@decocms/mesh 2.125.3 → 2.127.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 (212) hide show
  1. package/dist/client/assets/{AlertCircle-CAn1onHH.js → AlertCircle-DJ052zqS.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-ChcnKW7P.js → AlertOctagon-DCNCOxEl.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-Suhq71Ba.js → AlertTriangle-MQM19F_y.js} +1 -1
  4. package/dist/client/assets/{ArrowDown-BQn3fvf7.js → ArrowDown-Bn9Nw2BD.js} +1 -1
  5. package/dist/client/assets/{ArrowLeft-DkojAdWe.js → ArrowLeft-BSPqreiE.js} +1 -1
  6. package/dist/client/assets/{ArrowUp-CCTJ8tar.js → ArrowUp-BLFAP4Oh.js} +1 -1
  7. package/dist/client/assets/{Check-2BTd1528.js → Check-BXz-Aa3Y.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DUsP9qJl.js → CheckCircle-DmsV77x1.js} +1 -1
  9. package/dist/client/assets/{CheckDone01-Bs5yfbwu.js → CheckDone01-CQuFbmYi.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-D9LvEg4-.js → CheckVerified02-C2uVr9FW.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-BK0Z-3ss.js → ChevronDown-CEb48ZDu.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-CpFHeZ-k.js → ChevronRight-CQS5xbc3.js} +1 -1
  13. package/dist/client/assets/{Clock-DWLl74MU.js → Clock-X1ZnQ0e8.js} +1 -1
  14. package/dist/client/assets/{Code01-D7rt1C5k.js → Code01-CVF-mmmz.js} +1 -1
  15. package/dist/client/assets/{Container-Dkua_wx6.js → Container-D3N8SS-J.js} +1 -1
  16. package/dist/client/assets/{Copy01-CWD2XYkN.js → Copy01-CFXdI8SF.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-dIUcYa_e.js → Dataflow03-BvFbR-2p.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-R03fSXLm.js → DotsHorizontal-BlKZUIAr.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-nJGFqnIJ.js → DotsVertical-CJJQe-sw.js} +1 -1
  20. package/dist/client/assets/{Download01-w53nljTi.js → Download01-BuGXWPUb.js} +1 -1
  21. package/dist/client/assets/{Edit01-Een9NeGa.js → Edit01-vxAH-tv6.js} +1 -1
  22. package/dist/client/assets/{Eye-cRMKwlob.js → Eye-Cqy0OQfO.js} +1 -1
  23. package/dist/client/assets/{File02-BiHbI-Bs.js → File02-CYWnFy5E.js} +1 -1
  24. package/dist/client/assets/{File06-DK6hozGp.js → File06-p-mGMfLu.js} +1 -1
  25. package/dist/client/assets/{FilterLines-DcFfiBYv.js → FilterLines-B-D6srZC.js} +1 -1
  26. package/dist/client/assets/{Globe01-zBSU4RrG.js → Globe01-Di6WS1d0.js} +1 -1
  27. package/dist/client/assets/{Globe02-BzI-D3XF.js → Globe02-CL5aTFno.js} +1 -1
  28. package/dist/client/assets/{Grid01-DtWTP079.js → Grid01-BGPoEeik.js} +1 -1
  29. package/dist/client/assets/{Hash02-B_cIkiva.js → Hash02-BWg3CKrn.js} +1 -1
  30. package/dist/client/assets/{Home02-B0J9-6Fj.js → Home02-Atzompjz.js} +1 -1
  31. package/dist/client/assets/{Image01-DuLPJrbP.js → Image01-B-9nWGvT.js} +1 -1
  32. package/dist/client/assets/{Inbox01-DkeOZ2C_.js → Inbox01-CWbCHIve.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-v_Zi3ix-.js → InfoCircle-BxNpDB4f.js} +1 -1
  34. package/dist/client/assets/{Key01-FdWHEw6c.js → Key01-BBHw8-AF.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-BvWelMzx.js → LinkExternal01-BH7m2QmL.js} +1 -1
  36. package/dist/client/assets/{List-D1SXIq-Q.js → List-DZq_3WJK.js} +1 -1
  37. package/dist/client/assets/{Loading01-BntQXW3R.js → Loading01-Bm0RmGTq.js} +1 -1
  38. package/dist/client/assets/{Lock01-Ca25inpJ.js → Lock01-BY0MGONc.js} +1 -1
  39. package/dist/client/assets/{Pin01-D5SNXGno.js → Pin01-BQxfi8aj.js} +1 -1
  40. package/dist/client/assets/{Play-Dv6XoPC1.js → Play-CGUn4LDu.js} +1 -1
  41. package/dist/client/assets/{Plus-BpJ1F9ED.js → Plus-CfD4U7h2.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-C6HpBrM2.js → RefreshCcw01-ClQUpEVA.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-BLvlqjIJ.js → RefreshCw01-DsYl6Nso.js} +1 -1
  44. package/dist/client/assets/{Rows03-Bw2KmPLF.js → Rows03-BmDCzA2B.js} +1 -1
  45. package/dist/client/assets/{Save01-C7Op6P3G.js → Save01-CVm8Nhi5.js} +1 -1
  46. package/dist/client/assets/{SearchMd-B22BWSrE.js → SearchMd-rBeGYVN8.js} +1 -1
  47. package/dist/client/assets/{Settings01-39eYdV1s.js → Settings01-BCU61Dg3.js} +1 -1
  48. package/dist/client/assets/{Shield01-D5vtlDrS.js → Shield01-D73wrcGm.js} +1 -1
  49. package/dist/client/assets/{Terminal-jwgZ8meH.js → Terminal-B7IR3GOF.js} +1 -1
  50. package/dist/client/assets/Tool01-D4p-h1gd.js +1 -0
  51. package/dist/client/assets/{Trash01-NHvYJiOw.js → Trash01-CNjhe6V_.js} +1 -1
  52. package/dist/client/assets/{Upload01-B7z0chWz.js → Upload01-KtFgXqwG.js} +1 -1
  53. package/dist/client/assets/{Users03-CfBv5uVc.js → Users03-DNxW_fja.js} +1 -1
  54. package/dist/client/assets/{X-nbY3n5YX.js → X-OID4YrAs.js} +1 -1
  55. package/dist/client/assets/{XCircle-CdrNrzcr.js → XCircle-LfPUm5IL.js} +1 -1
  56. package/dist/client/assets/{XClose-DHV8bqGR.js → XClose-CVjVP425.js} +1 -1
  57. package/dist/client/assets/{agent-connections-preview-D2nPeCg-.js → agent-connections-preview-BPhKy-Id.js} +1 -1
  58. package/dist/client/assets/agent-detail-HyuxH4Ve.js +2 -0
  59. package/dist/client/assets/agents-Bc9eRkDe.js +1 -0
  60. package/dist/client/assets/{alert-dialog-DIblcPQC.js → alert-dialog-9GjsXnzK.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-lueUuNUs.js → auth-catchall-Bsy9nmf9.js} +1 -1
  62. package/dist/client/assets/{avatar-DAde4Coq.js → avatar-D7LZZNPu.js} +1 -1
  63. package/dist/client/assets/{badge-EvnzqGBM.js → badge-CQ9R9pkG.js} +1 -1
  64. package/dist/client/assets/{binder-DtqSnmtn.js → binder-BRFblyKj.js} +1 -1
  65. package/dist/client/assets/{breadcrumb-Dit0z7A7.js → breadcrumb-_jAneXHm.js} +1 -1
  66. package/dist/client/assets/{button-DDY6hri1.js → button-BjJbLzI1.js} +1 -1
  67. package/dist/client/assets/{card-CHcjH7V4.js → card-BiNPXwY7.js} +1 -1
  68. package/dist/client/assets/{chart-BEZIHLHA.js → chart-Cye540qd.js} +5 -5
  69. package/dist/client/assets/{checkbox-_pZquTsv.js → checkbox-ClNyXMEe.js} +1 -1
  70. package/dist/client/assets/{circle-alert-8my-DdYx.js → circle-alert-BwBTOPt2.js} +1 -1
  71. package/dist/client/assets/collection-detail-CgUzsg7m.js +26 -0
  72. package/dist/client/assets/collection-search-D9lLlfmK.js +1 -0
  73. package/dist/client/assets/collection-tab-CK-Q89lj.js +1 -0
  74. package/dist/client/assets/collection-table-wrapper-HJznMrYU.js +1 -0
  75. package/dist/client/assets/{collection-tabs-CMMj9apF.js → collection-tabs-D0BDRIQH.js} +1 -1
  76. package/dist/client/assets/{command-D0lPyqX9.js → command-CmCm6EpS.js} +1 -1
  77. package/dist/client/assets/{connect-jPJQySxH.js → connect-D_vBcyxr.js} +1 -1
  78. package/dist/client/assets/{connection-card-C36z_Zfo.js → connection-card-O78FPkKW.js} +1 -1
  79. package/dist/client/assets/connection-detail-CqECx5w9.js +1 -0
  80. package/dist/client/assets/connections-DcBskx9Y.js +1 -0
  81. package/dist/client/assets/{constants-BWuwqVaf.js → constants-Bz_J8k2h.js} +1 -1
  82. package/dist/client/assets/constants-CQfW12Qo.js +1 -0
  83. package/dist/client/assets/{context-BoqYBHof.js → context-DPw3JrfP.js} +1 -1
  84. package/dist/client/assets/{create-organization-dialog-DZ-29KA3.js → create-organization-dialog-ChDwEIL0.js} +1 -1
  85. package/dist/client/assets/{create-project-dialog-5JWgj7o1.js → create-project-dialog-D_pqfYAD.js} +1 -1
  86. package/dist/client/assets/{deco-constants-Lndb0_Fi.js → deco-constants-CGrimklY.js} +1 -1
  87. package/dist/client/assets/{dialog-AmArt43J.js → dialog-CsS26GNP.js} +1 -1
  88. package/dist/client/assets/{dropdown-menu-CMr4pVGd.js → dropdown-menu-Bx6HZEO6.js} +1 -1
  89. package/dist/client/assets/{dynamic-plugin-layout-B-RWLbim.js → dynamic-plugin-layout-ChDoP95P.js} +1 -1
  90. package/dist/client/assets/editable-thread-title-DG8vSbP7.js +16 -0
  91. package/dist/client/assets/{empty-state-BxqfhnZC.js → empty-state-BIKMZA4A.js} +1 -1
  92. package/dist/client/assets/{env-vars-editor-CeWJLU0d.js → env-vars-editor-Bu4z6L63.js} +1 -1
  93. package/dist/client/assets/{error-boundary-BbdoNwwk.js → error-boundary-BOjL_3iE.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-FghvIcuN.js → extract-connection-data-9qHOXLXC.js} +1 -1
  95. package/dist/client/assets/{file-browser-BRNDEG3O.js → file-browser-DlsvWnR4.js} +2 -2
  96. package/dist/client/assets/{form-Bsyh-cQj.js → form-BcYKMkAo.js} +1 -1
  97. package/dist/client/assets/{grid-view-BjxbyS3V.js → grid-view-DKE_LwVv.js} +1 -1
  98. package/dist/client/assets/{home-BqlHZV0D.js → home-CfX1o6Ev.js} +1 -1
  99. package/dist/client/assets/index-B7FUMscm.css +1 -0
  100. package/dist/client/assets/{index-ClGhCbA0.js → index-BFnklquP.js} +72 -62
  101. package/dist/client/assets/{index-IwkUYudi.js → index-BqwppNxk.js} +1 -1
  102. package/dist/client/assets/{index-CMIePc8v.js → index-CKXRhh0t.js} +37 -37
  103. package/dist/client/assets/{index-7GX9Z2_E.js → index-DbG6jisP.js} +1 -1
  104. package/dist/client/assets/{index-BwsTCLNe.js → index-Ds78Hq48.js} +1 -1
  105. package/dist/client/assets/index-LVMAuFW8.js +1 -0
  106. package/dist/client/assets/{index-_qbzL5MU.js → index-kQL4iCgd.js} +1 -1
  107. package/dist/client/assets/{index-Ck8tqNHK.js → index-lC9RbQEq.js} +1 -1
  108. package/dist/client/assets/{index-MmPZuevW.js → index-nl6bR4T8.js} +1 -1
  109. package/dist/client/assets/{infiniteQueryObserver-DuAdiH0n.js → infiniteQueryObserver-C_YVCa9u.js} +1 -1
  110. package/dist/client/assets/{input-Je9XV62u.js → input-BPPp7fkV.js} +1 -1
  111. package/dist/client/assets/{integration-icon-DeiJ75EP.js → integration-icon-CaUI1jG_.js} +1 -1
  112. package/dist/client/assets/{label-Ct-IE-k2.js → label-Ce-8MeXM.js} +1 -1
  113. package/dist/client/assets/{layout-BWtcS0Q2.js → layout-B_vm2aCi.js} +1 -1
  114. package/dist/client/assets/{localstorage-keys-B-4HWrAO.js → localstorage-keys-D7-2hl7K.js} +1 -1
  115. package/dist/client/assets/{login-swb3IsCw.js → login-BZjy-JZF.js} +1 -1
  116. package/dist/client/assets/{markdown-BshJmJUr.js → markdown-CL_nEHz6.js} +1 -1
  117. package/dist/client/assets/mcp-oauth-6gipdrl8.js +1 -0
  118. package/dist/client/assets/{mcp-server-card-DJ-C7iNn.js → mcp-server-card-k65UbfnQ.js} +1 -1
  119. package/dist/client/assets/mcp-server-detail-DOi3A41L.js +2 -0
  120. package/dist/client/assets/members-DyXednFN.js +3 -0
  121. package/dist/client/assets/{monitoring-Dkzs8zLr.js → monitoring-CbDWX7qw.js} +2 -2
  122. package/dist/client/assets/{monitoring-dashboard-edit-6Jd7ItfF.js → monitoring-dashboard-edit-Xu9WaY0f.js} +1 -1
  123. package/dist/client/assets/{monitoring-dashboard-view-NmZHmCWV.js → monitoring-dashboard-view-BnJZoOh6.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-hu62EGGB.js → oauth-callback-CLQrXT_i.js} +1 -1
  125. package/dist/client/assets/page-NSWxyYqB.js +1 -0
  126. package/dist/client/assets/page-tLMAT584.js +1 -0
  127. package/dist/client/assets/{plugin-empty-state-BfDH4uPn.js → plugin-empty-state-D5Ff5dMm.js} +1 -1
  128. package/dist/client/assets/{plugin-empty-state-DRRVQKmb.js → plugin-empty-state-WLlCNcH0.js} +1 -1
  129. package/dist/client/assets/{plugin-header-BPNBXPjM.js → plugin-header-DBNmWz2Z.js} +1 -1
  130. package/dist/client/assets/{plugin-header-8kNYjC6n.js → plugin-header-D_CX7196.js} +1 -1
  131. package/dist/client/assets/{popover-CdPr2kUy.js → popover-Dz4mFPzW.js} +1 -1
  132. package/dist/client/assets/{project-layout-bgteQ5fY.js → project-layout-L7FdQtTW.js} +1 -1
  133. package/dist/client/assets/projects-list-DFLeaqhB.js +1 -0
  134. package/dist/client/assets/{ranking-layout-BxRgmZtS.js → ranking-layout-CLhL84_g.js} +1 -1
  135. package/dist/client/assets/{readme-viewer-ym80L_hw.js → readme-viewer-BAJaQnye.js} +1 -1
  136. package/dist/client/assets/{registry-layout-C8Ew4flr.js → registry-layout-CLL316VY.js} +1 -1
  137. package/dist/client/assets/{registry-utils-DBAgugDf.js → registry-utils-C_nLhlWN.js} +1 -1
  138. package/dist/client/assets/{reports-layout-BoIJWhiW.js → reports-layout-DnfAta3q.js} +2 -2
  139. package/dist/client/assets/{reset-password-DY5mUItc.js → reset-password-Cpx9ZUFt.js} +1 -1
  140. package/dist/client/assets/{resizable-8m39GKGn.js → resizable-TMJNEC5w.js} +1 -1
  141. package/dist/client/assets/{save-actions-DnxE-Bzm.js → save-actions-BYQZP6Sr.js} +1 -1
  142. package/dist/client/assets/{scroll-area-C-RNU2ZC.js → scroll-area-D6nBfX1Y.js} +4 -4
  143. package/dist/client/assets/{select-B9AjxT2Q.js → select-CwR5iwKr.js} +1 -1
  144. package/dist/client/assets/shell-layout-BnW-yUkb.js +3 -0
  145. package/dist/client/assets/{skeleton-BAWgWTH6.js → skeleton-DzMO4E_x.js} +1 -1
  146. package/dist/client/assets/{spinner-C5H8EOvR.js → spinner-B4HBT9r3.js} +1 -1
  147. package/dist/client/assets/{store-invite-BSP87zro.js → store-invite-DR-2VUII.js} +1 -1
  148. package/dist/client/assets/{switch-Bnxx_fFZ.js → switch-DkAfY5Xp.js} +1 -1
  149. package/dist/client/assets/{table-Bt31_DyV.js → table-BDxbk9kk.js} +1 -1
  150. package/dist/client/assets/tasks-JeX1dzU3.js +1 -0
  151. package/dist/client/assets/{textarea-Dfcf9iVI.js → textarea-C7R7dq5L.js} +1 -1
  152. package/dist/client/assets/{time-range-picker-VoxMdMGw.js → time-range-picker-CPtVWgsO.js} +1 -1
  153. package/dist/client/assets/{toggle-group-BYr6H2N2.js → toggle-group-BsC04HU0.js} +1 -1
  154. package/dist/client/assets/tools-list-C1FJexpR.js +1 -0
  155. package/dist/client/assets/{tooltip-Kun6OEqc.js → tooltip-C-TvyUPP.js} +1 -1
  156. package/dist/client/assets/{topbar-portal-BYkDxjeH.js → topbar-portal-BlsIm0Za.js} +1 -1
  157. package/dist/client/assets/types-DWiNuJXJ.js +155 -0
  158. package/dist/client/assets/{use-binding-Bt6opM01.js → use-binding-DtOyQ6H-.js} +1 -1
  159. package/dist/client/assets/{use-connection-CZeLlUDa.js → use-connection-CU1wdNM8.js} +1 -1
  160. package/dist/client/assets/{use-copy-BLt7-cw9.js → use-copy-C-xyAEAK.js} +1 -1
  161. package/dist/client/assets/{use-create-virtual-mcp-BWbRPuCZ.js → use-create-virtual-mcp-CdmTVIKM.js} +1 -1
  162. package/dist/client/assets/use-deco-chat-open-yra_c3Dw.js +1 -0
  163. package/dist/client/assets/{use-install-from-registry-BsUBgwfp.js → use-install-from-registry-Dpg6ludv.js} +1 -1
  164. package/dist/client/assets/{use-list-state-B_n0GZwG.js → use-list-state-DEj8YIwi.js} +1 -1
  165. package/dist/client/assets/{use-llm-CBsUcVLv.js → use-llm-Bjuj_MKF.js} +1 -1
  166. package/dist/client/assets/use-mcp-prompts-C2SxEfwc.js +1 -0
  167. package/dist/client/assets/{use-mcp-tools-BED8kPD7.js → use-mcp-tools-aLeNmzej.js} +1 -1
  168. package/dist/client/assets/{use-mobile-DLzBblnh.js → use-mobile-B6wwiLld.js} +1 -1
  169. package/dist/client/assets/{use-organization-settings-BTKBql6r.js → use-organization-settings-DdF3cHOT.js} +1 -1
  170. package/dist/client/assets/{use-project-Dgs5h9hm.js → use-project-Bmqhspht.js} +1 -1
  171. package/dist/client/assets/{use-settings-modal-CL7KNbwO.js → use-settings-modal-BQGLflyF.js} +1 -1
  172. package/dist/client/assets/{use-view-mode-Cm6MlS0B.js → use-view-mode-D5ZS-ZdB.js} +1 -1
  173. package/dist/client/assets/{use-virtual-mcp-chylq6BL.js → use-virtual-mcp-DqbEku8h.js} +1 -1
  174. package/dist/client/assets/useInfiniteQuery-DgzNofe0.js +1 -0
  175. package/dist/client/assets/{useMutation-CTU78J7M.js → useMutation-D2jNlXyR.js} +1 -1
  176. package/dist/client/assets/useQuery-6KDecjjg.js +1 -0
  177. package/dist/client/assets/useSuspenseInfiniteQuery-B2-Ew4j-.js +1 -0
  178. package/dist/client/assets/workflow-DJP52hJ3.js +1 -0
  179. package/dist/client/index.html +2 -2
  180. package/dist/server/cli.js +5 -5
  181. package/dist/server/migrate.js +2 -2
  182. package/dist/server/server.js +5 -5
  183. package/package.json +2 -1
  184. package/dist/client/assets/agent-detail-CAAcyNFf.js +0 -2
  185. package/dist/client/assets/agents-IxYsoQkx.js +0 -1
  186. package/dist/client/assets/collection-detail-BPjVfY9E.js +0 -26
  187. package/dist/client/assets/collection-search-BhyeAK8D.js +0 -1
  188. package/dist/client/assets/collection-tab-DYRZjIfR.js +0 -1
  189. package/dist/client/assets/collection-table-wrapper-DF0r5l64.js +0 -1
  190. package/dist/client/assets/connection-detail-D4fpJvP6.js +0 -1
  191. package/dist/client/assets/connections-Dd7R3YoP.js +0 -1
  192. package/dist/client/assets/constants-alL-orOw.js +0 -1
  193. package/dist/client/assets/empty-state-CUU2GnRG.js +0 -1
  194. package/dist/client/assets/index-D1eaSCBW.css +0 -1
  195. package/dist/client/assets/index-DFjHyz2s.js +0 -1
  196. package/dist/client/assets/mcp-oauth-DtHeHoWJ.js +0 -1
  197. package/dist/client/assets/mcp-server-detail-Du1aBWwk.js +0 -2
  198. package/dist/client/assets/members-BLWGtvj7.js +0 -3
  199. package/dist/client/assets/page-C-wJ53x_.js +0 -1
  200. package/dist/client/assets/page-Y1SYGnRN.js +0 -1
  201. package/dist/client/assets/projects-list-DngofdiO.js +0 -1
  202. package/dist/client/assets/shell-layout-DY2c6Efx.js +0 -3
  203. package/dist/client/assets/tasks-OIFCJv2K.js +0 -1
  204. package/dist/client/assets/tools-list-CMPsf87L.js +0 -1
  205. package/dist/client/assets/typewriter-title-ir44iZyu.js +0 -16
  206. package/dist/client/assets/use-deco-chat-open-DqF5WsjN.js +0 -1
  207. package/dist/client/assets/use-mcp-prompts-CTAKOvKB.js +0 -1
  208. package/dist/client/assets/useInfiniteQuery-B4zFsz_-.js +0 -1
  209. package/dist/client/assets/useQuery-CL8s1AaN.js +0 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-CnNOZleg.js +0 -1
  211. package/dist/client/assets/view-mode-toggle-lRAyyRMm.js +0 -1
  212. package/dist/client/assets/workflow-CH4Jfjr7.js +0 -1
