decocms 4.572.0 → 4.573.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/dist/client/assets/{AlertCircle-kYtqXGU8.js → AlertCircle-Cn7aLqGD.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DDNkWSZu.js → AreaChart-CMeTgrZu.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B1m5qQi9.js → ArrowLeft-Clex4DU3.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DcYpepHk.js → ArrowUp-DPT2wlR7.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-BfCEFz3y.js → CartesianChart-B2gOTKNo.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-Bp-vLaQf.js → CategoricalChart-Djc5Q1Zp.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-B4NfGYxe.js → CheckCircle-l0BgBdex.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-EqyUOMMk.js → ChevronSelectorVertical-BbXlLdNT.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DRG0w_P4.js → ChevronUp-D0xD4CWi.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-BLl0RgXC.js → CreditCard01-CAgfpVLC.js} +1 -1
  11. package/dist/client/assets/{Globe04--FaZazgw.js → Globe04-DFwi3CoQ.js} +1 -1
  12. package/dist/client/assets/{Key01-D0Pq98hT.js → Key01-q3498IuC.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-C9GtmpYY.js → LinkBroken01-BkclpWPr.js} +1 -1
  14. package/dist/client/assets/{Minus-eGpg4-RN.js → Minus-D2H1757g.js} +1 -1
  15. package/dist/client/assets/{Monitor01-Su614Ctg.js → Monitor01-pdAw5Hpb.js} +1 -1
  16. package/dist/client/assets/{Play-D_ph4pZ0.js → Play-mj0Zbxy1.js} +1 -1
  17. package/dist/client/assets/{Plus-D8rFucQH.js → Plus-DD-WVS1P.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-BsZk9TgE.js → ReferenceLine-obrmbgU1.js} +1 -1
  19. package/dist/client/assets/{SearchMd-2MPq0KPN.js → SearchMd-D2GFNI7a.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-DDCYsqx9.js → ShoppingBag01-BQMf6OTu.js} +1 -1
  21. package/dist/client/assets/{Sun-Dvv08Urq.js → Sun-BWeGTNdA.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-D7HAXgYP.js → SwitchHorizontal01-amrllZXH.js} +1 -1
  23. package/dist/client/assets/{Tool01-BTDYOKsB.js → Tool01-CMaWHp8E.js} +1 -1
  24. package/dist/client/assets/{Tooltip-CPoCGNVz.js → Tooltip-DFEqzaZu.js} +1 -1
  25. package/dist/client/assets/{Trash01-CHCe7_6o.js → Trash01-CrG-kC_D.js} +1 -1
  26. package/dist/client/assets/{Upload01-Q6ECKQXp.js → Upload01-CyQARd6T.js} +1 -1
  27. package/dist/client/assets/{UserSquare-BJHrMhrM.js → UserSquare-CPjVW48L.js} +1 -1
  28. package/dist/client/assets/{Users01-DHfg9AEk.js → Users01-BPY3vewQ.js} +1 -1
  29. package/dist/client/assets/{XClose-BDiB_Nvo.js → XClose-BBI2UlVL.js} +1 -1
  30. package/dist/client/assets/{Zap-DpvU6Dp2.js → Zap-B1DyovfK.js} +1 -1
  31. package/dist/client/assets/{access-gate-BjRwuLrP.js → access-gate-ZWgi9qYj.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-Bh0vHlQ5.js → add-connection-dialog-BQNXbA5n.js} +1 -1
  33. package/dist/client/assets/agent-app-Bj3EYwlx.js +1 -0
  34. package/dist/client/assets/{agent-assets-BZWSLrfd.js → agent-assets-DI6qPyKd.js} +1 -1
  35. package/dist/client/assets/{agent-automation-C1Vdho1R.js → agent-automation-CU9zTpQA.js} +3 -3
  36. package/dist/client/assets/{agent-automations-BOxoQlGs.js → agent-automations---UAtRbI.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-CdFd9RbD.js → agent-calendar-cf-gDNxH.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-C80Nj8dH.js → agent-capabilities-C8QrjnQn.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-CEmlztKl.js → agent-connect-sources-DWV9WSKP.js} +1 -1
  40. package/dist/client/assets/agent-deck-D0lCoowF.js +1 -0
  41. package/dist/client/assets/{agent-e2e-CFF1rulz.js → agent-e2e-BOiuADaK.js} +1 -1
  42. package/dist/client/assets/agent-experiments-BMv9LCIg.js +1 -0
  43. package/dist/client/assets/{agent-file-Cq3onOpE.js → agent-file-CNp-H5vm.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-vCUxyXYf.js → agent-hosting-C-EBAKmR.js} +1 -1
  45. package/dist/client/assets/{agent-icon-DqjTL3cE.js → agent-icon-2MzErGc_.js} +1 -1
  46. package/dist/client/assets/agent-library-file-Agr0p3aP.js +1 -0
  47. package/dist/client/assets/agent-library-slTipnE2.js +1 -0
  48. package/dist/client/assets/agent-overview-BS9_YnvP.js +1 -0
  49. package/dist/client/assets/{agent-releases-aYJGzx-T.js → agent-releases-KTwDvjK6.js} +1 -1
  50. package/dist/client/assets/agent-settings-DrVJjCl1.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-gGRvmvu9.js → agent-site-editor-BpKx1qkb.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-1vmtmGbS.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-DLlGzEUS.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-Qe8DbwSs.js +1 -0
  55. package/dist/client/assets/agent-view-B8yeRN99.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-Bppi7Mra.js → agent-view-guard-4G3ZLLJ6.js} +1 -1
  57. package/dist/client/assets/{ai-providers-JXuyHqZ0.js → ai-providers-uRKTNSKv.js} +1 -1
  58. package/dist/client/assets/{alert-Cddl0pAs.js → alert-DEZDXwhI.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-DFGgGKah.js → analytics-sections-CyCVHqsU.js} +1 -1
  60. package/dist/client/assets/api-keys-CqXC8hcJ.js +1 -0
  61. package/dist/client/assets/{api-keys-CyRPnxt1.js → api-keys-DpXs9tft.js} +1 -1
  62. package/dist/client/assets/{app-editor-XjHMyWR2.js → app-editor-BaI-amod.js} +1 -1
  63. package/dist/client/assets/{asset-utils-Cekn7DV3.js → asset-utils-CksrawxC.js} +1 -1
  64. package/dist/client/assets/{auth-qAWEiaXq.js → auth-Zsy5lyIS.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-BEu29rgq.js → auth-catchall-BA7Y2mUQ.js} +1 -1
  66. package/dist/client/assets/{auth-entry-C-rkFm2s.js → auth-entry-DTgpDRCa.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-E78PPbPV.js → auth-split-layout-DnneloZ-.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-D7iMHNSW.js → authenticate-and-persist-oauth-DNTXHLOn.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-guzwZg5A.js → automation-list-row-DBYEb7yh.js} +1 -1
  70. package/dist/client/assets/{automation-runs-BHP_sOU-.js → automation-runs-WkjLeJLn.js} +1 -1
  71. package/dist/client/assets/{automations-BgweD4e5.js → automations-DQbfRFSm.js} +1 -1
  72. package/dist/client/assets/{autosend-_WPHuuuS.js → autosend-C5Y0g7p2.js} +1 -1
  73. package/dist/client/assets/{badge-DtxRsHGH.js → badge-CR0zmQ24.js} +1 -1
  74. package/dist/client/assets/{block-document-CT7wSVO4.js → block-document-C3eGsk46.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-BoHWp5NJ.js → blocks-preview-workspace-context-BSZxdExq.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-2A_KUVRA.js → blocks-tab-states-WlRP2osS.js} +1 -1
  77. package/dist/client/assets/{blog-schema-DyhIMTKN.js → blog-schema-KDZONLbr.js} +1 -1
  78. package/dist/client/assets/{buckets-B6SQeYKj.js → buckets-BleX9NUY.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc--GJGk9lj.js → build-improve-prompt-doc-BoBB4xB3.js} +1 -1
  80. package/dist/client/assets/{calendar-gF784tOB.js → calendar-BK-qPKHr.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-gokttFVD.js → capability-load-error-C9JRNP4k.js} +1 -1
  82. package/dist/client/assets/{category-editor-DH5eEcV-.js → category-editor-CcG8-9VQ.js} +1 -1
  83. package/dist/client/assets/{chart-2s7SvZtT.js → chart-C9hiF3-H.js} +1 -1
  84. package/dist/client/assets/{chat-context-aSjAR9mm.js → chat-context-DyGpAf46.js} +1 -1
  85. package/dist/client/assets/{chat-draft-C4Ql1o7U.js → chat-draft-CD_ST5_c.js} +1 -1
  86. package/dist/client/assets/{checkbox-CBfkrmis.js → checkbox-HvlgUNAP.js} +1 -1
  87. package/dist/client/assets/{choose-editor-DOrF20ax.js → choose-editor-CnjAnqj_.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-B188GHrd.js → cli-auth-success-Bwy0nso2.js} +1 -1
  89. package/dist/client/assets/{client-icons-CGEm3mRa.js → client-icons-Be9kjZ93.js} +1 -1
  90. package/dist/client/assets/{cms-settings-editor-CLowE0HB.js → cms-settings-editor-BrJarYyE.js} +1 -1
  91. package/dist/client/assets/{cms-store-drafts-CSMnfrKb.js → cms-store-drafts-BISchbEr.js} +1 -1
  92. package/dist/client/assets/{collapsible-C6tkGF0M.js → collapsible-f_iRDMCl.js} +1 -1
  93. package/dist/client/assets/{collection-detail-EKABwIVL.js → collection-detail-C3I3Gpfg.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-CiexA8e6.js → collection-display-button-ES-6OdCv.js} +1 -1
  95. package/dist/client/assets/{collection-search-iHJVqUHB.js → collection-search-EpeR-DRK.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-Dw3f1ge7.js → collection-table-wrapper-KbLz2yHx.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-Trcf-II9.js → collection-tabs-B_be-L9Y.js} +1 -1
  98. package/dist/client/assets/{combobox-DqTAA7CX.js → combobox-B18VgXI1.js} +1 -1
  99. package/dist/client/assets/{command-CtR4gjCr.js → command-BNUAVYAm.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-CMxxXZB8.js → companion-mcps-section-CxXAX0y8.js} +1 -1
  101. package/dist/client/assets/{config-BpJVAl-p.js → config-TryZ4RX0.js} +1 -1
  102. package/dist/client/assets/{connect-DjUzAPce.js → connect-CoilE_s4.js} +1 -1
  103. package/dist/client/assets/{connect-layout-atO8SWTe.js → connect-layout-BhfEVfq1.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-CpTTYi_l.js → connect-source-dialog-DPKdRpQi.js} +1 -1
  105. package/dist/client/assets/{connection-CZHWvxVM.js → connection-8A6_dw75.js} +1 -1
  106. package/dist/client/assets/{connection-card-Dt4OQ0Zk.js → connection-card-CNcOtDo-.js} +1 -1
  107. package/dist/client/assets/{connection-detail-weWLbsDk.js → connection-detail-DxRuUlKe.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-KX0UMFtC.js → connection-form-helpers-UVT13B_U.js} +1 -1
  109. package/dist/client/assets/{connection-slug-BQwcAWfG.js → connection-slug-C2s7RBeT.js} +1 -1
  110. package/dist/client/assets/{connections-i22Te-Si.js → connections-tE6aWKQG.js} +1 -1
  111. package/dist/client/assets/{content-tab-CxWiT9yK.js → content-tab-qUSnNt0b.js} +3 -3
  112. package/dist/client/assets/{context-BHoetvxj.js → context-5V6pbdZV.js} +1 -1
  113. package/dist/client/assets/{context-menu-CmlGLO8r.js → context-menu-DtOAkxnl.js} +1 -1
  114. package/dist/client/assets/{context-shell-PkAxZmyt.js → context-shell-ClsbZC3c.js} +3 -3
  115. package/dist/client/assets/{core.esm-DkzVh4mV.js → core.esm-rLLWAwJX.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-_VIsUUpV.js → create-organization-dialog-BX56eATK.js} +1 -1
  117. package/dist/client/assets/{device-hint-CdtW8Ayx.js → device-hint-CUm6BAQf.js} +1 -1
  118. package/dist/client/assets/{discover-DylE9QvC.js → discover-C3KntGhQ.js} +1 -1
  119. package/dist/client/assets/{domain-settings-BuPEVvED.js → domain-settings-CKu_dJSz.js} +1 -1
  120. package/dist/client/assets/{drawer-ChCkx76W.js → drawer-Cn25WPda.js} +1 -1
  121. package/dist/client/assets/{editor-BKO3Ouyu.js → editor-D2cdCxzq.js} +1 -1
  122. package/dist/client/assets/{editor-classes-BNXGx3Ep.js → editor-classes-fUC3onT7.js} +1 -1
  123. package/dist/client/assets/{empty-state-DiGOrU7G.js → empty-state-BBHWcru0.js} +1 -1
  124. package/dist/client/assets/{empty-state-ajQCApN0.js → empty-state-Ced795Fu.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-BUQKBcCh.js → experiments-tab-choice-BTxa6G1X.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-CTb_9Cpr.js → extract-connection-data-DPARA3fa.js} +1 -1
  127. package/dist/client/assets/{feature-gate-DReJia4Z.js → feature-gate-DmEXSzsv.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-DbaCusI2.js → feature-paywall-CnmlocfU.js} +1 -1
  129. package/dist/client/assets/feedback-BqoIMOg7.js +1 -0
  130. package/dist/client/assets/{file-explorer-CgN8XtEL.js → file-explorer-BQ3nHrzo.js} +2 -2
  131. package/dist/client/assets/{file-preview-CO8Jx_5T.js → file-preview-DDtKFulA.js} +1 -1
  132. package/dist/client/assets/{file-share-button-B1R4GS_L.js → file-share-button-z-0u2RSG.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-Bo3Nsgdh.js → file-type-icon-DKzfESDS.js} +1 -1
  134. package/dist/client/assets/{folder-icon-DHVgg162.js → folder-icon-D5X4rDtM.js} +1 -1
  135. package/dist/client/assets/{form-BhXakrt_.js → form-DlOI0nvB.js} +1 -1
  136. package/dist/client/assets/{general-BvxlAOrY.js → general-BaTc6G8G.js} +1 -1
  137. package/dist/client/assets/{github-icon-BBNizm_E.js → github-icon-Fl1CK57w.js} +1 -1
  138. package/dist/client/assets/{home-CppOBOPg.js → home-_5AX_rte.js} +1 -1
  139. package/dist/client/assets/{home-overview-6RI8kIqs.js → home-overview-BFMTQOYy.js} +1 -1
  140. package/dist/client/assets/{hosted-reconcile-C9_-UERm.js → hosted-reconcile-DlXpLWPa.js} +1 -1
  141. package/dist/client/assets/{icon-button-muPqJd-h.js → icon-button-igm3gACH.js} +1 -1
  142. package/dist/client/assets/{index-CcqLnTyv.js → index-B0M6fld0.js} +5 -5
  143. package/dist/client/assets/{index-Bcy7_FA1.js → index-B9BVHbVj.js} +1 -1
  144. package/dist/client/assets/{index-n9xCS6Sf.js → index-BK7RpYPl.js} +1 -1
  145. package/dist/client/assets/{index-BRwiTdyd.js → index-BiDkG-fY.js} +1 -1
  146. package/dist/client/assets/{index-D146teOp.js → index-BjDHxKQ1.js} +1 -1
  147. package/dist/client/assets/{index-8ANyj4B7.js → index-BqYmVY5c.js} +1 -1
  148. package/dist/client/assets/{index-878qqrH2.js → index-BvIbbFRO.js} +1 -1
  149. package/dist/client/assets/{index-B6_lV1vO.js → index-BvVW5l1B.js} +1 -1
  150. package/dist/client/assets/{index-DhM4mrtt.js → index-CZHAvvQX.js} +1 -1
  151. package/dist/client/assets/{index-GYpV5EH9.js → index-D13d0Rz8.js} +1 -1
  152. package/dist/client/assets/{index-TupjNSVk.js → index-DWwfYL9X.js} +1 -1
  153. package/dist/client/assets/{index-CKEKSTrk.css → index-K-NS4tm_.css} +1 -1
  154. package/dist/client/assets/index-RvC7A_Zr.js +1 -0
  155. package/dist/client/assets/{index-QDvBZCSy.js → index-bp35vkxQ.js} +1 -1
  156. package/dist/client/assets/{index-2LwpmkET.js → index-cB2W9GP1.js} +1 -1
  157. package/dist/client/assets/{index-BlAiq0AL.js → index-qF2eIicz.js} +1 -1
  158. package/dist/client/assets/{index-redirect-BUCPvmVN.js → index-redirect-Y2-2LqtJ.js} +1 -1
  159. package/dist/client/assets/{index-DCh3kkGn.js → index-woHs2Bei.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-uDA4YvYL.js → infiniteQueryObserver-CQdhIsL1.js} +1 -1
  161. package/dist/client/assets/{infra-billing-Bql8vBuZ.js → infra-billing-D0aBn-2W.js} +1 -1
  162. package/dist/client/assets/{input-BDAmWj4c.js → input-DPyEB9OP.js} +3 -3
  163. package/dist/client/assets/{input-COtL628i.js → input-WEG44w8N.js} +1 -1
  164. package/dist/client/assets/{integration-icon-ChQEBlMz.js → integration-icon-CbGo7Hoi.js} +1 -1
  165. package/dist/client/assets/{jira-icon-CJhoZQuc.js → jira-icon-C8Fhxneh.js} +1 -1
  166. package/dist/client/assets/{label-CsfAEF08.js → label-C2-_lSSQ.js} +1 -1
  167. package/dist/client/assets/{layout-B-LTaCR7.js → layout-B7jJw3TW.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-B3LnX3dE.js → legacy-agents-deep-ZncRE9wV.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-KlovZkVM.js → legacy-main-redirect-BU-BNhBf.js} +1 -1
  170. package/dist/client/assets/library-2jjA6huk.js +1 -0
  171. package/dist/client/assets/{library-tab-DdqY20-1.js → library-tab-KFeYjSPq.js} +1 -1
  172. package/dist/client/assets/{login-DRAz2Byx.js → login-CYw53vfL.js} +1 -1
  173. package/dist/client/assets/{markdown-CPuTm6Mv.js → markdown-CBPGMAeL.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-Cigj7X9N.js → mcp-app-renderer-Ct_65kSq.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-ChfuZkYU.js → mcp-oauth-BRzA5Pv_.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-BU_Qloaj.js → mcp-oauth-BzDrrJmr.js} +1 -1
  177. package/dist/client/assets/{members-BDBxWp17.js → members-DmQ1d6J9.js} +1 -1
  178. package/dist/client/assets/{memory-B9jEAxkU.js → memory-veer-4dg.js} +1 -1
  179. package/dist/client/assets/mock-board-CKa4hpGl.js +10 -0
  180. package/dist/client/assets/{monaco-editor-XS1Vx7aB.js → monaco-editor-CpFV1RfN.js} +1 -1
  181. package/dist/client/assets/{monitoring-B3WSTrVO.js → monitoring-CBecEU71.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-CuWemrnJ.js → monitoring-stats-row-Dn8Q55tj.js} +1 -1
  183. package/dist/client/assets/{multi-select-C2R3RZPE.js → multi-select-CrGD5Ooc.js} +1 -1
  184. package/dist/client/assets/{mustache-ByRkTjky.js → mustache-CfZeeK0-.js} +1 -1
  185. package/dist/client/assets/{named-rule-view-D9J5jfxv.js → named-rule-view-DCoLjOb_.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-C_1Rs0SG.js → new-project-dialog-xaa497EH.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-Du4CoqhX.js → oauth-callback-BZYuOZDS.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-CGOatJwS.js → oauth-callback-ai-provider-ht2kAjnJ.js} +1 -1
  189. package/dist/client/assets/{oauth-consent-DP5dM3Bl.js → oauth-consent-Cycay5jx.js} +1 -1
  190. package/dist/client/assets/{onboarding-CNJgq5g8.js → onboarding-CW6ecLdB.js} +1 -1
  191. package/dist/client/assets/{openai-conversation-RmvHRGWP.js → openai-conversation-BIBsPprq.js} +1 -1
  192. package/dist/client/assets/{optimistic-project-sidebar-views-BF6tqK9w.js → optimistic-project-sidebar-views-ClxmmxQQ.js} +1 -1
  193. package/dist/client/assets/{order-monitor-day-Cs26_K8M.js → order-monitor-day-ujguBEEi.js} +1 -1
  194. package/dist/client/assets/{organization-choice-Bntbf3d6.js → organization-choice-Dmg8UAst.js} +1 -1
  195. package/dist/client/assets/{orgs-CGfTnYKc.js → orgs-DwXxjD5w.js} +1 -1
  196. package/dist/client/assets/{own-accounts-section-Dv_Ox_cI.js → own-accounts-section-B1_zf8oO.js} +1 -1
  197. package/dist/client/assets/{pair-h0916MQd.js → pair-CYQ33Koe.js} +1 -1
  198. package/dist/client/assets/{parse-sections-BhaTg9vA.js → parse-sections-D19DrjFN.js} +3 -3
  199. package/dist/client/assets/{plan-GL1imSbx.js → plan-C3-HdCti.js} +1 -1
  200. package/dist/client/assets/{plan-ladder-BLc0_1i8.js → plan-ladder-DMGBEO8S.js} +1 -1
  201. package/dist/client/assets/{plan-usage-card-DWVVT2WQ.js → plan-usage-card-Dh5aZ9Wu.js} +1 -1
  202. package/dist/client/assets/{popover-BQnTqyWU.js → popover-CQC-Pea_.js} +1 -1
  203. package/dist/client/assets/{post-calendar-HNq1Smaq.js → post-calendar-DyAhp07d.js} +1 -1
  204. package/dist/client/assets/{post-editor-B1Q3Pcgn.js → post-editor-Bi0Lvuv1.js} +1 -1
  205. package/dist/client/assets/{preview-content-DHz0okBk.js → preview-content-DmNC5FDZ.js} +1 -1
  206. package/dist/client/assets/{preview-dialog-geLovY3F.js → preview-dialog-BXuQsxvP.js} +1 -1
  207. package/dist/client/assets/{preview-panel-5qTld6rM.js → preview-panel-BvPhN_GC.js} +1 -1
  208. package/dist/client/assets/{preview-tab-DTmM7FWc.js → preview-tab-kdq5fsPz.js} +3 -3
  209. package/dist/client/assets/{product-picker-dialog-CkKwZuBF.js → product-picker-dialog-BMl-NFfE.js} +1 -1
  210. package/dist/client/assets/{profile-DDg9c8sx.js → profile-CHLa-N2x.js} +1 -1
  211. package/dist/client/assets/{project-app-view-BTrJDLFt.js → project-app-view--F2yE3h6.js} +1 -1
  212. package/dist/client/assets/{project-apps-sFKq8oaX.js → project-apps-DLoX3eK_.js} +1 -1
  213. package/dist/client/assets/{project-icon-BlOLnUr2.js → project-icon-BFEgPANo.js} +1 -1
  214. package/dist/client/assets/{project-index-C12cl71J.js → project-index-Bt04pJyj.js} +1 -1
  215. package/dist/client/assets/project-reports-CQX2n1pZ.js +1 -0
  216. package/dist/client/assets/project-tasks-BxS2RWnj.js +1 -0
  217. package/dist/client/assets/{projects-APtBmhWY.js → projects-DBgcy_ko.js} +1 -1
  218. package/dist/client/assets/{projects-empty-state-B_-RYmNY.js → projects-empty-state-DSl1yjrE.js} +1 -1
  219. package/dist/client/assets/{prompts-rGT4H9HS.js → prompts-DLHllT_u.js} +1 -1
  220. package/dist/client/assets/record-editor-DSuyBQvO.js +1 -0
  221. package/dist/client/assets/{redirect-editor-CMuoDESV.js → redirect-editor-Dg4EE9RJ.js} +1 -1
  222. package/dist/client/assets/{reports-B5SaRV3H.js → reports-BLJvZSDk.js} +1 -1
  223. package/dist/client/assets/reports-DfhDFmgz.js +1 -0
  224. package/dist/client/assets/{reports-onboarding-C3O3uPM5.js → reports-onboarding-B_ps3py4.js} +1 -1
  225. package/dist/client/assets/{reports-tab-BU0ZPXc5.js → reports-tab-NBJtBy1O.js} +2 -2
  226. package/dist/client/assets/{repositories-EzK0gp8T.js → repositories-Bvm6e85d.js} +1 -1
  227. package/dist/client/assets/repositories-Cdm1E3kt.js +1 -0
  228. package/dist/client/assets/{repository-binding-CuR-5wbj.js → repository-binding-D5Bfxppj.js} +1 -1
  229. package/dist/client/assets/{repository-picker-DEa_L5X-.js → repository-picker-BG4RNPTd.js} +1 -1
  230. package/dist/client/assets/{require-capability-s4T8ky9G.js → require-capability-DRWZ_9vY.js} +1 -1
  231. package/dist/client/assets/{required-auth-layout-BnfTNype.js → required-auth-layout-BDLyo6_T.js} +1 -1
  232. package/dist/client/assets/{reset-password-DyQQJ8dn.js → reset-password-DaveZxAM.js} +1 -1
  233. package/dist/client/assets/{resizable-G0IV9sBv.js → resizable-ZTEIsDw7.js} +1 -1
  234. package/dist/client/assets/resolve-tab-icon-bd7hcPCn.js +1 -0
  235. package/dist/client/assets/{review-settings-CuOWj38_.js → review-settings-DWBDMXEy.js} +1 -1
  236. package/dist/client/assets/{role-color-DsX-V5ks.js → role-color-BoSKmMc3.js} +1 -1
  237. package/dist/client/assets/{roles-Dx9qwbnQ.js → roles-ll9CMZdV.js} +1 -1
  238. package/dist/client/assets/route-CARtHArs.js +1 -0
  239. package/dist/client/assets/route-CE2T-4lr.js +1 -0
  240. package/dist/client/assets/{route-BhRhH95H.js → route-apqFkN8H.js} +1 -1
  241. package/dist/client/assets/{sandbox-lifecycle-context-BbXRjeM5.js → sandbox-lifecycle-context--ksv8XqS.js} +1 -1
  242. package/dist/client/assets/{schema-DyZV-W0g.js → schema-BObR_fJ_.js} +1 -1
  243. package/dist/client/assets/{schema-D4ZSsKIV.js → schema-DDAhL9Cr.js} +1 -1
  244. package/dist/client/assets/{scroll-area-Dc2A2LkE.js → scroll-area-CYr4aRZr.js} +1 -1
  245. package/dist/client/assets/{search-input-DFXG_UYw.js → search-input-CEHMJvIu.js} +1 -1
  246. package/dist/client/assets/{search-toggle-B9QbSQeA.js → search-toggle-OJssd2AY.js} +1 -1
  247. package/dist/client/assets/{secret-picker-DmxIms9y.js → secret-picker-wjLxUG7e.js} +1 -1
  248. package/dist/client/assets/{secrets-AGU75gav.js → secrets-BYPmdyMN.js} +1 -1
  249. package/dist/client/assets/{section-array-field-ClWKGp_4.js → section-array-field-DZEuNEZT.js} +1 -1
  250. package/dist/client/assets/{sections-BVT_1GZf.js → sections-BDGuApqp.js} +1 -1
  251. package/dist/client/assets/{sections-editor-CYlxI1p5.js → sections-editor-w8bIFtKt.js} +1 -1
  252. package/dist/client/assets/{select-model-DrY_3vXN.js → select-model-JxuGnGfN.js} +1 -1
  253. package/dist/client/assets/{select-DQqbq83t.js → select-taudESnf.js} +1 -1
  254. package/dist/client/assets/{seo-editor-BlBhyBAl.js → seo-editor-D7qUpqtC.js} +1 -1
  255. package/dist/client/assets/{separator-C0H8Yj6d.js → separator-rYurNu9w.js} +1 -1
  256. package/dist/client/assets/settings-tab-BjoW2SLa.js +1 -0
  257. package/dist/client/assets/{sheet-B2jsXlHJ.js → sheet-C5Vpqn4B.js} +1 -1
  258. package/dist/client/assets/{shell-layout-CBX9BtMX.js → shell-layout-B_Je98M9.js} +1 -1
  259. package/dist/client/assets/{site-draft-actions-CD85gRfI.js → site-draft-actions-I-a6sWGq.js} +3 -3
  260. package/dist/client/assets/{site-draft-view-D0hJTk9N.js → site-draft-view-B9eorarP.js} +1 -1
  261. package/dist/client/assets/site-editor-A0UTz4FO.js +1 -0
  262. package/dist/client/assets/{site-editor-toast-CIOA7Zq3.js → site-editor-toast-BkfBkyel.js} +1 -1
  263. package/dist/client/assets/{skills-XkOrIlnS.js → skills-DFP73eqq.js} +1 -1
  264. package/dist/client/assets/{slider-84yNNCUP.js → slider-Va2dwWaV.js} +1 -1
  265. package/dist/client/assets/{sortable.esm-BHALCXRV.js → sortable.esm-BmFrP3rv.js} +1 -1
  266. package/dist/client/assets/{sso-6pnL0iJa.js → sso-BZP02FnS.js} +1 -1
  267. package/dist/client/assets/{suggestion-C3enCUG8.js → suggestion-CJnvcEOz.js} +1 -1
  268. package/dist/client/assets/super-agent-icon-BpFks7bc.js +1 -0
  269. package/dist/client/assets/{switch-2cMTOO8e.js → switch-NBzUnGw4.js} +1 -1
  270. package/dist/client/assets/{synced-repos-bmkfQV3e.js → synced-repos-x20dApIj.js} +1 -1
  271. package/dist/client/assets/{tab-icon-glyph-lzQzl_Ov.js → tab-icon-glyph-De_GoXbo.js} +1 -1
  272. package/dist/client/assets/{table-DvZCTg5z.js → table-B6HdX-5W.js} +1 -1
  273. package/dist/client/assets/{tabs-BzwzpfZ1.js → tabs-B9Fkm8UP.js} +1 -1
  274. package/dist/client/assets/{task-board-DcTNURQy.js → task-board-r7mBQBfA.js} +1 -1
  275. package/dist/client/assets/{task-route-DfbZq1yE.js → task-route-DzXY9dAT.js} +1 -1
  276. package/dist/client/assets/{task-status-CxLWWnTs.js → task-status-nf4sWabv.js} +1 -1
  277. package/dist/client/assets/{taskboard-analytics-Cmr5hCm9.js → taskboard-analytics-sh1MutiR.js} +1 -1
  278. package/dist/client/assets/tasks-CDaME30v.js +1 -0
  279. package/dist/client/assets/{tasks-CzV2b6I-.js → tasks-DiiwePJH.js} +1 -1
  280. package/dist/client/assets/{textarea-CpPhDLVU.js → textarea-8xMov02r.js} +1 -1
  281. package/dist/client/assets/{thread-analytics-9huoP8m_.js → thread-analytics-CI4Ww-tz.js} +1 -1
  282. package/dist/client/assets/{thread-intent-pegObLq9.js → thread-intent-B-lUepd6.js} +1 -1
  283. package/dist/client/assets/{thread-route-DORnlP1l.js → thread-route-BHZi-1Lx.js} +1 -1
  284. package/dist/client/assets/{thread-route-D5E5K-lU.js → thread-route-CidpLna8.js} +1 -1
  285. package/dist/client/assets/{thread-sheet-body-BFBUt-Sx.js → thread-sheet-body-CJ90Ecr4.js} +1 -1
  286. package/dist/client/assets/{time-range-picker-CO070soZ.js → time-range-picker-Bf3LTcPm.js} +1 -1
  287. package/dist/client/assets/{toggle-group-D9bXIbAb.js → toggle-group-GmYScomU.js} +1 -1
  288. package/dist/client/assets/{tool-namespace-BQSaNq7N.js → tool-namespace-BMJphfly.js} +1 -1
  289. package/dist/client/assets/{tool-set-selector-DM-ejAZy.js → tool-set-selector-ORY0JK_a.js} +1 -1
  290. package/dist/client/assets/{toolbar-icon-button-CTRAa2ng.js → toolbar-icon-button-DLb2L87M.js} +1 -1
  291. package/dist/client/assets/{tooltip-AKf-E49i.js → tooltip-DUgZeaAs.js} +1 -1
  292. package/dist/client/assets/{tooltipContext-C6xZbBgY.js → tooltipContext-DhhamGUz.js} +1 -1
  293. package/dist/client/assets/{track-ClB7tKVt.js → track-CDDSJk6a.js} +1 -1
  294. package/dist/client/assets/{types-BQOtvCBo.js → types-D5f5_4KC.js} +1 -1
  295. package/dist/client/assets/{url-slug-ihGFL5bo.js → url-slug-BgFXpKTa.js} +1 -1
  296. package/dist/client/assets/{usage-stats-CVX23WNU.js → usage-stats-Db2409wH.js} +1 -1
  297. package/dist/client/assets/{use-ai-providers-BrqJh5BT.js → use-ai-providers-CegsSqNf.js} +1 -1
  298. package/dist/client/assets/{use-apply-named-rule-BVdRelp-.js → use-apply-named-rule-CoAQZSng.js} +1 -1
  299. package/dist/client/assets/use-ask-in-chat-D8s6kqgy.js +1 -0
  300. package/dist/client/assets/{use-automations-B64sqUmg.js → use-automations-IINULJEn.js} +1 -1
  301. package/dist/client/assets/{use-autosave-CXs3BFTf.js → use-autosave-B28tAi82.js} +1 -1
  302. package/dist/client/assets/use-blocks-v8-project-390kM-ss.js +1 -0
  303. package/dist/client/assets/{use-chat-layout-state-Be9vIJ9A.js → use-chat-layout-state-SKM2dTYC.js} +1 -1
  304. package/dist/client/assets/{use-cms-publish-actions-_yzMD1wJ.js → use-cms-publish-actions-D7FBZjX-.js} +1 -1
  305. package/dist/client/assets/{use-connect-companion-CB7F6AWc.js → use-connect-companion-aYlKXW1g.js} +1 -1
  306. package/dist/client/assets/{use-connection-CECJF8rf.js → use-connection-BLq1Zghk.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-D6gXnizV.js → use-content-sync-Wt7A-cqi.js} +1 -1
  308. package/dist/client/assets/{use-copy-CtSedmtg.js → use-copy-jRaPRTwC.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-DQTvoMF-.js → use-date-fns-locale-C5zF4lje.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-BLJ3k7wG.js → use-debounced-autosave-DI_mWee1.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-CcMMD4Qy.js → use-debounced-value-Df5Y0bKp.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-C6qbWrOQ.js → use-deco-credits-IyUHS95H.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-Dc1L96mp.js → use-decopilot-events-CVaB2Rhy.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-Cw1Qu4uu.js → use-delete-connection-DrZnUntQ.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-D9sSgOb1.js → use-deployment-admin-CoSxtFqU.js} +1 -1
  316. package/dist/client/assets/{use-entitlements-BKF4jYfc.js → use-entitlements-n2MsZM9p.js} +1 -1
  317. package/dist/client/assets/{use-fast-preview-draft-url-TUtYOptx.js → use-fast-preview-draft-url-otug38hg.js} +1 -1
  318. package/dist/client/assets/{use-file-configs-D7-mFpqA.js → use-file-configs-BvpMQAvp.js} +1 -1
  319. package/dist/client/assets/{use-id-selection-JEuFRU8t.js → use-id-selection-DlXip3K9.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-RrCfNvIm.js → use-inbox-feed-CVBam4xO.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-Z_9MLZyx.js → use-infinite-scroll-qE2UPD2B.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-CANHKzNj.js → use-join-requests-Dmu4TFw2.js} +1 -1
  323. package/dist/client/assets/{use-main-panel-tabs-DA6Ypr8r.js → use-main-panel-tabs-CmG1gXaL.js} +1 -1
  324. package/dist/client/assets/{use-mcp-auth-status-CMC6AisX.js → use-mcp-auth-status-CdzqA_1C.js} +1 -1
  325. package/dist/client/assets/{use-mcp-client-DvDomB9A.js → use-mcp-client-C8sFqQYs.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-CgDM8qHG.js → use-mcp-prompts-KGxEzqRw.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-mI5K7YKF.js → use-mcp-tools-DMaf2rKI.js} +1 -1
  328. package/dist/client/assets/{use-mobile-BgN1E82d.js → use-mobile-JxzmRS3O.js} +1 -1
  329. package/dist/client/assets/{use-move-blocks-CPMJkp5h.js → use-move-blocks-B66Z69SN.js} +1 -1
  330. package/dist/client/assets/{use-navigate-to-agent-DmfSMV3R.js → use-navigate-to-agent-BPUG-DwT.js} +1 -1
  331. package/dist/client/assets/{use-org-fs-BWA2rFQC.js → use-org-fs-BTZCBdxy.js} +1 -1
  332. package/dist/client/assets/{use-org-repo-syncs-CTHMawzN.js → use-org-repo-syncs-CBRIaGB1.js} +1 -1
  333. package/dist/client/assets/{use-org-sso-CGB_T6WF.js → use-org-sso-CxdxMmbI.js} +1 -1
  334. package/dist/client/assets/{use-organization-settings-sxurgilE.js → use-organization-settings-DgPYo7py.js} +1 -1
  335. package/dist/client/assets/{use-project-native-view-presence-CwgTlxOv.js → use-project-native-view-presence-DltS_Jdi.js} +1 -1
  336. package/dist/client/assets/{use-project-scope-Cb4T7-Pe.js → use-project-scope-BLJIcw6l.js} +1 -1
  337. package/dist/client/assets/{use-recent-apps-DD97o_H1.js → use-recent-apps-DCrhrE1r.js} +1 -1
  338. package/dist/client/assets/{use-reports-diagnostic-BA9L8p6c.js → use-reports-diagnostic-BMotCZC_.js} +1 -1
  339. package/dist/client/assets/{use-sandbox-events-CdAdPYjL.js → use-sandbox-events-CPma0JnN.js} +1 -1
  340. package/dist/client/assets/{use-secrets-rjK8WMv5.js → use-secrets-U7VdTPCn.js} +1 -1
  341. package/dist/client/assets/{use-section-preview-base-DcuAqWGB.js → use-section-preview-base-CVV-8YE0.js} +1 -1
  342. package/dist/client/assets/{use-sidebar-collapsed-B34u6RwD.js → use-sidebar-collapsed-D8frxAVL.js} +1 -1
  343. package/dist/client/assets/{use-tags-0YxcWwJI.js → use-tags-zNsAvyT2.js} +1 -1
  344. package/dist/client/assets/{use-task-board-analytics-tpDvOzAs.js → use-task-board-analytics-CE11Vums.js} +1 -1
  345. package/dist/client/assets/{use-task-board-events-CGZxY00s.js → use-task-board-events-WJfNx3Vw.js} +1 -1
  346. package/dist/client/assets/{use-task-board-item-prs-B6YW8nsa.js → use-task-board-item-prs-BkBj5QMy.js} +1 -1
  347. package/dist/client/assets/{use-task-board-items-BcL-6L6N.js → use-task-board-items-CmUbMz1G.js} +1 -1
  348. package/dist/client/assets/{use-task-board-prompts-B9dDmO_e.js → use-task-board-prompts-Dsyp8Uoc.js} +1 -1
  349. package/dist/client/assets/{use-task-metadata-hgLXNv36.js → use-task-metadata-DRP-RY0l.js} +1 -1
  350. package/dist/client/assets/{use-thread-outputs-X5IsW797.js → use-thread-outputs-BOXdgR_A.js} +1 -1
  351. package/dist/client/assets/{use-voice-input-DmZaOhTZ.js → use-voice-input-CQSYzFMw.js} +1 -1
  352. package/dist/client/assets/useInfiniteQuery-CrPhADUx.js +1 -0
  353. package/dist/client/assets/{useQueries-BbhbAWNG.js → useQueries-BpjN820-.js} +1 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-B5oEM_Vd.js +1 -0
  355. package/dist/client/assets/{users-BNwLmtY6.js → users-DgPmfgcj.js} +1 -1
  356. package/dist/client/assets/{utils-KeMhVvdQ.js → utils-DwY9C3Mj.js} +1 -1
  357. package/dist/client/assets/{variant-calendar-VCJbhkWd.js → variant-calendar-ByGN-Vpc.js} +1 -1
  358. package/dist/client/assets/{variant-matcher-override-DLQRivi9.js → variant-matcher-override-CzeUMJ70.js} +1 -1
  359. package/dist/client/assets/{view-header-cnfShdRT.js → view-header-JSqDfdkj.js} +1 -1
  360. package/dist/client/assets/{virtual-mcp-YmAa-VVd.js → virtual-mcp-CVLIL1Oq.js} +1 -1
  361. package/dist/client/assets/{watch-sse-pool-CYcZM1HP.js → watch-sse-pool-CwQVaju9.js} +1 -1
  362. package/dist/client/index.html +2 -2
  363. package/dist/server/server.js +528 -528
  364. package/package.json +1 -1
  365. package/dist/client/assets/agent-app-IWHPMxEK.js +0 -1
  366. package/dist/client/assets/agent-deck-CtBABaGT.js +0 -1
  367. package/dist/client/assets/agent-experiments-ui7FfvYG.js +0 -1
  368. package/dist/client/assets/agent-library-CrZB4N_E.js +0 -1
  369. package/dist/client/assets/agent-library-file-BOxLy0sn.js +0 -1
  370. package/dist/client/assets/agent-overview-BcgCBEmB.js +0 -1
  371. package/dist/client/assets/agent-settings-CxJPBxUl.js +0 -1
  372. package/dist/client/assets/agent-site-editor-code-CLO4vASe.js +0 -2
  373. package/dist/client/assets/agent-site-editor-content-DwQjPdJR.js +0 -1
  374. package/dist/client/assets/agent-site-editor-preview-DVAXUJER.js +0 -1
  375. package/dist/client/assets/agent-view-BWBpZVUF.js +0 -1
  376. package/dist/client/assets/api-keys-G9chtY31.js +0 -1
  377. package/dist/client/assets/feedback-CVUSSdB5.js +0 -1
  378. package/dist/client/assets/index-A822oipr.js +0 -1
  379. package/dist/client/assets/library-B2C1_FfB.js +0 -1
  380. package/dist/client/assets/mock-board-Bsls4MQk.js +0 -10
  381. package/dist/client/assets/project-reports-AxUmLNIH.js +0 -1
  382. package/dist/client/assets/project-tasks-CAr2Cqy5.js +0 -1
  383. package/dist/client/assets/record-editor-Ci0iG6uP.js +0 -1
  384. package/dist/client/assets/reports-D-qIr9kO.js +0 -1
  385. package/dist/client/assets/repositories-DcYP84R5.js +0 -1
  386. package/dist/client/assets/resolve-tab-icon-73RgcuQe.js +0 -1
  387. package/dist/client/assets/route-CSMzYXoN.js +0 -1
  388. package/dist/client/assets/route-DyaXyBfS.js +0 -1
  389. package/dist/client/assets/settings-tab-DWTMFT0X.js +0 -1
  390. package/dist/client/assets/site-editor-CWVoX5OY.js +0 -1
  391. package/dist/client/assets/tasks-140YlmT4.js +0 -1
  392. package/dist/client/assets/use-ask-in-chat-CtKzpyFU.js +0 -1
  393. package/dist/client/assets/use-blocks-v8-project-BPQNHFav.js +0 -1
  394. package/dist/client/assets/useInfiniteQuery-WRSkkanY.js +0 -1
  395. package/dist/client/assets/useSuspenseInfiniteQuery-B1s2URZC.js +0 -1
