decocms 3.95.1 → 3.95.3

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 (216) hide show
  1. package/dist/client/assets/{AlertCircle-BEPdbmtR.js → AlertCircle-B2rGiQLW.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BS6mW4Fn.js → ArrowUpRight-DYz-mNwT.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-BJUS1y5Z.js → CheckCircle-cLxWQcst.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-bgoAIVAO.js → ChevronDown-DajKJ50G.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-CwMWPt0X.js → ChevronLeft-CB4idmP8.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-eb8mpO1j.js → ChevronRight-DwQZMwjZ.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cn2ufNfM.js → ChevronUp-DFVBw1Q0.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CDy4zbAg.js → DotsVertical-DXVlN6Ej.js} +1 -1
  9. package/dist/client/assets/{Eye-CrDQTMzM.js → Eye-XlApkfqq.js} +1 -1
  10. package/dist/client/assets/{FilterLines-BBfGLA4Z.js → FilterLines-yICREcB1.js} +1 -1
  11. package/dist/client/assets/{Globe01-Cem06PV5.js → Globe01-BsZz_aM-.js} +1 -1
  12. package/dist/client/assets/{Globe04-Fn7foOiF.js → Globe04-2qahfQsK.js} +1 -1
  13. package/dist/client/assets/{HardDrive-Czktxo8Y.js → HardDrive-BOnuPdqR.js} +1 -1
  14. package/dist/client/assets/{Key01-B8QK_wp0.js → Key01-EWZLh6Dg.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-CoAG46N9.js → LayoutLeft-B0kudz4E.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-gpOkeAUR.js → LinkExternal01-B40yAEYp.js} +1 -1
  17. package/dist/client/assets/{Monitor01-BGqRnga1.js → Monitor01-CEDnJUQX.js} +1 -1
  18. package/dist/client/assets/{Palette-BFhQLhTB.js → Palette-DcfG5x3C.js} +1 -1
  19. package/dist/client/assets/{Play-7xVDSEjq.js → Play-BqHmN8yQ.js} +1 -1
  20. package/dist/client/assets/{Plus-DxkHSBU7.js → Plus-FHaDaCOZ.js} +1 -1
  21. package/dist/client/assets/{SearchMd-CWhaU1QK.js → SearchMd-CtVQE5jm.js} +1 -1
  22. package/dist/client/assets/{Settings02-DQwifSPL.js → Settings02-C2eeV5U-.js} +1 -1
  23. package/dist/client/assets/{Shield01-DOjU0b_5.js → Shield01-CVbeDgIl.js} +1 -1
  24. package/dist/client/assets/{Star01-DvnAH6PL.js → Star01-DNr09MAY.js} +1 -1
  25. package/dist/client/assets/{Stars01-CCa_fT55.js → Stars01-DUYEhBcS.js} +1 -1
  26. package/dist/client/assets/{Stars02-Bmmz6ajf.js → Stars02-nM_Vn7Vv.js} +1 -1
  27. package/dist/client/assets/{Sun-DvZb7OIK.js → Sun-BmtS6iHG.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BLNw2FEe.js → SwitchHorizontal01-BTdkOtmC.js} +1 -1
  29. package/dist/client/assets/{Tool01-JaghzvsW.js → Tool01-DdMkISER.js} +1 -1
  30. package/dist/client/assets/{Trash01-DleGAEnI.js → Trash01-DK9RS17_.js} +1 -1
  31. package/dist/client/assets/{Upload01-CrgdbwqF.js → Upload01-cLKObBlS.js} +1 -1
  32. package/dist/client/assets/{User01-BkvGzczA.js → User01-CWKoITic.js} +1 -1
  33. package/dist/client/assets/{Users01-0meLmy_5.js → Users01-BCyCe1vl.js} +1 -1
  34. package/dist/client/assets/{Users03-BJg3xSbq.js → Users03-FbNBHUKo.js} +1 -1
  35. package/dist/client/assets/{X-DKKGRpVm.js → X-B5LAnKcO.js} +1 -1
  36. package/dist/client/assets/{XCircle-B-PjaeEJ.js → XCircle-CJScj78U.js} +1 -1
  37. package/dist/client/assets/{XClose-YNTj8XAM.js → XClose-BDmZVvYt.js} +1 -1
  38. package/dist/client/assets/{Zap-BxYohw6G.js → Zap-S88eHWD4.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-tzfjp6uC.js → ZapSquare-CwCpnU0T.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-D0Lpxxlk.js → ZoomOut-CiTyIS5u.js} +1 -1
  41. package/dist/client/assets/{access-gate-tld0-v8U.js → access-gate-ZKnrNl-k.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-BTmT7GM6.js → add-section-modal-BENIooAl.js} +1 -1
  43. package/dist/client/assets/{agent-icon-DSDm4_R8.js → agent-icon-CpgVmlKA.js} +1 -1
  44. package/dist/client/assets/{agents-list-DXodHSIu.js → agents-list-B6yzYfWy.js} +1 -1
  45. package/dist/client/assets/{ai-providers-C9mB3PRf.js → ai-providers-DVlFDhhC.js} +1 -1
  46. package/dist/client/assets/{alert-BpjQL41T.js → alert-Dtc0cxh7.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-DYO8zz2S.js → alert-dialog-F25p9Qd4.js} +1 -1
  48. package/dist/client/assets/{app-editor-DiAJndmt.js → app-editor-BuvCOPjS.js} +1 -1
  49. package/dist/client/assets/{auth-CuG56QXb.js → auth-b_6YQ5M-.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-BvI_YS5H.js → auth-catchall-B1-hfgkP.js} +1 -1
  51. package/dist/client/assets/{auth-entry-DgAf9fM8.js → auth-entry-BTBVj0g8.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-CVoq6mzQ.js → auth-split-layout-BgGqHUJx.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-CkLM20vf.js → authenticate-and-persist-oauth-KmxgbBFx.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-BClpQKmz.js → automation-list-row-kN98yjTo.js} +1 -1
  55. package/dist/client/assets/{automation-runs-BNNlJVsr.js → automation-runs-BtxudtXE.js} +1 -1
  56. package/dist/client/assets/{automations-CJUumeh6.js → automations-DqIZRT7Z.js} +1 -1
  57. package/dist/client/assets/{avatar-MyHJNCYy.js → avatar-D--lTQS0.js} +1 -1
  58. package/dist/client/assets/{badge-DvMADcdY.js → badge-BMv5o_K8.js} +1 -1
  59. package/dist/client/assets/block-document-EE_G8dwY.js +3 -0
  60. package/dist/client/assets/{brand-context-EPm_yO9k.js → brand-context-DhNrXwwF.js} +1 -1
  61. package/dist/client/assets/{buckets-DPphHhzM.js → buckets-CKUmU8cF.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-zH8kI02n.js → capability-load-error-yDY4tChx.js} +1 -1
  63. package/dist/client/assets/{card-B3_dM_vK.js → card-DKEaJmjc.js} +1 -1
  64. package/dist/client/assets/category-editor-DEU1yROu.js +1 -0
  65. package/dist/client/assets/{chat-context-CttLt0Cf.js → chat-context-D3ExOe2Y.js} +1 -1
  66. package/dist/client/assets/{checkbox-y7afwzpt.js → checkbox-BNJLgZxx.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-fhlgA9Kp.js → cli-auth-success-Bgd-7Amv.js} +1 -1
  68. package/dist/client/assets/{collection-detail-Dn8jwntA.js → collection-detail-BebXxPRt.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-BUPch7dF.js → collection-display-button-o0ZRKN00.js} +1 -1
  70. package/dist/client/assets/{collection-search-ebScmXLd.js → collection-search-D2ns8QJ2.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-DIbnLTfV.js → collection-tabs-DGHCcD9t.js} +1 -1
  72. package/dist/client/assets/{command-z_GRZs6B.js → command-BxU9CB6T.js} +1 -1
  73. package/dist/client/assets/commerce-onboarding-DZ_9ItcO.js +1 -0
  74. package/dist/client/assets/{connect-desktop-dialog-MjsVWZzs.js → connect-desktop-dialog-B3nMoofq.js} +1 -1
  75. package/dist/client/assets/{connection-card-nxe_fGFe.js → connection-card-D7NkQFKT.js} +1 -1
  76. package/dist/client/assets/{connection-detail-_gGNrVNv.js → connection-detail-8h-8Pe2H.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers--89iqTDu.js → connection-form-helpers-DDvLA1rL.js} +1 -1
  78. package/dist/client/assets/{connections-DkbDsQ3j.js → connections-sRvBRapv.js} +1 -1
  79. package/dist/client/assets/{context-menu-CZQzKnps.js → context-menu-Cv2jDAnH.js} +1 -1
  80. package/dist/client/assets/{decopilot-vmLbIS1G.js → decopilot-B_42o1Ie.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-Cm2VJM0Q.js → decopilot-sse-pool-B7XaA24C.js} +1 -1
  82. package/dist/client/assets/{dialog-DcJxJAi_.js → dialog-BzVd1N_n.js} +1 -1
  83. package/dist/client/assets/{domain-settings-nLSBCo2B.js → domain-settings-CGOuE-F4.js} +1 -1
  84. package/dist/client/assets/{drawer-nZZcFse5.js → drawer-BU5LE1S-.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-BNhl-rpz.js → dropdown-menu-Cu02JhqK.js} +1 -1
  86. package/dist/client/assets/{empty-state--8jeF922.js → empty-state-CycaKPME.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-DAqoFNbM.js → extract-connection-data-Yinpm7Wp.js} +1 -1
  88. package/dist/client/assets/{file-explorer-DrZsMJcF.js → file-explorer-BmS8vCxm.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-Bnsj6yPL.js → file-type-icon-BgIATQF6.js} +1 -1
  90. package/dist/client/assets/{files-Dw907u6B.js → files-D2hBuVbg.js} +1 -1
  91. package/dist/client/assets/{form-D47BcVvX.js → form-O3jmDZ8D.js} +1 -1
  92. package/dist/client/assets/{general-CLTCqGrO.js → general-C7_l1b86.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-B9FuAbX8.js → github-repo-picker-pUxjtHSB.js} +1 -1
  94. package/dist/client/assets/{hooks-Dzur-KyR.js → hooks-CNaD44fD.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-Dd3Chr97.js → import-from-deco-dialog-Dtdwv7Ix.js} +1 -1
  96. package/dist/client/assets/{index-wEdpz7sP.js → index-BN_hzDkU.js} +1 -1
  97. package/dist/client/assets/{index-CbeSsWmm.js → index-BXTj7zt6.js} +1 -1
  98. package/dist/client/assets/{index-C2KjUHnF.js → index-BlQHqLEe.js} +1 -1
  99. package/dist/client/assets/{index-DkhUAEGE.js → index-BvFbU3H7.js} +1 -1
  100. package/dist/client/assets/{index-vz4XYiJu.js → index-C-fgfOOa.js} +1 -1
  101. package/dist/client/assets/{index-Wa0GAZ_S.js → index-D0-4shy1.js} +1 -1
  102. package/dist/client/assets/{index-DfLjPUzt.js → index-D4uJ-4rf.js} +1 -1
  103. package/dist/client/assets/{index-DTPuCfiR.js → index-DTyFHoVS.js} +1 -1
  104. package/dist/client/assets/{index-D73fp--P.js → index-Dfdfr_wO.js} +1 -1
  105. package/dist/client/assets/{index-oij0WOOR.js → index-Dk_a1p_f.js} +1 -1
  106. package/dist/client/assets/{index-D6MGtFww.js → index-Dz6axdna.js} +1 -1
  107. package/dist/client/assets/{index-Ci6JsPP0.js → index-VgUmzAVY.js} +1 -1
  108. package/dist/client/assets/{index-r-Yo5XKn.js → index-g9kd8YLC.js} +5 -5
  109. package/dist/client/assets/{index-CBdIFd2T.js → index-i4yKOslE.js} +3 -3
  110. package/dist/client/assets/{index-redirect-BoeXhxpg.js → index-redirect-zjPjZ7DB.js} +1 -1
  111. package/dist/client/assets/{input-CDeFHzqo.js → input-DYWiBUd4.js} +1 -1
  112. package/dist/client/assets/{integration-icon-Bq_7i_P9.js → integration-icon-DZfYl8h3.js} +1 -1
  113. package/dist/client/assets/{label-Ddfd9BsS.js → label-C5DnCEJJ.js} +1 -1
  114. package/dist/client/assets/{login-DCDQN4cG.js → login-ZdxBhxLk.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-OWY8XmPF.js → mcp-oauth-Cn6Swd6f.js} +1 -1
  116. package/dist/client/assets/{members-he6lEIt7.js → members-d7WS2vVJ.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-0k_a6Xff.js → monaco-editor-DdEcYsFE.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-D0aPIIhF.js → monitoring-stats-row-C_007qlV.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-67WujYXi.js → oauth-callback-BYQv6ZU1.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-BHW5obof.js → oauth-callback-ai-provider-CVH53bYc.js} +1 -1
  121. package/dist/client/assets/{onboarding-BO1k51tX.js → onboarding-BzFsfWa7.js} +1 -1
  122. package/dist/client/assets/{org-install-BPVUbolV.js → org-install-8vVjx4xt.js} +1 -1
  123. package/dist/client/assets/{org-layout-kLaztwHw.js → org-layout-B4M0_2fh.js} +1 -1
  124. package/dist/client/assets/{organization-choice-Ct3tNlRc.js → organization-choice-DSrJjFv2.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-X-ofXNen.js → page-seo-form-DOcO58Bb.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-D5ReG0ZJ.js +1 -0
  127. package/dist/client/assets/{popover-BYOmDMXo.js → popover-Cqn28LcZ.js} +1 -1
  128. package/dist/client/assets/post-editor-C7Z6Li9d.js +1 -0
  129. package/dist/client/assets/{preview-dialog-DmA3o1aj.js → preview-dialog-DVVKqkqH.js} +1 -1
  130. package/dist/client/assets/{primitives-CxkyOXrN.js → primitives-BBY7iXPz.js} +1 -1
  131. package/dist/client/assets/{profile-B-0sjcty.js → profile-BNQWuWuJ.js} +1 -1
  132. package/dist/client/assets/project-app-view-D-yuZq0b.js +1 -0
  133. package/dist/client/assets/record-editor-3o9ZHekL.js +1 -0
  134. package/dist/client/assets/registry-ClFi1QyC.js +2 -0
  135. package/dist/client/assets/{registry-layout-BkQV-nAO.js → registry-layout-WUDoPZno.js} +1 -1
  136. package/dist/client/assets/{require-capability-Caxc5D0o.js → require-capability-DBSpClLq.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-DojzDU3A.js → required-auth-layout-DBSHkTvE.js} +1 -1
  138. package/dist/client/assets/{reset-password-DFMdIRco.js → reset-password-C3CAd88p.js} +1 -1
  139. package/dist/client/assets/{roles-C25Zerfg.js → roles-D-oc3H0Q.js} +1 -1
  140. package/dist/client/assets/{save-status-CRx31DkO.js → save-status-DiiQFyNz.js} +1 -1
  141. package/dist/client/assets/{scroll-area-B-6QW0z3.js → scroll-area-BJwafxli.js} +1 -1
  142. package/dist/client/assets/{search-input-BZXdiIic.js → search-input-BXoNPqlW.js} +1 -1
  143. package/dist/client/assets/{secrets-DJg6mjVY.js → secrets-CBSRFkkP.js} +1 -1
  144. package/dist/client/assets/{sections-editor-fz-LURO_.js → sections-editor-CVrcpUD7.js} +1 -1
  145. package/dist/client/assets/{select-wlg7-x-r.js → select-BURfxZgH.js} +1 -1
  146. package/dist/client/assets/{select-model-DHGzUXZO.js → select-model-C5-GKj9v.js} +1 -1
  147. package/dist/client/assets/{seo-editor-BLkyAbSL.js → seo-editor-DhKev2vA.js} +1 -1
  148. package/dist/client/assets/{settings-layout-ujmcWDoJ.js → settings-layout-C_UkjADM.js} +1 -1
  149. package/dist/client/assets/{settings-section-D-1HhYwL.js → settings-section-4OTvULu2.js} +1 -1
  150. package/dist/client/assets/{sheet-Brr_wRug.js → sheet-kBH5wWuh.js} +1 -1
  151. package/dist/client/assets/{shell-controls-CSxz6NyD.js → shell-controls-DO88OaHx.js} +1 -1
  152. package/dist/client/assets/{shell-layout-DCJg6bjd.js → shell-layout-C9QfcYwS.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-CLerIems.js → shell-route-loading-BGNAbcrB.js} +1 -1
  154. package/dist/client/assets/{sidebar-CeqXjcTA.js → sidebar-CUYXItjm.js} +1 -1
  155. package/dist/client/assets/{skeleton-Cup2ZZxu.js → skeleton-CDZIM9IX.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-D2e7Jj3u.js → sortable.esm-D-2-mhpi.js} +1 -1
  157. package/dist/client/assets/{sso-QUkSHeXI.js → sso-DyaVCCbh.js} +1 -1
  158. package/dist/client/assets/{store-BEvET5wU.js → store-Ctd5X7Cj.js} +1 -1
  159. package/dist/client/assets/store-registry-Ct-rpPhS.js +2 -0
  160. package/dist/client/assets/{studio-tools-BEcztvKx.js → studio-tools-BIon8cDY.js} +1 -1
  161. package/dist/client/assets/{switch-DEDpUse5.js → switch-Cfy-9sgc.js} +1 -1
  162. package/dist/client/assets/{table-BrP5LmRN.js → table-B9Ser0hN.js} +1 -1
  163. package/dist/client/assets/{tabs-BUuBEReQ.js → tabs-DBW6pdRK.js} +1 -1
  164. package/dist/client/assets/{task-status-DodJV8OX.js → task-status-BEL_tB4l.js} +1 -1
  165. package/dist/client/assets/{textarea-B4kdBrvw.js → textarea-DZCmuZgN.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DmbGz8_A.js → toggle-group-BAuAoo_h.js} +1 -1
  167. package/dist/client/assets/{toolbar-Dm29ty5E.js → toolbar-C3iNf-7g.js} +1 -1
  168. package/dist/client/assets/{tooltip-B2NfMEjt.js → tooltip-CXJRsrjZ.js} +1 -1
  169. package/dist/client/assets/{types-BPJE6zoV.js → types-_9kCqfLO.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-Jwe69ux4.js → use-ai-providers-CYpO6V5w.js} +1 -1
  171. package/dist/client/assets/{use-automations-Gkn8RP-3.js → use-automations-CCFTv539.js} +1 -1
  172. package/dist/client/assets/{use-capability--KadQKtL.js → use-capability-CdTgUecU.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-BG-OJO4j.js → use-clock-tick-o7ys6RNk.js} +1 -1
  174. package/dist/client/assets/{use-collections-CvHg4Tgh.js → use-collections-DXvOdsjP.js} +1 -1
  175. package/dist/client/assets/{use-connection-DuJRGUWh.js → use-connection-DIyKq7Ja.js} +1 -1
  176. package/dist/client/assets/{use-copy-CHpqZEqt.js → use-copy-BGh_3bgs.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BXMkfnYg.js → use-create-virtual-mcp-JuYxDLVO.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BsG7vEt9.js → use-debounced-autosave-xqhSnikO.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-6kNBwEXr.js → use-delete-connection-DhRatED-.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-BLM5nNaw.js → use-file-configs-C4r9SONA.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-CpbZLz3x.js → use-infinite-scroll-MldU11Y_.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-qQqcKn0r.js → use-join-requests-CcFOr0Kc.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-RYfuXh7q.js → use-mcp-client-Cf5O31zc.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-C8RA6rc6.js → use-mcp-prompts-0LKFoXra.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-CnL8Vpqh.js → use-mcp-tools-BpKUIA5V.js} +1 -1
  186. package/dist/client/assets/{use-members-DNuh7IUz.js → use-members-Cleyn3sD.js} +1 -1
  187. package/dist/client/assets/{use-mobile-SzkwxURu.js → use-mobile-kRXKzOd9.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-CoJMdQyb.js → use-navigate-to-agent-D5T4j8BI.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-L7NgHVqa.js → use-org-auth-client-DbFVvoh8.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-DC-fY_KL.js → use-org-sso-rHZ6AeZh.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-CsnMUlNm.js → use-organization-roles-DDTawLMo.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-DxbR8LZH.js → use-organization-settings-DR6y14Ln.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-DR5wKJd8.js → use-registry-connections-B75n3CLT.js} +1 -1
  194. package/dist/client/assets/{use-secrets-BaV_ft84.js → use-secrets-D9jHoh1C.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-KIIrefPR.js → use-status-sounds-DRNyv2My.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-B5u2xwPR.js → use-view-mode-BWd0QgE9.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-DL1NGXij.js → use-virtual-mcp-BrKgTMoD.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-D6UIz-QI.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-BR1ud50u.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-CGnLidv9.js → useSuspenseQueries-DTyz6kxM.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-BgbhdQtJ.js → variant-calendar-VLF4t49m.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-C1VjMwIi.js → view-mode-toggle-BSFLVh95.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +1 -1
  206. package/dist/client/assets/block-document-BMU8lc4f.js +0 -3
  207. package/dist/client/assets/category-editor-BBi_DLZH.js +0 -1
  208. package/dist/client/assets/commerce-onboarding-DltQ8ozv.js +0 -1
  209. package/dist/client/assets/page-seo-sheet-fW0TK7Fo.js +0 -1
  210. package/dist/client/assets/post-editor-Bk1HlIe6.js +0 -1
  211. package/dist/client/assets/project-app-view-ahKBqEeh.js +0 -1
  212. package/dist/client/assets/record-editor-BeuuIvqu.js +0 -1
  213. package/dist/client/assets/registry-ijfRRvlE.js +0 -2
  214. package/dist/client/assets/store-registry-9KgGiH3c.js +0 -2
  215. package/dist/client/assets/useInfiniteQuery-CGWj_d7Q.js +0 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-D9GeBm8m.js +0 -1
@@ -1 +1 @@
1
- import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-CBdIFd2T.js";import{E as Ee}from"./empty-state--8jeF922.js";import{u as et,a as Ae}from"./use-collections-CvHg4Tgh.js";import{u as ce}from"./use-mcp-client-RYfuXh7q.js";import{F as ne,a as tt,b as de,d as me}from"./form-D47BcVvX.js";import{I as ue}from"./input-CDeFHzqo.js";import{T as re}from"./textarea-B4kdBrvw.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-vz4XYiJu.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-DSDm4_R8.js";import{g as ut,M as xt,a as Ne}from"./types-BPJE6zoV.js";import{A as pt,a as ft,b as ht}from"./alert-BpjQL41T.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-wlg7-x-r.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-B2NfMEjt.js";import{i as jt}from"./AlertCircle-BEPdbmtR.js";import{s as bt}from"./Stars02-Bmmz6ajf.js";import{a as Nt}from"./Eye-CrDQTMzM.js";import{i as vt}from"./Play-7xVDSEjq.js";import{i as St}from"./ChevronRight-eb8mpO1j.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-oij0WOOR.js";import{a as Oe,u as Re}from"./use-connection-DuJRGUWh.js";import{a as It}from"./use-mcp-tools-CnL8Vpqh.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Bq_7i_P9.js";import{f as Tt,h as Pt}from"./chat-context-CttLt0Cf.js";import{b as kt}from"./shell-layout-DCJg6bjd.js";import{M as Et}from"./monaco-editor-0k_a6Xff.js";import{n as At}from"./XCircle-B-PjaeEJ.js";import"./auth-CuG56QXb.js";import"./label-Ddfd9BsS.js";import"./index-Ci6JsPP0.js";import"./sidebar-CeqXjcTA.js";import"./LayoutLeft-CoAG46N9.js";import"./use-mobile-SzkwxURu.js";import"./sheet-Brr_wRug.js";import"./X-DKKGRpVm.js";import"./ZoomOut-D0Lpxxlk.js";import"./Key01-B8QK_wp0.js";import"./extract-connection-data-DAqoFNbM.js";import"./use-registry-connections-DR5wKJd8.js";import"./use-organization-settings-DxbR8LZH.js";import"./studio-tools-BEcztvKx.js";import"./Plus-DxkHSBU7.js";import"./index-D73fp--P.js";import"./index-DfLjPUzt.js";import"./popover-BYOmDMXo.js";import"./use-virtual-mcp-DL1NGXij.js";import"./ChevronUp-Cn2ufNfM.js";import"./SearchMd-CWhaU1QK.js";import"./Users03-BJg3xSbq.js";import"./use-create-virtual-mcp-BXMkfnYg.js";import"./use-navigate-to-agent-CoJMdQyb.js";import"./Tool01-JaghzvsW.js";import"./SwitchHorizontal01-BLNw2FEe.js";import"./Settings02-DQwifSPL.js";import"./ArrowUpRight-BS6mW4Fn.js";import"./ZapSquare-tzfjp6uC.js";import"./CheckCircle-BJUS1y5Z.js";import"./ChevronDown-bgoAIVAO.js";import"./ChevronLeft-CwMWPt0X.js";import"./DotsVertical-CDy4zbAg.js";import"./Globe01-Cem06PV5.js";import"./FilterLines-BBfGLA4Z.js";import"./Star01-DvnAH6PL.js";import"./Globe04-Fn7foOiF.js";import"./HardDrive-Czktxo8Y.js";import"./LinkExternal01-gpOkeAUR.js";import"./Monitor01-BGqRnga1.js";import"./Sun-DvZb7OIK.js";import"./Palette-BFhQLhTB.js";import"./Shield01-DOjU0b_5.js";import"./Stars01-CCa_fT55.js";import"./Trash01-DleGAEnI.js";import"./Upload01-CrgdbwqF.js";import"./User01-BkvGzczA.js";import"./Users01-0meLmy_5.js";import"./XClose-YNTj8XAM.js";import"./Zap-BxYohw6G.js";import"./mcp-oauth-OWY8XmPF.js";import"./badge-DvMADcdY.js";import"./hooks-Dzur-KyR.js";import"./decopilot-sse-pool-Cm2VJM0Q.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Jwe69ux4.js";import"./tab-id-BptcWVWa.js";import"./avatar-MyHJNCYy.js";import"./dialog-DcJxJAi_.js";import"./required-auth-layout-DojzDU3A.js";import"./use-org-sso-DC-fY_KL.js";import"./index-C2KjUHnF.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.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:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...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 Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...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 zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{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(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
1
+ import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-i4yKOslE.js";import{E as Ee}from"./empty-state-CycaKPME.js";import{u as et,a as Ae}from"./use-collections-DXvOdsjP.js";import{u as ce}from"./use-mcp-client-Cf5O31zc.js";import{F as ne,a as tt,b as de,d as me}from"./form-O3jmDZ8D.js";import{I as ue}from"./input-DYWiBUd4.js";import{T as re}from"./textarea-DZCmuZgN.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-C-fgfOOa.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-CpgVmlKA.js";import{g as ut,M as xt,a as Ne}from"./types-_9kCqfLO.js";import{A as pt,a as ft,b as ht}from"./alert-Dtc0cxh7.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-BURfxZgH.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-CXJRsrjZ.js";import{i as jt}from"./AlertCircle-B2rGiQLW.js";import{s as bt}from"./Stars02-nM_Vn7Vv.js";import{a as Nt}from"./Eye-XlApkfqq.js";import{i as vt}from"./Play-BqHmN8yQ.js";import{i as St}from"./ChevronRight-DwQZMwjZ.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-Dk_a1p_f.js";import{a as Oe,u as Re}from"./use-connection-DIyKq7Ja.js";import{a as It}from"./use-mcp-tools-BpKUIA5V.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-DZfYl8h3.js";import{f as Tt,h as Pt}from"./chat-context-D3ExOe2Y.js";import{b as kt}from"./shell-layout-C9QfcYwS.js";import{M as Et}from"./monaco-editor-DdEcYsFE.js";import{n as At}from"./XCircle-CJScj78U.js";import"./auth-b_6YQ5M-.js";import"./label-C5DnCEJJ.js";import"./index-VgUmzAVY.js";import"./sidebar-CUYXItjm.js";import"./LayoutLeft-B0kudz4E.js";import"./use-mobile-kRXKzOd9.js";import"./sheet-kBH5wWuh.js";import"./X-B5LAnKcO.js";import"./ZoomOut-CiTyIS5u.js";import"./Key01-EWZLh6Dg.js";import"./extract-connection-data-Yinpm7Wp.js";import"./use-registry-connections-B75n3CLT.js";import"./use-organization-settings-DR6y14Ln.js";import"./studio-tools-BIon8cDY.js";import"./Plus-FHaDaCOZ.js";import"./index-Dfdfr_wO.js";import"./index-D4uJ-4rf.js";import"./popover-Cqn28LcZ.js";import"./use-virtual-mcp-BrKgTMoD.js";import"./ChevronUp-DFVBw1Q0.js";import"./SearchMd-CtVQE5jm.js";import"./Users03-FbNBHUKo.js";import"./use-create-virtual-mcp-JuYxDLVO.js";import"./use-navigate-to-agent-D5T4j8BI.js";import"./Tool01-DdMkISER.js";import"./SwitchHorizontal01-BTdkOtmC.js";import"./Settings02-C2eeV5U-.js";import"./ArrowUpRight-DYz-mNwT.js";import"./ZapSquare-CwCpnU0T.js";import"./CheckCircle-cLxWQcst.js";import"./ChevronDown-DajKJ50G.js";import"./ChevronLeft-CB4idmP8.js";import"./DotsVertical-DXVlN6Ej.js";import"./Globe01-BsZz_aM-.js";import"./FilterLines-yICREcB1.js";import"./Star01-DNr09MAY.js";import"./Globe04-2qahfQsK.js";import"./HardDrive-BOnuPdqR.js";import"./LinkExternal01-B40yAEYp.js";import"./Monitor01-CEDnJUQX.js";import"./Sun-BmtS6iHG.js";import"./Palette-DcfG5x3C.js";import"./Shield01-CVbeDgIl.js";import"./Stars01-DUYEhBcS.js";import"./Trash01-DK9RS17_.js";import"./Upload01-cLKObBlS.js";import"./User01-CWKoITic.js";import"./Users01-BCyCe1vl.js";import"./XClose-BDmZVvYt.js";import"./Zap-S88eHWD4.js";import"./mcp-oauth-Cn6Swd6f.js";import"./badge-BMv5o_K8.js";import"./hooks-CNaD44fD.js";import"./decopilot-sse-pool-B7XaA24C.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CYpO6V5w.js";import"./tab-id-BptcWVWa.js";import"./avatar-D--lTQS0.js";import"./dialog-BzVd1N_n.js";import"./required-auth-layout-DBSHkTvE.js";import"./use-org-sso-rHZ6AeZh.js";import"./index-BlQHqLEe.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.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:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...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 Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...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 zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{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(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-CBdIFd2T.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-BNhl-rpz.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-BLNw2FEe.js";import{i as S}from"./ChevronUp-Cn2ufNfM.js";import{a as I,b as K,c as P,T as W}from"./tooltip-B2NfMEjt.js";import{V as q}from"./view-mode-toggle-C1VjMwIi.js";import{B as G}from"./badge-DvMADcdY.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",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"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-i4yKOslE.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-Cu02JhqK.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-BTdkOtmC.js";import{i as S}from"./ChevronUp-DFVBw1Q0.js";import{a as I,b as K,c as P,T as W}from"./tooltip-CXJRsrjZ.js";import{V as q}from"./view-mode-toggle-BSFLVh95.js";import{B as G}from"./badge-BMv5o_K8.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",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"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-CBdIFd2T.js";import{i as C}from"./SearchMd-CWhaU1QK.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-i4yKOslE.js";import{i as C}from"./SearchMd-CtVQE5jm.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-CBdIFd2T.js";import{B as g}from"./badge-DvMADcdY.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("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]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("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&&m.jsx(g,{variant:"secondary",className:u("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]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,l as u,j as m}from"./index-i4yKOslE.js";import{B as g}from"./badge-BMv5o_K8.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("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]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("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&&m.jsx(g,{variant:"secondary",className:u("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]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as d,l as i,j as n}from"./index-CBdIFd2T.js";import{_ as m}from"./index-DfLjPUzt.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-DcJxJAi_.js";import{i as y}from"./SearchMd-CWhaU1QK.js";function C(a){const e=d.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=i("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 S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.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(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("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 r;return e[6]!==s||e[7]!==l?(r=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]=r):r=e[8],r}function G(a){const e=d.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=i("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 L(a){const e=d.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 R(a){const e=d.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=i("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 B(a){const e=d.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=i("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 H(a){const e=d.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=i("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{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
1
+ import{c as d,l as i,j as n}from"./index-i4yKOslE.js";import{_ as m}from"./index-D4uJ-4rf.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-BzVd1N_n.js";import{i as y}from"./SearchMd-CtVQE5jm.js";function C(a){const e=d.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=i("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 S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.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(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("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 r;return e[6]!==s||e[7]!==l?(r=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]=r):r=e[8],r}function G(a){const e=d.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=i("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 L(a){const e=d.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 R(a){const e=d.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=i("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 B(a){const e=d.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=i("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 H(a){const e=d.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=i("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{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
@@ -0,0 +1 @@
1
+ import{c as I,r as D,l as Z,j as n,B as H,m as mt,d as ke,K as W,o as He,s as ue,n as Be,p as Ge,i as ut,k as ft,q as me,Q as pt,E as gt,a as Oe,u as ht,b as xt,v as kt,w as yt,L as Ot}from"./index-i4yKOslE.js";import{A as Ut}from"./auth-entry-BTBVj0g8.js";import{A as At}from"./auth-split-layout-BgGqHUJx.js";import{O as at}from"./organization-choice-DSrJjFv2.js";import{f as Rt}from"./tab-id-BptcWVWa.js";import{I as Ue}from"./input-DYWiBUd4.js";import{u as Ae,W as vt,S as bt,g as Pt,C as $t}from"./use-mcp-client-Cf5O31zc.js";import{i as jt}from"./XCircle-CJScj78U.js";import{I as Ct}from"./integration-icon-DZfYl8h3.js";import{D as Qe,a as Lt,b as zt,c as Dt,d as Kt,e as Mt}from"./dialog-BzVd1N_n.js";import{T as Ft,a as qt,b as Vt}from"./tooltip-CXJRsrjZ.js";import{i as We}from"./CheckCircle-cLxWQcst.js";import{i as Ht}from"./ZoomOut-CiTyIS5u.js";import{g as Bt,c as Gt,e as Qt}from"./extract-connection-data-Yinpm7Wp.js";import{F as fe,a as Ye,b as pe,c as Ke,d as ge,e as he}from"./form-O3jmDZ8D.js";import{i as Wt}from"./ChevronUp-DFVBw1Q0.js";import{s as Yt,a as Jt}from"./Eye-XlApkfqq.js";import{i as Zt}from"./Settings02-C2eeV5U-.js";import{i as Xt}from"./agent-icon-CpgVmlKA.js";import{u as en}from"./useSuspenseQueries-DTyz6kxM.js";import{a as tn}from"./authenticate-and-persist-oauth-KmxgbBFx.js";import{i as St}from"./ArrowUpRight-DYz-mNwT.js";import{s as Nt}from"./User01-CWKoITic.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-D--lTQS0.js";import"./auth-b_6YQ5M-.js";import"./X-B5LAnKcO.js";import"./label-C5DnCEJJ.js";import"./AlertCircle-B2rGiQLW.js";import"./Tool01-DdMkISER.js";import"./SwitchHorizontal01-BTdkOtmC.js";import"./ZapSquare-CwCpnU0T.js";import"./Users03-FbNBHUKo.js";import"./ChevronDown-DajKJ50G.js";import"./ChevronLeft-CB4idmP8.js";import"./ChevronRight-DwQZMwjZ.js";import"./DotsVertical-DXVlN6Ej.js";import"./Stars02-nM_Vn7Vv.js";import"./Globe01-BsZz_aM-.js";import"./FilterLines-yICREcB1.js";import"./Star01-DNr09MAY.js";import"./Globe04-2qahfQsK.js";import"./HardDrive-BOnuPdqR.js";import"./Key01-EWZLh6Dg.js";import"./LayoutLeft-B0kudz4E.js";import"./LinkExternal01-B40yAEYp.js";import"./Monitor01-CEDnJUQX.js";import"./Sun-BmtS6iHG.js";import"./Palette-DcfG5x3C.js";import"./Play-BqHmN8yQ.js";import"./Plus-FHaDaCOZ.js";import"./SearchMd-CtVQE5jm.js";import"./Shield01-CVbeDgIl.js";import"./Stars01-DUYEhBcS.js";import"./Trash01-DK9RS17_.js";import"./Upload01-cLKObBlS.js";import"./Users01-BCyCe1vl.js";import"./XClose-BDmZVvYt.js";import"./Zap-S88eHWD4.js";import"./mcp-oauth-Cn6Swd6f.js";const nn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,sn=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,on=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,rn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=nn.test(e),i=sn.test(e),o=on.test(e);if(t&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=i?e:`https://${e}`;let r;try{r=new URL(l)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=r.hostname.split(".");return c.length<2||c.some(a=>!a||!rn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Fe(s){const e=I.c(14),{children:t,className:i,wrapperClassName:o}=s,[l,r]=D.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=j=>{if(!j)return;const x=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};x(),j.addEventListener("scroll",x,{passive:!0});const g=new ResizeObserver(x);g.observe(j);for(const m of Array.from(j.children))g.observe(m);return()=>{j.removeEventListener("scroll",x),g.disconnect()}},e[0]=c):c=e[0];const a=c;let u;e[1]!==o?(u=Z("relative",o),e[1]=o,e[2]=u):u=e[2];let f;e[3]!==t||e[4]!==i?(f=n.jsx("div",{ref:a,className:i,children:t}),e[3]=t,e[4]=i,e[5]=f):f=e[5];const p=l?"opacity-0":"opacity-100";let d;e[6]!==p?(d=Z("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=d):d=e[7];let h;e[8]!==d?(h=n.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let v;return e[10]!==u||e[11]!==f||e[12]!==h?(v=n.jsxs("div",{className:u,children:[f,h]}),e[10]=u,e[11]=f,e[12]=h,e[13]=v):v=e[13],v}function an(s){const e=s.properties;if(!e)return[];const t=[];for(const[i,o]of Object.entries(e)){const c=o?.properties?.__type?.const;typeof c=="string"&&c.length>0&&t.push({fieldKey:i,bindingType:c})}return t}function ln(s,e){const t=[];if(s.length&&t.push({field:["id"],operator:"in",value:s}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function J(s){const e=s;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??s}function cn(s,e,t,i){return{...s??{},[e]:{__type:t,value:i}}}function qe(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(qe):typeof s=="object"?Object.entries(s).some(([e,t])=>!e.startsWith("__")&&qe(t)):!1}function dn(s){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[s]?e[s]:s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function mn(s){return qe(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function un(s){return s?Object.entries(s).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=mn(t);return i?[{key:e,label:dn(e),value:i}]:[]}):[]}function fn({autoOpenFieldKey:s,card:e}){return s===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function pn(s,e,t){const i=s.filter(o=>o.app_name===e||!!t&&o.app_id===t);return i.length===0?null:(i.sort((o,l)=>{const r=c=>c.status==="active"?0:1;return r(o)!==r(l)?r(o)-r(l):(l.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function gn(s){return s.server?.icons?.[0]?.src??Bt(s.server?.repository)??null}function hn(s,e){const t=s._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||s.title||s.server?.title||s.server?.name||e}function xn(s){const e=[],t=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],l=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!l)continue;const r=s.configurationState?.[i.fieldKey]?.value,c=r?t.get(r):void 0,a=r&&c?r:null,u=a?s.connectionReadiness?.[a]!==!1:!1,f=!!a&&u;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:l,title:hn(l,i.bindingType),icon:gn(l),headline:o?.headline??l._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||pn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:c?.configuration_state??null})}return e}function yn(s,e){if(!s)return null;const t=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=t(s);for(const o of e)if(t(o.siteUrl)===i)return o.siteUrl;return null}function vn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${i.displayName})`}))}))}function lt(s){const e=I.c(38);let t,i,o,l,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:t,...l}=s,e[0]=s,e[1]=t,e[2]=i,e[3]=o,e[4]=l,e[5]=r):(t=e[1],i=e[2],o=e[3],l=e[4],r=e[5]);const[c,a]=D.useState(!1),[u,f]=D.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch($){console.error("Failed to copy text: ",$)}},e[6]=r,e[7]=p):p=e[7];const d=p;let h;e[8]!==c?(h=()=>{a(!c)},e[8]=c,e[9]=h):h=e[9];const v=h,j=c?"text":"password";let x;e[10]!==t?(x=Z("pr-20",t),e[10]=t,e[11]=x):x=e[11];let g;e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==j||e[16]!==x||e[17]!==r?(g=n.jsx(Ue,{type:j,value:r,onChange:i,placeholder:o,className:x,...l}),e[12]=i,e[13]=o,e[14]=l,e[15]=j,e[16]=x,e[17]=r,e[18]=g):g=e[18];const m=c?"Hide password":"Show password";let b;e[19]!==c?(b=c?n.jsx(Zt,{size:16}):n.jsx(Yt,{size:16}),e[19]=c,e[20]=b):b=e[20];let y;e[21]!==m||e[22]!==b||e[23]!==v?(y=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:v,title:m,children:b}),e[21]=m,e[22]=b,e[23]=v,e[24]=y):y=e[24];const S=!r,_=u?"Copied!":"Copy token";let N;e[25]!==u?(N=u?n.jsx(Wt,{size:16}):n.jsx(Jt,{size:16}),e[25]=u,e[26]=N):N=e[26];let w;e[27]!==d||e[28]!==_||e[29]!==N||e[30]!==S?(w=n.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:S,title:_,children:N}),e[27]=d,e[28]=_,e[29]=N,e[30]=S,e[31]=w):w=e[31];let E;e[32]!==w||e[33]!==y?(E=n.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[y,w]}),e[32]=w,e[33]=y,e[34]=E):E=e[34];let k;return e[35]!==E||e[36]!==g?(k=n.jsxs("div",{className:"relative",children:[g,E]}),e[35]=E,e[36]=g,e[37]=k):k=e[37],k}function Je(s){const e=I.c(19),{card:t,selfClient:i,org:o,onDone:l,onError:r}=s,c=mt();let a;e[0]!==t||e[1]!==i?(a=async x=>{const g={...t.configurationState??{},...x};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:g}}})},e[0]=t,e[1]=i,e[2]=a):a=e[2];let u;e[3]!==l||e[4]!==o||e[5]!==c?(u=async()=>{await c.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),l()},e[3]=l,e[4]=o,e[5]=c,e[6]=u):u=e[6];let f;e[7]!==r?(f=x=>{r?.(x)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==u||e[11]!==f?(p={mutationFn:a,onSuccess:u,onError:f},e[9]=a,e[10]=u,e[11]=f,e[12]=p):p=e[12];const d=ke(p);let h;e[13]!==d?(h=x=>d.mutate(x),e[13]=d,e[14]=h):h=e[14];const v=h;let j;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==v?(j={save:v,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=v,e[18]=j):j=e[18],j}const bn=He({accountName:ue().min(1,"Informe o nome da conta"),appKey:ue().optional(),appToken:ue().optional()});function jn(s){const e=I.c(63),{card:t,selfClient:i,org:o,onDone:l,onIsPendingChange:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Be(bn),e[0]=c):c=e[0];const a=t.configurationState?.accountName||"",u=t.configurationState?.appKey||"",f=t.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==u||e[3]!==f?(p={resolver:c,defaultValues:{accountName:a,appKey:u,appToken:f}},e[1]=a,e[2]=u,e[3]=f,e[4]=p):p=e[4];const d=Ge(p);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==d?(h=()=>{d.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=d,e[9]=h):h=e[9];let v;e[10]!==t.configurationState||e[11]!==d?(v=[t.configurationState,d],e[10]=t.configurationState,e[11]=d,e[12]=v):v=e[12],D.useEffect(h,v);let j;e[13]!==t||e[14]!==l||e[15]!==o||e[16]!==i?(j={card:t,selfClient:i,org:o,onDone:l},e[13]=t,e[14]=l,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:x,isPending:g,error:m}=Je(j);let b,y;e[18]!==g||e[19]!==r?(y=()=>{r?.(g)},b=[g,r],e[18]=g,e[19]=r,e[20]=b,e[21]=y):(b=e[20],y=e[21]),D.useEffect(y,b);let S;if(e[22]!==d||e[23]!==x){let K;e[25]!==x?(K=async C=>{x(C)},e[25]=x,e[26]=K):K=e[26],S=d.handleSubmit(K),e[22]=d,e[23]=x,e[24]=S}else S=e[24];const _=S;let N;e[27]!==g?(N=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"Nome da conta"}),n.jsx(ge,{children:n.jsx(Ue,{placeholder:"Nome da sua conta VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[27]=g,e[28]=N):N=e[28];let w;e[29]!==d.control||e[30]!==N?(w=n.jsx(fe,{control:d.control,name:"accountName",render:N}),e[29]=d.control,e[30]=N,e[31]=w):w=e[31];let E;e[32]!==g?(E=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Key (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Key da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[32]=g,e[33]=E):E=e[33];let k;e[34]!==d.control||e[35]!==E?(k=n.jsx(fe,{control:d.control,name:"appKey",render:E}),e[34]=d.control,e[35]=E,e[36]=k):k=e[36];let $;e[37]!==g?($=K=>{const{field:C}=K;return n.jsxs(pe,{children:[n.jsx(Ke,{children:"App Token (opcional)"}),n.jsx(ge,{children:n.jsx(lt,{placeholder:"App Token da VTEX",...C,disabled:g})}),n.jsx(he,{})]})},e[37]=g,e[38]=$):$=e[38];let O;e[39]!==d.control||e[40]!==$?(O=n.jsx(fe,{control:d.control,name:"appToken",render:$}),e[39]=d.control,e[40]=$,e[41]=O):O=e[41];let T;e[42]!==d||e[43]!==w||e[44]!==k||e[45]!==O?(T=n.jsxs(Ye,{...d,children:[w,k,O]}),e[42]=d,e[43]=w,e[44]=k,e[45]=O,e[46]=T):T=e[46];let U;e[47]!==m?(U=m&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Não foi possível salvar a configuração"}),e[47]=m,e[48]=U):U=e[48];let P;e[49]!==g||e[50]!==l?(P=n.jsx(H,{type:"button",variant:"outline",onClick:l,disabled:g,children:"Cancelar"}),e[49]=g,e[50]=l,e[51]=P):P=e[51];const M=g?"Salvando...":"Salvar";let q;e[52]!==g||e[53]!==M?(q=n.jsx(H,{type:"submit",disabled:g,children:M}),e[52]=g,e[53]=M,e[54]=q):q=e[54];let z;e[55]!==P||e[56]!==q?(z=n.jsxs(Qe,{className:"pt-4",children:[P,q]}),e[55]=P,e[56]=q,e[57]=z):z=e[57];let F;return e[58]!==_||e[59]!==T||e[60]!==U||e[61]!==z?(F=n.jsxs("form",{onSubmit:_,className:"space-y-4",children:[T,U,z]}),e[58]=_,e[59]=T,e[60]=U,e[61]=z,e[62]=F):F=e[62],F}function _t(s){const e=I.c(30),{options:t,value:i,onChange:o,disabled:l,ariaLabel:r,searchPlaceholder:c}=s,a=c===void 0?"Buscar...":c,[u,f]=D.useState("");let p,d,h;if(e[0]!==t||e[1]!==u||e[2]!==i){const w=u.trim().toLowerCase();p=w?t.filter(E=>E.label.toLowerCase().includes(w)):t,d=p.map(Cn),h=d.includes(i)?i:d[0]??"",e[0]=t,e[1]=u,e[2]=i,e[3]=p,e[4]=d,e[5]=h}else p=e[3],d=e[4],h=e[5];const v=h;let j;e[6]!==l||e[7]!==d||e[8]!==o?(j=function(E){if(l||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(E.key))return;E.preventDefault();const $=E.currentTarget.dataset.value,O=d.indexOf($),T=d.length;if(T===0)return;let U;E.key==="ArrowDown"||E.key==="ArrowRight"?U=(O+1)%T:E.key==="ArrowUp"||E.key==="ArrowLeft"?U=(O-1+T)%T:E.key==="Home"?U=0:U=T-1;const P=d[U];o(P),E.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(P)}"]`)?.focus()},e[6]=l,e[7]=d,e[8]=o,e[9]=j):j=e[9];const x=j;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Xt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=g):g=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=w=>f(w.target.value),e[11]=m):m=e[11];const b=`Buscar ${r}`;let y;e[12]!==l||e[13]!==u||e[14]!==a||e[15]!==b?(y=n.jsxs("div",{className:"relative",children:[g,n.jsx(Ue,{type:"text",value:u,onChange:m,disabled:l,placeholder:a,"aria-label":b,className:"h-8 pl-8"})]}),e[12]=l,e[13]=u,e[14]=a,e[15]=b,e[16]=y):y=e[16];let S;e[17]!==l||e[18]!==p||e[19]!==x||e[20]!==o||e[21]!==v||e[22]!==i?(S=p.length===0?n.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):p.map(w=>{const E=w.value===i;return n.jsxs("button",{type:"button",role:"radio","aria-checked":E,disabled:l,"data-value":w.value,tabIndex:w.value===v?0:-1,onClick:()=>o(w.value),onKeyDown:x,className:Z("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",E?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[n.jsx("span",{className:"truncate",children:w.label}),E?n.jsx(We,{size:16,className:"shrink-0 text-primary"}):null]},w.value)}),e[17]=l,e[18]=p,e[19]=x,e[20]=o,e[21]=v,e[22]=i,e[23]=S):S=e[23];let _;e[24]!==r||e[25]!==S?(_=n.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:S}),e[24]=r,e[25]=S,e[26]=_):_=e[26];let N;return e[27]!==y||e[28]!==_?(N=n.jsxs("div",{className:"space-y-2",children:[y,_]}),e[27]=y,e[28]=_,e[29]=N):N=e[29],N}function Cn(s){return s.value}function Ze(s){const e=I.c(16),{label:t,iconSize:i,className:o,iconClassName:l,labelClassName:r}=s,c=i===void 0?14:i;let a;e[0]!==o?(a=Z("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let u;e[2]!==l?(u=Z("shrink-0 animate-spin",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==c||e[5]!==u?(f=n.jsx(ut,{size:c,className:u}),e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==r?(p=Z("text-sm",r),e[7]=r,e[8]=p):p=e[8];let d;e[9]!==t||e[10]!==p?(d=n.jsx("span",{className:p,children:t}),e[9]=t,e[10]=p,e[11]=d):d=e[11];let h;return e[12]!==a||e[13]!==f||e[14]!==d?(h=n.jsxs("span",{className:a,children:[f,d]}),e[12]=a,e[13]=f,e[14]=d,e[15]=h):h=e[15],h}const Sn=He({propertyId:ue().min(1,"Selecione uma propriedade")});function Nn(s){const e=I.c(55),{card:t,connectionId:i,companionClient:o,selfClient:l,org:r,onDone:c,onIsPendingChange:a}=s;let u;e[0]!==i||e[1]!==r.id?(u=W.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=u):u=e[2];let f;e[3]!==o?(f=async()=>{const C=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(C);return vn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==u||e[6]!==f?(p={queryKey:u,queryFn:f},e[5]=u,e[6]=f,e[7]=p):p=e[7];const d=ft(p);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Be(Sn),e[8]=h):h=e[8];const v=t.configurationState?.propertyId||"";let j;e[9]!==v?(j={resolver:h,defaultValues:{propertyId:v}},e[9]=v,e[10]=j):j=e[10];const x=Ge(j);let g;e[11]!==t||e[12]!==c||e[13]!==r||e[14]!==l?(g={card:t,selfClient:l,org:r,onDone:c},e[11]=t,e[12]=c,e[13]=r,e[14]=l,e[15]=g):g=e[15];const{save:m,isPending:b,error:y}=Je(g);let S,_;e[16]!==b||e[17]!==a?(S=()=>{a?.(b)},_=[b,a],e[16]=b,e[17]=a,e[18]=S,e[19]=_):(S=e[18],_=e[19]),D.useEffect(S,_);let N;if(e[20]!==x||e[21]!==m){let C;e[23]!==m?(C=async L=>{m(L)},e[23]=m,e[24]=C):C=e[24],N=x.handleSubmit(C),e[20]=x,e[21]=m,e[22]=N}else N=e[22];const w=N;if(d.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando propriedades..."})}),e[25]=C):C=e[25],C}if(d.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=C):C=e[26],C}let E;e[27]!==d.data?(E=d.data||[],e[27]=d.data,e[28]=E):E=e[28];const k=E;if(k.flatMap(En).length===0){let C;return e[29]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."})}),e[29]=C):C=e[29],C}let O;e[30]!==b||e[31]!==k?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(_t,{options:k.flatMap(_n),value:L.value,onChange:L.onChange,disabled:b,ariaLabel:"Propriedade do Google Analytics"})}),n.jsx(he,{})]})},e[30]=b,e[31]=k,e[32]=O):O=e[32];let T;e[33]!==x.control||e[34]!==O?(T=n.jsx(fe,{control:x.control,name:"propertyId",render:O}),e[33]=x.control,e[34]=O,e[35]=T):T=e[35];let U;e[36]!==x||e[37]!==T?(U=n.jsx(Ye,{...x,children:T}),e[36]=x,e[37]=T,e[38]=U):U=e[38];let P;e[39]!==y?(P=y&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[39]=y,e[40]=P):P=e[40];let M;e[41]!==b||e[42]!==c?(M=n.jsx(H,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancelar"}),e[41]=b,e[42]=c,e[43]=M):M=e[43];const q=b?"Salvando...":"Salvar";let z;e[44]!==b||e[45]!==q?(z=n.jsx(H,{type:"submit",disabled:b,children:q}),e[44]=b,e[45]=q,e[46]=z):z=e[46];let F;e[47]!==M||e[48]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[47]=M,e[48]=z,e[49]=F):F=e[49];let K;return e[50]!==w||e[51]!==U||e[52]!==P||e[53]!==F?(K=n.jsxs("form",{onSubmit:w,className:"space-y-4",children:[U,P,F]}),e[50]=w,e[51]=U,e[52]=P,e[53]=F,e[54]=K):K=e[54],K}function _n(s){return s.options}function En(s){return s.options}const wn=He({siteUrl:ue().min(1,"Selecione um site")});function Tn(s){const e=I.c(59),{card:t,connectionId:i,companionClient:o,selfClient:l,org:r,contextSiteUrl:c,onDone:a,onIsPendingChange:u}=s;let f;e[0]!==i||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const C=await o.callTool({name:"list_sites",arguments:{}});return J(C).sites||[]},e[3]=o,e[4]=p):p=e[4];let d;e[5]!==f||e[6]!==p?(d={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=d):d=e[7];const h=ft(d);let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=Be(wn),e[8]=v):v=e[8];const j=t.configurationState?.siteUrl||"";let x;e[9]!==j?(x={resolver:v,defaultValues:{siteUrl:j}},e[9]=j,e[10]=x):x=e[10];const g=Ge(x);let m;e[11]!==t||e[12]!==a||e[13]!==r||e[14]!==l?(m={card:t,selfClient:l,org:r,onDone:a},e[11]=t,e[12]=a,e[13]=r,e[14]=l,e[15]=m):m=e[15];const{save:b,isPending:y,error:S}=Je(m);let _,N;e[16]!==y||e[17]!==u?(_=()=>{u?.(y)},N=[y,u],e[16]=y,e[17]=u,e[18]=_,e[19]=N):(_=e[18],N=e[19]),D.useEffect(_,N);let w;if(e[20]!==g||e[21]!==b){let C;e[23]!==b?(C=async L=>{b(L)},e[23]=b,e[24]=C):C=e[24],w=g.handleSubmit(C),e[20]=g,e[21]=b,e[22]=w}else w=e[22];const E=w;if(h.isLoading){let C;return e[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:n.jsx(Ze,{label:"Carregando sites..."})}),e[25]=C):C=e[25],C}if(h.isError){let C;return e[26]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=C):C=e[26],C}let k,$;if(e[27]!==t.configurationState?.siteUrl||e[28]!==c||e[29]!==g||e[30]!==h.data){$=Symbol.for("react.early_return_sentinel");e:{if(k=h.data||[],k.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"space-y-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=L):L=e[33],$=L;break e}const C=t.configurationState?.siteUrl;if(C&&g.getValues("siteUrl")!==C)g.setValue("siteUrl",C);else if(!C&&!g.getValues("siteUrl")){const L=yn(c,k);L&&g.setValue("siteUrl",L)}}e[27]=t.configurationState?.siteUrl,e[28]=c,e[29]=g,e[30]=h.data,e[31]=k,e[32]=$}else k=e[31],$=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let O;e[34]!==y||e[35]!==k?(O=C=>{const{field:L}=C;return n.jsxs(pe,{children:[n.jsx(ge,{children:n.jsx(_t,{options:k.map(In),value:L.value,onChange:L.onChange,disabled:y,ariaLabel:"Site verificado"})}),n.jsx(he,{})]})},e[34]=y,e[35]=k,e[36]=O):O=e[36];let T;e[37]!==g.control||e[38]!==O?(T=n.jsx(fe,{control:g.control,name:"siteUrl",render:O}),e[37]=g.control,e[38]=O,e[39]=T):T=e[39];let U;e[40]!==g||e[41]!==T?(U=n.jsx(Ye,{...g,children:T}),e[40]=g,e[41]=T,e[42]=U):U=e[42];let P;e[43]!==S?(P=S&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:"Não foi possível salvar a configuração"}),e[43]=S,e[44]=P):P=e[44];let M;e[45]!==y||e[46]!==a?(M=n.jsx(H,{type:"button",variant:"outline",onClick:a,disabled:y,children:"Cancelar"}),e[45]=y,e[46]=a,e[47]=M):M=e[47];const q=y?"Salvando...":"Salvar";let z;e[48]!==y||e[49]!==q?(z=n.jsx(H,{type:"submit",disabled:y,children:q}),e[48]=y,e[49]=q,e[50]=z):z=e[50];let F;e[51]!==M||e[52]!==z?(F=n.jsxs(Qe,{className:"pt-4",children:[M,z]}),e[51]=M,e[52]=z,e[53]=F):F=e[53];let K;return e[54]!==E||e[55]!==U||e[56]!==P||e[57]!==F?(K=n.jsxs("form",{onSubmit:E,className:"space-y-4",children:[U,P,F]}),e[54]=E,e[55]=U,e[56]=P,e[57]=F,e[58]=K):K=e[58],K}function In(s){return{value:s.siteUrl,label:s.siteUrl}}const kn={vtex:jn,"google-analytics":Nn,"google-search-console":Tn};function On(){const s=I.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=t):t=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,n.jsx("div",{className:"p-1",children:n.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Ve(s){const e=I.c(3),{children:t}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(We,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==t?(o=n.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,n.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function Un(s){const e=I.c(45),{card:t,connecting:i,disabled:o,onConnect:l,org:r,selfClient:c,siteUrl:a,autoOpenConfigFieldKey:u,onAutoOpenConfigHandled:f}=s,p=t.linkedConnectionId;let d;e[0]!==t.configurationState?(d=un(t.configurationState),e[0]=t.configurationState,e[1]=d):d=e[1];const h=d;let v;e[2]!==t.icon||e[3]!==t.title?(v=n.jsx(Ct,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=t.icon,e[3]=t.title,e[4]=v):v=e[4];let j;e[5]!==t.title?(j=n.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[5]=t.title,e[6]=j):j=e[6];let x;e[7]!==t.satisfied||e[8]!==t.title||e[9]!==i||e[10]!==o||e[11]!==l?(x=t.satisfied?n.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[n.jsx(We,{size:16})," Conectado"]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:l,"aria-label":`Conectar ${t.title}`,children:i?n.jsx(ut,{size:16,className:"animate-spin"}):"Conectar"}),e[7]=t.satisfied,e[8]=t.title,e[9]=i,e[10]=o,e[11]=l,e[12]=x):x=e[12];let g;e[13]!==v||e[14]!==j||e[15]!==x?(g=n.jsxs("div",{className:"flex items-center gap-2",children:[v,j,x]}),e[13]=v,e[14]=j,e[15]=x,e[16]=g):g=e[16];let m;e[17]!==t.checks?(m=t.checks!==null&&n.jsxs(Ve,{children:["+ ",t.checks," verificações"]}),e[17]=t.checks,e[18]=m):m=e[18];let b;e[19]!==t.headline?(b=t.headline&&n.jsx(Ve,{children:t.headline}),e[19]=t.headline,e[20]=b):b=e[20];let y;e[21]!==t.bullets?(y=t.bullets.map(An),e[21]=t.bullets,e[22]=y):y=e[22];let S;e[23]!==t.candidateConnectionId||e[24]!==t.satisfied||e[25]!==t.title?(S=!t.satisfied&&t.candidateConnectionId&&n.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Usando sua conexão existente de ",t.title]}),e[23]=t.candidateConnectionId,e[24]=t.satisfied,e[25]=t.title,e[26]=S):S=e[26];let _;e[27]!==m||e[28]!==b||e[29]!==y||e[30]!==S?(_=n.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[m,b,y,S]}),e[27]=m,e[28]=b,e[29]=y,e[30]=S,e[31]=_):_=e[31];let N;e[32]!==u||e[33]!==t||e[34]!==p||e[35]!==f||e[36]!==r||e[37]!==h||e[38]!==c||e[39]!==a?(N=t.satisfied&&p&&n.jsx(D.Suspense,{fallback:n.jsx($n,{}),children:n.jsx(Ln,{card:t,org:r,selfClient:c,connectionId:p,savedConfigEntries:h,contextSiteUrl:a,autoOpen:fn({autoOpenFieldKey:u,card:t}),onAutoOpenHandled:f})}),e[32]=u,e[33]=t,e[34]=p,e[35]=f,e[36]=r,e[37]=h,e[38]=c,e[39]=a,e[40]=N):N=e[40];let w;return e[41]!==_||e[42]!==N||e[43]!==g?(w=n.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[g,_,N]}),e[41]=_,e[42]=N,e[43]=g,e[44]=w):w=e[44],w}function An(s){return n.jsx(Ve,{children:s},s)}function Rn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function Pn(s){const e=I.c(2),{title:t}=s;let i;return e[0]!==t?(i=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("p",{className:"text-xs text-muted-foreground",children:["A configuração ainda não está disponível aqui para ",t,"."]})}),e[0]=t,e[1]=i):i=e[1],i}function $n(){const s=I.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"h-5 w-24 animate-pulse rounded bg-muted/60"}),n.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]})}),s[0]=e):e=s[0],e}function Ln(s){const e=I.c(41),{card:t,org:i,selfClient:o,connectionId:l,savedConfigEntries:r,contextSiteUrl:c,autoOpen:a,onAutoOpenHandled:u}=s;let f;e[0]!==l||e[1]!==i.id||e[2]!==i.slug?(f={connectionId:l,orgId:i.id,orgSlug:i.slug},e[0]=l,e[1]=i.id,e[2]=i.slug,e[3]=f):f=e[3];const p=Ae(f),[d,h]=D.useState(a),[v,j]=D.useState(!1),x=kn[t.bindingType];let g;e[4]!==a||e[5]!==u?(g=()=>{h(!1),a&&u()},e[4]=a,e[5]=u,e[6]=g):g=e[6];const m=g;let b;e[7]!==m||e[8]!==v?(b=U=>{if(!(!U&&v)){if(!U){m();return}h(!0)}},e[7]=m,e[8]=v,e[9]=b):b=e[9];const y=b;let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuração"}),e[10]=S):S=e[10];let _;e[11]!==r.length?(_=r.length===0&&n.jsx("p",{className:"text-xs text-muted-foreground",children:"Nenhum valor de configuração foi salvo ainda."}),e[11]=r.length,e[12]=_):_=e[12];let N;e[13]!==_?(N=n.jsxs("div",{className:"grid gap-1",children:[S,_]}),e[13]=_,e[14]=N):N=e[14];let w;e[15]!==x||e[16]!==t.title||e[17]!==r.length?(w=r.length>0?n.jsxs(Ft,{children:[n.jsx(qt,{asChild:!0,children:n.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(!0),"aria-label":`Editar configuração de ${t.title}`,disabled:!x,children:n.jsx(Ht,{size:14})})}),n.jsx(Vt,{children:"Editar configuração"})]}):n.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!0),disabled:!x,children:"Configurar"}),e[15]=x,e[16]=t.title,e[17]=r.length,e[18]=w):w=e[18];let E;e[19]!==N||e[20]!==w?(E=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N,w]}),e[19]=N,e[20]=w,e[21]=E):E=e[21];let k;e[22]!==r?(k=r.length>0&&n.jsx("dl",{className:"grid gap-2",children:r.map(zn)}),e[22]=r,e[23]=k):k=e[23];let $;e[24]!==E||e[25]!==k?($=n.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[E,k]}),e[24]=E,e[25]=k,e[26]=$):$=e[26];let O;e[27]!==x||e[28]!==t||e[29]!==m||e[30]!==p||e[31]!==l||e[32]!==c||e[33]!==d||e[34]!==y||e[35]!==i||e[36]!==o?(O=x?n.jsx(Lt,{open:d,onOpenChange:y,children:n.jsxs(zt,{className:"sm:max-w-lg",children:[n.jsxs(Dt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[n.jsx(Ct,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n.jsx(Kt,{children:t.title}),n.jsxs(Mt,{children:["Configure o ",t.title," para enriquecer os dados"]})]})]}),n.jsx(x,{card:t,connectionId:l,companionClient:p,selfClient:o,org:i,contextSiteUrl:c,onDone:m,onIsPendingChange:j})]})}):n.jsx(Pn,{title:t.title}),e[27]=x,e[28]=t,e[29]=m,e[30]=p,e[31]=l,e[32]=c,e[33]=d,e[34]=y,e[35]=i,e[36]=o,e[37]=O):O=e[37];let T;return e[38]!==$||e[39]!==O?(T=n.jsxs(n.Fragment,{children:[$,O]}),e[38]=$,e[39]=O,e[40]=T):T=e[40],T}function zn(s){return n.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[n.jsx("dt",{className:"text-muted-foreground",children:s.label}),n.jsx("dd",{className:"truncate text-foreground",children:Rn(s.key,s.value)})]},s.key)}const Xe={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Rupturas, PDPs incompletas e lacunas de atributos em todos os SKUs"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Onde a receita vaza entre a visualização do produto e o checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Lacunas de visibilidade na busca e indexação em todo o seu catálogo"}};function Dn(s){const e=I.c(30),{selfClient:t,org:i,cdConnectionId:o}=s;let l;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(l={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=l):l=e[3];const r=Ae(l);let c;e[4]!==o||e[5]!==i.id?(c=W.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=c):c=e[6];let a;e[7]!==r?(a=async()=>{const R=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(R)},e[7]=r,e[8]=a):a=e[8];let u;e[9]!==c||e[10]!==a?(u={queryKey:c,queryFn:a},e[9]=c,e[10]=a,e[11]=u):u=e[11];const f=me(u),p=an(f.data?.stateSchema??{properties:{}}),d=p.map(Wn),h=p.map(Qn).filter(Gn),v=p.filter(Bn).map(Hn),j=[...h,...v].sort().join(",");let x;e[12]!==o||e[13]!==i.id?(x=W.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==t?(g=async()=>{const R=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(R)},e[15]=o,e[16]=t,e[17]=g):g=e[17];let m;e[18]!==x||e[19]!==g?(m={queryKey:x,queryFn:g},e[18]=x,e[19]=g,e[20]=m):m=e[20];const y=me(m).data?.item?.configuration_state??null;let S;e[21]!==y?(S=R=>y?.[R.fieldKey]?.value,e[21]=y,e[22]=S):S=e[22];const _=p.map(S).filter(Vn),N=[...d.map(qn),...h.map(Fn),..._.map(Mn)].sort().join(","),E=me({queryKey:W.commerceDiscoveryCompanionConnections(i.id,N),queryFn:async()=>{if(p.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:d},{field:["app_id"],operator:"in",value:h}];_.length>0&&R.push({field:["id"],operator:"in",value:_});const G=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return J(G)}}).data?.items??[],k=new Set(_),$=E.filter(R=>k.has(R.id)),O=$.filter(Kn);let T;e[23]!==i.id||e[24]!==i.slug?(T=R=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(i.id,R.id),queryFn:async()=>{try{const G=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=T):T=e[25];const U=en({queries:O.map(T)});let P;e[26]!==U?(P=(R,G)=>[R.id,U[G]?.data?.hasToken===!0],e[26]=U,e[27]=P):P=e[27];const M=new Map(O.map(P)),q={};for(const R of $)q[R.id]=!R.oauth_config||!!R.connection_token||M.get(R.id)===!0;const z=me({queryKey:W.commerceDiscoveryCompanionRegistry(i.id,j),queryFn:async()=>{if(p.length===0)return{items:[]};const R=ln(h,v),G=await Gt(vt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return J(G)}}),F={},K={};for(const R of z.data?.items??[])F[R.id]=R,R.server?.name&&(K[R.server.name]=R);const C=xn({requirements:p,itemsById:F,itemsByName:K,connections:E,connectionReadiness:q,configurationState:y,curated:Xe});let L;return e[28]!==C?(L={cards:C},e[28]=C,e[29]=L):L=e[29],L}function Kn(s){return s.oauth_config&&!s.connection_token}function Mn(s){return`linked:${s}`}function Fn(s){return`app:${s}`}function qn(s){return`binding:${s}`}function Vn(s){return typeof s=="string"&&s.length>0}function Hn(s){return s.bindingType}function Bn(s){return!Xe[s.bindingType]}function Gn(s){return!!s}function Qn(s){return Xe[s.bindingType]?.registryAppId}function Wn(s){return s.bindingType}function Yn({selfClient:s,org:e,userId:t,cdConnectionId:i}){const o=mt(),[l,r]=D.useState(null),[c,a]=D.useState(null),u=async(p,d)=>{const h=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:d}});return J(h)};async function f(p){r(p.fieldKey),a(null);try{let d=p.candidateConnectionId;if(!d){const m=Qt(p.registryItem,e.id,t,{remoteIndex:0}),b=m.connection_type==="STDIO",y=!!m.connection_url,S=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!y&&!S)return a(`${p.title} cannot be connected: no connection method available`),!1;const _=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});d=J(_).item.id}const h=d,v=await tn({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:m=>u(h,{connection_token:m}).then(()=>{})});if(!v.ok)return a(`Couldn't sign in to ${p.title}: ${v.error}`),!1;const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),x=J(j).item?.configuration_state??null,g=cn(x,p.fieldKey,p.bindingType,h);return await u(i,{configuration_state:g}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),!0}catch(d){return a(d instanceof Error?d.message:String(d)),!1}finally{r(null)}}return{connect:f,connectingFieldKey:l,error:c}}const et="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function tt(){const s=I.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"grid gap-1.5",children:[n.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Desbloqueie seu diagnóstico completo"}),n.jsx("p",{className:"text-base text-muted-foreground",children:"Conecte suas ferramentas para liberar mais de 100 verificações no seu funil."})]}),s[0]=e):e=s[0],e}function Jn(){const s=I.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Zn)}),s[0]=e):e=s[0],e}function Zn(s){return n.jsx(On,{},s)}function nt(){const s=I.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:et,children:[n.jsx(tt,{}),n.jsx(Jn,{})]}),s[0]=e):e=s[0],e}function Xn(s){const e=I.c(5),{onRetry:t}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let o,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),l=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=o,e[2]=l):(o=e[1],l=e[2]);let r;return e[3]!==t?(r=n.jsxs("div",{className:et,children:[i,n.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[o,l,n.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=r):r=e[4],r}function es(s){const e=I.c(2);let t;return e[0]!==s?(t=n.jsx(pt,{children:i=>{const{reset:o}=i;return n.jsx(gt,{fallback:l=>{const{resetError:r}=l;return n.jsx(Xn,{onRetry:()=>{o(),r()}})},children:n.jsx(D.Suspense,{fallback:n.jsx(nt,{}),children:n.jsx(ts,{...s})})})}}),e[0]=s,e[1]=t):t=e[1],t}function ts(s){const e=I.c(35),{org:t,cdConnectionId:i,siteUrl:o}=s,{data:l}=Oe.useSession(),r=l?.user?.id??"";let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:bt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const a=Ae(c);let u;e[3]!==i||e[4]!==t||e[5]!==a?(u={selfClient:a,org:t,cdConnectionId:i},e[3]=i,e[4]=t,e[5]=a,e[6]=u):u=e[6];const{cards:f}=Dn(u);let p;e[7]!==i||e[8]!==t||e[9]!==a||e[10]!==r?(p={selfClient:a,org:t,userId:r,cdConnectionId:i},e[7]=i,e[8]=t,e[9]=a,e[10]=r,e[11]=p):p=e[11];const{connect:d,connectingFieldKey:h,error:v}=Yn(p),[j,x]=D.useState(null);if(f.length===0)return null;const g=h!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(tt,{}),e[12]=m):m=e[12];let b;e[13]!==v?(b=v&&n.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v}),e[13]=v,e[14]=b):b=e[14];let y;if(e[15]!==j||e[16]!==g||e[17]!==f||e[18]!==d||e[19]!==h||e[20]!==t||e[21]!==a||e[22]!==o){let _;e[24]!==j||e[25]!==g||e[26]!==d||e[27]!==h||e[28]!==t||e[29]!==a||e[30]!==o?(_=N=>{const w=async()=>{await d(N)&&x(N.fieldKey)};return n.jsx(Un,{card:N,connecting:h===N.fieldKey,disabled:g&&h!==N.fieldKey,org:t,selfClient:a,siteUrl:o,autoOpenConfigFieldKey:j,onAutoOpenConfigHandled:()=>x(E=>E===N.fieldKey?null:E),onConnect:()=>{w()}},N.fieldKey)},e[24]=j,e[25]=g,e[26]=d,e[27]=h,e[28]=t,e[29]=a,e[30]=o,e[31]=_):_=e[31],y=f.map(_),e[15]=j,e[16]=g,e[17]=f,e[18]=d,e[19]=h,e[20]=t,e[21]=a,e[22]=o,e[23]=y}else y=e[23];let S;return e[32]!==b||e[33]!==y?(S=n.jsxs("div",{className:et,children:[m,n.jsx(Fe,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[60vh] md:flex-none",children:n.jsxs("div",{className:"grid gap-4",children:[b,y]})})]}),e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const st="https://decocms-tanstack.deco-cx.workers.dev/agendar",ns="Prefere que a gente acompanhe você?",ss="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.";function it({siteUrl:s,email:e}){const t=new URL(st);return s&&t.searchParams.set("siteUrl",s),e&&t.searchParams.set("email",e),t.toString()}function is(s){const e=I.c(9),{href:t,size:i,className:o}=s,l=t===void 0?st:t,r=i===void 0?"lg":i;let c;e[0]!==o?(c=Z("w-full",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(St,{size:16}),e[2]=a):a=e[2];let u;e[3]!==l?(u=n.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",children:["Agendar uma reunião",a]}),e[3]=l,e[4]=u):u=e[4];let f;return e[5]!==r||e[6]!==c||e[7]!==u?(f=n.jsx(H,{asChild:!0,variant:"outline",size:r,className:c,children:u}),e[5]=r,e[6]=c,e[7]=u,e[8]=f):f=e[8],f}function ct(s){const e=I.c(2),{children:t}=s;let i;return e[0]!==t?(i=n.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:t}),e[0]=t,e[1]=i):i=e[1],i}function os(){const s=I.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ct,{children:n.jsx(Nt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:n.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=t):t=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,n.jsxs("div",{className:"relative",children:[i,n.jsxs(ct,{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function ot(s){const e=I.c(4),{href:t}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(os,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"grid gap-2",children:[n.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:ns}),n.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:ss})]}),e[1]=o):o=e[1];let l;return e[2]!==t?(l=n.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:n.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,n.jsx(is,{href:t,size:"xl"})]})}),e[2]=t,e[3]=l):l=e[3],l}function rs(s){const e=I.c(8),{className:t,href:i}=s,o=i===void 0?st:i;let l;e[0]!==t?(l=Z("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:n.jsx(Nt,{size:20})}),e[2]=r):r=e[2];let c,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[n.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefere falar com uma pessoa?"}),n.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Agende uma chamada e rodamos o diagnóstico com você."})]}),a=n.jsx(St,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=c,e[4]=a):(c=e[3],a=e[4]);let u;return e[5]!==o||e[6]!==l?(u=n.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:l,children:[r,c,a]}),e[5]=o,e[6]=l,e[7]=u):u=e[7],u}function Et(s){const e=I.c(10),{host:t}=s,i=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=n.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=r):(o=e[0],l=e[1],r=e[2]);let c;e[3]!==i?(c=n.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:n.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=c):c=e[4];let a;e[5]!==t?(a=n.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=a):a=e[6];let u;return e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"flex items-center gap-3",children:[o,l,r,c,a]}),e[7]=c,e[8]=a,e[9]=u):u=e[9],u}const as={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ls(s){return as[s]}function rt(s){const e=I.c(4),{variant:t}=s;let i;e[0]!==t?(i=ls(t),e[0]=t,e[1]=i):i=e[1];let o;return e[2]!==i?(o=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ze,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function Ti(){const s=I.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ms,{}),s[0]=e):e=s[0],e}const wt=D.createContext(null),Tt=()=>D.useContext(wt);function Q(s){const e=I.c(13);let t,i;e[0]!==s?({visual:i,...t}=s,e[0]=s,e[1]=t,e[2]=i):(t=e[1],i=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/commerce-onboarding"},e[3]=o):o=e[3];const l=ht(o),{data:r}=Oe.useSession(),c=r?.user?.email;let a;e[4]!==l.siteUrl||e[5]!==c?(a=it({siteUrl:l.siteUrl,email:c}),e[4]=l.siteUrl,e[5]=c,e[6]=a):a=e[6];const u=a;let f;e[7]!==u||e[8]!==i?(f=i??n.jsx(ot,{href:u}),e[7]=u,e[8]=i,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==f?(p=n.jsx(At,{...t,visual:f}),e[10]=t,e[11]=f,e[12]=p):p=e[12],p}const cs={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:s=>`Código enviado para ${s}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:s=>`Continuar com ${s}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function ds(s){if(!s)return null;const e=Te(s);return e.ok?new URL(e.value).hostname:null}function dt(s){switch(s){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return s}}function ms(){const s=I.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const t=ht(e),{org:i,siteUrl:o}=t;let l;s[1]!==o?(l=ds(o),s[1]=o,s[2]=l):l=s[2];const r=l;let c;s[3]!==i||s[4]!==o?(c=n.jsx(us,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=c):c=s[5];let a;return s[6]!==r||s[7]!==c?(a=n.jsx(wt.Provider,{value:r,children:c}),s[6]=r,s[7]=c,s[8]=a):a=s[8],a}function us(s){const e=I.c(8),{requestedOrgSlug:t,siteUrl:i}=s,{data:o,isPending:l}=Oe.useSession(),r=Tt();if(l){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Q,{children:n.jsx(rt,{variant:"generic"})}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r?n.jsx(Et,{host:r}):void 0,e[1]=r,e[2]=u):u=e[2];let f;return e[3]!==u?(f=n.jsx(Q,{children:n.jsx(Ut,{callbackUrl:a,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:u,copy:cs})}),e[3]=u,e[4]=f):f=e[4],f}let c;return e[5]!==t||e[6]!==i?(c=n.jsx(fs,{requestedOrgSlug:t,siteUrl:i}),e[5]=t,e[6]=i,e[7]=c):c=e[7],c}function fs(s){const e=I.c(40),{requestedOrgSlug:t,siteUrl:i}=s,o=xt(),l=kt(),[r,c]=D.useState(null),[a,u]=D.useState(null),f=l.data?.map(gs)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:ps,retry:!1,onSuccess:m=>{u(m)}},e[0]=p):p=e[0];const d=ke(p);if(l.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Q,{children:n.jsx(rt,{variant:"workspace"})}),e[1]=m):m=e[1],m}if(l.error){let m;return e[2]!==l?(m=n.jsx(Ie,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[2]=l,e[3]=m):m=e[3],m}const h=t?f.find(m=>m.slug===t):null;if(h){let m;return e[4]!==h||e[5]!==i?(m=n.jsx(we,{org:h,initialSiteUrl:i}),e[4]=h,e[5]=i,e[6]=m):m=e[6],m}if(t){let m;return e[7]!==l?(m=n.jsx(Ie,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>l.refetch()}),e[7]=l,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=n.jsx(we,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=n.jsx(we,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=S=>c(S),e[16]=b):b=e[16];let y;return e[17]!==f?(y=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:f,selectLabel:"Continuar",onSelected:b})})]})}),e[17]=f,e[18]=y):y=e[18],y}if(!a){let m;e[19]!==d?(m=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=m):m=e[20];let b;return e[21]!==d||e[22]!==m?(b=n.jsx(hs,{mutation:d,onRetry:m}),e[21]=d,e[22]=m,e[23]=b):b=e[23],b}const v=a;if(v?.success&&(v.status==="created"||v.status==="joined"||v.status==="already_has_organization")&&v.organization){let m;return e[24]!==v.organization||e[25]!==i?(m=n.jsx(we,{org:v.organization,initialSiteUrl:i}),e[24]=v.organization,e[25]=i,e[26]=m):m=e[26],m}if(v?.status==="ambiguous"&&v.organizations&&v.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(X,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=m):m=e[27];const b=v.domain??void 0;let y;e[28]!==o||e[29]!==i?(y=(_,N)=>{yt(),c({..._,slug:N}),o({to:"/commerce-onboarding",search:{org:N,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=y):y=e[30];let S;return e[31]!==v.organizations||e[32]!==b||e[33]!==y?(S=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[m,n.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(at,{organizations:v.organizations,domain:b,onJoined:y})})]})}),e[31]=v.organizations,e[32]=b,e[33]=y,e[34]=S):S=e[34],S}const j=v?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let x;e[35]!==d?(x=()=>{u(null),d.reset()},e[35]=d,e[36]=x):x=e[36];let g;return e[37]!==j||e[38]!==x?(g=n.jsx(Ie,{title:"O onboarding de commerce precisa de suporte",description:j,actionLabel:"Tentar novamente",onRetry:x}),e[37]=j,e[38]=x,e[39]=g):g=e[39],g}async function ps(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&yt(),e}function gs(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function hs(s){const e=I.c(7),{mutation:t,onRetry:i}=s,o=D.useRef(!1);let l;e[0]!==t?(l=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=l):l=e[1];const r=l;if(t.error){let u;return e[2]!==i?(u=n.jsx(Ie,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:i}),e[2]=i,e[3]=u):u=e[3],u}let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rt,{variant:"generic"}),e[4]=c):c=e[4];let a;return e[5]!==r?(a=n.jsx(Q,{children:n.jsx("div",{ref:r,children:c})}),e[5]=r,e[6]=a):a=e[6],a}function X(s){const e=I.c(8),{title:t,description:i}=s,o=Tt();let l;e[0]!==o?(l=o?n.jsx(Et,{host:o}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let r;e[2]!==i||e[3]!==t?(r=(t||i)&&n.jsxs("div",{className:"space-y-2",children:[t&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),i&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=t,e[4]=r):r=e[4];let c;return e[5]!==l||e[6]!==r?(c=n.jsxs("div",{className:"grid gap-10",children:[l,r]}),e[5]=l,e[6]=r,e[7]=c):c=e[7],c}function Ie(s){const e=I.c(9),{title:t,description:i,actionLabel:o,onRetry:l}=s;let r;e[0]!==i||e[1]!==t?(r=n.jsx(X,{title:t,description:i}),e[0]=i,e[1]=t,e[2]=r):r=e[2];let c;e[3]!==o||e[4]!==l?(c=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=c):c=e[5];let a;return e[6]!==r||e[7]!==c?(a=n.jsx(Q,{children:n.jsxs("div",{className:"grid gap-10",children:[r,c]})}),e[6]=r,e[7]=c,e[8]=a):a=e[8],a}function xs(s){return s.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Ee(s){const e=s;if(e.isError)throw new Error(xs(e));return e.structuredContent??s}function we(s){const e=I.c(10),{org:t,initialSiteUrl:i}=s,{data:o}=Oe.useSession(),l=o?.user?.email;let r;e[0]!==i||e[1]!==l?(r=it({siteUrl:i,email:l}),e[0]=i,e[1]=l,e[2]=r):r=e[2];const c=r;let a;e[3]!==c?(a=n.jsx(ot,{href:c}),e[3]=c,e[4]=a):a=e[4];const u=a;let f;return e[5]!==i||e[6]!==u||e[7]!==t||e[8]!==o?.user?.email?(f=n.jsx(pt,{children:p=>{const{reset:d}=p;return n.jsx(gt,{fallback:h=>{const{error:v,resetError:j}=h;return n.jsx(Q,{visual:u,children:n.jsx(ys,{orgName:t.name,message:v instanceof Error?v.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{d(),j()}})})},children:n.jsx(D.Suspense,{fallback:n.jsx(It,{visual:u}),children:n.jsx(vs,{org:t,initialSiteUrl:i,sessionEmail:o?.user?.email},`${t.id}:${i??""}`)})})}}),e[5]=i,e[6]=u,e[7]=t,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function It(s){const e=I.c(3),{visual:t}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(X,{}),n.jsx(nt,{})]}),e[0]=i):i=e[0];let o;return e[1]!==t?(o=n.jsx(Q,{align:"fill",visual:t,children:i}),e[1]=t,e[2]=o):o=e[2],o}function ys(s){const e=I.c(10),{orgName:t,message:i,onRetry:o}=s,l=`A configuração de commerce continuará em ${t}.`;let r;e[0]!==l?(r=n.jsx(X,{title:"Diagnóstico de commerce",description:l}),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==i?(c=n.jsx(xe,{message:i}),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==o?(a=n.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Tentar novamente"}),e[4]=o,e[5]=a):a=e[5];let u;return e[6]!==r||e[7]!==c||e[8]!==a?(u=n.jsxs("div",{className:"grid gap-10",children:[r,c,a]}),e[6]=r,e[7]=c,e[8]=a,e[9]=u):u=e[9],u}function vs(s){const e=I.c(111),{org:t,initialSiteUrl:i,sessionEmail:o}=s,l=xt();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:bt,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const c=Ae(r),[a,u]=D.useState(i??""),[f,p]=D.useState(null),[d,h]=D.useState(null),v=D.useRef(!1),j=vt.COMMERCE_DISCOVERY(t.id),x=Pt(t.id),g=W.commerceDiscoveryConnection(t.id,j);let m;e[3]!==j||e[4]!==c?(m=async()=>{const A=await c.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ee(A)},e[3]=j,e[4]=c,e[5]=m):m=e[5];let b;e[6]!==g||e[7]!==m?(b={queryKey:g,queryFn:m,retry:!1},e[6]=g,e[7]=m,e[8]=b):b=e[8];const y=me(b),S=W.commerceDiscoveryVirtualMcp(t.id,x);let _;e[9]!==c||e[10]!==x?(_=async()=>{const A=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return Ee(A)},e[9]=c,e[10]=x,e[11]=_):_=e[11];let N;e[12]!==S||e[13]!==_?(N={queryKey:S,queryFn:_,retry:!1},e[12]=S,e[13]=_,e[14]=N):N=e[14];const w=me(N);let E;e[15]!==c?(E=async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:A}});return Ee(B)},e[15]=c,e[16]=E):E=e[16];let k;e[17]!==y||e[18]!==w?(k=A=>{p(A),h(null),y.refetch(),w.refetch()},e[17]=y,e[18]=w,e[19]=k):k=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=A=>{h(A instanceof Error?A.message:"A configuração do Commerce Discovery falhou.")},e[20]=$):$=e[20];let O;e[21]!==E||e[22]!==k?(O={mutationFn:E,retry:!1,onSuccess:k,onError:$},e[21]=E,e[22]=k,e[23]=O):O=e[23];const T=ke(O);let U;e[24]!==c?(U={mutationFn:async A=>{const B=await c.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:A}});return Ee(B)},retry:!1},e[24]=c,e[25]=U):U=e[25];const P=ke(U),[M,q]=D.useState(null),z=!!y.data.item&&!!w.data.item,F=y.data.item,K=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,C=i||a||K||"";let L;e[26]!==C||e[27]!==o?(L=it({siteUrl:C,email:o}),e[26]=C,e[27]=o,e[28]=L):L=e[28];const R=L;let G;e[29]!==R?(G=n.jsx(ot,{href:R}),e[29]=R,e[30]=G):G=e[30];const V=G;let ye;e[31]!==T?(ye=A=>{const B=Te(A);if(!B.ok){h(dt(B.error));return}h(null),T.mutate(B.value)},e[31]=T,e[32]=ye):ye=e[32];const te=ye;let ve;e[33]!==i||e[34]!==te||e[35]!==z?(ve=A=>{!A||v.current||z||!i||(v.current=!0,te(i))},e[33]=i,e[34]=te,e[35]=z,e[36]=ve):ve=e[36];const Re=ve;let be;e[37]!==te||e[38]!==a?(be=A=>{A.preventDefault(),te(a)},e[37]=te,e[38]=a,e[39]=be):be=e[39];const Y=be;let je;e[40]!==j||e[41]!==f?.reportApp||e[42]!==x?(je=f?.reportApp??{connectionId:j,virtualMcpId:x,toolName:$t},e[40]=j,e[41]=f?.reportApp,e[42]=x,e[43]=je):je=e[43];const ee=je;let Ce;e[44]!==C||e[45]!==l||e[46]!==t.slug||e[47]!==ee||e[48]!==P?(Ce=async()=>{q(null);const A=Te(C);if(A.ok)try{await P.mutateAsync(A.value)}catch{q("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Ot.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ee.virtualMcpId,main:Rt(ee.connectionId,ee.toolName),chat:0}})},e[44]=C,e[45]=l,e[46]=t.slug,e[47]=ee,e[48]=P,e[49]=Ce):Ce=e[49];const Pe=Ce;if(z){let A;return e[50]!==R||e[51]!==V||e[52]!==C||e[53]!==Pe||e[54]!==t||e[55]!==ee||e[56]!==M||e[57]!==P.isPending?(A=n.jsx(bs,{org:t,reportApp:ee,onOpenReport:Pe,isSubmitting:P.isPending,error:M,meetingUrl:R,meetingVisual:V,siteUrl:C}),e[50]=R,e[51]=V,e[52]=C,e[53]=Pe,e[54]=t,e[55]=ee,e[56]=M,e[57]=P.isPending,e[58]=A):A=e[58],A}if(T.isPending){let A;return e[59]!==V?(A=n.jsx(It,{visual:V}),e[59]=V,e[60]=A):A=e[60],A}if(i){let A,B;if(e[61]!==V||e[62]!==Y||e[63]!==i||e[64]!==d||e[65]!==t.name||e[66]!==T.isPending||e[67]!==a){B=Symbol.for("react.early_return_sentinel");e:if(A=Te(i),!A.ok){const ze=`A configuração de commerce continuará em ${t.name}.`;let le;e[70]!==ze?(le=n.jsx(X,{title:"Diagnóstico de commerce",description:ze}),e[70]=ze,e[71]=le):le=e[71];const De=n.jsx(xe,{message:dt(A.error)});let ce;e[72]!==Y||e[73]!==d||e[74]!==T.isPending||e[75]!==a?(ce=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[72]=Y,e[73]=d,e[74]=T.isPending,e[75]=a,e[76]=ce):ce=e[76];let de;e[77]!==le||e[78]!==De||e[79]!==ce?(de=n.jsxs("div",{className:"grid gap-10",children:[le,De,ce]}),e[77]=le,e[78]=De,e[79]=ce,e[80]=de):de=e[80];let _e;e[81]!==V||e[82]!==de?(_e=n.jsx(Q,{visual:V,children:de}),e[81]=V,e[82]=de,e[83]=_e):_e=e[83],B=_e;break e}e[61]=V,e[62]=Y,e[63]=i,e[64]=d,e[65]=t.name,e[66]=T.isPending,e[67]=a,e[68]=A,e[69]=B}else A=e[68],B=e[69];if(B!==Symbol.for("react.early_return_sentinel"))return B;const Le=`O Commerce Discovery está sendo preparado para ${A.value}.`;let oe;e[84]!==Le?(oe=n.jsx(X,{title:"Diagnóstico de commerce",description:Le}),e[84]=Le,e[85]=oe):oe=e[85];let re;e[86]!==Y||e[87]!==d||e[88]!==T.isPending||e[89]!==a?(re=d?n.jsxs(n.Fragment,{children:[n.jsx(xe,{message:d}),n.jsx(Me,{siteUrl:a,error:null,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y})]}):n.jsx(nt,{}),e[86]=Y,e[87]=d,e[88]=T.isPending,e[89]=a,e[90]=re):re=e[90];let ae;e[91]!==oe||e[92]!==re||e[93]!==Re?(ae=n.jsxs("div",{ref:Re,className:"grid gap-10",children:[oe,re]}),e[91]=oe,e[92]=re,e[93]=Re,e[94]=ae):ae=e[94];let Ne;return e[95]!==V||e[96]!==ae?(Ne=n.jsx(Q,{visual:V,children:ae}),e[95]=V,e[96]=ae,e[97]=Ne):Ne=e[97],Ne}const $e=`A configuração de commerce continuará em ${t.name}.`;let ne;e[98]!==$e?(ne=n.jsx(X,{title:"Diagnóstico de commerce",description:$e}),e[98]=$e,e[99]=ne):ne=e[99];let se;e[100]!==Y||e[101]!==d||e[102]!==T.isPending||e[103]!==a?(se=n.jsx(Me,{siteUrl:a,error:d,isSubmitting:T.isPending,onSiteUrlChange:u,onSubmit:Y}),e[100]=Y,e[101]=d,e[102]=T.isPending,e[103]=a,e[104]=se):se=e[104];let ie;e[105]!==ne||e[106]!==se?(ie=n.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[105]=ne,e[106]=se,e[107]=ie):ie=e[107];let Se;return e[108]!==V||e[109]!==ie?(Se=n.jsx(Q,{visual:V,children:ie}),e[108]=V,e[109]=ie,e[110]=Se):Se=e[110],Se}function Me(s){const e=I.c(20),{siteUrl:t,error:i,isSubmitting:o,onSiteUrlChange:l,onSubmit:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=c):c=e[0];let a;e[1]!==l?(a=x=>l(x.target.value),e[1]=l,e[2]=a):a=e[2];const u=!!i;let f;e[3]!==o||e[4]!==t||e[5]!==a||e[6]!==u?(f=n.jsx(Ue,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:a,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=a,e[6]=u,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?n.jsx(xe,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let d;e[10]!==f||e[11]!==p?(d=n.jsxs("div",{className:"grid gap-2",children:[c,f,p]}),e[10]=f,e[11]=p,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(jt,{size:16}),e[13]=h):h=e[13];let v;e[14]!==o?(v=n.jsxs(H,{type:"submit",size:"xl",className:"w-full",disabled:o,children:["Continuar",h]}),e[14]=o,e[15]=v):v=e[15];let j;return e[16]!==r||e[17]!==d||e[18]!==v?(j=n.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,v]}),e[16]=r,e[17]=d,e[18]=v,e[19]=j):j=e[19],j}function bs(s){const e=I.c(26),{org:t,reportApp:i,onOpenReport:o,isSubmitting:l,error:r,meetingUrl:c,meetingVisual:a,siteUrl:u}=s;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(X,{}),e[0]=f):f=e[0];let p;e[1]!==t||e[2]!==i.connectionId||e[3]!==u?(p=n.jsx(es,{org:t,cdConnectionId:i.connectionId,siteUrl:u}),e[1]=t,e[2]=i.connectionId,e[3]=u,e[4]=p):p=e[4];let d;e[5]!==c?(d=n.jsx(rs,{className:"md:hidden",href:c}),e[5]=c,e[6]=d):d=e[6];let h;e[7]!==r?(h=r?n.jsx(xe,{message:r}):null,e[7]=r,e[8]=h):h=e[8];const v=l||!i.virtualMcpId,j=l?"Abrindo relatório...":"Ver relatório completo";let x;e[9]!==l?(x=l?null:n.jsx(jt,{size:18}),e[9]=l,e[10]=x):x=e[10];let g;e[11]!==o||e[12]!==v||e[13]!==j||e[14]!==x?(g=n.jsxs(H,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:v,children:[j,x]}),e[11]=o,e[12]=v,e[13]=j,e[14]=x,e[15]=g):g=e[15];let m;e[16]!==d||e[17]!==h||e[18]!==g?(m=n.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,g]}),e[16]=d,e[17]=h,e[18]=g,e[19]=m):m=e[19];let b;e[20]!==p||e[21]!==m?(b=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,p,m]}),e[20]=p,e[21]=m,e[22]=b):b=e[22];let y;return e[23]!==a||e[24]!==b?(y=n.jsx(Q,{align:"fill",visual:a,children:b}),e[23]=a,e[24]=b,e[25]=y):y=e[25],y}function xe(s){const e=I.c(2),{message:t}=s;let i;return e[0]!==t?(i=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=i):i=e[1],i}export{Ti as default};
@@ -1 +1 @@
1
- import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-CBdIFd2T.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-DcJxJAi_.js";import{S as _}from"./chat-context-CttLt0Cf.js";import{i as $}from"./ChevronUp-Cn2ufNfM.js";import{a as A}from"./Eye-CrDQTMzM.js";import{u as B}from"./studio-tools-BEcztvKx.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
1
+ import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-i4yKOslE.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-BzVd1N_n.js";import{S as _}from"./chat-context-D3ExOe2Y.js";import{i as $}from"./ChevronUp-DFVBw1Q0.js";import{a as A}from"./Eye-XlApkfqq.js";import{u as B}from"./studio-tools-BIon8cDY.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C as $,b0 as k,K as D,l as E,j as x}from"./index-CBdIFd2T.js";import{u as K}from"./use-registry-connections-DR5wKJd8.js";import{b as Q}from"./use-organization-settings-DxbR8LZH.js";import{S as w,e as F}from"./use-mcp-client-RYfuXh7q.js";import{u as H}from"./useInfiniteQuery-CGWj_d7Q.js";import{i as q,f as G}from"./extract-connection-data-DAqoFNbM.js";import{C as U}from"./card-B3_dM_vK.js";import{I as V}from"./integration-icon-Bq_7i_P9.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C as $,b0 as k,K as D,l as E,j as x}from"./index-i4yKOslE.js";import{u as K}from"./use-registry-connections-B75n3CLT.js";import{b as Q}from"./use-organization-settings-DR6y14Ln.js";import{S as w,e as F}from"./use-mcp-client-Cf5O31zc.js";import{u as H}from"./useInfiniteQuery-D6UIz-QI.js";import{i as q,f as G}from"./extract-connection-data-Yinpm7Wp.js";import{C as U}from"./card-DKEaJmjc.js";import{I as V}from"./integration-icon-DZfYl8h3.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};