@@ -1 +1 @@
1
- import{c as d,j as c,ah as n,ai as l}from"./index-CMIePc8v.js";import{i as m}from"./Check-2BTd1528.js";import{c as b}from"./button-DDY6hri1.js";function f(o){const e=d.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(n,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{f as C};
1
+ import{c as d,j as c,ah as n,ai as l}from"./index-CKXRhh0t.js";import{i as m}from"./Check-BXz-Aa3Y.js";import{c as b}from"./button-BjJbLzI1.js";function f(o){const e=d.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(n,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{f as C};
@@ -1 +1 @@
1
- import{r as c}from"./index-CMIePc8v.js";const h=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=y(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const w=c.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:p,...n},d)=>c.createElement("svg",{ref:d,...k,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",s),...!a&&!f(n)&&{"aria-hidden":"true"},...n},[...p.map(([m,C])=>c.createElement(m,C)),...Array.isArray(a)?a:[a]]));const u=(t,e)=>{const r=c.forwardRef(({className:o,...s},a)=>c.createElement(w,{ref:a,iconNode:e,className:l(`lucide-${h(i(t))}`,`lucide-${t}`,o),...s}));return r.displayName=i(t),r};const g=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",g);const x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],L=u("circle-alert",x);export{L as C,b as a,u as c};
1
+ import{r as c}from"./index-CKXRhh0t.js";const h=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=y(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const w=c.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:p,...n},d)=>c.createElement("svg",{ref:d,...k,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",s),...!a&&!f(n)&&{"aria-hidden":"true"},...n},[...p.map(([m,C])=>c.createElement(m,C)),...Array.isArray(a)?a:[a]]));const u=(t,e)=>{const r=c.forwardRef(({className:o,...s},a)=>c.createElement(w,{ref:a,iconNode:e,className:l(`lucide-${h(i(t))}`,`lucide-${t}`,o),...s}));return r.displayName=i(t),r};const g=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",g);const x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],L=u("circle-alert",x);export{L as C,b as a,u as c};
@@ -0,0 +1,26 @@
1
+ import{b4 as re,r as k,o as to,s as Tt,c as N,j as o,bV as Vt,u as Y,l as no,y as so,e as he,a as oo,aE as et,O as tt,t as An,bJ as K,cd as ro,ce as io,aH as lo,a8 as Ut,au as ue,aw as Mn,aI as co,aq as Bt,aG as ao,aJ as Pn,as as Ln,aP as uo,aQ as fo,ax as Dn,aR as mo,cf as qt,cg as po,am as xo,bL as ho,ap as go,m as bo,ch as jo,ci as vo,cj as zn}from"./index-CKXRhh0t.js";import{E as Wn}from"./collection-search-D9lLlfmK.js";import{E as Fn}from"./error-boundary-BOjL_3iE.js";import{d as Kt,u as Jt,f as ut,h as So}from"./use-connection-CU1wdNM8.js";import{u as ie,g as Be,i as yo}from"./constants-Bz_J8k2h.js";import{P as Gt}from"./index-kQL4iCgd.js";import{F as $t,a as wo,b as Xt,d as Zt}from"./form-BcYKMkAo.js";import{I as Qt}from"./input-BPPp7fkV.js";import{T as Dt}from"./textarea-C7R7dq5L.js";import{b as Hn,V as Yt,a as be}from"./layout-B_vm2aCi.js";import{S as Vn}from"./save-actions-BYQZP6Sr.js";import{M as No,N as Co,S as ko,a as Io,c as _o,m as Ze,P as Eo,i as To,R as $o,u as Oo,b as Ro,d as jn,E as Ao,e as Mo}from"./index-BFnklquP.js";import{g as Po,s as Lo,M as vn}from"./types-DWiNuJXJ.js";import{c as M,B as Q}from"./button-BjJbLzI1.js";import{S as Un,a as Bn,b as qn,c as Kn,d as nt}from"./select-CwR5iwKr.js";import{c as en,T as st,a as ot,b as rt}from"./tooltip-C-TvyUPP.js";import{i as Do}from"./AlertCircle-DJ052zqS.js";import{s as zo}from"./Clock-X1ZnQ0e8.js";import{i as Sn}from"./Code01-CVF-mmmz.js";import{a as Wo}from"./Copy01-CFXdI8SF.js";import{i as ft}from"./Loading01-Bm0RmGTq.js";import{i as tn}from"./Play-CGUn4LDu.js";import{B as Jn,a as Gn,b as De,d as it,e as lt,c as Xn}from"./breadcrumb-_jAneXHm.js";import{u as Fo,O as Ho,M as Vo,F as Uo,v as Bo}from"./index-Ds78Hq48.js";import{d as nn,b as sn,a as on}from"./use-mcp-tools-aLeNmzej.js";import{I as mt}from"./integration-icon-CaUI1jG_.js";import{a as qo}from"./tools-list-C1FJexpR.js";import{M as ze,n as Ko,S as Jo,a as Go}from"./scroll-area-D6nBfX1Y.js";import{E as rn}from"./empty-state-BIKMZA4A.js";import{n as Xo}from"./Container-D3N8SS-J.js";import{b as Zn}from"./use-virtual-mcp-DqbEku8h.js";import{b as Zo,a as yn,R as Qo}from"./resizable-TMJNEC5w.js";import{B as xe}from"./badge-CQ9R9pkG.js";import{S as pt}from"./spinner-B4HBT9r3.js";import{V as Yo}from"./collection-table-wrapper-HJznMrYU.js";import{a as er}from"./use-binding-DtOyQ6H-.js";import{b as tr,c as nr,d as sr,e as or,a as rr,D as ir}from"./dialog-CsS26GNP.js";import"./index-DbG6jisP.js";import{s as Qn}from"./Plus-CfD4U7h2.js";import{c as Yn}from"./AlertOctagon-DCNCOxEl.js";import{i as xt}from"./Check-BXz-Aa3Y.js";import{i as lr}from"./DotsHorizontal-BlKZUIAr.js";import{a as cr}from"./Tool01-D4p-h1gd.js";import{s as ln}from"./XClose-CVjVP425.js";import{D as ar,a as dr,b as ur,c as wn}from"./dropdown-menu-Bx6HZEO6.js";import{g as fr,R as mr,h as pr,j as es}from"./use-deco-chat-open-yra_c3Dw.js";import{i as xr}from"./ChevronRight-CQS5xbc3.js";import{i as ts}from"./X-OID4YrAs.js";import{c as hr}from"./context-DPw3JrfP.js";import"./SearchMd-rBeGYVN8.js";import"./AlertTriangle-MQM19F_y.js";import"./useMutation-D2jNlXyR.js";import"./Pin01-BQxfi8aj.js";import"./use-organization-settings-DdF3cHOT.js";import"./label-Ce-8MeXM.js";import"./index-lC9RbQEq.js";import"./use-mobile-B6wwiLld.js";import"./Save01-CVm8Nhi5.js";import"./popover-Dz4mFPzW.js";import"./skeleton-DzMO4E_x.js";import"./localstorage-keys-D7-2hl7K.js";import"./useQuery-6KDecjjg.js";import"./use-mcp-prompts-C2SxEfwc.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-BLFAP4Oh.js";import"./ChevronDown-CEb48ZDu.js";import"./Edit01-vxAH-tv6.js";import"./Users03-DNxW_fja.js";import"./XCircle-LfPUm5IL.js";import"./ArrowLeft-BSPqreiE.js";import"./use-copy-C-xyAEAK.js";import"./use-create-virtual-mcp-CdmTVIKM.js";import"./deco-constants-CGrimklY.js";import"./marked.esm-BaswSlok.js";import"./markdown-CL_nEHz6.js";import"./Eye-Cqy0OQfO.js";import"./Globe02-CL5aTFno.js";import"./RefreshCw01-DsYl6Nso.js";import"./generate-id-Dyweu44Y.js";import"./Trash01-CNjhe6V_.js";import"./index-BqwppNxk.js";import"./mcp-oauth-6gipdrl8.js";import"./File06-p-mGMfLu.js";import"./Key01-BBHw8-AF.js";import"./constants-CQfW12Qo.js";import"./registry-utils-C_nLhlWN.js";import"./extract-connection-data-9qHOXLXC.js";import"./github-icon-Dp3wHhYE.js";import"./use-install-from-registry-Dpg6ludv.js";import"./circle-alert-BwBTOPt2.js";import"./index-nl6bR4T8.js";import"./card-BiNPXwY7.js";import"./ArrowDown-Bn9Nw2BD.js";import"./Grid01-BGPoEeik.js";import"./List-DZq_3WJK.js";import"./table-BDxbk9kk.js";import"./binder-BRFblyKj.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-Bjuj_MKF.js";import"./Image01-B-9nWGvT.js";import"./RefreshCcw01-ClQUpEVA.js";import"./Settings01-BCU61Dg3.js";import"./useSuspenseInfiniteQuery-B2-Ew4j-.js";import"./infiniteQueryObserver-C_YVCa9u.js";const ns=re("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const ss=re("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const cn=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const an=re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const gr=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const br=re("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const jr=re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const os=re("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const rs=re("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const is=re("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const vr=re("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const ls=re("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const cs=re("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),as=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));as.displayName="Box";const ds=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));ds.displayName="ClockFastForward";const us=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));us.displayName="Code02";const Qe=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Qe.displayName="Columns01";const fs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));fs.displayName="CornerDownRight";const ms=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ms.displayName="Database01";const ps=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));ps.displayName="GitBranch01";const xs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));xs.displayName="Repeat03";const hs=({size:t=24,color:e="currentColor",...n})=>k.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},k.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),k.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));hs.displayName="StopCircle";to({title:Tt().min(1),description:Tt().nullable(),body:Tt()});function Ot(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Sr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function yr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx($t,{control:n.control,name:"title",render:Cr}),o.jsx($t,{control:n.control,name:"description",render:Nr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx($t,{control:n.control,name:"body",render:wr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(wo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function wr(t){const{field:e}=t;return o.jsx(Xt,{children:o.jsx(Zt,{children:o.jsx(Dt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Nr(t){const{field:e}=t;return o.jsxs(Xt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Zt,{children:o.jsx(Qt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Cr(t){const{field:e}=t;return o.jsxs(Xt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Zt,{children:o.jsx(Qt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const e=N.c(41),{providerId:n,promptId:s}=t,r=Vt().location.href,{org:l}=Y(),c=n||null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const d=ie(a),u=Kt(n,"PROMPT",s,d),f=Jt(n,"PROMPT",d),m=f.update.isPending;let h;e[3]!==u?(h=u?{title:u.title,description:u.description??null,body:Ot(u)}:void 0,e[3]=u,e[4]=h):h=e[4];let p;e[5]!==h?(p={values:h},e[5]=h,e[6]=p):p=e[6];const x=no(p);let g;e[7]!==x||e[8]!==u?(g=()=>{u&&x.reset({title:u.title,description:u.description??null,body:Ot(u)})},e[7]=x,e[8]=u,e[9]=g):g=e[9];const b=g;let j;e[10]!==f.update||e[11]!==x||e[12]!==s?(j=x.handleSubmit(async I=>{const R=await f.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:R.title,description:R.description??null,body:Ot(R)})}),e[10]=f.update,e[11]=x,e[12]=s,e[13]=j):j=e[13];const S=j;if(!u){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Wn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let y;e[15]!==u.title?(y=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[15]=u.title,e[16]=y):y=e[16];let v;e[17]!==u.description?(v=u.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[17]=u.description,e[18]=v):v=e[18];let w;e[19]!==y||e[20]!==v?(w=o.jsx(Hn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,v]})}),e[19]=y,e[20]=v,e[21]=w):w=e[21];let C;e[22]!==S?(C=()=>{S()},e[22]=S,e[23]=C):C=e[23];let _;e[24]!==x.formState.isDirty||e[25]!==m||e[26]!==b||e[27]!==C?(_=o.jsx(Vn,{onSave:C,onUndo:b,isDirty:x.formState.isDirty,isSaving:m}),e[24]=x.formState.isDirty,e[25]=m,e[26]=b,e[27]=C,e[28]=_):_=e[28];let E;e[29]!==u.title||e[30]!==r?(E=o.jsx(Gt,{title:u.title,url:r,icon:"description"}),e[29]=u.title,e[30]=r,e[31]=E):E=e[31];let $;e[32]!==_||e[33]!==E?($=o.jsxs(Yt,{children:[_,E]}),e[32]=_,e[33]=E,e[34]=$):$=e[34];let T;e[35]!==x?(T=o.jsx("div",{className:"h-full",children:o.jsx(yr,{form:x})}),e[35]=x,e[36]=T):T=e[36];let P;return e[37]!==$||e[38]!==T||e[39]!==w?(P=o.jsxs(be,{children:[w,$,T]}),e[37]=$,e[38]=T,e[39]=w,e[40]=P):P=e[40],P}function Ir(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Sr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Wn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(Fn,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(kr,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const _r=so("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Er(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=M(_r({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Tr(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=M("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function $r(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=M("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Nn=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Or(t){const e=N.c(9),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=Fo(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Ho,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(Vo,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(Rr,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function Rr({toolName:t,connectionId:e}){const s=Vt().location.href,{replayId:i}=oo({strict:!1}),r=(()=>{if(!i)return null;const O=`replay-${i}`,A=sessionStorage.getItem(O);if(!A)return null;sessionStorage.removeItem(O);try{return JSON.parse(A)}catch{return null}})(),l=(()=>{if(!r)return null;const O={};for(const[A,L]of Object.entries(r))L!==null&&typeof L=="object"?O[A]=JSON.stringify(L,null,2):O[A]=L;return O})(),[c,a]=k.useState(l??{}),[d,u]=k.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=k.useState(null),[h,p]=k.useState(null),[x,g]=k.useState(null),[b,j]=k.useState(null),[S,y]=k.useState(!1),[v,w]=k.useState(null),{org:C}=Y(),_=ut(e),E=ie({connectionId:e,orgId:C.id}),$=nn({client:E}),T=$.data?.tools?.find(O=>O.name===t),P=Po(T?._meta),[I,R]=k.useState("json"),[V,W]=k.useState(!1);P&&!V&&(R("ui"),W(!0));const X=T?.inputSchema?.properties,U=X?Object.keys(X):[],D=U.length>0,q={};if(D&&T?.inputSchema?.properties)for(const O of U)q[O]=T.inputSchema.required?.includes(O)?"":void 0;const se=O=>Object.prototype.hasOwnProperty.call(c,O),te=async()=>{y(!0),j(null),m(null),p(null),g(null),w(null);const O=performance.now();try{if(!E)throw new Error("MCP client is not available");const A=D?{...q,...c}:(()=>{const ae=d.trim();if(!ae)return{};const me=JSON.parse(ae);if(me&&typeof me=="object")return me;throw new Error("Raw JSON input must be an object.")})();D&&T?.inputSchema?.properties&&Object.entries(T.inputSchema.properties).forEach(([ae,me])=>{if((me.type==="object"||me.type==="array")&&typeof A[ae]=="string")try{A[ae]=JSON.parse(A[ae])}catch{}});const L=await E.callTool({name:t,arguments:A}),Z=L.structuredContent??L,le=performance.now(),oe=Math.round(le-O);m(Z),p(L),g(A);const ce=JSON.stringify(Z),H=new TextEncoder().encode(ce).length;w({duration:`${oe}ms`,bytes:`${H} bytes`,tokens:`~${Math.ceil(H/4)} tokens`,cost:"$0.0000"})}catch(A){const L=A instanceof Error?A.message:String(A);j(L||"Unknown error occurred");const Z=performance.now();w({duration:`${Math.round(Z-O)}ms`})}finally{y(!1)}},F=(O,A)=>{a(L=>({...L,[O]:A}))},J=()=>{m(null),p(null),g(null),j(null),w(null)},G=T?.name??Nn(t),ee=o.jsx(Jn,{children:o.jsxs(Gn,{children:[o.jsx(De,{children:o.jsx(it,{asChild:!0,children:o.jsx(et,{to:"/$org/$project/mcps",params:{org:C.slug,project:tt},children:"Connections"})})}),o.jsx(lt,{}),_&&o.jsxs(o.Fragment,{children:[o.jsx(De,{children:o.jsx(it,{asChild:!0,children:o.jsx(et,{to:"/$org/$project/mcps/$connectionId",params:{org:C.slug,project:tt,connectionId:e},search:{tab:"tools"},children:_.title})})}),o.jsx(lt,{})]}),o.jsx(De,{children:o.jsx(Xn,{children:G})})]})});return o.jsxs(be,{breadcrumb:ee,children:[o.jsx(Yt,{children:o.jsx(Gt,{title:T?.name??Nn(t),url:s,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(mt,{icon:_?.icon||null,name:_?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[$.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):$.isLoading?o.jsx(ft,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:$.isSuccess?"ready":$.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:T?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),T?.inputSchema?.required&&T.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:D&&T?.inputSchema?.properties?Object.entries(T.inputSchema.properties).map(([O,A])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[O,T.inputSchema?.required?.includes(O)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:A.type})]}),A.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:A.description}),A.type==="object"||A.type==="array"?o.jsx(Dt,{className:"font-mono text-xs",value:se(O)?c[O]??"":q[O]??"",onChange:L=>F(O,L.target.value),placeholder:`Enter ${O} as JSON...`,rows:3}):A.type==="boolean"?o.jsxs(Un,{value:se(O)?String(c[O]??""):"",onValueChange:L=>F(O,L==="true"),children:[o.jsx(Bn,{children:o.jsx(qn,{placeholder:"Select true or false..."})}),o.jsxs(Kn,{children:[o.jsx(nt,{value:"true",children:"true"}),o.jsx(nt,{value:"false",children:"false"})]})]}):o.jsx(Qt,{value:se(O)?c[O]??"":q[O]??"",onChange:L=>F(O,L.target.value),placeholder:`Enter ${O}...`})]},O)):T?.inputSchema&&!D?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Dt,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:O=>u(O.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsx(qo,{annotations:T?.annotations,_meta:T?._meta})]}),v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(zo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(as,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ms,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),o.jsxs("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:S?o.jsxs(Q,{size:"sm",variant:"destructive",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:J,children:[o.jsx(hs,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(Q,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:te,children:[o.jsx(tn,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),P&&o.jsx(en,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(st,{children:[o.jsx(ot,{asChild:!0,children:o.jsx(Q,{size:"icon",variant:I==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>R("ui"),children:o.jsx(Lo,{size:14})})}),o.jsx(rt,{children:"Interactive view"})]}),o.jsxs(st,{children:[o.jsx(ot,{asChild:!0,children:o.jsx(Q,{size:"icon",variant:I==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>R("json"),children:o.jsx(Sn,{size:14})})}),o.jsx(rt,{children:"JSON view"})]})]})})]}),b&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Er,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Do,{className:"h-4 w-4"}),o.jsx(Tr,{className:"mb-0",children:"Execution Failed"})]}),o.jsx($r,{className:"text-xs text-destructive",children:b})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:P&&I==="ui"&&E?o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(No,{resourceURI:P,toolName:t,toolInput:x??void 0,toolResult:h??void 0,displayMode:"fullscreen",minHeight:vn.view.minHeight,maxHeight:vn.view.maxHeight,client:E,className:"h-full"})}):f?o.jsxs(o.Fragment,{children:[o.jsx(ze,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(Q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),An.success("Copied to clipboard")},children:o.jsx(Wo,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Sn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Ar(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=he(i).connectionId;if(!ut(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ft,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(k.Suspense,{fallback:a,children:o.jsx(Or,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const Cn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(h=>h(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},dn=(t=>t?Cn(t):Cn),Mr=t=>t;function zt(t,e=Mr){const n=K.useSyncExternalStore(t.subscribe,K.useCallback(()=>e(t.getState()),[t,e]),K.useCallback(()=>e(t.getInitialState()),[t,e]));return K.useDebugValue(n),n}const Pr=t=>{const e=dn(t),n=s=>zt(e,s);return Object.assign(n,e),n},Lr=(t=>Pr);function gs(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Wt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Wt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Wt(s)(n)}}}},Dr=(t,e)=>(n,s,i)=>{let r={storage:gs(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const h=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>h;let p;const x=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:h)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:h))||void 0;return Wt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:h),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>x(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||x(),p||h},bs=Dr,{useSyncExternalStoreWithSelector:zr}=ro,Wr=t=>t;function Fr(t,e=Wr,n){const s=zr(t.subscribe,t.getState,t.getInitialState,e,n);return K.useDebugValue(s),s}const kn=t=>Symbol.iterator in t,In=t=>"entries"in t,_n=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Hr=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Vr(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:kn(t)&&kn(e)?In(t)&&In(e)?_n(t,e):Hr(t,e):_n({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ur(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
+ ${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
3
+ `:""} ${d}${f}: ${n(u)};`}).join(`
4
+ `)}
5
+ }`}return`interface ${e} ${n(t)}`}function Rt(t,e){const n=t.trim();return e.some(i=>i.name.toLowerCase()===n.toLowerCase())?`${n}_${Math.random().toString(36).substring(2,6)}`:n}function Br(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
6
+
7
+ ${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function At(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...io,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const js=k.createContext(null),qr=t=>dn()(bs(e=>({...t,actions:{setIsAddingStep:n=>e(s=>({...s,isAddingStep:n})),setCurrentStepTab:n=>e(s=>({...s,currentStepTab:n})),setToolAction:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.map(i=>"toolName"in i.action&&i.action.toolName===n.toolName?{...i,action:n}:i)}})),appendStep:({step:n,type:s})=>e(i=>{const r=n??At(s,i.workflow.steps.length),l=i.workflow.steps.find(a=>a.name===r.name),c=l?`${r.name} ${parseInt(l.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:r.name;return{workflow:{...i.workflow,steps:[...i.workflow.steps,{...r,name:c}]}}}),deleteStep:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.filter(i=>i.name!==n)}})),duplicateStep:n=>e(s=>{const i=s.workflow.steps.findIndex(a=>a.name===n);if(i===-1)return s;const r=s.workflow.steps[i];if(!r)return s;const l={...r,name:Rt(r.name,s.workflow.steps)},c=[...s.workflow.steps];return c.splice(i+1,0,l),{workflow:{...s.workflow,steps:c},currentStepName:l.name}}),setCurrentStepName:n=>e(s=>({...s,currentStepName:n})),updateStep:(n,s)=>e(i=>({...i,workflow:{...i.workflow,steps:i.workflow.steps.map(r=>r.name===n?{...r,...s}:r)}})),setTrackingExecutionId:n=>e(s=>({...s,trackingExecutionId:n})),resetToOriginalWorkflow:()=>e(n=>({...n,workflow:n.originalWorkflow})),startAddingStep:n=>e(s=>({...s,isAddingStep:!0,addingStepType:n})),cancelAddingStep:()=>e(n=>({...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:n=>e(s=>{const i=s.selectedParentSteps.includes(n);return{...s,selectedParentSteps:i?s.selectedParentSteps.filter(r=>r!==n):[...s.selectedParentSteps,n]}}),confirmAddCodeStep:()=>e(n=>{const{selectedParentSteps:s,addingStepType:i,workflow:r}=n;if(i!=="code"||s.length===0)return n;const l={};for(const f of s)l[f]=`@${f}`;const c={};for(const f of s){const m=r.steps.find(h=>h.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=At("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Ur(a,"Input"),m=d.action,h=Br(m.code,f);d={...d,action:{...m,code:h}}}const u=Rt(d.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...d,name:u}]},currentStepName:u}}),addToolStep:()=>e(n=>{let s=At("tool",Number((Math.random()*1e6).toFixed(0)));const i=Rt(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),setWorkflow:n=>e(s=>({...s,workflow:n})),startReplacingTool:n=>e(s=>({...s,replacingToolInfo:{toolName:n}})),cancelReplacingTool:()=>e(n=>({...n,replacingToolInfo:null})),setSelectedVirtualMcpId:n=>e(s=>({...s,selectedVirtualMcpId:n}))}}),{name:`workflow-store-${encodeURIComponent(t.workflow.id)}`,storage:gs(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function Kr(t){const e=N.c(11),{children:n,initialState:s}=t,i=Zn(),{org:r}=Y();let l;e[0]!==r||e[1]!==i?.[0]?.id?(l=i?.[0]?.id??Be(r.id),e[0]=r,e[1]=i?.[0]?.id,e[2]=l):l=e[2];const c=l;let a;e[3]!==c||e[4]!==s.currentStepTab||e[5]!==s.trackingExecutionId||e[6]!==s.workflow?(a=()=>qr({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:c,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[3]=c,e[4]=s.currentStepTab,e[5]=s.trackingExecutionId,e[6]=s.workflow,e[7]=a):a=e[7];const[d]=k.useState(a);let u;return e[8]!==n||e[9]!==d?(u=o.jsx(js.Provider,{value:d,children:n}),e[8]=n,e[9]=d,e[10]=u):u=e[10],u}function qe(t,e){const n=k.useContext(js);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Fr(n,t,Vr)}function We(){return qe(Jr)}function Jr(t){return t.workflow}function ne(){return qe(Gr)}function Gr(t){return t.actions}function vs(){const t=Je();return qe(Xr)??t[0]?.name}function Xr(t){return t.currentStepName}function Ke(){const t=N.c(5),e=vs(),n=Je();let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==e?(r=l=>l.name===e,t[3]=e,t[4]=r):r=t[4],s=n.find(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];const i=s;return i||n[0]}function Je(){return We().steps}function Ft(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Ft(t[n],e[n]))return!1;return!0}if(typeof t=="object"){const n=t,s=e,i=Object.keys(n),r=Object.keys(s);if(i.length!==r.length)return!1;for(const l of i)if(!(l in s)||!Ft(n[l],s[l]))return!1;return!0}return!1}function Ss(){const t=N.c(5),e=We();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=Gs(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=Ft(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function B(){return qe(Zr)}function Zr(t){return t.trackingExecutionId}function Ge(){return qe(Qr)}function Qr(t){return t.selectedVirtualMcpId}function Yr(t){const e=N.c(23),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=Zn()??[],{org:a}=Y();let d;e[0]!==a.id?(d=Be(a.id),e[0]=a.id,e[1]=d):d=e[1];const u=d,f=c.filter(ti),m=Un,h=n??u;let p;e[2]!==s?(p=C=>s(C===""?void 0:C),e[2]=s,e[3]=p):p=e[3];let x;e[4]!==i?(x=M("text-xs",i),e[4]=i,e[5]=x):x=e[5];let g;e[6]!==l?(g=o.jsx(qn,{placeholder:l}),e[6]=l,e[7]=g):g=e[7];let b;e[8]!==x||e[9]!==g?(b=o.jsx(Bn,{size:"sm",className:x,children:g}),e[8]=x,e[9]=g,e[10]=b):b=e[10];const j=Kn;let S;e[11]!==u?(S=o.jsx(nt,{value:u,children:"All tools (Decopilot)"}),e[11]=u,e[12]=S):S=e[12];const y=f.map(ei);let v;e[13]!==j||e[14]!==S||e[15]!==y?(v=o.jsxs(j,{children:[S,y]}),e[13]=j,e[14]=S,e[15]=y,e[16]=v):v=e[16];let w;return e[17]!==m||e[18]!==v||e[19]!==h||e[20]!==p||e[21]!==b?(w=o.jsxs(m,{value:h,onValueChange:p,children:[b,v]}),e[17]=m,e[18]=v,e[19]=h,e[20]=p,e[21]=b,e[22]=w):w=e[22],w}function ei(t){return o.jsx(nt,{value:t.id,children:t.title},t.id)}function ti(t){return t.id!==null&&!yo(t.id)}function Fe(){const t=N.c(2),e=So();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=er(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}function pe(t){const e=N.c(12),{org:n}=Y(),s=Fe();let i;e[0]!==s.id||e[1]!==n.id?(i={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=i):i=e[2];const r=ie(i);let l;e[3]!==t?(l={id:t},e[3]=t,e[4]=l):l=e[4];const c=!!t;let a;e[5]!==r||e[6]!==l||e[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:l,enabled:c,select:ni},e[5]=r,e[6]=l,e[7]=c,e[8]=a):a=e[8];const{data:d,isLoading:u}=sn(a),f=d?.item;let m;return e[9]!==u||e[10]!==f?(m={item:f,isLoading:u},e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function ni(t){return t.structuredContent??t}function ys(t,e,n){const s=N.c(14),{org:i}=Y(),r=Fe();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ie(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];let u;s[6]!==c||s[7]!==a||s[8]!==d?(u={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,select:si},s[6]=c,s[7]=a,s[8]=d,s[9]=u):u=s[9];const{data:f,isLoading:m}=sn(u),h=f?.output,p=f?.error;let x;return s[10]!==m||s[11]!==h||s[12]!==p?(x={output:h,error:p,isLoading:m},s[10]=m,s[11]=h,s[12]=p,s[13]=x):x=s[13],x}function si(t){return t.structuredContent??t}function oi(){const t=N.c(19),{org:e}=Y(),n=Fe(),s=We();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ie(i);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=["workflow"],t[3]=l):l=t[3];let c;t[4]!==s.id?(c={field:l,operator:"eq",value:s.id},t[4]=s.id,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=[{field:["created_at"],direction:"desc"}],t[6]=a):a=t[6];let d;t[7]!==c?(d={where:c,orderBy:a,limit:100},t[7]=c,t[8]=d):d=t[8];const u=!!s.id;let f;t[9]!==r||t[10]!==d||t[11]!==u?(f={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:d,enabled:u,staleTime:5e3,select:ri},t[9]=r,t[10]=d,t[11]=u,t[12]=f):f=t[12];const{data:m,isLoading:h,refetch:p}=sn(f);let x;t[13]!==m?.items?(x=m?.items??[],t[13]=m?.items,t[14]=x):x=t[14];let g;return t[15]!==h||t[16]!==p||t[17]!==x?(g={executions:x,isLoading:h,refetch:p},t[15]=h,t[16]=p,t[17]=x,t[18]=g):g=t[18],g}function ri(t){return t.structuredContent??t}function ws(t){const e=[];function n(s){if(typeof s=="string"){const i=s.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(i)for(const r of i)if(r==="@input")e.push("__entire_input__");else{const l=r.replace("@input.","");e.push(l)}}else Array.isArray(s)?s.forEach(n):typeof s=="object"&&s!==null&&Object.values(s).forEach(n)}return n(t),[...new Set(e)]}function ii(t){const e=[];for(const n of t){const s=ws(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function li(t){for(const e of t)if(ws(e.input).includes("__entire_input__"))return!0;return!1}function ci(t){const e=ii(t);if(e.length===0)return li(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function ai(){const t=N.c(2),e=We();let n;return t[0]!==e.steps?(n=ci(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function di(){const t=N.c(16),{org:e}=Y(),{id:n}=Fe(),{setTrackingExecutionId:s}=ne(),i=We(),r=Ge(),l=ai();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ie(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=on(d);let m;t[5]!==e.id||t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==i?(m=async g=>{const b=g===void 0?{}:g,j=r??Be(e.id),S=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:j,start_at_epoch_ms:S,workflow_collection_id:i.id}}),w=(y.structuredContent??y)?.item?.id??void 0;return s(w),w},t[5]=e.id,t[6]=r,t[7]=s,t[8]=u,t[9]=i,t[10]=m):m=t[10];const h=m,p=l!==null;let x;return t[11]!==h||t[12]!==l||t[13]!==f||t[14]!==p?(x={handleRunWorkflow:h,isPending:f,requiresInput:p,inputSchema:l},t[11]=h,t[12]=l,t[13]=f,t[14]=p,t[15]=x):x=t[15],x}function ui(){const t=N.c(10),{org:e}=Y(),{id:n}=Fe();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=on(r);let a;t[5]!==l?(a=async f=>await l({name:"CANCEL_EXECUTION",arguments:{executionId:f}}),t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleCancelWorkflow:d,isCancelling:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function fi(){const t=N.c(10),{org:e}=Y(),{id:n}=Fe();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ie(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=on(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.success??!1},t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleResumeWorkflow:d,isResuming:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function mi(){const t=N.c(3),e=B(),{item:n}=pe(e);let s;return t[0]!==n||t[1]!==e?(s=e&&n?(()=>{const r={};return n?.input&&(r.input=n.input),r})():void 0,t[0]=n,t[1]=e,t[2]=s):s=t[2],s}function pi(t,e,n,s){if(!e)return[...t].sort(s);const i=n(e);return[...t].sort((r,l)=>{const c=n(r),a=n(l);return c===i?-1:a===i?1:s?s(r,l):0})}const un=Lr()(bs(t=>({viewMode:"visual",setViewMode:e=>t({viewMode:e}),showExecutionsList:!1,setShowExecutionsList:e=>t({showExecutionsList:e}),toggleExecutionsList:()=>t(e=>({showExecutionsList:!e.showExecutionsList}))}),{name:"workflow-view-mode"})),Ns=k.createContext([]);function Cs(){return k.useContext(Ns)}function xi({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Eo;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,d,u;const f=r.view.state.selection.$to.nodeAfter;(a=f?.text)!=null&&a.startsWith(" ")&&(l.to+=1),r.chain().focus().insertContentAt(l,[{type:n,attrs:{...c,mentionSuggestionChar:s}},{type:"text",text:" "}]).run(),(u=(d=r.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:r,range:l})=>{const c=r.doc.resolve(l.from),a=r.schema.nodes[n];return!!c.parent.type.contentMatch.matchType(a)},...e}}function ks(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>xi({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function En(t,e){const n=ks(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var hi=Co.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,s;return`${(n=e?.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var s,i;return["span",Ze(this.HTMLAttributes,t.HTMLAttributes),`${(s=n?.char)!=null?s:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=En(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Ze({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Ze({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Ze({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},..._o({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;s!==null;){const[,i,r,l]=s,c=r??l;e[i==="char"?"mentionSuggestionChar":i]=c,s=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:En(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:s}=e,{empty:i,anchor:r}=s;if(!i)return!1;let l=new Io,c=0;return e.doc.nodesBetween(r-1,r,(a,d)=>{if(a.type.name===this.name)return n=!0,l=a,c=d,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return ks(this).map(ko)}}),gi=hi,Mt,ht="HoverCard",[Is]=Dn(ht,[Pn]),gt=Pn(),[bi,bt]=Is(ht),_s=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=gt(e),d=k.useRef(0),u=k.useRef(0),f=k.useRef(!1),m=k.useRef(!1),[h,p]=Bt({prop:s,defaultProp:i??!1,onChange:r,caller:ht}),x=k.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=k.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=k.useCallback(()=>p(!1),[p]);return k.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(bi,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(ao,{...a,children:n})})};_s.displayName=ht;var Es="HoverCardTrigger",Ts=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=bt(Es,n),r=gt(n);return o.jsx(lo,{asChild:!0,...r,children:o.jsx(Ut.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:ue(t.onPointerEnter,at(i.onOpen)),onPointerLeave:ue(t.onPointerLeave,at(i.onClose)),onFocus:ue(t.onFocus,i.onOpen),onBlur:ue(t.onBlur,i.onClose),onTouchStart:ue(t.onTouchStart,l=>l.preventDefault())})})});Ts.displayName=Es;var fn="HoverCardPortal",[ji,vi]=Is(fn,{forceMount:void 0}),$s=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=bt(fn,e);return o.jsx(ji,{scope:e,forceMount:n,children:o.jsx(Mn,{present:n||r.open,children:o.jsx(co,{asChild:!0,container:i,children:s})})})};$s.displayName=fn;var ct="HoverCardContent",Os=k.forwardRef((t,e)=>{const n=vi(ct,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=bt(ct,t.__scopeHoverCard);return o.jsx(Mn,{present:s||r.open,children:o.jsx(Si,{"data-state":r.open?"open":"closed",...i,onPointerEnter:ue(t.onPointerEnter,at(r.onOpen)),onPointerLeave:ue(t.onPointerLeave,at(r.onClose)),ref:e})})});Os.displayName=ct;var Si=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=bt(ct,n),d=gt(n),u=k.useRef(null),f=Ln(e,u),[m,h]=k.useState(!1);return k.useEffect(()=>{if(m){const p=document.body;return Mt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Mt,p.style.webkitUserSelect=Mt}}},[m]),k.useEffect(()=>{if(u.current){const p=()=>{h(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),k.useEffect(()=>{u.current&&Ni(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),o.jsx(uo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ue(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(fo,{...d,...c,onPointerDown:ue(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),yi="HoverCardArrow",wi=k.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=gt(n);return o.jsx(mo,{...i,...s,ref:e})});wi.displayName=yi;function at(t){return e=>e.pointerType==="touch"?void 0:t()}function Ni(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Ci=_s,ki=Ts,Ii=$s,_i=Os;function Ei(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Ci,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function Ti(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(ki,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function $i(t){const e=N.c(12);let n,s,i,r;e[0]!==t?({className:n,align:i,sideOffset:r,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=r):(n=e[1],s=e[2],i=e[3],r=e[4]);const l=i===void 0?"center":i,c=r===void 0?4:r;let a;e[5]!==n?(a=M("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(d=o.jsx(Ii,{"data-slot":"hover-card-portal",children:o.jsx(_i,{"data-slot":"hover-card-content",align:l,sideOffset:c,className:a,...s})}),e[7]=l,e[8]=s,e[9]=c,e[10]=a,e[11]=d):d=e[11],d}const Rs=k.createContext(void 0);function Oi(t,e){const n=e.split("."),s=n[0];if(!s)return;let i=t[s];for(let r=1;r<n.length&&i!==void 0;r++){const l=n[r];if(l)if(typeof i=="object"&&i!==null)i=i[l];else return}return i}function Ri(t){const e=N.c(20),{node:n}=t,s=k.useContext(Rs),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const x=r?Oi(s,i):void 0;l=x!==void 0?typeof x=="object"?JSON.stringify(x,null,2):String(x):void 0,e[0]=r,e[1]=i,e[2]=s,e[3]=l}else l=e[3];const c=l;let a;e[4]!==i?(a=o.jsxs("span",{className:"bg-primary/20 text-primary px-1 rounded font-medium cursor-pointer",children:["@",i]}),e[4]=i,e[5]=a):a=e[5];const d=a;if(!r||c===void 0){let x;return e[6]!==d?(x=o.jsx(jn,{as:"span",children:d}),e[6]=d,e[7]=x):x=e[7],x}let u;e[8]!==d?(u=o.jsx(Ti,{asChild:!0,children:d}),e[8]=d,e[9]=u):u=e[9];let f;e[10]!==i?(f=o.jsxs("div",{className:"text-xs font-medium text-muted-foreground",children:["@",i]}),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==c?(m=o.jsx("pre",{className:"text-xs font-mono bg-muted/50 p-2 rounded overflow-auto max-h-[200px] whitespace-pre-wrap break-all",children:c}),e[12]=c,e[13]=m):m=e[13];let h;e[14]!==f||e[15]!==m?(h=o.jsx($i,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=h):h=e[16];let p;return e[17]!==u||e[18]!==h?(p=o.jsx(jn,{as:"span",children:o.jsxs(Ei,{openDelay:200,children:[u,h]})}),e[17]=u,e[18]=h,e[19]=p):p=e[19],p}function As(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let fe=Ms();function Ms(){return dn(()=>({items:[],selectedIndex:0,command:null}))}function Tn(t,e){fe.setState({items:t,command:e,selectedIndex:0})}function Ai(){const{items:t,selectedIndex:e}=fe.getState();t.length&&fe.setState({selectedIndex:(e-1+t.length)%t.length})}function Mi(){const{items:t,selectedIndex:e}=fe.getState();t.length&&fe.setState({selectedIndex:(e+1)%t.length})}function Ps(){const{items:t,selectedIndex:e,command:n}=fe.getState(),s=t[e];return s?(n?.(s),!0):!1}function $n(){fe=Ms()}function Pi(){const t=N.c(7),e=zt(fe,Di),n=zt(fe,Li);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{fe.setState({selectedIndex:c}),Ps()},className:M("flex items-center w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",c===n?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l.label},l.id),t[3]=n,t[4]=r):r=t[4],s=e.map(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];let i;return t[5]!==s?(i=o.jsx("div",{className:"bg-popover border border-border rounded-lg shadow-lg overflow-hidden min-w-[180px]",children:o.jsx("div",{className:"p-1",children:s})}),t[5]=s,t[6]=i):i=t[6],i}function Li(t){return t.selectedIndex}function Di(t){return t.items}function zi(){let t=null,e=null;return{onStart:n=>{Tn(n.items,n.command),t=new Ro(Pi,{editor:n.editor}),e=document.createElement("div"),e.style.cssText="position:absolute;z-index:9999";const s=n.clientRect?.();s&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`),e.appendChild(t.element),document.body.appendChild(e)},onUpdate:n=>{Tn(n.items,n.command);const s=n.clientRect?.();s&&e&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`)},onKeyDown:({event:n})=>n.key==="Escape"?(e?.remove(),t?.destroy(),$n(),!0):n.key==="ArrowUp"?(Ai(),!0):n.key==="ArrowDown"?(Mi(),!0):n.key==="Enter"?Ps():!1,onExit:()=>{e?.remove(),t?.destroy(),$n()}}}const Pt=/@([\w.]+)/g;function Wi(t,e){if(!t)return null;const n=As(e),s=new Map(n.map(a=>[a.id,a]));if(!Pt.test(t))return t;Pt.lastIndex=0;const r=[];let l=0,c;for(;(c=Pt.exec(t))!==null;){const a=c[1]??"",d=c.index;d>l&&r.push({type:"text",text:t.slice(l,d)});const u=s.get(a);u?r.push({type:"mention",attrs:{id:u.id,label:u.label}}):r.push({type:"text",text:c[0]}),l=d+c[0].length}return l<t.length&&r.push({type:"text",text:t.slice(l)}),{type:"doc",content:[{type:"paragraph",content:r.length>0?r:void 0}]}}function mn(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=mi();let d;e[0]!==n||e[1]!==s?(d=Wi(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=To.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=h):h=e[3];let p;if(e[4]!==n||e[5]!==f){let E;e[7]!==n?(E=$=>{const{query:T}=$;return As(n).filter(I=>I.label.toLowerCase().includes(T.toLowerCase())||I.id.toLowerCase().includes(T.toLowerCase()))},e[7]=n,e[8]=E):E=e[8],p=gi.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Ui,renderHTML:Vi,suggestion:{items:E,render:zi,command:Hi}}).extend(f?{addNodeView(){return $o(Ri)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let x;e[9]!==p?(x=[h,p],e[9]=p,e[10]=x):x=e[10];const g=r??"";let b;e[11]!==g?(b={attributes:{class:"prose prose-sm max-w-none focus:outline-none w-full min-h-[20px]","data-placeholder":g},handleKeyDown:Fi},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=E=>{const{editor:$}=E;return i?.($.getText().trim())},e[13]=i,e[14]=j):j=e[14];let S;e[15]!==u||e[16]!==m||e[17]!==x||e[18]!==b||e[19]!==j?(S={content:u,editable:m,extensions:x,editorProps:b,onUpdate:j},e[15]=u,e[16]=m,e[17]=x,e[18]=b,e[19]=j,e[20]=S):S=e[20];const y=Oo(S);let v;e[21]!==l?(v=M("rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l),e[21]=l,e[22]=v):v=e[22];let w;e[23]!==y?(w=o.jsx(Ao,{editor:y}),e[23]=y,e[24]=w):w=e[24];let C;e[25]!==v||e[26]!==w?(C=o.jsx("div",{className:v,children:w}),e[25]=v,e[26]=w,e[27]=C):C=e[27];const _=C;if(a!==void 0){let E;return e[28]!==_||e[29]!==a?(E=o.jsx(Rs.Provider,{value:a,children:_}),e[28]=_,e[29]=a,e[30]=E):E=e[30],E}return _}function Fi(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Hi(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function Vi(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Ui(t){const{node:e}=t;return`@${e.attrs.id}`}function Bi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Cs(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(mn,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function qi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Cs(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(mn,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Ki(t){const e=N.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=u=>s(u.target.value===""?void 0:Number(u.target.value)),e[0]=s,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=M("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),e[2]=a):a=e[2];let d;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(d=o.jsx("input",{id:r,type:"number",value:l,onChange:c,disabled:i,className:a}),e[3]=r,e[4]=i,e[5]=l,e[6]=c,e[7]=d):d=e[7],d}function Ji(t){const e=N.c(13),{value:n,onChange:s,readonly:i,id:r,label:l}=t,c=n??!1;let a;e[0]!==s?(a=m=>s(m.target.checked),e[0]=s,e[1]=a):a=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(d=o.jsx("input",{id:r,type:"checkbox",checked:c,onChange:a,disabled:i,className:"h-4 w-4 rounded border-input"}),e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=d):d=e[6];let u;e[7]!==l?(u=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==d||e[11]!==u?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[d,u]}),e[9]=r,e[10]=d,e[11]=u,e[12]=f):f=e[12],f}function Gi(t){const e=N.c(14),{value:n,onChange:s,readonly:i,id:r,options:l}=t;let c;e[0]!==l.enumOptions?(c=l.enumOptions??[],e[0]=l.enumOptions,e[1]=c):c=e[1];const a=c,d=n??"";let u;e[2]!==s?(u=x=>s(x.target.value),e[2]=s,e[3]=u):u=e[3];let f,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=M("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let h;e[6]!==a?(h=a.map(Xi),e[6]=a,e[7]=h):h=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==h?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,h]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=h,e[13]=p):p=e[13],p}function Xi(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Zi={TextWidget:Bi,TextareaWidget:qi,NumberWidget:Ki,CheckboxWidget:Ji,SelectWidget:Gi};function Qi(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:cs,color:"text-blue-500"};case"number":case"integer":return{Icon:is,color:"text-blue-500"};case"array":return{Icon:ss,color:"text-purple-500"};case"object":return{Icon:ns,color:"text-orange-500"};case"boolean":return{Icon:ls,color:"text-pink-500"};case"null":return{Icon:qt,color:"text-gray-500"};default:return{Icon:os,color:"text-muted-foreground"}}}function Yi(t){const e=N.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let v;return e[0]!==l?(v=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=v):v=e[1],v}if(n==="root"){let v;return e[2]!==l?(v=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=v):v=e[3],v}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,m,h,p,x,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:v,color:w}=Qi(d);g="space-y-2",h="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=e[17],e[18]!==i?(x=i&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"}),e[18]=i,e[19]=x):x=e[19],u=v,f=14,m=M(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=h,e[12]=p,e[13]=x,e[14]=g}else u=e[8],f=e[9],m=e[10],h=e[11],p=e[12],x=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let j;e[24]!==h||e[25]!==p||e[26]!==x||e[27]!==b?(j=o.jsxs("div",{className:h,children:[p,x,b]}),e[24]=h,e[25]=p,e[26]=x,e[27]=b,e[28]=j):j=e[28];let S;e[29]!==r?(S=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=S):S=e[30];let y;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==S?(y=o.jsxs("div",{className:g,children:[j,S,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=S,e[35]=y):y=e[35],y}function el(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(nl),e[0]=n,e[1]=c):c=e[1];let a;return e[2]!==c?(a=o.jsx("div",{className:"space-y-4",children:c}),e[2]=c,e[3]=a):a=e[3],a}let r;e[4]!==n?(r=n.map(tl),e[4]=n,e[5]=r):r=e[5];let l;return e[6]!==r?(l=o.jsx("div",{className:"pl-4 border-l-2 border-border/50 space-y-4",children:r}),e[6]=r,e[7]=l):l=e[7],l}function tl(t){return o.jsx("div",{children:t.content},t.name)}function nl(t){return o.jsx("div",{children:t.content},t.name)}function sl(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(ol),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==l?(c=o.jsx("div",{className:"space-y-2",children:l}),e[2]=l,e[3]=c):c=e[3];let a;e[4]!==s||e[5]!==i||e[6]!==r?(a=s&&o.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:i,children:["+ Add ",r||"item"]}),e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==c||e[9]!==a?(d=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function ol(t){return o.jsx("div",{className:"flex gap-2 items-start",children:o.jsx("div",{className:"flex-1",children:t})},t.key||t.index)}function rl(){return null}function il(){return null}const ll={FieldTemplate:Yi,ObjectFieldTemplate:el,ArrayFieldTemplate:sl,UnsupportedFieldTemplate:rl,ErrorListTemplate:il};function cl(t){const e=N.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,d,u)=>{const f=typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d??""),m=Array.isArray(u.type)?u.type.join(" | "):u.type??"string";return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),o.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:m})]}),u.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:u.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(mn,{mentions:i,value:f,readOnly:!0,className:"border-0 bg-transparent p-0"})})]},a)},e[0]=i,e[1]=r):r=e[1];const l=r;let c;return e[2]!==s||e[3]!==n.properties||e[4]!==l?(c=o.jsx("div",{className:"space-y-4",children:Object.entries(n.properties).map(a=>{const[d,u]=a,f=s[d];return l(d,f,u)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function Ls({inputSchema:t,inputParams:e,setInputParams:n,handleInputChange:s,mentions:i,readOnly:r}){const l=i??[];if(!t)return o.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."});if(r)return o.jsx(cl,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=k.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[h,p]of Object.entries(f))m[h]!==p&&s(h,p);for(const h of Object.keys(m))h in f||s(h,void 0)}a.current=f};return o.jsx(Ns.Provider,{value:l,children:o.jsx(Uo,{schema:c,formData:e,onChange:d,validator:Bo,widgets:Zi,templates:ll,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function al(t){const e=N.c(33),{open:n,onOpenChange:s,inputSchema:i,onSubmit:r,isPending:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[a,d]=k.useState(c);let u;e[1]!==a||e[2]!==s||e[3]!==r?(u=async()=>{await r(a),s(!1),d({})},e[1]=a,e[2]=s,e[3]=r,e[4]=u):u=e[4];const f=u;let m;e[5]!==s?(m=_=>{_||d({}),s(_)},e[5]=s,e[6]=m):m=e[6];const h=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(tr,{children:[o.jsx(nr,{children:"Workflow Input"}),o.jsx(sr,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[8]=x):x=e[8];let g;e[9]!==a||e[10]!==i?(g=o.jsx("div",{className:"py-4",children:o.jsx(Ls,{inputSchema:i,inputParams:a,setInputParams:d,mentions:x})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==h?(b=()=>h(!1),e[12]=h,e[13]=b):b=e[13];let j;e[14]!==l||e[15]!==b?(j=o.jsx(Q,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let S;e[17]!==l?(S=l?o.jsx(pt,{size:"xs"}):o.jsx(tn,{size:14}),e[17]=l,e[18]=S):S=e[18];let y;e[19]!==f||e[20]!==l||e[21]!==S?(y=o.jsxs(Q,{onClick:f,disabled:l,className:"gap-2",children:[S,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=S,e[22]=y):y=e[22];let v;e[23]!==y||e[24]!==j?(v=o.jsxs(or,{children:[j,y]}),e[23]=y,e[24]=j,e[25]=v):v=e[25];let w;e[26]!==v||e[27]!==g?(w=o.jsxs(rr,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,v]}),e[26]=v,e[27]=g,e[28]=w):w=e[28];let C;return e[29]!==h||e[30]!==n||e[31]!==w?(C=o.jsx(ir,{open:n,onOpenChange:h,children:w}),e[29]=h,e[30]=n,e[31]=w,e[32]=C):C=e[32],C}function dl(t){const e=N.c(27),{title:n,description:s,onSave:i,isSaving:r}=t,c=Vt().location.href,{viewMode:a,setViewMode:d,showExecutionsList:u,toggleExecutionsList:f}=un(),{resetToOriginalWorkflow:m,setSelectedVirtualMcpId:h}=ne(),p=Ss(),x=Ge(),g=B();let b;e[0]!==n?(b=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==s?(j=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==b||e[5]!==j?(S=o.jsx(Hn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,j]})}),e[4]=b,e[5]=j,e[6]=S):S=e[6];let y;e[7]!==p||e[8]!==r||e[9]!==i||e[10]!==m||e[11]!==x||e[12]!==h||e[13]!==d||e[14]!==u||e[15]!==n||e[16]!==f||e[17]!==g||e[18]!==c||e[19]!==a?(y=!g&&o.jsxs(o.Fragment,{children:[o.jsx(Vn,{onSave:i,onUndo:m,isDirty:p,isSaving:r,saveLabel:"Save workflow",undoLabel:"Reset changes"}),o.jsx(k.Suspense,{fallback:o.jsx(pt,{size:"xs"}),children:o.jsx(Yr,{selectedVirtualMcpId:x,onVirtualMcpChange:h,placeholder:"Select Agent"})}),o.jsx(Yo,{value:a,onValueChange:d,size:"sm",options:[{value:"visual",icon:o.jsx(ps,{})},{value:"code",icon:o.jsx(us,{})}]}),o.jsx(Gt,{title:n,url:c,icon:"workflow"}),o.jsx(en,{children:o.jsxs(st,{delayDuration:0,children:[o.jsx(ot,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(Q,{variant:u?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:f,"aria-label":u?"Hide runs":"Show runs",children:o.jsx(ds,{size:14})})})}),o.jsx(rt,{side:"bottom",children:u?"Hide runs":"Show runs"})]})})]}),e[7]=p,e[8]=r,e[9]=i,e[10]=m,e[11]=x,e[12]=h,e[13]=d,e[14]=u,e[15]=n,e[16]=f,e[17]=g,e[18]=c,e[19]=a,e[20]=y):y=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(ml,{}),e[21]=v):v=e[21];let w;e[22]!==y?(w=o.jsxs(Yt,{children:[y,v]}),e[22]=y,e[23]=w):w=e[23];let C;return e[24]!==S||e[25]!==w?(C=o.jsxs(o.Fragment,{children:[S,w]}),e[24]=S,e[25]=w,e[26]=C):C=e[26],C}function ul(){const t=B(),{item:e}=pe(t);return e?.completed_at_epoch_ms!=null}function fl(){const t=B(),{item:e}=pe(t);return e?.status==="cancelled"}function ml(){const t=N.c(58),e=Ss(),n=ul(),s=fl(),i=B(),r=Ge(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=di(),u=Je(),[f,m]=k.useState(!1),{handleCancelWorkflow:h,isCancelling:p}=ui(),{handleResumeWorkflow:x,isResuming:g}=fi(),b=i&&!n;let j;t[0]!==u?(j=u.some(pl),t[0]=u,t[1]=j):j=t[1];const S=j,y=!r,v=u.length===0,w=e||v||S||y||c||p,C=b||c;let _;t[2]!==S||t[3]!==y||t[4]!==e||t[5]!==s||t[6]!==C||t[7]!==v?(_=()=>s?"Workflow is currently cancelled":C?"Workflow is currently running":e?"Save your changes before running":y?"Select an Agent first":v||S?"Add at least one step to the workflow":null,t[2]=S,t[3]=y,t[4]=e,t[5]=s,t[6]=C,t[7]=v,t[8]=_):_=t[8];const $=_();let T;t[9]!==h||t[10]!==x||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==C||t[15]!==a||t[16]!==i?(T=async()=>{if(a&&d){m(!0);return}if(s&&i){await x(i);return}if(C&&i){await h(i);return}await l({})},t[9]=h,t[10]=x,t[11]=l,t[12]=d,t[13]=s,t[14]=C,t[15]=a,t[16]=i,t[17]=T):T=t[17];const P=T;let I;t[18]!==l?(I=async O=>{await l(O)},t[18]=l,t[19]=I):I=t[19];const R=I,V=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",W=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let X;t[20]!==W?(X=M("gap-2 h-7 px-3",W),t[20]=W,t[21]=X):X=t[21];let U;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(U=(!b&&!c&&!p&&!g||s)&&o.jsx(tn,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=U):U=t[27];let D;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(D=b&&!c&&!p&&!g&&!s&&o.jsx(Mo,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=D):D=t[33];let q;t[34]!==p||t[35]!==c||t[36]!==g?(q=(c||p||g)&&o.jsx(pt,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=q):q=t[37];let se;t[38]!==V||t[39]!==P||t[40]!==w||t[41]!==X||t[42]!==U||t[43]!==D||t[44]!==q?(se=o.jsxs(Q,{variant:"default",size:"sm",className:X,disabled:w,onClick:P,children:[U,D,q,V]}),t[38]=V,t[39]=P,t[40]=w,t[41]=X,t[42]=U,t[43]=D,t[44]=q,t[45]=se):se=t[45];const te=se;let F;t[46]!==te||t[47]!==$?(F=$?o.jsx(en,{children:o.jsxs(st,{delayDuration:0,children:[o.jsx(ot,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:te})}),o.jsx(rt,{side:"bottom",children:$})]})}):te,t[46]=te,t[47]=$,t[48]=F):F=t[48];const J=F;let G;t[49]!==R||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(G=a&&d&&o.jsx(al,{open:f,onOpenChange:m,inputSchema:d,onSubmit:R,isPending:c}),t[49]=R,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=G):G=t[54];let ee;return t[55]!==J||t[56]!==G?(ee=o.jsxs(o.Fragment,{children:[J,G]}),t[55]=J,t[56]=G,t[57]=ee):ee=t[57],ee}function pl(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function On(t,e){for(const n of e)if(n===t||n.startsWith(`${t}[`))return!0;return!1}function xl(){const t=N.c(13),e=B(),n=Je(),{item:s}=pe(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.error||t[3]!==s.running_steps||t[4]!==s.status||t[5]!==n){i={};let r;t[7]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(hl)??[]),t[7]=s.completed_steps?.success,t[8]=r):r=t[8];const l=r,c=s.completed_steps?.error??[];let a;t[9]!==s.running_steps?(a=s.running_steps??[],t[9]=s.running_steps,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d,f=s.status,m=s.error!=null?typeof s.error=="string"?s.error:JSON.stringify(s.error):void 0;let h=-1;n.forEach((p,x)=>{(l.has(p.name)||On(p.name,c))&&(h=x)}),n.forEach((p,x)=>{let g="pending",b;On(p.name,c)?(g="error",b=m):l.has(p.name)?g="success":(f==="error"||f==="failed")&&u.has(p.name)?(g="error",b=m):f==="running"&&x===h+1&&(g="running"),i[p.name]={status:g,output:void 0,error:b,stepIndex:x}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.error,t[3]=s.running_steps,t[4]=s.status,t[5]=n,t[6]=i}else i=t[6];return i}function hl(t){return t.name}function gl(t){const e=N.c(97),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=B(),{item:m}=pe(f),h=m?.completed_steps,p=h?.success,x=h?.error??[];let g;e[0]!==n.name||e[1]!==p?(g=p?.find(z=>z.name===n.name),e[0]=n.name,e[1]=p,e[2]=g):g=e[2];const b=g,j=b?.completed_at_epoch_ms,S=b!=null;let y;e[3]!==n.name?(y=z=>z===n.name||z.startsWith(`${n.name}[`),e[3]=n.name,e[4]=y):y=e[4];const v=x.some(y),w="toolName"in n.action,C=w&&"connectionId"in n.action?n.action.connectionId:null,E=!!(w&&"toolName"in n.action?n.action.toolName:null),$=_l(n),P=(m?.status==="error"||m?.status==="failed")&&m?.running_steps?.includes(n.name),I=S?"success":v||P?"error":r?.status,R=r!==void 0,V=I==="success"||I==="error";let W=$.length>0?60:12;(I==="success"||I==="error")&&(W=W+32);const X=vl(I);let U;e[5]!==I?(U=Sl(I),e[5]=I,e[6]=U):U=e[6];const D=U;let q;e[7]===Symbol.for("react.memo_cache_sentinel")?(q=function(Et,Ys){const bn=Ys.split(".").slice(1);if(bn.length===0)return Array.isArray(Et)?Et:void 0;let ge=Et;for(const eo of bn){if(ge==null)return;if(typeof ge=="object")ge=ge[eo];else return}return Array.isArray(ge)?ge:void 0},e[7]=q):q=e[7];const se=q,te=n.forEach!==void 0,F=n.forEach?.ref;let J;e[8]!==F?(J=F?.replace("@","").split(".")[0],e[8]=F,e[9]=J):J=e[9];const G=J,ee=m?.status==="running"||m?.status==="enqueued";let O;e[10]!==p||e[11]!==G?(O=p?.some(z=>z.name===G),e[10]=p,e[11]=G,e[12]=O):O=e[12];const A=O,L=ee?500:!1;let Z;e[13]!==A||e[14]!==L?(Z={refetchInterval:L,enabled:A},e[13]=A,e[14]=L,e[15]=Z):Z=e[15];const{output:le}=ys(f,G,Z);let oe;if(e[16]!==le||e[17]!==F){const z=F?.replace("@","");oe=z?se(le,z):void 0,e[16]=le,e[17]=F,e[18]=oe}else oe=e[18];const ce=oe;let H;if(e[19]!==n.name){let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=/[.*+?^${}()|[\]\\]/g,e[21]=z):z=e[21],H=n.name.replace(z,"\\$&"),e[19]=n.name,e[20]=H}else H=e[20];const ae=H,me=new RegExp(`^${ae}\\[\\d+\\]$`),St=m?.completed_steps?.success?.filter(z=>me.test(z.name)),He=x.filter(z=>me.test(z)),yt=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",wt=I==="running"&&"bg-accent/50",Nt=l&&"opacity-50";let je;e[22]!==yt||e[23]!==wt||e[24]!==Nt?(je=M("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",yt,wt,Nt),e[22]=yt,e[23]=wt,e[24]=Nt,e[25]=je):je=e[25];const Xs="button",Zs=0;let ve;e[26]!==a?(ve=z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),a())},e[26]=a,e[27]=ve):ve=e[27];const Ct=M("text-xs font-mono opacity-75 h-8 flex items-center",X),kt=s+1;let Se;e[28]!==Ct||e[29]!==kt?(Se=o.jsx("div",{className:"w-5 flex flex-col items-center justify-center shrink-0 pt-3",children:o.jsxs("span",{className:Ct,children:[kt,"."]})}),e[28]=Ct,e[29]=kt,e[30]=Se):Se=e[30];let ye;e[31]!==D||e[32]!==s?(ye=s>0?o.jsx(Lt,{height:12,color:D}):o.jsx("div",{className:"h-3"}),e[31]=D,e[32]=s,e[33]=ye):ye=e[33];let we;e[34]!==C||e[35]!==E||e[36]!==w||e[37]!==n.name?(we=o.jsx(kl,{connectionId:C,isToolStep:w,hasToolSelected:E,stepName:n.name}),e[34]=C,e[35]=E,e[36]=w,e[37]=n.name,e[38]=we):we=e[38];let Ne;e[39]!==D||e[40]!==V||e[41]!==I?(Ne=V&&o.jsxs(o.Fragment,{children:[o.jsx(Lt,{height:8,color:D}),o.jsx(yl,{status:I})]}),e[39]=D,e[40]=V,e[41]=I,e[42]=Ne):Ne=e[42];let Ce;e[43]!==D||e[44]!==W||e[45]!==c||e[46]!==f?(Ce=c&&f?null:o.jsx(Lt,{height:W,color:D}),e[43]=D,e[44]=W,e[45]=c,e[46]=f,e[47]=Ce):Ce=e[47];let ke;e[48]!==ye||e[49]!==we||e[50]!==Ne||e[51]!==Ce?(ke=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[ye,we,Ne,Ce]}),e[48]=ye,e[49]=we,e[50]=Ne,e[51]=Ce,e[52]=ke):ke=e[52];const Qs="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",It=E?"font-medium text-foreground":"text-foreground";let Ie;e[53]!==It?(Ie=M("text-sm truncate flex-1",It),e[53]=It,e[54]=Ie):Ie=e[54];let _e;e[55]!==n?(_e=Il(n),e[55]=n,e[56]=_e):_e=e[56];let Ee;e[57]!==Ie||e[58]!==_e?(Ee=o.jsx("span",{className:Ie,children:_e}),e[57]=Ie,e[58]=_e,e[59]=Ee):Ee=e[59];let Te;e[60]!==St?.length||e[61]!==He||e[62]!==te||e[63]!==ce?(Te=te&&ce&&ce.length>0&&o.jsxs("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center gap-1",children:[`${(St?.length??0)+He.length} / ${ce.length}`,He.length>0&&o.jsxs("span",{className:"text-destructive",children:["(",He.length," failed)"]})]}),e[60]=St?.length,e[61]=He,e[62]=te,e[63]=ce,e[64]=Te):Te=e[64];let $e;e[65]!==R||e[66]!==I?($e=R&&o.jsx(wl,{status:I}),e[65]=R,e[66]=I,e[67]=$e):$e=e[67];let Oe;e[68]!==Te||e[69]!==$e?(Oe=o.jsxs("div",{className:"flex items-center gap-2",children:[Te,$e]}),e[68]=Te,e[69]=$e,e[70]=Oe):Oe=e[70];let Re;e[71]!==R||e[72]!==d||e[73]!==u?(Re=!R&&o.jsxs(ar,{children:[o.jsx(dr,{asChild:!0,children:o.jsx(Q,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:jl,children:o.jsx(lr,{size:14})})}),o.jsxs(ur,{align:"end",children:[o.jsxs(wn,{onClick:z=>{z.stopPropagation(),u()},children:[o.jsx(jr,{size:14}),"Duplicate"]}),o.jsxs(wn,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:z=>{z.stopPropagation(),d()},children:[o.jsx(po,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[71]=R,e[72]=d,e[73]=u,e[74]=Re):Re=e[74];let Ae;e[75]!==Ee||e[76]!==Oe||e[77]!==Re?(Ae=o.jsxs("div",{className:"flex items-center h-8",children:[Ee,Oe,Re]}),e[75]=Ee,e[76]=Oe,e[77]=Re,e[78]=Ae):Ae=e[78];const _t=$.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:$.map(bl)});let Me;e[79]!==I||e[80]!==j?(Me=I==="success"&&o.jsx(Nl,{completedAtEpochMs:j}),e[79]=I,e[80]=j,e[81]=Me):Me=e[81];let Pe;e[82]!==r?.error||e[83]!==I?(Pe=I==="error"&&o.jsx(Cl,{error:r?.error}),e[82]=r?.error,e[83]=I,e[84]=Pe):Pe=e[84];let Le;e[85]!==Ae||e[86]!==_t||e[87]!==Me||e[88]!==Pe?(Le=o.jsxs("div",{className:Qs,children:[Ae,_t,Me,Pe]}),e[85]=Ae,e[86]=_t,e[87]=Me,e[88]=Pe,e[89]=Le):Le=e[89];let Xe;return e[90]!==a||e[91]!==je||e[92]!==ve||e[93]!==Se||e[94]!==ke||e[95]!==Le?(Xe=o.jsxs("div",{className:je,onClick:a,role:Xs,tabIndex:Zs,onKeyDown:ve,children:[Se,ke,Le]}),e[90]=a,e[91]=je,e[92]=ve,e[93]=Se,e[94]=ke,e[95]=Le,e[96]=Xe):Xe=e[96],Xe}function bl(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function jl(t){return t.stopPropagation()}function vl(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function Sl(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function yl(t){const e=N.c(2),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-success flex items-center justify-center",children:o.jsx(xt,{size:8,className:"text-success-foreground"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-destructive flex items-center justify-center",children:o.jsx(ln,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function wl(t){const e=N.c(3),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(xt,{size:11,className:"text-success"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(ln,{size:11,className:"text-destructive"})}),e[1]=s):s=e[1],s}if(n==="running"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(ft,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function Nl(t){const e=N.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null&&n>0?new Date(n):null,d=a&&!Number.isNaN(a.getTime());s=d?a.toISOString().split("T")[0]:null,i=d?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Ko,{size:16,className:"text-success"}),o.jsx("span",{className:"text-xs text-success",children:s}),o.jsx("span",{className:"text-xs text-success",children:r})]}),e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==l?(c=o.jsx("div",{className:"inline-flex items-center gap-3 px-1.5 py-1 bg-success-foreground rounded-lg w-fit",children:l}),e[6]=l,e[7]=c):c=e[7],c}function Cl(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Yn,{size:16,className:"text-destructive"}),e[0]=s):s=e[0];const i=n||"Execution failed";let r;return e[1]!==i?(r=o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-1.5 py-1 bg-destructive-foreground rounded-lg w-fit",children:[s,o.jsx("span",{className:"text-xs text-destructive",children:i})]}),e[1]=i,e[2]=r):r=e[2],r}function kl(t){const e=N.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=ut(n??"");if(s&&i&&l?.icon){let a;return e[0]!==l.icon||e[1]!==r?(a=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center overflow-hidden",children:o.jsx(mt,{icon:l.icon,name:r,size:"xs",className:"border-0 rounded-none"})}),e[0]=l.icon,e[1]=r,e[2]=a):a=e[2],a}let c;return e[3]!==s?(c=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:s?o.jsx(cr,{size:16,className:"text-muted-foreground"}):o.jsx(br,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function Lt(t){const e=N.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=M("w-px",i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;return e[4]!==r||e[5]!==l?(c=o.jsx("div",{className:r,style:l}),e[4]=r,e[5]=l,e[6]=c):c=e[6],c}function Il(t){return t.name?t.name:"toolName"in t.action&&t.action.toolName?t.action.toolName:"code"in t.action?t.name||"Code Step":"Select tool..."}function _l(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function El(t){const e=N.c(32),{className:n}=t,s=Je(),i=vs(),r=xl(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=ne(),d=B();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(S=>r[S.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let h;e[4]!==n?(h=M("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=h):h=e[5];let p;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let S;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(S=(y,v)=>{const w=r?.[y.name],C=f!==-1&&v>f&&w?.status==="pending",_=v===s.length-1;return o.jsx(gl,{step:y,index:v,isSelected:y.name===i,executionStatus:w,isSkipped:C,isLastStep:_,onSelect:()=>l(y.name),onDelete:()=>c(y.name),onDuplicate:()=>a(y.name)},y.name)},e[14]=i,e[15]=c,e[16]=a,e[17]=f,e[18]=l,e[19]=r,e[20]=s.length,e[21]=S):S=e[21],p=s.map(S),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=p}else p=e[13];let x;e[22]!==p?(x=o.jsx("div",{className:"pt-3 -space-y-1",children:p}),e[22]=p,e[23]=x):x=e[23];let g;e[24]!==d?(g=d?null:o.jsx(Tl,{}),e[24]=d,e[25]=g):g=e[25];let b;e[26]!==x||e[27]!==g?(b=o.jsxs("div",{className:"w-full -space-y-1",children:[x,g]}),e[26]=x,e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==h||e[30]!==b?(j=o.jsx(k.Suspense,{fallback:m,children:o.jsx("div",{className:h,children:b})}),e[29]=h,e[30]=b,e[31]=j):j=e[31],j}function Tl(){const t=N.c(8),{addToolStep:e}=ne();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("div",{className:"w-5 shrink-0"}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"w-px h-3 bg-border"}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Qn,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(Q,{variant:"outline",size:"icon",className:"size-8 rounded-lg",onClick:e,children:i}),t[3]=e,t[4]=r):r=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"w-px h-8",style:{backgroundImage:"repeating-linear-gradient(180deg, var(--border), var(--border) 4px, transparent 4px, transparent 8px)",backgroundPosition:"left top",backgroundRepeat:"repeat-y",backgroundSize:"2px 100%"}}),t[5]=l):l=t[5];let c;return t[6]!==r?(c=o.jsxs("div",{className:"flex gap-2 items-start px-4 pb-3",children:[n,o.jsxs("div",{className:"flex flex-col border-1 border-transparent items-center shrink-0",children:[s,r,l]})]}),t[6]=r,t[7]=c):c=t[7],c}function $l(){const t=N.c(14),{org:e}=Y(),n=Ge();let s;t[0]!==e.id||t[1]!==n?(s=n??Be(e.id),t[0]=e.id,t[1]=n,t[2]=s):s=t[2];const i=s;let r;t[3]!==e.id||t[4]!==i?(r={connectionId:i,orgId:e.id},t[3]=e.id,t[4]=i,t[5]=r):r=t[5];const l=ie(r);let c;t[6]!==l?(c={client:l},t[6]=l,t[7]=c):c=t[7];const a=nn(c);let d;t[8]!==a.data?.tools?(d=a.data?.tools??[],t[8]=a.data?.tools,t[9]=d):d=t[9];let u;return t[10]!==d||t[11]!==a.error||t[12]!==a.isLoading?(u={tools:d,isLoading:a.isLoading,error:a.error},t[10]=d,t[11]=a.error,t[12]=a.isLoading,t[13]=u):u=t[13],u}function Ol(t){const e=N.c(2),{className:n}=t;let s;return e[0]!==n?(s=o.jsx(Rl,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function Rl(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=$l(),l=Ke(),{updateStep:c}=ne(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let v;e[3]!==d?(v=w=>w.name===d,e[3]=d,e[4]=v):v=e[4],u=s.find(v),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const m=pi(s,u??null,Ml,Al);let h;e[5]!==l||e[6]!==c?(h=v=>{l&&c(l.name,{action:{...l.action,toolName:v.name},outputSchema:v.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=h):h=e[7];const p=h;if(i){let v;e[8]!==n?(v=M("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=v):v=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(pt,{size:"sm"})}),e[10]=w):w=e[10];let C;return e[11]!==v?(C=o.jsx("div",{className:v,children:w}),e[11]=v,e[12]=C):C=e[12],C}if(r){let v;e[13]!==n?(v=M("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=v):v=e[14];let w;e[15]!==r.message?(w=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-destructive p-4 text-center",children:["Failed to load tools: ",r.message]}),e[15]=r.message,e[16]=w):w=e[16];let C;return e[17]!==v||e[18]!==w?(C=o.jsx("div",{className:v,children:w}),e[17]=v,e[18]=w,e[19]=C):C=e[19],C}let x;e[20]!==n?(x=M("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=x):x=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("span",{className:"text-base font-medium text-foreground",children:"Select tool"}),e[22]=g):g=e[22];let b;e[23]!==s.length?(b=o.jsx("div",{className:"flex items-start border-b border-border",children:o.jsxs("div",{className:"flex-1 flex items-center h-12 px-5",children:[g,o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",s.length,")"]})]})}),e[23]=s.length,e[24]=b):b=e[24];let j;if(e[25]!==p||e[26]!==m||e[27]!==d){let v;e[29]!==p||e[30]!==d?(v=w=>o.jsx(Pl,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=v):v=e[31],j=m.map(v),e[25]=p,e[26]=m,e[27]=d,e[28]=j}else j=e[28];let S;e[32]!==j?(S=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=S):S=e[33];let y;return e[34]!==x||e[35]!==b||e[36]!==S?(y=o.jsxs("div",{className:x,children:[b,S]}),e[34]=x,e[35]=b,e[36]=S,e[37]=y):y=e[37],y}function Al(t,e){return t.name.localeCompare(e.name)}function Ml(t){return t.name}function Pl(t){const e=N.c(20),{icon:n,title:s,description:i,isSelected:r,onClick:l}=t,c=r&&"bg-muted/50";let a;e[0]!==c?(a=M("flex items-start gap-2.5 min-h-14 px-5 py-4 cursor-pointer transition-colors","hover:bg-muted/50",c),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==l?(d=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==s?(u=o.jsx(mt,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==s?(f=o.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:s}),e[7]=s,e[8]=f):f=e[8];let m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let h;e[11]!==f||e[12]!==m?(h=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=h):h=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==h?(p=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,h]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=h,e[19]=p):p=e[19],p}var de="Accordion",Ll=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pn,Dl,zl]=ho(de),[jt]=Dn(de,[zl,es]),xn=es(),Ds=K.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(pn.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(Vl,{...r,ref:e}):o.jsx(Hl,{...i,ref:e})})});Ds.displayName=de;var[zs,Wl]=jt(de),[Ws,Fl]=jt(de,{collapsible:!1}),Hl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=Bt({prop:n,defaultProp:s??"",onChange:i,caller:de});return o.jsx(zs,{scope:t.__scopeAccordion,value:K.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:K.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(Ws,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(Fs,{...l,ref:e})})})}),Vl=K.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=Bt({prop:n,defaultProp:s??[],onChange:i,caller:de}),a=K.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=K.useCallback(u=>c((f=[])=>f.filter(m=>m!==u)),[c]);return o.jsx(zs,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(Ws,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(Fs,{...r,ref:e})})})}),[Ul,vt]=jt(de),Fs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=K.useRef(null),a=Ln(c,e),d=Dl(n),f=go(i)==="ltr",m=ue(t.onKeyDown,h=>{if(!Ll.includes(h.key))return;const p=h.target,x=d().filter(_=>!_.ref.current?.disabled),g=x.findIndex(_=>_.ref.current===p),b=x.length;if(g===-1)return;h.preventDefault();let j=g;const S=0,y=b-1,v=()=>{j=g+1,j>y&&(j=S)},w=()=>{j=g-1,j<S&&(j=y)};switch(h.key){case"Home":j=S;break;case"End":j=y;break;case"ArrowRight":r==="horizontal"&&(f?v():w());break;case"ArrowDown":r==="vertical"&&v();break;case"ArrowLeft":r==="horizontal"&&(f?w():v());break;case"ArrowUp":r==="vertical"&&w();break}const C=j%b;x[C].ref.current?.focus()});return o.jsx(Ul,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(pn.Slot,{scope:n,children:o.jsx(Ut.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:m})})})}),dt="AccordionItem",[Bl,hn]=jt(dt),Hs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=vt(dt,n),l=Wl(dt,n),c=xn(n),a=xo(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(Bl,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(mr,{"data-orientation":r.orientation,"data-state":Js(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});Hs.displayName=dt;var Vs="AccordionHeader",Us=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=vt(de,n),r=hn(Vs,n);return o.jsx(Ut.h3,{"data-orientation":i.orientation,"data-state":Js(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});Us.displayName=Vs;var Ht="AccordionTrigger",Bs=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=vt(de,n),r=hn(Ht,n),l=Fl(Ht,n),c=xn(n);return o.jsx(pn.ItemSlot,{scope:n,children:o.jsx(fr,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});Bs.displayName=Ht;var qs="AccordionContent",Ks=K.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=vt(de,n),r=hn(qs,n),l=xn(n);return o.jsx(pr,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...l,...s,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});Ks.displayName=qs;function Js(t){return t?"open":"closed"}var ql=Ds,Kl=Hs,Jl=Us,Gl=Bs,Xl=Ks;function Zl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(ql,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function Ql(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=M("border-b last:border-b-0",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx(Kl,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Yl(t){const e=N.c(11);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=M("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-4 text-left text-sm font-medium transition-all outline-none hover:bg-accent/50 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-90",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xr,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 transition-transform duration-200"}),e[6]=l):l=e[6];let c;return e[7]!==n||e[8]!==i||e[9]!==r?(c=o.jsx(Jl,{className:"flex",children:o.jsxs(Gl,{"data-slot":"accordion-trigger",className:r,...i,children:[n,l]})}),e[7]=n,e[8]=i,e[9]=r,e[10]=c):c=e[10],c}function ec(t){const e=N.c(12);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=M("pt-0 pb-4",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]!==n||e[7]!==r?(l=o.jsx("div",{className:r,children:n}),e[6]=n,e[7]=r,e[8]=l):l=e[8];let c;return e[9]!==i||e[10]!==l?(c=o.jsx(Xl,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...i,children:l}),e[9]=i,e[10]=l,e[11]=c):c=e[11],c}function tc(t){const{updateStep:e}=ne(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=gn(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function nc(t){const e=N.c(48),{className:n}=t,s=Ke(),{appendStep:i}=ne();tc(s);const r=B(),{item:l}=pe(r);if(!s){let $;e[0]!==n?($=M("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=$):$=e[1];let T;e[2]!==i?(T=()=>{i({type:"tool"})},e[2]=i,e[3]=T):T=e[3];let P;e[4]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(Qn,{size:14}),e[4]=P):P=e[4];let I;e[5]!==T?(I=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground gap-2 flex-col",children:["Select or create a step to configure",o.jsx(Q,{variant:"ghost",size:"icon",className:"size-7",onClick:T,children:P})]}),e[5]=T,e[6]=I):I=e[6];let R;return e[7]!==$||e[8]!==I?(R=o.jsx("div",{className:$,children:I}),e[7]=$,e[8]=I,e[9]=R):R=e[9],R}const c=s?.name;let a;e[10]!==l?.completed_steps?.error?(a=l?.completed_steps?.error??[],e[10]=l?.completed_steps?.error,e[11]=a):a=e[11];const d=a;let u;if(e[12]!==c||e[13]!==d){let $;e[15]!==c?($=T=>T===c||T.startsWith(`${c}[`),e[15]=c,e[16]=$):$=e[16],u=d.some($),e[12]=c,e[13]=d,e[14]=u}else u=e[14];const f=u,m=l?.status==="error"||l?.status==="failed";let h;e[17]!==c||e[18]!==m||e[19]!==l?.running_steps?(h=m&&l?.running_steps?.includes(c??""),e[17]=c,e[18]=m,e[19]=l?.running_steps,e[20]=h):h=e[20];const p=h,x=!!(l?.completed_steps?.success?.some($=>$.name===c)||f||p),g=f||p;let b;e[21]!==n?(b=M("flex flex-col h-full bg-sidebar overflow-scroll",n),e[21]=n,e[22]=b):b=e[22];let j,S;e[23]!==s?(j=o.jsx(sc,{step:s}),S=o.jsx(rc,{step:s}),e[23]=s,e[24]=j,e[25]=S):(j=e[24],S=e[25]);const y=`${c}-${x?"open":"closed"}`;let v;e[26]!==l||e[27]!==g?(v=g&&l?.error!=null?typeof l.error=="string"?l.error:JSON.stringify(l.error):void 0,e[26]=l,e[27]=g,e[28]=v):v=e[28];let w;e[29]!==s||e[30]!==x||e[31]!==g||e[32]!==y||e[33]!==v?(w=o.jsx(lc,{step:s,defaultOpen:x,isStepErrored:g,executionError:v},y),e[29]=s,e[30]=x,e[31]=g,e[32]=y,e[33]=v,e[34]=w):w=e[34];let C;e[35]!==s||e[36]!==r?(C=!r&&o.jsx(mc,{step:s}),e[35]=s,e[36]=r,e[37]=C):C=e[37];let _;e[38]!==s||e[39]!==r?(_=!r&&o.jsx(hc,{step:s}),e[38]=s,e[39]=r,e[40]=_):_=e[40];let E;return e[41]!==C||e[42]!==_||e[43]!==b||e[44]!==j||e[45]!==S||e[46]!==w?(E=o.jsxs("div",{className:b,children:[j,S,w,C,_]}),e[41]=C,e[42]=_,e[43]=b,e[44]=j,e[45]=S,e[46]=w,e[47]=E):E=e[47],E}function sc(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=B(),l=i??"";let c;e[0]!==l?(c=o.jsx(mt,{icon:null,name:l,size:"xs",className:"shadow-sm"}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==i?(a=o.jsx("span",{className:"text-base font-medium text-foreground truncate flex-1",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==r?(d=r?null:o.jsx(oc,{}),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==a||e[8]!==d?(u=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;e[10]!==n.description?(f=n.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[10]=n.description,e[11]=f):f=e[11];let m;return e[12]!==u||e[13]!==f?(m=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14],m}function oc(){const t=N.c(9),e=Ke(),{updateStep:n,startReplacingTool:s}=ne(),i=B(),l=e&&"toolName"in e.action?e.action.toolName:null;let c;t[0]!==e||t[1]!==s||t[2]!==l||t[3]!==i||t[4]!==n?(c=()=>{if(e){if(i){An.error("You cannot replace a tool while a workflow is executing.");return}l&&s(l),n(e.name,{action:{...e.action,toolName:""}})}},t[0]=e,t[1]=s,t[2]=l,t[3]=i,t[4]=n,t[5]=c):c=t[5];const a=c;let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(xs,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(Q,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:d}),t[7]=a,t[8]=u):u=t[8],u}function gn(t){const e=N.c(16),{org:n}=Y(),s=Ge();let i;e[0]!==n.id||e[1]!==s?(i=s??Be(n.id),e[0]=n.id,e[1]=s,e[2]=i):i=e[2];const r=i;let l;e[3]!==n.id||e[4]!==r?(l={connectionId:r,orgId:n.id},e[3]=n.id,e[4]=r,e[5]=l):l=e[5];const c=ie(l);let a;e[6]!==c?(a={client:c},e[6]=c,e[7]=a):a=e[7];const d=nn(a);let u;e[8]!==t||e[9]!==d.data?.tools?(u=d.data?.tools?.find(h=>h.name===t),e[8]=t,e[9]=d.data?.tools,e[10]=u):u=e[10];const f=u;let m;return e[11]!==f||e[12]!==d.error||e[13]!==d.isLoading||e[14]!==d.isSuccess?(m={tool:f,isLoading:d.isLoading,isReady:d.isSuccess,error:d.error},e[11]=f,e[12]=d.error,e[13]=d.isLoading,e[14]=d.isSuccess,e[15]=m):m=e[15],m}function rc(t){const e=N.c(18),{step:n}=t,{updateStep:s}=ne(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=B(),{tool:c}=gn(r??"");if(!c||!c.inputSchema)return null;let a;e[0]!==n.name||e[1]!==s?(a=v=>{s(n.name,{input:v})},e[0]=n.name,e[1]=s,e[2]=a):a=e[2];const d=a;let u;e[3]!==n.input||e[4]!==c.inputSchema||e[5]!==l?(u=l?ic(c.inputSchema,n.input):c.inputSchema,e[3]=n.input,e[4]=c.inputSchema,e[5]=l,e[6]=u):u=e[6];const f=u,m=l?"output":"input";let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Yl,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[7]=h):h=e[7];const p=n.name+l,x=!!l,g=f,b=n.input;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[8]=j):j=e[8];let S;e[9]!==d||e[10]!==p||e[11]!==x||e[12]!==g||e[13]!==b?(S=o.jsxs(Ql,{value:"input",className:"border-b-0",children:[h,o.jsx(ec,{className:"px-5 pt-2",children:o.jsx(Ls,{readOnly:x,inputSchema:g,inputParams:b,setInputParams:d,mentions:j},p)})]}),e[9]=d,e[10]=p,e[11]=x,e[12]=g,e[13]=b,e[14]=S):S=e[14];let y;return e[15]!==S||e[16]!==m?(y=o.jsx(Zl,{type:"single",collapsible:!0,defaultValue:m,className:"border-b border-border shrink-0",children:S}),e[15]=S,e[16]=m,e[17]=y):y=e[17],y}function ic(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function lc(t){const e=N.c(42),{step:n,defaultOpen:s,isStepErrored:i,executionError:r}=t,l=n.outputSchema,c=B(),{item:a}=pe(c),d=a?.completed_steps?.error??[];let u;e[0]!==n.name?(u=H=>H===n.name||H.startsWith(`${n.name}[`),e[0]=n.name,e[1]=u):u=e[1];const f=d.some(u),h=(a?.status==="error"||a?.status==="failed")&&a?.running_steps?.includes(n.name),p=!!(a?.completed_steps?.success?.some(H=>H.name===n.name)||f||h),[x,g]=k.useState(s),b=n.forEach!==void 0,[j,S]=k.useState("all"),y=b?new RegExp(`^${n.name}\\[(\\d+)\\]$`):null,v=b?(a?.completed_steps?.success??[]).filter(H=>y.test(H.name)).map(H=>{const ae=H.name.match(y);return{index:Number(ae[1]),status:"success"}}):[],C=(b?d.filter(H=>y.test(H)):[]).map(H=>{const ae=H.match(y);return{index:Number(ae[1]),status:"error"}}),_=[...v,...C].sort(ac),E=_.length>0,$=b&&j!=="all"?`${n.name}[${j}]`:void 0,T=p?n.name:void 0,P=$??T,{output:I,error:R}=ys(c,P);let V;e[2]!==R||e[3]!==r||e[4]!==i||e[5]!==I?(V=I||(R?{error:R}:i&&r?{error:r}:void 0),e[2]=R,e[3]=r,e[4]=i,e[5]=I,e[6]=V):V=e[6];const W=V,X=l&&typeof l=="object"?l.properties:void 0;let U;e[7]!==X?(U=X?Object.entries(X):[],e[7]=X,e[8]=U):U=e[8];const D=U,q=j!=="all"&&C.some(H=>H.index===j),se=j==="all"?i||f||h:q,te=x?"flex-1 min-h-0 overflow-hidden":"shrink-0";let F;e[9]!==te?(F=M("flex flex-col border-b border-border",te),e[9]=te,e[10]=F):F=e[10];let J;e[11]!==x||e[12]!==g?(J=()=>g(!x),e[11]=x,e[12]=g,e[13]=J):J=e[13];const G=se?"text-destructive":"text-muted-foreground";let ee;e[14]!==G?(ee=M("text-sm font-medium",G),e[14]=G,e[15]=ee):ee=e[15];const O=se?"Error":"Output";let A;e[16]!==ee||e[17]!==O?(A=o.jsx("h3",{className:ee,children:O}),e[16]=ee,e[17]=O,e[18]=A):A=e[18];let L;e[19]!==x?(L=x?o.jsx(an,{size:14,className:"text-muted-foreground"}):o.jsx(cn,{size:14,className:"text-muted-foreground"}),e[19]=x,e[20]=L):L=e[20];let Z;e[21]!==A||e[22]!==L?(Z=o.jsxs("div",{className:"flex items-center justify-between",children:[A,L]}),e[21]=A,e[22]=L,e[23]=Z):Z=e[23];let le;e[24]!==Z||e[25]!==J?(le=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:J,children:Z}),e[24]=Z,e[25]=J,e[26]=le):le=e[26];let oe;e[27]!==_||e[28]!==W||e[29]!==E||e[30]!==b||e[31]!==x||e[32]!==D||e[33]!==j||e[34]!==S||e[35]!==n.name||e[36]!==c?(oe=x&&o.jsxs(o.Fragment,{children:[c&&b&&E&&o.jsx(dc,{iterations:_,selectedIteration:j,onSelect:S}),c&&W?o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ze,{code:JSON.stringify(W,null,2),language:"json",height:"100%",readOnly:!0},`output-${n.name}-${j}`)}):null,!c&&D.length>0&&o.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:D.map(cc)})]}),e[27]=_,e[28]=W,e[29]=E,e[30]=b,e[31]=x,e[32]=D,e[33]=j,e[34]=S,e[35]=n.name,e[36]=c,e[37]=oe):oe=e[37];let ce;return e[38]!==le||e[39]!==oe||e[40]!==F?(ce=o.jsxs("div",{className:F,children:[le,oe]}),e[38]=le,e[39]=oe,e[40]=F,e[41]=ce):ce=e[41],ce}function cc(t){const[e,n]=t;return o.jsx(fc,{name:e,schema:n},e)}function ac(t,e){return t.index-e.index}function dc(t){const e=N.c(21),{iterations:n,selectedIteration:s,onSelect:i}=t,r=s==="all"?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground";let l;e[0]!==r?(l=M("h-7 px-3 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",r),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==i?(c=()=>i("all"),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==l||e[5]!==c?(a=o.jsx("button",{type:"button",className:l,onClick:c,children:"All Results"}),e[4]=l,e[5]=c,e[6]=a):a=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"w-px h-4 bg-border mx-1"}),e[7]=d):d=e[7];let u;if(e[8]!==n||e[9]!==i||e[10]!==s){let p;e[12]!==i||e[13]!==s?(p=x=>{const g=s===x.index;return o.jsxs("button",{type:"button",className:M("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",g?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(x.index),children:[x.status==="success"?o.jsx(xt,{size:12,className:"text-success"}):o.jsx(ln,{size:12,className:"text-destructive"}),o.jsxs("span",{className:"font-mono",children:["#",x.index]})]},x.index)},e[12]=i,e[13]=s,e[14]=p):p=e[14],u=n.map(p),e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];let f;e[15]!==a||e[16]!==u?(f=o.jsxs("div",{className:"flex w-max items-center gap-2 pb-3",children:[a,d,u]}),e[15]=a,e[16]=u,e[17]=f):f=e[17];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(Jo,{orientation:"horizontal"}),e[18]=m):m=e[18];let h;return e[19]!==f?(h=o.jsx("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:o.jsxs(Go,{className:"w-full whitespace-nowrap",children:[f,m]})}),e[19]=f,e[20]=h):h=e[20],h}function uc(t){switch(t){case"string":return{Icon:cs,color:"text-blue-500"};case"number":case"integer":return{Icon:is,color:"text-blue-500"};case"array":return{Icon:ss,color:"text-purple-500"};case"object":return{Icon:ns,color:"text-orange-500"};case"boolean":return{Icon:ls,color:"text-pink-500"};case"null":return{Icon:qt,color:"text-gray-500"};default:return{Icon:os,color:"text-muted-foreground"}}}function fc(t){const e=N.c(28),{name:n,schema:s}=t,i=Ke(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:y,color:v}=uc(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=y,c=14,a=M(v),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=d,e[5]=u}else l=e[1],c=e[2],a=e[3],d=e[4],u=e[5];let f;e[6]!==l||e[7]!==c||e[8]!==a?(f=o.jsx(l,{size:c,className:a}),e[6]=l,e[7]=c,e[8]=a,e[9]=f):f=e[9];let m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let h;e[12]!==d||e[13]!==f||e[14]!==m?(h=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=h):h=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(fs,{size:14,className:"opacity-50"}),e[16]=p):p=e[16];const x=i?.name;let g;e[17]!==x?(g=o.jsxs("span",{className:"text-muted-foreground",children:[x,"."]}),e[17]=x,e[18]=g):g=e[18];let b;e[19]!==n?(b=o.jsx("div",{className:"bg-blue-500/10 text-blue-500 px-1 py-0.5 rounded",children:n}),e[19]=n,e[20]=b):b=e[20];let j;e[21]!==g||e[22]!==b?(j=o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let S;return e[24]!==j||e[25]!==u||e[26]!==h?(S=o.jsxs("div",{className:u,children:[h,j]}),e[24]=j,e[25]=u,e[26]=h,e[27]=S):S=e[27],S}function mc(t){const e=N.c(29),{step:n}=t,{updateStep:s}=ne(),i=B(),[r,l]=k.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=gn(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
8
+ // Tool output schema not available
9
+ }`;const _=d.outputSchema,E=_.properties;return E?`interface Input {
10
+ ${Object.entries(E).map(T=>{const[P,I]=T,R=Ye(I),V=!_.required?.includes(P);return` ${P}${V?"?":""}: ${R};`}).join(`
11
+ `)}
12
+ }`:`interface Input {
13
+ [key: string]: unknown;
14
+ }`},e[0]=d,e[1]=f):f=e[1];const m=f;let h;e[2]!==m||e[3]!==n.action||e[4]!==n.name||e[5]!==s?(h=()=>{if("transformCode"in n.action&&n.action.transformCode){l(xc);return}const E=`${m()}
15
+
16
+ interface Output {
17
+ // Define your output type here
18
+ result: unknown;
19
+ }
20
+
21
+ export default async function(input: Input): Promise<Output> {
22
+ // Transform the tool output
23
+ return {
24
+ result: input,
25
+ };
26
+ }`;s(n.name,{action:{...n.action,transformCode:E}}),l(pc)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=h):h=e[6];const p=h;let x;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(x=(_,E)=>{s(n.name,{action:{...n.action,transformCode:_},...E?{outputSchema:E}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=x):x=e[10];const g=x;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[11]!==b?(j=M("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=S):S=e[13];let y;e[14]!==r?(y=o.jsxs("div",{className:"flex items-center justify-between",children:[S,r?o.jsx(an,{size:14,className:"text-muted-foreground"}):o.jsx(cn,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=y):y=e[15];let v;e[16]!==y||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:y}),e[16]=y,e[17]=p,e[18]=v):v=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ze,{code:u,language:"typescript",readOnly:i!==void 0,onSave:g,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=g,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=w):w=e[24];let C;return e[25]!==j||e[26]!==v||e[27]!==w?(C=o.jsxs("div",{className:j,children:[v,w]}),e[25]=j,e[26]=v,e[27]=w,e[28]=C):C=e[28],C}function pc(t){return!t}function xc(t){return!t}function hc(t){const e=N.c(24),{step:n}=t,[s,i]=k.useState(!1),{updateStep:r}=ne(),l="code"in n.action&&n.action.code?n.action.code:null,c=B();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,S)=>{r(n.name,{action:{...n.action,code:j},...S?{outputSchema:S}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const d=a;if(!l)return null;const u=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==u?(f=M("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=h):h=e[8];let p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[h,s?o.jsx(an,{size:14,className:"text-muted-foreground"}):o.jsx(cn,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let x;e[11]!==m||e[12]!==p?(x=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,e[13]=x):x=e[13];let g;e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==n.name||e[18]!==c?(g=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ze,{onSave:(j,S)=>d(j,S),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=d,e[16]=s,e[17]=n.name,e[18]=c,e[19]=g):g=e[19];let b;return e[20]!==f||e[21]!==x||e[22]!==g?(b=o.jsxs("div",{className:f,children:[x,g]}),e[20]=f,e[21]=x,e[22]=g,e[23]=b):b=e[23],b}function Ye(t){if(Array.isArray(t.type))return t.type.map(n=>Ye({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Ye(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Ye(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function gc(t){switch(t){case"success":return o.jsxs(xe,{variant:"success",className:"gap-1",children:[o.jsx(xt,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(xe,{variant:"destructive",className:"gap-1",children:[o.jsx(Yn,{size:11}),"Error"]});case"running":return o.jsxs(xe,{variant:"secondary",className:"gap-1",children:[o.jsx(Qe,{size:11}),"Running"]});case"enqueued":return o.jsxs(xe,{variant:"secondary",className:"gap-1",children:[o.jsx(Qe,{size:11}),"On hold"]});case"cancelled":return o.jsxs(xe,{variant:"secondary",className:"gap-1",children:[o.jsx(ts,{size:11}),"Cancelled"]});default:return o.jsxs(xe,{variant:"secondary",className:"gap-1",children:[o.jsx(Qe,{size:11}),t]})}}function bc(t){return`Run #${t.slice(-4).toUpperCase()}`}function jc(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=oi(),{setShowExecutionsList:r}=un(),{setTrackingExecutionId:l}=ne(),c=B();let a;e[0]!==l?(a=S=>{l(S)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let m;e[4]!==n?(m=M("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=h):h=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(ts,{size:11}),e[7]=p):p=e[7];let x;e[8]!==f?(x=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[h,o.jsx(Q,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),e[8]=f,e[9]=x):x=e[9];let g;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((S,y)=>o.jsx(vc,{execution:S,isSelected:S.id===c,isFirst:y===0,onSelect:()=>d(S.id)},S.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=g):g=e[14];let b;e[15]!==g?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:g}),e[15]=g,e[16]=b):b=e[16];let j;return e[17]!==m||e[18]!==x||e[19]!==b?(j=o.jsxs("div",{className:m,children:[x,b]}),e[17]=m,e[18]=x,e[19]=b,e[20]=j):j=e[20],j}function vc(t){const e=N.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=M("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n.status?(u=gc(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=bc(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let h;e[10]!==u||e[11]!==m?(h=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=h):h=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==h?(p=o.jsx("div",{className:d,onClick:r,children:h}),e[13]=r,e[14]=d,e[15]=h,e[16]=p):p=e[16],p}const Sc=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],yc=hr({buildUrl:t=>`/org/${t}/watch?types=workflow.*`,eventTypes:Sc}),wc=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"],Nc=500,Ue=new Map,Ve=new Map;function Cc(t){const e=Ve.get(t);if(e)for(const n of e)n.invalidateQueries({predicate:s=>s.queryKey.some(i=>typeof i=="string"&&wc.includes(i))})}function kc(t){Ue.has(t)||Ue.set(t,setTimeout(()=>{Ue.delete(t),Cc(t)},Nc))}const Rn=()=>0;function Ic(){const t=N.c(3),{org:e}=Y(),n=bo(),s=e.id;let i;t[0]!==s||t[1]!==n?(i=l=>{let c=Ve.get(s);c||(c=new Set,Ve.set(s,c)),c.add(n);const a=()=>{kc(s),l()},d=yc.subscribe(s,a);return()=>{d(),c.delete(n),c.size===0&&Ve.delete(s);const u=Ue.get(s);u&&!Ve.has(s)&&(clearTimeout(u),Ue.delete(s))}},t[0]=s,t[1]=n,t[2]=i):i=t[2];const r=i;k.useSyncExternalStore(r,Rn,Rn)}function Gs(t){const e=N.c(11),{itemId:n}=t,[s,i]=k.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=he(r),c=l??"no-connection",{org:a}=Y(),d=l??null;let u;e[1]!==a.id||e[2]!==d?(u={connectionId:d,orgId:a.id},e[1]=a.id,e[2]=d,e[3]=u):u=e[3];const f=ie(u),m=Kt(c,"WORKFLOW",n,f),h=Jt(c,"WORKFLOW",f);let p;e[4]!==h||e[5]!==n?(p=async b=>{i(!0),await h.update.mutateAsync({id:n,data:b}).finally(()=>{i(!1)})},e[4]=h,e[5]=n,e[6]=p):p=e[6];const x=p;let g;return e[7]!==s||e[8]!==m||e[9]!==x?(g={item:m,update:x,isUpdating:s},e[7]=s,e[8]=m,e[9]=x,e[10]=g):g=e[10],g}function _c(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=ne();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.steps||e[3]!==n.title){const f={title:n.title,description:n.description,steps:n.steps};r=ze,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.steps,e[3]=n.title,e[4]=r,e[5]=l,e[6]=c,e[7]=a}else r=e[4],l=e[5],c=e[6],a=e[7];let d;e[8]!==s||e[9]!==i||e[10]!==n?(d=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[8]=s,e[9]=i,e[10]=n,e[11]=d):d=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):u=e[17],u}function Ec(){const t=N.c(9),e=B(),{item:n}=pe(e),s=n?.start_at_epoch_ms,i=n?.completed_at_epoch_ms,r=n?.status==="running"&&s&&!i;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Date.now(),t[0]=l):l=t[0];const c=k.useRef(l);let a;t[1]!==r?(a=x=>{if(!r)return Tc;const g=setInterval(()=>{c.current=Date.now(),x()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const d=a;let u;t[3]!==r?(u=()=>r?c.current:0,t[3]=r,t[4]=u):u=t[4];const f=u,m=k.useSyncExternalStore(d,f,f),h=i&&s?Math.max(0,i-s):null;let p=null;if(s){let x;t[5]!==s?(x=new Date(s).getTime(),t[5]=s,t[6]=x):x=t[6];const g=x;if(i){let b;t[7]!==i?(b=new Date(i).getTime(),t[7]=i,t[8]=b):b=t[8],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??h}function Tc(){}function $c(t){if(t<1e3)return`${t}ms`;const e=t/1e3,n=e%60,s=Math.floor(e/60),i=s%60,r=Math.floor(s/60);return r>0?`${r}h ${i}m ${n.toFixed(3)}s`:i>0?`${i}m ${n.toFixed(3)}s`:`${n.toFixed(3)}s`}function Oc(){const t=N.c(26),{setTrackingExecutionId:e}=ne(),n=B(),{item:s}=pe(n),i=Ec();let r;t[0]!==i?(r=i!=null?$c(i):null,t[0]=i,t[1]=r):r=t[1];const l=r,c=s?.status,a=c==="error"||c==="failed",d=c==="success";let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(jo,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=u):u=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=f):f=t[3];let m;t[4]!==n?(m=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[f,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=m):m=t[5];let h;t[6]!==d?(h=d&&o.jsxs(xe,{variant:"success",className:"gap-1 ml-3",children:[o.jsx(vo,{size:11}),"Success"]}),t[6]=d,t[7]=h):h=t[7];let p;t[8]!==a?(p=a&&o.jsxs(xe,{variant:"destructive",className:"gap-1 ml-3",children:[o.jsx(vr,{size:11}),"Failed"]}),t[8]=a,t[9]=p):p=t[9];let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(gr,{className:"w-4 h-4 text-muted-foreground"}),t[10]=x):x=t[10];let g;t[11]!==l?(g=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[x,o.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),t[11]=l,t[12]=g):g=t[12];let b;t[13]!==m||t[14]!==h||t[15]!==p||t[16]!==g?(b=o.jsxs("div",{className:"flex items-center h-full",children:[u,m,h,p,g]}),t[13]=m,t[14]=h,t[15]=p,t[16]=g,t[17]=b):b=t[17];let j;t[18]!==e?(j=()=>e(void 0),t[18]=e,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(qt,{className:"w-4 h-4 text-muted-foreground"}),t[20]=S):S=t[20];let y;t[21]!==j?(y=o.jsx(Q,{variant:"ghost",size:"xs",onClick:j,children:S}),t[21]=j,t[22]=y):y=t[22];let v;return t[23]!==y||t[24]!==b?(v=o.jsx("div",{className:"flex flex-col border-b border-border",children:o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between",children:[b,y]})}),t[23]=y,t[24]=b,t[25]=v):v=t[25],v}function Rc(){const t=N.c(15);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=he(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i,update:r,isUpdating:l}=Gs(s);let c;t[3]!==i?(c=JSON.stringify(i),t[3]=i,t[4]=c):c=t[4];const a=c;if(!i){let m;return t[5]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(be,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(rn,{icon:o.jsx(rs,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})})}),t[5]=m):m=t[5],m}let d;t[6]!==i?(d={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},t[6]=i,t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==r?(u=o.jsx(Ac,{onUpdate:r,isUpdating:l}),t[8]=l,t[9]=r,t[10]=u):u=t[10];let f;return t[11]!==a||t[12]!==d||t[13]!==u?(f=o.jsx(Kr,{initialState:d,children:u},a),t[11]=a,t[12]=d,t[13]=u,t[14]=f):f=t[14],f}function Ac(t){const e=N.c(21),{onUpdate:n,isUpdating:s}=t;Ic();const i=We(),r=B(),{viewMode:l,showExecutionsList:c}=un(),a=Ke();let d;e[0]!==n||e[1]!==i?(d=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=d):d=e[2];const u=d,f=a&&"toolName"in a.action,m=f?a.action.toolName:null,h=f&&!m&&!r,p=!h&&(a||r||!c);let x;e[3]!==u||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(x=o.jsx(dl,{title:i.title,description:i.description,onSave:u,isSaving:s}),e[3]=u,e[4]=s,e[5]=i.description,e[6]=i.title,e[7]=x):x=e[7];let g;e[8]!==r?(g=r&&o.jsx(Oc,{}),e[8]=r,e[9]=g):g=e[9];let b;e[10]!==n||e[11]!==c||e[12]!==p||e[13]!==h||e[14]!==l||e[15]!==i?(b=o.jsx("div",{className:"flex-1 overflow-hidden",children:l==="code"?o.jsx(_c,{workflow:i,onUpdate:n}):o.jsxs(Zo,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(yn,{defaultSize:50,minSize:30,children:o.jsx(El,{})}),o.jsx(Qo,{}),o.jsxs(yn,{defaultSize:50,minSize:25,children:[h&&o.jsx(Ol,{className:"border-l border-border"}),c&&o.jsx(jc,{}),p&&o.jsx(nc,{className:"border-l border-border"})]})]})}),e[10]=n,e[11]=c,e[12]=p,e[13]=h,e[14]=l,e[15]=i,e[16]=b):b=e[16];let j;return e[17]!==x||e[18]!==g||e[19]!==b?(j=o.jsx(be,{children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[x,g,b]})}),e[17]=x,e[18]=g,e[19]=b,e[20]=j):j=e[20],j}function Mc(t){const e=N.c(6),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=he(s),r=i??"no-connection",{org:l}=Y(),c=i??null;let a;e[1]!==l.id||e[2]!==c?(a={connectionId:c,orgId:l.id},e[1]=l.id,e[2]=c,e[3]=a):a=e[3];const d=ie(a),u=Kt(r,"WORKFLOW_EXECUTION",n,d);let f;return e[4]!==u?(f={item:u},e[4]=u,e[5]=f):f=e[5],f}function Pc(){const t=N.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const{itemId:n}=he(e);let s;t[1]!==n?(s={itemId:n},t[1]=n,t[2]=s):s=t[2];const{item:i}=Mc(s);if(!i){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(be,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(rn,{icon:o.jsx(rs,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})})}),t[3]=c):c=t[3],c}let r;t[4]!==i?(r=JSON.stringify(i,null,2),t[4]=i,t[5]=r):r=t[5];let l;return t[6]!==r?(l=o.jsx(be,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(ze,{height:"100%",code:r,language:"json",readOnly:!0})})}),t[6]=r,t[7]=l):l=t[7],l}const Lc={workflow:Rc,workflow_execution:Pc,prompt:Ir};function Dc(){const t=N.c(6),e=zn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=he(n),i=decodeURIComponent(s.itemId);let r;t[1]!==e.history?(r=()=>{e.history.back()},t[1]=e.history,t[2]=r):r=t[2];const l=r,c=zc;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Ar,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function zc(t){return Promise.resolve()}function Wc(t){return t.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Fc(){const t=N.c(38),e=zn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=he(n),i=s.connectionId,r=decodeURIComponent(s.collectionName),l=decodeURIComponent(s.itemId);let c;t[1]!==e.history?(c=()=>{e.history.back()},t[1]=e.history,t[2]=c):c=t[2];const a=c,d=i??"no-connection",{org:u}=Y(),f=ut(i),m=i??null;let h;t[3]!==u.id||t[4]!==m?(h={connectionId:m,orgId:u.id},t[3]=u.id,t[4]=m,t[5]=h):h=t[5];const p=ie(h),x=Jt(d,r,p);let g;t[6]!==x||t[7]!==l?(g=async W=>{l&&await x.update.mutateAsync({id:l,data:W})},t[6]=x,t[7]=l,t[8]=g):g=t[8];const b=g;let j;t[9]!==r?(j=r?.toLowerCase(),t[9]=r,t[10]=j):j=t[10];const S=j,y=S&&Lc[S];let v;t[11]!==r?(v=Wc(r),t[11]=r,t[12]=v):v=t[12];const w=v;let C;t[13]!==u.slug?(C=o.jsx(De,{children:o.jsx(it,{asChild:!0,children:o.jsx(et,{to:"/$org/$project/mcps",params:{org:u.slug,project:tt},children:"Connections"})})}),t[13]=u.slug,t[14]=C):C=t[14];let _;t[15]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(lt,{}),t[15]=_):_=t[15];let E;t[16]!==r||t[17]!==f||t[18]!==i||t[19]!==u.slug?(E=f&&o.jsxs(o.Fragment,{children:[o.jsx(De,{children:o.jsx(it,{asChild:!0,children:o.jsx(et,{to:"/$org/$project/mcps/$connectionId",params:{org:u.slug,project:tt,connectionId:i},search:{tab:r},children:f.title})})}),o.jsx(lt,{})]}),t[16]=r,t[17]=f,t[18]=i,t[19]=u.slug,t[20]=E):E=t[20];let $;t[21]!==w?($=o.jsx(De,{children:o.jsx(Xn,{children:w})}),t[21]=w,t[22]=$):$=t[22];let T;t[23]!==$||t[24]!==C||t[25]!==E?(T=o.jsx(Jn,{children:o.jsxs(Gn,{children:[C,_,E,$]})}),t[23]=$,t[24]=C,t[25]=E,t[26]=T):T=t[26];const P=T;if(y){let W;return t[27]!==y||t[28]!==a||t[29]!==b||t[30]!==l?(W=o.jsx(y,{itemId:l,onBack:a,onUpdate:b}),t[27]=y,t[28]=a,t[29]=b,t[30]=l,t[31]=W):W=t[31],W}let I;t[32]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(Xo,{size:36,className:"text-muted-foreground"}),t[32]=I):I=t[32];let R;t[33]!==a?(R=o.jsx(rn,{icon:I,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[33]=a,t[34]=R):R=t[34];let V;return t[35]!==P||t[36]!==R?(V=o.jsx(be,{breadcrumb:P,children:R}),t[35]=P,t[36]=R,t[37]=V):V=t[37],V}function Hc(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=he(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Dc,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Fc,{}),t[2]=r):r=t[2],r}function Wd(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Fn,{children:o.jsx(k.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ft,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Hc,{})})}),t[0]=e):e=t[0],e}export{Wd as default};
@@ -0,0 +1 @@
1
+ import{c as v,j as t}from"./index-CKXRhh0t.js";import{c as N}from"./button-BjJbLzI1.js";import{i as y}from"./Loading01-Bm0RmGTq.js";import{i as C}from"./SearchMd-rBeGYVN8.js";import{I as w}from"./input-BPPp7fkV.js";function S(){const u=v.c(1);let e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),u[0]=e):e=u[0],e}function R(u){const e=v.c(24),{image:f,title:h,description:j,actions:d,className:p,descriptionClassName:g,actionsClassName:x}=u;let n;e[0]!==p?(n=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",p),e[0]=p,e[1]=n):n=e[1];let s;e[2]!==f?(s=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(S,{})}),e[2]=f,e[3]=s):s=e[3];let o;e[4]!==h?(o=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:h}),e[4]=h,e[5]=o):o=e[5];let l;e[6]!==g?(l=N("text-sm text-muted-foreground text-center max-w-[300px]",g),e[6]=g,e[7]=l):l=e[7];let i;e[8]!==j||e[9]!==l?(i=t.jsx("div",{className:l,children:j}),e[8]=j,e[9]=l,e[10]=i):i=e[10];let r;e[11]!==o||e[12]!==i?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o,i]}),e[11]=o,e[12]=i,e[13]=r):r=e[13];let a;e[14]!==d||e[15]!==x?(a=d&&t.jsx("div",{className:N("flex items-center gap-2",x),children:d}),e[14]=d,e[15]=x,e[16]=a):a=e[16];let c;e[17]!==r||e[18]!==a?(c=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,a]}),e[17]=r,e[18]=a,e[19]=c):c=e[19];let m;return e[20]!==n||e[21]!==s||e[22]!==c?(m=t.jsxs("div",{className:n,children:[s,c]}),e[20]=n,e[21]=s,e[22]=c,e[23]=m):m=e[23],m}function _(u){const e=v.c(21),{value:f,onChange:h,placeholder:j,onKeyDown:d,className:p,isSearching:g,disabled:x}=u,n=j===void 0?"Search...":j;let s;e[0]!==p?(s=N("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=s):s=e[1];const o=x?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==o?(l=N("flex items-center gap-2.5 h-12 px-4",o),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==g?(i=g?t.jsx(y,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=g,e[5]=i):i=e[5];let r;e[6]!==h?(r=b=>h(b.target.value),e[6]=h,e[7]=r):r=e[7];let a;e[8]!==x||e[9]!==d||e[10]!==n||e[11]!==r||e[12]!==f?(a=t.jsx(w,{value:f,onChange:r,onKeyDown:d,placeholder:n,disabled:x,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=x,e[9]=d,e[10]=n,e[11]=r,e[12]=f,e[13]=a):a=e[13];let c;e[14]!==l||e[15]!==i||e[16]!==a?(c=t.jsxs("label",{className:l,children:[i,a]}),e[14]=l,e[15]=i,e[16]=a,e[17]=c):c=e[17];let m;return e[18]!==s||e[19]!==c?(m=t.jsx("div",{className:s,children:c}),e[18]=s,e[19]=c,e[20]=m):m=e[20],m}export{_ as C,R as E};
@@ -0,0 +1 @@
1
+ import{c as Ae,j as t,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-CKXRhh0t.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-HJznMrYU.js";import{C as it,E as nt}from"./collection-search-D9lLlfmK.js";import{C as rt}from"./card-BiNPXwY7.js";import{I as ke}from"./integration-icon-CaUI1jG_.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-Bx6HZEO6.js";import{B as Ie}from"./button-BjJbLzI1.js";import{a as Be}from"./Copy01-CFXdI8SF.js";import{i as Re}from"./DotsVertical-CJJQe-sw.js";import{i as Ve}from"./Edit01-vxAH-tv6.js";import{s as Ge}from"./Eye-Cqy0OQfO.js";import{s as Je}from"./Trash01-CNjhe6V_.js";import{E as ze}from"./empty-state-BIKMZA4A.js";import{n as Ee}from"./Inbox01-CWbCHIve.js";import{U as lt,u as at}from"./use-list-state-DEj8YIwi.js";import{B as ct}from"./constants-CQfW12Qo.js";import{A as dt,g as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-9GjsXnzK.js";import{u as jt,e as Ct}from"./use-connection-CU1wdNM8.js";import{u as vt}from"./constants-Bz_J8k2h.js";import{s as bt}from"./Plus-CfD4U7h2.js";import{V as yt}from"./layout-B_vm2aCi.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(rt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(lt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(nt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
@@ -0,0 +1 @@
1
+ import{r as I,c as P,j as s}from"./index-CKXRhh0t.js";import{c as y,B as oe}from"./button-BjJbLzI1.js";import{c as ne,a as ie,D as re,b as le}from"./dropdown-menu-Bx6HZEO6.js";import{n as Y}from"./ArrowDown-Bn9Nw2BD.js";import{i as Z}from"./ArrowUp-BLFAP4Oh.js";import{i as ae}from"./Check-BXz-Aa3Y.js";import{c as ce}from"./Grid01-BGPoEeik.js";import{i as de}from"./List-DZq_3WJK.js";import{c as ue,T as fe,a as me,b as xe}from"./tooltip-C-TvyUPP.js";import{T as pe,a as he,b as X,c as ge,d as be,e as ve}from"./table-BDxbk9kk.js";const ee=({size:C=24,color:e="currentColor",...o})=>I.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},I.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));ee.displayName="Sliders01";const je={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function we(C){const e=P.c(66),{value:o,onValueChange:a,options:t,size:f,fullWidth:d,className:l}=C,m=f===void 0?"sm":f,c=d===void 0?!1:d,b=I.useRef(null),u=I.useRef(null);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={left:0,width:0,opacity:0},e[0]=r):r=e[0];const[i,h]=I.useState(r);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=K=>{if(!K.current)return;const{offsetLeft:te,offsetWidth:se}=K.current;h({left:te,width:se,opacity:1})},e[1]=x):x=e[1];const j=x;let v;e[2]!==t[0].value||e[3]!==o?(v=()=>{const K=o===t[0].value?b:u;j(K)},e[2]=t[0].value,e[3]=o,e[4]=v):v=e[4];let p;e[5]!==t||e[6]!==o?(p=[o,t],e[5]=t,e[6]=o,e[7]=p):p=e[7],I.useEffect(v,p);const n=je[m];let g;e[8]!==l?(g=y("relative flex gap-0 bg-muted rounded-lg",l),e[8]=l,e[9]=g):g=e[9];let w;e[10]!==a||e[11]!==t[0].value?(w=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=w):w=e[12];const N=c?"flex-1 h-12 px-4":n.button,O=!c&&t[0].label?"px-3":"";let z;e[13]!==O||e[14]!==N?(z=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",N,O),e[13]=O,e[14]=N,e[15]=z):z=e[15];const A=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==n.icon||e[17]!==A?(k=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,A),e[16]=n.icon,e[17]=A,e[18]=k):k=e[18];let S;e[19]!==t[0].icon||e[20]!==k?(S=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=S):S=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(T=t[0].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=T):T=e[25];let D;e[26]!==z||e[27]!==S||e[28]!==T||e[29]!==w?(D=s.jsxs("button",{ref:b,type:"button",onClick:w,className:z,children:[S,T]}),e[26]=z,e[27]=S,e[28]=T,e[29]=w,e[30]=D):D=e[30];let M;e[31]!==a||e[32]!==t[1].value?(M=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=M):M=e[33];const q=c?"flex-1 h-12 px-4":n.button,F=!c&&t[1].label?"px-3":"";let R;e[34]!==q||e[35]!==F?(R=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",q,F),e[34]=q,e[35]=F,e[36]=R):R=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let $;e[37]!==n.icon||e[38]!==G?($=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,G),e[37]=n.icon,e[38]=G,e[39]=$):$=e[39];let V;e[40]!==t[1].icon||e[41]!==$?(V=s.jsx("span",{className:$,children:t[1].icon}),e[40]=t[1].icon,e[41]=$,e[42]=V):V=e[42];let _;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(_=t[1].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=_):_=e[46];let L;e[47]!==M||e[48]!==R||e[49]!==V||e[50]!==_?(L=s.jsxs("button",{ref:u,type:"button",onClick:M,className:R,children:[V,_]}),e[47]=M,e[48]=R,e[49]=V,e[50]=_,e[51]=L):L=e[51];const J=c?"h-12":n.button;let E;e[52]!==J?(E=y("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",J),e[52]=J,e[53]=E):E=e[53];const Q=`${i.left}px`,U=`${i.width}px`;let W;e[54]!==i.opacity||e[55]!==Q||e[56]!==U?(W={left:Q,width:U,opacity:i.opacity},e[54]=i.opacity,e[55]=Q,e[56]=U,e[57]=W):W=e[57];let B;e[58]!==E||e[59]!==W?(B=s.jsx("div",{className:E,style:W}),e[58]=E,e[59]=W,e[60]=B):B=e[60];let H;return e[61]!==D||e[62]!==L||e[63]!==B||e[64]!==g?(H=s.jsxs("div",{className:g,children:[D,L,B]}),e[61]=D,e[62]=L,e[63]=B,e[64]=g,e[65]=H):H=e[65],H}function Ve(C){const e=P.c(16),{viewMode:o,onViewModeChange:a,sortKey:t,sortDirection:f,onSort:d,sortOptions:l}=C;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const c=m;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ue,{children:s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(oe,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(ee,{size:16})})})}),s.jsx(xe,{children:"Search filters"})]})}),e[2]=b):b=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={value:"table",icon:s.jsx(de,{})},e[3]=u):u=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[u,{value:"cards",icon:s.jsx(ce,{})}],e[4]=r):r=e[4];let i;e[5]!==a||e[6]!==o?(i=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(we,{value:o,onValueChange:a,fullWidth:!0,options:r})}),e[5]=a,e[6]=o,e[7]=i):i=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==t||e[11]!==c?(h=c.length>0&&d&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),c.map(j=>{const v=t===j.id;return s.jsx(ne,{onClick:()=>d(j.id),className:y("h-8 px-2 py-0 cursor-pointer",v&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[v&&s.jsx(ae,{size:16,className:"text-foreground shrink-0"}),!v&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),v&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-foreground shrink-0"}):s.jsx(Y,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=d,e[9]=f,e[10]=t,e[11]=c,e[12]=h):h=e[12];let x;return e[13]!==i||e[14]!==h?(x=s.jsxs(re,{children:[b,s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,h]})]}),e[13]=i,e[14]=h,e[15]=x):x=e[15],x}function Ne(C){const e=P.c(29),{columns:o,data:a,sortKey:t,sortDirection:f,onSort:d,onRowClick:l,rowClassName:m}=C;let c;e[0]!==f?(c=function(n,g){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:g&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(Y,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=f,e[1]=c):c=e[1];const b=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=function(n,g){let w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===g-1&&(w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),w},e[2]=u):u=e[2];const r=u;let i;if(e[3]!==o||e[4]!==d||e[5]!==b||e[6]!==t){let p;e[8]!==o.length||e[9]!==d||e[10]!==b||e[11]!==t?(p=(n,g)=>{const w=t===n.id;return s.jsx(pe,{className:y(r(g,o.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&d?()=>d(n.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&b(n.id,w)]})},n.id)},e[8]=o.length,e[9]=d,e[10]=b,e[11]=t,e[12]=p):p=e[12],i=o.map(p),e[3]=o,e[4]=d,e[5]=b,e[6]=t,e[7]=i}else i=e[7];let h;e[13]!==i?(h=s.jsx(he,{className:"border-b-0",children:s.jsx(X,{className:"h-9 hover:bg-transparent border-b border-border",children:i})}),e[13]=i,e[14]=h):h=e[14];let x;if(e[15]!==o||e[16]!==a||e[17]!==l||e[18]!==m){let p;e[20]!==o||e[21]!==l||e[22]!==m?(p=(n,g)=>{const w=m?.(n);return s.jsx(X,{"data-row-index":g,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",l?"cursor-pointer":"",w),onClick:l?()=>l(n):void 0,children:o.map(N=>s.jsx(ge,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName,N.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:y(N.wrap?"w-full":"min-w-0 w-full",!N.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:N.render?N.render(n):N.accessor?N.accessor(n):null})},N.id))},g)},e[20]=o,e[21]=l,e[22]=m,e[23]=p):p=e[23],x=a.map(p),e[15]=o,e[16]=a,e[17]=l,e[18]=m,e[19]=x}else x=e[19];let j;e[24]!==x?(j=s.jsx(be,{children:x}),e[24]=x,e[25]=j):j=e[25];let v;return e[26]!==h||e[27]!==j?(v=s.jsxs(ve,{className:"w-full border-collapse",children:[h,j]}),e[26]=h,e[27]=j,e[28]=v):v=e[28],v}function _e(C){const e=P.c(12),{columns:o,data:a,isLoading:t,sortKey:f,sortDirection:d,onSort:l,onRowClick:m,emptyState:c}=C;if(t===void 0?!1:t){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(a.length===0){let r;e[1]!==c?(r=c||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=c,e[2]=r):r=e[2];let i;return e[3]!==r?(i=s.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=i):i=e[4],i}let u;return e[5]!==o||e[6]!==a||e[7]!==m||e[8]!==l||e[9]!==d||e[10]!==f?(u=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ne,{columns:o,data:a,sortKey:f,sortDirection:d,onSort:l,onRowClick:m})}),e[5]=o,e[6]=a,e[7]=m,e[8]=l,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}export{Ve as C,we as V,_e as a};
@@ -1 +1 @@
1
- import{c as x,j as u}from"./index-CMIePc8v.js";import{c as m}from"./button-DDY6hri1.js";import{B as g}from"./badge-EvnzqGBM.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
1
+ import{c as x,j as u}from"./index-CKXRhh0t.js";import{c as m}from"./button-BjJbLzI1.js";import{B as g}from"./badge-CQ9R9pkG.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
@@ -1 +1 @@
1
- import{c as r,u as i,n as u,K as p,d as f,j as n}from"./index-CMIePc8v.js";import{_ as m}from"./index-MmPZuevW.js";import{c as d}from"./button-DDY6hri1.js";import{i as x}from"./SearchMd-B22BWSrE.js";function v(){const a=r.c(4),{locator:e}=i();let t;a[0]!==e?(t=p.members(e),a[0]=e,a[1]=t):t=a[1];let s;return a[2]!==t?(s={queryKey:t,queryFn:g},a[2]=t,a[3]=s):s=a[3],u(s)}function g(){return f.organization.listMembers()}function _(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function j(a){const e=r.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(x,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=d("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==l?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=c):c=e[8],c}function C(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function w(a){const e=r.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function k(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function E(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{$ as C,E as a,k as b,w as c,C as d,_ as e,j as f,v as u};
1
+ import{c as r,u as i,n as u,K as p,d as f,j as n}from"./index-CKXRhh0t.js";import{_ as m}from"./index-nl6bR4T8.js";import{c as d}from"./button-BjJbLzI1.js";import{i as x}from"./SearchMd-rBeGYVN8.js";function v(){const a=r.c(4),{locator:e}=i();let t;a[0]!==e?(t=p.members(e),a[0]=e,a[1]=t):t=a[1];let s;return a[2]!==t?(s={queryKey:t,queryFn:g},a[2]=t,a[3]=s):s=a[3],u(s)}function g(){return f.organization.listMembers()}function _(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function j(a){const e=r.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(x,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=d("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==l?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=c):c=e[8],c}function C(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function w(a){const e=r.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function k(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function E(a){const e=r.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=d("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{$ as C,E as a,k as b,w as c,C as d,_ as e,j as f,v as u};
@@ -1 +1 @@
1
- import{c as T,bv as M,j as e,bw as P,m as q,r as R,t as h,e as O}from"./index-CMIePc8v.js";import{u as A}from"./useQuery-CL8s1AaN.js";import{u as _}from"./useMutation-CTU78J7M.js";import{B as y}from"./button-DDY6hri1.js";import{C as N,a as v}from"./card-CHcjH7V4.js";import{i as L,a as U}from"./mcp-oauth-DtHeHoWJ.js";import{c as C,C as K,a as w}from"./circle-alert-8my-DdYx.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],k=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(k,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(w,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(w,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(w,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
1
+ import{c as T,bS as M,j as e,bT as P,m as q,r as R,t as h,e as O}from"./index-CKXRhh0t.js";import{u as A}from"./useQuery-6KDecjjg.js";import{u as _}from"./useMutation-D2jNlXyR.js";import{B as y}from"./button-BjJbLzI1.js";import{C as N,a as v}from"./card-BiNPXwY7.js";import{i as L,a as U}from"./mcp-oauth-6gipdrl8.js";import{c as C,C as K,a as k}from"./circle-alert-BwBTOPt2.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
@@ -1 +1 @@
1
- import{c as $,j as t}from"./index-CMIePc8v.js";import{C as q}from"./card-CHcjH7V4.js";import{c as N}from"./button-DDY6hri1.js";import{I as B}from"./integration-icon-DeiJ75EP.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
1
+ import{c as $,j as t}from"./index-CKXRhh0t.js";import{C as q}from"./card-BiNPXwY7.js";import{c as N}from"./button-BjJbLzI1.js";import{I as B}from"./integration-icon-CaUI1jG_.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};