@@ -1 +1 @@
1
- import{c as z,gN as ke,j as i,b as ce,r as ee,hy as ye,h as ge,B as xe,m as Pe,t as ae,aH as De,aI as Ne,aJ as ve,aK as Ce,bj as Se,aL as we,aM as _e,aN as Ae,X as ze,bx as Fe,Y as ue,a8 as Ie,Z as Ue,_ as $e}from"./index-CcqLnTyv.js";import{C as Me}from"./index-8ANyj4B7.js";import{A as Te}from"./agent-view-guard-Bppi7Mra.js";import{_ as Ee,M as Le,e as Oe}from"./agent-icon-DqjTL3cE.js";import{a as Re}from"./SwitchHorizontal01-D7HAXgYP.js";import{b as Be}from"./Tool01-BTDYOKsB.js";import{s as Ve}from"./Trash01-CHCe7_6o.js";import{i as he}from"./Upload01-Q6ECKQXp.js";import{S as qe}from"./search-input-DFXG_UYw.js";import{u as Ge}from"./repository-binding-CuR-5wbj.js";import{u as He}from"./use-debounced-value-CcMMD4Qy.js";import{a as Ke}from"./use-file-configs-D7-mFpqA.js";import{u as We,a as Ye,e as Je,i as Qe,b as be,f as Xe,c as Ze}from"./asset-utils-Cekn7DV3.js";import{m as et}from"./match-site-slug-config-D3fUJ6vX.js";import{b as tt}from"./thread-route-D5E5K-lU.js";import"./use-mobile-BgN1E82d.js";import"./use-sidebar-collapsed-B34u6RwD.js";import"./use-chat-layout-state-Be9vIJ9A.js";import"./autosend-_WPHuuuS.js";import"./use-project-scope-Cb4T7-Pe.js";import"./thread-intent-pegObLq9.js";import"./use-mcp-client-DvDomB9A.js";import"./auth-qAWEiaXq.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CYcZM1HP.js";import"./task-board-DcTNURQy.js";import"./schema-D4ZSsKIV.js";import"./tooltip-AKf-E49i.js";import"./index-D146teOp.js";import"./toolbar-icon-button-CTRAa2ng.js";import"./shell-layout-CBX9BtMX.js";import"./Globe04--FaZazgw.js";import"./UserSquare-BJHrMhrM.js";import"./use-deployment-admin-D9sSgOb1.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BDiB_Nvo.js";import"./CheckCircle-B4NfGYxe.js";import"./Monitor01-Su614Ctg.js";import"./Zap-DpvU6Dp2.js";import"./Plus-D8rFucQH.js";import"./command-CtR4gjCr.js";import"./index-DCh3kkGn.js";import"./SearchMd-2MPq0KPN.js";import"./integration-icon-ChQEBlMz.js";import"./LinkBroken01-C9GtmpYY.js";import"./project-icon-BlOLnUr2.js";import"./use-navigate-to-agent-DmfSMV3R.js";import"./new-project-dialog-C_1Rs0SG.js";import"./ArrowLeft-B1m5qQi9.js";import"./label-CsfAEF08.js";import"./repository-picker-DEa_L5X-.js";import"./github-icon-BBNizm_E.js";import"./useInfiniteQuery-WRSkkanY.js";import"./infiniteQueryObserver-uDA4YvYL.js";import"./collection-search-iHJVqUHB.js";import"./ShoppingBag01-DDCYsqx9.js";import"./use-organization-settings-sxurgilE.js";import"./required-auth-layout-BnfTNype.js";import"./use-org-sso-CGB_T6WF.js";import"./sheet-B2jsXlHJ.js";import"./resizable-G0IV9sBv.js";import"./use-main-panel-tabs-DA6Ypr8r.js";import"./use-connection-CECJF8rf.js";import"./use-mcp-tools-mI5K7YKF.js";import"./types-BQOtvCBo.js";import"./utils-CVEq3hMx.js";import"./agent-capabilities-C80Nj8dH.js";import"./index-n9xCS6Sf.js";import"./ArrowUp-DcYpepHk.js";import"./chat-context-aSjAR9mm.js";import"./use-entitlements-BKF4jYfc.js";import"./use-ai-providers-BrqJh5BT.js";import"./use-decopilot-events-Dc1L96mp.js";import"./tool-namespace-BQSaNq7N.js";import"./drawer-ChCkx76W.js";import"./use-mcp-prompts-CgDM8qHG.js";import"./usage-stats-CVX23WNU.js";import"./form-BhXakrt_.js";import"./markdown-CPuTm6Mv.js";import"./use-copy-CtSedmtg.js";import"./input-BDAmWj4c.js";import"./icon-button-muPqJd-h.js";import"./file-type-icon-Bo3Nsgdh.js";import"./chat-draft-C4Ql1o7U.js";import"./use-voice-input-DmZaOhTZ.js";import"./popover-BQnTqyWU.js";import"./ChevronUp-DRG0w_P4.js";import"./index-DhM4mrtt.js";import"./checkbox-CBfkrmis.js";import"./Minus-eGpg4-RN.js";import"./select-DQqbq83t.js";import"./index-BdQq_4o_.js";import"./ChevronSelectorVertical-EqyUOMMk.js";import"./Key01-D0Pq98hT.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./AlertCircle-kYtqXGU8.js";import"./tabs-BzwzpfZ1.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-C6qbWrOQ.js";import"./toggle-group-D9bXIbAb.js";import"./input-COtL628i.js";import"./suggestion-C3enCUG8.js";import"./use-org-fs-BWA2rFQC.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DbaCusI2.js";import"./plan-ladder-BLc0_1i8.js";import"./add-connection-dialog-Bh0vHlQ5.js";import"./extract-connection-data-CTb_9Cpr.js";import"./metadata-D72DunRR.js";import"./connection-CZHWvxVM.js";import"./url-slug-ihGFL5bo.js";import"./connection-card-Dt4OQ0Zk.js";import"./connection-slug-BQwcAWfG.js";import"./textarea-CpPhDLVU.js";import"./schema-DyZV-W0g.js";import"./connection-form-helpers-KX0UMFtC.js";import"./authenticate-and-persist-oauth-D7iMHNSW.js";import"./mcp-oauth-BU_Qloaj.js";import"./mcp-oauth-ChfuZkYU.js";import"./collection-tabs-Trcf-II9.js";import"./badge-DtxRsHGH.js";import"./use-infinite-scroll-Z_9MLZyx.js";import"./useSuspenseInfiniteQuery-B1s2URZC.js";import"./use-task-board-events-CGZxY00s.js";import"./pair-h0916MQd.js";import"./collapsible-C6tkGF0M.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Cigj7X9N.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-thread-outputs-X5IsW797.js";import"./use-sandbox-events-CdAdPYjL.js";import"./sandbox-url-D3mC8qhT.js";import"./resolve-tab-icon-73RgcuQe.js";import"./use-task-metadata-hgLXNv36.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-CwgTlxOv.js";import"./use-blocks-v8-project-BPQNHFav.js";import"./virtual-mcp-YmAa-VVd.js";import"./CreditCard01-BLl0RgXC.js";import"./Sun-Dvv08Urq.js";import"./Play-D_ph4pZ0.js";import"./Users01-DHfg9AEk.js";function it(r){const e=z.c(6),{virtualMcpId:t}=r,s=Ge(t),l=Ke();let o;e[0]!==l||e[1]!==s?(o=et(l,ke(s)),e[0]=l,e[1]=s,e[2]=o):o=e[2];const n=o;if(!n){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(st,{}),e[3]=a):a=e[3],a}let c;return e[4]!==n?(c=i.jsx(ot,{config:n}),e[4]=n,e[5]=c):c=e[5],c}function st(){const r=z.c(12),e=ce();let t;r[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:i.jsx(Le,{size:20,className:"text-muted-foreground"})}),r[0]=t):t=r[0];let s;r[1]!==e?(s=e("assets.browser.noBucketTitle"),r[1]=e,r[2]=s):s=r[2];let l;r[3]!==s?(l=i.jsx("p",{className:"text-sm font-medium",children:s}),r[3]=s,r[4]=l):l=r[4];let o;r[5]!==e?(o=e("assets.browser.noBucketDescription"),r[5]=e,r[6]=o):o=r[6];let n;r[7]!==o?(n=i.jsx("p",{className:"mt-1 max-w-sm text-xs text-muted-foreground",children:o}),r[7]=o,r[8]=n):n=r[8];let c;return r[9]!==l||r[10]!==n?(c=i.jsxs("div",{className:"flex h-full min-h-0 flex-col items-center justify-center gap-3 p-10 text-center",children:[t,i.jsxs("div",{children:[l,n]})]}),r[9]=l,r[10]=n,r[11]=c):c=r[11],c}function rt(r){return r<0||r<640?2:r<768?3:r<1024?4:5}function lt(r,e){const t=Array.from({length:e},()=>[]);return r.forEach((s,l)=>t[l%e].push(s)),t}function ot(r){const e=z.c(99),{config:t}=r,s=ce(),[l,o]=ee.useState(""),n=He(l,300);let c;e[0]!==t.id||e[1]!==n?(c={configId:t.id,search:n},e[0]=t.id,e[1]=n,e[2]=c):c=e[2];const a=We(c),m=Ye(),[y,p]=ee.useState(!1),[d,g]=ee.useState(null),u=ee.useRef(null);let h;e[3]!==t.id||e[4]!==a||e[5]!==s||e[6]!==m?(h=async function(_){if(!_)return;const Z=Array.from(_);if(Z.length===0)return;const I=[];for(const O of Z)try{await m.mutateAsync({configId:t.id,file:O})}catch(U){const A=U;I.push(`${O.name} (${A instanceof Error?A.message:"upload failed"})`)}await a.refetch(),I.length>0&&ae.error(I.length===Z.length?s("filePicker.filePickerDialog.uploadFailedAll",{errors:I.join("; ")}):s("filePicker.filePickerDialog.uploadFailedSome",{errors:I.join("; ")}))},e[3]=t.id,e[4]=a,e[5]=s,e[6]=m,e[7]=h):h=e[7];const x=h;let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=function(_){_.preventDefault(),p(!0)},e[8]=f):f=e[8];const j=f;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=function(){p(!1)},e[9]=C):C=e[9];const P=C;let k;e[10]!==x?(k=function(_){_.preventDefault(),_.stopPropagation(),p(!1),x(_.dataTransfer.files)},e[10]=x,e[11]=k):k=e[11];const b=k,[D,S]=ye();let N,v,w,$,M,F;if(e[12]!==t.name||e[13]!==n||e[14]!==S||e[15]!==D||e[16]!==x||e[17]!==y||e[18]!==a.data?.pages||e[19]!==a.isFetching||e[20]!==a.isFetchingNextPage||e[21]!==b||e[22]!==l||e[23]!==s||e[24]!==m.isPending){const _=(a.data?.pages??[]).flatMap(nt),Z=lt(_,rt(D)),I=n.trim(),O=l!==n||a.isFetching&&!a.isFetchingNextPage;M="flex h-full min-h-0 flex-col gap-3 p-4";let U;e[31]!==s?(U=s("assets.browser.title"),e[31]=s,e[32]=U):U=e[32];let A;e[33]!==U?(A=i.jsx("h2",{className:"text-sm font-semibold",children:U}),e[33]=U,e[34]=A):A=e[34];let R;e[35]!==t.name||e[36]!==s?(R=s("assets.browser.bucketLabel",{name:t.name}),e[35]=t.name,e[36]=s,e[37]=R):R=e[37];let B;e[38]!==R?(B=i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:R}),e[38]=R,e[39]=B):B=e[39];let V;e[40]!==A||e[41]!==B?(V=i.jsxs("div",{className:"min-w-0",children:[A,B]}),e[40]=A,e[41]=B,e[42]=V):V=e[42];let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=()=>u.current?.click(),e[43]=re):re=e[43];let q;e[44]!==m.isPending?(q=m.isPending?i.jsx(ge,{className:"size-3.5"}):i.jsx(he,{size:14}),e[44]=m.isPending,e[45]=q):q=e[45];let G;e[46]!==s||e[47]!==m.isPending?(G=m.isPending?s("filePicker.filePickerDialog.uploading"):s("filePicker.filePickerDialog.dropFilesOrClick"),e[46]=s,e[47]=m.isPending,e[48]=G):G=e[48];let H;e[49]!==q||e[50]!==G||e[51]!==m.isPending?(H=i.jsxs(xe,{type:"button",size:"sm",disabled:m.isPending,onClick:re,children:[q,G]}),e[49]=q,e[50]=G,e[51]=m.isPending,e[52]=H):H=e[52];let K;e[53]!==x?(K=i.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:ne=>{const pe=Array.from(ne.target.files??[]);ne.target.value="",x(pe)}}),e[53]=x,e[54]=K):K=e[54],e[55]!==V||e[56]!==H||e[57]!==K?(F=i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3",children:[V,H,K]}),e[55]=V,e[56]=H,e[57]=K,e[58]=F):F=e[58];let W;e[59]!==s?(W=s("filePicker.filePickerDialog.searchFilesPlaceholder"),e[59]=s,e[60]=W):W=e[60],e[61]!==O||e[62]!==l||e[63]!==W?(N=i.jsx(qe,{value:l,onChange:o,isSearching:O,placeholder:W,className:"shrink-0"}),e[61]=O,e[62]=l,e[63]=W,e[64]=N):N=e[64];let le;e[65]===Symbol.for("react.memo_cache_sentinel")?(le=()=>u.current?.click(),e[65]=le):le=e[65];const me=y&&"border-primary bg-primary/5",fe=m.isPending&&"pointer-events-none opacity-60";let Y;e[66]!==me||e[67]!==fe?(Y=Pe("flex shrink-0 flex-col items-center justify-center gap-1 rounded-xl border border-dashed border-border/60 p-4 text-center transition-colors",me,fe),e[66]=me,e[67]=fe,e[68]=Y):Y=e[68];let oe;e[69]===Symbol.for("react.memo_cache_sentinel")?(oe=i.jsx(he,{size:16,className:"text-muted-foreground"}),e[69]=oe):oe=e[69];let J;e[70]!==s?(J=s("filePicker.filePickerDialog.dropFilesOrClick"),e[70]=s,e[71]=J):J=e[71];let Q;e[72]!==s?(Q=s("filePicker.filePickerDialog.uploadSizeLimit"),e[72]=s,e[73]=Q):Q=e[73];let X;e[74]!==J||e[75]!==Q?(X=i.jsxs("p",{className:"text-xs text-muted-foreground",children:[J," ",Q]}),e[74]=J,e[75]=Q,e[76]=X):X=e[76],e[77]!==b||e[78]!==Y||e[79]!==X?(v=i.jsxs("button",{type:"button",onClick:le,onDragOver:j,onDragLeave:P,onDrop:b,className:Y,children:[oe,X]}),e[77]=b,e[78]=Y,e[79]=X,e[80]=v):v=e[80],w="min-h-0 flex-1 overflow-y-auto pr-1",$=_.length===0?I?i.jsx(je,{title:s("filePicker.filePickerDialog.noMatches",{query:I}),description:s("filePicker.filePickerDialog.tryDifferentSearchOrLoadMore")}):i.jsx(je,{title:s("filePicker.filePickerDialog.noFilesYet"),description:s("filePicker.filePickerDialog.dropFileToGetStarted")}):i.jsx("div",{ref:S,className:"flex items-start gap-3",children:Z.map((ne,pe)=>i.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:ne.map(de=>i.jsx(at,{item:de,onDelete:()=>g(de)},de.key))},pe))}),e[12]=t.name,e[13]=n,e[14]=S,e[15]=D,e[16]=x,e[17]=y,e[18]=a.data?.pages,e[19]=a.isFetching,e[20]=a.isFetchingNextPage,e[21]=b,e[22]=l,e[23]=s,e[24]=m.isPending,e[25]=N,e[26]=v,e[27]=w,e[28]=$,e[29]=M,e[30]=F}else N=e[25],v=e[26],w=e[27],$=e[28],M=e[29],F=e[30];let T;e[81]!==a||e[82]!==s?(T=a.hasNextPage&&i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:a.isFetchingNextPage,onClick:()=>a.fetchNextPage(),children:a.isFetchingNextPage?i.jsxs(i.Fragment,{children:[i.jsx(ge,{className:"size-3.5"}),s("filePicker.filePickerDialog.loading")]}):s("filePicker.filePickerDialog.loadMore")})}),e[81]=a,e[82]=s,e[83]=T):T=e[83];let E;e[84]!==T||e[85]!==w||e[86]!==$?(E=i.jsxs("div",{className:w,children:[$,T]}),e[84]=T,e[85]=w,e[86]=$,e[87]=E):E=e[87];let te;e[88]===Symbol.for("react.memo_cache_sentinel")?(te=()=>g(null),e[88]=te):te=e[88];let L;e[89]!==t.id||e[90]!==d?(L=i.jsx(ft,{configId:t.id,item:d,onClose:te}),e[89]=t.id,e[90]=d,e[91]=L):L=e[91];let ie;return e[92]!==N||e[93]!==v||e[94]!==E||e[95]!==L||e[96]!==M||e[97]!==F?(ie=i.jsxs("div",{className:M,children:[F,N,v,E,L]}),e[92]=N,e[93]=v,e[94]=E,e[95]=L,e[96]=M,e[97]=F,e[98]=ie):ie=e[98],ie}function nt(r){return r.items}function je(r){const e=z.c(8),{title:t,description:s}=r;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:i.jsx(Be,{size:18,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let o;e[1]!==t?(o=i.jsx("p",{className:"text-sm font-medium",children:t}),e[1]=t,e[2]=o):o=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=n):n=e[4];let c;return e[5]!==o||e[6]!==n?(c=i.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[l,o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7],c}function at(r){const e=z.c(34),{item:t,onDelete:s}=r;let l;e[0]!==t.key?(l=Je(t.key),e[0]=t.key,e[1]=l):l=e[1];const o=l;let n;e[2]!==t.key?(n=Qe(t.key),e[2]=t.key,e[3]=n):n=e[3];const c=n;let a;e[4]!==c||e[5]!==t.key||e[6]!==t.publicUrl?(a=c?i.jsx("img",{src:t.publicUrl,alt:t.key,loading:"lazy",className:"block h-auto w-full",onError:ct}):i.jsx("div",{className:"flex aspect-square items-center justify-center",children:i.jsx(Ee,{size:28,className:"text-muted-foreground"})}),e[4]=c,e[5]=t.key,e[6]=t.publicUrl,e[7]=a):a=e[7];let m;e[8]!==t.key||e[9]!==t.publicUrl||e[10]!==a?(m=i.jsx("a",{href:t.publicUrl,target:"_blank",rel:"noreferrer",title:t.key,className:"block transition hover:ring-2 hover:ring-inset hover:ring-primary",children:a}),e[8]=t.key,e[9]=t.publicUrl,e[10]=a,e[11]=m):m=e[11];const y=t.key;let p;e[12]!==t.key?(p=be(t.key),e[12]=t.key,e[13]=p):p=e[13];let d;e[14]!==t.key||e[15]!==p?(d=i.jsx("p",{className:"truncate text-xs font-medium",title:y,children:p}),e[14]=t.key,e[15]=p,e[16]=d):d=e[16];let g;e[17]!==t.size?(g=Xe(t.size),e[17]=t.size,e[18]=g):g=e[18];let u;e[19]!==o||e[20]!==g?(u=i.jsxs("p",{className:"text-2xs uppercase text-muted-foreground",children:[o," · ",g]}),e[19]=o,e[20]=g,e[21]=u):u=e[21];let h;e[22]!==d||e[23]!==u?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[d,u]}),e[22]=d,e[23]=u,e[24]=h):h=e[24];let x;e[25]!==t||e[26]!==s?(x=i.jsx(mt,{item:t,onDelete:s}),e[25]=t,e[26]=s,e[27]=x):x=e[27];let f;e[28]!==h||e[29]!==x?(f=i.jsxs("div",{className:"flex items-center gap-1 border-t border-border/60 bg-background px-2 py-1.5",children:[h,x]}),e[28]=h,e[29]=x,e[30]=f):f=e[30];let j;return e[31]!==f||e[32]!==m?(j=i.jsxs("div",{className:"group relative flex flex-col overflow-hidden rounded-lg border border-border/60 bg-muted",children:[m,f]}),e[31]=f,e[32]=m,e[33]=j):j=e[33],j}function ct(r){r.target.style.display="none"}function mt(r){const e=z.c(36),{item:t,onDelete:s}=r,l=ce(),[o,n]=ee.useState(!1);let c;e[0]!==t.publicUrl||e[1]!==l?(c=async function(){try{await navigator.clipboard.writeText(t.publicUrl),n(!0),window.setTimeout(()=>n(!1),1500)}catch{ae.error(l("filePicker.filePickerDialog.failedToCopyUrl"))}},e[0]=t.publicUrl,e[1]=l,e[2]=c):c=e[2];const a=c;let m;e[3]!==l?(m=l("filePicker.filePickerDialog.assetActions"),e[3]=l,e[4]=m):m=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx(Re,{size:14}),e[5]=y):y=e[5];let p;e[6]!==m?(p=i.jsx(ze,{asChild:!0,children:i.jsx(xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0","aria-label":m,children:y})}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==o?(d=o?i.jsx(Fe,{size:14}):i.jsx(Oe,{size:14}),e[8]=o,e[9]=d):d=e[9];let g;e[10]!==o||e[11]!==l?(g=l(o?"filePicker.filePickerDialog.copied":"filePicker.filePickerDialog.copyUrl"),e[10]=o,e[11]=l,e[12]=g):g=e[12];let u;e[13]!==a||e[14]!==d||e[15]!==g?(u=i.jsxs(ue,{onClick:a,children:[d,g]}),e[13]=a,e[14]=d,e[15]=g,e[16]=u):u=e[16];const h=t.publicUrl;let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Ie,{size:14}),e[17]=x):x=e[17];let f;e[18]!==l?(f=l("filePicker.filePickerDialog.openInNewTab"),e[18]=l,e[19]=f):f=e[19];let j;e[20]!==t.publicUrl||e[21]!==f?(j=i.jsx(ue,{asChild:!0,children:i.jsxs("a",{href:h,target:"_blank",rel:"noreferrer",children:[x,f]})}),e[20]=t.publicUrl,e[21]=f,e[22]=j):j=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ve,{size:14}),e[23]=C):C=e[23];let P;e[24]!==l?(P=l("assets.browser.deleteAction"),e[24]=l,e[25]=P):P=e[25];let k;e[26]!==s||e[27]!==P?(k=i.jsxs(ue,{variant:"destructive",onClick:s,children:[C,P]}),e[26]=s,e[27]=P,e[28]=k):k=e[28];let b;e[29]!==j||e[30]!==k||e[31]!==u?(b=i.jsxs(Ue,{align:"end",children:[u,j,k]}),e[29]=j,e[30]=k,e[31]=u,e[32]=b):b=e[32];let D;return e[33]!==b||e[34]!==p?(D=i.jsxs($e,{children:[p,b]}),e[33]=b,e[34]=p,e[35]=D):D=e[35],D}function ft(r){const e=z.c(46),{configId:t,item:s,onClose:l}=r,o=ce(),n=Ze();let c;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==o?(c=async function(){if(s)try{await n.mutateAsync({configId:t,key:s.key}),ae.success(o("assets.browser.deleted")),l()}catch{ae.error(o("assets.browser.deleteFailed"))}},e[0]=t,e[1]=n,e[2]=s,e[3]=l,e[4]=o,e[5]=c):c=e[5];const a=c,m=!!s;let y;e[6]!==l?(y=w=>!w&&l(),e[6]=l,e[7]=y):y=e[7];let p;e[8]!==o?(p=o("assets.browser.deleteConfirmTitle"),e[8]=o,e[9]=p):p=e[9];let d;e[10]!==p?(d=i.jsx(De,{children:p}),e[10]=p,e[11]=d):d=e[11];let g;e[12]!==s||e[13]!==o?(g=o("assets.browser.deleteConfirmDescription",{name:s?be(s.key):""}),e[12]=s,e[13]=o,e[14]=g):g=e[14];let u;e[15]!==g?(u=i.jsx(Ne,{children:g}),e[15]=g,e[16]=u):u=e[16];let h;e[17]!==d||e[18]!==u?(h=i.jsxs(ve,{children:[d,u]}),e[17]=d,e[18]=u,e[19]=h):h=e[19];const x=n.isPending;let f;e[20]!==o?(f=o("assets.browser.deleteCancel"),e[20]=o,e[21]=f):f=e[21];let j;e[22]!==n.isPending||e[23]!==f?(j=i.jsx(Ce,{disabled:x,children:f}),e[22]=n.isPending,e[23]=f,e[24]=j):j=e[24];const C=n.isPending;let P;e[25]!==a?(P=w=>{w.preventDefault(),a()},e[25]=a,e[26]=P):P=e[26];let k;e[27]!==n.isPending?(k=n.isPending?i.jsx(ge,{className:"size-3.5"}):null,e[27]=n.isPending,e[28]=k):k=e[28];let b;e[29]!==o?(b=o("assets.browser.deleteConfirm"),e[29]=o,e[30]=b):b=e[30];let D;e[31]!==n.isPending||e[32]!==P||e[33]!==k||e[34]!==b?(D=i.jsxs(Se,{variant:"destructive",disabled:C,onClick:P,children:[k,b]}),e[31]=n.isPending,e[32]=P,e[33]=k,e[34]=b,e[35]=D):D=e[35];let S;e[36]!==j||e[37]!==D?(S=i.jsxs(we,{children:[j,D]}),e[36]=j,e[37]=D,e[38]=S):S=e[38];let N;e[39]!==S||e[40]!==h?(N=i.jsxs(_e,{children:[h,S]}),e[39]=S,e[40]=h,e[41]=N):N=e[41];let v;return e[42]!==N||e[43]!==m||e[44]!==y?(v=i.jsx(Ae,{open:m,onOpenChange:y,children:N}),e[42]=N,e[43]=m,e[44]=y,e[45]=v):v=e[45],v}function pt(){const r=z.c(2),e=tt();let t;return r[0]!==e?(t=i.jsx(Te,{tabId:"assets",children:i.jsx(it,{virtualMcpId:e})}),r[0]=e,r[1]=t):t=r[1],t}function Ws(){const r=z.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Me.Content,{children:i.jsx(pt,{})}),r[0]=e):e=r[0],e}export{Ws as default};
1
+ import{c as z,gN as ke,j as i,b as ce,r as ee,hy as ye,h as ge,B as xe,m as Pe,t as ae,aH as De,aI as Ne,aJ as ve,aK as Ce,bj as Se,aL as we,aM as _e,aN as Ae,X as ze,bx as Fe,Y as ue,a8 as Ie,Z as Ue,_ as $e}from"./index-B0M6fld0.js";import{C as Me}from"./index-BqYmVY5c.js";import{A as Te}from"./agent-view-guard-4G3ZLLJ6.js";import{_ as Ee,N as Le,e as Oe}from"./agent-icon-2MzErGc_.js";import{a as Re}from"./SwitchHorizontal01-amrllZXH.js";import{b as Be}from"./Tool01-CMaWHp8E.js";import{s as Ve}from"./Trash01-CrG-kC_D.js";import{i as he}from"./Upload01-CyQARd6T.js";import{S as qe}from"./search-input-CEHMJvIu.js";import{u as Ge}from"./repository-binding-D5Bfxppj.js";import{u as He}from"./use-debounced-value-Df5Y0bKp.js";import{a as Ke}from"./use-file-configs-BvpMQAvp.js";import{u as We,a as Ye,e as Je,i as Qe,b as be,f as Xe,c as Ze}from"./asset-utils-CksrawxC.js";import{m as et}from"./match-site-slug-config-D3fUJ6vX.js";import{b as tt}from"./thread-route-CidpLna8.js";import"./use-mobile-JxzmRS3O.js";import"./use-sidebar-collapsed-D8frxAVL.js";import"./use-chat-layout-state-SKM2dTYC.js";import"./autosend-C5Y0g7p2.js";import"./use-project-scope-BLJIcw6l.js";import"./thread-intent-B-lUepd6.js";import"./use-mcp-client-C8sFqQYs.js";import"./auth-Zsy5lyIS.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CwQVaju9.js";import"./task-board-r7mBQBfA.js";import"./schema-DDAhL9Cr.js";import"./tooltip-DUgZeaAs.js";import"./index-BjDHxKQ1.js";import"./toolbar-icon-button-DLb2L87M.js";import"./shell-layout-B_Je98M9.js";import"./Globe04-DFwi3CoQ.js";import"./UserSquare-CPjVW48L.js";import"./use-deployment-admin-CoSxtFqU.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BBI2UlVL.js";import"./CheckCircle-l0BgBdex.js";import"./Monitor01-pdAw5Hpb.js";import"./Zap-B1DyovfK.js";import"./Plus-DD-WVS1P.js";import"./command-BNUAVYAm.js";import"./index-woHs2Bei.js";import"./SearchMd-D2GFNI7a.js";import"./integration-icon-CbGo7Hoi.js";import"./LinkBroken01-BkclpWPr.js";import"./project-icon-BFEgPANo.js";import"./use-navigate-to-agent-BPUG-DwT.js";import"./new-project-dialog-xaa497EH.js";import"./ArrowLeft-Clex4DU3.js";import"./label-C2-_lSSQ.js";import"./repository-picker-BG4RNPTd.js";import"./github-icon-Fl1CK57w.js";import"./useInfiniteQuery-CrPhADUx.js";import"./infiniteQueryObserver-CQdhIsL1.js";import"./collection-search-EpeR-DRK.js";import"./ShoppingBag01-BQMf6OTu.js";import"./use-organization-settings-DgPYo7py.js";import"./required-auth-layout-BDLyo6_T.js";import"./use-org-sso-CxdxMmbI.js";import"./sheet-C5Vpqn4B.js";import"./resizable-ZTEIsDw7.js";import"./use-main-panel-tabs-CmG1gXaL.js";import"./use-connection-BLq1Zghk.js";import"./use-mcp-tools-DMaf2rKI.js";import"./types-D5f5_4KC.js";import"./utils-CVEq3hMx.js";import"./agent-capabilities-C8QrjnQn.js";import"./index-BK7RpYPl.js";import"./ArrowUp-DPT2wlR7.js";import"./chat-context-DyGpAf46.js";import"./use-entitlements-n2MsZM9p.js";import"./use-ai-providers-CegsSqNf.js";import"./use-decopilot-events-CVaB2Rhy.js";import"./tool-namespace-BMJphfly.js";import"./drawer-Cn25WPda.js";import"./use-mcp-prompts-KGxEzqRw.js";import"./usage-stats-Db2409wH.js";import"./form-DlOI0nvB.js";import"./markdown-CBPGMAeL.js";import"./use-copy-jRaPRTwC.js";import"./input-DPyEB9OP.js";import"./icon-button-igm3gACH.js";import"./file-type-icon-DKzfESDS.js";import"./chat-draft-CD_ST5_c.js";import"./use-voice-input-CQSYzFMw.js";import"./popover-CQC-Pea_.js";import"./ChevronUp-D0xD4CWi.js";import"./index-CZHAvvQX.js";import"./checkbox-HvlgUNAP.js";import"./Minus-D2H1757g.js";import"./select-taudESnf.js";import"./index-BdQq_4o_.js";import"./ChevronSelectorVertical-BbXlLdNT.js";import"./Key01-q3498IuC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./AlertCircle-Cn7aLqGD.js";import"./tabs-B9Fkm8UP.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-IyUHS95H.js";import"./toggle-group-GmYScomU.js";import"./input-WEG44w8N.js";import"./suggestion-CJnvcEOz.js";import"./use-org-fs-BTZCBdxy.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-CnmlocfU.js";import"./plan-ladder-DMGBEO8S.js";import"./add-connection-dialog-BQNXbA5n.js";import"./extract-connection-data-DPARA3fa.js";import"./metadata-D72DunRR.js";import"./connection-8A6_dw75.js";import"./url-slug-BgFXpKTa.js";import"./connection-card-CNcOtDo-.js";import"./connection-slug-C2s7RBeT.js";import"./textarea-8xMov02r.js";import"./schema-BObR_fJ_.js";import"./connection-form-helpers-UVT13B_U.js";import"./authenticate-and-persist-oauth-DNTXHLOn.js";import"./mcp-oauth-BzDrrJmr.js";import"./mcp-oauth-BRzA5Pv_.js";import"./collection-tabs-B_be-L9Y.js";import"./badge-CR0zmQ24.js";import"./use-infinite-scroll-qE2UPD2B.js";import"./useSuspenseInfiniteQuery-B5oEM_Vd.js";import"./use-task-board-events-WJfNx3Vw.js";import"./pair-CYQ33Koe.js";import"./collapsible-f_iRDMCl.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Ct_65kSq.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-thread-outputs-BOXdgR_A.js";import"./use-sandbox-events-CPma0JnN.js";import"./sandbox-url-D3mC8qhT.js";import"./resolve-tab-icon-bd7hcPCn.js";import"./use-task-metadata-DRP-RY0l.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-DltS_Jdi.js";import"./use-blocks-v8-project-390kM-ss.js";import"./virtual-mcp-CVLIL1Oq.js";import"./CreditCard01-CAgfpVLC.js";import"./Sun-BWeGTNdA.js";import"./Play-mj0Zbxy1.js";import"./Users01-BPY3vewQ.js";function it(r){const e=z.c(6),{virtualMcpId:t}=r,s=Ge(t),l=Ke();let o;e[0]!==l||e[1]!==s?(o=et(l,ke(s)),e[0]=l,e[1]=s,e[2]=o):o=e[2];const n=o;if(!n){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(st,{}),e[3]=a):a=e[3],a}let c;return e[4]!==n?(c=i.jsx(ot,{config:n}),e[4]=n,e[5]=c):c=e[5],c}function st(){const r=z.c(12),e=ce();let t;r[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:i.jsx(Le,{size:20,className:"text-muted-foreground"})}),r[0]=t):t=r[0];let s;r[1]!==e?(s=e("assets.browser.noBucketTitle"),r[1]=e,r[2]=s):s=r[2];let l;r[3]!==s?(l=i.jsx("p",{className:"text-sm font-medium",children:s}),r[3]=s,r[4]=l):l=r[4];let o;r[5]!==e?(o=e("assets.browser.noBucketDescription"),r[5]=e,r[6]=o):o=r[6];let n;r[7]!==o?(n=i.jsx("p",{className:"mt-1 max-w-sm text-xs text-muted-foreground",children:o}),r[7]=o,r[8]=n):n=r[8];let c;return r[9]!==l||r[10]!==n?(c=i.jsxs("div",{className:"flex h-full min-h-0 flex-col items-center justify-center gap-3 p-10 text-center",children:[t,i.jsxs("div",{children:[l,n]})]}),r[9]=l,r[10]=n,r[11]=c):c=r[11],c}function rt(r){return r<0||r<640?2:r<768?3:r<1024?4:5}function lt(r,e){const t=Array.from({length:e},()=>[]);return r.forEach((s,l)=>t[l%e].push(s)),t}function ot(r){const e=z.c(99),{config:t}=r,s=ce(),[l,o]=ee.useState(""),n=He(l,300);let c;e[0]!==t.id||e[1]!==n?(c={configId:t.id,search:n},e[0]=t.id,e[1]=n,e[2]=c):c=e[2];const a=We(c),m=Ye(),[y,p]=ee.useState(!1),[d,g]=ee.useState(null),u=ee.useRef(null);let h;e[3]!==t.id||e[4]!==a||e[5]!==s||e[6]!==m?(h=async function(_){if(!_)return;const Z=Array.from(_);if(Z.length===0)return;const I=[];for(const O of Z)try{await m.mutateAsync({configId:t.id,file:O})}catch(U){const A=U;I.push(`${O.name} (${A instanceof Error?A.message:"upload failed"})`)}await a.refetch(),I.length>0&&ae.error(I.length===Z.length?s("filePicker.filePickerDialog.uploadFailedAll",{errors:I.join("; ")}):s("filePicker.filePickerDialog.uploadFailedSome",{errors:I.join("; ")}))},e[3]=t.id,e[4]=a,e[5]=s,e[6]=m,e[7]=h):h=e[7];const x=h;let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=function(_){_.preventDefault(),p(!0)},e[8]=f):f=e[8];const j=f;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=function(){p(!1)},e[9]=C):C=e[9];const P=C;let k;e[10]!==x?(k=function(_){_.preventDefault(),_.stopPropagation(),p(!1),x(_.dataTransfer.files)},e[10]=x,e[11]=k):k=e[11];const b=k,[D,S]=ye();let N,v,w,$,M,F;if(e[12]!==t.name||e[13]!==n||e[14]!==S||e[15]!==D||e[16]!==x||e[17]!==y||e[18]!==a.data?.pages||e[19]!==a.isFetching||e[20]!==a.isFetchingNextPage||e[21]!==b||e[22]!==l||e[23]!==s||e[24]!==m.isPending){const _=(a.data?.pages??[]).flatMap(nt),Z=lt(_,rt(D)),I=n.trim(),O=l!==n||a.isFetching&&!a.isFetchingNextPage;M="flex h-full min-h-0 flex-col gap-3 p-4";let U;e[31]!==s?(U=s("assets.browser.title"),e[31]=s,e[32]=U):U=e[32];let A;e[33]!==U?(A=i.jsx("h2",{className:"text-sm font-semibold",children:U}),e[33]=U,e[34]=A):A=e[34];let R;e[35]!==t.name||e[36]!==s?(R=s("assets.browser.bucketLabel",{name:t.name}),e[35]=t.name,e[36]=s,e[37]=R):R=e[37];let B;e[38]!==R?(B=i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:R}),e[38]=R,e[39]=B):B=e[39];let V;e[40]!==A||e[41]!==B?(V=i.jsxs("div",{className:"min-w-0",children:[A,B]}),e[40]=A,e[41]=B,e[42]=V):V=e[42];let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=()=>u.current?.click(),e[43]=re):re=e[43];let q;e[44]!==m.isPending?(q=m.isPending?i.jsx(ge,{className:"size-3.5"}):i.jsx(he,{size:14}),e[44]=m.isPending,e[45]=q):q=e[45];let G;e[46]!==s||e[47]!==m.isPending?(G=m.isPending?s("filePicker.filePickerDialog.uploading"):s("filePicker.filePickerDialog.dropFilesOrClick"),e[46]=s,e[47]=m.isPending,e[48]=G):G=e[48];let H;e[49]!==q||e[50]!==G||e[51]!==m.isPending?(H=i.jsxs(xe,{type:"button",size:"sm",disabled:m.isPending,onClick:re,children:[q,G]}),e[49]=q,e[50]=G,e[51]=m.isPending,e[52]=H):H=e[52];let K;e[53]!==x?(K=i.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:ne=>{const pe=Array.from(ne.target.files??[]);ne.target.value="",x(pe)}}),e[53]=x,e[54]=K):K=e[54],e[55]!==V||e[56]!==H||e[57]!==K?(F=i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3",children:[V,H,K]}),e[55]=V,e[56]=H,e[57]=K,e[58]=F):F=e[58];let W;e[59]!==s?(W=s("filePicker.filePickerDialog.searchFilesPlaceholder"),e[59]=s,e[60]=W):W=e[60],e[61]!==O||e[62]!==l||e[63]!==W?(N=i.jsx(qe,{value:l,onChange:o,isSearching:O,placeholder:W,className:"shrink-0"}),e[61]=O,e[62]=l,e[63]=W,e[64]=N):N=e[64];let le;e[65]===Symbol.for("react.memo_cache_sentinel")?(le=()=>u.current?.click(),e[65]=le):le=e[65];const me=y&&"border-primary bg-primary/5",fe=m.isPending&&"pointer-events-none opacity-60";let Y;e[66]!==me||e[67]!==fe?(Y=Pe("flex shrink-0 flex-col items-center justify-center gap-1 rounded-xl border border-dashed border-border/60 p-4 text-center transition-colors",me,fe),e[66]=me,e[67]=fe,e[68]=Y):Y=e[68];let oe;e[69]===Symbol.for("react.memo_cache_sentinel")?(oe=i.jsx(he,{size:16,className:"text-muted-foreground"}),e[69]=oe):oe=e[69];let J;e[70]!==s?(J=s("filePicker.filePickerDialog.dropFilesOrClick"),e[70]=s,e[71]=J):J=e[71];let Q;e[72]!==s?(Q=s("filePicker.filePickerDialog.uploadSizeLimit"),e[72]=s,e[73]=Q):Q=e[73];let X;e[74]!==J||e[75]!==Q?(X=i.jsxs("p",{className:"text-xs text-muted-foreground",children:[J," ",Q]}),e[74]=J,e[75]=Q,e[76]=X):X=e[76],e[77]!==b||e[78]!==Y||e[79]!==X?(v=i.jsxs("button",{type:"button",onClick:le,onDragOver:j,onDragLeave:P,onDrop:b,className:Y,children:[oe,X]}),e[77]=b,e[78]=Y,e[79]=X,e[80]=v):v=e[80],w="min-h-0 flex-1 overflow-y-auto pr-1",$=_.length===0?I?i.jsx(je,{title:s("filePicker.filePickerDialog.noMatches",{query:I}),description:s("filePicker.filePickerDialog.tryDifferentSearchOrLoadMore")}):i.jsx(je,{title:s("filePicker.filePickerDialog.noFilesYet"),description:s("filePicker.filePickerDialog.dropFileToGetStarted")}):i.jsx("div",{ref:S,className:"flex items-start gap-3",children:Z.map((ne,pe)=>i.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:ne.map(de=>i.jsx(at,{item:de,onDelete:()=>g(de)},de.key))},pe))}),e[12]=t.name,e[13]=n,e[14]=S,e[15]=D,e[16]=x,e[17]=y,e[18]=a.data?.pages,e[19]=a.isFetching,e[20]=a.isFetchingNextPage,e[21]=b,e[22]=l,e[23]=s,e[24]=m.isPending,e[25]=N,e[26]=v,e[27]=w,e[28]=$,e[29]=M,e[30]=F}else N=e[25],v=e[26],w=e[27],$=e[28],M=e[29],F=e[30];let T;e[81]!==a||e[82]!==s?(T=a.hasNextPage&&i.jsx("div",{className:"flex justify-center py-4",children:i.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:a.isFetchingNextPage,onClick:()=>a.fetchNextPage(),children:a.isFetchingNextPage?i.jsxs(i.Fragment,{children:[i.jsx(ge,{className:"size-3.5"}),s("filePicker.filePickerDialog.loading")]}):s("filePicker.filePickerDialog.loadMore")})}),e[81]=a,e[82]=s,e[83]=T):T=e[83];let E;e[84]!==T||e[85]!==w||e[86]!==$?(E=i.jsxs("div",{className:w,children:[$,T]}),e[84]=T,e[85]=w,e[86]=$,e[87]=E):E=e[87];let te;e[88]===Symbol.for("react.memo_cache_sentinel")?(te=()=>g(null),e[88]=te):te=e[88];let L;e[89]!==t.id||e[90]!==d?(L=i.jsx(ft,{configId:t.id,item:d,onClose:te}),e[89]=t.id,e[90]=d,e[91]=L):L=e[91];let ie;return e[92]!==N||e[93]!==v||e[94]!==E||e[95]!==L||e[96]!==M||e[97]!==F?(ie=i.jsxs("div",{className:M,children:[F,N,v,E,L]}),e[92]=N,e[93]=v,e[94]=E,e[95]=L,e[96]=M,e[97]=F,e[98]=ie):ie=e[98],ie}function nt(r){return r.items}function je(r){const e=z.c(8),{title:t,description:s}=r;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:i.jsx(Be,{size:18,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let o;e[1]!==t?(o=i.jsx("p",{className:"text-sm font-medium",children:t}),e[1]=t,e[2]=o):o=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=n):n=e[4];let c;return e[5]!==o||e[6]!==n?(c=i.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[l,o,n]}),e[5]=o,e[6]=n,e[7]=c):c=e[7],c}function at(r){const e=z.c(34),{item:t,onDelete:s}=r;let l;e[0]!==t.key?(l=Je(t.key),e[0]=t.key,e[1]=l):l=e[1];const o=l;let n;e[2]!==t.key?(n=Qe(t.key),e[2]=t.key,e[3]=n):n=e[3];const c=n;let a;e[4]!==c||e[5]!==t.key||e[6]!==t.publicUrl?(a=c?i.jsx("img",{src:t.publicUrl,alt:t.key,loading:"lazy",className:"block h-auto w-full",onError:ct}):i.jsx("div",{className:"flex aspect-square items-center justify-center",children:i.jsx(Ee,{size:28,className:"text-muted-foreground"})}),e[4]=c,e[5]=t.key,e[6]=t.publicUrl,e[7]=a):a=e[7];let m;e[8]!==t.key||e[9]!==t.publicUrl||e[10]!==a?(m=i.jsx("a",{href:t.publicUrl,target:"_blank",rel:"noreferrer",title:t.key,className:"block transition hover:ring-2 hover:ring-inset hover:ring-primary",children:a}),e[8]=t.key,e[9]=t.publicUrl,e[10]=a,e[11]=m):m=e[11];const y=t.key;let p;e[12]!==t.key?(p=be(t.key),e[12]=t.key,e[13]=p):p=e[13];let d;e[14]!==t.key||e[15]!==p?(d=i.jsx("p",{className:"truncate text-xs font-medium",title:y,children:p}),e[14]=t.key,e[15]=p,e[16]=d):d=e[16];let g;e[17]!==t.size?(g=Xe(t.size),e[17]=t.size,e[18]=g):g=e[18];let u;e[19]!==o||e[20]!==g?(u=i.jsxs("p",{className:"text-2xs uppercase text-muted-foreground",children:[o," · ",g]}),e[19]=o,e[20]=g,e[21]=u):u=e[21];let h;e[22]!==d||e[23]!==u?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[d,u]}),e[22]=d,e[23]=u,e[24]=h):h=e[24];let x;e[25]!==t||e[26]!==s?(x=i.jsx(mt,{item:t,onDelete:s}),e[25]=t,e[26]=s,e[27]=x):x=e[27];let f;e[28]!==h||e[29]!==x?(f=i.jsxs("div",{className:"flex items-center gap-1 border-t border-border/60 bg-background px-2 py-1.5",children:[h,x]}),e[28]=h,e[29]=x,e[30]=f):f=e[30];let j;return e[31]!==f||e[32]!==m?(j=i.jsxs("div",{className:"group relative flex flex-col overflow-hidden rounded-lg border border-border/60 bg-muted",children:[m,f]}),e[31]=f,e[32]=m,e[33]=j):j=e[33],j}function ct(r){r.target.style.display="none"}function mt(r){const e=z.c(36),{item:t,onDelete:s}=r,l=ce(),[o,n]=ee.useState(!1);let c;e[0]!==t.publicUrl||e[1]!==l?(c=async function(){try{await navigator.clipboard.writeText(t.publicUrl),n(!0),window.setTimeout(()=>n(!1),1500)}catch{ae.error(l("filePicker.filePickerDialog.failedToCopyUrl"))}},e[0]=t.publicUrl,e[1]=l,e[2]=c):c=e[2];const a=c;let m;e[3]!==l?(m=l("filePicker.filePickerDialog.assetActions"),e[3]=l,e[4]=m):m=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx(Re,{size:14}),e[5]=y):y=e[5];let p;e[6]!==m?(p=i.jsx(ze,{asChild:!0,children:i.jsx(xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0","aria-label":m,children:y})}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==o?(d=o?i.jsx(Fe,{size:14}):i.jsx(Oe,{size:14}),e[8]=o,e[9]=d):d=e[9];let g;e[10]!==o||e[11]!==l?(g=l(o?"filePicker.filePickerDialog.copied":"filePicker.filePickerDialog.copyUrl"),e[10]=o,e[11]=l,e[12]=g):g=e[12];let u;e[13]!==a||e[14]!==d||e[15]!==g?(u=i.jsxs(ue,{onClick:a,children:[d,g]}),e[13]=a,e[14]=d,e[15]=g,e[16]=u):u=e[16];const h=t.publicUrl;let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Ie,{size:14}),e[17]=x):x=e[17];let f;e[18]!==l?(f=l("filePicker.filePickerDialog.openInNewTab"),e[18]=l,e[19]=f):f=e[19];let j;e[20]!==t.publicUrl||e[21]!==f?(j=i.jsx(ue,{asChild:!0,children:i.jsxs("a",{href:h,target:"_blank",rel:"noreferrer",children:[x,f]})}),e[20]=t.publicUrl,e[21]=f,e[22]=j):j=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ve,{size:14}),e[23]=C):C=e[23];let P;e[24]!==l?(P=l("assets.browser.deleteAction"),e[24]=l,e[25]=P):P=e[25];let k;e[26]!==s||e[27]!==P?(k=i.jsxs(ue,{variant:"destructive",onClick:s,children:[C,P]}),e[26]=s,e[27]=P,e[28]=k):k=e[28];let b;e[29]!==j||e[30]!==k||e[31]!==u?(b=i.jsxs(Ue,{align:"end",children:[u,j,k]}),e[29]=j,e[30]=k,e[31]=u,e[32]=b):b=e[32];let D;return e[33]!==b||e[34]!==p?(D=i.jsxs($e,{children:[p,b]}),e[33]=b,e[34]=p,e[35]=D):D=e[35],D}function ft(r){const e=z.c(46),{configId:t,item:s,onClose:l}=r,o=ce(),n=Ze();let c;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==o?(c=async function(){if(s)try{await n.mutateAsync({configId:t,key:s.key}),ae.success(o("assets.browser.deleted")),l()}catch{ae.error(o("assets.browser.deleteFailed"))}},e[0]=t,e[1]=n,e[2]=s,e[3]=l,e[4]=o,e[5]=c):c=e[5];const a=c,m=!!s;let y;e[6]!==l?(y=w=>!w&&l(),e[6]=l,e[7]=y):y=e[7];let p;e[8]!==o?(p=o("assets.browser.deleteConfirmTitle"),e[8]=o,e[9]=p):p=e[9];let d;e[10]!==p?(d=i.jsx(De,{children:p}),e[10]=p,e[11]=d):d=e[11];let g;e[12]!==s||e[13]!==o?(g=o("assets.browser.deleteConfirmDescription",{name:s?be(s.key):""}),e[12]=s,e[13]=o,e[14]=g):g=e[14];let u;e[15]!==g?(u=i.jsx(Ne,{children:g}),e[15]=g,e[16]=u):u=e[16];let h;e[17]!==d||e[18]!==u?(h=i.jsxs(ve,{children:[d,u]}),e[17]=d,e[18]=u,e[19]=h):h=e[19];const x=n.isPending;let f;e[20]!==o?(f=o("assets.browser.deleteCancel"),e[20]=o,e[21]=f):f=e[21];let j;e[22]!==n.isPending||e[23]!==f?(j=i.jsx(Ce,{disabled:x,children:f}),e[22]=n.isPending,e[23]=f,e[24]=j):j=e[24];const C=n.isPending;let P;e[25]!==a?(P=w=>{w.preventDefault(),a()},e[25]=a,e[26]=P):P=e[26];let k;e[27]!==n.isPending?(k=n.isPending?i.jsx(ge,{className:"size-3.5"}):null,e[27]=n.isPending,e[28]=k):k=e[28];let b;e[29]!==o?(b=o("assets.browser.deleteConfirm"),e[29]=o,e[30]=b):b=e[30];let D;e[31]!==n.isPending||e[32]!==P||e[33]!==k||e[34]!==b?(D=i.jsxs(Se,{variant:"destructive",disabled:C,onClick:P,children:[k,b]}),e[31]=n.isPending,e[32]=P,e[33]=k,e[34]=b,e[35]=D):D=e[35];let S;e[36]!==j||e[37]!==D?(S=i.jsxs(we,{children:[j,D]}),e[36]=j,e[37]=D,e[38]=S):S=e[38];let N;e[39]!==S||e[40]!==h?(N=i.jsxs(_e,{children:[h,S]}),e[39]=S,e[40]=h,e[41]=N):N=e[41];let v;return e[42]!==N||e[43]!==m||e[44]!==y?(v=i.jsx(Ae,{open:m,onOpenChange:y,children:N}),e[42]=N,e[43]=m,e[44]=y,e[45]=v):v=e[45],v}function pt(){const r=z.c(2),e=tt();let t;return r[0]!==e?(t=i.jsx(Te,{tabId:"assets",children:i.jsx(it,{virtualMcpId:e})}),r[0]=e,r[1]=t):t=r[1],t}function Ws(){const r=z.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Me.Content,{children:i.jsx(pt,{})}),r[0]=e):e=r[0],e}export{Ws as default};
@@ -1,4 +1,4 @@
1
- import{c6 as Qt,c as q,b as ee,r as w,j as t,B,bx as qt,m as Pt,a5 as $t,D as et,v as tt,w as st,x as at,aT as ot,y as nt,t as X,bB as es,_ as ts,X as ss,Z as as,ap as os,an as ns,ao as is,Y as ze,b3 as rs,h as Le,aH as pt,aI as xt,aJ as gt,aK as ht,bj as jt,aL as yt,aM as bt,aN as vt,E as Ke,aE as ls,c7 as Ct,I as Nt,c8 as cs,aj as ds,aZ as Qe,n as Xe,f as ms}from"./index-CcqLnTyv.js";import{C as us}from"./index-8ANyj4B7.js";import{b as it,O as fs,a as ps,a3 as xs,m as St,at as gs,T as kt,au as hs,g as js,S as Me,av as Et,e as Ye}from"./agent-icon-DqjTL3cE.js";import{n as Tt}from"./ShoppingBag01-DDCYsqx9.js";import{t as rt}from"./ChevronUp-DRG0w_P4.js";import{e as ys}from"./UserSquare-BJHrMhrM.js";import{b as bs,e as lt,c as Ot,t as zt}from"./Tool01-BTDYOKsB.js";import{i as vs}from"./SearchMd-2MPq0KPN.js";import{B as Kt}from"./badge-DtxRsHGH.js";import{C as Ft}from"./checkbox-CBfkrmis.js";import{S as ct}from"./switch-2cMTOO8e.js";import{a as Mt,b as Rt,P as Lt}from"./popover-BQnTqyWU.js";import{C as Cs,e as wt,b as Ns,f as Ss,a as ks,c as Ts}from"./command-CtR4gjCr.js";import{g as ws,s as _s}from"./tool-namespace-BQSaNq7N.js";import{u as dt}from"./use-connection-CECJF8rf.js";import{u as Ds}from"./use-mcp-client-DvDomB9A.js";import{u as Is}from"./use-mcp-tools-mI5K7YKF.js";import{I as As}from"./integration-icon-ChQEBlMz.js";import{M as Ps}from"./select-model-DrY_3vXN.js";import{u as $s}from"./use-ai-providers-BrqJh5BT.js";import{U as Es,b as Os}from"./build-improve-prompt-doc--GJGk9lj.js";import{a as ve,c as zs,d as Ks}from"./use-automations-B64sqUmg.js";import{c as Fs,b as Ms,h as Rs,t as Ls}from"./chat-context-aSjAR9mm.js";import{b as Vs,C as Us,a as Ws}from"./collapsible-C6tkGF0M.js";import{c as Bs,T as Gs,a as Hs}from"./tooltip-AKf-E49i.js";import{g as Js}from"./shell-layout-CBX9BtMX.js";import{i as Vt}from"./ArrowLeft-B1m5qQi9.js";import{i as Xs}from"./ArrowUp-DcYpepHk.js";import{s as Ys}from"./Trash01-CHCe7_6o.js";import{s as mt}from"./XClose-BDiB_Nvo.js";import{u as _t}from"./use-debounced-autosave-BLJ3k7wG.js";import{T as Zs,a as Qs}from"./input-COtL628i.js";import{u as qs,a as ea,J as Ut}from"./jira-icon-CJhoZQuc.js";import{s as ta}from"./Plus-D8rFucQH.js";import{i as ut}from"./Zap-DpvU6Dp2.js";import{l as We,H as sa}from"./config-BpJVAl-p.js";import{C as aa}from"./task-board-DcTNURQy.js";import{M as Wt}from"./multi-select-C2R3RZPE.js";import{S as ge,b as he,a as je,d as ye,c as be}from"./select-DQqbq83t.js";import{c as oa,a as na,T as Dt}from"./tabs-BzwzpfZ1.js";import{MonacoCodeEditor as ia}from"./monaco-editor-XS1Vx7aB.js";import{A as ra}from"./automation-runs-BHP_sOU-.js";import{C as la}from"./collection-tabs-Trcf-II9.js";import{a as ca}from"./autosend-_WPHuuuS.js";import"./use-mobile-BgN1E82d.js";import"./use-sidebar-collapsed-B34u6RwD.js";import"./use-chat-layout-state-Be9vIJ9A.js";import"./thread-route-D5E5K-lU.js";import"./thread-intent-pegObLq9.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CYcZM1HP.js";import"./toolbar-icon-button-CTRAa2ng.js";import"./sheet-B2jsXlHJ.js";import"./resizable-G0IV9sBv.js";import"./use-project-scope-Cb4T7-Pe.js";import"./repository-binding-CuR-5wbj.js";import"./AlertCircle-kYtqXGU8.js";import"./LinkBroken01-C9GtmpYY.js";import"./Globe04--FaZazgw.js";import"./CheckCircle-B4NfGYxe.js";import"./ChevronSelectorVertical-EqyUOMMk.js";import"./CreditCard01-BLl0RgXC.js";import"./SwitchHorizontal01-D7HAXgYP.js";import"./Key01-D0Pq98hT.js";import"./Minus-eGpg4-RN.js";import"./Monitor01-Su614Ctg.js";import"./Sun-Dvv08Urq.js";import"./Play-D_ph4pZ0.js";import"./Upload01-Q6ECKQXp.js";import"./Users01-DHfg9AEk.js";import"./index-DCh3kkGn.js";import"./auth-qAWEiaXq.js";import"./drawer-ChCkx76W.js";import"./index-DhM4mrtt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-entitlements-BKF4jYfc.js";import"./use-decopilot-events-Dc1L96mp.js";import"./use-organization-settings-sxurgilE.js";import"./schema-D4ZSsKIV.js";import"./index-D146teOp.js";import"./use-deployment-admin-D9sSgOb1.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-BlOLnUr2.js";import"./use-navigate-to-agent-DmfSMV3R.js";import"./use-debounced-value-CcMMD4Qy.js";import"./new-project-dialog-C_1Rs0SG.js";import"./label-CsfAEF08.js";import"./repository-picker-DEa_L5X-.js";import"./github-icon-BBNizm_E.js";import"./useInfiniteQuery-WRSkkanY.js";import"./infiniteQueryObserver-uDA4YvYL.js";import"./collection-search-iHJVqUHB.js";import"./required-auth-layout-BnfTNype.js";import"./use-org-sso-CGB_T6WF.js";import"./suggestion-C3enCUG8.js";import"./usage-stats-CVX23WNU.js";import"./form-BhXakrt_.js";import"./utils-CVEq3hMx.js";import"./markdown-CPuTm6Mv.js";import"./use-copy-CtSedmtg.js";import"./use-mcp-prompts-CgDM8qHG.js";import"./use-org-fs-BWA2rFQC.js";import"./core.esm-DkzVh4mV.js";import"./index-BdQq_4o_.js";import"./active-indicator-CCMhAsc_.js";import"./editor-BKO3Ouyu.js";import"./table-DvZCTg5z.js";import"./empty-state-DiGOrU7G.js";import"./use-id-selection-JEuFRU8t.js";import"./use-infinite-scroll-Z_9MLZyx.js";import"./task-status-CxLWWnTs.js";import"./thread-sheet-body-BFBUt-Sx.js";import"./useSuspenseInfiniteQuery-B1s2URZC.js";import"./pair-h0916MQd.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Cigj7X9N.js";import"./types-BQOtvCBo.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-thread-outputs-X5IsW797.js";import"./file-type-icon-Bo3Nsgdh.js";const Ze={fast:{labelKey:"automations.automationConfig.tierFast",subtitleKey:"automations.automationConfig.tierFastSubtitle",icon:js},smart:{labelKey:"automations.automationConfig.tierSmart",subtitleKey:"automations.automationConfig.tierSmartSubtitle",icon:zt},thinking:{labelKey:"automations.automationConfig.tierThinking",subtitleKey:"automations.automationConfig.tierThinkingSubtitle",icon:hs}},da=["fast","smart","thinking"];function ma(r){const e=q.c(19),{tier:s,onSelect:n}=r,o=ee(),[i,c]=w.useState(!1),a=Ze[s].icon;let j;e[0]!==a?(j=t.jsx(a,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=j):j=e[1];const d=Ze[s];let m;e[2]!==o||e[3]!==d.labelKey?(m=o(d.labelKey),e[2]=o,e[3]=d.labelKey,e[4]=m):m=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[5]=x):x=e[5];let f;e[6]!==j||e[7]!==m?(f=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[j,m,x]})}),e[6]=j,e[7]=m,e[8]=f):f=e[8];let g;e[9]!==n||e[10]!==o||e[11]!==s?(g=da.map(p=>{const l=Ze[p],y=l.icon;return t.jsxs("button",{type:"button",onClick:()=>{n(p),c(!1)},className:Pt("flex items-start gap-2 px-2 py-1.5 rounded-lg text-left hover:bg-accent"),children:[t.jsx(y,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"text-sm",children:o(l.labelKey)}),t.jsx("div",{className:"text-xs text-muted-foreground",children:o(l.subtitleKey)})]}),p===s&&t.jsx(qt,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[9]=n,e[10]=o,e[11]=s,e[12]=g):g=e[12];let u;e[13]!==g?(u=t.jsx(Rt,{align:"start",className:"p-1 w-64",children:t.jsx("div",{className:"flex flex-col",children:g})}),e[13]=g,e[14]=u):u=e[14];let h;return e[15]!==i||e[16]!==f||e[17]!==u?(h=t.jsxs(Lt,{open:i,onOpenChange:c,children:[f,u]}),e[15]=i,e[16]=f,e[17]=u,e[18]=h):h=e[18],h}function ua(r){const e=q.c(27),{tier:s,onTierChange:n,override:o,onOverrideChange:i}=r,c=ee(),[a,j]=w.useState(o!==null);let d;e[0]!==c?(d=c("automations.automationConfig.modelLabel"),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==d?(m=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:d}),e[2]=d,e[3]=m):m=e[3];let x;e[4]!==i||e[5]!==n||e[6]!==o||e[7]!==c||e[8]!==s||e[9]!==a?(x=a?t.jsx(w.Suspense,{fallback:t.jsx(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:c("automations.automationConfig.loadingModels")}),children:t.jsx(fa,{override:o,onOverrideChange:i})}):t.jsx(ma,{tier:s,onSelect:n}),e[4]=i,e[5]=n,e[6]=o,e[7]=c,e[8]=s,e[9]=a,e[10]=x):x=e[10];let f;e[11]!==i?(f=y=>{j(y),y||i(null)},e[11]=i,e[12]=f):f=e[12];let g;e[13]!==f||e[14]!==a?(g=t.jsx(ct,{checked:a,onCheckedChange:f,className:"cursor-pointer"}),e[13]=f,e[14]=a,e[15]=g):g=e[15];let u;e[16]!==c?(u=c("automations.automationConfig.specificModel"),e[16]=c,e[17]=u):u=e[17];let h;e[18]!==g||e[19]!==u?(h=t.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[g,u]}),e[18]=g,e[19]=u,e[20]=h):h=e[20];let p;e[21]!==x||e[22]!==h?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[x,h]}),e[21]=x,e[22]=h,e[23]=p):p=e[23];let l;return e[24]!==m||e[25]!==p?(l=t.jsxs("div",{className:"flex flex-col gap-2",children:[m,p]}),e[24]=m,e[25]=p,e[26]=l):l=e[26],l}function fa(r){const e=q.c(25),{override:s,onOverrideChange:n}=r,o=ee(),i=$s(),c=i[0]?.id??null;let a;e[0]!==c||e[1]!==i||e[2]!==s?.credentialId?(a=i.some(l=>l.id===s?.credentialId)?s?.credentialId??null:c,e[0]=c,e[1]=i,e[2]=s?.credentialId,e[3]=a):a=e[3];const[j,d]=w.useState(a);let m;e[4]!==j||e[5]!==c||e[6]!==i?(m=i.some(l=>l.id===j)?j:c,e[4]=j,e[5]=c,e[6]=i,e[7]=m):m=e[7];const x=m;let f;e[8]!==i||e[9]!==s?(f=s&&i.some(l=>l.id===s.credentialId)?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[8]=i,e[9]=s,e[10]=f):f=e[10];const g=f;if(i.length===0){let l;e[11]!==o?(l=o("automations.automationConfig.connectAiProviderHint"),e[11]=o,e[12]=l):l=e[12];let y;return e[13]!==l?(y=t.jsx("span",{className:"text-xs text-muted-foreground italic",children:l}),e[13]=l,e[14]=y):y=e[14],y}let u;e[15]!==o?(u=o("automations.automationConfig.pickModelPlaceholder"),e[15]=o,e[16]=u):u=e[16];let h;e[17]!==x||e[18]!==n?(h=l=>{const y=l.keyId??x??"";d(y),n({modelId:l.modelId,credentialId:y,title:l.title??l.modelId})},e[17]=x,e[18]=n,e[19]=h):h=e[19];let p;return e[20]!==x||e[21]!==g||e[22]!==u||e[23]!==h?(p=t.jsx("div",{className:"w-fit max-w-full",children:t.jsx(Ps,{variant:"bordered",placeholder:u,model:g,credentialId:x,onCredentialChange:d,onModelChange:h})}),e[20]=x,e[21]=g,e[22]=u,e[23]=h,e[24]=p):p=e[24],p}const Bt=[{key:"capabilities",headingKey:"automations.automationConfig.builtinCapabilities",icon:lt,tools:[{name:"web_search",titleKey:"automations.automationConfig.toolWebSearch",descriptionKey:"automations.automationConfig.toolWebSearchDesc",icon:it},{name:"generate_image",titleKey:"automations.automationConfig.toolGenerateImage",descriptionKey:"automations.automationConfig.toolGenerateImageDesc",icon:bs},{name:"subtask",titleKey:"automations.automationConfig.toolSubtask",descriptionKey:"automations.automationConfig.toolSubtaskDesc",icon:Qt},{name:"user_ask",titleKey:"automations.automationConfig.toolAskUser",descriptionKey:"automations.automationConfig.toolAskUserDesc",icon:fs}]},{key:"files",headingKey:"automations.automationConfig.filesCode",icon:St,tools:[{name:"read",titleKey:"automations.automationConfig.toolReadFile",descriptionKey:"automations.automationConfig.toolReadFileDesc",icon:ps},{name:"write",titleKey:"automations.automationConfig.toolWriteFile",descriptionKey:"automations.automationConfig.toolWriteFileDesc",icon:Ot},{name:"edit",titleKey:"automations.automationConfig.toolEditFile",descriptionKey:"automations.automationConfig.toolEditFileDesc",icon:xs},{name:"grep",titleKey:"automations.automationConfig.toolSearchContent",descriptionKey:"automations.automationConfig.toolSearchContentDesc",icon:vs},{name:"glob",titleKey:"automations.automationConfig.toolFindFiles",descriptionKey:"automations.automationConfig.toolFindFilesDesc",icon:St},{name:"bash",titleKey:"automations.automationConfig.toolRunCommand",descriptionKey:"automations.automationConfig.toolRunCommandDesc",icon:gs}]},{key:"context",headingKey:"automations.automationConfig.context",icon:kt,tools:[{name:"read_resource",titleKey:"automations.automationConfig.toolReadResource",descriptionKey:"automations.automationConfig.toolReadResourceDesc",icon:kt},{name:"read_prompt",titleKey:"automations.automationConfig.toolReadPrompt",descriptionKey:"automations.automationConfig.toolReadPromptDesc",icon:Tt},{name:"skill",titleKey:"automations.automationConfig.toolLoadSkill",descriptionKey:"automations.automationConfig.toolLoadSkillDesc",icon:Tt}]}],pa=Bt.flatMap(r=>r.tools.map(e=>e.name));function xa(r){const e=r.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):r}function ga(r){const e=q.c(12),{agentId:s,value:n,onChange:o}=r,i=ee();let c;e[0]!==i?(c=i("automations.automationConfig.toolsLabel"),e[0]=i,e[1]=c):c=e[1];let a;e[2]!==c?(a=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:c}),e[2]=c,e[3]=a):a=e[3];let j;e[4]!==s||e[5]!==o||e[6]!==i||e[7]!==n?(j=s?t.jsx(w.Suspense,{fallback:t.jsxs(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[t.jsx(lt,{size:14}),i("automations.automationConfig.loadingTools")]}),children:t.jsx(ha,{agentId:s,value:n,onChange:o})}):t.jsx("span",{className:"text-xs text-muted-foreground italic",children:i("automations.automationConfig.pickAgentFirst")}),e[4]=s,e[5]=o,e[6]=i,e[7]=n,e[8]=j):j=e[8];let d;return e[9]!==a||e[10]!==j?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,j]}),e[9]=a,e[10]=j,e[11]=d):d=e[11],d}function It(r){const e=q.c(17),{value:s,checked:n,onToggle:o,title:i,description:c,leading:a}=r;let j;e[0]!==n?(j=t.jsx(Ft,{checked:n,className:"pointer-events-none mt-0.5"}),e[0]=n,e[1]=j):j=e[1];let d;e[2]!==a?(d=a&&t.jsx("span",{className:"mt-px shrink-0",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==i?(m=t.jsx("span",{className:"truncate text-sm leading-tight",children:i}),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==c?(x=c&&t.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:c}),e[6]=c,e[7]=x):x=e[7];let f;e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10];let g;return e[11]!==o||e[12]!==j||e[13]!==d||e[14]!==f||e[15]!==s?(g=t.jsxs(Ns,{value:s,onSelect:o,className:"items-start gap-2.5 py-2",children:[j,d,f]}),e[11]=o,e[12]=j,e[13]=d,e[14]=f,e[15]=s,e[16]=g):g=e[16],g}function At(r){const e=q.c(27),{conn:s,label:n,icon:o,on:i,total:c,onToggle:a}=r,j=ee(),d=i===c;let m;e[0]!==o||e[1]!==s?(m=s?t.jsx(As,{icon:s.icon,name:s.title,size:"2xs"}):o?t.jsx(o,{size:14,className:"text-muted-foreground"}):t.jsx(ys,{size:14,className:"text-muted-foreground"}),e[0]=o,e[1]=s,e[2]=m):m=e[2];let x;e[3]!==s?.title||e[4]!==n||e[5]!==j?(x=s?.title??n??j("automations.automationConfig.otherTools"),e[3]=s?.title,e[4]=n,e[5]=j,e[6]=x):x=e[6];let f;e[7]!==x?(f=t.jsx("span",{className:"truncate",children:x}),e[7]=x,e[8]=f):f=e[8];let g;e[9]!==i||e[10]!==c?(g=t.jsxs("span",{className:"text-2xs font-normal tabular-nums text-muted-foreground/70",children:[i,"/",c]}),e[9]=i,e[10]=c,e[11]=g):g=e[11];let u;e[12]!==a?(u=v=>{v.stopPropagation(),a()},e[12]=a,e[13]=u):u=e[13];let h;e[14]!==d||e[15]!==j?(h=j(d?"automations.automationConfig.none":"automations.automationConfig.all"),e[14]=d,e[15]=j,e[16]=h):h=e[16];let p;e[17]!==u||e[18]!==h?(p=t.jsx("button",{type:"button",onClick:u,className:"text-2xs font-medium text-primary hover:underline",children:h}),e[17]=u,e[18]=h,e[19]=p):p=e[19];let l;e[20]!==g||e[21]!==p?(l=t.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[g,p]}),e[20]=g,e[21]=p,e[22]=l):l=e[22];let y;return e[23]!==m||e[24]!==f||e[25]!==l?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f,l]}),e[23]=m,e[24]=f,e[25]=l,e[26]=y):y=e[26],y}function ha(r){const e=q.c(83),{agentId:s,value:n,onChange:o}=r,i=ee(),{org:c}=$t(),[a,j]=w.useState(!1);let d;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(d={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=d):d=e[3];const m=Ds(d);let x;e[4]!==m?(x={client:m},e[4]=m,e[5]=x):x=e[5];const{data:f,isLoading:g}=Is(x),u=dt();let h,p,l,y,v,N,S,b,T,_,D,k,A;if(e[6]!==u||e[7]!==f?.tools||e[8]!==g||e[9]!==o||e[10]!==a||e[11]!==i||e[12]!==n){const Y=new Map(u.map(Ca)),H=new Map;for(const I of f?.tools??[]){const O=ws(I._meta)??"__other__",Q=_s(I.name,O==="__other__"?void 0:O),P=I.title,xe=P&&P!==I.name?P:xa(Q);H.has(O)||H.set(O,{clientId:O,conn:Y.get(O),tools:[]}),H.get(O).tools.push({name:I.name,display:xe,description:I.description})}const W=[...H.values()].sort(va),G=(f?.tools??[]).map(ba),J=[...pa,...G],V=n===null?new Set(J):new Set(n),U=J.every(I=>V.has(I)),E=I=>o(J.every(O=>I.has(O))?null:[...I]),oe=I=>{const O=new Set(V);O.has(I)?O.delete(I):O.add(I),E(O)},ne=(I,O)=>{const Q=new Set(V);for(const P of I)O?Q.add(P):Q.delete(P);E(Q)};y=Lt,A=a,v=j;let Z;e[26]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(lt,{size:14,className:"text-muted-foreground"}),e[26]=Z):Z=e[26];let ie;e[27]!==U||e[28]!==i?(ie=i(U?"automations.automationConfig.allTools":"automations.automationConfig.tools"),e[27]=U,e[28]=i,e[29]=ie):ie=e[29];const ue=!U&&t.jsxs(Kt,{variant:"secondary",className:"ml-0.5 tabular-nums",children:[V.size,"/",J.length]});let me;e[30]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[30]=me):me=e[30],e[31]!==ie||e[32]!==ue?(N=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[Z,ie,ue,me]})}),e[31]=ie,e[32]=ue,e[33]=N):N=e[33],l=Rt,D="p-0 w-80",k="start",p=Ss;let te;e[34]!==i?(te=i("automations.automationConfig.searchToolsPlaceholder"),e[34]=i,e[35]=te):te=e[35],e[36]!==te?(T=t.jsx(ks,{placeholder:te}),e[36]=te,e[37]=T):T=e[37];const fe=U?i("automations.automationConfig.allToolsEnabled",{count:J.length}):i("automations.automationConfig.toolsEnabledCount",{enabled:V.size,total:J.length});let se;e[38]!==fe?(se=t.jsx("span",{className:"text-xs text-muted-foreground",children:fe}),e[38]=fe,e[39]=se):se=e[39];let re;e[40]!==o?(re=()=>o(null),e[40]=o,e[41]=re):re=e[41];let le;e[42]!==i?(le=i("automations.automationConfig.selectAll"),e[42]=i,e[43]=le):le=e[43];let C;e[44]!==U||e[45]!==re||e[46]!==le?(C=t.jsx("button",{type:"button",onClick:re,disabled:U,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:le}),e[44]=U,e[45]=re,e[46]=le,e[47]=C):C=e[47];let M;e[48]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[48]=M):M=e[48];let z;e[49]!==o?(z=()=>o([]),e[49]=o,e[50]=z):z=e[50];const pe=V.size===0;let ae;e[51]!==i?(ae=i("automations.automationConfig.clear"),e[51]=i,e[52]=ae):ae=e[52];let ce;e[53]!==z||e[54]!==pe||e[55]!==ae?(ce=t.jsx("button",{type:"button",onClick:z,disabled:pe,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:ae}),e[53]=z,e[54]=pe,e[55]=ae,e[56]=ce):ce=e[56];let de;e[57]!==C||e[58]!==ce?(de=t.jsxs("div",{className:"flex items-center gap-2",children:[C,M,ce]}),e[57]=C,e[58]=ce,e[59]=de):de=e[59],e[60]!==se||e[61]!==de?(_=t.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[se,de]}),e[60]=se,e[61]=de,e[62]=_):_=e[62],h=Ts,S="max-h-80",b=g?t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("automations.automationConfig.loadingTools")}):t.jsxs(t.Fragment,{children:[t.jsx(Cs,{children:i("automations.automationConfig.noToolsFound")}),Bt.map(I=>{const O=I.tools.map(ya),Q=O.filter(P=>V.has(P)).length;return t.jsx(wt,{heading:t.jsx(At,{label:i(I.headingKey),icon:I.icon,on:Q,total:O.length,onToggle:()=>ne(O,Q!==O.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${i(P.titleKey)} ${P.name}`,checked:V.has(P.name),onToggle:()=>oe(P.name),title:i(P.titleKey),description:i(P.descriptionKey),leading:t.jsx(P.icon,{size:16,className:"text-muted-foreground"})},P.name))},I.key)}),W.map(I=>{const O=I.tools.map(ja),Q=O.filter(P=>V.has(P)).length;return t.jsx(wt,{heading:t.jsx(At,{conn:I.conn,on:Q,total:O.length,onToggle:()=>ne(O,Q!==O.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${P.display} ${P.name} ${I.conn?.title??""}`,checked:V.has(P.name),onToggle:()=>oe(P.name),title:P.display,description:P.description},P.name))},I.clientId)})]}),e[6]=u,e[7]=f?.tools,e[8]=g,e[9]=o,e[10]=a,e[11]=i,e[12]=n,e[13]=h,e[14]=p,e[15]=l,e[16]=y,e[17]=v,e[18]=N,e[19]=S,e[20]=b,e[21]=T,e[22]=_,e[23]=D,e[24]=k,e[25]=A}else h=e[13],p=e[14],l=e[15],y=e[16],v=e[17],N=e[18],S=e[19],b=e[20],T=e[21],_=e[22],D=e[23],k=e[24],A=e[25];let $;e[63]!==h||e[64]!==S||e[65]!==b?($=t.jsx(h,{className:S,children:b}),e[63]=h,e[64]=S,e[65]=b,e[66]=$):$=e[66];let R;e[67]!==p||e[68]!==$||e[69]!==T||e[70]!==_?(R=t.jsxs(p,{children:[T,_,$]}),e[67]=p,e[68]=$,e[69]=T,e[70]=_,e[71]=R):R=e[71];let K;e[72]!==l||e[73]!==R||e[74]!==D||e[75]!==k?(K=t.jsx(l,{className:D,align:k,children:R}),e[72]=l,e[73]=R,e[74]=D,e[75]=k,e[76]=K):K=e[76];let F;return e[77]!==y||e[78]!==v||e[79]!==N||e[80]!==K||e[81]!==A?(F=t.jsxs(y,{open:A,onOpenChange:v,children:[N,K]}),e[77]=y,e[78]=v,e[79]=N,e[80]=K,e[81]=A,e[82]=F):F=e[82],F}function ja(r){return r.name}function ya(r){return r.name}function ba(r){return r.name}function va(r,e){return(r.conn?.title??r.clientId).localeCompare(e.conn?.title??e.clientId)}function Ca(r){return[r.id,r]}function Re(r){const e=r.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function Na(r){if(!r)return"Unknown schedule";const e=r.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]??"1");return a%7===0?`Every ${a/7} weeks`:`Every ${a} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const a=(i[2]??"0").padStart(2,"0"),j=(i[1]??"0").padStart(2,"0");return`Every day at ${a}:${j} UTC`}const c=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(c){const j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(c[3]??"0")]??"day",d=(c[2]??"0").padStart(2,"0"),m=(c[1]??"0").padStart(2,"0");return`Every ${j} at ${d}:${m} UTC`}return r}function Sa(r,e){const s=Math.max(1,r);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function ka(r){const e=r.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return o?{count:parseInt(o[1]),unit:"days"}:null}function Ta(r,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[r]??r:r}const wa=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}],qe=aa.filter(r=>!sa.includes(r)),Gt=["any","earlier","later","statuses"],_a=r=>qe.some(e=>e===r),Da=r=>Gt.some(e=>e===r);function Ia({automationId:r,open:e,onOpenChange:s}){const n=ee(),{triggerAdd:o}=ve(),[i,c]=w.useState("in_progress"),[a,j]=w.useState("any"),[d,m]=w.useState([]),x=qe.filter(l=>l!==i),f=d.filter(l=>l!==i),g=a!=="statuses"||f.length>0,u=l=>{l||(c("in_progress"),j("any"),m([])),s(l)},h=async()=>{try{await o.mutateAsync({automation_id:r,type:"board_column_transition",column_key:i,from:a==="statuses"?{kind:a,statuses:f}:{kind:a}}),X.success(n("automations.addStarterPopover.starterAdded")),u(!1)}catch(l){X.error(l instanceof Error?l.message:n("automations.addStarterPopover.failedAddStarter"))}},p=l=>n(l==="any"?"automations.columnTransitionDialog.fromAny":l==="earlier"?"automations.columnTransitionDialog.fromEarlier":l==="later"?"automations.columnTransitionDialog.fromLater":"automations.columnTransitionDialog.fromColumns");return t.jsx(et,{open:e,onOpenChange:u,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(at,{children:n("automations.columnTransitionDialog.title")}),t.jsx(ot,{children:n("automations.columnTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.column")}),t.jsxs(ge,{value:i,onValueChange:l=>{_a(l)&&c(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:qe.map(l=>{const{label:y,visual:v}=We(l,n),N=v.icon;return t.jsxs(be,{value:l,children:[t.jsx(N,{size:14,className:Pt("shrink-0",v.iconClassName)}),y]},l)})})]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.origin")}),t.jsxs(ge,{value:a,onValueChange:l=>{Da(l)&&j(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Gt.map(l=>t.jsx(be,{value:l,children:p(l)},l))})]}),a==="statuses"&&t.jsx(Wt,{options:x.map(l=>({label:We(l,n).label,value:l})),defaultValue:f,onValueChange:m,placeholder:n("automations.columnTransitionDialog.columnsPlaceholder"),modalPopover:!0,className:"max-w-none"},i)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("automations.columnTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>u(!1),children:n("automations.columnTransitionDialog.cancel")}),t.jsx(B,{disabled:!g||o.isPending,onClick:h,children:n("automations.columnTransitionDialog.add")})]})]})})}const Ht=["any","earlier","later","statuses"],Aa=r=>Ht.some(e=>e===r);function Pa({automationId:r,boardId:e,open:s,onOpenChange:n}){const o=ee(),{triggerAdd:i}=ve(),c=qs(s?e:null),[a,j]=w.useState(null),[d,m]=w.useState("any"),[x,f]=w.useState([]),g=(c.data??[]).flatMap(b=>b.statuses.map(T=>({column:b.name,status:T}))),u=a??g[0]?.status??null,h=g.map(b=>b.status).filter(b=>b!==u),p=x.filter(b=>b!==u),l=u!==null&&(d!=="statuses"||p.length>0),y=b=>{b||(j(null),m("any"),f([])),n(b)},v=async()=>{if(u)try{await i.mutateAsync({automation_id:r,type:"jira_transition",jira_status:u,from:d==="statuses"?{kind:d,statuses:p}:{kind:d}}),X.success(o("automations.addStarterPopover.starterAdded")),y(!1)}catch(b){X.error(b instanceof Error?b.message:o("automations.addStarterPopover.failedAddStarter"))}},N=b=>o(b==="any"?"automations.jiraTransitionDialog.fromAny":b==="earlier"?"automations.jiraTransitionDialog.fromEarlier":b==="later"?"automations.jiraTransitionDialog.fromLater":"automations.jiraTransitionDialog.fromStatuses");let S;return c.isPending?S=t.jsx(es,{className:"h-9 w-full"}):c.isError||g.length===0?S=t.jsx("p",{className:"text-xs text-muted-foreground",children:o("automations.jiraTransitionDialog.noStatuses")}):S=t.jsxs(ge,{value:u??void 0,onValueChange:j,children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:g.map(b=>t.jsxs(be,{value:b.status,children:[b.status,b.column!==b.status&&t.jsx("span",{className:"text-muted-foreground",children:b.column})]},b.status))})]}),t.jsx(et,{open:s,onOpenChange:y,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(at,{children:o("automations.jiraTransitionDialog.title")}),t.jsx(ot,{children:o("automations.jiraTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:o("automations.jiraTransitionDialog.status")}),S]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:o("automations.jiraTransitionDialog.origin")}),t.jsxs(ge,{value:d,onValueChange:b=>{Aa(b)&&m(b)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ht.map(b=>t.jsx(be,{value:b,children:N(b)},b))})]}),d==="statuses"&&t.jsx(Wt,{options:h.map(b=>({label:b,value:b})),defaultValue:p,onValueChange:f,placeholder:o("automations.jiraTransitionDialog.statusesPlaceholder"),modalPopover:!0,className:"max-w-none"},u)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("automations.jiraTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>y(!1),children:o("automations.jiraTransitionDialog.cancel")}),t.jsx(B,{disabled:!l||i.isPending,onClick:v,children:o("automations.jiraTransitionDialog.add")})]})]})})}function $a({automationId:r,open:e,onOpenChange:s,onCustomSelect:n,onEventSelect:o,onWebhookCreated:i}){const c=ee(),{triggerAdd:a}=ve(),[j,d]=w.useState(!1),[m,x]=w.useState(!1),[f,g]=w.useState(!1),u=ea().data?.boardId??null,h=e??j,p=v=>{s?s(v):d(v)},l=async v=>{try{await a.mutateAsync({automation_id:r,type:"cron",cron_expression:v}),X.success(c("automations.addStarterPopover.starterAdded")),p(!1)}catch(N){const S=N instanceof Error?N.message:c("automations.addStarterPopover.failedAddStarter");X.error(S)}},y=async()=>{try{const v=await a.mutateAsync({automation_id:r,type:"webhook"});p(!1),v.webhook?i?.(v.webhook):X.success(c("automations.addStarterPopover.webhookStarterAdded"))}catch(v){const N=v instanceof Error?v.message:c("automations.addStarterPopover.failedAddWebhookStarter");X.error(N)}};return t.jsxs(t.Fragment,{children:[t.jsxs(ts,{open:h,onOpenChange:p,children:[t.jsx(ss,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",children:[t.jsx(ta,{size:14}),c("automations.addStarterPopover.addStarter")]})}),t.jsxs(as,{align:"end",className:"w-[240px]",children:[t.jsxs(os,{children:[t.jsxs(ns,{className:"gap-2.5",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.every")]}),t.jsx(is,{className:"w-[160px]",children:wa.map(v=>t.jsxs(ze,{className:"gap-2.5",onSelect:()=>l(v.cron),disabled:a.isPending,children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.everyUnit",{unit:v.label})]},v.cron))})]}),t.jsxs(ze,{className:"gap-2.5",onSelect:()=>{p(!1),n?.()},children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.customCron")]}),t.jsxs(ze,{className:"gap-2.5",onSelect:()=>{p(!1),o?.()},children:[t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.event")]}),t.jsxs(ze,{className:"gap-2.5",onSelect:()=>{p(!1),x(!0)},children:[t.jsx(Et,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.cardEntersColumn")]}),u&&t.jsxs(ze,{className:"gap-2.5",onSelect:()=>{p(!1),g(!0)},children:[t.jsx(Ut,{size:14,className:"shrink-0"}),c("automations.addStarterPopover.jiraIssueEntersStatus")]}),t.jsxs(ze,{className:"gap-2.5",onSelect:()=>{y()},disabled:a.isPending,children:[t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.webhook")]})]})]}),t.jsx(Ia,{automationId:r,open:m,onOpenChange:x}),u&&t.jsx(Pa,{automationId:r,boardId:u,open:f,onOpenChange:g})]})}function Jt(r){const e=q.c(39),{open:s,onOpenChange:n,url:o,token:i,title:c,description:a}=r,j=c===void 0?"Webhook ready":c,d=a===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":a,m=ee(),[x,f]=w.useState(null),[g,u]=w.useState("curl"),[h,p]=w.useState("header"),l=w.useId();let y;e[0]!==m?(y=async(W,G)=>{try{await navigator.clipboard.writeText(W),f(G),X.success(m("automations.webhookSecretDialog.copied")),setTimeout(()=>f(null),1500)}catch{X.error(m("automations.webhookSecretDialog.failedCopy"))}},e[0]=m,e[1]=y):y=e[1];const v=y;let N;e[2]!==h||e[3]!==i||e[4]!==o?(N=o&&i&&h==="url"?`${o.replace(/\/$/,"")}/${i}`:o??"",e[2]=h,e[3]=i,e[4]=o,e[5]=N):N=e[5];const S=N,b=o&&i?h==="header"?`curl -X POST "${S}" \\
1
+ import{c6 as Qt,c as q,b as ee,r as w,j as t,B,bx as qt,m as Pt,a5 as $t,D as et,v as tt,w as st,x as at,aT as ot,y as nt,t as X,bB as es,_ as ts,X as ss,Z as as,ap as os,an as ns,ao as is,Y as Oe,b3 as rs,h as Le,aH as pt,aI as xt,aJ as gt,aK as ht,bj as jt,aL as yt,aM as bt,aN as vt,E as Ke,aE as ls,c7 as Ct,I as Nt,c8 as cs,aj as ds,aZ as Qe,n as Xe,f as ms}from"./index-B0M6fld0.js";import{C as us}from"./index-BqYmVY5c.js";import{b as it,B as fs,a as ps,a3 as xs,m as St,at as gs,T as kt,au as hs,g as js,S as Me,av as Et,e as Ye}from"./agent-icon-2MzErGc_.js";import{n as Tt}from"./ShoppingBag01-BQMf6OTu.js";import{t as rt}from"./ChevronUp-D0xD4CWi.js";import{e as ys}from"./UserSquare-CPjVW48L.js";import{b as bs,e as lt,c as zt,t as Ot}from"./Tool01-CMaWHp8E.js";import{i as vs}from"./SearchMd-D2GFNI7a.js";import{B as Kt}from"./badge-CR0zmQ24.js";import{C as Ft}from"./checkbox-HvlgUNAP.js";import{S as ct}from"./switch-NBzUnGw4.js";import{a as Mt,b as Rt,P as Lt}from"./popover-CQC-Pea_.js";import{C as Cs,e as wt,b as Ns,f as Ss,a as ks,c as Ts}from"./command-BNUAVYAm.js";import{g as ws,s as _s}from"./tool-namespace-BMJphfly.js";import{u as dt}from"./use-connection-BLq1Zghk.js";import{u as Ds}from"./use-mcp-client-C8sFqQYs.js";import{u as Is}from"./use-mcp-tools-DMaf2rKI.js";import{I as As}from"./integration-icon-CbGo7Hoi.js";import{M as Ps}from"./select-model-JxuGnGfN.js";import{u as $s}from"./use-ai-providers-CegsSqNf.js";import{U as Es,b as zs}from"./build-improve-prompt-doc-BoBB4xB3.js";import{a as ve,c as Os,d as Ks}from"./use-automations-IINULJEn.js";import{c as Fs,b as Ms,h as Rs,t as Ls}from"./chat-context-DyGpAf46.js";import{b as Vs,C as Us,a as Ws}from"./collapsible-f_iRDMCl.js";import{c as Bs,T as Gs,a as Hs}from"./tooltip-DUgZeaAs.js";import{g as Js}from"./shell-layout-B_Je98M9.js";import{i as Vt}from"./ArrowLeft-Clex4DU3.js";import{i as Xs}from"./ArrowUp-DPT2wlR7.js";import{s as Ys}from"./Trash01-CrG-kC_D.js";import{s as mt}from"./XClose-BBI2UlVL.js";import{u as _t}from"./use-debounced-autosave-DI_mWee1.js";import{T as Zs,a as Qs}from"./input-WEG44w8N.js";import{u as qs,a as ea,J as Ut}from"./jira-icon-C8Fhxneh.js";import{s as ta}from"./Plus-DD-WVS1P.js";import{i as ut}from"./Zap-B1DyovfK.js";import{l as We,H as sa}from"./config-TryZ4RX0.js";import{C as aa}from"./task-board-r7mBQBfA.js";import{M as Wt}from"./multi-select-CrGD5Ooc.js";import{S as ge,b as he,a as je,d as ye,c as be}from"./select-taudESnf.js";import{c as oa,a as na,T as Dt}from"./tabs-B9Fkm8UP.js";import{MonacoCodeEditor as ia}from"./monaco-editor-CpFV1RfN.js";import{A as ra}from"./automation-runs-WkjLeJLn.js";import{C as la}from"./collection-tabs-B_be-L9Y.js";import{a as ca}from"./autosend-C5Y0g7p2.js";import"./use-mobile-JxzmRS3O.js";import"./use-sidebar-collapsed-D8frxAVL.js";import"./use-chat-layout-state-SKM2dTYC.js";import"./thread-route-CidpLna8.js";import"./thread-intent-B-lUepd6.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CwQVaju9.js";import"./toolbar-icon-button-DLb2L87M.js";import"./sheet-C5Vpqn4B.js";import"./resizable-ZTEIsDw7.js";import"./use-project-scope-BLJIcw6l.js";import"./repository-binding-D5Bfxppj.js";import"./AlertCircle-Cn7aLqGD.js";import"./LinkBroken01-BkclpWPr.js";import"./Globe04-DFwi3CoQ.js";import"./CheckCircle-l0BgBdex.js";import"./ChevronSelectorVertical-BbXlLdNT.js";import"./CreditCard01-CAgfpVLC.js";import"./SwitchHorizontal01-amrllZXH.js";import"./Key01-q3498IuC.js";import"./Minus-D2H1757g.js";import"./Monitor01-pdAw5Hpb.js";import"./Sun-BWeGTNdA.js";import"./Play-mj0Zbxy1.js";import"./Upload01-CyQARd6T.js";import"./Users01-BPY3vewQ.js";import"./index-woHs2Bei.js";import"./auth-Zsy5lyIS.js";import"./drawer-Cn25WPda.js";import"./index-CZHAvvQX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-entitlements-n2MsZM9p.js";import"./use-decopilot-events-CVaB2Rhy.js";import"./use-organization-settings-DgPYo7py.js";import"./schema-DDAhL9Cr.js";import"./index-BjDHxKQ1.js";import"./use-deployment-admin-CoSxtFqU.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-BFEgPANo.js";import"./use-navigate-to-agent-BPUG-DwT.js";import"./use-debounced-value-Df5Y0bKp.js";import"./new-project-dialog-xaa497EH.js";import"./label-C2-_lSSQ.js";import"./repository-picker-BG4RNPTd.js";import"./github-icon-Fl1CK57w.js";import"./useInfiniteQuery-CrPhADUx.js";import"./infiniteQueryObserver-CQdhIsL1.js";import"./collection-search-EpeR-DRK.js";import"./required-auth-layout-BDLyo6_T.js";import"./use-org-sso-CxdxMmbI.js";import"./suggestion-CJnvcEOz.js";import"./usage-stats-Db2409wH.js";import"./form-DlOI0nvB.js";import"./utils-CVEq3hMx.js";import"./markdown-CBPGMAeL.js";import"./use-copy-jRaPRTwC.js";import"./use-mcp-prompts-KGxEzqRw.js";import"./use-org-fs-BTZCBdxy.js";import"./core.esm-rLLWAwJX.js";import"./index-BdQq_4o_.js";import"./active-indicator-CCMhAsc_.js";import"./editor-D2cdCxzq.js";import"./table-B6HdX-5W.js";import"./empty-state-BBHWcru0.js";import"./use-id-selection-DlXip3K9.js";import"./use-infinite-scroll-qE2UPD2B.js";import"./task-status-nf4sWabv.js";import"./thread-sheet-body-CJ90Ecr4.js";import"./useSuspenseInfiniteQuery-B5oEM_Vd.js";import"./pair-CYQ33Koe.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Ct_65kSq.js";import"./types-D5f5_4KC.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-thread-outputs-BOXdgR_A.js";import"./file-type-icon-DKzfESDS.js";const Ze={fast:{labelKey:"automations.automationConfig.tierFast",subtitleKey:"automations.automationConfig.tierFastSubtitle",icon:js},smart:{labelKey:"automations.automationConfig.tierSmart",subtitleKey:"automations.automationConfig.tierSmartSubtitle",icon:Ot},thinking:{labelKey:"automations.automationConfig.tierThinking",subtitleKey:"automations.automationConfig.tierThinkingSubtitle",icon:hs}},da=["fast","smart","thinking"];function ma(r){const e=q.c(19),{tier:s,onSelect:n}=r,o=ee(),[i,c]=w.useState(!1),a=Ze[s].icon;let j;e[0]!==a?(j=t.jsx(a,{size:14,className:"text-muted-foreground"}),e[0]=a,e[1]=j):j=e[1];const d=Ze[s];let m;e[2]!==o||e[3]!==d.labelKey?(m=o(d.labelKey),e[2]=o,e[3]=d.labelKey,e[4]=m):m=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[5]=x):x=e[5];let f;e[6]!==j||e[7]!==m?(f=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[j,m,x]})}),e[6]=j,e[7]=m,e[8]=f):f=e[8];let g;e[9]!==n||e[10]!==o||e[11]!==s?(g=da.map(p=>{const l=Ze[p],y=l.icon;return t.jsxs("button",{type:"button",onClick:()=>{n(p),c(!1)},className:Pt("flex items-start gap-2 px-2 py-1.5 rounded-lg text-left hover:bg-accent"),children:[t.jsx(y,{size:16,className:"shrink-0 text-muted-foreground mt-0.5"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"text-sm",children:o(l.labelKey)}),t.jsx("div",{className:"text-xs text-muted-foreground",children:o(l.subtitleKey)})]}),p===s&&t.jsx(qt,{size:14,className:"text-foreground mt-0.5"})]},p)}),e[9]=n,e[10]=o,e[11]=s,e[12]=g):g=e[12];let u;e[13]!==g?(u=t.jsx(Rt,{align:"start",className:"p-1 w-64",children:t.jsx("div",{className:"flex flex-col",children:g})}),e[13]=g,e[14]=u):u=e[14];let h;return e[15]!==i||e[16]!==f||e[17]!==u?(h=t.jsxs(Lt,{open:i,onOpenChange:c,children:[f,u]}),e[15]=i,e[16]=f,e[17]=u,e[18]=h):h=e[18],h}function ua(r){const e=q.c(27),{tier:s,onTierChange:n,override:o,onOverrideChange:i}=r,c=ee(),[a,j]=w.useState(o!==null);let d;e[0]!==c?(d=c("automations.automationConfig.modelLabel"),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==d?(m=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:d}),e[2]=d,e[3]=m):m=e[3];let x;e[4]!==i||e[5]!==n||e[6]!==o||e[7]!==c||e[8]!==s||e[9]!==a?(x=a?t.jsx(w.Suspense,{fallback:t.jsx(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:c("automations.automationConfig.loadingModels")}),children:t.jsx(fa,{override:o,onOverrideChange:i})}):t.jsx(ma,{tier:s,onSelect:n}),e[4]=i,e[5]=n,e[6]=o,e[7]=c,e[8]=s,e[9]=a,e[10]=x):x=e[10];let f;e[11]!==i?(f=y=>{j(y),y||i(null)},e[11]=i,e[12]=f):f=e[12];let g;e[13]!==f||e[14]!==a?(g=t.jsx(ct,{checked:a,onCheckedChange:f,className:"cursor-pointer"}),e[13]=f,e[14]=a,e[15]=g):g=e[15];let u;e[16]!==c?(u=c("automations.automationConfig.specificModel"),e[16]=c,e[17]=u):u=e[17];let h;e[18]!==g||e[19]!==u?(h=t.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none",children:[g,u]}),e[18]=g,e[19]=u,e[20]=h):h=e[20];let p;e[21]!==x||e[22]!==h?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[x,h]}),e[21]=x,e[22]=h,e[23]=p):p=e[23];let l;return e[24]!==m||e[25]!==p?(l=t.jsxs("div",{className:"flex flex-col gap-2",children:[m,p]}),e[24]=m,e[25]=p,e[26]=l):l=e[26],l}function fa(r){const e=q.c(25),{override:s,onOverrideChange:n}=r,o=ee(),i=$s(),c=i[0]?.id??null;let a;e[0]!==c||e[1]!==i||e[2]!==s?.credentialId?(a=i.some(l=>l.id===s?.credentialId)?s?.credentialId??null:c,e[0]=c,e[1]=i,e[2]=s?.credentialId,e[3]=a):a=e[3];const[j,d]=w.useState(a);let m;e[4]!==j||e[5]!==c||e[6]!==i?(m=i.some(l=>l.id===j)?j:c,e[4]=j,e[5]=c,e[6]=i,e[7]=m):m=e[7];const x=m;let f;e[8]!==i||e[9]!==s?(f=s&&i.some(l=>l.id===s.credentialId)?{modelId:s.modelId,title:s.title||s.modelId,keyId:s.credentialId,providerId:"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[8]=i,e[9]=s,e[10]=f):f=e[10];const g=f;if(i.length===0){let l;e[11]!==o?(l=o("automations.automationConfig.connectAiProviderHint"),e[11]=o,e[12]=l):l=e[12];let y;return e[13]!==l?(y=t.jsx("span",{className:"text-xs text-muted-foreground italic",children:l}),e[13]=l,e[14]=y):y=e[14],y}let u;e[15]!==o?(u=o("automations.automationConfig.pickModelPlaceholder"),e[15]=o,e[16]=u):u=e[16];let h;e[17]!==x||e[18]!==n?(h=l=>{const y=l.keyId??x??"";d(y),n({modelId:l.modelId,credentialId:y,title:l.title??l.modelId})},e[17]=x,e[18]=n,e[19]=h):h=e[19];let p;return e[20]!==x||e[21]!==g||e[22]!==u||e[23]!==h?(p=t.jsx("div",{className:"w-fit max-w-full",children:t.jsx(Ps,{variant:"bordered",placeholder:u,model:g,credentialId:x,onCredentialChange:d,onModelChange:h})}),e[20]=x,e[21]=g,e[22]=u,e[23]=h,e[24]=p):p=e[24],p}const Bt=[{key:"capabilities",headingKey:"automations.automationConfig.builtinCapabilities",icon:lt,tools:[{name:"web_search",titleKey:"automations.automationConfig.toolWebSearch",descriptionKey:"automations.automationConfig.toolWebSearchDesc",icon:it},{name:"generate_image",titleKey:"automations.automationConfig.toolGenerateImage",descriptionKey:"automations.automationConfig.toolGenerateImageDesc",icon:bs},{name:"subtask",titleKey:"automations.automationConfig.toolSubtask",descriptionKey:"automations.automationConfig.toolSubtaskDesc",icon:Qt},{name:"user_ask",titleKey:"automations.automationConfig.toolAskUser",descriptionKey:"automations.automationConfig.toolAskUserDesc",icon:fs}]},{key:"files",headingKey:"automations.automationConfig.filesCode",icon:St,tools:[{name:"read",titleKey:"automations.automationConfig.toolReadFile",descriptionKey:"automations.automationConfig.toolReadFileDesc",icon:ps},{name:"write",titleKey:"automations.automationConfig.toolWriteFile",descriptionKey:"automations.automationConfig.toolWriteFileDesc",icon:zt},{name:"edit",titleKey:"automations.automationConfig.toolEditFile",descriptionKey:"automations.automationConfig.toolEditFileDesc",icon:xs},{name:"grep",titleKey:"automations.automationConfig.toolSearchContent",descriptionKey:"automations.automationConfig.toolSearchContentDesc",icon:vs},{name:"glob",titleKey:"automations.automationConfig.toolFindFiles",descriptionKey:"automations.automationConfig.toolFindFilesDesc",icon:St},{name:"bash",titleKey:"automations.automationConfig.toolRunCommand",descriptionKey:"automations.automationConfig.toolRunCommandDesc",icon:gs}]},{key:"context",headingKey:"automations.automationConfig.context",icon:kt,tools:[{name:"read_resource",titleKey:"automations.automationConfig.toolReadResource",descriptionKey:"automations.automationConfig.toolReadResourceDesc",icon:kt},{name:"read_prompt",titleKey:"automations.automationConfig.toolReadPrompt",descriptionKey:"automations.automationConfig.toolReadPromptDesc",icon:Tt},{name:"skill",titleKey:"automations.automationConfig.toolLoadSkill",descriptionKey:"automations.automationConfig.toolLoadSkillDesc",icon:Tt}]}],pa=Bt.flatMap(r=>r.tools.map(e=>e.name));function xa(r){const e=r.replace(/[_-]+/g," ").trim();return e?e.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase()):r}function ga(r){const e=q.c(12),{agentId:s,value:n,onChange:o}=r,i=ee();let c;e[0]!==i?(c=i("automations.automationConfig.toolsLabel"),e[0]=i,e[1]=c):c=e[1];let a;e[2]!==c?(a=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:c}),e[2]=c,e[3]=a):a=e[3];let j;e[4]!==s||e[5]!==o||e[6]!==i||e[7]!==n?(j=s?t.jsx(w.Suspense,{fallback:t.jsxs(B,{variant:"outline",size:"sm",disabled:!0,className:"w-fit",children:[t.jsx(lt,{size:14}),i("automations.automationConfig.loadingTools")]}),children:t.jsx(ha,{agentId:s,value:n,onChange:o})}):t.jsx("span",{className:"text-xs text-muted-foreground italic",children:i("automations.automationConfig.pickAgentFirst")}),e[4]=s,e[5]=o,e[6]=i,e[7]=n,e[8]=j):j=e[8];let d;return e[9]!==a||e[10]!==j?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[a,j]}),e[9]=a,e[10]=j,e[11]=d):d=e[11],d}function It(r){const e=q.c(17),{value:s,checked:n,onToggle:o,title:i,description:c,leading:a}=r;let j;e[0]!==n?(j=t.jsx(Ft,{checked:n,className:"pointer-events-none mt-0.5"}),e[0]=n,e[1]=j):j=e[1];let d;e[2]!==a?(d=a&&t.jsx("span",{className:"mt-px shrink-0",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==i?(m=t.jsx("span",{className:"truncate text-sm leading-tight",children:i}),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==c?(x=c&&t.jsx("span",{className:"line-clamp-2 text-xs leading-snug text-muted-foreground",children:c}),e[6]=c,e[7]=x):x=e[7];let f;e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10];let g;return e[11]!==o||e[12]!==j||e[13]!==d||e[14]!==f||e[15]!==s?(g=t.jsxs(Ns,{value:s,onSelect:o,className:"items-start gap-2.5 py-2",children:[j,d,f]}),e[11]=o,e[12]=j,e[13]=d,e[14]=f,e[15]=s,e[16]=g):g=e[16],g}function At(r){const e=q.c(27),{conn:s,label:n,icon:o,on:i,total:c,onToggle:a}=r,j=ee(),d=i===c;let m;e[0]!==o||e[1]!==s?(m=s?t.jsx(As,{icon:s.icon,name:s.title,size:"2xs"}):o?t.jsx(o,{size:14,className:"text-muted-foreground"}):t.jsx(ys,{size:14,className:"text-muted-foreground"}),e[0]=o,e[1]=s,e[2]=m):m=e[2];let x;e[3]!==s?.title||e[4]!==n||e[5]!==j?(x=s?.title??n??j("automations.automationConfig.otherTools"),e[3]=s?.title,e[4]=n,e[5]=j,e[6]=x):x=e[6];let f;e[7]!==x?(f=t.jsx("span",{className:"truncate",children:x}),e[7]=x,e[8]=f):f=e[8];let g;e[9]!==i||e[10]!==c?(g=t.jsxs("span",{className:"text-2xs font-normal tabular-nums text-muted-foreground/70",children:[i,"/",c]}),e[9]=i,e[10]=c,e[11]=g):g=e[11];let u;e[12]!==a?(u=v=>{v.stopPropagation(),a()},e[12]=a,e[13]=u):u=e[13];let h;e[14]!==d||e[15]!==j?(h=j(d?"automations.automationConfig.none":"automations.automationConfig.all"),e[14]=d,e[15]=j,e[16]=h):h=e[16];let p;e[17]!==u||e[18]!==h?(p=t.jsx("button",{type:"button",onClick:u,className:"text-2xs font-medium text-primary hover:underline",children:h}),e[17]=u,e[18]=h,e[19]=p):p=e[19];let l;e[20]!==g||e[21]!==p?(l=t.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[g,p]}),e[20]=g,e[21]=p,e[22]=l):l=e[22];let y;return e[23]!==m||e[24]!==f||e[25]!==l?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f,l]}),e[23]=m,e[24]=f,e[25]=l,e[26]=y):y=e[26],y}function ha(r){const e=q.c(83),{agentId:s,value:n,onChange:o}=r,i=ee(),{org:c}=$t(),[a,j]=w.useState(!1);let d;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(d={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=d):d=e[3];const m=Ds(d);let x;e[4]!==m?(x={client:m},e[4]=m,e[5]=x):x=e[5];const{data:f,isLoading:g}=Is(x),u=dt();let h,p,l,y,v,N,S,b,T,_,D,k,A;if(e[6]!==u||e[7]!==f?.tools||e[8]!==g||e[9]!==o||e[10]!==a||e[11]!==i||e[12]!==n){const Y=new Map(u.map(Ca)),H=new Map;for(const I of f?.tools??[]){const z=ws(I._meta)??"__other__",Q=_s(I.name,z==="__other__"?void 0:z),P=I.title,xe=P&&P!==I.name?P:xa(Q);H.has(z)||H.set(z,{clientId:z,conn:Y.get(z),tools:[]}),H.get(z).tools.push({name:I.name,display:xe,description:I.description})}const W=[...H.values()].sort(va),G=(f?.tools??[]).map(ba),J=[...pa,...G],V=n===null?new Set(J):new Set(n),U=J.every(I=>V.has(I)),E=I=>o(J.every(z=>I.has(z))?null:[...I]),oe=I=>{const z=new Set(V);z.has(I)?z.delete(I):z.add(I),E(z)},ne=(I,z)=>{const Q=new Set(V);for(const P of I)z?Q.add(P):Q.delete(P);E(Q)};y=Lt,A=a,v=j;let Z;e[26]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(lt,{size:14,className:"text-muted-foreground"}),e[26]=Z):Z=e[26];let ie;e[27]!==U||e[28]!==i?(ie=i(U?"automations.automationConfig.allTools":"automations.automationConfig.tools"),e[27]=U,e[28]=i,e[29]=ie):ie=e[29];const ue=!U&&t.jsxs(Kt,{variant:"secondary",className:"ml-0.5 tabular-nums",children:[V.size,"/",J.length]});let me;e[30]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{size:14,className:"text-muted-foreground"}),e[30]=me):me=e[30],e[31]!==ie||e[32]!==ue?(N=t.jsx(Mt,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",className:"w-fit gap-1.5",children:[Z,ie,ue,me]})}),e[31]=ie,e[32]=ue,e[33]=N):N=e[33],l=Rt,D="p-0 w-80",k="start",p=Ss;let te;e[34]!==i?(te=i("automations.automationConfig.searchToolsPlaceholder"),e[34]=i,e[35]=te):te=e[35],e[36]!==te?(T=t.jsx(ks,{placeholder:te}),e[36]=te,e[37]=T):T=e[37];const fe=U?i("automations.automationConfig.allToolsEnabled",{count:J.length}):i("automations.automationConfig.toolsEnabledCount",{enabled:V.size,total:J.length});let se;e[38]!==fe?(se=t.jsx("span",{className:"text-xs text-muted-foreground",children:fe}),e[38]=fe,e[39]=se):se=e[39];let re;e[40]!==o?(re=()=>o(null),e[40]=o,e[41]=re):re=e[41];let le;e[42]!==i?(le=i("automations.automationConfig.selectAll"),e[42]=i,e[43]=le):le=e[43];let C;e[44]!==U||e[45]!==re||e[46]!==le?(C=t.jsx("button",{type:"button",onClick:re,disabled:U,className:"text-xs font-medium text-primary hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:le}),e[44]=U,e[45]=re,e[46]=le,e[47]=C):C=e[47];let M;e[48]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[48]=M):M=e[48];let O;e[49]!==o?(O=()=>o([]),e[49]=o,e[50]=O):O=e[50];const pe=V.size===0;let ae;e[51]!==i?(ae=i("automations.automationConfig.clear"),e[51]=i,e[52]=ae):ae=e[52];let ce;e[53]!==O||e[54]!==pe||e[55]!==ae?(ce=t.jsx("button",{type:"button",onClick:O,disabled:pe,className:"text-xs font-medium text-muted-foreground hover:underline disabled:cursor-default disabled:opacity-40 disabled:no-underline",children:ae}),e[53]=O,e[54]=pe,e[55]=ae,e[56]=ce):ce=e[56];let de;e[57]!==C||e[58]!==ce?(de=t.jsxs("div",{className:"flex items-center gap-2",children:[C,M,ce]}),e[57]=C,e[58]=ce,e[59]=de):de=e[59],e[60]!==se||e[61]!==de?(_=t.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[se,de]}),e[60]=se,e[61]=de,e[62]=_):_=e[62],h=Ts,S="max-h-80",b=g?t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("automations.automationConfig.loadingTools")}):t.jsxs(t.Fragment,{children:[t.jsx(Cs,{children:i("automations.automationConfig.noToolsFound")}),Bt.map(I=>{const z=I.tools.map(ya),Q=z.filter(P=>V.has(P)).length;return t.jsx(wt,{heading:t.jsx(At,{label:i(I.headingKey),icon:I.icon,on:Q,total:z.length,onToggle:()=>ne(z,Q!==z.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${i(P.titleKey)} ${P.name}`,checked:V.has(P.name),onToggle:()=>oe(P.name),title:i(P.titleKey),description:i(P.descriptionKey),leading:t.jsx(P.icon,{size:16,className:"text-muted-foreground"})},P.name))},I.key)}),W.map(I=>{const z=I.tools.map(ja),Q=z.filter(P=>V.has(P)).length;return t.jsx(wt,{heading:t.jsx(At,{conn:I.conn,on:Q,total:z.length,onToggle:()=>ne(z,Q!==z.length)}),children:I.tools.map(P=>t.jsx(It,{value:`${P.display} ${P.name} ${I.conn?.title??""}`,checked:V.has(P.name),onToggle:()=>oe(P.name),title:P.display,description:P.description},P.name))},I.clientId)})]}),e[6]=u,e[7]=f?.tools,e[8]=g,e[9]=o,e[10]=a,e[11]=i,e[12]=n,e[13]=h,e[14]=p,e[15]=l,e[16]=y,e[17]=v,e[18]=N,e[19]=S,e[20]=b,e[21]=T,e[22]=_,e[23]=D,e[24]=k,e[25]=A}else h=e[13],p=e[14],l=e[15],y=e[16],v=e[17],N=e[18],S=e[19],b=e[20],T=e[21],_=e[22],D=e[23],k=e[24],A=e[25];let $;e[63]!==h||e[64]!==S||e[65]!==b?($=t.jsx(h,{className:S,children:b}),e[63]=h,e[64]=S,e[65]=b,e[66]=$):$=e[66];let R;e[67]!==p||e[68]!==$||e[69]!==T||e[70]!==_?(R=t.jsxs(p,{children:[T,_,$]}),e[67]=p,e[68]=$,e[69]=T,e[70]=_,e[71]=R):R=e[71];let K;e[72]!==l||e[73]!==R||e[74]!==D||e[75]!==k?(K=t.jsx(l,{className:D,align:k,children:R}),e[72]=l,e[73]=R,e[74]=D,e[75]=k,e[76]=K):K=e[76];let F;return e[77]!==y||e[78]!==v||e[79]!==N||e[80]!==K||e[81]!==A?(F=t.jsxs(y,{open:A,onOpenChange:v,children:[N,K]}),e[77]=y,e[78]=v,e[79]=N,e[80]=K,e[81]=A,e[82]=F):F=e[82],F}function ja(r){return r.name}function ya(r){return r.name}function ba(r){return r.name}function va(r,e){return(r.conn?.title??r.clientId).localeCompare(e.conn?.title??e.clientId)}function Ca(r){return[r.id,r]}function Re(r){const e=r.trim().split(/\s+/);return e.length!==5?!1:e.every(s=>/^[\d*/,-]+$/.test(s))}function Na(r){if(!r)return"Unknown schedule";const e=r.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return`Every ${s[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]??"1");return a%7===0?`Every ${a/7} weeks`:`Every ${a} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const a=(i[2]??"0").padStart(2,"0"),j=(i[1]??"0").padStart(2,"0");return`Every day at ${a}:${j} UTC`}const c=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(c){const j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(c[3]??"0")]??"day",d=(c[2]??"0").padStart(2,"0"),m=(c[1]??"0").padStart(2,"0");return`Every ${j} at ${d}:${m} UTC`}return r}function Sa(r,e){const s=Math.max(1,r);switch(e){case"minutes":return s===1?"* * * * *":`*/${s} * * * *`;case"hours":return s===1?"0 * * * *":`0 */${s} * * *`;case"days":return s===1?"0 0 * * *":`0 0 */${s} * *`;case"weeks":return s===1?"0 0 * * 1":`0 0 */${s*7} * *`}}function ka(r){const e=r.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const s=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(s)return{count:parseInt(s[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);return o?{count:parseInt(o[1]),unit:"days"}:null}function Ta(r,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[r]??r:r}const wa=[{label:"5 minutes",cron:"*/5 * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}],qe=aa.filter(r=>!sa.includes(r)),Gt=["any","earlier","later","statuses"],_a=r=>qe.some(e=>e===r),Da=r=>Gt.some(e=>e===r);function Ia({automationId:r,open:e,onOpenChange:s}){const n=ee(),{triggerAdd:o}=ve(),[i,c]=w.useState("in_progress"),[a,j]=w.useState("any"),[d,m]=w.useState([]),x=qe.filter(l=>l!==i),f=d.filter(l=>l!==i),g=a!=="statuses"||f.length>0,u=l=>{l||(c("in_progress"),j("any"),m([])),s(l)},h=async()=>{try{await o.mutateAsync({automation_id:r,type:"board_column_transition",column_key:i,from:a==="statuses"?{kind:a,statuses:f}:{kind:a}}),X.success(n("automations.addStarterPopover.starterAdded")),u(!1)}catch(l){X.error(l instanceof Error?l.message:n("automations.addStarterPopover.failedAddStarter"))}},p=l=>n(l==="any"?"automations.columnTransitionDialog.fromAny":l==="earlier"?"automations.columnTransitionDialog.fromEarlier":l==="later"?"automations.columnTransitionDialog.fromLater":"automations.columnTransitionDialog.fromColumns");return t.jsx(et,{open:e,onOpenChange:u,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(at,{children:n("automations.columnTransitionDialog.title")}),t.jsx(ot,{children:n("automations.columnTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.column")}),t.jsxs(ge,{value:i,onValueChange:l=>{_a(l)&&c(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:qe.map(l=>{const{label:y,visual:v}=We(l,n),N=v.icon;return t.jsxs(be,{value:l,children:[t.jsx(N,{size:14,className:Pt("shrink-0",v.iconClassName)}),y]},l)})})]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n("automations.columnTransitionDialog.origin")}),t.jsxs(ge,{value:a,onValueChange:l=>{Da(l)&&j(l)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Gt.map(l=>t.jsx(be,{value:l,children:p(l)},l))})]}),a==="statuses"&&t.jsx(Wt,{options:x.map(l=>({label:We(l,n).label,value:l})),defaultValue:f,onValueChange:m,placeholder:n("automations.columnTransitionDialog.columnsPlaceholder"),modalPopover:!0,className:"max-w-none"},i)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("automations.columnTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>u(!1),children:n("automations.columnTransitionDialog.cancel")}),t.jsx(B,{disabled:!g||o.isPending,onClick:h,children:n("automations.columnTransitionDialog.add")})]})]})})}const Ht=["any","earlier","later","statuses"],Aa=r=>Ht.some(e=>e===r);function Pa({automationId:r,boardId:e,open:s,onOpenChange:n}){const o=ee(),{triggerAdd:i}=ve(),c=qs(s?e:null),[a,j]=w.useState(null),[d,m]=w.useState("any"),[x,f]=w.useState([]),g=(c.data??[]).flatMap(b=>b.statuses.map(T=>({column:b.name,status:T}))),u=a??g[0]?.status??null,h=g.map(b=>b.status).filter(b=>b!==u),p=x.filter(b=>b!==u),l=u!==null&&(d!=="statuses"||p.length>0),y=b=>{b||(j(null),m("any"),f([])),n(b)},v=async()=>{if(u)try{await i.mutateAsync({automation_id:r,type:"jira_transition",jira_status:u,from:d==="statuses"?{kind:d,statuses:p}:{kind:d}}),X.success(o("automations.addStarterPopover.starterAdded")),y(!1)}catch(b){X.error(b instanceof Error?b.message:o("automations.addStarterPopover.failedAddStarter"))}},N=b=>o(b==="any"?"automations.jiraTransitionDialog.fromAny":b==="earlier"?"automations.jiraTransitionDialog.fromEarlier":b==="later"?"automations.jiraTransitionDialog.fromLater":"automations.jiraTransitionDialog.fromStatuses");let S;return c.isPending?S=t.jsx(es,{className:"h-9 w-full"}):c.isError||g.length===0?S=t.jsx("p",{className:"text-xs text-muted-foreground",children:o("automations.jiraTransitionDialog.noStatuses")}):S=t.jsxs(ge,{value:u??void 0,onValueChange:j,children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:g.map(b=>t.jsxs(be,{value:b.status,children:[b.status,b.column!==b.status&&t.jsx("span",{className:"text-muted-foreground",children:b.column})]},b.status))})]}),t.jsx(et,{open:s,onOpenChange:y,children:t.jsxs(tt,{className:"max-w-md",children:[t.jsxs(st,{children:[t.jsx(at,{children:o("automations.jiraTransitionDialog.title")}),t.jsx(ot,{children:o("automations.jiraTransitionDialog.description")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:o("automations.jiraTransitionDialog.status")}),S]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:o("automations.jiraTransitionDialog.origin")}),t.jsxs(ge,{value:d,onValueChange:b=>{Aa(b)&&m(b)},children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{})}),t.jsx(ye,{children:Ht.map(b=>t.jsx(be,{value:b,children:N(b)},b))})]}),d==="statuses"&&t.jsx(Wt,{options:h.map(b=>({label:b,value:b})),defaultValue:p,onValueChange:f,placeholder:o("automations.jiraTransitionDialog.statusesPlaceholder"),modalPopover:!0,className:"max-w-none"},u)]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("automations.jiraTransitionDialog.help")})]}),t.jsxs(nt,{children:[t.jsx(B,{variant:"ghost",onClick:()=>y(!1),children:o("automations.jiraTransitionDialog.cancel")}),t.jsx(B,{disabled:!l||i.isPending,onClick:v,children:o("automations.jiraTransitionDialog.add")})]})]})})}function $a({automationId:r,open:e,onOpenChange:s,onCustomSelect:n,onEventSelect:o,onWebhookCreated:i}){const c=ee(),{triggerAdd:a}=ve(),[j,d]=w.useState(!1),[m,x]=w.useState(!1),[f,g]=w.useState(!1),u=ea().data?.boardId??null,h=e??j,p=v=>{s?s(v):d(v)},l=async v=>{try{await a.mutateAsync({automation_id:r,type:"cron",cron_expression:v}),X.success(c("automations.addStarterPopover.starterAdded")),p(!1)}catch(N){const S=N instanceof Error?N.message:c("automations.addStarterPopover.failedAddStarter");X.error(S)}},y=async()=>{try{const v=await a.mutateAsync({automation_id:r,type:"webhook"});p(!1),v.webhook?i?.(v.webhook):X.success(c("automations.addStarterPopover.webhookStarterAdded"))}catch(v){const N=v instanceof Error?v.message:c("automations.addStarterPopover.failedAddWebhookStarter");X.error(N)}};return t.jsxs(t.Fragment,{children:[t.jsxs(ts,{open:h,onOpenChange:p,children:[t.jsx(ss,{asChild:!0,children:t.jsxs(B,{variant:"outline",size:"sm",children:[t.jsx(ta,{size:14}),c("automations.addStarterPopover.addStarter")]})}),t.jsxs(as,{align:"end",className:"w-[240px]",children:[t.jsxs(os,{children:[t.jsxs(ns,{className:"gap-2.5",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.every")]}),t.jsx(is,{className:"w-[160px]",children:wa.map(v=>t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>l(v.cron),disabled:a.isPending,children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.everyUnit",{unit:v.label})]},v.cron))})]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),n?.()},children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.customCron")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),o?.()},children:[t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.event")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),x(!0)},children:[t.jsx(Et,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.cardEntersColumn")]}),u&&t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{p(!1),g(!0)},children:[t.jsx(Ut,{size:14,className:"shrink-0"}),c("automations.addStarterPopover.jiraIssueEntersStatus")]}),t.jsxs(Oe,{className:"gap-2.5",onSelect:()=>{y()},disabled:a.isPending,children:[t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}),c("automations.addStarterPopover.webhook")]})]})]}),t.jsx(Ia,{automationId:r,open:m,onOpenChange:x}),u&&t.jsx(Pa,{automationId:r,boardId:u,open:f,onOpenChange:g})]})}function Jt(r){const e=q.c(39),{open:s,onOpenChange:n,url:o,token:i,title:c,description:a}=r,j=c===void 0?"Webhook ready":c,d=a===void 0?"Send a POST to this URL with the bearer token to fire the automation. The token is shown once — copy it now.":a,m=ee(),[x,f]=w.useState(null),[g,u]=w.useState("curl"),[h,p]=w.useState("header"),l=w.useId();let y;e[0]!==m?(y=async(W,G)=>{try{await navigator.clipboard.writeText(W),f(G),X.success(m("automations.webhookSecretDialog.copied")),setTimeout(()=>f(null),1500)}catch{X.error(m("automations.webhookSecretDialog.failedCopy"))}},e[0]=m,e[1]=y):y=e[1];const v=y;let N;e[2]!==h||e[3]!==i||e[4]!==o?(N=o&&i&&h==="url"?`${o.replace(/\/$/,"")}/${i}`:o??"",e[2]=h,e[3]=i,e[4]=o,e[5]=N):N=e[5];const S=N,b=o&&i?h==="header"?`curl -X POST "${S}" \\
2
2
  -H "Authorization: Bearer ${i}" \\
3
3
  -H "Content-Type: application/json" \\
4
4
  -d '{"hello":"world"}'`:`curl -X POST "${S}" \\
@@ -16,5 +16,5 @@ import{c6 as Qt,c as q,b as ee,r as w,j as t,B,bx as qt,m as Pt,a5 as $t,D as et
16
16
  "Content-Type": "application/json",
17
17
  },
18
18
  body: JSON.stringify({ hello: "world" }),
19
- });`:"",_=g==="curl"?b:T;let D;e[6]!==j?(D=t.jsx(at,{children:j}),e[6]=j,e[7]=D):D=e[7];let k;e[8]!==d?(k=t.jsx(ot,{children:d}),e[8]=d,e[9]=k):k=e[9];let A;e[10]!==D||e[11]!==k?(A=t.jsxs(st,{children:[D,k]}),e[10]=D,e[11]=k,e[12]=A):A=e[12];let $;e[13]!==h||e[14]!==x||e[15]!==v||e[16]!==S||e[17]!==g||e[18]!==_||e[19]!==m||e[20]!==i||e[21]!==l||e[22]!==o?($=o&&i?t.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.url")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:S}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(S,"url"),children:[t.jsx(Ye,{size:13}),m(x==="url"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.tokenLabel")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:i}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(i,"token"),children:[t.jsx(Ye,{size:13}),m(x==="token"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.snippet")}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(oa,{value:g,onValueChange:W=>u(W),children:t.jsxs(na,{className:"h-8 p-[2px]",children:[t.jsx(Dt,{value:"curl",className:"h-7 px-2.5 text-xs",children:"curl"}),t.jsx(Dt,{value:"fetch",className:"h-7 px-2.5 text-xs",children:"fetch"})]})}),t.jsxs("label",{htmlFor:l,className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none",children:[t.jsx(Ft,{id:l,checked:h==="url",onCheckedChange:W=>p(W?"url":"header")}),m("automations.webhookSecretDialog.tokenInUrl")]})]}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(_,"example"),children:[t.jsx(Ye,{size:13}),m(x==="example"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]}),t.jsx("div",{className:"rounded-md border overflow-hidden min-w-0",children:t.jsx(ia,{code:_,language:g==="curl"?"shell":"typescript",readOnly:!0,disableDiagnostics:!0,height:180})})]})]}):null,e[13]=h,e[14]=x,e[15]=v,e[16]=S,e[17]=g,e[18]=_,e[19]=m,e[20]=i,e[21]=l,e[22]=o,e[23]=$):$=e[23];let R;e[24]!==n?(R=()=>n(!1),e[24]=n,e[25]=R):R=e[25];let K;e[26]!==m?(K=m("automations.webhookSecretDialog.done"),e[26]=m,e[27]=K):K=e[27];let F;e[28]!==K||e[29]!==R?(F=t.jsx(nt,{children:t.jsx(B,{onClick:R,children:K})}),e[28]=K,e[29]=R,e[30]=F):F=e[30];let Y;e[31]!==F||e[32]!==A||e[33]!==$?(Y=t.jsxs(tt,{className:"max-w-lg",children:[A,$,F]}),e[31]=F,e[32]=A,e[33]=$,e[34]=Y):Y=e[34];let H;return e[35]!==n||e[36]!==s||e[37]!==Y?(H=t.jsx(et,{open:s,onOpenChange:n,children:Y}),e[35]=n,e[36]=s,e[37]=Y,e[38]=H):H=e[38],H}async function Ea(r){const{cronExpression:e,automationId:s,oldTriggerId:n,addTrigger:o,removeTrigger:i}=r,c=await o({automation_id:s,type:"cron",cron_expression:e});try{await i({trigger_id:n,automation_id:s})}catch(a){throw await i({trigger_id:c.id,automation_id:s}).catch(()=>{}),a}}function Xt(r){const e=q.c(153),{trigger:s,automationId:n,connectionName:o,readOnly:i}=r,c=i===void 0?!1:i,a=ee(),{triggerAdd:j,triggerRemove:d,triggerRotateToken:m}=ve(),[x,f]=w.useState(!1),[g,u]=w.useState(!1),[h,p]=w.useState(null);let l;e[0]!==s.cron_expression?(l=s.cron_expression?ka(s.cron_expression):null,e[0]=s.cron_expression,e[1]=l):l=e[1];const y=l,[v,N]=w.useState(y?.count??1),[S,b]=w.useState(!1),[T,_]=w.useState(s.cron_expression??""),D=d.isPending||j.isPending||m.isPending,k=s.type==="cron",A=s.type==="webhook",$=s.type==="board_column_transition";let R;e[2]!==a||e[3]!==s.type?(R=s.type==="board_pr_ready"?a("automations.triggerCard.prReady"):s.type==="linked_chat_run"?a("automations.triggerCard.linkedChatRun"):s.type==="board_pr_merged"?a("automations.triggerCard.prMerged"):s.type==="chat_pr_opened"?a("automations.triggerCard.chatPrOpened"):s.type==="card_mention"?a("automations.triggerCard.cardMention"):null,e[2]=a,e[3]=s.type,e[4]=R):R=e[4];const K=R,F=s.type==="jira_transition";let Y;e[5]!==n||e[6]!==d||e[7]!==a||e[8]!==s.id?(Y=async()=>{try{await d.mutateAsync({trigger_id:s.id,automation_id:n}),X.success(a("automations.triggerCard.starterRemoved"))}catch{X.error(a("automations.triggerCard.failedToRemoveStarter"))}f(!1)},e[5]=n,e[6]=d,e[7]=a,e[8]=s.id,e[9]=Y):Y=e[9];const H=Y;let W;e[10]!==j||e[11]!==n||e[12]!==d||e[13]!==s.id?(W=L=>Ea({cronExpression:L,automationId:n,oldTriggerId:s.id,addTrigger:Fe=>j.mutateAsync(Fe),removeTrigger:Fe=>d.mutateAsync(Fe)}),e[10]=j,e[11]=n,e[12]=d,e[13]=s.id,e[14]=W):W=e[14];const G=W;let J;e[15]!==T||e[16]!==G||e[17]!==a||e[18]!==s.cron_expression?(J=async()=>{const L=T.trim();if(!L||!Re(L)||L===s.cron_expression){b(!1),_(s.cron_expression??"");return}try{await G(L),b(!1)}catch{X.error(a("automations.triggerCard.failedToUpdateStarter")),_(s.cron_expression??""),b(!1)}},e[15]=T,e[16]=G,e[17]=a,e[18]=s.cron_expression,e[19]=J):J=e[19];const V=J;let U;e[20]!==n||e[21]!==m||e[22]!==a||e[23]!==s.id?(U=async()=>{u(!1);try{const L=await m.mutateAsync({trigger_id:s.id,automation_id:n});p({url:L.url,token:L.token})}catch{X.error(a("automations.triggerCard.failedToRotateToken"))}},e[20]=n,e[21]=m,e[22]=a,e[23]=s.id,e[24]=U):U=e[24];const E=U;let oe;e[25]!==y||e[26]!==G||e[27]!==a||e[28]!==s.cron_expression?(oe=async L=>{if(!y)return;const Fe=y.unit==="minutes"?5:1,Je=Math.max(Fe,L);Je!==L&&N(Je);const ft=Sa(Je,y.unit);if(ft!==s.cron_expression)try{await G(ft)}catch{X.error(a("automations.triggerCard.failedToUpdateStarter")),N(y.count)}},e[25]=y,e[26]=G,e[27]=a,e[28]=s.cron_expression,e[29]=oe):oe=e[29];const ne=oe;let Z;e[30]!==$||e[31]!==k||e[32]!==F||e[33]!==A||e[34]!==K?(Z=k?t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}):F?t.jsx(Ut,{size:14,className:"shrink-0"}):$||K?t.jsx(Et,{size:14,className:"text-muted-foreground shrink-0"}):A?t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}):t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=$,e[31]=k,e[32]=F,e[33]=A,e[34]=K,e[35]=Z):Z=e[35];let ie;e[36]!==o||e[37]!==v||e[38]!==T||e[39]!==ne||e[40]!==V||e[41]!==y||e[42]!==$||e[43]!==k||e[44]!==S||e[45]!==F||e[46]!==D||e[47]!==A||e[48]!==K||e[49]!==a||e[50]!==s.column_key||e[51]!==s.cron_expression||e[52]!==s.event_type||e[53]!==s.from||e[54]!==s.params?(ie=y&&k?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:a("automations.triggerCard.every")}),t.jsx("input",{type:"number",min:y.unit==="minutes"?5:1,value:v,onChange:L=>N(parseInt(L.target.value)||1),onBlur:()=>ne(v),onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&N(y.count)},disabled:D,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus-ring"}),t.jsx("span",{className:"text-sm",children:Ta(y.unit,v)})]}):k&&S?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:T,onChange:L=>_(L.target.value),onBlur:V,onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&(b(!1),_(s.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),T&&!Re(T)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:a("automations.triggerCard.invalid")})]}):t.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[t.jsx("span",{className:"text-sm font-mono text-xs text-muted-foreground truncate",children:k?Na(s.cron_expression??""):$?a("automations.triggerCard.cardEntersColumn",{lane:We(s.column_key??"",a).label}):K||(F?a("automations.triggerCard.issueEntersJiraStatus",{status:s.column_key??""}):A?a("automations.triggerCard.webhookPostToFire"):`${s.event_type}${o?` · ${o}`:""}`)}),$&&t.jsx(za,{from:s.from}),F&&t.jsx(Ka,{from:s.from}),!k&&!A&&!$&&!K&&!F&&s.params&&Object.keys(s.params).length>0&&t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:Object.entries(s.params).map(Oa).join(", ")})]}),e[36]=o,e[37]=v,e[38]=T,e[39]=ne,e[40]=V,e[41]=y,e[42]=$,e[43]=k,e[44]=S,e[45]=F,e[46]=D,e[47]=A,e[48]=K,e[49]=a,e[50]=s.column_key,e[51]=s.cron_expression,e[52]=s.event_type,e[53]=s.from,e[54]=s.params,e[55]=ie):ie=e[55];let ue;e[56]!==D?(ue=D&&t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),e[56]=D,e[57]=ue):ue=e[57];let me;e[58]!==y||e[59]!==k||e[60]!==S||e[61]!==a||e[62]!==s.cron_expression?(me=k&&!y&&!S&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity","aria-label":a("automations.triggerCard.editSchedule"),onClick:()=>{_(s.cron_expression??""),b(!0)},children:t.jsx(Ot,{size:13,className:"text-muted-foreground"})}),e[58]=y,e[59]=k,e[60]=S,e[61]=a,e[62]=s.cron_expression,e[63]=me):me=e[63];let te;e[64]!==A||e[65]!==a?(te=A&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity",title:a("automations.triggerCard.rotateToken"),"aria-label":a("automations.triggerCard.rotateToken"),onClick:()=>u(!0),children:t.jsx(rs,{size:13,className:"text-muted-foreground"})}),e[64]=A,e[65]=a,e[66]=te):te=e[66];let fe;e[67]!==c||e[68]!==a?(fe=!c&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity","aria-label":a("automations.triggerCard.removeStarter"),onClick:()=>f(!0),children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),e[67]=c,e[68]=a,e[69]=fe):fe=e[69];let se;e[70]!==ue||e[71]!==me||e[72]!==te||e[73]!==fe?(se=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[ue,me,te,fe]}),e[70]=ue,e[71]=me,e[72]=te,e[73]=fe,e[74]=se):se=e[74];let re;e[75]!==ie||e[76]!==se||e[77]!==Z?(re=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 surface group",children:[Z,ie,se]}),e[75]=ie,e[76]=se,e[77]=Z,e[78]=re):re=e[78];let le;e[79]!==a?(le=a("automations.triggerCard.removeStarter"),e[79]=a,e[80]=le):le=e[80];let C;e[81]!==le?(C=t.jsx(pt,{children:le}),e[81]=le,e[82]=C):C=e[82];let M;e[83]!==a?(M=a("automations.triggerCard.confirmRemoveStarter"),e[83]=a,e[84]=M):M=e[84];let z;e[85]!==M?(z=t.jsx(xt,{children:M}),e[85]=M,e[86]=z):z=e[86];let pe;e[87]!==C||e[88]!==z?(pe=t.jsxs(gt,{children:[C,z]}),e[87]=C,e[88]=z,e[89]=pe):pe=e[89];let ae;e[90]!==a?(ae=a("automations.triggerCard.cancel"),e[90]=a,e[91]=ae):ae=e[91];let ce;e[92]!==ae?(ce=t.jsx(ht,{children:ae}),e[92]=ae,e[93]=ce):ce=e[93];let de;e[94]!==a?(de=a("automations.triggerCard.remove"),e[94]=a,e[95]=de):de=e[95];let I;e[96]!==H||e[97]!==de?(I=t.jsx(jt,{onClick:H,variant:"destructive",children:de}),e[96]=H,e[97]=de,e[98]=I):I=e[98];let O;e[99]!==ce||e[100]!==I?(O=t.jsxs(yt,{children:[ce,I]}),e[99]=ce,e[100]=I,e[101]=O):O=e[101];let Q;e[102]!==pe||e[103]!==O?(Q=t.jsxs(bt,{children:[pe,O]}),e[102]=pe,e[103]=O,e[104]=Q):Q=e[104];let P;e[105]!==x||e[106]!==Q?(P=t.jsx(vt,{open:x,onOpenChange:f,children:Q}),e[105]=x,e[106]=Q,e[107]=P):P=e[107];let xe;e[108]!==a?(xe=a("automations.triggerCard.rotateWebhookToken"),e[108]=a,e[109]=xe):xe=e[109];let Ce;e[110]!==xe?(Ce=t.jsx(pt,{children:xe}),e[110]=xe,e[111]=Ce):Ce=e[111];let Ne;e[112]!==a?(Ne=a("automations.triggerCard.rotateWebhookTokenDescription"),e[112]=a,e[113]=Ne):Ne=e[113];let Se;e[114]!==Ne?(Se=t.jsx(xt,{children:Ne}),e[114]=Ne,e[115]=Se):Se=e[115];let ke;e[116]!==Ce||e[117]!==Se?(ke=t.jsxs(gt,{children:[Ce,Se]}),e[116]=Ce,e[117]=Se,e[118]=ke):ke=e[118];let Te;e[119]!==a?(Te=a("automations.triggerCard.cancel"),e[119]=a,e[120]=Te):Te=e[120];let we;e[121]!==Te?(we=t.jsx(ht,{children:Te}),e[121]=Te,e[122]=we):we=e[122];let _e;e[123]!==a?(_e=a("automations.triggerCard.rotate"),e[123]=a,e[124]=_e):_e=e[124];let De;e[125]!==E||e[126]!==_e?(De=t.jsx(jt,{onClick:E,children:_e}),e[125]=E,e[126]=_e,e[127]=De):De=e[127];let Ie;e[128]!==we||e[129]!==De?(Ie=t.jsxs(yt,{children:[we,De]}),e[128]=we,e[129]=De,e[130]=Ie):Ie=e[130];let Ae;e[131]!==ke||e[132]!==Ie?(Ae=t.jsxs(bt,{children:[ke,Ie]}),e[131]=ke,e[132]=Ie,e[133]=Ae):Ae=e[133];let Pe;e[134]!==g||e[135]!==Ae?(Pe=t.jsx(vt,{open:g,onOpenChange:u,children:Ae}),e[134]=g,e[135]=Ae,e[136]=Pe):Pe=e[136];const Be=h!==null;let Ve;e[137]===Symbol.for("react.memo_cache_sentinel")?(Ve=L=>{L||p(null)},e[137]=Ve):Ve=e[137];const Ge=h?.url??null,He=h?.token??null;let $e;e[138]!==a?($e=a("automations.triggerCard.newWebhookToken"),e[138]=a,e[139]=$e):$e=e[139];let Ee;e[140]!==a?(Ee=a("automations.triggerCard.newWebhookTokenDescription"),e[140]=a,e[141]=Ee):Ee=e[141];let Oe;e[142]!==Be||e[143]!==Ge||e[144]!==He||e[145]!==$e||e[146]!==Ee?(Oe=t.jsx(Jt,{open:Be,onOpenChange:Ve,url:Ge,token:He,title:$e,description:Ee}),e[142]=Be,e[143]=Ge,e[144]=He,e[145]=$e,e[146]=Ee,e[147]=Oe):Oe=e[147];let Ue;return e[148]!==re||e[149]!==P||e[150]!==Pe||e[151]!==Oe?(Ue=t.jsxs(t.Fragment,{children:[re,P,Pe,Oe]}),e[148]=re,e[149]=P,e[150]=Pe,e[151]=Oe,e[152]=Ue):Ue=e[152],Ue}function Oa(r){const[e,s]=r;return`${e}: ${s}`}function za(r){const e=q.c(10),{from:s}=r,n=ee();let o;e[0]!==s||e[1]!==n?(o=!s||s.kind==="any"?null:s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.map(m=>We(m,n).label).join(", ")}):null,e[0]=s,e[1]=n,e[2]=o):o=e[2];const i=o;let c;e[3]!==n?(c=n("automations.triggerCard.unownedOnly"),e[3]=n,e[4]=c):c=e[4];let a;e[5]!==i||e[6]!==c?(a=[i,c].filter(Boolean),e[5]=i,e[6]=c,e[7]=a):a=e[7];const j=a.join(" · ");let d;return e[8]!==j?(d=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:j}),e[8]=j,e[9]=d):d=e[9],d}function Ka(r){const e=q.c(6),{from:s}=r,n=ee();if(!s||s.kind==="any")return null;let o;e[0]!==s.kind||e[1]!==s.statuses||e[2]!==n?(o=s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.join(", ")}):null,e[0]=s.kind,e[1]=s.statuses,e[2]=n,e[3]=o):o=e[3];let i;return e[4]!==o?(i=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:o}),e[4]=o,e[5]=i):i=e[5],i}function Fa(r){const e=q.c(70),{automationId:s,onDone:n}=r,o=ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={binding:"TRIGGER"},e[0]=i):i=e[0];const c=dt(i),[a,j]=w.useState(),[d,m]=w.useState();let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x={},e[1]=x):x=e[1];const[f,g]=w.useState(x),{triggerAdd:u}=ve(),{data:h,isLoading:p}=zs(a);let l,y,v,N,S,b;if(e[2]!==u||e[3]!==s||e[4]!==a||e[5]!==d||e[6]!==p||e[7]!==n||e[8]!==f||e[9]!==o||e[10]!==c||e[11]!==h){const D=h?.find(U=>U.type===d);let k;e[18]!==u||e[19]!==s||e[20]!==a||e[21]!==d||e[22]!==n||e[23]!==f||e[24]!==o?(k=async()=>{if(!(!a||!d))try{await u.mutateAsync({automation_id:s,type:"event",event_type:d,connection_id:a,params:f}),Ke("automation_trigger_added",{automation_id:s,trigger_type:"event",connection_id:a,event_type:d}),X.success(o("automations.eventTriggerForm.successAdded")),n()}catch{X.error(o("automations.eventTriggerForm.errorFailed"))}},e[18]=u,e[19]=s,e[20]=a,e[21]=d,e[22]=n,e[23]=f,e[24]=o,e[25]=k):k=e[25],l=k,y="flex flex-col gap-3 px-3 py-3 surface";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[26]=A):A=e[26];let $;e[27]!==o?($=o("automations.eventTriggerForm.title"),e[27]=o,e[28]=$):$=e[28];let R;e[29]!==$?(R=t.jsx("span",{className:"text-sm font-medium",children:$}),e[29]=$,e[30]=R):R=e[30];let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(mt,{size:13}),e[31]=K):K=e[31];let F;e[32]!==n?(F=t.jsx("button",{type:"button",className:"ml-auto shrink-0 p-0.5 text-muted-foreground hover:text-foreground rounded-lg",onClick:n,children:K}),e[32]=n,e[33]=F):F=e[33],e[34]!==R||e[35]!==F?(v=t.jsxs("div",{className:"flex items-center gap-2",children:[A,R,F]}),e[34]=R,e[35]=F,e[36]=v):v=e[36];const Y=a??"";let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=U=>{j(U),m(void 0),g({})},e[37]=H):H=e[37];let W;e[38]!==o?(W=o("automations.eventTriggerForm.selectConnectionPlaceholder"),e[38]=o,e[39]=W):W=e[39];let G;e[40]!==W?(G=t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:W})}),e[40]=W,e[41]=G):G=e[41];let J;e[42]!==o||e[43]!==c?(J=c.length===0?t.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:o("automations.eventTriggerForm.noConnectionsWithTrigger")}):c.map(La),e[42]=o,e[43]=c,e[44]=J):J=e[44];let V;e[45]!==J?(V=t.jsx(ye,{children:J}),e[45]=J,e[46]=V):V=e[46],e[47]!==Y||e[48]!==G||e[49]!==V?(N=t.jsxs(ge,{value:Y,onValueChange:H,children:[G,V]}),e[47]=Y,e[48]=G,e[49]=V,e[50]=N):N=e[50],e[51]!==a||e[52]!==d||e[53]!==p||e[54]!==o||e[55]!==h?(S=a&&t.jsxs(ge,{value:d??"",onValueChange:U=>{m(U),g({})},children:[t.jsx(he,{className:"w-full",children:p?t.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(Le,{className:"size-[13px]"}),o("automations.eventTriggerForm.loadingEvents")]}):t.jsx(je,{placeholder:o("automations.eventTriggerForm.selectEventTypePlaceholder"),children:d??o("automations.eventTriggerForm.selectEventTypePlaceholder")})}),t.jsx(ye,{children:h?.map(Ra)})]}),e[51]=a,e[52]=d,e[53]=p,e[54]=o,e[55]=h,e[56]=S):S=e[56],b=D?.paramsSchema&&Object.keys(D.paramsSchema).length>0&&t.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(D.paramsSchema).map(U=>{const[E,oe]=U;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("label",{className:"text-xs text-muted-foreground",children:[E,oe.description&&t.jsxs("span",{className:"text-muted-foreground/60",children:[" ","— ",oe.description]})]}),oe.enum?t.jsxs(ge,{value:f[E]??"",onValueChange:ne=>g(Z=>({...Z,[E]:ne})),children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:o("automations.eventTriggerForm.selectParamPlaceholder",{key:E})})}),t.jsx(ye,{children:oe.enum.map(Ma)})]}):t.jsx("input",{type:"text",value:f[E]??"",onChange:ne=>g(Z=>({...Z,[E]:ne.target.value})),placeholder:oe.description??E,className:"text-sm border border-border rounded-md bg-background px-2 py-1.5 focus-ring"})]},E)})}),e[2]=u,e[3]=s,e[4]=a,e[5]=d,e[6]=p,e[7]=n,e[8]=f,e[9]=o,e[10]=c,e[11]=h,e[12]=l,e[13]=y,e[14]=v,e[15]=N,e[16]=S,e[17]=b}else l=e[12],y=e[13],v=e[14],N=e[15],S=e[16],b=e[17];let T;e[57]!==u||e[58]!==a||e[59]!==d||e[60]!==l||e[61]!==o?(T=a&&d&&t.jsx(B,{size:"sm",onClick:l,disabled:u.isPending,children:u.isPending?t.jsx(Le,{className:"size-[13px]"}):o("automations.eventTriggerForm.addTriggerButton")}),e[57]=u,e[58]=a,e[59]=d,e[60]=l,e[61]=o,e[62]=T):T=e[62];let _;return e[63]!==y||e[64]!==v||e[65]!==N||e[66]!==S||e[67]!==b||e[68]!==T?(_=t.jsxs("div",{className:y,children:[v,N,S,b,T]}),e[63]=y,e[64]=v,e[65]=N,e[66]=S,e[67]=b,e[68]=T,e[69]=_):_=e[69],_}function Ma(r){return t.jsx(be,{value:r,children:r},r)}function Ra(r){return t.jsx(be,{value:r.type,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:r.type}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r.description})]})},r.type)}function La(r){return t.jsx(be,{value:r.id,children:r.title},r.id)}const Va=30;function Ua(r,e){switch(e.type){case"accumulate":{const s=r??{start:e.now,fields:new Set,saveCount:0},n=new Set(s.fields);for(const o of e.fields)n.add(o);return{...s,fields:n,saveCount:s.saveCount+1}}case"reset":return null}}function Wa({automationId:r,automation:e,onBack:s,onDelete:n}){const o=ee(),i=e.virtual_mcp_id,{org:c}=$t(),{update:a,triggerAdd:j,run:d}=ve(),m=dt(),x=new Map(m.map(C=>[C.id,C.title])),{openTask:f}=Fs(),{openSidePanel:g}=Js(),{sendMessage:u}=Ms(),h=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[p,l]=w.useState(h),[y,v]=w.useState(!1),[N,S]=w.useState(!1),[b,T]=w.useState(!1),[_,D]=w.useState(""),[k,A]=w.useState(!1),[$,R]=w.useState(null),[K,F]=w.useState(!1),[Y,H]=w.useState(!1),[W,G]=w.useState(!1),J=async()=>{if(K)return;const M=Rs(p).filter(z=>z.type==="text").map(z=>z.text).join(`
20
- `);if(M.trim()){F(!0);try{se(),Ke("automation_improve_clicked",{automation_id:r,agent_id:i,instructions_length:M.length}),g(),await u({tiptapDoc:Os({managerAgentId:cs.AUTOMATION_MANAGER(c.id),managerName:"Automation Manager",kind:"automation",id:r,instructions:M})})}finally{F(!1)}}},V=e.models?.tier??"smart",U=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,E=ls({defaultValues:{name:e.name,active:e.active,tier:V,modelOverride:U,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),oe=E.watch("active"),[ne,Z]=w.useReducer(Ua,null),ie=()=>{ne!==null&&(Ke("automation_updated",{automation_id:r,agent_id:i,fields:Array.from(ne.fields),save_count:ne.saveCount,edit_duration_ms:Date.now()-ne.start}),Z({type:"reset"}))},ue=async()=>{const C=E.control._formState.dirtyFields,M=Object.keys(C);if(M.length===0&&!W)return!0;const z=E.getValues(),pe=E.control._defaultValues;E.reset(z,{keepValues:!0});const ae=W;G(!1);const ce={tier:z.tier,...z.modelOverride?{modelId:z.modelOverride.modelId,credentialId:z.modelOverride.credentialId,modelTitle:z.modelOverride.title}:{}},de={id:r,name:z.name,active:z.active,models:ce,tools:z.tools,maxAgentSteps:z.maxAgentSteps,messages:Ls(p),temperature:0};try{await a.mutateAsync(de)}catch{return E.reset(pe,{keepValues:!0}),ae&&G(!0),!1}const I=[...M];return ae&&I.push("messages"),Z({type:"accumulate",now:Date.now(),fields:I}),fe(),!0},{schedule:me,flush:te}=_t({save:ue}),{schedule:fe,flush:se}=_t({delayMs:3e4,save:async()=>ie()});w.useEffect(()=>{const C=E.watch(()=>me());return()=>C.unsubscribe()},[]);const re=C=>{if(l(C),!Y){H(!0);return}G(!0),me()},le=async()=>{Ke("automation_test_clicked",{automation_id:r,agent_id:i});const C=await te();if(se(),!!C){if(!p){X.error(o("automations.automationDetail.noInstructionsConfigured"));return}try{const M=await d.mutateAsync(r);M.threadId&&(g(),f(M.threadId))}catch{}}};return t.jsxs(t.Fragment,{children:[s&&t.jsx("div",{className:"flex items-center pb-4 shrink-0",children:t.jsxs(B,{variant:"ghost",size:"sm",onClick:s,children:[t.jsx(Vt,{size:14}),o("automations.automationDetail.backToList")]})}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsx(Ct,{control:E.control,name:"name",render:({field:C})=>t.jsx(Nt,{...C,placeholder:o("automations.automationDetail.automationNamePlaceholder"),className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),n&&t.jsx(B,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:n,children:t.jsx(Ys,{size:14})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ct,{control:E.control,name:"active",render:({field:C})=>t.jsx(ct,{checked:C.value,onCheckedChange:M=>{C.onChange(M),te()},className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:o(oe?"automations.automationDetail.active":"automations.automationDetail.inactive")}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx(Es,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.starter")}),t.jsx($a,{automationId:r,open:y,onOpenChange:v,onCustomSelect:()=>{T(!0),A(!1),D("")},onEventSelect:()=>{A(!0),T(!1)},onWebhookCreated:C=>{Ke("automation_trigger_added",{automation_id:r,trigger_type:"webhook"}),R(C)}})]}),e.triggers.length===0&&!b?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[o("automations.automationDetail.whenShouldRun")," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:o("automations.automationDetail.addStarter")})," ",o("automations.automationDetail.toGetGoing")]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(C=>t.jsx(Xt,{trigger:C,automationId:r,connectionName:C.connection_id?x.get(C.connection_id):void 0},C.id))}),b&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:_,onChange:C=>D(C.target.value),onBlur:async()=>{const C=_.trim();if(!(!C||!Re(C)))try{await j.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),Ke("automation_trigger_added",{automation_id:r,trigger_type:"cron"}),X.success(o("automations.automationDetail.starterAdded")),T(!1),D("")}catch{X.error(o("automations.automationDetail.failedToAddStarter"))}},onKeyDown:async C=>{const M=_.trim();C.key==="Enter"&&M&&Re(M)&&C.target.blur(),C.key==="Escape"&&(T(!1),D(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),_&&!Re(_)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:o("automations.automationDetail.invalid")}),j.isPending&&t.jsx(Le,{className:"size-[13px] text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity rounded-lg",onClick:()=>{T(!1),D("")},children:t.jsx(mt,{size:13})})]}),k&&t.jsx(w.Suspense,{fallback:t.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:o("automations.automationDetail.loadingConnections")})]}),children:t.jsx(Fa,{automationId:r,onDone:()=>A(!1)})}),t.jsx(Jt,{open:$!==null,onOpenChange:C=>{C||R(null)},url:$?.url??null,token:$?.token??null})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.instructions")}),t.jsxs(B,{variant:"outline",size:"sm",className:"gap-1.5",disabled:K||!p,onClick:J,children:[t.jsx(zt,{size:13}),o("automations.automationDetail.improve")]})]}),t.jsx(Zs,{tiptapDoc:p,setTiptapDoc:re,placeholder:o("automations.automationDetail.instructionsPlaceholder"),children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Qs,{virtualMcpId:i||null,className:"max-h-[45vh]"}),t.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:t.jsxs(Bs,{children:[t.jsx(Gs,{asChild:!0,children:t.jsxs(B,{type:"button",variant:"default",className:"gap-1.5",onClick:le,disabled:!i,children:[t.jsx(Xs,{size:16}),o("automations.automationDetail.test")]})}),t.jsx(Hs,{children:o("automations.automationDetail.testAutomation")})]})})]})})]}),t.jsxs(Vs,{open:N,onOpenChange:S,className:"flex flex-col gap-2.5",children:[t.jsxs(Us,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.advanced")}),t.jsx(rt,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Ws,{className:"flex flex-col gap-5 pt-0.5",children:[t.jsx(ua,{tier:E.watch("tier"),onTierChange:C=>E.setValue("tier",C,{shouldDirty:!0}),override:E.watch("modelOverride"),onOverrideChange:C=>E.setValue("modelOverride",C,{shouldDirty:!0})}),t.jsx(ga,{agentId:i||null,value:E.watch("tools"),onChange:C=>E.setValue("tools",C,{shouldDirty:!0})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.maxSteps")}),t.jsx(Nt,{type:"number",min:1,max:100,className:"w-40",placeholder:o("automations.automationDetail.maxStepsPlaceholder",{default:Va}),value:E.watch("maxAgentSteps")??"",onChange:C=>{const M=C.target.value.trim(),z=M===""?null:Number(M);E.setValue("maxAgentSteps",z===null||Number.isNaN(z)?null:z,{shouldDirty:!0})}})]})]})]})]})]})}function Ba(r){const e=q.c(55),{automation:s}=r,n=ee(),{update:o}=ve();let i;e[0]!==s.name?(i=t.jsx("h2",{className:"text-lg font-medium text-foreground",children:s.name}),e[0]=s.name,e[1]=i):i=e[1];let c;e[2]!==n?(c=n("automations.builtin.badge"),e[2]=n,e[3]=c):c=e[3];let a;e[4]!==c?(a=t.jsx(Kt,{variant:"muted",children:c}),e[4]=c,e[5]=a):a=e[5];let j;e[6]!==i||e[7]!==a?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[i,a]}),e[6]=i,e[7]=a,e[8]=j):j=e[8];let d;e[9]!==s.id||e[10]!==o?(d=D=>o.mutate({id:s.id,active:D}),e[9]=s.id,e[10]=o,e[11]=d):d=e[11];let m;e[12]!==s.active||e[13]!==d||e[14]!==o.isPending?(m=t.jsx(ct,{checked:s.active,disabled:o.isPending,onCheckedChange:d,className:"cursor-pointer"}),e[12]=s.active,e[13]=d,e[14]=o.isPending,e[15]=m):m=e[15];let x;e[16]!==s.active||e[17]!==n?(x=s.active?n("automations.automationDetail.active"):n("automations.automationDetail.inactive"),e[16]=s.active,e[17]=n,e[18]=x):x=e[18];let f;e[19]!==x?(f=t.jsx("span",{className:"text-sm text-muted-foreground",children:x}),e[19]=x,e[20]=f):f=e[20];let g;e[21]!==m||e[22]!==f?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f]}),e[21]=m,e[22]=f,e[23]=g):g=e[23];let u;e[24]!==j||e[25]!==g?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,g]}),e[24]=j,e[25]=g,e[26]=u):u=e[26];let h;e[27]!==n?(h=n("automations.automationDetail.starter"),e[27]=n,e[28]=h):h=e[28];let p;e[29]!==h?(p=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:h}),e[29]=h,e[30]=p):p=e[30];let l;if(e[31]!==s.id||e[32]!==s.triggers){let D;e[34]!==s.id?(D=k=>t.jsx(Xt,{trigger:k,automationId:s.id,readOnly:!0},k.id),e[34]=s.id,e[35]=D):D=e[35],l=s.triggers.map(D),e[31]=s.id,e[32]=s.triggers,e[33]=l}else l=e[33];let y;e[36]!==p||e[37]!==l?(y=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[p,l]}),e[36]=p,e[37]=l,e[38]=y):y=e[38];let v;e[39]!==n?(v=n("automations.automationDetail.instructions"),e[39]=n,e[40]=v):v=e[40];let N;e[41]!==v?(N=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:v}),e[41]=v,e[42]=N):N=e[42];let S;e[43]!==s.system_key||e[44]!==n?(S=s.system_key==="implementer"?n("automations.builtin.implementerDescription"):s.system_key==="reviewer"?n("automations.builtin.reviewerDescription"):s.system_key==="linked_chats"?n("automations.builtin.linkedChatsDescription"):s.system_key==="pr_merged"?n("automations.builtin.prMergedDescription"):s.system_key==="chat_pr"?n("automations.builtin.chatPrDescription"):s.system_key==="agent_mentions"?n("automations.builtin.mentionsDescription"):n("automations.builtin.description"),e[43]=s.system_key,e[44]=n,e[45]=S):S=e[45];let b;e[46]!==S?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[46]=S,e[47]=b):b=e[47];let T;e[48]!==N||e[49]!==b?(T=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[N,b]}),e[48]=N,e[49]=b,e[50]=T):T=e[50];let _;return e[51]!==u||e[52]!==y||e[53]!==T?(_=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,T]}),e[51]=u,e[52]=y,e[53]=T,e[54]=_):_=e[54],_}const Yt=[{key:"24h",labelKey:"mainPanelTabs.automationTab.last24hours",ms:1440*60*1e3},{key:"7d",labelKey:"mainPanelTabs.automationTab.last7days",ms:10080*60*1e3},{key:"30d",labelKey:"mainPanelTabs.automationTab.last30days",ms:720*60*60*1e3}];function Zt(r){const e=Yt.find(n=>n.key===r).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function Ga(r){const e=q.c(16),{automationId:s,triggerIds:n}=r,o=ee(),[i,c]=w.useState("30d"),[a,j]=w.useState(Ha);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const l=p;c(l),j(Zt(l))},e[0]=d):d=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(he,{className:"w-44",children:t.jsx(je,{})}),e[1]=m):m=e[1];let x;e[2]!==o?(x=Yt.map(p=>t.jsx(be,{value:p.key,children:o(p.labelKey)},p.key)),e[2]=o,e[3]=x):x=e[3];let f;e[4]!==x?(f=t.jsx(ye,{children:x}),e[4]=x,e[5]=f):f=e[5];let g;e[6]!==f||e[7]!==i?(g=t.jsx("div",{className:"flex items-center justify-end",children:t.jsxs(ge,{value:i,onValueChange:d,children:[m,f]})}),e[6]=f,e[7]=i,e[8]=g):g=e[8];let u;e[9]!==s||e[10]!==a||e[11]!==n?(u=t.jsx(ra,{automationId:s,triggerIds:n,range:a}),e[9]=s,e[10]=a,e[11]=n,e[12]=u):u=e[12];let h;return e[13]!==g||e[14]!==u?(h=t.jsxs("div",{className:"flex flex-col gap-5",children:[g,u]}),e[13]=g,e[14]=u,e[15]=h):h=e[15],h}function Ha(){return Zt("30d")}function Ja(r){const e=q.c(5),{tabId:s}=r;let n;e[0]!==s?(n=ds(s),e[0]=s,e[1]=n):n=e[1];const o=n;if(!o)return null;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qe,{}),e[2]=i):i=e[2];let c;return e[3]!==o.id?(c=t.jsx(w.Suspense,{fallback:i,children:t.jsx(Xa,{id:o.id})}),e[3]=o.id,e[4]=c):c=e[4],c}function Xa(r){const e=q.c(41),{id:s}=r,n=ee(),{openPanel:o}=ca(),{data:i,isLoading:c}=Ks(s),[a,j]=w.useState("settings");let d;e[0]!==o?(d=()=>o("automations"),e[0]=o,e[1]=d):d=e[1];const m=d;if(c){let k;return e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Qe,{}),e[2]=k):k=e[2],k}if(!i){let k;e[3]!==n?(k=n("mainPanelTabs.automationTab.automationNotFound"),e[3]=n,e[4]=k):k=e[4];let A;return e[5]!==k?(A=t.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:k}),e[5]=k,e[6]=A):A=e[6],A}let x;e[7]!==i.triggers?(x=i.triggers.map(Ya),e[7]=i.triggers,e[8]=x):x=e[8];const f=x;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vt,{size:14}),e[9]=g):g=e[9];let u;e[10]!==n?(u=n("mainPanelTabs.automationTab.backToList"),e[10]=n,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs(B,{variant:"ghost",size:"sm",onClick:m,children:[g,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let p;e[15]!==n?(p=n("mainPanelTabs.automationTab.settings"),e[15]=n,e[16]=p):p=e[16];let l;e[17]!==p?(l={id:"settings",label:p},e[17]=p,e[18]=l):l=e[18];let y;e[19]!==n?(y=n("mainPanelTabs.automationTab.runs"),e[19]=n,e[20]=y):y=e[20];let v;e[21]!==y?(v={id:"runs",label:y},e[21]=y,e[22]=v):v=e[22];let N;e[23]!==l||e[24]!==v?(N=[l,v],e[23]=l,e[24]=v,e[25]=N):N=e[25];let S;e[26]===Symbol.for("react.memo_cache_sentinel")?(S=k=>j(k),e[26]=S):S=e[26];let b;e[27]!==N||e[28]!==a?(b=t.jsx(la,{placement:"page",tabs:N,activeTab:a,onTabChange:S}),e[27]=N,e[28]=a,e[29]=b):b=e[29];let T;e[30]!==b||e[31]!==h?(T=t.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[h,b]}),e[30]=b,e[31]=h,e[32]=T):T=e[32];let _;e[33]!==i||e[34]!==s||e[35]!==a||e[36]!==f?(_=a==="settings"?i.system_key?t.jsx(Ba,{automation:i}):t.jsx(Wa,{automationId:s,automation:i}):t.jsx(w.Suspense,{fallback:t.jsx(Qe,{}),children:t.jsx(Ga,{automationId:s,triggerIds:f})}),e[33]=i,e[34]=s,e[35]=a,e[36]=f,e[37]=_):_=e[37];let D;return e[38]!==T||e[39]!==_?(D=t.jsx(Xe,{children:t.jsx(Xe.Content,{children:t.jsxs(Xe.Container,{children:[T,_]})})}),e[38]=T,e[39]=_,e[40]=D):D=e[40],D}function Ya(r){return r.id}function Za(){const r=q.c(3);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},r[0]=e):e=r[0];const{automationId:s}=ms(e);let n;return r[1]!==s?(n=s?t.jsx(Ja,{tabId:`automation:${s}`}):null,r[1]=s,r[2]=n):n=r[2],n}function fi(){const r=q.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(us.Content,{children:t.jsx(Za,{})}),r[0]=e):e=r[0],e}export{fi as default};
19
+ });`:"",_=g==="curl"?b:T;let D;e[6]!==j?(D=t.jsx(at,{children:j}),e[6]=j,e[7]=D):D=e[7];let k;e[8]!==d?(k=t.jsx(ot,{children:d}),e[8]=d,e[9]=k):k=e[9];let A;e[10]!==D||e[11]!==k?(A=t.jsxs(st,{children:[D,k]}),e[10]=D,e[11]=k,e[12]=A):A=e[12];let $;e[13]!==h||e[14]!==x||e[15]!==v||e[16]!==S||e[17]!==g||e[18]!==_||e[19]!==m||e[20]!==i||e[21]!==l||e[22]!==o?($=o&&i?t.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.url")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:S}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(S,"url"),children:[t.jsx(Ye,{size:13}),m(x==="url"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.tokenLabel")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("code",{className:"flex-1 min-w-0 text-xs font-mono bg-muted rounded-md px-2 py-1.5 truncate",children:i}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(i,"token"),children:[t.jsx(Ye,{size:13}),m(x==="token"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:m("automations.webhookSecretDialog.snippet")}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(oa,{value:g,onValueChange:W=>u(W),children:t.jsxs(na,{className:"h-8 p-[2px]",children:[t.jsx(Dt,{value:"curl",className:"h-7 px-2.5 text-xs",children:"curl"}),t.jsx(Dt,{value:"fetch",className:"h-7 px-2.5 text-xs",children:"fetch"})]})}),t.jsxs("label",{htmlFor:l,className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none",children:[t.jsx(Ft,{id:l,checked:h==="url",onCheckedChange:W=>p(W?"url":"header")}),m("automations.webhookSecretDialog.tokenInUrl")]})]}),t.jsxs(B,{size:"sm",variant:"outline",onClick:()=>v(_,"example"),children:[t.jsx(Ye,{size:13}),m(x==="example"?"automations.webhookSecretDialog.copied":"automations.webhookSecretDialog.copy")]})]}),t.jsx("div",{className:"rounded-md border overflow-hidden min-w-0",children:t.jsx(ia,{code:_,language:g==="curl"?"shell":"typescript",readOnly:!0,disableDiagnostics:!0,height:180})})]})]}):null,e[13]=h,e[14]=x,e[15]=v,e[16]=S,e[17]=g,e[18]=_,e[19]=m,e[20]=i,e[21]=l,e[22]=o,e[23]=$):$=e[23];let R;e[24]!==n?(R=()=>n(!1),e[24]=n,e[25]=R):R=e[25];let K;e[26]!==m?(K=m("automations.webhookSecretDialog.done"),e[26]=m,e[27]=K):K=e[27];let F;e[28]!==K||e[29]!==R?(F=t.jsx(nt,{children:t.jsx(B,{onClick:R,children:K})}),e[28]=K,e[29]=R,e[30]=F):F=e[30];let Y;e[31]!==F||e[32]!==A||e[33]!==$?(Y=t.jsxs(tt,{className:"max-w-lg",children:[A,$,F]}),e[31]=F,e[32]=A,e[33]=$,e[34]=Y):Y=e[34];let H;return e[35]!==n||e[36]!==s||e[37]!==Y?(H=t.jsx(et,{open:s,onOpenChange:n,children:Y}),e[35]=n,e[36]=s,e[37]=Y,e[38]=H):H=e[38],H}async function Ea(r){const{cronExpression:e,automationId:s,oldTriggerId:n,addTrigger:o,removeTrigger:i}=r,c=await o({automation_id:s,type:"cron",cron_expression:e});try{await i({trigger_id:n,automation_id:s})}catch(a){throw await i({trigger_id:c.id,automation_id:s}).catch(()=>{}),a}}function Xt(r){const e=q.c(153),{trigger:s,automationId:n,connectionName:o,readOnly:i}=r,c=i===void 0?!1:i,a=ee(),{triggerAdd:j,triggerRemove:d,triggerRotateToken:m}=ve(),[x,f]=w.useState(!1),[g,u]=w.useState(!1),[h,p]=w.useState(null);let l;e[0]!==s.cron_expression?(l=s.cron_expression?ka(s.cron_expression):null,e[0]=s.cron_expression,e[1]=l):l=e[1];const y=l,[v,N]=w.useState(y?.count??1),[S,b]=w.useState(!1),[T,_]=w.useState(s.cron_expression??""),D=d.isPending||j.isPending||m.isPending,k=s.type==="cron",A=s.type==="webhook",$=s.type==="board_column_transition";let R;e[2]!==a||e[3]!==s.type?(R=s.type==="board_pr_ready"?a("automations.triggerCard.prReady"):s.type==="linked_chat_run"?a("automations.triggerCard.linkedChatRun"):s.type==="board_pr_merged"?a("automations.triggerCard.prMerged"):s.type==="chat_pr_opened"?a("automations.triggerCard.chatPrOpened"):s.type==="card_mention"?a("automations.triggerCard.cardMention"):null,e[2]=a,e[3]=s.type,e[4]=R):R=e[4];const K=R,F=s.type==="jira_transition";let Y;e[5]!==n||e[6]!==d||e[7]!==a||e[8]!==s.id?(Y=async()=>{try{await d.mutateAsync({trigger_id:s.id,automation_id:n}),X.success(a("automations.triggerCard.starterRemoved"))}catch{X.error(a("automations.triggerCard.failedToRemoveStarter"))}f(!1)},e[5]=n,e[6]=d,e[7]=a,e[8]=s.id,e[9]=Y):Y=e[9];const H=Y;let W;e[10]!==j||e[11]!==n||e[12]!==d||e[13]!==s.id?(W=L=>Ea({cronExpression:L,automationId:n,oldTriggerId:s.id,addTrigger:Fe=>j.mutateAsync(Fe),removeTrigger:Fe=>d.mutateAsync(Fe)}),e[10]=j,e[11]=n,e[12]=d,e[13]=s.id,e[14]=W):W=e[14];const G=W;let J;e[15]!==T||e[16]!==G||e[17]!==a||e[18]!==s.cron_expression?(J=async()=>{const L=T.trim();if(!L||!Re(L)||L===s.cron_expression){b(!1),_(s.cron_expression??"");return}try{await G(L),b(!1)}catch{X.error(a("automations.triggerCard.failedToUpdateStarter")),_(s.cron_expression??""),b(!1)}},e[15]=T,e[16]=G,e[17]=a,e[18]=s.cron_expression,e[19]=J):J=e[19];const V=J;let U;e[20]!==n||e[21]!==m||e[22]!==a||e[23]!==s.id?(U=async()=>{u(!1);try{const L=await m.mutateAsync({trigger_id:s.id,automation_id:n});p({url:L.url,token:L.token})}catch{X.error(a("automations.triggerCard.failedToRotateToken"))}},e[20]=n,e[21]=m,e[22]=a,e[23]=s.id,e[24]=U):U=e[24];const E=U;let oe;e[25]!==y||e[26]!==G||e[27]!==a||e[28]!==s.cron_expression?(oe=async L=>{if(!y)return;const Fe=y.unit==="minutes"?5:1,Je=Math.max(Fe,L);Je!==L&&N(Je);const ft=Sa(Je,y.unit);if(ft!==s.cron_expression)try{await G(ft)}catch{X.error(a("automations.triggerCard.failedToUpdateStarter")),N(y.count)}},e[25]=y,e[26]=G,e[27]=a,e[28]=s.cron_expression,e[29]=oe):oe=e[29];const ne=oe;let Z;e[30]!==$||e[31]!==k||e[32]!==F||e[33]!==A||e[34]!==K?(Z=k?t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}):F?t.jsx(Ut,{size:14,className:"shrink-0"}):$||K?t.jsx(Et,{size:14,className:"text-muted-foreground shrink-0"}):A?t.jsx(it,{size:14,className:"text-muted-foreground shrink-0"}):t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=$,e[31]=k,e[32]=F,e[33]=A,e[34]=K,e[35]=Z):Z=e[35];let ie;e[36]!==o||e[37]!==v||e[38]!==T||e[39]!==ne||e[40]!==V||e[41]!==y||e[42]!==$||e[43]!==k||e[44]!==S||e[45]!==F||e[46]!==D||e[47]!==A||e[48]!==K||e[49]!==a||e[50]!==s.column_key||e[51]!==s.cron_expression||e[52]!==s.event_type||e[53]!==s.from||e[54]!==s.params?(ie=y&&k?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:a("automations.triggerCard.every")}),t.jsx("input",{type:"number",min:y.unit==="minutes"?5:1,value:v,onChange:L=>N(parseInt(L.target.value)||1),onBlur:()=>ne(v),onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&N(y.count)},disabled:D,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus-ring"}),t.jsx("span",{className:"text-sm",children:Ta(y.unit,v)})]}):k&&S?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:T,onChange:L=>_(L.target.value),onBlur:V,onKeyDown:L=>{L.key==="Enter"&&L.target.blur(),L.key==="Escape"&&(b(!1),_(s.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),T&&!Re(T)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:a("automations.triggerCard.invalid")})]}):t.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[t.jsx("span",{className:"text-sm font-mono text-xs text-muted-foreground truncate",children:k?Na(s.cron_expression??""):$?a("automations.triggerCard.cardEntersColumn",{lane:We(s.column_key??"",a).label}):K||(F?a("automations.triggerCard.issueEntersJiraStatus",{status:s.column_key??""}):A?a("automations.triggerCard.webhookPostToFire"):`${s.event_type}${o?` · ${o}`:""}`)}),$&&t.jsx(Oa,{from:s.from}),F&&t.jsx(Ka,{from:s.from}),!k&&!A&&!$&&!K&&!F&&s.params&&Object.keys(s.params).length>0&&t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:Object.entries(s.params).map(za).join(", ")})]}),e[36]=o,e[37]=v,e[38]=T,e[39]=ne,e[40]=V,e[41]=y,e[42]=$,e[43]=k,e[44]=S,e[45]=F,e[46]=D,e[47]=A,e[48]=K,e[49]=a,e[50]=s.column_key,e[51]=s.cron_expression,e[52]=s.event_type,e[53]=s.from,e[54]=s.params,e[55]=ie):ie=e[55];let ue;e[56]!==D?(ue=D&&t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),e[56]=D,e[57]=ue):ue=e[57];let me;e[58]!==y||e[59]!==k||e[60]!==S||e[61]!==a||e[62]!==s.cron_expression?(me=k&&!y&&!S&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity","aria-label":a("automations.triggerCard.editSchedule"),onClick:()=>{_(s.cron_expression??""),b(!0)},children:t.jsx(zt,{size:13,className:"text-muted-foreground"})}),e[58]=y,e[59]=k,e[60]=S,e[61]=a,e[62]=s.cron_expression,e[63]=me):me=e[63];let te;e[64]!==A||e[65]!==a?(te=A&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity",title:a("automations.triggerCard.rotateToken"),"aria-label":a("automations.triggerCard.rotateToken"),onClick:()=>u(!0),children:t.jsx(rs,{size:13,className:"text-muted-foreground"})}),e[64]=A,e[65]=a,e[66]=te):te=e[66];let fe;e[67]!==c||e[68]!==a?(fe=!c&&t.jsx(B,{variant:"ghost",size:"icon-sm",className:"opacity-0 group-hover:opacity-100 transition-opacity","aria-label":a("automations.triggerCard.removeStarter"),onClick:()=>f(!0),children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),e[67]=c,e[68]=a,e[69]=fe):fe=e[69];let se;e[70]!==ue||e[71]!==me||e[72]!==te||e[73]!==fe?(se=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[ue,me,te,fe]}),e[70]=ue,e[71]=me,e[72]=te,e[73]=fe,e[74]=se):se=e[74];let re;e[75]!==ie||e[76]!==se||e[77]!==Z?(re=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 surface group",children:[Z,ie,se]}),e[75]=ie,e[76]=se,e[77]=Z,e[78]=re):re=e[78];let le;e[79]!==a?(le=a("automations.triggerCard.removeStarter"),e[79]=a,e[80]=le):le=e[80];let C;e[81]!==le?(C=t.jsx(pt,{children:le}),e[81]=le,e[82]=C):C=e[82];let M;e[83]!==a?(M=a("automations.triggerCard.confirmRemoveStarter"),e[83]=a,e[84]=M):M=e[84];let O;e[85]!==M?(O=t.jsx(xt,{children:M}),e[85]=M,e[86]=O):O=e[86];let pe;e[87]!==C||e[88]!==O?(pe=t.jsxs(gt,{children:[C,O]}),e[87]=C,e[88]=O,e[89]=pe):pe=e[89];let ae;e[90]!==a?(ae=a("automations.triggerCard.cancel"),e[90]=a,e[91]=ae):ae=e[91];let ce;e[92]!==ae?(ce=t.jsx(ht,{children:ae}),e[92]=ae,e[93]=ce):ce=e[93];let de;e[94]!==a?(de=a("automations.triggerCard.remove"),e[94]=a,e[95]=de):de=e[95];let I;e[96]!==H||e[97]!==de?(I=t.jsx(jt,{onClick:H,variant:"destructive",children:de}),e[96]=H,e[97]=de,e[98]=I):I=e[98];let z;e[99]!==ce||e[100]!==I?(z=t.jsxs(yt,{children:[ce,I]}),e[99]=ce,e[100]=I,e[101]=z):z=e[101];let Q;e[102]!==pe||e[103]!==z?(Q=t.jsxs(bt,{children:[pe,z]}),e[102]=pe,e[103]=z,e[104]=Q):Q=e[104];let P;e[105]!==x||e[106]!==Q?(P=t.jsx(vt,{open:x,onOpenChange:f,children:Q}),e[105]=x,e[106]=Q,e[107]=P):P=e[107];let xe;e[108]!==a?(xe=a("automations.triggerCard.rotateWebhookToken"),e[108]=a,e[109]=xe):xe=e[109];let Ce;e[110]!==xe?(Ce=t.jsx(pt,{children:xe}),e[110]=xe,e[111]=Ce):Ce=e[111];let Ne;e[112]!==a?(Ne=a("automations.triggerCard.rotateWebhookTokenDescription"),e[112]=a,e[113]=Ne):Ne=e[113];let Se;e[114]!==Ne?(Se=t.jsx(xt,{children:Ne}),e[114]=Ne,e[115]=Se):Se=e[115];let ke;e[116]!==Ce||e[117]!==Se?(ke=t.jsxs(gt,{children:[Ce,Se]}),e[116]=Ce,e[117]=Se,e[118]=ke):ke=e[118];let Te;e[119]!==a?(Te=a("automations.triggerCard.cancel"),e[119]=a,e[120]=Te):Te=e[120];let we;e[121]!==Te?(we=t.jsx(ht,{children:Te}),e[121]=Te,e[122]=we):we=e[122];let _e;e[123]!==a?(_e=a("automations.triggerCard.rotate"),e[123]=a,e[124]=_e):_e=e[124];let De;e[125]!==E||e[126]!==_e?(De=t.jsx(jt,{onClick:E,children:_e}),e[125]=E,e[126]=_e,e[127]=De):De=e[127];let Ie;e[128]!==we||e[129]!==De?(Ie=t.jsxs(yt,{children:[we,De]}),e[128]=we,e[129]=De,e[130]=Ie):Ie=e[130];let Ae;e[131]!==ke||e[132]!==Ie?(Ae=t.jsxs(bt,{children:[ke,Ie]}),e[131]=ke,e[132]=Ie,e[133]=Ae):Ae=e[133];let Pe;e[134]!==g||e[135]!==Ae?(Pe=t.jsx(vt,{open:g,onOpenChange:u,children:Ae}),e[134]=g,e[135]=Ae,e[136]=Pe):Pe=e[136];const Be=h!==null;let Ve;e[137]===Symbol.for("react.memo_cache_sentinel")?(Ve=L=>{L||p(null)},e[137]=Ve):Ve=e[137];const Ge=h?.url??null,He=h?.token??null;let $e;e[138]!==a?($e=a("automations.triggerCard.newWebhookToken"),e[138]=a,e[139]=$e):$e=e[139];let Ee;e[140]!==a?(Ee=a("automations.triggerCard.newWebhookTokenDescription"),e[140]=a,e[141]=Ee):Ee=e[141];let ze;e[142]!==Be||e[143]!==Ge||e[144]!==He||e[145]!==$e||e[146]!==Ee?(ze=t.jsx(Jt,{open:Be,onOpenChange:Ve,url:Ge,token:He,title:$e,description:Ee}),e[142]=Be,e[143]=Ge,e[144]=He,e[145]=$e,e[146]=Ee,e[147]=ze):ze=e[147];let Ue;return e[148]!==re||e[149]!==P||e[150]!==Pe||e[151]!==ze?(Ue=t.jsxs(t.Fragment,{children:[re,P,Pe,ze]}),e[148]=re,e[149]=P,e[150]=Pe,e[151]=ze,e[152]=Ue):Ue=e[152],Ue}function za(r){const[e,s]=r;return`${e}: ${s}`}function Oa(r){const e=q.c(10),{from:s}=r,n=ee();let o;e[0]!==s||e[1]!==n?(o=!s||s.kind==="any"?null:s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.map(m=>We(m,n).label).join(", ")}):null,e[0]=s,e[1]=n,e[2]=o):o=e[2];const i=o;let c;e[3]!==n?(c=n("automations.triggerCard.unownedOnly"),e[3]=n,e[4]=c):c=e[4];let a;e[5]!==i||e[6]!==c?(a=[i,c].filter(Boolean),e[5]=i,e[6]=c,e[7]=a):a=e[7];const j=a.join(" · ");let d;return e[8]!==j?(d=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:j}),e[8]=j,e[9]=d):d=e[9],d}function Ka(r){const e=q.c(6),{from:s}=r,n=ee();if(!s||s.kind==="any")return null;let o;e[0]!==s.kind||e[1]!==s.statuses||e[2]!==n?(o=s.kind==="earlier"?n("automations.triggerCard.fromEarlier"):s.kind==="later"?n("automations.triggerCard.fromLater"):s.kind==="statuses"?n("automations.triggerCard.fromColumns",{columns:s.statuses.join(", ")}):null,e[0]=s.kind,e[1]=s.statuses,e[2]=n,e[3]=o):o=e[3];let i;return e[4]!==o?(i=t.jsx("span",{className:"text-xs text-muted-foreground/60 truncate",children:o}),e[4]=o,e[5]=i):i=e[5],i}function Fa(r){const e=q.c(70),{automationId:s,onDone:n}=r,o=ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={binding:"TRIGGER"},e[0]=i):i=e[0];const c=dt(i),[a,j]=w.useState(),[d,m]=w.useState();let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x={},e[1]=x):x=e[1];const[f,g]=w.useState(x),{triggerAdd:u}=ve(),{data:h,isLoading:p}=Os(a);let l,y,v,N,S,b;if(e[2]!==u||e[3]!==s||e[4]!==a||e[5]!==d||e[6]!==p||e[7]!==n||e[8]!==f||e[9]!==o||e[10]!==c||e[11]!==h){const D=h?.find(U=>U.type===d);let k;e[18]!==u||e[19]!==s||e[20]!==a||e[21]!==d||e[22]!==n||e[23]!==f||e[24]!==o?(k=async()=>{if(!(!a||!d))try{await u.mutateAsync({automation_id:s,type:"event",event_type:d,connection_id:a,params:f}),Ke("automation_trigger_added",{automation_id:s,trigger_type:"event",connection_id:a,event_type:d}),X.success(o("automations.eventTriggerForm.successAdded")),n()}catch{X.error(o("automations.eventTriggerForm.errorFailed"))}},e[18]=u,e[19]=s,e[20]=a,e[21]=d,e[22]=n,e[23]=f,e[24]=o,e[25]=k):k=e[25],l=k,y="flex flex-col gap-3 px-3 py-3 surface";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ut,{size:14,className:"text-muted-foreground shrink-0"}),e[26]=A):A=e[26];let $;e[27]!==o?($=o("automations.eventTriggerForm.title"),e[27]=o,e[28]=$):$=e[28];let R;e[29]!==$?(R=t.jsx("span",{className:"text-sm font-medium",children:$}),e[29]=$,e[30]=R):R=e[30];let K;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(mt,{size:13}),e[31]=K):K=e[31];let F;e[32]!==n?(F=t.jsx("button",{type:"button",className:"ml-auto shrink-0 p-0.5 text-muted-foreground hover:text-foreground rounded-lg",onClick:n,children:K}),e[32]=n,e[33]=F):F=e[33],e[34]!==R||e[35]!==F?(v=t.jsxs("div",{className:"flex items-center gap-2",children:[A,R,F]}),e[34]=R,e[35]=F,e[36]=v):v=e[36];const Y=a??"";let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=U=>{j(U),m(void 0),g({})},e[37]=H):H=e[37];let W;e[38]!==o?(W=o("automations.eventTriggerForm.selectConnectionPlaceholder"),e[38]=o,e[39]=W):W=e[39];let G;e[40]!==W?(G=t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:W})}),e[40]=W,e[41]=G):G=e[41];let J;e[42]!==o||e[43]!==c?(J=c.length===0?t.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:o("automations.eventTriggerForm.noConnectionsWithTrigger")}):c.map(La),e[42]=o,e[43]=c,e[44]=J):J=e[44];let V;e[45]!==J?(V=t.jsx(ye,{children:J}),e[45]=J,e[46]=V):V=e[46],e[47]!==Y||e[48]!==G||e[49]!==V?(N=t.jsxs(ge,{value:Y,onValueChange:H,children:[G,V]}),e[47]=Y,e[48]=G,e[49]=V,e[50]=N):N=e[50],e[51]!==a||e[52]!==d||e[53]!==p||e[54]!==o||e[55]!==h?(S=a&&t.jsxs(ge,{value:d??"",onValueChange:U=>{m(U),g({})},children:[t.jsx(he,{className:"w-full",children:p?t.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(Le,{className:"size-[13px]"}),o("automations.eventTriggerForm.loadingEvents")]}):t.jsx(je,{placeholder:o("automations.eventTriggerForm.selectEventTypePlaceholder"),children:d??o("automations.eventTriggerForm.selectEventTypePlaceholder")})}),t.jsx(ye,{children:h?.map(Ra)})]}),e[51]=a,e[52]=d,e[53]=p,e[54]=o,e[55]=h,e[56]=S):S=e[56],b=D?.paramsSchema&&Object.keys(D.paramsSchema).length>0&&t.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(D.paramsSchema).map(U=>{const[E,oe]=U;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("label",{className:"text-xs text-muted-foreground",children:[E,oe.description&&t.jsxs("span",{className:"text-muted-foreground/60",children:[" ","— ",oe.description]})]}),oe.enum?t.jsxs(ge,{value:f[E]??"",onValueChange:ne=>g(Z=>({...Z,[E]:ne})),children:[t.jsx(he,{className:"w-full",children:t.jsx(je,{placeholder:o("automations.eventTriggerForm.selectParamPlaceholder",{key:E})})}),t.jsx(ye,{children:oe.enum.map(Ma)})]}):t.jsx("input",{type:"text",value:f[E]??"",onChange:ne=>g(Z=>({...Z,[E]:ne.target.value})),placeholder:oe.description??E,className:"text-sm border border-border rounded-md bg-background px-2 py-1.5 focus-ring"})]},E)})}),e[2]=u,e[3]=s,e[4]=a,e[5]=d,e[6]=p,e[7]=n,e[8]=f,e[9]=o,e[10]=c,e[11]=h,e[12]=l,e[13]=y,e[14]=v,e[15]=N,e[16]=S,e[17]=b}else l=e[12],y=e[13],v=e[14],N=e[15],S=e[16],b=e[17];let T;e[57]!==u||e[58]!==a||e[59]!==d||e[60]!==l||e[61]!==o?(T=a&&d&&t.jsx(B,{size:"sm",onClick:l,disabled:u.isPending,children:u.isPending?t.jsx(Le,{className:"size-[13px]"}):o("automations.eventTriggerForm.addTriggerButton")}),e[57]=u,e[58]=a,e[59]=d,e[60]=l,e[61]=o,e[62]=T):T=e[62];let _;return e[63]!==y||e[64]!==v||e[65]!==N||e[66]!==S||e[67]!==b||e[68]!==T?(_=t.jsxs("div",{className:y,children:[v,N,S,b,T]}),e[63]=y,e[64]=v,e[65]=N,e[66]=S,e[67]=b,e[68]=T,e[69]=_):_=e[69],_}function Ma(r){return t.jsx(be,{value:r,children:r},r)}function Ra(r){return t.jsx(be,{value:r.type,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:r.type}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r.description})]})},r.type)}function La(r){return t.jsx(be,{value:r.id,children:r.title},r.id)}const Va=30;function Ua(r,e){switch(e.type){case"accumulate":{const s=r??{start:e.now,fields:new Set,saveCount:0},n=new Set(s.fields);for(const o of e.fields)n.add(o);return{...s,fields:n,saveCount:s.saveCount+1}}case"reset":return null}}function Wa({automationId:r,automation:e,onBack:s,onDelete:n}){const o=ee(),i=e.virtual_mcp_id,{org:c}=$t(),{update:a,triggerAdd:j,run:d}=ve(),m=dt(),x=new Map(m.map(C=>[C.id,C.title])),{openTask:f}=Fs(),{openSidePanel:g}=Js(),{sendMessage:u}=Ms(),h=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[p,l]=w.useState(h),[y,v]=w.useState(!1),[N,S]=w.useState(!1),[b,T]=w.useState(!1),[_,D]=w.useState(""),[k,A]=w.useState(!1),[$,R]=w.useState(null),[K,F]=w.useState(!1),[Y,H]=w.useState(!1),[W,G]=w.useState(!1),J=async()=>{if(K)return;const M=Rs(p).filter(O=>O.type==="text").map(O=>O.text).join(`
20
+ `);if(M.trim()){F(!0);try{se(),Ke("automation_improve_clicked",{automation_id:r,agent_id:i,instructions_length:M.length}),g(),await u({tiptapDoc:zs({managerAgentId:cs.AUTOMATION_MANAGER(c.id),managerName:"Automation Manager",kind:"automation",id:r,instructions:M})})}finally{F(!1)}}},V=e.models?.tier??"smart",U=e.models?.modelId&&e.models?.credentialId?{modelId:e.models.modelId,credentialId:e.models.credentialId,title:e.models.modelTitle??e.models.modelId}:null,E=ls({defaultValues:{name:e.name,active:e.active,tier:V,modelOverride:U,tools:e.tools??null,maxAgentSteps:e.maxAgentSteps??null}}),oe=E.watch("active"),[ne,Z]=w.useReducer(Ua,null),ie=()=>{ne!==null&&(Ke("automation_updated",{automation_id:r,agent_id:i,fields:Array.from(ne.fields),save_count:ne.saveCount,edit_duration_ms:Date.now()-ne.start}),Z({type:"reset"}))},ue=async()=>{const C=E.control._formState.dirtyFields,M=Object.keys(C);if(M.length===0&&!W)return!0;const O=E.getValues(),pe=E.control._defaultValues;E.reset(O,{keepValues:!0});const ae=W;G(!1);const ce={tier:O.tier,...O.modelOverride?{modelId:O.modelOverride.modelId,credentialId:O.modelOverride.credentialId,modelTitle:O.modelOverride.title}:{}},de={id:r,name:O.name,active:O.active,models:ce,tools:O.tools,maxAgentSteps:O.maxAgentSteps,messages:Ls(p),temperature:0};try{await a.mutateAsync(de)}catch{return E.reset(pe,{keepValues:!0}),ae&&G(!0),!1}const I=[...M];return ae&&I.push("messages"),Z({type:"accumulate",now:Date.now(),fields:I}),fe(),!0},{schedule:me,flush:te}=_t({save:ue}),{schedule:fe,flush:se}=_t({delayMs:3e4,save:async()=>ie()});w.useEffect(()=>{const C=E.watch(()=>me());return()=>C.unsubscribe()},[]);const re=C=>{if(l(C),!Y){H(!0);return}G(!0),me()},le=async()=>{Ke("automation_test_clicked",{automation_id:r,agent_id:i});const C=await te();if(se(),!!C){if(!p){X.error(o("automations.automationDetail.noInstructionsConfigured"));return}try{const M=await d.mutateAsync(r);M.threadId&&(g(),f(M.threadId))}catch{}}};return t.jsxs(t.Fragment,{children:[s&&t.jsx("div",{className:"flex items-center pb-4 shrink-0",children:t.jsxs(B,{variant:"ghost",size:"sm",onClick:s,children:[t.jsx(Vt,{size:14}),o("automations.automationDetail.backToList")]})}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsx(Ct,{control:E.control,name:"name",render:({field:C})=>t.jsx(Nt,{...C,placeholder:o("automations.automationDetail.automationNamePlaceholder"),className:"border border-transparent shadow-none px-0 text-lg font-medium h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent flex-1",style:{boxShadow:"none"}})}),n&&t.jsx(B,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:n,children:t.jsx(Ys,{size:14})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ct,{control:E.control,name:"active",render:({field:C})=>t.jsx(ct,{checked:C.value,onCheckedChange:M=>{C.onChange(M),te()},className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:o(oe?"automations.automationDetail.active":"automations.automationDetail.inactive")}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx(Es,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.starter")}),t.jsx($a,{automationId:r,open:y,onOpenChange:v,onCustomSelect:()=>{T(!0),A(!1),D("")},onEventSelect:()=>{A(!0),T(!1)},onWebhookCreated:C=>{Ke("automation_trigger_added",{automation_id:r,trigger_type:"webhook"}),R(C)}})]}),e.triggers.length===0&&!b?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:[o("automations.automationDetail.whenShouldRun")," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:o("automations.automationDetail.addStarter")})," ",o("automations.automationDetail.toGetGoing")]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(C=>t.jsx(Xt,{trigger:C,automationId:r,connectionName:C.connection_id?x.get(C.connection_id):void 0},C.id))}),b&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(Me,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:_,onChange:C=>D(C.target.value),onBlur:async()=>{const C=_.trim();if(!(!C||!Re(C)))try{await j.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),Ke("automation_trigger_added",{automation_id:r,trigger_type:"cron"}),X.success(o("automations.automationDetail.starterAdded")),T(!1),D("")}catch{X.error(o("automations.automationDetail.failedToAddStarter"))}},onKeyDown:async C=>{const M=_.trim();C.key==="Enter"&&M&&Re(M)&&C.target.blur(),C.key==="Escape"&&(T(!1),D(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),_&&!Re(_)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:o("automations.automationDetail.invalid")}),j.isPending&&t.jsx(Le,{className:"size-[13px] text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity rounded-lg",onClick:()=>{T(!1),D("")},children:t.jsx(mt,{size:13})})]}),k&&t.jsx(w.Suspense,{fallback:t.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 rounded-lg border border-border bg-background",children:[t.jsx(Le,{className:"size-[13px] text-muted-foreground"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:o("automations.automationDetail.loadingConnections")})]}),children:t.jsx(Fa,{automationId:r,onDone:()=>A(!1)})}),t.jsx(Jt,{open:$!==null,onOpenChange:C=>{C||R(null)},url:$?.url??null,token:$?.token??null})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.instructions")}),t.jsxs(B,{variant:"outline",size:"sm",className:"gap-1.5",disabled:K||!p,onClick:J,children:[t.jsx(Ot,{size:13}),o("automations.automationDetail.improve")]})]}),t.jsx(Zs,{tiptapDoc:p,setTiptapDoc:re,placeholder:o("automations.automationDetail.instructionsPlaceholder"),children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Qs,{virtualMcpId:i||null,className:"max-h-[45vh]"}),t.jsx("div",{className:"@container/chat-bottom flex items-center justify-end gap-1.5 p-2.5",children:t.jsxs(Bs,{children:[t.jsx(Gs,{asChild:!0,children:t.jsxs(B,{type:"button",variant:"default",className:"gap-1.5",onClick:le,disabled:!i,children:[t.jsx(Xs,{size:16}),o("automations.automationDetail.test")]})}),t.jsx(Hs,{children:o("automations.automationDetail.testAutomation")})]})})]})})]}),t.jsxs(Vs,{open:N,onOpenChange:S,className:"flex flex-col gap-2.5",children:[t.jsxs(Us,{className:"group flex w-fit cursor-pointer items-center gap-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.advanced")}),t.jsx(rt,{size:14,className:"text-muted-foreground/60 transition-transform group-data-[state=open]:rotate-180"})]}),t.jsxs(Ws,{className:"flex flex-col gap-5 pt-0.5",children:[t.jsx(ua,{tier:E.watch("tier"),onTierChange:C=>E.setValue("tier",C,{shouldDirty:!0}),override:E.watch("modelOverride"),onOverrideChange:C=>E.setValue("modelOverride",C,{shouldDirty:!0})}),t.jsx(ga,{agentId:i||null,value:E.watch("tools"),onChange:C=>E.setValue("tools",C,{shouldDirty:!0})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:o("automations.automationDetail.maxSteps")}),t.jsx(Nt,{type:"number",min:1,max:100,className:"w-40",placeholder:o("automations.automationDetail.maxStepsPlaceholder",{default:Va}),value:E.watch("maxAgentSteps")??"",onChange:C=>{const M=C.target.value.trim(),O=M===""?null:Number(M);E.setValue("maxAgentSteps",O===null||Number.isNaN(O)?null:O,{shouldDirty:!0})}})]})]})]})]})]})}function Ba(r){const e=q.c(55),{automation:s}=r,n=ee(),{update:o}=ve();let i;e[0]!==s.name?(i=t.jsx("h2",{className:"text-lg font-medium text-foreground",children:s.name}),e[0]=s.name,e[1]=i):i=e[1];let c;e[2]!==n?(c=n("automations.builtin.badge"),e[2]=n,e[3]=c):c=e[3];let a;e[4]!==c?(a=t.jsx(Kt,{variant:"muted",children:c}),e[4]=c,e[5]=a):a=e[5];let j;e[6]!==i||e[7]!==a?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[i,a]}),e[6]=i,e[7]=a,e[8]=j):j=e[8];let d;e[9]!==s.id||e[10]!==o?(d=D=>o.mutate({id:s.id,active:D}),e[9]=s.id,e[10]=o,e[11]=d):d=e[11];let m;e[12]!==s.active||e[13]!==d||e[14]!==o.isPending?(m=t.jsx(ct,{checked:s.active,disabled:o.isPending,onCheckedChange:d,className:"cursor-pointer"}),e[12]=s.active,e[13]=d,e[14]=o.isPending,e[15]=m):m=e[15];let x;e[16]!==s.active||e[17]!==n?(x=s.active?n("automations.automationDetail.active"):n("automations.automationDetail.inactive"),e[16]=s.active,e[17]=n,e[18]=x):x=e[18];let f;e[19]!==x?(f=t.jsx("span",{className:"text-sm text-muted-foreground",children:x}),e[19]=x,e[20]=f):f=e[20];let g;e[21]!==m||e[22]!==f?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[m,f]}),e[21]=m,e[22]=f,e[23]=g):g=e[23];let u;e[24]!==j||e[25]!==g?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,g]}),e[24]=j,e[25]=g,e[26]=u):u=e[26];let h;e[27]!==n?(h=n("automations.automationDetail.starter"),e[27]=n,e[28]=h):h=e[28];let p;e[29]!==h?(p=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:h}),e[29]=h,e[30]=p):p=e[30];let l;if(e[31]!==s.id||e[32]!==s.triggers){let D;e[34]!==s.id?(D=k=>t.jsx(Xt,{trigger:k,automationId:s.id,readOnly:!0},k.id),e[34]=s.id,e[35]=D):D=e[35],l=s.triggers.map(D),e[31]=s.id,e[32]=s.triggers,e[33]=l}else l=e[33];let y;e[36]!==p||e[37]!==l?(y=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[p,l]}),e[36]=p,e[37]=l,e[38]=y):y=e[38];let v;e[39]!==n?(v=n("automations.automationDetail.instructions"),e[39]=n,e[40]=v):v=e[40];let N;e[41]!==v?(N=t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:v}),e[41]=v,e[42]=N):N=e[42];let S;e[43]!==s.system_key||e[44]!==n?(S=s.system_key==="implementer"?n("automations.builtin.implementerDescription"):s.system_key==="reviewer"?n("automations.builtin.reviewerDescription"):s.system_key==="linked_chats"?n("automations.builtin.linkedChatsDescription"):s.system_key==="pr_merged"?n("automations.builtin.prMergedDescription"):s.system_key==="chat_pr"?n("automations.builtin.chatPrDescription"):s.system_key==="agent_mentions"?n("automations.builtin.mentionsDescription"):n("automations.builtin.description"),e[43]=s.system_key,e[44]=n,e[45]=S):S=e[45];let b;e[46]!==S?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[46]=S,e[47]=b):b=e[47];let T;e[48]!==N||e[49]!==b?(T=t.jsxs("div",{className:"flex flex-col gap-2.5",children:[N,b]}),e[48]=N,e[49]=b,e[50]=T):T=e[50];let _;return e[51]!==u||e[52]!==y||e[53]!==T?(_=t.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,T]}),e[51]=u,e[52]=y,e[53]=T,e[54]=_):_=e[54],_}const Yt=[{key:"24h",labelKey:"mainPanelTabs.automationTab.last24hours",ms:1440*60*1e3},{key:"7d",labelKey:"mainPanelTabs.automationTab.last7days",ms:10080*60*1e3},{key:"30d",labelKey:"mainPanelTabs.automationTab.last30days",ms:720*60*60*1e3}];function Zt(r){const e=Yt.find(n=>n.key===r).ms,s=Date.now();return{startDate:new Date(s-e).toISOString(),endDate:new Date(s).toISOString()}}function Ga(r){const e=q.c(16),{automationId:s,triggerIds:n}=r,o=ee(),[i,c]=w.useState("30d"),[a,j]=w.useState(Ha);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=p=>{const l=p;c(l),j(Zt(l))},e[0]=d):d=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(he,{className:"w-44",children:t.jsx(je,{})}),e[1]=m):m=e[1];let x;e[2]!==o?(x=Yt.map(p=>t.jsx(be,{value:p.key,children:o(p.labelKey)},p.key)),e[2]=o,e[3]=x):x=e[3];let f;e[4]!==x?(f=t.jsx(ye,{children:x}),e[4]=x,e[5]=f):f=e[5];let g;e[6]!==f||e[7]!==i?(g=t.jsx("div",{className:"flex items-center justify-end",children:t.jsxs(ge,{value:i,onValueChange:d,children:[m,f]})}),e[6]=f,e[7]=i,e[8]=g):g=e[8];let u;e[9]!==s||e[10]!==a||e[11]!==n?(u=t.jsx(ra,{automationId:s,triggerIds:n,range:a}),e[9]=s,e[10]=a,e[11]=n,e[12]=u):u=e[12];let h;return e[13]!==g||e[14]!==u?(h=t.jsxs("div",{className:"flex flex-col gap-5",children:[g,u]}),e[13]=g,e[14]=u,e[15]=h):h=e[15],h}function Ha(){return Zt("30d")}function Ja(r){const e=q.c(5),{tabId:s}=r;let n;e[0]!==s?(n=ds(s),e[0]=s,e[1]=n):n=e[1];const o=n;if(!o)return null;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qe,{}),e[2]=i):i=e[2];let c;return e[3]!==o.id?(c=t.jsx(w.Suspense,{fallback:i,children:t.jsx(Xa,{id:o.id})}),e[3]=o.id,e[4]=c):c=e[4],c}function Xa(r){const e=q.c(41),{id:s}=r,n=ee(),{openPanel:o}=ca(),{data:i,isLoading:c}=Ks(s),[a,j]=w.useState("settings");let d;e[0]!==o?(d=()=>o("automations"),e[0]=o,e[1]=d):d=e[1];const m=d;if(c){let k;return e[2]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Qe,{}),e[2]=k):k=e[2],k}if(!i){let k;e[3]!==n?(k=n("mainPanelTabs.automationTab.automationNotFound"),e[3]=n,e[4]=k):k=e[4];let A;return e[5]!==k?(A=t.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:k}),e[5]=k,e[6]=A):A=e[6],A}let x;e[7]!==i.triggers?(x=i.triggers.map(Ya),e[7]=i.triggers,e[8]=x):x=e[8];const f=x;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vt,{size:14}),e[9]=g):g=e[9];let u;e[10]!==n?(u=n("mainPanelTabs.automationTab.backToList"),e[10]=n,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs(B,{variant:"ghost",size:"sm",onClick:m,children:[g,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let p;e[15]!==n?(p=n("mainPanelTabs.automationTab.settings"),e[15]=n,e[16]=p):p=e[16];let l;e[17]!==p?(l={id:"settings",label:p},e[17]=p,e[18]=l):l=e[18];let y;e[19]!==n?(y=n("mainPanelTabs.automationTab.runs"),e[19]=n,e[20]=y):y=e[20];let v;e[21]!==y?(v={id:"runs",label:y},e[21]=y,e[22]=v):v=e[22];let N;e[23]!==l||e[24]!==v?(N=[l,v],e[23]=l,e[24]=v,e[25]=N):N=e[25];let S;e[26]===Symbol.for("react.memo_cache_sentinel")?(S=k=>j(k),e[26]=S):S=e[26];let b;e[27]!==N||e[28]!==a?(b=t.jsx(la,{placement:"page",tabs:N,activeTab:a,onTabChange:S}),e[27]=N,e[28]=a,e[29]=b):b=e[29];let T;e[30]!==b||e[31]!==h?(T=t.jsxs("div",{className:"flex items-center justify-between pb-4 shrink-0",children:[h,b]}),e[30]=b,e[31]=h,e[32]=T):T=e[32];let _;e[33]!==i||e[34]!==s||e[35]!==a||e[36]!==f?(_=a==="settings"?i.system_key?t.jsx(Ba,{automation:i}):t.jsx(Wa,{automationId:s,automation:i}):t.jsx(w.Suspense,{fallback:t.jsx(Qe,{}),children:t.jsx(Ga,{automationId:s,triggerIds:f})}),e[33]=i,e[34]=s,e[35]=a,e[36]=f,e[37]=_):_=e[37];let D;return e[38]!==T||e[39]!==_?(D=t.jsx(Xe,{children:t.jsx(Xe.Content,{children:t.jsxs(Xe.Container,{children:[T,_]})})}),e[38]=T,e[39]=_,e[40]=D):D=e[40],D}function Ya(r){return r.id}function Za(){const r=q.c(3);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},r[0]=e):e=r[0];const{automationId:s}=ms(e);let n;return r[1]!==s?(n=s?t.jsx(Ja,{tabId:`automation:${s}`}):null,r[1]=s,r[2]=n):n=r[2],n}function fi(){const r=q.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(us.Content,{children:t.jsx(Za,{})}),r[0]=e):e=r[0],e}export{fi as default};
@@ -1 +1 @@
1
- import{c as S,b as K,r as F,j as e,n as a,E as O,B as V,aZ as Q}from"./index-CcqLnTyv.js";import{C as U}from"./index-8ANyj4B7.js";import{s as W}from"./Plus-D8rFucQH.js";import{l as X}from"./agent-icon-DqjTL3cE.js";import{i as Z}from"./Zap-DpvU6Dp2.js";import{S as Y}from"./search-input-DFXG_UYw.js";import{E as $}from"./empty-state-DiGOrU7G.js";import{u as tt,a as et,b as it}from"./use-automations-B64sqUmg.js";import{a as ot}from"./autosend-_WPHuuuS.js";import{A as st}from"./automation-list-row-guzwZg5A.js";import{b as nt}from"./thread-route-D5E5K-lU.js";import"./use-mobile-BgN1E82d.js";import"./use-sidebar-collapsed-B34u6RwD.js";import"./use-chat-layout-state-Be9vIJ9A.js";import"./thread-intent-pegObLq9.js";import"./use-mcp-client-DvDomB9A.js";import"./auth-qAWEiaXq.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CYcZM1HP.js";import"./task-board-DcTNURQy.js";import"./schema-D4ZSsKIV.js";import"./tooltip-AKf-E49i.js";import"./index-D146teOp.js";import"./toolbar-icon-button-CTRAa2ng.js";import"./shell-layout-CBX9BtMX.js";import"./Globe04--FaZazgw.js";import"./UserSquare-BJHrMhrM.js";import"./use-deployment-admin-D9sSgOb1.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BDiB_Nvo.js";import"./use-project-scope-Cb4T7-Pe.js";import"./repository-binding-CuR-5wbj.js";import"./CheckCircle-B4NfGYxe.js";import"./Monitor01-Su614Ctg.js";import"./Tool01-BTDYOKsB.js";import"./command-CtR4gjCr.js";import"./index-DCh3kkGn.js";import"./SearchMd-2MPq0KPN.js";import"./integration-icon-ChQEBlMz.js";import"./LinkBroken01-C9GtmpYY.js";import"./project-icon-BlOLnUr2.js";import"./use-navigate-to-agent-DmfSMV3R.js";import"./use-debounced-value-CcMMD4Qy.js";import"./new-project-dialog-C_1Rs0SG.js";import"./ArrowLeft-B1m5qQi9.js";import"./label-CsfAEF08.js";import"./repository-picker-DEa_L5X-.js";import"./github-icon-BBNizm_E.js";import"./useInfiniteQuery-WRSkkanY.js";import"./infiniteQueryObserver-uDA4YvYL.js";import"./collection-search-iHJVqUHB.js";import"./ShoppingBag01-DDCYsqx9.js";import"./use-organization-settings-sxurgilE.js";import"./required-auth-layout-BnfTNype.js";import"./use-org-sso-CGB_T6WF.js";import"./sheet-B2jsXlHJ.js";import"./resizable-G0IV9sBv.js";import"./AlertCircle-kYtqXGU8.js";import"./ArrowUp-DcYpepHk.js";import"./ChevronUp-DRG0w_P4.js";import"./ChevronSelectorVertical-EqyUOMMk.js";import"./CreditCard01-BLl0RgXC.js";import"./SwitchHorizontal01-D7HAXgYP.js";import"./Key01-D0Pq98hT.js";import"./Minus-eGpg4-RN.js";import"./Sun-Dvv08Urq.js";import"./Play-D_ph4pZ0.js";import"./Trash01-CHCe7_6o.js";import"./Upload01-Q6ECKQXp.js";import"./Users01-DHfg9AEk.js";import"./badge-DtxRsHGH.js";function rt(o){if(!(o instanceof Error))return!1;const t=o.message.toLowerCase();return t.includes("relation")&&t.includes("does not exist")}function at(o){const t=S.c(45),{virtualMcpId:n}=o,i=K(),{openPanel:r}=ot(),{data:D,error:M}=tt(n),v=D===void 0?[]:D,{create:y}=et(),[_,G]=F.useState("");if(M&&rt(M)){let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(X,{size:48,className:"text-muted-foreground"}),t[0]=s):s=t[0];let x;t[1]!==i?(x=i("automations.setupRequired.title"),t[1]=i,t[2]=x):x=t[2];let h;t[3]!==i?(h=i("automations.setupRequired.description"),t[3]=i,t[4]=h):h=t[4];let j;t[5]!==r?(j=()=>r("settings"),t[5]=r,t[6]=j):j=t[6];let g;t[7]!==i?(g=i("automations.setupRequired.goToSetup"),t[7]=i,t[8]=g):g=t[8];let C;t[9]!==j||t[10]!==g?(C=e.jsx(V,{size:"sm",onClick:j,children:g}),t[9]=j,t[10]=g,t[11]=C):C=t[11];let N;return t[12]!==x||t[13]!==h||t[14]!==C?(N=e.jsx(a,{children:e.jsx(a.Content,{children:e.jsx(a.Container,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:s,title:x,description:h,actions:C})})})})}),t[12]=x,t[13]=h,t[14]=C,t[15]=N):N=t[15],N}const H=_.toLowerCase(),q=v.filter(s=>s.name.toLowerCase().includes(H));let w;t[16]!==r?(w=s=>r(`automation:${s}`),t[16]=r,t[17]=w):w=t[17];const B=w,R=async()=>{if(y.isPending)return;O("automation_new_clicked",{virtual_mcp_id:n,existing_count:v.length});const s=await y.mutateAsync(it(n));B(s.id)},J=y.isPending;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(W,{size:14}),t[18]=A):A=t[18];let m;t[19]!==i?(m=i("automations.automationsList.newAutomation"),t[19]=i,t[20]=m):m=t[20];let L;t[21]!==y.isPending||t[22]!==R||t[23]!==m?(L=e.jsxs(V,{size:"sm",onClick:R,disabled:J,children:[A,m]}),t[21]=y.isPending,t[22]=R,t[23]=m,t[24]=L):L=t[24];const P=L,E=a,T=a,k=a;let l;t[25]!==i?(l=i("automations.automationsList.title"),t[25]=i,t[26]=l):l=t[26];let c;t[27]!==P||t[28]!==l?(c=e.jsx(a.Title,{actions:P,children:l}),t[27]=P,t[28]=l,t[29]=c):c=t[29];const z=v.length>0&&e.jsx(Y,{value:_,onChange:G,placeholder:i("automations.automationsList.searchPlaceholder"),className:"w-full md:w-[375px]"});let p;t[30]!==z?(p=e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:z}),t[30]=z,t[31]=p):p=t[31];let u;t[32]!==c||t[33]!==p?(u=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,p]}),t[32]=c,t[33]=p,t[34]=u):u=t[34];const I=v.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(Z,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.emptyTitle"),description:i("automations.automationsList.emptyDescription"),actions:!1})}):q.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(Z,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.noResultsTitle"),description:i("automations.automationsList.noResultsDescription",{search:_})})}):e.jsx("div",{className:"mt-6 flex flex-col divide-y divide-border overflow-hidden rounded-xl bg-card shadow-edge",children:q.map(s=>e.jsx(st,{automation:s,onClick:()=>B(s.id)},s.id))});let d;t[35]!==u||t[36]!==I||t[37]!==k.Container?(d=e.jsxs(k.Container,{children:[u,I]}),t[35]=u,t[36]=I,t[37]=k.Container,t[38]=d):d=t[38];let f;t[39]!==d||t[40]!==T.Content?(f=e.jsx(T.Content,{children:d}),t[39]=d,t[40]=T.Content,t[41]=f):f=t[41];let b;return t[42]!==E||t[43]!==f?(b=e.jsx(E,{children:f}),t[42]=E,t[43]=f,t[44]=b):b=t[44],b}function mt(o){const t=S.c(3),{virtualMcpId:n}=o;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=e.jsx(Q,{}),t[0]=i):i=t[0];let r;return t[1]!==n?(r=e.jsx(F.Suspense,{fallback:i,children:e.jsx(at,{virtualMcpId:n})}),t[1]=n,t[2]=r):r=t[2],r}function lt(){const o=S.c(2),t=nt();let n;return o[0]!==t?(n=e.jsx(mt,{virtualMcpId:t}),o[0]=t,o[1]=n):n=o[1],n}function Se(){const o=S.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(U.Content,{children:e.jsx(lt,{})}),o[0]=t):t=o[0],t}export{Se as default};
1
+ import{c as S,b as K,r as F,j as e,n as a,E as O,B as V,aZ as Q}from"./index-B0M6fld0.js";import{C as U}from"./index-BqYmVY5c.js";import{s as W}from"./Plus-DD-WVS1P.js";import{l as X}from"./agent-icon-2MzErGc_.js";import{i as Z}from"./Zap-B1DyovfK.js";import{S as Y}from"./search-input-CEHMJvIu.js";import{E as $}from"./empty-state-BBHWcru0.js";import{u as tt,a as et,b as it}from"./use-automations-IINULJEn.js";import{a as ot}from"./autosend-C5Y0g7p2.js";import{A as st}from"./automation-list-row-DBYEb7yh.js";import{b as nt}from"./thread-route-CidpLna8.js";import"./use-mobile-JxzmRS3O.js";import"./use-sidebar-collapsed-D8frxAVL.js";import"./use-chat-layout-state-SKM2dTYC.js";import"./thread-intent-B-lUepd6.js";import"./use-mcp-client-C8sFqQYs.js";import"./auth-Zsy5lyIS.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-CwQVaju9.js";import"./task-board-r7mBQBfA.js";import"./schema-DDAhL9Cr.js";import"./tooltip-DUgZeaAs.js";import"./index-BjDHxKQ1.js";import"./toolbar-icon-button-DLb2L87M.js";import"./shell-layout-B_Je98M9.js";import"./Globe04-DFwi3CoQ.js";import"./UserSquare-CPjVW48L.js";import"./use-deployment-admin-CoSxtFqU.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BBI2UlVL.js";import"./use-project-scope-BLJIcw6l.js";import"./repository-binding-D5Bfxppj.js";import"./CheckCircle-l0BgBdex.js";import"./Monitor01-pdAw5Hpb.js";import"./Tool01-CMaWHp8E.js";import"./command-BNUAVYAm.js";import"./index-woHs2Bei.js";import"./SearchMd-D2GFNI7a.js";import"./integration-icon-CbGo7Hoi.js";import"./LinkBroken01-BkclpWPr.js";import"./project-icon-BFEgPANo.js";import"./use-navigate-to-agent-BPUG-DwT.js";import"./use-debounced-value-Df5Y0bKp.js";import"./new-project-dialog-xaa497EH.js";import"./ArrowLeft-Clex4DU3.js";import"./label-C2-_lSSQ.js";import"./repository-picker-BG4RNPTd.js";import"./github-icon-Fl1CK57w.js";import"./useInfiniteQuery-CrPhADUx.js";import"./infiniteQueryObserver-CQdhIsL1.js";import"./collection-search-EpeR-DRK.js";import"./ShoppingBag01-BQMf6OTu.js";import"./use-organization-settings-DgPYo7py.js";import"./required-auth-layout-BDLyo6_T.js";import"./use-org-sso-CxdxMmbI.js";import"./sheet-C5Vpqn4B.js";import"./resizable-ZTEIsDw7.js";import"./AlertCircle-Cn7aLqGD.js";import"./ArrowUp-DPT2wlR7.js";import"./ChevronUp-D0xD4CWi.js";import"./ChevronSelectorVertical-BbXlLdNT.js";import"./CreditCard01-CAgfpVLC.js";import"./SwitchHorizontal01-amrllZXH.js";import"./Key01-q3498IuC.js";import"./Minus-D2H1757g.js";import"./Sun-BWeGTNdA.js";import"./Play-mj0Zbxy1.js";import"./Trash01-CrG-kC_D.js";import"./Upload01-CyQARd6T.js";import"./Users01-BPY3vewQ.js";import"./badge-CR0zmQ24.js";function rt(o){if(!(o instanceof Error))return!1;const t=o.message.toLowerCase();return t.includes("relation")&&t.includes("does not exist")}function at(o){const t=S.c(45),{virtualMcpId:n}=o,i=K(),{openPanel:r}=ot(),{data:D,error:M}=tt(n),v=D===void 0?[]:D,{create:y}=et(),[_,G]=F.useState("");if(M&&rt(M)){let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(X,{size:48,className:"text-muted-foreground"}),t[0]=s):s=t[0];let x;t[1]!==i?(x=i("automations.setupRequired.title"),t[1]=i,t[2]=x):x=t[2];let h;t[3]!==i?(h=i("automations.setupRequired.description"),t[3]=i,t[4]=h):h=t[4];let j;t[5]!==r?(j=()=>r("settings"),t[5]=r,t[6]=j):j=t[6];let g;t[7]!==i?(g=i("automations.setupRequired.goToSetup"),t[7]=i,t[8]=g):g=t[8];let C;t[9]!==j||t[10]!==g?(C=e.jsx(V,{size:"sm",onClick:j,children:g}),t[9]=j,t[10]=g,t[11]=C):C=t[11];let N;return t[12]!==x||t[13]!==h||t[14]!==C?(N=e.jsx(a,{children:e.jsx(a.Content,{children:e.jsx(a.Container,{children:e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:s,title:x,description:h,actions:C})})})})}),t[12]=x,t[13]=h,t[14]=C,t[15]=N):N=t[15],N}const H=_.toLowerCase(),q=v.filter(s=>s.name.toLowerCase().includes(H));let w;t[16]!==r?(w=s=>r(`automation:${s}`),t[16]=r,t[17]=w):w=t[17];const B=w,R=async()=>{if(y.isPending)return;O("automation_new_clicked",{virtual_mcp_id:n,existing_count:v.length});const s=await y.mutateAsync(it(n));B(s.id)},J=y.isPending;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(W,{size:14}),t[18]=A):A=t[18];let m;t[19]!==i?(m=i("automations.automationsList.newAutomation"),t[19]=i,t[20]=m):m=t[20];let L;t[21]!==y.isPending||t[22]!==R||t[23]!==m?(L=e.jsxs(V,{size:"sm",onClick:R,disabled:J,children:[A,m]}),t[21]=y.isPending,t[22]=R,t[23]=m,t[24]=L):L=t[24];const P=L,E=a,T=a,k=a;let l;t[25]!==i?(l=i("automations.automationsList.title"),t[25]=i,t[26]=l):l=t[26];let c;t[27]!==P||t[28]!==l?(c=e.jsx(a.Title,{actions:P,children:l}),t[27]=P,t[28]=l,t[29]=c):c=t[29];const z=v.length>0&&e.jsx(Y,{value:_,onChange:G,placeholder:i("automations.automationsList.searchPlaceholder"),className:"w-full md:w-[375px]"});let p;t[30]!==z?(p=e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:z}),t[30]=z,t[31]=p):p=t[31];let u;t[32]!==c||t[33]!==p?(u=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,p]}),t[32]=c,t[33]=p,t[34]=u):u=t[34];const I=v.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(Z,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.emptyTitle"),description:i("automations.automationsList.emptyDescription"),actions:!1})}):q.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($,{image:e.jsx(Z,{size:48,className:"text-muted-foreground"}),title:i("automations.automationsList.noResultsTitle"),description:i("automations.automationsList.noResultsDescription",{search:_})})}):e.jsx("div",{className:"mt-6 flex flex-col divide-y divide-border overflow-hidden rounded-xl bg-card shadow-edge",children:q.map(s=>e.jsx(st,{automation:s,onClick:()=>B(s.id)},s.id))});let d;t[35]!==u||t[36]!==I||t[37]!==k.Container?(d=e.jsxs(k.Container,{children:[u,I]}),t[35]=u,t[36]=I,t[37]=k.Container,t[38]=d):d=t[38];let f;t[39]!==d||t[40]!==T.Content?(f=e.jsx(T.Content,{children:d}),t[39]=d,t[40]=T.Content,t[41]=f):f=t[41];let b;return t[42]!==E||t[43]!==f?(b=e.jsx(E,{children:f}),t[42]=E,t[43]=f,t[44]=b):b=t[44],b}function mt(o){const t=S.c(3),{virtualMcpId:n}=o;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=e.jsx(Q,{}),t[0]=i):i=t[0];let r;return t[1]!==n?(r=e.jsx(F.Suspense,{fallback:i,children:e.jsx(at,{virtualMcpId:n})}),t[1]=n,t[2]=r):r=t[2],r}function lt(){const o=S.c(2),t=nt();let n;return o[0]!==t?(n=e.jsx(mt,{virtualMcpId:t}),o[0]=t,o[1]=n):n=o[1],n}function Se(){const o=S.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(U.Content,{children:e.jsx(lt,{})}),o[0]=t):t=o[0],t}export{Se as default};