decocms 4.149.7 → 4.150.1

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 (243) hide show
  1. package/dist/client/assets/{AlertCircle-BiFsMhm4.js → AlertCircle-DZqBnZUK.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DoByAr16.js → AreaChart-BQfL1zWr.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BSm3AYB8.js → ArrowUp-BzVoSWRY.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DeyIz7v5.js → ArrowUpRight-C-HFqkS4.js} +1 -1
  5. package/dist/client/assets/{Check-rokpcf0T.js → Check-BX2JJtbr.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DAP9g-rT.js → CheckCircle-B9Q7BP0R.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-CPacLmdA.js → ChevronDown-C0kK0nLg.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-B3aSlkur.js → ChevronRight-DgLwn5xj.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BK9Hx0V9.js → ChevronUp-DUu3dFvi.js} +1 -1
  10. package/dist/client/assets/{Copy01-5TOIojCe.js → Copy01-ButcPCjW.js} +1 -1
  11. package/dist/client/assets/CpuChip01--vbgg446.js +1 -0
  12. package/dist/client/assets/{DotsVertical-Ci1-w3e_.js → DotsVertical-C_TeAt9N.js} +1 -1
  13. package/dist/client/assets/{Eye-D_L0dZ6u.js → Eye-vq9NyAEt.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CXXP_NBc.js → FilterLines-_MGxq1cj.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Dz77ORfh.js → HardDrive-CzyBCh3d.js} +1 -1
  16. package/dist/client/assets/{Key01-DajEy3HZ.js → Key01-CvoufTmi.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CNCDZdDQ.js → LayoutLeft-pPvjYgoZ.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CBBWd_u8.js → LinkExternal01-DQGUVSM9.js} +1 -1
  19. package/dist/client/assets/{LogOut01-DWlyRcQP.js → LogOut01-BseiHZwI.js} +1 -1
  20. package/dist/client/assets/{Monitor01-SfpO8_eS.js → Monitor01-CN2AFUd8.js} +1 -1
  21. package/dist/client/assets/{Palette-DdP8XSRj.js → Palette-iBvrW59Z.js} +1 -1
  22. package/dist/client/assets/{Play-CCRE5ZQ3.js → Play-C3pUfm0S.js} +1 -1
  23. package/dist/client/assets/{Plus-SfXjhFdQ.js → Plus-BTr4PI36.js} +1 -1
  24. package/dist/client/assets/{SearchLg-Cm9WaEOr.js → SearchLg-DqteayyL.js} +1 -1
  25. package/dist/client/assets/{SearchMd-BFouC3yb.js → SearchMd-DaQvdwYA.js} +1 -1
  26. package/dist/client/assets/{Settings02-DUdP-JTL.js → Settings02-BK7HMP-t.js} +1 -1
  27. package/dist/client/assets/{Shield01-CVeAmAQS.js → Shield01-CsKHz8R7.js} +1 -1
  28. package/dist/client/assets/{Star01-BoqpV_cz.js → Star01-DhZ4xNqy.js} +1 -1
  29. package/dist/client/assets/{Stars01-oBfIKe_H.js → Stars01-YVkhCw82.js} +1 -1
  30. package/dist/client/assets/{Stars02-BHuJgpT2.js → Stars02-CXR47Omk.js} +1 -1
  31. package/dist/client/assets/{Sun-DPFLXdN9.js → Sun-1q5AI4_f.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-UVm_9kuZ.js → SwitchHorizontal01-C97W2y_Q.js} +1 -1
  33. package/dist/client/assets/{Tool01-Cwtm9Zfc.js → Tool01-BW8ZvrE3.js} +1 -1
  34. package/dist/client/assets/{Tool02-Dtn0vTkb.js → Tool02-CxblnFnJ.js} +1 -1
  35. package/dist/client/assets/{Trash01-jc_UuKLC.js → Trash01-CmT8OmvC.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-GUe-gdeI.js → TrendUp01-D_7UkRme.js} +1 -1
  37. package/dist/client/assets/{Upload01-_1DUBSlt.js → Upload01-D1JXX1Ph.js} +1 -1
  38. package/dist/client/assets/{User01-D_ggPL6l.js → User01-Dpjq1MBp.js} +1 -1
  39. package/dist/client/assets/{Users01-DMeK9zGH.js → Users01-Dl_9JClI.js} +1 -1
  40. package/dist/client/assets/{Users03-CM1sULj9.js → Users03-rXolOTe_.js} +1 -1
  41. package/dist/client/assets/{X-C5G0YNBl.js → X-D_oLK6_c.js} +1 -1
  42. package/dist/client/assets/{XCircle-DrrwTSsJ.js → XCircle-DUZX5yLz.js} +1 -1
  43. package/dist/client/assets/{XClose-aZG3Lwvy.js → XClose-D0oOj-ud.js} +1 -1
  44. package/dist/client/assets/{Zap-CxBT7IWE.js → Zap-DVHCKkr0.js} +1 -1
  45. package/dist/client/assets/ZapSquare-CicfodSm.js +1 -0
  46. package/dist/client/assets/{access-gate-B3guIJUr.js → access-gate-BnNnauJv.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-DAOs5z1n.js → add-section-modal-CE7z0FNf.js} +1 -1
  48. package/dist/client/assets/agent-icon-keI5mZSI.js +1 -0
  49. package/dist/client/assets/agents-list-DN0L8-S2.js +1 -0
  50. package/dist/client/assets/{ai-providers-syUkGpFH.js → ai-providers-CJVMEb6m.js} +1 -1
  51. package/dist/client/assets/{alert-ta_KJfM4.js → alert-QXKW6mrW.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DliQGHu_.js → alert-dialog-CJMXecoj.js} +1 -1
  53. package/dist/client/assets/app-editor-d2FCQf_M.js +1 -0
  54. package/dist/client/assets/{auth-XDi96955.js → auth-U7lq6rf1.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-CgBsmSSz.js → auth-catchall-6_yxuDjG.js} +1 -1
  56. package/dist/client/assets/{auth-entry-Bp3C-6Uj.js → auth-entry-6LychnRm.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-D94Rl64P.js → auth-split-layout-CB5yvL88.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-C0WFKfVc.js → authenticate-and-persist-oauth-DfZaAOrc.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BUkSuGgE.js → automation-list-row-Bjro_SDr.js} +1 -1
  60. package/dist/client/assets/{automation-runs-CFl0TPrC.js → automation-runs-CJkwrx8I.js} +1 -1
  61. package/dist/client/assets/automations-BL6zBb2p.js +1 -0
  62. package/dist/client/assets/{avatar-BrxEDiW5.js → avatar-DDU8NMhZ.js} +1 -1
  63. package/dist/client/assets/{badge-DggS66bH.js → badge-if80MApE.js} +1 -1
  64. package/dist/client/assets/{block-document-DqYzWxLv.js → block-document-DdFaYDne.js} +1 -1
  65. package/dist/client/assets/{brand-context-Bc6RY2Yv.js → brand-context-BCQ-t-QL.js} +1 -1
  66. package/dist/client/assets/{buckets-Dl78-NSh.js → buckets-DWozHHqG.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-BUe-qkRp.js +1 -0
  68. package/dist/client/assets/{calendar-DcWQOY47.js → calendar-BSabjpqG.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-CVQkqfS2.js → capability-load-error-BG2BHe51.js} +1 -1
  70. package/dist/client/assets/{card-Bc9XMAV0.js → card-CDMFPpZU.js} +1 -1
  71. package/dist/client/assets/category-editor-HzAm1c9d.js +1 -0
  72. package/dist/client/assets/{chat-context-AqRARPO5.js → chat-context-Bfoolk8K.js} +12 -12
  73. package/dist/client/assets/{checkbox-B6ZDdSvN.js → checkbox-zcCdLvf3.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CrDsqLgJ.js → cli-auth-success-BN9YecVy.js} +1 -1
  75. package/dist/client/assets/collection-detail-jytpg5V6.js +1 -0
  76. package/dist/client/assets/{collection-display-button-D6RRnHxA.js → collection-display-button-CqG38uH-.js} +1 -1
  77. package/dist/client/assets/{collection-search-ClOu31ci.js → collection-search-BFAHbGX2.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-DzdSHmL5.js → collection-table-wrapper-DOVfUDY5.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-CLTFM03Q.js → collection-tabs-DJpG_RPu.js} +1 -1
  80. package/dist/client/assets/{command-tEVFSIDb.js → command-DiRc8_ii.js} +1 -1
  81. package/dist/client/assets/commerce-onboarding-CtU9NsGr.js +1 -0
  82. package/dist/client/assets/{companions-core-BXWaci_Z.js → companions-core-DZwnuE3V.js} +1 -1
  83. package/dist/client/assets/{connect-CdApKN_i.js → connect-YYFj2Q1m.js} +1 -1
  84. package/dist/client/assets/{connection-BzEpFoAX.js → connection-EN-8DRCE.js} +1 -1
  85. package/dist/client/assets/{connection-card-D4oWr5G1.js → connection-card-BIyUAtll.js} +1 -1
  86. package/dist/client/assets/connection-detail-Ce5UBrjG.js +1 -0
  87. package/dist/client/assets/{connection-form-helpers-bHQvDEyW.js → connection-form-helpers-lxp-YyV6.js} +1 -1
  88. package/dist/client/assets/connections-CQ2eDkZU.js +1 -0
  89. package/dist/client/assets/{decopilot-sse-pool-B6fO_e2Q.js → decopilot-sse-pool-BAATEVTt.js} +1 -1
  90. package/dist/client/assets/{dialog-CcBvH6sb.js → dialog-CYVn8lw-.js} +1 -1
  91. package/dist/client/assets/{domain-settings-BNIxLber.js → domain-settings-CBbmoa3g.js} +1 -1
  92. package/dist/client/assets/{drawer-BYPzeiqB.js → drawer-BB1-ZKkN.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BnYh-sUy.js → dropdown-menu-CfjF0x1v.js} +1 -1
  94. package/dist/client/assets/{empty-state-D0um33CJ.js → empty-state-N4NC3DL9.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-C4oZtxRq.js → extract-connection-data-BnMf-nfh.js} +1 -1
  96. package/dist/client/assets/file-explorer-BqYrk0Ms.js +2 -0
  97. package/dist/client/assets/{form-B30v3rW_.js → form-CP4aOMvu.js} +1 -1
  98. package/dist/client/assets/general-BSzHiEss.js +1 -0
  99. package/dist/client/assets/{github-repo-picker-DnYzYk-g.js → github-repo-picker-0Sxe85R0.js} +1 -1
  100. package/dist/client/assets/{hooks-DpMhOxp5.js → hooks-BpX9ViV0.js} +1 -1
  101. package/dist/client/assets/{index-BaONrWsa.js → index-B2fgv8Yv.js} +1 -1
  102. package/dist/client/assets/index-B5MweN_Z.js +1 -0
  103. package/dist/client/assets/{index-dverSVGj.js → index-BcSLSEHl.js} +1 -1
  104. package/dist/client/assets/{index-im4TJfDr.js → index-BotXJfEU.js} +1 -1
  105. package/dist/client/assets/{index-BXUkQJWN.js → index-CdzXGTFr.js} +3 -3
  106. package/dist/client/assets/{index-DsTqVdZx.js → index-CncDnAtk.js} +31 -31
  107. package/dist/client/assets/{index-Ci8RLcRP.js → index-Cxn76qtl.js} +1 -1
  108. package/dist/client/assets/{index-hrFLkJh0.js → index-D0TpSBVR.js} +2 -2
  109. package/dist/client/assets/{index-JAfoJcTE.js → index-Dg5lW10U.js} +1 -1
  110. package/dist/client/assets/{index-DTgaKfa1.js → index-INSKxT89.js} +18 -18
  111. package/dist/client/assets/{index-j_W2ZplR.js → index-LeH-Nk1D.js} +1 -1
  112. package/dist/client/assets/{index-redirect-EaRTgxTw.js → index-redirect-tBPXkXmO.js} +1 -1
  113. package/dist/client/assets/{input-C72W64FP.js → input-Cd5pEbyl.js} +1 -1
  114. package/dist/client/assets/{integration-icon-Buh9MmdF.js → integration-icon-C-nm4Ydr.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-C85Ce4Km.js → invite-member-dialog-BwM33IGb.js} +1 -1
  116. package/dist/client/assets/{label-BUH_VVoz.js → label-eqyUR7pd.js} +1 -1
  117. package/dist/client/assets/{layout-CBiQ0oxs.js → layout-CePiBe08.js} +1 -1
  118. package/dist/client/assets/{login-DR1jxZMt.js → login-ClZA04aU.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-CECKXhxv.js → mcp-oauth-BdEJh0Yp.js} +1 -1
  120. package/dist/client/assets/{members---vaY7GK.js → members-3_HeLCuh.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-DGkIp40X.js → monaco-editor-6AQRiRcp.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-C_IyOC8R.js → monitoring-stats-row-CXpN7aAs.js} +1 -1
  123. package/dist/client/assets/{multi-select-X3IHqjVc.js → multi-select-B-Wy-fBT.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-ai-provider-By0SIhLp.js → oauth-callback-ai-provider-D3gZ3hlb.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-BeXlujDl.js → oauth-callback-j0W1XQko.js} +1 -1
  126. package/dist/client/assets/{onboarding-Cit1IiD-.js → onboarding-r-9D_0Za.js} +1 -1
  127. package/dist/client/assets/{org-install-CgwvFWoC.js → org-install-CbK7rVy9.js} +1 -1
  128. package/dist/client/assets/{org-layout-DEUTz0Pc.js → org-layout-7y7V8IKN.js} +1 -1
  129. package/dist/client/assets/{organization-choice-BLASMBg3.js → organization-choice-BAQiqls9.js} +1 -1
  130. package/dist/client/assets/{orgs-BUaqmNDB.js → orgs-BQTbdOcN.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-DB3OBAjK.js → page-seo-form-DwD4N-jw.js} +1 -1
  132. package/dist/client/assets/{popover-DatxMXX8.js → popover-CQ865FPo.js} +1 -1
  133. package/dist/client/assets/post-editor-C4o2J-RD.js +1 -0
  134. package/dist/client/assets/{primitives-BYry-oxo.js → primitives-CVvWouXZ.js} +1 -1
  135. package/dist/client/assets/{profile-DBx-quKK.js → profile-C0lf9fD2.js} +1 -1
  136. package/dist/client/assets/project-app-view-9r4oY0gB.js +1 -0
  137. package/dist/client/assets/record-editor-BVYWsgZq.js +1 -0
  138. package/dist/client/assets/redirect-editor-LqB0Nm_2.js +1 -0
  139. package/dist/client/assets/registry-B8rqoFpG.js +2 -0
  140. package/dist/client/assets/{registry-layout-4cbriU6p.js → registry-layout-BVBEgYAJ.js} +1 -1
  141. package/dist/client/assets/{reports-vwsJm6zQ.js → reports-YUUL3Ytl.js} +1 -1
  142. package/dist/client/assets/{require-capability-CUVZxilL.js → require-capability-b0W8gUzJ.js} +1 -1
  143. package/dist/client/assets/{required-auth-layout-Dvz6-mde.js → required-auth-layout-s2bNe0-l.js} +1 -1
  144. package/dist/client/assets/{reset-password-Dx66CcaP.js → reset-password-CSwEmYQQ.js} +1 -1
  145. package/dist/client/assets/roles-loV9_p_I.js +1 -0
  146. package/dist/client/assets/{search-input-CeYZhUxp.js → search-input-CRcO4xtW.js} +1 -1
  147. package/dist/client/assets/{secrets-DopzyFUm.js → secrets-DBG8Rlmw.js} +1 -1
  148. package/dist/client/assets/{sections-editor-by9bX78B.js → sections-editor-LAgLjJeB.js} +2 -2
  149. package/dist/client/assets/{select-DxtXx4Gd.js → select-C2W-lxSj.js} +1 -1
  150. package/dist/client/assets/select-model-Ct17SqfM.js +4 -0
  151. package/dist/client/assets/{self-tool-result-BUUd7Dsf.js → self-tool-result-G4ouxwYH.js} +1 -1
  152. package/dist/client/assets/seo-editor-snae3wbN.js +1 -0
  153. package/dist/client/assets/settings-layout-Cej22qeG.js +1 -0
  154. package/dist/client/assets/{settings-section-I60nzLqo.js → settings-section-BgtkwP9q.js} +1 -1
  155. package/dist/client/assets/{shell-controls-B3pJLSaV.js → shell-controls-DDIY7zkg.js} +1 -1
  156. package/dist/client/assets/shell-layout-BuuJGaxi.js +1 -0
  157. package/dist/client/assets/{sidebar-DguXDaRr.js → sidebar-iLgdb67_.js} +1 -1
  158. package/dist/client/assets/{skeleton-D3TX9e1l.js → skeleton-_WKgU-il.js} +1 -1
  159. package/dist/client/assets/{sso-CQ5TRs4N.js → sso-BJJ5DW-W.js} +1 -1
  160. package/dist/client/assets/{store-D7yGyDZ_.js → store-DlBOPhQk.js} +1 -1
  161. package/dist/client/assets/store-registry-DlQ0I2jj.js +2 -0
  162. package/dist/client/assets/{studio-tools-e62Z61Le.js → studio-tools-C06bI5ga.js} +1 -1
  163. package/dist/client/assets/{switch-CxExaNpJ.js → switch-CkEk_N83.js} +1 -1
  164. package/dist/client/assets/tab-id-Dk_SIAtC.js +1 -0
  165. package/dist/client/assets/{table-_k-3G-55.js → table-DX8acQFf.js} +1 -1
  166. package/dist/client/assets/{tabs-dqQKMmuL.js → tabs-gdbVmbI5.js} +1 -1
  167. package/dist/client/assets/{textarea-DfYALb4E.js → textarea-DSOHqOj4.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CWypEkzR.js → toggle-group-yPxjK2Ay.js} +1 -1
  169. package/dist/client/assets/{toolbar-CG6AS3q0.js → toolbar-CF2vnmHI.js} +1 -1
  170. package/dist/client/assets/{tooltip-CqWMVk2M.js → tooltip-D0pHBYbI.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-Du0KxunD.js → use-ai-providers-Do1WYhvy.js} +1 -1
  172. package/dist/client/assets/{use-automations-CzgZplev.js → use-automations-KDX-0X--.js} +1 -1
  173. package/dist/client/assets/{use-autosave-BZInI20f.js → use-autosave-C0dZ5JZi.js} +1 -1
  174. package/dist/client/assets/{use-capability-DOpinycn.js → use-capability-g498lRte.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-ZkT_1fjY.js → use-clock-tick-C4AQqDtd.js} +1 -1
  176. package/dist/client/assets/{use-connection-DtFjrTRv.js → use-connection-CIET0Msk.js} +1 -1
  177. package/dist/client/assets/{use-copy-BfuE0gud.js → use-copy-Dg_8Rv-z.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-DEmwA4BW.js → use-create-virtual-mcp-BvTOzXby.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-CMosI2l2.js → use-debounced-autosave-BEBg04RP.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-MzI5bRtk.js → use-debounced-value-BrEMTOVV.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-BKHMf8TZ.js → use-deco-credits-B66UJoDc.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-B8cCEH6l.js → use-decopilot-events-7kVAFziy.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-CEGqjsMV.js → use-delete-connection-Dekdl8Jk.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-CA3Wfjto.js → use-deployment-admin-DzTk1Qt9.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CB7kRy8l.js → use-file-configs-Cp5zjQB4.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-DHM2f60I.js → use-infinite-scroll-CMnhUeUg.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-DnWd7MPF.js → use-join-requests-Dt2PAYbh.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-C7fHuFD9.js → use-mcp-auth-status-C8CB6EOV.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-DayFt0Gf.js → use-mcp-client-BJx91BEC.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-BCVy-8a8.js → use-mcp-tools-COwEziEE.js} +1 -1
  191. package/dist/client/assets/{use-members-CCGbZEKO.js → use-members-Cyar9rsw.js} +1 -1
  192. package/dist/client/assets/{use-mobile-BIWGqE3k.js → use-mobile-DyVGWTUp.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-C0TiV0EA.js → use-navigate-to-agent-DJbF8uas.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C8uBs8j9.js → use-org-auth-client-COlHJa-m.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-DaDrJMD5.js → use-org-sso-3CIZqJFZ.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-BlO7RM3e.js → use-organization-roles-CeA_uzsB.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-BlVRLL3T.js → use-organization-settings-DzBziioM.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-DUkSdHsB.js → use-registry-connections-BpSuBbUM.js} +1 -1
  199. package/dist/client/assets/{use-secrets-BEx9Od_r.js → use-secrets-CF9zZ1JY.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-CP0Qqj0G.js → use-status-sounds-DEoxAi_S.js} +1 -1
  201. package/dist/client/assets/{use-tags-DH2ycxFF.js → use-tags-DH-DMykO.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-CxFbTkRh.js → use-view-mode-DADBS_q5.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-DDWns2sS.js → use-virtual-mcp-D-ZbuaT8.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-dNqP5hrQ.js +1 -0
  205. package/dist/client/assets/{useQueries-BPzZfFWR.js → useQueries-BMpOuVMz.js} +1 -1
  206. package/dist/client/assets/{useRouterState-BJbfWH_Z.js → useRouterState-BWkI0XVJ.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-GpeT0UF_.js +1 -0
  208. package/dist/client/assets/{users-DuMboXV7.js → users-DwrGpP7z.js} +1 -1
  209. package/dist/client/assets/variant-calendar-B3_WxDcA.js +1 -0
  210. package/dist/client/assets/{view-mode-toggle-FdjAmoYN.js → view-mode-toggle-BNh4rdw8.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +1 -1
  213. package/dist/server/server.js +1 -1
  214. package/package.json +1 -1
  215. package/dist/client/assets/ZapSquare-YZ7_-s41.js +0 -1
  216. package/dist/client/assets/agent-icon-BEPZv5Dl.js +0 -1
  217. package/dist/client/assets/agents-list-DUyQLNC0.js +0 -1
  218. package/dist/client/assets/app-editor-B7khE0Iy.js +0 -1
  219. package/dist/client/assets/automations-CRUVEUg6.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-IzA2cHs3.js +0 -1
  221. package/dist/client/assets/category-editor-ynZvDu_K.js +0 -1
  222. package/dist/client/assets/collection-detail-DvbrhRUo.js +0 -1
  223. package/dist/client/assets/commerce-onboarding-CCVmPUPH.js +0 -1
  224. package/dist/client/assets/connection-detail-BbOJLept.js +0 -1
  225. package/dist/client/assets/connections-nomzvbCd.js +0 -1
  226. package/dist/client/assets/file-explorer-DMVvyrkG.js +0 -2
  227. package/dist/client/assets/general-C_h_TDLy.js +0 -1
  228. package/dist/client/assets/index-B2z-OJ9z.js +0 -1
  229. package/dist/client/assets/post-editor-DyYUkUcy.js +0 -1
  230. package/dist/client/assets/project-app-view-DT8-Icbs.js +0 -1
  231. package/dist/client/assets/record-editor-CwGXwawj.js +0 -1
  232. package/dist/client/assets/redirect-editor-C3rgNZF9.js +0 -1
  233. package/dist/client/assets/registry-Bf5g_vcK.js +0 -2
  234. package/dist/client/assets/roles-dceW8mzX.js +0 -1
  235. package/dist/client/assets/select-model-CGwgvL1-.js +0 -4
  236. package/dist/client/assets/seo-editor-6gP8M2Dn.js +0 -1
  237. package/dist/client/assets/settings-layout-k2SWGDzi.js +0 -1
  238. package/dist/client/assets/shell-layout-Bz6Fy8ta.js +0 -1
  239. package/dist/client/assets/store-registry-DC157K5t.js +0 -2
  240. package/dist/client/assets/tab-id-8NbPTAxB.js +0 -1
  241. package/dist/client/assets/useInfiniteQuery-BiSANydn.js +0 -1
  242. package/dist/client/assets/useSuspenseInfiniteQuery-BMbpgKyc.js +0 -1
  243. package/dist/client/assets/variant-calendar-B4olbBIH.js +0 -1
@@ -1,6 +1,6 @@
1
- import{X as x,a2 as w,Y as i,a5 as ke,a3 as ue,a4 as Se,aH as Ie,cp as kt,bb as Ue,b0 as ot,c as W,m as It,bu as Ct,j as Y,F as J,K as ae,n as it,aI as wt,J as rt,u as Ne,o as Fe,t as de,I as me,G as fe,d as lt,f as Mt,r as S,e as Tt,b as De,p as Pt,a as At,v as _t,a9 as Rt}from"./index-DTgaKfa1.js";import{d as $t,q as Dt,A as ct,s as Et,t as Ot,n as Ut,w as Lt}from"./tab-id-8NbPTAxB.js";import{S as Nt,u as Ft,e as jt,b as qt}from"./hooks-DpMhOxp5.js";import{u as dt,c as Kt}from"./studio-tools-e62Z61Le.js";import{a as Vt,u as Qt,S as Bt}from"./use-mcp-client-DayFt0Gf.js";import{u as Ht}from"./use-virtual-mcp-DDWns2sS.js";import{p as Wt,u as zt,b as ye,i as Gt,c as Xt}from"./use-ai-providers-Du0KxunD.js";import{u as Zt}from"./use-decopilot-events-B8cCEH6l.js";import{b as Yt}from"./use-organization-settings-BlVRLL3T.js";const ve=x({connection_id:i().describe("Connection ID"),selected_tools:w(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:w(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:w(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),ut=ve.extend({selected_tools:ve.shape.selected_tools.optional(),selected_resources:ve.shape.selected_resources.optional(),selected_prompts:ve.shape.selected_prompts.optional()}),Jt=x({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),en=x({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:x({type:Ue("ext-app"),appId:i(),args:Se(i(),ot()).optional()})}),tn=x({defaultMainView:x({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:ke().nullable().optional(),cmsDefaultOpen:ke().nullable().optional(),tabs:w(en).optional()}),Ze=x({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Se(i(),ot()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Ie().int().positive().optional(),maxHeight:Ie().int().positive().optional()}),je=x({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:w(Jt).nullable().optional(),layout:tn.nullable().optional(),homeTile:Ze.nullable().optional(),homeTiles:w(Ze).nullable().optional(),homePrompts:w(i()).nullable().optional()});function is(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const s=t?.homeTile;return s?[s]:[]}const nn=/^[A-Za-z_][A-Za-z0-9_]*$/,Ye=i().min(1).regex(nn,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),sn=kt("kind",[x({key:Ye,kind:Ue("literal"),value:i()}),x({key:Ye,kind:Ue("secret"),secretId:i().min(1)})]),an=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,on=x({host:i().min(1).regex(an).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),qe=x({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:w(sn).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:w(on).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),Ke=x({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Ie().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),rn=ue(["agent-sandbox","user-desktop"]),ln=ue(["agent-sandbox","user-desktop","cluster"]);function Ve(t){return t==="cluster"?"agent-sandbox":t}const pt={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:rn.optional(),createdAt:Ie().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:x({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},ht=x(pt),cn=x({...pt,sandboxProviderKind:ln.optional()});function dn(t){const e=cn.parse(t);return ht.parse({...e,sandboxProviderKind:e.sandboxProviderKind?Ve(e.sandboxProviderKind):void 0})}function rs(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,s={};for(const[n,a]of Object.entries(e)){if(!a||typeof a!="object"||n!=="cluster"&&n!=="agent-sandbox"&&n!=="user-desktop")continue;const o=Ve(n);try{if(n==="cluster"&&s[o])continue;s[o]=dn(a)}catch{}}return s}const Qe=Se(i().describe("userId"),Se(i().describe("branch"),Se(i().describe("sandboxProviderKind"),ht))),un=x({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:ue(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:Ie().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Be=w(un).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),pn=ue(["smart","code-review","open"]),He=pn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),ls=x({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:ue(["active","inactive"]).describe("Current status"),pinned:ke().describe("Whether this space is pinned to the sidebar"),metadata:x({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:w(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:w(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().describe("Metadata"),connections:w(ve).describe("Connections with their selected tools, resources, and prompts")}),mt=x({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});x({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:ue(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:ke().optional().default(!1).describe("Pin to sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:w(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:w(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:w(ut).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:w(mt).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});x({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:ue(["active","inactive"]).optional().describe("New status"),pinned:ke().optional().describe("Pin/unpin from sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:w(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:w(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:w(ut).optional().describe("New connections (replaces existing)"),prompts:w(mt).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});const hn=Ct("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function cs(t){const e=W.c(10),{variant:s,size:n}=t;let a;e[0]!==n||e[1]!==s?(a=It(hn({variant:s,size:n})),e[0]=n,e[1]=s,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=Y.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=Y.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let l;e[5]!==a?(l=Y.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=l):l=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=Y.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let u;return e[8]!==l?(u=Y.jsxs("div",{role:"status",children:[l,p]}),e[8]=l,e[9]=u):u=e[9],u}function mn(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
2
- `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Re={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function fn(t,e){if(!t)return null;const s=e?Ve(e):null;if(t==="decopilot"&&s===null)return"decopilot";for(const[n,a]of Object.entries(Re))if(a.harness===t&&a.sandbox===s)return n;return null}function ds(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function bn(t,e){return e&&t&&Re[t].sandbox==="user-desktop"?"decopilot":t}const Je={online:!1,capabilities:[],ready:!1};function ft(t){const e=W.c(9),{org:s}=J(),n=dt(),a=t?.fast??!1;let o;e[0]!==s.id?(o=ae.currentLink(s.id),e[0]=s.id,e[1]=o):o=e[1];let r;e[2]!==n?(r=async()=>{const y=await n.call("LINK_CURRENT_GET",{});return y?{...y,ready:!0}:{...Je,ready:!0}},e[2]=n,e[3]=r):r=e[3];const l=a?1e3:1e4,p=a?2e3:15e3;let u;e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==p?(u={queryKey:o,queryFn:r,staleTime:l,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=l,e[7]=p,e[8]=u):u=e[8];const{data:m}=it(u);return m??Je}function gn(){const t=W.c(11),e=ft(),s=wt();let n;t[0]!==e.capabilities||t[1]!==e.online?(n=e.online&&e.capabilities.includes("claude-code"),t[0]=e.capabilities,t[1]=e.online,t[2]=n):n=t[2];let a;t[3]!==e.capabilities||t[4]!==e.online?(a=e.online&&e.capabilities.includes("codex"),t[3]=e.capabilities,t[4]=e.online,t[5]=a):a=t[5];let o;return t[6]!==e.online||t[7]!==s.runtime.agentSandbox||t[8]!==n||t[9]!==a?(o={agentSandbox:s.runtime.agentSandbox,userDesktop:e.online,claudeCode:n,codex:a},t[6]=e.online,t[7]=s.runtime.agentSandbox,t[8]=n,t[9]=a,t[10]=o):o=t[10],o}function yn(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function vn(t){const e=t?t.split("/").filter(Boolean):[],s=e[0]==="public",n=s?e[1]??null:null,a=s?n?`public-${n}`:null:e[0]??null,o=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:a,dirPath:o,isPublic:s,publicSet:n,readOnly:s}}function us(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const et="public-";function bt(t){return t.startsWith(et)?t.slice(et.length):null}function ps(t,e){const s=bt(t);return s?`public/${s}/${e}`:`${t}/${e}`}function Sn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function xn(t){const{volume:e,dirPath:s}=vn(t);if(!e)return null;let n;if(e==="home")n="org/home";else if(e==="outputs")n="org/.outputs";else if(e==="uploads")n="org/.uploads";else{const a=bt(e);n=a?`org/public/${a}`:`org/${e}`}return s?`${n}/${s}`:n}function kn(t){const e=W.c(21);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=rt(s);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ne(a);let r;e[2]!==o.brand||e[3]!==o.main||e[4]!==o.preview||e[5]!==o.skill?(r=(typeof o.main=="string"?$t(o.main)?.path:void 0)??o.preview??o.skill??o.brand??null,e[2]=o.brand,e[3]=o.main,e[4]=o.preview,e[5]=o.skill,e[6]=r):r=e[6];const l=r;let p;if(e[7]!==n?.params.appSlug||e[8]!==n?.params.collectionName||e[9]!==n?.params.itemId||e[10]!==l||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
3
- - ID: ${t}`),l){let m;e[13]!==l?(m=xn(l),e[13]=l,e[14]=m):m=e[14];const y=m;let I;e[15]!==l?(I=Sn(l),e[15]=l,e[16]=I):I=e[16],p.push(`### Currently Open File
1
+ import{X as x,a2 as C,Y as i,a5 as Ie,a3 as ue,a4 as xe,aH as we,cp as kt,bb as Ue,b0 as it,c as W,m as It,bu as wt,j as Y,F as J,K as oe,n as rt,aI as Ct,J as lt,u as Ne,o as Fe,t as de,I as me,G as fe,d as ct,f as Mt,r as S,e as Tt,b as Ee,p as At,a as Pt,v as _t,a9 as Rt}from"./index-INSKxT89.js";import{d as $t,q as Et,A as dt,t as Dt,u as Ot,n as Ut,w as Lt}from"./tab-id-Dk_SIAtC.js";import{S as Nt,u as Ft,e as jt,b as qt}from"./hooks-BpX9ViV0.js";import{u as ut,c as Kt}from"./studio-tools-C06bI5ga.js";import{a as Vt,u as Qt,S as Bt}from"./use-mcp-client-BJx91BEC.js";import{u as Ht}from"./use-virtual-mcp-D-ZbuaT8.js";import{p as Wt,u as zt,b as ve,i as Gt,c as Xt}from"./use-ai-providers-Do1WYhvy.js";import{u as Zt}from"./use-decopilot-events-7kVAFziy.js";import{b as Yt}from"./use-organization-settings-DzBziioM.js";const Se=x({connection_id:i().describe("Connection ID"),selected_tools:C(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:C(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:C(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),pt=Se.extend({selected_tools:Se.shape.selected_tools.optional(),selected_resources:Se.shape.selected_resources.optional(),selected_prompts:Se.shape.selected_prompts.optional()}),Jt=x({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),en=x({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:x({type:Ue("ext-app"),appId:i(),args:xe(i(),it()).optional()})}),tn=x({defaultMainView:x({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:Ie().nullable().optional(),cmsDefaultOpen:Ie().nullable().optional(),tabs:C(en).optional()}),Ye=x({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:xe(i(),it()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:we().int().positive().optional(),maxHeight:we().int().positive().optional()}),je=x({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:C(Jt).nullable().optional(),layout:tn.nullable().optional(),homeTile:Ye.nullable().optional(),homeTiles:C(Ye).nullable().optional(),homePrompts:C(i()).nullable().optional()});function ls(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const s=t?.homeTile;return s?[s]:[]}const nn=/^[A-Za-z_][A-Za-z0-9_]*$/,Je=i().min(1).regex(nn,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),sn=kt("kind",[x({key:Je,kind:Ue("literal"),value:i()}),x({key:Je,kind:Ue("secret"),secretId:i().min(1)})]),an=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,on=x({host:i().min(1).regex(an).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),qe=x({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:C(sn).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:C(on).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),Ke=x({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:we().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),rn=ue(["agent-sandbox","user-desktop"]),ln=ue(["agent-sandbox","user-desktop","cluster"]);function Ve(t){return t==="cluster"?"agent-sandbox":t}const ht={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:rn.optional(),createdAt:we().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:x({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},mt=x(ht),cn=x({...ht,sandboxProviderKind:ln.optional()});function dn(t){const e=cn.parse(t);return mt.parse({...e,sandboxProviderKind:e.sandboxProviderKind?Ve(e.sandboxProviderKind):void 0})}function cs(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,s={};for(const[n,a]of Object.entries(e)){if(!a||typeof a!="object"||n!=="cluster"&&n!=="agent-sandbox"&&n!=="user-desktop")continue;const o=Ve(n);try{if(n==="cluster"&&s[o])continue;s[o]=dn(a)}catch{}}return s}const Qe=xe(i().describe("userId"),xe(i().describe("branch"),xe(i().describe("sandboxProviderKind"),mt))),un=x({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:ue(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:we().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Be=C(un).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),pn=ue(["smart","code-review","open"]),He=pn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),ds=x({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:ue(["active","inactive"]).describe("Current status"),pinned:Ie().describe("Whether this space is pinned to the sidebar"),metadata:x({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().describe("Metadata"),connections:C(Se).describe("Connections with their selected tools, resources, and prompts")}),ft=x({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});x({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:ue(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:Ie().optional().default(!1).describe("Pin to sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(pt).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:C(ft).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});x({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:ue(["active","inactive"]).optional().describe("New status"),pinned:Ie().optional().describe("Pin/unpin from sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(pt).optional().describe("New connections (replaces existing)"),prompts:C(ft).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});const hn=wt("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function us(t){const e=W.c(10),{variant:s,size:n}=t;let a;e[0]!==n||e[1]!==s?(a=It(hn({variant:s,size:n})),e[0]=n,e[1]=s,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=Y.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=Y.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let l;e[5]!==a?(l=Y.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=l):l=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=Y.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let u;return e[8]!==l?(u=Y.jsxs("div",{role:"status",children:[l,p]}),e[8]=l,e[9]=u):u=e[9],u}function mn(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
2
+ `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Re={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function fn(t,e){if(!t)return null;const s=e?Ve(e):null;if(t==="decopilot"&&s===null)return"decopilot";for(const[n,a]of Object.entries(Re))if(a.harness===t&&a.sandbox===s)return n;return null}function bn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function gn({pendingOption:t,lockedHarness:e,availability:s}){return e==="claude-code"?"claude-code-desktop":e==="codex"?"codex-desktop":t==="claude-code-desktop"||t==="codex-desktop"?t:bn(s)}function yn(t,e){return e&&t&&Re[t].sandbox==="user-desktop"?"decopilot":t}const et={online:!1,capabilities:[],ready:!1};function bt(t){const e=W.c(9),{org:s}=J(),n=ut(),a=t?.fast??!1;let o;e[0]!==s.id?(o=oe.currentLink(s.id),e[0]=s.id,e[1]=o):o=e[1];let r;e[2]!==n?(r=async()=>{const y=await n.call("LINK_CURRENT_GET",{});return y?{...y,ready:!0}:{...et,ready:!0}},e[2]=n,e[3]=r):r=e[3];const l=a?1e3:1e4,p=a?2e3:15e3;let u;e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==p?(u={queryKey:o,queryFn:r,staleTime:l,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=l,e[7]=p,e[8]=u):u=e[8];const{data:m}=rt(u);return m??et}function vn(){const t=W.c(11),e=bt(),s=Ct();let n;t[0]!==e.capabilities||t[1]!==e.online?(n=e.online&&e.capabilities.includes("claude-code"),t[0]=e.capabilities,t[1]=e.online,t[2]=n):n=t[2];let a;t[3]!==e.capabilities||t[4]!==e.online?(a=e.online&&e.capabilities.includes("codex"),t[3]=e.capabilities,t[4]=e.online,t[5]=a):a=t[5];let o;return t[6]!==e.online||t[7]!==s.runtime.agentSandbox||t[8]!==n||t[9]!==a?(o={agentSandbox:s.runtime.agentSandbox,userDesktop:e.online,claudeCode:n,codex:a},t[6]=e.online,t[7]=s.runtime.agentSandbox,t[8]=n,t[9]=a,t[10]=o):o=t[10],o}function Sn(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function xn(t){const e=t?t.split("/").filter(Boolean):[],s=e[0]==="public",n=s?e[1]??null:null,a=s?n?`public-${n}`:null:e[0]??null,o=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:a,dirPath:o,isPublic:s,publicSet:n,readOnly:s}}function ps(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const tt="public-";function gt(t){return t.startsWith(tt)?t.slice(tt.length):null}function hs(t,e){const s=gt(t);return s?`public/${s}/${e}`:`${t}/${e}`}function kn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function In(t){const{volume:e,dirPath:s}=xn(t);if(!e)return null;let n;if(e==="home")n="org/home";else if(e==="outputs")n="org/.outputs";else if(e==="uploads")n="org/.uploads";else{const a=gt(e);n=a?`org/public/${a}`:`org/${e}`}return s?`${n}/${s}`:n}function wn(t){const e=W.c(21);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=lt(s);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ne(a);let r;e[2]!==o.brand||e[3]!==o.main||e[4]!==o.preview||e[5]!==o.skill?(r=(typeof o.main=="string"?$t(o.main)?.path:void 0)??o.preview??o.skill??o.brand??null,e[2]=o.brand,e[3]=o.main,e[4]=o.preview,e[5]=o.skill,e[6]=r):r=e[6];const l=r;let p;if(e[7]!==n?.params.appSlug||e[8]!==n?.params.collectionName||e[9]!==n?.params.itemId||e[10]!==l||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
3
+ - ID: ${t}`),l){let m;e[13]!==l?(m=In(l),e[13]=l,e[14]=m):m=e[14];const y=m;let I;e[15]!==l?(I=kn(l),e[15]=l,e[16]=I):I=e[16],p.push(`### Currently Open File
4
4
  The user has this file open in the Library and is most likely referring to it:
5
5
  - Name: ${I}
6
6
  - Library path: ${l}${y?`
@@ -13,24 +13,24 @@ ${u.join(`
13
13
 
14
14
  Help the user understand and work with this resource.`),e[7]=n?.params.appSlug,e[8]=n?.params.collectionName,e[9]=n?.params.itemId,e[10]=l,e[11]=t,e[12]=p}else p=e[12];return p.join(`
15
15
 
16
- `)}function In(){const t=W.c(5),e=Fe(),{org:s}=J();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const a=rt(n);let o;return t[1]!==a?.params||t[2]!==s||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const u=p[1],m=a?.params.appSlug;if(!m)return;e.invalidateQueries({queryKey:ae.collection(s.slug,m,u)});const y=u.toLowerCase().replace(/_/g," ");de.success(`${y} updated`)},t[1]=a?.params,t[2]=s,t[3]=e,t[4]=o):o=t[4],o}function Cn(){const t=W.c(4),{org:e,project:s}=J(),n=`${e.id}/${s.id}`;let a;t[0]!==n?(a=fe.taskLastViewed(n),t[0]=n,t[1]=a):a=t[1];const[,o]=me(a,wn);let r;return t[2]!==o?(r={markTaskRead:p=>{o(u=>({...u,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function wn(t){return t??{}}function gt(){const t=lt(),{org:e}=J(),s=Ne({strict:!1}),n=Mt({strict:!1}),a=s.virtualmcpid??Vt(e.id).id,o=(p,u)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:m=>{const y={},I=u?.virtualMcpId??m.virtualmcpid;I&&(y.virtualmcpid=I);const f=m.main;return f&&typeof f=="string"&&!Dt(f)&&(y.main=f),(m.sidepanel==="chat"||m.sidepanel===0)&&(y.sidepanel=m.sidepanel),u?.autosend&&(y.autosend=ct),y}})},r=S.useRef(crypto.randomUUID()),l=n.taskId??r.current;return{virtualMcpId:a,taskId:l,navigateToTask:o}}function Mn(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(n),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
17
- ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function tt(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
18
- ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Tn(t,e){const s=(t.files??[]).filter(r=>r.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const a=s.map(r=>`<skill-file path="${r.relPath}">
16
+ `)}function Cn(){const t=W.c(5),e=Fe(),{org:s}=J();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const a=lt(n);let o;return t[1]!==a?.params||t[2]!==s||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const u=p[1],m=a?.params.appSlug;if(!m)return;e.invalidateQueries({queryKey:oe.collection(s.slug,m,u)});const y=u.toLowerCase().replace(/_/g," ");de.success(`${y} updated`)},t[1]=a?.params,t[2]=s,t[3]=e,t[4]=o):o=t[4],o}function Mn(){const t=W.c(4),{org:e,project:s}=J(),n=`${e.id}/${s.id}`;let a;t[0]!==n?(a=fe.taskLastViewed(n),t[0]=n,t[1]=a):a=t[1];const[,o]=me(a,Tn);let r;return t[2]!==o?(r={markTaskRead:p=>{o(u=>({...u,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Tn(t){return t??{}}function yt(){const t=ct(),{org:e}=J(),s=Ne({strict:!1}),n=Mt({strict:!1}),a=s.virtualmcpid??Vt(e.id).id,o=(p,u)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:m=>{const y={},I=u?.virtualMcpId??m.virtualmcpid;I&&(y.virtualmcpid=I);const f=m.main;return f&&typeof f=="string"&&!Et(f)&&(y.main=f),(m.sidepanel==="chat"||m.sidepanel===0)&&(y.sidepanel=m.sidepanel),u?.autosend&&(y.autosend=dt),y}})},r=S.useRef(crypto.randomUUID()),l=n.taskId??r.current;return{virtualMcpId:a,taskId:l,navigateToTask:o}}function An(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(n),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
17
+ ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function nt(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
18
+ ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Pn(t,e){const s=(t.files??[]).filter(r=>r.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const a=s.map(r=>`<skill-file path="${r.relPath}">
19
19
  ${r.content.trim()}
20
20
  </skill-file>`).join(`
21
21
 
22
22
  `),o=n.length>0?`
23
23
 
24
24
  Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{type:"text",text:`[${e}]
25
- ${a}${o}`}]}function Pn(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const a=Array.isArray(n.content)?n.content:[n.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;s.push({type:"text",text:`[${e}]
25
+ ${a}${o}`}]}function _n(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const a=Array.isArray(n.content)?n.content:[n.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;s.push({type:"text",text:`[${e}]
26
26
  ${r}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;s.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const r=o.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?s.push({type:"text",text:`[${e}]
27
- ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&s.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return s}function yt(t){if(!t)return[];const e=[];let s="";const n=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")s+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(a.attrs.kind==="task"){const l=a.attrs.metadata,p=l?.title??a.attrs.name??"",u=l?.context?.trim()||[p,l?.description?.trim()].filter(Boolean).join(`
27
+ ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&s.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return s}function vt(t){if(!t)return[];const e=[];let s="";const n=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")s+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(a.attrs.kind==="task"){const l=a.attrs.metadata,p=l?.title??a.attrs.name??"",u=l?.context?.trim()||[p,l?.description?.trim()].filter(Boolean).join(`
28
28
 
29
29
  `);u&&e.push({type:"text",text:u});return}if(s+=r,o==="@"){const l=a.attrs.metadata;l&&typeof l=="object"&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??a.attrs.name} (agent_id: ${l.agentId})]
30
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...tt(l,r))}else if(a.attrs.kind==="skill"){const l=a.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Tn(l,r))}else{const l=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(l)&&l.length>0&&typeof l[0]=="object"&&l[0]!==null&&"role"in l[0]?e.push(...Pn(l,r)):Array.isArray(l)&&e.push(...tt(l,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;s+=r,e.push(...Mn(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)n(o)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function hs(t){const e=yt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function ms(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function An(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function fs(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function _n(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function Rn(t,e){return t.filter(s=>s.messageId!==e)}const nt=new Map,We=new Set;function $n(t){We.add(t)}function Dn(t){return We.has(t)}function En(t){We.delete(t)}function Ce(t){let e=nt.get(t);return e||(e=new Nt([]),nt.set(t,e)),e}function vt(t,e){Ce(t).update(s=>_n(s,e))}function Le(t,e){Ce(t).update(s=>Rn(s,e))}function On(t,e){Ce(t).set(e)}const $e=new Map;function Un(t,e){$e.set(`${t}:${e.id}`,e)}function Ln(t,e){const s=`${t}:${e}`,n=$e.get(s);return $e.delete(s),n}function st(t,e){$e.delete(`${t}:${e}`)}async function se(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();On(e,n.items??[])}catch{}}function bs(t){const e=W.c(2);let s;e[0]!==t?(s=Ce(t),e[0]=t,e[1]=s):s=e[1];const n=s;return S.useSyncExternalStore(n.subscribe,n.get,n.get)}function Nn(){const{org:t}=J();return{enqueue:vt,refresh:e=>se(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;Le(e,s);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return de.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await se(t.slug,e)}}}}const xe={tiers:{}};function Fn(){const t=W.c(7),{org:e}=J();let s;t[0]!==e.id?(s=ae.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const o=await Kt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return o?.tiers?o:xe},t[2]=e.slug,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=a):a=t[6],it(a)}function jn(){return Fn().data??xe}function gs(){const t=W.c(19),{org:e}=J(),s=dt(),n=Fe();let a;t[0]!==e.id?(a=ae.userModelPreferences(e.id),t[0]=e.id,t[1]=a):a=t[1];const o=a;let r;t[2]!==o||t[3]!==n||t[4]!==s?(r=async I=>{const f=n.getQueryData(o)??xe;return await s.call("USER_MODEL_PREFERENCES_UPDATE",f)??f},t[2]=o,t[3]=n,t[4]=s,t[5]=r):r=t[5];let l,p,u,m;t[6]!==o||t[7]!==n?(l=I=>{const{tier:f,slot:T}=I,K=n.getQueryData(o),F=K??xe;return n.setQueryData(o,{tiers:{...F.tiers,[f]:T}}),{prev:K}},p=(I,f,T)=>{n.setQueryData(o,T?.prev??xe)},u=I=>{n.setQueryData(o,I)},m=()=>{n.isMutating({mutationKey:o})===1&&n.invalidateQueries({queryKey:o})},t[6]=o,t[7]=n,t[8]=l,t[9]=p,t[10]=u,t[11]=m):(l=t[8],p=t[9],u=t[10],m=t[11]);let y;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==p||t[16]!==u||t[17]!==m?(y={mutationKey:o,mutationFn:r,onMutate:l,onError:p,onSuccess:u,onSettled:m},t[12]=o,t[13]=r,t[14]=l,t[15]=p,t[16]=u,t[17]=m,t[18]=y):y=t[18],Tt(y)}function qn(){const t=W.c(5),e=Yt(),s=jn(),n=s.tiers.fast??e.tiers.fast,a=s.tiers.smart??e.tiers.smart,o=s.tiers.thinking??e.tiers.thinking;let r;return t[0]!==e.tiers||t[1]!==n||t[2]!==a||t[3]!==o?(r={tiers:{...e.tiers,fast:n,smart:a,thinking:o}},t[0]=e.tiers,t[1]=n,t[2]=a,t[3]=o,t[4]=r):r=t[4],r}function le(t,e,s,n){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=s.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Kn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Vn(t,e,s,n){if(!s||n.length===0)return null;const a=e.find(p=>p.id===s);if(!a)return null;const o=Wt([a],{[s]:n}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const l=n.find(p=>p.modelId===r.modelId);return l?{...l,keyId:s}:null}const at=new Set,ce=new Set;function he(t){return S.useSyncExternalStore(t.subscribe,t.get,t.get)}function Qn(t){return t.kind==="loading"?"ready":t.kind}const Bn=1e4,Hn=10,ze=S.createContext(null),Ge=S.createContext(null),Xe=S.createContext(null),St=S.createContext(null);function Wn({children:t}){const{locator:e}=J(),{virtualMcpId:s}=gt(),[n,a]=me(fe.chatSelectedImageModel(e),null),[o,r]=me(fe.chatSelectedWebSearchModel(e),null),[l,p]=me(fe.chatSelectedDeepResearchModel(e),null),[u,m]=S.useState(null),[y,I]=S.useState("default"),f=qn(),[T,K]=me(fe.chatSimpleModeTier(e),null),F=Kn(T),C=zt(),P=f.tiers[F],j=u&&C.some(c=>c.id===u)?u:P?.keyId??C[0]?.id??null,{models:q,isLoading:_}=ye(j??void 0),{models:z}=ye(P?.keyId),{models:oe}=ye(f.tiers.image?.keyId),{models:E}=ye(f.tiers.web_search?.keyId),{models:V}=ye(f.tiers.deep_research?.keyId),te=le(P,C,z,P?.title)??Vn(F,C,j,q),ee=_,G=q.filter(c=>c.capabilities?.includes("image")),Q=le(n,C,G),ne=le(f.tiers.image,C,oe,f.tiers.image?.title)??Q??G[0]??null,b=q.filter(Gt),L=le(o,C,b),X=b.find(c=>c.modelId==="perplexity/sonar")??b[0]??null,Z=le(f.tiers.web_search,C,E,f.tiers.web_search?.title)??L??X,B=q.filter(Xt),A=le(l,C,B),H=B.find(c=>c.modelId==="perplexity/deep-research")??B.find(c=>c.asyncResearch===!0)??B[0]??null,$=le(f.tiers.deep_research,C,V,f.tiers.deep_research?.title)??A??H,Ee=Ht(s)??{id:s,title:"",description:null,icon:null},[we,Me]=S.useState({}),Te=(c,O)=>{const U=[];for(const D of O.content??[])D.type==="text"&&D.text?.trim()&&U.push(D.text.trim());const M=U.join(`
31
- `);if(!M){be(c);return}new TextEncoder().encode(M).length>Bn||Me(D=>Object.keys(D).length>=Hn&&!(c in D)?D:{...D,[c]:M})},be=c=>{Me(O=>{const{[c]:U,...M}=O;return M})},[Pe,pe]=me(fe.chatLastAgentOption(e),c=>c&&c in Re?c:null),re=Xn(),Oe=re?.isThreadLocked&&re.lockedHarness!=null?fn(re.lockedHarness,re.lockedSandbox):null,Ae=ft();gn();const _e=bn(Pe??null,Ae.ready&&!Ae.online),ge=re?.isThreadLocked?Oe:_e,d=ge?Re[ge]:null,h=d?.harness??null,N=d?.sandbox??null,[R,g]=S.useState(void 0),k=S.useRef(R);k.current=R;const v={selectedModel:te,setModel:()=>{},credentialId:j,setCredentialId:m,allModelsConnections:C,isModelsLoading:ee,selectedVirtualMcp:Ee,imageModel:ne,setImageModel:c=>{a(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:Z,setWebSearchModel:c=>{r(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:$,setDeepResearchModel:c=>{p(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:y,setChatMode:I,appContexts:we,setAppContext:Te,clearAppContext:be,tiptapDoc:R,setTiptapDoc:g,tiptapDocRef:k,resetInteraction:()=>{},simpleModeTier:F,setSimpleModeTier:c=>K(c),pendingAgentOption:ge,setPendingAgentOption:pe,pendingHarnessId:h,pendingSandboxProviderKind:N};return Y.jsx(Xe.Provider,{value:v,children:t})}function ys(t){const e=W.c(41),{virtualMcpId:s,task:n,children:a}=t,{locator:o}=J(),{data:r}=At.useSession(),l=r?.user??null,{taskId:p,virtualMcpId:u,navigateToTask:m}=gt(),[y]=_t(),{markTaskRead:I}=Cn(),f=qt(),T=p,K=u,F=kn(K);let C;e[0]!==I||e[1]!==m?(C=(A,H)=>{I(A),m(A,{virtualMcpId:H?.virtualMcpId,autosend:H?.autosend})},e[0]=I,e[1]=m,e[2]=C):C=e[2];const P=C,j=T&&n?.id===T?n:null,q=j?.harness_id??null,_=j?.sandbox_provider_kind??null,z=j?.branch??null,oe=q!=null,E=z;let V;e[3]!==E||e[4]!==P||e[5]!==f||e[6]!==s?(V=()=>{const A=crypto.randomUUID();return f.create({id:A,virtual_mcp_id:s,...E?{branch:E}:{}}).then(()=>P(A)).catch(()=>{P(A)}),A},e[3]=E,e[4]=P,e[5]=f,e[6]=s,e[7]=V):V=e[7];const te=V;let ee;e[8]!==E||e[9]!==o||e[10]!==P||e[11]!==f||e[12]!==s?(ee=A=>{const H=crypto.randomUUID(),$=A.virtualMcpId??s,ie=$===s?E:null;Lt(sessionStorage,o,H,A.message),f.create({id:H,virtual_mcp_id:$,...ie?{branch:ie}:{}}).then(()=>P(H,{virtualMcpId:A.virtualMcpId,autosend:!0})).catch(()=>{P(H,{virtualMcpId:A.virtualMcpId,autosend:!0})})},e[8]=E,e[9]=o,e[10]=P,e[11]=f,e[12]=s,e[13]=ee):ee=e[13];const G=ee;let Q;e[14]!==T||e[15]!==f?(Q=A=>{T&&f.setBranch(T,A)},e[14]=T,e[15]=f,e[16]=Q):Q=e[16];let ne;e[17]!==j||e[18]!==te||e[19]!==G||e[20]!==E||e[21]!==T||e[22]!==K||e[23]!==oe||e[24]!==z||e[25]!==q||e[26]!==_||e[27]!==P||e[28]!==Q?(ne={virtualMcpId:K,taskId:T,openTask:P,createTask:te,createTaskWithMessage:G,activeTask:j,isThreadLocked:oe,lockedHarness:q,lockedSandbox:_,lockedBranch:z,currentBranch:E,setCurrentTaskBranch:Q},e[17]=j,e[18]=te,e[19]=G,e[20]=E,e[21]=T,e[22]=K,e[23]=oe,e[24]=z,e[25]=q,e[26]=_,e[27]=P,e[28]=Q,e[29]=ne):ne=e[29];const b=ne;let L;e[30]!==F||e[31]!==y||e[32]!==m||e[33]!==l?(L={user:l,contextPrompt:F,preferences:y,rawNavigateToTask:m},e[30]=F,e[31]=y,e[32]=m,e[33]=l,e[34]=L):L=e[34];const X=L;let Z;e[35]!==a||e[36]!==X?(Z=Y.jsx(Wn,{children:Y.jsx(St.Provider,{value:X,children:a})}),e[35]=a,e[36]=X,e[37]=Z):Z=e[37];let B;return e[38]!==Z||e[39]!==b?(B=Y.jsx(Ge.Provider,{value:b,children:Z}),e[38]=Z,e[39]=b,e[40]=B):B=e[40],B}function vs({taskId:t,children:e}){const s=De(),{virtualMcpId:n,activeTask:a,currentBranch:o}=zn();t&&!at.has(t)&&(at.add(t),Pt("chat_opened",{thread_id:t}));const{imageModel:r,webSearchModel:l,deepResearchModel:p,chatMode:u,setChatMode:m,appContexts:y,setTiptapDoc:I,simpleModeTier:f,pendingSandboxProviderKind:T,pendingHarnessId:K}=Gn(),F=S.useContext(St);if(!F)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:C,contextPrompt:P,preferences:j,rawNavigateToTask:q}=F,{org:_,locator:z}=J(),oe=Nn(),[E,V]=S.useState(null),te=In(),ee=Fe(),G=Ft(),Q=lt(),ne=Qt({connectionId:Bt,orgId:_.id,orgSlug:_.slug}),b=jt(_.slug,t,{client:ne});S.use(b.ready);const L=he(b.messages),X=he(b.status),Z=he(b.finishReason),B=he(b.runStatusStage),A=he(b.hasMoreOlder),H=he(b.isFetchingOlder),$=S.useRef({onToolCall:te,queryClient:ee,rawNavigateToTask:q,taskId:t,manager:G,navigate:Q,orgId:_.id,orgSlug:_.slug});$.current={onToolCall:te,queryClient:ee,rawNavigateToTask:q,taskId:t,manager:G,navigate:Q,orgId:_.id,orgSlug:_.slug},Zt({orgSlug:_.slug,taskId:t,onTaskStatus:d=>{const h=$.current,N=d.data.message_id;if(d.data.status==="in_progress"&&N){Le(h.taskId,N);const R=Ln(h.taskId,N);R&&b.applyLocalMessage(R),se(h.orgSlug,h.taskId)}Dn(h.taskId)&&(async()=>(await se(h.orgSlug,h.taskId),await b.reconcileFromServer()&&Ce(h.taskId).get().length===0&&En(h.taskId)))()}}),S.useEffect(()=>{const d={onData:g=>{if(g.type==="data-thread-title"){const k=g.data;if(!k?.title)return;const v=$.current;if(!v.taskId)return;v.manager.patchThread({id:v.taskId,title:k.title,updated_at:new Date().toISOString()});return}if(g.type==="data-deck-updated"){const k=g.data;if(!k?.path)return;const v=k.path,c=$.current;c.queryClient.invalidateQueries({queryKey:ae.orgFsStat(c.orgId,"home",v)}),c.queryClient.invalidateQueries({queryKey:ae.orgFsRecent(c.orgId)}),c.navigate({to:".",search:O=>({...O,main:Ut(v)}),replace:!0});return}if(g.type==="data-open-preview"){const k=g.data,v=$.current,c=v.taskId;if(c){const O=v.manager.threads.get().find(U=>U.id===c);v.manager.patchThread({id:c,...k?.branch?{branch:k.branch}:{},...k?.sandboxProviderKind?{sandbox_provider_kind:k.sandboxProviderKind}:{},metadata:{...O?.metadata??{},...k?.githubRepo?{githubRepo:k.githubRepo}:{},...k?.sandboxMap?{sandboxMap:k.sandboxMap}:{}}})}v.navigate({to:".",search:O=>({...O,main:"preview"}),replace:!0});return}},onFinish:(g,k,v)=>{const c=$.current;c.taskId&&se(c.orgSlug,c.taskId),c.taskId&&c.manager.patchThread({id:c.taskId,status:mn(v,g.parts),updated_at:new Date().toISOString()});const O=g.parts?.some(M=>{const D=M;return(D.type==="tool-share_with_user"||D.type==="tool-bash"||D.type==="tool-write")&&D.state==="output-available"});if(c.taskId&&O){const M=ae.threadOutputs(c.taskId);for(const D of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{c.queryClient.invalidateQueries({queryKey:M})},D)}c.queryClient.invalidateQueries({queryKey:ae.homeNextActions(c.orgSlug)});const U=g.metadata?.thread_id;U&&U!==c.taskId&&c.rawNavigateToTask(U)},onError:g=>{V(g),console.error("[chat] Error",g)},onToolCall:g=>$.current.onToolCall(g)};b.observer=d,se($.current.orgSlug,$.current.taskId);const h=g=>g==="submitted"||g==="streaming";let N=h(b.status.get().kind);const R=b.status.subscribe(()=>{const g=h(b.status.get().kind);if(g===N)return;N=g;const k=$.current;se(k.orgSlug,k.taskId)});return()=>{b.observer===d&&(b.observer=null),R()}},[b]);const ie=X.kind==="submitted"||X.kind==="streaming",Ee=L.length===0,we=L.at(-1),Me=!ie&&we?.role==="assistant"&&we.parts.some(d=>"state"in d&&d.state==="approval-requested"),Te=a,be=(Te?.status==="in_progress"||Te?.status==="expired")&&X.kind==="ready"&&L.length>0;async function Pe(d){const h=t,N=n,R=Object.entries(y),g=R.length>0?R.map(([U,M])=>`### App Context: ${U}
30
+ Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...nt(l,r))}else if(a.attrs.kind==="skill"){const l=a.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Pn(l,r))}else{const l=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(l)&&l.length>0&&typeof l[0]=="object"&&l[0]!==null&&"role"in l[0]?e.push(..._n(l,r)):Array.isArray(l)&&e.push(...nt(l,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;s+=r,e.push(...An(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)n(o)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function ms(t){const e=vt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function fs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Rn(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function bs(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function $n(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function En(t,e){return t.filter(s=>s.messageId!==e)}const st=new Map,We=new Set;function Dn(t){We.add(t)}function On(t){return We.has(t)}function Un(t){We.delete(t)}function Ce(t){let e=st.get(t);return e||(e=new Nt([]),st.set(t,e)),e}function St(t,e){Ce(t).update(s=>$n(s,e))}function Le(t,e){Ce(t).update(s=>En(s,e))}function Ln(t,e){Ce(t).set(e)}const $e=new Map;function Nn(t,e){$e.set(`${t}:${e.id}`,e)}function Fn(t,e){const s=`${t}:${e}`,n=$e.get(s);return $e.delete(s),n}function at(t,e){$e.delete(`${t}:${e}`)}async function ae(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();Ln(e,n.items??[])}catch{}}function gs(t){const e=W.c(2);let s;e[0]!==t?(s=Ce(t),e[0]=t,e[1]=s):s=e[1];const n=s;return S.useSyncExternalStore(n.subscribe,n.get,n.get)}function jn(){const{org:t}=J();return{enqueue:St,refresh:e=>ae(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;Le(e,s);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return de.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await ae(t.slug,e)}}}}const ke={tiers:{}};function qn(){const t=W.c(7),{org:e}=J();let s;t[0]!==e.id?(s=oe.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const o=await Kt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return o?.tiers?o:ke},t[2]=e.slug,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=a):a=t[6],rt(a)}function Kn(){return qn().data??ke}function ys(){const t=W.c(19),{org:e}=J(),s=ut(),n=Fe();let a;t[0]!==e.id?(a=oe.userModelPreferences(e.id),t[0]=e.id,t[1]=a):a=t[1];const o=a;let r;t[2]!==o||t[3]!==n||t[4]!==s?(r=async I=>{const f=n.getQueryData(o)??ke;return await s.call("USER_MODEL_PREFERENCES_UPDATE",f)??f},t[2]=o,t[3]=n,t[4]=s,t[5]=r):r=t[5];let l,p,u,m;t[6]!==o||t[7]!==n?(l=I=>{const{tier:f,slot:T}=I,K=n.getQueryData(o),F=K??ke;return n.setQueryData(o,{tiers:{...F.tiers,[f]:T}}),{prev:K}},p=(I,f,T)=>{n.setQueryData(o,T?.prev??ke)},u=I=>{n.setQueryData(o,I)},m=()=>{n.isMutating({mutationKey:o})===1&&n.invalidateQueries({queryKey:o})},t[6]=o,t[7]=n,t[8]=l,t[9]=p,t[10]=u,t[11]=m):(l=t[8],p=t[9],u=t[10],m=t[11]);let y;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==p||t[16]!==u||t[17]!==m?(y={mutationKey:o,mutationFn:r,onMutate:l,onError:p,onSuccess:u,onSettled:m},t[12]=o,t[13]=r,t[14]=l,t[15]=p,t[16]=u,t[17]=m,t[18]=y):y=t[18],Tt(y)}function Vn(){const t=W.c(5),e=Yt(),s=Kn(),n=s.tiers.fast??e.tiers.fast,a=s.tiers.smart??e.tiers.smart,o=s.tiers.thinking??e.tiers.thinking;let r;return t[0]!==e.tiers||t[1]!==n||t[2]!==a||t[3]!==o?(r={tiers:{...e.tiers,fast:n,smart:a,thinking:o}},t[0]=e.tiers,t[1]=n,t[2]=a,t[3]=o,t[4]=r):r=t[4],r}function le(t,e,s,n){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=s.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Qn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Bn(t,e,s,n){if(!s||n.length===0)return null;const a=e.find(p=>p.id===s);if(!a)return null;const o=Wt([a],{[s]:n}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const l=n.find(p=>p.modelId===r.modelId);return l?{...l,keyId:s}:null}const ot=new Set,ce=new Set;function he(t){return S.useSyncExternalStore(t.subscribe,t.get,t.get)}function Hn(t){return t.kind==="loading"?"ready":t.kind}const Wn=1e4,zn=10,ze=S.createContext(null),Ge=S.createContext(null),Xe=S.createContext(null),xt=S.createContext(null);function Gn({children:t}){const{locator:e}=J(),{virtualMcpId:s}=yt(),[n,a]=me(fe.chatSelectedImageModel(e),null),[o,r]=me(fe.chatSelectedWebSearchModel(e),null),[l,p]=me(fe.chatSelectedDeepResearchModel(e),null),[u,m]=S.useState(null),[y,I]=S.useState("default"),f=Vn(),[T,K]=me(fe.chatSimpleModeTier(e),null),F=Qn(T),w=zt(),A=f.tiers[F],j=u&&w.some(c=>c.id===u)?u:A?.keyId??w[0]?.id??null,{models:q,isLoading:_}=ve(j??void 0),{models:z}=ve(A?.keyId),{models:ie}=ve(f.tiers.image?.keyId),{models:D}=ve(f.tiers.web_search?.keyId),{models:V}=ve(f.tiers.deep_research?.keyId),ne=le(A,w,z,A?.title)??Bn(F,w,j,q),ee=_,G=q.filter(c=>c.capabilities?.includes("image")),Q=le(n,w,G),se=le(f.tiers.image,w,ie,f.tiers.image?.title)??Q??G[0]??null,b=q.filter(Gt),L=le(o,w,b),X=b.find(c=>c.modelId==="perplexity/sonar")??b[0]??null,Z=le(f.tiers.web_search,w,D,f.tiers.web_search?.title)??L??X,B=q.filter(Xt),P=le(l,w,B),H=B.find(c=>c.modelId==="perplexity/deep-research")??B.find(c=>c.asyncResearch===!0)??B[0]??null,$=le(f.tiers.deep_research,w,V,f.tiers.deep_research?.title)??P??H,De=Ht(s)??{id:s,title:"",description:null,icon:null},[Me,Te]=S.useState({}),Ae=(c,O)=>{const U=[];for(const E of O.content??[])E.type==="text"&&E.text?.trim()&&U.push(E.text.trim());const M=U.join(`
31
+ `);if(!M){be(c);return}new TextEncoder().encode(M).length>Wn||Te(E=>Object.keys(E).length>=zn&&!(c in E)?E:{...E,[c]:M})},be=c=>{Te(O=>{const{[c]:U,...M}=O;return M})},[ge,pe]=me(fe.chatLastAgentOption(e),c=>c&&c in Re?c:null),te=Yn(),Oe=te?.isThreadLocked&&te.lockedHarness!=null?fn(te.lockedHarness,te.lockedSandbox):null,Pe=bt(),Ze=vn();gn({pendingOption:ge,lockedHarness:te?.isThreadLocked?te.lockedHarness:null,availability:Ze});const _e=yn(ge,Pe.ready&&!Pe.online),ye=te?.isThreadLocked?Oe:_e,d=ye?Re[ye]:null,h=d?.harness??null,N=d?.sandbox??null,[R,g]=S.useState(void 0),k=S.useRef(R);k.current=R;const v={selectedModel:ne,setModel:()=>{},credentialId:j,setCredentialId:m,allModelsConnections:w,isModelsLoading:ee,selectedVirtualMcp:De,imageModel:se,setImageModel:c=>{a(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:Z,setWebSearchModel:c=>{r(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:$,setDeepResearchModel:c=>{p(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:y,setChatMode:I,appContexts:Me,setAppContext:Ae,clearAppContext:be,tiptapDoc:R,setTiptapDoc:g,tiptapDocRef:k,resetInteraction:()=>{},simpleModeTier:F,setSimpleModeTier:c=>K(c),pendingAgentOption:ye,setPendingAgentOption:pe,pendingHarnessId:h,pendingSandboxProviderKind:N};return Y.jsx(Xe.Provider,{value:v,children:t})}function vs(t){const e=W.c(41),{virtualMcpId:s,task:n,children:a}=t,{locator:o}=J(),{data:r}=Pt.useSession(),l=r?.user??null,{taskId:p,virtualMcpId:u,navigateToTask:m}=yt(),[y]=_t(),{markTaskRead:I}=Mn(),f=qt(),T=p,K=u,F=wn(K);let w;e[0]!==I||e[1]!==m?(w=(P,H)=>{I(P),m(P,{virtualMcpId:H?.virtualMcpId,autosend:H?.autosend})},e[0]=I,e[1]=m,e[2]=w):w=e[2];const A=w,j=T&&n?.id===T?n:null,q=j?.harness_id??null,_=j?.sandbox_provider_kind??null,z=j?.branch??null,ie=q!=null,D=z;let V;e[3]!==D||e[4]!==A||e[5]!==f||e[6]!==s?(V=()=>{const P=crypto.randomUUID();return f.create({id:P,virtual_mcp_id:s,...D?{branch:D}:{}}).then(()=>A(P)).catch(()=>{A(P)}),P},e[3]=D,e[4]=A,e[5]=f,e[6]=s,e[7]=V):V=e[7];const ne=V;let ee;e[8]!==D||e[9]!==o||e[10]!==A||e[11]!==f||e[12]!==s?(ee=P=>{const H=crypto.randomUUID(),$=P.virtualMcpId??s,re=$===s?D:null;Lt(sessionStorage,o,H,P.message),f.create({id:H,virtual_mcp_id:$,...re?{branch:re}:{}}).then(()=>A(H,{virtualMcpId:P.virtualMcpId,autosend:!0})).catch(()=>{A(H,{virtualMcpId:P.virtualMcpId,autosend:!0})})},e[8]=D,e[9]=o,e[10]=A,e[11]=f,e[12]=s,e[13]=ee):ee=e[13];const G=ee;let Q;e[14]!==T||e[15]!==f?(Q=P=>{T&&f.setBranch(T,P)},e[14]=T,e[15]=f,e[16]=Q):Q=e[16];let se;e[17]!==j||e[18]!==ne||e[19]!==G||e[20]!==D||e[21]!==T||e[22]!==K||e[23]!==ie||e[24]!==z||e[25]!==q||e[26]!==_||e[27]!==A||e[28]!==Q?(se={virtualMcpId:K,taskId:T,openTask:A,createTask:ne,createTaskWithMessage:G,activeTask:j,isThreadLocked:ie,lockedHarness:q,lockedSandbox:_,lockedBranch:z,currentBranch:D,setCurrentTaskBranch:Q},e[17]=j,e[18]=ne,e[19]=G,e[20]=D,e[21]=T,e[22]=K,e[23]=ie,e[24]=z,e[25]=q,e[26]=_,e[27]=A,e[28]=Q,e[29]=se):se=e[29];const b=se;let L;e[30]!==F||e[31]!==y||e[32]!==m||e[33]!==l?(L={user:l,contextPrompt:F,preferences:y,rawNavigateToTask:m},e[30]=F,e[31]=y,e[32]=m,e[33]=l,e[34]=L):L=e[34];const X=L;let Z;e[35]!==a||e[36]!==X?(Z=Y.jsx(Gn,{children:Y.jsx(xt.Provider,{value:X,children:a})}),e[35]=a,e[36]=X,e[37]=Z):Z=e[37];let B;return e[38]!==Z||e[39]!==b?(B=Y.jsx(Ge.Provider,{value:b,children:Z}),e[38]=Z,e[39]=b,e[40]=B):B=e[40],B}function Ss({taskId:t,children:e}){const s=Ee(),{virtualMcpId:n,activeTask:a,currentBranch:o}=Xn();t&&!ot.has(t)&&(ot.add(t),At("chat_opened",{thread_id:t}));const{imageModel:r,webSearchModel:l,deepResearchModel:p,chatMode:u,setChatMode:m,appContexts:y,setTiptapDoc:I,simpleModeTier:f,pendingSandboxProviderKind:T,pendingHarnessId:K}=Zn(),F=S.useContext(xt);if(!F)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:w,contextPrompt:A,preferences:j,rawNavigateToTask:q}=F,{org:_,locator:z}=J(),ie=jn(),[D,V]=S.useState(null),ne=Cn(),ee=Fe(),G=Ft(),Q=ct(),se=Qt({connectionId:Bt,orgId:_.id,orgSlug:_.slug}),b=jt(_.slug,t,{client:se});S.use(b.ready);const L=he(b.messages),X=he(b.status),Z=he(b.finishReason),B=he(b.runStatusStage),P=he(b.hasMoreOlder),H=he(b.isFetchingOlder),$=S.useRef({onToolCall:ne,queryClient:ee,rawNavigateToTask:q,taskId:t,manager:G,navigate:Q,orgId:_.id,orgSlug:_.slug});$.current={onToolCall:ne,queryClient:ee,rawNavigateToTask:q,taskId:t,manager:G,navigate:Q,orgId:_.id,orgSlug:_.slug},Zt({orgSlug:_.slug,taskId:t,onTaskStatus:d=>{const h=$.current,N=d.data.message_id;if(d.data.status==="in_progress"&&N){Le(h.taskId,N);const R=Fn(h.taskId,N);R&&b.applyLocalMessage(R),ae(h.orgSlug,h.taskId)}On(h.taskId)&&(async()=>(await ae(h.orgSlug,h.taskId),await b.reconcileFromServer()&&Ce(h.taskId).get().length===0&&Un(h.taskId)))()}}),S.useEffect(()=>{const d={onData:g=>{if(g.type==="data-thread-title"){const k=g.data;if(!k?.title)return;const v=$.current;if(!v.taskId)return;v.manager.patchThread({id:v.taskId,title:k.title,updated_at:new Date().toISOString()});return}if(g.type==="data-deck-updated"){const k=g.data;if(!k?.path)return;const v=k.path,c=$.current;c.queryClient.invalidateQueries({queryKey:oe.orgFsStat(c.orgId,"home",v)}),c.queryClient.invalidateQueries({queryKey:oe.orgFsRecent(c.orgId)}),c.navigate({to:".",search:O=>({...O,main:Ut(v)}),replace:!0});return}if(g.type==="data-open-preview"){const k=g.data,v=$.current,c=v.taskId;if(c){const O=v.manager.threads.get().find(U=>U.id===c);v.manager.patchThread({id:c,...k?.branch?{branch:k.branch}:{},...k?.sandboxProviderKind?{sandbox_provider_kind:k.sandboxProviderKind}:{},metadata:{...O?.metadata??{},...k?.githubRepo?{githubRepo:k.githubRepo}:{},...k?.sandboxMap?{sandboxMap:k.sandboxMap}:{}}})}v.navigate({to:".",search:O=>({...O,main:"preview"}),replace:!0});return}},onFinish:(g,k,v)=>{const c=$.current;c.taskId&&ae(c.orgSlug,c.taskId),c.taskId&&c.manager.patchThread({id:c.taskId,status:mn(v,g.parts),updated_at:new Date().toISOString()});const O=g.parts?.some(M=>{const E=M;return(E.type==="tool-share_with_user"||E.type==="tool-bash"||E.type==="tool-write")&&E.state==="output-available"});if(c.taskId&&O){const M=oe.threadOutputs(c.taskId);for(const E of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{c.queryClient.invalidateQueries({queryKey:M})},E)}c.queryClient.invalidateQueries({queryKey:oe.homeNextActions(c.orgSlug)});const U=g.metadata?.thread_id;U&&U!==c.taskId&&c.rawNavigateToTask(U)},onError:g=>{V(g),console.error("[chat] Error",g)},onToolCall:g=>$.current.onToolCall(g)};b.observer=d,ae($.current.orgSlug,$.current.taskId);const h=g=>g==="submitted"||g==="streaming";let N=h(b.status.get().kind);const R=b.status.subscribe(()=>{const g=h(b.status.get().kind);if(g===N)return;N=g;const k=$.current;ae(k.orgSlug,k.taskId)});return()=>{b.observer===d&&(b.observer=null),R()}},[b]);const re=X.kind==="submitted"||X.kind==="streaming",De=L.length===0,Me=L.at(-1),Te=!re&&Me?.role==="assistant"&&Me.parts.some(d=>"state"in d&&d.state==="approval-requested"),Ae=a,be=(Ae?.status==="in_progress"||Ae?.status==="expired")&&X.kind==="ready"&&L.length>0;async function ge(d){const h=t,N=n,R=Object.entries(y),g=R.length>0?R.map(([U,M])=>`### App Context: ${U}
32
32
  ${M}`).join(`
33
33
 
34
- `):"",k=[P,g].filter(Boolean).join(`
34
+ `):"",k=[A,g].filter(Boolean).join(`
35
35
 
36
- `);let v=u;v==="gen-image"&&!r&&(v="default"),v==="web-search"&&!l&&(v="default"),v==="deep-research"&&!p&&(v="default"),(v==="web-search"||v==="deep-research")&&m("default");const c=yn({thread:a?{harness_id:a.harness_id??null,sandbox_provider_kind:a.sandbox_provider_kind??null,branch:a.branch??null}:null,globals:{harnessId:K??void 0,sandboxProviderKind:T??void 0,branch:o}});a?.harness_id||G.patchThread({id:h,harness_id:c.harnessId??"decopilot",updated_at:new Date().toISOString()});const O={tier:f,mode:v,toolApprovalLevel:j.toolApprovalLevel??Rt(),system:k||void 0,agent:{id:N},thread_id:h,...c};try{if(ie||be){let U=!0;try{Un(h,d),await b.enqueue(d,O),vt(h,{workflowId:`thread-run:${h}:${d.id}`,messageId:d.id,text:An(d.parts),hasAttachments:d.parts.some(M=>M.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),$n(h)}catch(M){U=!1,st(h,d.id),Le(h,d.id),V(M instanceof Error?M:new Error(String(M))),de.error(M instanceof Error?M.message:s("chat.chatContext.failedToQueueMessage"))}return se(_.slug,h),U}return await b.submit({kind:"message",message:d},O),!0}finally{ce.delete(h)}}async function pe(d){const h=d.parts??yt(d.tiptapDoc);if(h.length===0||ce.has(t))return;ce.add(t),V(null),I(void 0);const N={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}},R={id:crypto.randomUUID(),role:"user",parts:h,metadata:N};await Pe(R)}async function re(d,h){if(ce.has(t))return de.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(ce.add(t),!await oe.cancel(t,d))return ce.delete(t),de.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;st(t,d),b.removeLocalMessage(d);const R={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:h}],metadata:{created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}}};try{return await Pe(R)}catch(g){return de.error(g instanceof Error?g.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const Oe=async()=>{b.stop();try{const d=await fetch(`/api/${_.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.message??s("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const h=d instanceof Error?d.message:s("chat.chatContext.failedToCancel");de.error(h),console.error("[chat] cancelRun",d)}},Ae=d=>d&&typeof d=="object"&&"type"in d?pe({tiptapDoc:d}):pe(d),_e=Ne({strict:!1}).autosend===ct;S.useEffect(()=>{if(!_e||L.length>0)return;const d=Et(sessionStorage,z,t);d&&pe(d.message).then(()=>{Ot(sessionStorage,z,t)})},[_e,L.length,z,t,pe]);const ge={messages:L,status:Qn(X),sendMessage:Ae,editQueuedMessage:re,stop:()=>{Oe()},submit:(d,h)=>b.submit(d,h),removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>ce.has(t),error:E,clearError:()=>V(null),finishReason:Z,runStatusStage:B,clearFinishReason:()=>b.finishReason.set(null),isStreaming:ie,isChatEmpty:Ee,isWaitingForApprovals:Me??!1,isRunInProgress:be,hasMoreOlder:A,isFetchingOlder:H,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return Y.jsx(ze.Provider,{value:ge,children:e})}function Ss(){const t=De(),e=S.useContext(ze);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function xs(){return S.useContext(ze)}function zn(){const t=De(),e=S.useContext(Ge);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function Gn(){const t=De(),e=S.useContext(Xe);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function ks(){return S.useContext(Xe)}function Xn(){return S.useContext(Ge)}export{vs as A,ps as B,Wn as C,gt as D,nn as E,ks as F,cs as S,ls as V,Ss as a,Xn as b,ft as c,zn as d,bs as e,Nn as f,st as g,gn as h,Fn as i,gs as j,qn as k,xs as l,ys as m,ms as n,rs as o,ds as p,an as q,is as r,fs as s,hs as t,Gn as u,yt as v,vn as w,Sn as x,us as y,bt as z};
36
+ `);let v=u;v==="gen-image"&&!r&&(v="default"),v==="web-search"&&!l&&(v="default"),v==="deep-research"&&!p&&(v="default"),(v==="web-search"||v==="deep-research")&&m("default");const c=Sn({thread:a?{harness_id:a.harness_id??null,sandbox_provider_kind:a.sandbox_provider_kind??null,branch:a.branch??null}:null,globals:{harnessId:K??void 0,sandboxProviderKind:T??void 0,branch:o}});a?.harness_id||G.patchThread({id:h,harness_id:c.harnessId??"decopilot",updated_at:new Date().toISOString()});const O={tier:f,mode:v,toolApprovalLevel:j.toolApprovalLevel??Rt(),system:k||void 0,agent:{id:N},thread_id:h,...c};try{if(re||be){let U=!0;try{Nn(h,d),await b.enqueue(d,O),St(h,{workflowId:`thread-run:${h}:${d.id}`,messageId:d.id,text:Rn(d.parts),hasAttachments:d.parts.some(M=>M.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Dn(h)}catch(M){U=!1,at(h,d.id),Le(h,d.id),V(M instanceof Error?M:new Error(String(M))),de.error(M instanceof Error?M.message:s("chat.chatContext.failedToQueueMessage"))}return ae(_.slug,h),U}return await b.submit({kind:"message",message:d},O),!0}finally{ce.delete(h)}}async function pe(d){const h=d.parts??vt(d.tiptapDoc);if(h.length===0||ce.has(t))return;ce.add(t),V(null),I(void 0);const N={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:w?.image??void 0,name:w?.name??"you"}},R={id:crypto.randomUUID(),role:"user",parts:h,metadata:N};await ge(R)}async function te(d,h){if(ce.has(t))return de.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(ce.add(t),!await ie.cancel(t,d))return ce.delete(t),de.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;at(t,d),b.removeLocalMessage(d);const R={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:h}],metadata:{created_at:new Date().toISOString(),user:{avatar:w?.image??void 0,name:w?.name??"you"}}};try{return await ge(R)}catch(g){return de.error(g instanceof Error?g.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const Oe=async()=>{b.stop();try{const d=await fetch(`/api/${_.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.message??s("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const h=d instanceof Error?d.message:s("chat.chatContext.failedToCancel");de.error(h),console.error("[chat] cancelRun",d)}},Pe=d=>d&&typeof d=="object"&&"type"in d?pe({tiptapDoc:d}):pe(d),_e=Ne({strict:!1}).autosend===dt;S.useEffect(()=>{if(!_e||L.length>0)return;const d=Dt(sessionStorage,z,t);d&&pe(d.message).then(()=>{Ot(sessionStorage,z,t)})},[_e,L.length,z,t,pe]);const ye={messages:L,status:Hn(X),sendMessage:Pe,editQueuedMessage:te,stop:()=>{Oe()},submit:(d,h)=>b.submit(d,h),removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>ce.has(t),error:D,clearError:()=>V(null),finishReason:Z,runStatusStage:B,clearFinishReason:()=>b.finishReason.set(null),isStreaming:re,isChatEmpty:De,isWaitingForApprovals:Te??!1,isRunInProgress:be,hasMoreOlder:P,isFetchingOlder:H,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return Y.jsx(ze.Provider,{value:ye,children:e})}function xs(){const t=Ee(),e=S.useContext(ze);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function ks(){return S.useContext(ze)}function Xn(){const t=Ee(),e=S.useContext(Ge);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function Zn(){const t=Ee(),e=S.useContext(Xe);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function Is(){return S.useContext(Xe)}function Yn(){return S.useContext(Ge)}export{Ss as A,hs as B,Gn as C,yt as D,nn as E,Is as F,us as S,ds as V,xs as a,Yn as b,bt as c,Xn as d,gs as e,jn as f,at as g,vn as h,qn as i,ys as j,Vn as k,ks as l,vs as m,fs as n,cs as o,bn as p,an as q,ls as r,bs as s,ms as t,Zn as u,vt as v,xn as w,kn as x,ps as y,gt as z};
@@ -1 +1 @@
1
- import{c as n,m as d,j as c,bw as l,bx as m}from"./index-DTgaKfa1.js";import{i as b}from"./Check-rokpcf0T.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
1
+ import{c as n,m as d,j as c,bw as l,bx as m}from"./index-INSKxT89.js";import{i as b}from"./Check-BX2JJtbr.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +1 @@
1
- import{c as a,a as c,r as m,j as o}from"./index-DTgaKfa1.js";import{A as u}from"./auth-split-layout-D94Rl64P.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
1
+ import{c as a,a as c,r as m,j as o}from"./index-INSKxT89.js";import{A as u}from"./auth-split-layout-CB5yvL88.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
@@ -0,0 +1 @@
1
+ import{c as k,j as t,B as W,k as oe,X as Xe,Y as re,b as Q,E as Ee,r as E,F as fe,b4 as Ge,b5 as Oe,_ as Ze,m as K,b6 as et,u as tt,L as te,t as st,f as he,aW as Re}from"./index-INSKxT89.js";import{E as Fe}from"./empty-state-N4NC3DL9.js";import{u as ge}from"./use-mcp-client-BJx91BEC.js";import{F as ae,a as lt,b as ce,d as de}from"./form-CP4aOMvu.js";import{I as pe}from"./input-Cd5pEbyl.js";import{T as xe}from"./textarea-DSOHqOj4.js";import{a as ot,b as nt,V as je,O as it,M as rt}from"./index-B2fgv8Yv.js";import{aL as at,W as ct,aM as dt,a2 as mt,ae as ut,aN as pt,a7 as ye}from"./agent-icon-keI5mZSI.js";import{g as xt,M as ft,a as we}from"./index-LeH-Nk1D.js";import{A as ht,a as gt,b as jt}from"./alert-QXKW6mrW.js";import{S as Ce,a as Ie,b as $e,c as Te,d as me}from"./select-C2W-lxSj.js";import{b as bt,c as Pe,T as ke,a as Ae}from"./tooltip-D0pHBYbI.js";import{i as Nt}from"./AlertCircle-DZqBnZUK.js";import{s as vt}from"./Stars02-CXR47Omk.js";import{a as St}from"./Copy01-ButcPCjW.js";import{i as yt}from"./Play-C3pUfm0S.js";import{i as wt}from"./ChevronRight-DgLwn5xj.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./use-mcp-auth-status-C8CB6EOV.js";import{a as Me,u as ze}from"./use-connection-CIET0Msk.js";import{a as Tt}from"./use-mcp-tools-COwEziEE.js";import{M as Pt,c as kt}from"./monaco-editor-6AQRiRcp.js";import{I as De}from"./integration-icon-C-nm4Ydr.js";import{l as At,F as Dt}from"./chat-context-Bfoolk8K.js";import{u as Et}from"./shell-layout-BuuJGaxi.js";import{a as Ot}from"./Tool02-CxblnFnJ.js";import"./auth-U7lq6rf1.js";import"./label-eqyUR7pd.js";import"./index-BcSLSEHl.js";import"./sidebar-iLgdb67_.js";import"./LayoutLeft-pPvjYgoZ.js";import"./use-mobile-DyVGWTUp.js";import"./X-D_oLK6_c.js";import"./Key01-CvoufTmi.js";import"./extract-connection-data-BnMf-nfh.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-BpSuBbUM.js";import"./use-organization-settings-DzBziioM.js";import"./studio-tools-C06bI5ga.js";import"./Plus-BTr4PI36.js";import"./index-Dg5lW10U.js";import"./popover-CQ865FPo.js";import"./use-virtual-mcp-D-ZbuaT8.js";import"./Check-BX2JJtbr.js";import"./SearchMd-DaQvdwYA.js";import"./Users03-rXolOTe_.js";import"./use-create-virtual-mcp-BvTOzXby.js";import"./use-navigate-to-agent-DJbF8uas.js";import"./hooks-BpX9ViV0.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BAATEVTt.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-BW8ZvrE3.js";import"./ArrowUp-BzVoSWRY.js";import"./Settings02-BK7HMP-t.js";import"./XCircle-DUZX5yLz.js";import"./ArrowUpRight-C-HFqkS4.js";import"./TrendUp01-D_7UkRme.js";import"./ZapSquare-CicfodSm.js";import"./CheckCircle-B9Q7BP0R.js";import"./ChevronDown-C0kK0nLg.js";import"./ChevronUp-DUu3dFvi.js";import"./DotsVertical-C_TeAt9N.js";import"./CpuChip01--vbgg446.js";import"./Eye-vq9NyAEt.js";import"./FilterLines-_MGxq1cj.js";import"./Star01-DhZ4xNqy.js";import"./Palette-iBvrW59Z.js";import"./SwitchHorizontal01-C97W2y_Q.js";import"./HardDrive-CzyBCh3d.js";import"./LinkExternal01-DQGUVSM9.js";import"./LogOut01-BseiHZwI.js";import"./Monitor01-CN2AFUd8.js";import"./Sun-1q5AI4_f.js";import"./SearchLg-DqteayyL.js";import"./Shield01-CsKHz8R7.js";import"./Stars01-YVkhCw82.js";import"./Trash01-CmT8OmvC.js";import"./Upload01-D1JXX1Ph.js";import"./User01-Dpjq1MBp.js";import"./Users01-Dl_9JClI.js";import"./XClose-D0oOj-ud.js";import"./Zap-DVHCKkr0.js";import"./badge-if80MApE.js";import"./mcp-oauth-BdEJh0Yp.js";import"./tab-id-Dk_SIAtC.js";import"./dialog-CYVn8lw-.js";import"./use-ai-providers-Do1WYhvy.js";import"./use-decopilot-events-7kVAFziy.js";import"./avatar-DDU8NMhZ.js";import"./required-auth-layout-s2bNe0-l.js";import"./use-org-sso-3CIZqJFZ.js";function Rt(s){const e=k.c(15),{onSave:n,onUndo:l,isDirty:o,isSaving:i,saveLabel:r,undoLabel:c}=s,d=r===void 0?"Save":r,a=c===void 0?"Undo":c;if(!o)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(at,{size:14}),e[0]=x):x=e[0];let h;e[1]!==i||e[2]!==l||e[3]!==a?(h=t.jsxs(W,{variant:"outline",size:"sm",onClick:l,disabled:i,"aria-label":a,children:[x,a]}),e[1]=i,e[2]=l,e[3]=a,e[4]=h):h=e[4];let m;e[5]!==i?(m=i?t.jsx(oe,{size:14,className:"animate-spin"}):t.jsx(ct,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==m?(f=t.jsxs(W,{variant:"default",size:"sm",onClick:n,disabled:i,"aria-label":d,children:[m,d]}),e[7]=i,e[8]=n,e[9]=d,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==h||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[h,f]}),e[12]=h,e[13]=f,e[14]=p):p=e[14],p}Xe({title:re().min(1),description:re().nullable(),body:re()});function ue(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ft(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(l=>l==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Mt(s){const e=k.c(43),{form:n}=s,l=Q();let o;e[0]!==l?(o=l("details.prompt.details"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==o?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==l?(r=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.title")}),t.jsx(de,{children:t.jsx(pe,{...N,placeholder:l("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=l,e[5]=r):r=e[5];let c;e[6]!==n.control||e[7]!==r?(c=t.jsx(ae,{control:n.control,name:"title",render:r}),e[6]=n.control,e[7]=r,e[8]=c):c=e[8];let d;e[9]!==l?(d=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.description")}),t.jsx(de,{children:t.jsx(pe,{...N,value:N.value??"",placeholder:l("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=l,e[10]=d):d=e[10];let a;e[11]!==n.control||e[12]!==d?(a=t.jsx(ae,{control:n.control,name:"description",render:d}),e[11]=n.control,e[12]=d,e[13]=a):a=e[13];let x;e[14]!==c||e[15]!==a?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c,a]}),e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;e[17]!==i||e[18]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=h):h=e[19];let m;e[20]!==l?(m=l("details.prompt.message"),e[20]=l,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==l?(p=l("details.prompt.messageDescription"),e[24]=l,e[25]=p):p=e[25];let g;e[26]!==p?(g=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=g):g=e[27];let b;e[28]!==l?(b=w=>{const{field:N}=w;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(xe,{...N,value:N.value??"",placeholder:l("details.prompt.bodyPlaceholder"),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"})})})},e[28]=l,e[29]=b):b=e[29];let S;e[30]!==n.control||e[31]!==b?(S=t.jsx(ae,{control:n.control,name:"body",render:b}),e[30]=n.control,e[31]=b,e[32]=S):S=e[32];let T;e[33]!==f||e[34]!==g||e[35]!==S?(T=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,g,S]}),e[33]=f,e[34]=g,e[35]=S,e[36]=T):T=e[36];let y;e[37]!==T||e[38]!==h?(y=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:[h,T]}),e[37]=T,e[38]=h,e[39]=y):y=e[39];let P;return e[40]!==n||e[41]!==y?(P=t.jsx(lt,{...n,children:y}),e[40]=n,e[41]=y,e[42]=P):P=e[42],P}function zt(s){const e=k.c(42),{providerId:n,promptId:l}=s,o=Q(),{org:i}=fe(),r=n||null;let c;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(c={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=c):c=e[3];const d=ge(c),a=Ge(n,"PROMPT",l,d),x=Oe(n,"PROMPT",d),h=x.update.isPending;let m;e[4]!==a?(m=a?{title:a.title,description:a.description??null,body:ue(a)}:void 0,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Ze(f);let g;e[8]!==p||e[9]!==a?(g=()=>{a&&p.reset({title:a.title,description:a.description??null,body:ue(a)})},e[8]=p,e[9]=a,e[10]=g):g=e[10];const b=g;let S;e[11]!==x.update||e[12]!==p||e[13]!==l?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:l,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:ue(I)})}),e[11]=x.update,e[12]=p,e[13]=l,e[14]=S):S=e[14];const T=S;if(!a){let C;e[15]!==o?(C=o("details.prompt.notFoundTitle"),e[15]=o,e[16]=C):C=e[16];let I;e[17]!==o?(I=o("details.prompt.notFoundDescription"),e[17]=o,e[18]=I):I=e[18];let R;return e[19]!==C||e[20]!==I?(R=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=R):R=e[21],R}let y;e[22]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[22]=a.title,e[23]=y):y=e[23];let P;e[24]!==a.description?(P=a.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:a.description})]}):null,e[24]=a.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let N;e[29]!==T?(N=()=>{T()},e[29]=T,e[30]=N):N=e[30];let A;e[31]!==p.formState.isDirty||e[32]!==h||e[33]!==b||e[34]!==N?(A=t.jsx(ot,{children:t.jsx(Rt,{onSave:N,onUndo:b,isDirty:p.formState.isDirty,isSaving:h})}),e[31]=p.formState.isDirty,e[32]=h,e[33]=b,e[34]=N,e[35]=A):A=e[35];let D;e[36]!==p?(D=t.jsx("div",{className:"h-full",children:t.jsx(Mt,{form:p})}),e[36]=p,e[37]=D):D=e[37];let O;return e[38]!==A||e[39]!==D||e[40]!==w?(O=t.jsxs(je,{children:[w,A,D]}),e[38]=A,e[39]=D,e[40]=w,e[41]=O):O=e[41],O}function Lt(s){const e=k.c(10),{itemId:n}=s,l=Q();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(),e[0]=o):o=e[0];const i=o;if(!i){let c;e[1]!==l?(c=l("details.prompt.notFoundTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==l?(d=l("details.prompt.missingConnectionDescription"),e[3]=l,e[4]=d):d=e[4];let a;return e[5]!==c||e[6]!==d?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:c,description:d})}),e[5]=c,e[6]=d,e[7]=a):a=e[7],a}let r;return e[8]!==n?(r=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:null,children:t.jsx(zt,{providerId:i,promptId:n})})}),e[8]=n,e[9]=r):r=e[9],r}function Le(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("min-w-0 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Be(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function X(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function se(s){const e=k.c(10);let n,l,o;e[0]!==s?({asChild:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);const i=n?et:"a";let r;e[4]!==l?(r=K("hover:text-foreground transition-colors truncate",l),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==o||e[8]!==r?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:r,...o}),e[6]=i,e[7]=o,e[8]=r,e[9]=c):c=e[9],c}function Ue(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("text-foreground font-medium truncate",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function le(s){const e=k.c(12);let n,l,o;e[0]!==s?({children:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);let i;e[4]!==l?(i=K("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",l),e[4]=l,e[5]=i):i=e[5];let r;e[6]!==n?(r=n??t.jsx(wt,{}),e[6]=n,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==r?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...o,children:r}),e[8]=o,e[9]=i,e[10]=r,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=k.c(12),{toolName:n,connectionId:l,siblings:o,onSelectInstance:i,onBack:r}=s,c=Q();let d;e[0]!==l?(d={connectionId:l},e[0]=l,e[1]=d):d=e[1];const a=It(d);if(!a.isAuthenticated){let m;return e[2]!==a.supportsOAuth||e[3]!==r||e[4]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(it,{onAuthenticate:()=>r(),buttonText:c("details.tool.goBackToAuthenticate")}):t.jsx(rt,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=r,e[4]=c,e[5]=m):m=e[5],m}const x=`${l}:${n}`;let h;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==x||e[10]!==n?(h=t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:i},x),e[6]=l,e[7]=i,e[8]=o,e[9]=x,e[10]=n,e[11]=h):h=e[11],h}function Vt({toolName:s,connectionId:e,siblings:n,onSelectInstance:l}){const o=Q(),{replayId:i}=tt({strict:!1}),r=(()=>{if(!i)return null;const u=`replay-${i}`,j=sessionStorage.getItem(u);if(!j)return null;sessionStorage.removeItem(u);try{return JSON.parse(j)}catch{return null}})(),c=(()=>{if(!r)return null;const u={};for(const[j,$]of Object.entries(r))$!==null&&typeof $=="object"?u[j]=JSON.stringify($,null,2):u[j]=$;return u})(),[d,a]=E.useState(c??{}),[x,h]=E.useState(r?JSON.stringify(r,null,2):"{}"),[m,f]=E.useState(null),[p,g]=E.useState(null),[b,S]=E.useState(null),[T,y]=E.useState(null),[P,w]=E.useState(!1),[N,A]=E.useState(null),{org:D}=fe(),O=Me(e),C=At(),I=Dt(),{openSidePanel:R}=Et(),U=`${e}:${s}`,M=ge({connectionId:e,orgId:D.id,orgSlug:D.slug}),V=Tt({client:M}),v=V.data?.tools?.find(u=>u.name===s),F=xt(v?._meta),J=u=>{if(!C)return;const j=kt(u.content);j.content.length>0&&(R("chat"),C.sendMessage({tiptapDoc:j}))},[z,L]=E.useState("json"),[q,Y]=E.useState(!1);F&&!q&&(L("ui"),Y(!0));const _=v?.inputSchema?.properties,be=_?Object.keys(_):[],G=be.length>0,Z={};if(G&&v?.inputSchema?.properties)for(const u of be)Z[u]=v.inputSchema.required?.includes(u)?"":void 0;const ne=u=>Object.prototype.hasOwnProperty.call(d,u),Ve=async()=>{w(!0),y(null),f(null),g(null),S(null),A(null);const u=performance.now();try{if(!M)throw new Error("MCP client is not available");const j=G?{...Z,...d}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof j[B]=="string")try{j[B]=JSON.parse(j[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof j[B]=="string"&&j[B]!==""){const Se=Number(j[B]);Number.isNaN(Se)||(j[B]=Se)}});const $=await M.callTool({name:s,arguments:j}),ee=$.structuredContent??$,Ke=performance.now(),Qe=Math.round(Ke-u);f(ee),g($),S(j);const Ye=JSON.stringify(ee),ve=new TextEncoder().encode(Ye).length;A({duration:`${Qe}ms`,bytes:`${ve} bytes`,tokens:`~${Math.ceil(ve/4)} tokens`,cost:"$0.0000"})}catch(j){const $=j instanceof Error?j.message:String(j);y($||"Unknown error occurred");const ee=performance.now();A({duration:`${Math.round(ee-u)}ms`})}finally{w(!1)}},ie=(u,j)=>{a($=>({...$,[u]:j}))},_e=()=>{f(null),g(null),S(null),y(null),A(null)},Je=v?.name??Bt(s),qe=t.jsx(Le,{children:t.jsxs(Be,{children:[t.jsx(X,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:D.slug},children:o("details.tool.connections")})})}),t.jsx(le,{}),O&&t.jsxs(t.Fragment,{children:[t.jsx(X,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:D.slug,appSlug:Ct(O)},search:{tab:"tools"},children:O.title})})}),t.jsx(le,{})]}),t.jsx(X,{children:t.jsx(Ue,{children:Je})})]})}),Ne=n.length>1&&t.jsxs(Ce,{value:e,onValueChange:l,children:[t.jsx(Ie,{className:"h-8 w-auto min-w-[200px]",children:t.jsx($e,{})}),t.jsx(Te,{children:n.map(u=>t.jsx(me,{value:u.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(De,{icon:u.icon,name:u.title,size:"xs",className:"shrink-0"}),u.title]})},u.id))})]}),He=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:o("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",o("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([u,j])=>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:[u,v.inputSchema?.required?.includes(u)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:j.type})]}),j.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.description}),j.type==="object"||j.type==="array"?t.jsx(xe,{className:"font-mono text-xs",value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enterAsJson",{key:u}),rows:3}):j.type==="boolean"?t.jsxs(Ce,{value:ne(u)?String(d[u]??""):"",onValueChange:$=>ie(u,$==="true"),children:[t.jsx(Ie,{children:t.jsx($e,{placeholder:o("details.tool.selectTrueOrFalse")})}),t.jsxs(Te,{children:[t.jsx(me,{value:"true",children:"true"}),t.jsx(me,{value:"false",children:"false"})]})]}):t.jsx(pe,{value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enter",{key:u})})]},u)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:o("details.tool.rawJsonInput")}),t.jsx(xe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:u=>h(u.target.value),placeholder:o("details.tool.rawJsonExample")})]}):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:o("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:_e,children:[t.jsx(dt,{className:"h-3.5 w-3.5"}),o("details.tool.cancel")]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(yt,{className:"h-3.5 w-3.5 fill-current"}),o("details.tool.executeTool")]})})]}),We=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:o("details.tool.result")}),t.jsxs("div",{className:"flex items-center gap-3",children:[N&&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(vt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.duration})]}),N.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(mt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.tokens})]}),N.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.bytes})]}),N.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:N.cost})})]}),F&&t.jsx(bt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(W,{size:"icon",variant:z==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(Ae,{children:o("details.tool.interactiveView")})]}),t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(W,{size:"icon",variant:z==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("json"),children:t.jsx(ye,{size:14})})}),t.jsx(Ae,{children:o("details.tool.jsonView")})]})]})})]})]}),T&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{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(Nt,{className:"h-4 w-4"}),t.jsx(gt,{className:"mb-0",children:o("details.tool.executionFailed")})]}),t.jsx(jt,{className:"text-xs text-destructive",children:T})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:F&&z==="ui"&&M?t.jsx(E.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:o("details.tool.loadingApp")})]})}),children:t.jsx(ft,{resourceURI:F,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:we.view.minHeight,maxHeight:we.view.maxHeight,client:M,onMessage:J,onUpdateModelContext:u=>I?.setAppContext(U,u),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{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)),st.success(o("details.tool.copiedToClipboard"))},children:t.jsx(St,{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(ye,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:o("details.tool.runToolToSeeResults")})]})})]});return t.jsx(je,{breadcrumb:qe,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(De,{icon:O?.icon||null,name:O?.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:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(oe,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx($t,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:Ne})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),n.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:o("details.tool.instance")}),Ne]}),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:He}),We]})})]})})}function _t(s){const e=k.c(20),{itemId:n,siblings:l,onBack:o}=s,i=Q(),[r,c]=E.useState(l[0]?.id??"");let d;e[0]!==r||e[1]!==l?(d=l.find(f=>f.id===r)?.id??l[0]?.id??"",e[0]=r,e[1]=l,e[2]=d):d=e[2];const a=d;if(!Me(a||void 0)||!a){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let g;e[7]!==i?(g=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=g):g=e[8];let b;e[9]!==g?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[9]=g,e[10]=b):b=e[10];let S;return e[11]!==p||e[12]!==b?(S=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:[p,b]})}),e[11]=p,e[12]=b,e[13]=S):S=e[13],S}let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[14]=h):h=e[14];let m;return e[15]!==a||e[16]!==o||e[17]!==l||e[18]!==n?(m=t.jsx(E.Suspense,{fallback:h,children:t.jsx(Ut,{toolName:n,connectionId:a,siblings:l,onSelectInstance:c,onBack:o})}),e[15]=a,e[16]=o,e[17]=l,e[18]=n,e[19]=m):m=e[19],m}function Jt(s){const e=k.c(21),{icon:n,illustration:l,title:o,description:i,buttonProps:r,buttonComponent:c,className:d,children:a}=s;let x;e[0]!==d?(x=K("flex flex-col items-center justify-center py-16 text-center",d),e[0]=d,e[1]=x):x=e[1];let h;e[2]!==n||e[3]!==l?(h=l?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:l}):n?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:n}):null,e[2]=n,e[3]=l,e[4]=h):h=e[4];let m;e[5]!==o?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==c||e[13]!==r?(g=(c??r)&&t.jsx("div",{className:"mt-4",children:c??(r&&t.jsx(W,{size:"sm",className:K(r?.className),...r}))}),e[12]=c,e[13]=r,e[14]=g):g=e[14];let b;return e[15]!==a||e[16]!==x||e[17]!==h||e[18]!==p||e[19]!==g?(b=t.jsxs("div",{className:x,children:[h,p,g,a]}),e[15]=a,e[16]=x,e[17]=h,e[18]=p,e[19]=g,e[20]=b):b=e[20],b}const qt={prompt:Lt};function Ht(){const s=k.c(9),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=decodeURIComponent(l.itemId);let i;s[1]!==l.appSlug?(i={slug:l.appSlug},s[1]=l.appSlug,s[2]=i):i=s[2];const r=ze(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const d=c,a=Wt;let x;return s[5]!==d||s[6]!==o||s[7]!==r?(x=t.jsx(_t,{itemId:o,siblings:r,onBack:d,onUpdate:a}),s[5]=d,s[6]=o,s[7]=r,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=k.c(52),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=Q(),i=decodeURIComponent(l.collectionName),r=decodeURIComponent(l.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:a}=fe();let x;s[3]!==l.appSlug?(x={slug:l.appSlug},s[3]=l.appSlug,s[4]=x):x=s[4];const m=ze(x)[0]??null,f=m?.id??"",p=f||"no-connection",g=f??null;let b;s[5]!==a.id||s[6]!==a.slug||s[7]!==g?(b={connectionId:g,orgId:a.id,orgSlug:a.slug},s[5]=a.id,s[6]=a.slug,s[7]=g,s[8]=b):b=s[8];const S=ge(b),T=Oe(p,i,S);let y;s[9]!==T||s[10]!==r?(y=async _=>{r&&await T.update.mutateAsync({id:r,data:_})},s[9]=T,s[10]=r,s[11]=y):y=s[11];const P=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const N=w,A=N&&qt[N];let D;s[14]!==i?(D=Kt(i),s[14]=i,s[15]=D):D=s[15];const O=D;let C;s[16]!==a.slug?(C=t.jsx(X,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[16]=a.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(le,{}),s[18]=I):I=s[18];let R;s[19]!==i||s[20]!==m||s[21]!==a.slug||s[22]!==l.appSlug?(R=m&&t.jsxs(t.Fragment,{children:[t.jsx(X,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:l.appSlug},search:{tab:i},children:m.title})})}),t.jsx(le,{})]}),s[19]=i,s[20]=m,s[21]=a.slug,s[22]=l.appSlug,s[23]=R):R=s[23];let U;s[24]!==O?(U=t.jsx(X,{children:t.jsx(Ue,{children:O})}),s[24]=O,s[25]=U):U=s[25];let M;s[26]!==R||s[27]!==U||s[28]!==C?(M=t.jsx(Le,{children:t.jsxs(Be,{children:[C,I,R,U]})}),s[26]=R,s[27]=U,s[28]=C,s[29]=M):M=s[29];const V=M;if(A){let _;return s[30]!==A||s[31]!==d||s[32]!==P||s[33]!==r?(_=t.jsx(A,{itemId:r,onBack:d,onUpdate:P}),s[30]=A,s[31]=d,s[32]=P,s[33]=r,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ot,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let F;s[36]!==o?(F=o("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=o,s[37]=F):F=s[37];let J;s[38]!==o?(J=o("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=o,s[39]=J):J=s[39];let z;s[40]!==o?(z=o("orgs.collectionDetail.goBackButton"),s[40]=o,s[41]=z):z=s[41];let L;s[42]!==d||s[43]!==z?(L={onClick:d,children:z},s[42]=d,s[43]=z,s[44]=L):L=s[44];let q;s[45]!==F||s[46]!==J||s[47]!==L?(q=t.jsx(Jt,{icon:v,title:F,description:J,buttonProps:L}),s[45]=F,s[46]=J,s[47]=L,s[48]=q):q=s[48];let Y;return s[49]!==V||s[50]!==q?(Y=t.jsx(je,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Y):Y=s[51],Y}function Yt(){const s=k.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 n=he(e);if(decodeURIComponent(n.collectionName)==="tools"){let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ht,{}),s[1]=r):r=s[1],r}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Fl(){const s=k.c(7),e=Q();let n;s[0]!==e?(n=e("orgs.collectionDetail.loadingAriaLabel"),s[0]=e,s[1]=n):n=s[1];let l;s[2]!==n?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground","aria-label":n})}),s[2]=n,s[3]=l):l=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Yt,{}),s[4]=o):o=s[4];let i;return s[5]!==l?(i=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:l,children:o})}),s[5]=l,s[6]=i):i=s[6],i}export{Fl as default};
@@ -1 +1 @@
1
- import{c as $,b as A,j as s,m as z,B as E}from"./index-DTgaKfa1.js";import{a as S,D as F,b as L,c as O}from"./dropdown-menu-BnYh-sUy.js";import{i as R,n as _}from"./ArrowUp-BSm3AYB8.js";import{i as V}from"./Check-rokpcf0T.js";import{a as I,i as K,c as P}from"./SwitchHorizontal01-UVm_9kuZ.js";import{T as W,a as q,b as G,c as H}from"./tooltip-CqWMVk2M.js";import{V as J}from"./view-mode-toggle-FdjAmoYN.js";import{B as Q}from"./badge-DggS66bH.js";function oe(t){const e=$.c(36),{viewMode:l,onViewModeChange:u,sortKey:M,sortDirection:h,onSort:g,sortOptions:j,filters:b}=t;let v;e[0]!==j?(v=j===void 0?[]:j,e[0]=j,e[1]=v):v=e[1];const N=v;let w;e[2]!==b?(w=b===void 0?[]:b,e[2]=b,e[3]=w):w=e[3];const r=w,i=A();let C;e[4]!==r?(C=r.filter(X),e[4]=r,e[5]=C):C=e[5];const y=C.length;let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(I,{size:16}),e[6]=k):k=e[6];let o;e[7]!==y?(o=y>0&&s.jsx(Q,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:y}),e[7]=y,e[8]=o):o=e[8];let n;e[9]!==o?(n=s.jsx(W,{asChild:!0,children:s.jsx(F,{asChild:!0,children:s.jsxs(E,{variant:"outline",size:"icon",className:"relative",children:[k,o]})})}),e[9]=o,e[10]=n):n=e[10];let a;e[11]!==i?(a=i("collections.collectionDisplayButton.displayAndFilters"),e[11]=i,e[12]=a):a=e[12];let c;e[13]!==a?(c=s.jsx(q,{children:a}),e[13]=a,e[14]=c):c=e[14];let d;e[15]!==c||e[16]!==n?(d=s.jsx(G,{children:s.jsxs(H,{children:[n,c]})}),e[15]=c,e[16]=n,e[17]=d):d=e[17];let x;e[18]!==u||e[19]!==l?(x=u&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(J,{value:l,onValueChange:u,fullWidth:!0,options:[{value:"table",icon:s.jsx(K,{})},{value:"cards",icon:s.jsx(P,{})}]})}),e[18]=u,e[19]=l,e[20]=x):x=e[20];let m;e[21]!==g||e[22]!==h||e[23]!==M||e[24]!==N||e[25]!==i?(m=N.length>0&&g&&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:i("collections.collectionDisplayButton.sortBy")}),N.map(T=>{const B=M===T.id;return s.jsx(S,{onClick:()=>g(T.id),className:z("h-8 px-2 py-0 cursor-pointer",B&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[B&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!B&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:T.label}),B&&h&&(h==="asc"?s.jsx(R,{size:16,className:"text-foreground shrink-0"}):s.jsx(_,{size:16,className:"text-foreground shrink-0"}))]})},T.id)})]}),e[21]=g,e[22]=h,e[23]=M,e[24]=N,e[25]=i,e[26]=m):m=e[26];let p;e[27]!==r?(p=r.map(U),e[27]=r,e[28]=p):p=e[28];let f;e[29]!==x||e[30]!==m||e[31]!==p?(f=s.jsxs(L,{align:"end",className:"w-[200px] p-0 gap-0",children:[x,m,p]}),e[29]=x,e[30]=m,e[31]=p,e[32]=f):f=e[32];let D;return e[33]!==d||e[34]!==f?(D=s.jsxs(O,{children:[d,f]}),e[33]=d,e[34]=f,e[35]=D):D=e[35],D}function U(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 l=t.value===e.id;return s.jsx(S,{onClick:()=>t.onChange(e.id),className:z("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!l&&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 X(t){return t.value!=="ALL"}export{oe as C};
1
+ import{c as $,b as A,j as s,m as z,B as E}from"./index-INSKxT89.js";import{a as S,D as F,b as L,c as O}from"./dropdown-menu-CfjF0x1v.js";import{i as R,n as _}from"./ArrowUp-BzVoSWRY.js";import{i as V}from"./Check-BX2JJtbr.js";import{a as I,i as K,c as P}from"./SwitchHorizontal01-C97W2y_Q.js";import{T as W,a as q,b as G,c as H}from"./tooltip-D0pHBYbI.js";import{V as J}from"./view-mode-toggle-BNh4rdw8.js";import{B as Q}from"./badge-if80MApE.js";function oe(t){const e=$.c(36),{viewMode:l,onViewModeChange:u,sortKey:M,sortDirection:h,onSort:g,sortOptions:j,filters:b}=t;let v;e[0]!==j?(v=j===void 0?[]:j,e[0]=j,e[1]=v):v=e[1];const N=v;let w;e[2]!==b?(w=b===void 0?[]:b,e[2]=b,e[3]=w):w=e[3];const r=w,i=A();let C;e[4]!==r?(C=r.filter(X),e[4]=r,e[5]=C):C=e[5];const y=C.length;let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(I,{size:16}),e[6]=k):k=e[6];let o;e[7]!==y?(o=y>0&&s.jsx(Q,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:y}),e[7]=y,e[8]=o):o=e[8];let n;e[9]!==o?(n=s.jsx(W,{asChild:!0,children:s.jsx(F,{asChild:!0,children:s.jsxs(E,{variant:"outline",size:"icon",className:"relative",children:[k,o]})})}),e[9]=o,e[10]=n):n=e[10];let a;e[11]!==i?(a=i("collections.collectionDisplayButton.displayAndFilters"),e[11]=i,e[12]=a):a=e[12];let c;e[13]!==a?(c=s.jsx(q,{children:a}),e[13]=a,e[14]=c):c=e[14];let d;e[15]!==c||e[16]!==n?(d=s.jsx(G,{children:s.jsxs(H,{children:[n,c]})}),e[15]=c,e[16]=n,e[17]=d):d=e[17];let x;e[18]!==u||e[19]!==l?(x=u&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(J,{value:l,onValueChange:u,fullWidth:!0,options:[{value:"table",icon:s.jsx(K,{})},{value:"cards",icon:s.jsx(P,{})}]})}),e[18]=u,e[19]=l,e[20]=x):x=e[20];let m;e[21]!==g||e[22]!==h||e[23]!==M||e[24]!==N||e[25]!==i?(m=N.length>0&&g&&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:i("collections.collectionDisplayButton.sortBy")}),N.map(T=>{const B=M===T.id;return s.jsx(S,{onClick:()=>g(T.id),className:z("h-8 px-2 py-0 cursor-pointer",B&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[B&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!B&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:T.label}),B&&h&&(h==="asc"?s.jsx(R,{size:16,className:"text-foreground shrink-0"}):s.jsx(_,{size:16,className:"text-foreground shrink-0"}))]})},T.id)})]}),e[21]=g,e[22]=h,e[23]=M,e[24]=N,e[25]=i,e[26]=m):m=e[26];let p;e[27]!==r?(p=r.map(U),e[27]=r,e[28]=p):p=e[28];let f;e[29]!==x||e[30]!==m||e[31]!==p?(f=s.jsxs(L,{align:"end",className:"w-[200px] p-0 gap-0",children:[x,m,p]}),e[29]=x,e[30]=m,e[31]=p,e[32]=f):f=e[32];let D;return e[33]!==d||e[34]!==f?(D=s.jsxs(O,{children:[d,f]}),e[33]=d,e[34]=f,e[35]=D):D=e[35],D}function U(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 l=t.value===e.id;return s.jsx(S,{onClick:()=>t.onChange(e.id),className:z("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(V,{size:16,className:"text-foreground shrink-0"}),!l&&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 X(t){return t.value!=="ALL"}export{oe as C};
@@ -1 +1 @@
1
- import{c as k,m as b,j as n,k as v}from"./index-DTgaKfa1.js";import{i as w}from"./SearchMd-BFouC3yb.js";function S(j){const e=k.c(21),{value:m,onChange:d,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?n.jsx(v,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):n.jsx(w,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==d?(r=N=>d(N.target.value),e[6]=d,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==m?(o=n.jsx("input",{type:"text",value:m,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]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==l||e[16]!==o?(a=n.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=n.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as k,m as b,j as n,k as v}from"./index-INSKxT89.js";import{i as w}from"./SearchMd-DaQvdwYA.js";function S(j){const e=k.c(21),{value:m,onChange:d,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?n.jsx(v,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):n.jsx(w,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==d?(r=N=>d(N.target.value),e[6]=d,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==m?(o=n.jsx("input",{type:"text",value:m,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]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==l||e[16]!==o?(a=n.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=n.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as k,j as r,m as C,b as S}from"./index-DTgaKfa1.js";import{d as R,e as H,a as T,T as I,b as W,c as z}from"./table-_k-3G-55.js";import{i as D,n as E}from"./ArrowUp-BSm3AYB8.js";function K(y){const e=k.c(29),{columns:n,data:f,sortKey:u,sortDirection:x,onSort:c,onRowClick:a,rowClassName:d}=y;let p;e[0]!==x?(p=function(s,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=function(s,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return s===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=o):o=e[2];const g=o;let t;if(e[3]!==n||e[4]!==c||e[5]!==b||e[6]!==u){let i;e[8]!==n.length||e[9]!==c||e[10]!==b||e[11]!==u?(i=(s,h)=>{const N=u===s.id;return r.jsx(R,{className:C(g(h,n.length),"group transition-colors select-none",s.sortable&&"hover:bg-accent cursor-pointer",s.rowClassName,s.cellClassName),onClick:s.sortable&&c?()=>c(s.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[s.header,s.sortable&&b(s.id,N)]})},s.id)},e[8]=n.length,e[9]=c,e[10]=b,e[11]=u,e[12]=i):i=e[12],t=n.map(i),e[3]=n,e[4]=c,e[5]=b,e[6]=u,e[7]=t}else t=e[7];let l;e[13]!==t?(l=r.jsx(H,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:t})}),e[13]=t,e[14]=l):l=e[14];let j;if(e[15]!==n||e[16]!==f||e[17]!==a||e[18]!==d){let i;e[20]!==n||e[21]!==a||e[22]!==d?(i=(s,h)=>{const N=d?.(s);return r.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",N),onClick:a?()=>a(s):void 0,children:n.map(m=>r.jsx(I,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(s):m.accessor?m.accessor(s):null})},m.id))},h)},e[20]=n,e[21]=a,e[22]=d,e[23]=i):i=e[23],j=f.map(i),e[15]=n,e[16]=f,e[17]=a,e[18]=d,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(W,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==l||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[l,w]}),e[26]=l,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(16),{columns:n,data:f,isLoading:u,sortKey:x,sortDirection:c,onSort:a,onRowClick:d,emptyState:p}=y,b=u===void 0?!1:u,o=S();if(b){let t;e[0]!==o?(t=o("collections.collectionTableWrapper.loading"),e[0]=o,e[1]=t):t=e[1];let l;return e[2]!==t?(l=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:t})}),e[2]=t,e[3]=l):l=e[3],l}if(f.length===0){let t;e[4]!==p||e[5]!==o?(t=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:o("collections.collectionTableWrapper.noItemsFound")}),e[4]=p,e[5]=o,e[6]=t):t=e[6];let l;return e[7]!==t?(l=r.jsx("div",{className:"flex items-center justify-center h-full",children:t}),e[7]=t,e[8]=l):l=e[8],l}let g;return e[9]!==n||e[10]!==f||e[11]!==d||e[12]!==a||e[13]!==c||e[14]!==x?(g=r.jsx("div",{className:"flex-1",children:r.jsx(K,{columns:n,data:f,sortKey:x,sortDirection:c,onSort:a,onRowClick:d})}),e[9]=n,e[10]=f,e[11]=d,e[12]=a,e[13]=c,e[14]=x,e[15]=g):g=e[15],g}export{B as C};
1
+ import{c as k,j as r,m as C,b as S}from"./index-INSKxT89.js";import{d as R,e as H,a as T,T as I,b as W,c as z}from"./table-DX8acQFf.js";import{i as D,n as E}from"./ArrowUp-BzVoSWRY.js";function K(y){const e=k.c(29),{columns:n,data:f,sortKey:u,sortDirection:x,onSort:c,onRowClick:a,rowClassName:d}=y;let p;e[0]!==x?(p=function(s,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=function(s,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return s===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=o):o=e[2];const g=o;let t;if(e[3]!==n||e[4]!==c||e[5]!==b||e[6]!==u){let i;e[8]!==n.length||e[9]!==c||e[10]!==b||e[11]!==u?(i=(s,h)=>{const N=u===s.id;return r.jsx(R,{className:C(g(h,n.length),"group transition-colors select-none",s.sortable&&"hover:bg-accent cursor-pointer",s.rowClassName,s.cellClassName),onClick:s.sortable&&c?()=>c(s.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[s.header,s.sortable&&b(s.id,N)]})},s.id)},e[8]=n.length,e[9]=c,e[10]=b,e[11]=u,e[12]=i):i=e[12],t=n.map(i),e[3]=n,e[4]=c,e[5]=b,e[6]=u,e[7]=t}else t=e[7];let l;e[13]!==t?(l=r.jsx(H,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:t})}),e[13]=t,e[14]=l):l=e[14];let j;if(e[15]!==n||e[16]!==f||e[17]!==a||e[18]!==d){let i;e[20]!==n||e[21]!==a||e[22]!==d?(i=(s,h)=>{const N=d?.(s);return r.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",a?"cursor-pointer":"",N),onClick:a?()=>a(s):void 0,children:n.map(m=>r.jsx(I,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(s):m.accessor?m.accessor(s):null})},m.id))},h)},e[20]=n,e[21]=a,e[22]=d,e[23]=i):i=e[23],j=f.map(i),e[15]=n,e[16]=f,e[17]=a,e[18]=d,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(W,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==l||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[l,w]}),e[26]=l,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(16),{columns:n,data:f,isLoading:u,sortKey:x,sortDirection:c,onSort:a,onRowClick:d,emptyState:p}=y,b=u===void 0?!1:u,o=S();if(b){let t;e[0]!==o?(t=o("collections.collectionTableWrapper.loading"),e[0]=o,e[1]=t):t=e[1];let l;return e[2]!==t?(l=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:t})}),e[2]=t,e[3]=l):l=e[3],l}if(f.length===0){let t;e[4]!==p||e[5]!==o?(t=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:o("collections.collectionTableWrapper.noItemsFound")}),e[4]=p,e[5]=o,e[6]=t):t=e[6];let l;return e[7]!==t?(l=r.jsx("div",{className:"flex items-center justify-center h-full",children:t}),e[7]=t,e[8]=l):l=e[8],l}let g;return e[9]!==n||e[10]!==f||e[11]!==d||e[12]!==a||e[13]!==c||e[14]!==x?(g=r.jsx("div",{className:"flex-1",children:r.jsx(K,{columns:n,data:f,sortKey:x,sortDirection:c,onSort:a,onRowClick:d})}),e[9]=n,e[10]=f,e[11]=d,e[12]=a,e[13]=c,e[14]=x,e[15]=g):g=e[15],g}export{B as C};
@@ -1 +1 @@
1
- import{c as f,m as u,j as m}from"./index-DTgaKfa1.js";import{B as g}from"./badge-DggS66bH.js";function h(x){const e=f.c(12),{tabs:l,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]!==l){let c;e[6]!==n||e[7]!==s?(c=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]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=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,m as u,j as m}from"./index-INSKxT89.js";import{B as g}from"./badge-if80MApE.js";function h(x){const e=f.c(12),{tabs:l,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]!==l){let c;e[6]!==n||e[7]!==s?(c=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]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=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,m as i,j as n}from"./index-DTgaKfa1.js";import{_ as m}from"./index-JAfoJcTE.js";import{e as N,b as j,h as b,a as w,d as y}from"./dialog-CcBvH6sb.js";import{i as C}from"./SearchMd-BFouC3yb.js";function $(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 z(a){const e=d.c(26);let t,s,o,l,r,h;e[0]!==a?({title:r,description:h,children:t,className:s,filter:o,...l}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r,e[6]=h):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5],h=e[6]);const v=r===void 0?"Command Palette":r,k=h===void 0?"Search for a command to run...":h;let c;e[7]!==v?(c=n.jsx(j,{children:v}),e[7]=v,e[8]=c):c=e[8];let p;e[9]!==k?(p=n.jsx(b,{children:k}),e[9]=k,e[10]=p):p=e[10];let u;e[11]!==c||e[12]!==p?(u=n.jsxs(w,{className:"sr-only",children:[c,p]}),e[11]=c,e[12]=p,e[13]=u):u=e[13];let f;e[14]!==s?(f=i("overflow-hidden p-0",s),e[14]=s,e[15]=f):f=e[15];let x;e[16]!==t||e[17]!==o?(x=n.jsx($,{filter:o,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[16]=t,e[17]=o,e[18]=x):x=e[18];let g;e[19]!==f||e[20]!==x?(g=n.jsx(y,{className:f,closeButtonClassName:"hidden",children:x}),e[19]=f,e[20]=x,e[21]=g):g=e[21];let _;return e[22]!==l||e[23]!==u||e[24]!==g?(_=n.jsxs(N,{...l,children:[u,g]}),e[22]=l,e[23]=u,e[24]=g,e[25]=_):_=e[25],_}function G(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(C,{className:"size-4 shrink-0 text-muted-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 L(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 R(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:"text-muted-foreground px-4 py-4 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}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("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 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("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 P(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,R as a,B as b,P as c,G as d,$ as e,z as f,H as g};
1
+ import{c as d,m as i,j as n}from"./index-INSKxT89.js";import{_ as m}from"./index-Dg5lW10U.js";import{e as N,b as j,h as b,a as w,d as y}from"./dialog-CYVn8lw-.js";import{i as C}from"./SearchMd-DaQvdwYA.js";function $(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 z(a){const e=d.c(26);let t,s,o,l,r,h;e[0]!==a?({title:r,description:h,children:t,className:s,filter:o,...l}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r,e[6]=h):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5],h=e[6]);const v=r===void 0?"Command Palette":r,k=h===void 0?"Search for a command to run...":h;let c;e[7]!==v?(c=n.jsx(j,{children:v}),e[7]=v,e[8]=c):c=e[8];let p;e[9]!==k?(p=n.jsx(b,{children:k}),e[9]=k,e[10]=p):p=e[10];let u;e[11]!==c||e[12]!==p?(u=n.jsxs(w,{className:"sr-only",children:[c,p]}),e[11]=c,e[12]=p,e[13]=u):u=e[13];let f;e[14]!==s?(f=i("overflow-hidden p-0",s),e[14]=s,e[15]=f):f=e[15];let x;e[16]!==t||e[17]!==o?(x=n.jsx($,{filter:o,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[16]=t,e[17]=o,e[18]=x):x=e[18];let g;e[19]!==f||e[20]!==x?(g=n.jsx(y,{className:f,closeButtonClassName:"hidden",children:x}),e[19]=f,e[20]=x,e[21]=g):g=e[21];let _;return e[22]!==l||e[23]!==u||e[24]!==g?(_=n.jsxs(N,{...l,children:[u,g]}),e[22]=l,e[23]=u,e[24]=g,e[25]=_):_=e[25],_}function G(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(C,{className:"size-4 shrink-0 text-muted-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 L(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 R(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:"text-muted-foreground px-4 py-4 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}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("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 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("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 P(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,R as a,B as b,P as c,G as d,$ as e,z as f,H as g};
@@ -0,0 +1 @@
1
+ import{c as E,b as $,j as i,m as Le,p as se,B as ve,u as Ge,q as it,r as B,a as Te,d as ot,s as st,e as Ye,v as Se,w as Je,Q as nt,E as lt,K as Fe,x as $e,N as at}from"./index-INSKxT89.js";import{L as ct,s as ke,S as He,i as mt,n as Ie,C as Xe,p as Re}from"./self-tool-result-G4ouxwYH.js";import{A as dt}from"./auth-entry-6LychnRm.js";import{A as ut}from"./auth-split-layout-CB5yvL88.js";import{O as Be}from"./organization-choice-BAQiqls9.js";import{I as gt}from"./input-Cd5pEbyl.js";import{D as ft,a as We,b as pt,c as ht}from"./dropdown-menu-CfjF0x1v.js";import{S as bt,u as xt,W as yt,g as jt,a as Ct}from"./use-mcp-client-BJx91BEC.js";import{i as Ot}from"./XCircle-DUZX5yLz.js";import{i as vt}from"./ArrowUpRight-C-HFqkS4.js";import"./integration-icon-C-nm4Ydr.js";import"./Tool02-CxblnFnJ.js";import"./agent-icon-keI5mZSI.js";import"./AlertCircle-DZqBnZUK.js";import"./Tool01-BW8ZvrE3.js";import"./ArrowUp-BzVoSWRY.js";import"./Settings02-BK7HMP-t.js";import"./TrendUp01-D_7UkRme.js";import"./ZapSquare-CicfodSm.js";import"./Users03-rXolOTe_.js";import"./CheckCircle-B9Q7BP0R.js";import"./Check-BX2JJtbr.js";import"./ChevronDown-C0kK0nLg.js";import"./ChevronRight-DgLwn5xj.js";import"./ChevronUp-DUu3dFvi.js";import"./DotsVertical-C_TeAt9N.js";import"./Stars02-CXR47Omk.js";import"./Copy01-ButcPCjW.js";import"./CpuChip01--vbgg446.js";import"./Eye-vq9NyAEt.js";import"./FilterLines-_MGxq1cj.js";import"./Star01-DhZ4xNqy.js";import"./Palette-iBvrW59Z.js";import"./SwitchHorizontal01-C97W2y_Q.js";import"./HardDrive-CzyBCh3d.js";import"./Key01-CvoufTmi.js";import"./LayoutLeft-pPvjYgoZ.js";import"./LinkExternal01-DQGUVSM9.js";import"./LogOut01-BseiHZwI.js";import"./Monitor01-CN2AFUd8.js";import"./Sun-1q5AI4_f.js";import"./Play-C3pUfm0S.js";import"./Plus-BTr4PI36.js";import"./SearchLg-DqteayyL.js";import"./SearchMd-DaQvdwYA.js";import"./Shield01-CsKHz8R7.js";import"./Stars01-YVkhCw82.js";import"./Trash01-CmT8OmvC.js";import"./Upload01-D1JXX1Ph.js";import"./User01-Dpjq1MBp.js";import"./Users01-Dl_9JClI.js";import"./XClose-D0oOj-ud.js";import"./X-D_oLK6_c.js";import"./Zap-DVHCKkr0.js";import"./dialog-CYVn8lw-.js";import"./tooltip-D0pHBYbI.js";import"./companions-core-DZwnuE3V.js";import"./extract-connection-data-BnMf-nfh.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./form-CP4aOMvu.js";import"./label-eqyUR7pd.js";import"./use-debounced-value-BrEMTOVV.js";import"./useQueries-BMpOuVMz.js";import"./authenticate-and-persist-oauth-DfZaAOrc.js";import"./mcp-oauth-BdEJh0Yp.js";import"./auth-U7lq6rf1.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DDU8NMhZ.js";const qe={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ve=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],St="var(--brand-green-dark)";function Me({siteUrl:t,email:e,locale:o}){const s=(o&&qe[o])??qe["pt-BR"]??"https://decocms.com/agendar",r=new URL(s);return t&&r.searchParams.set("siteUrl",t),e&&r.searchParams.set("email",e),r.toString()}function _t(t){const e=E.c(15),{href:o,size:s,className:r,orgId:a}=t,l=s===void 0?"lg":s,n=$();let c;e[0]!==r?(c=Le("w-full",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==a?(m=()=>se("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=u):u=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(vt,{size:16}),e[6]=d):d=e[6];let g;e[7]!==o||e[8]!==m||e[9]!==u?(g=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",onClick:m,children:[u,d]}),e[7]=o,e[8]=m,e[9]=u,e[10]=g):g=e[10];let p;return e[11]!==l||e[12]!==c||e[13]!==g?(p=i.jsx(ve,{asChild:!0,variant:"outline",size:l,className:c,children:g}),e[11]=l,e[12]=c,e[13]=g,e[14]=p):p=e[14],p}function wt(t){const e=E.c(13),{size:o}=t,s=o===void 0?72:o,r=$();let a;e[0]!==r?(a=r("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=r,e[1]=a):a=e[1];const l=a;let n;e[2]!==s?(n=Math.round(s*.3),e[2]=s,e[3]=n):n=e[3];const c=n;let m;e[4]!==s?(m={height:s},e[4]=s,e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==c||e[8]!==s?(u=Ve.map((g,p)=>i.jsxs("div",{className:"relative shrink-0",style:{width:s,height:s,marginLeft:p===0?0:-c,zIndex:Ve.length-p},children:[i.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:i.jsx("img",{src:g,alt:l,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&i.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),i.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},g)),e[6]=l,e[7]=c,e[8]=s,e[9]=u):u=e[9];let d;return e[10]!==m||e[11]!==u?(d=i.jsx("div",{className:"flex items-end",style:m,children:u}),e[10]=m,e[11]=u,e[12]=d):d=e[12],d}function De(t){const e=E.c(19),{href:o,orgId:s}=t,r=$();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"h-20",style:{backgroundColor:St}}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"-mt-9 mb-4",children:i.jsx(wt,{})}),e[1]=l):l=e[1];let n;e[2]!==r?(n=r("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=r,e[3]=n):n=e[3];let c;e[4]!==n?(c=i.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r?(m=r("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=i.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=u):u=e[9];let d;e[10]!==c||e[11]!==u?(d=i.jsxs("div",{className:"grid gap-1.5",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12];let g;e[13]!==o||e[14]!==s?(g=i.jsx(_t,{href:o,size:"lg",className:"mt-6",orgId:s}),e[13]=o,e[14]=s,e[15]=g):g=e[15];let p;return e[16]!==d||e[17]!==g?(p=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[a,i.jsxs("div",{className:"px-8 pb-8",children:[l,d,g]})]})}),e[16]=d,e[17]=g,e[18]=p):p=e[18],p}function Ze(t){const e=E.c(10),{host:o}=t,s=`https://www.google.com/s2/favicons?domain=${o}&sz=128`;let r,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=r,e[1]=a,e[2]=l):(r=e[0],a=e[1],l=e[2]);let n;e[3]!==s?(n=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==o?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:o}),e[5]=o,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=i.jsxs("div",{className:"flex items-center gap-3",children:[r,a,l,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function Ae(t){const e=E.c(5),{variant:o}=t,s=$();let r;e[0]!==s||e[1]!==o?(r=s(o==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=s,e[1]=o,e[2]=r):r=e[2];const a=r;let l;return e[3]!==a?(l=i.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:i.jsx(ct,{label:a,className:"text-muted-foreground"})}),e[3]=a,e[4]=l):l=e[4],l}function ii(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(It,{}),t[0]=e):e=t[0],e}const et=B.createContext(null),tt=()=>B.useContext(et);function Nt(){const t=E.c(22),[e,o]=Se(),s=e.language==="pt-BR"?"PT-BR":"EN";let r;t[0]!==s?(r=i.jsx(ft,{asChild:!0,children:i.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:s})}),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==o?(a=()=>{o(Ut)},t[2]=o,t[3]=a):a=t[3];const l=e.language==="en"&&"bg-accent";let n;t[4]!==l?(n=Le(l),t[4]=l,t[5]=n):n=t[5];let c;t[6]!==a||t[7]!==n?(c=i.jsx(We,{onClick:a,className:n,children:"English"}),t[6]=a,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==o?(m=()=>{o(Et)},t[9]=o,t[10]=m):m=t[10];const u=e.language==="pt-BR"&&"bg-accent";let d;t[11]!==u?(d=Le(u),t[11]=u,t[12]=d):d=t[12];let g;t[13]!==m||t[14]!==d?(g=i.jsx(We,{onClick:m,className:d,children:"Português (Brasil)"}),t[13]=m,t[14]=d,t[15]=g):g=t[15];let p;t[16]!==c||t[17]!==g?(p=i.jsxs(pt,{align:"end",children:[c,g]}),t[16]=c,t[17]=g,t[18]=p):p=t[18];let v;return t[19]!==r||t[20]!==p?(v=i.jsxs(ht,{children:[r,p]}),t[19]=r,t[20]=p,t[21]=v):v=t[21],v}function Et(t){return{...t,language:"pt-BR"}}function Ut(t){return{...t,language:"en"}}function T(t){const e=E.c(17);let o,s,r;e[0]!==t?({visual:r,children:o,...s}=t,e[0]=t,e[1]=o,e[2]=s,e[3]=r):(o=e[1],s=e[2],r=e[3]);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/commerce-onboarding"},e[4]=a):a=e[4];const l=Ge(a),{data:n}=Te.useSession(),[c]=Se(),m=n?.user?.email;let u;e[5]!==c.language||e[6]!==l.siteUrl||e[7]!==m?(u=Me({siteUrl:l.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=e[8];const d=u;let g;e[9]!==d||e[10]!==r?(g=r??i.jsx(De,{href:d}),e[9]=d,e[10]=r,e[11]=g):g=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsxs("div",{className:"flex justify-between items-start mb-8",children:[i.jsx("div",{}),i.jsx(Nt,{})]}),e[12]=p):p=e[12];let v;return e[13]!==o||e[14]!==s||e[15]!==g?(v=i.jsxs(ut,{...s,visual:g,children:[p,o]}),e[13]=o,e[14]=s,e[15]=g,e[16]=v):v=e[16],v}function Pt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}function Ke(t,e){switch(e){case"Enter a website URL.":return t("routes.commerceOnboarding.siteUrl.enterUrl");case"Use an HTTP or HTTPS website URL.":return t("routes.commerceOnboarding.siteUrl.useHttpOrHttps");case"Enter a valid website URL.":return t("routes.commerceOnboarding.siteUrl.enterValidUrl");case"__configurationFailed":return t("routes.commerceOnboarding.configurationFailed");default:return e}}let Qe=!1;function It(){const t=Ge({from:"/commerce-onboarding"}),{org:e,siteUrl:o}=t,s=ke(o);return!Qe&&it()&&(Qe=!0,se("commerce_onboarding_viewed",{site_url:o,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),i.jsx(et.Provider,{value:s,children:i.jsx(Rt,{requestedOrgSlug:e,siteUrl:o})})}function Rt(t){const e=E.c(14),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),{data:a,isPending:l}=Te.useSession(),n=tt();if(l){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(T,{children:i.jsx(Ae,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!a){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r("routes.commerceOnboarding.unlockDiagnostic"),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==n?(d=n?i.jsx(Ze,{host:n}):void 0,e[3]=n,e[4]=d):d=e[4];let g;e[5]!==r?(g=Pt(r),e[5]=r,e[6]=g):g=e[6];let p;return e[7]!==u||e[8]!==d||e[9]!==g?(p=i.jsx(T,{children:i.jsx(dt,{callbackUrl:m,allowAutoLogin:!1,title:u,subtitle:null,brand:d,copy:g})}),e[7]=u,e[8]=d,e[9]=g,e[10]=p):p=e[10],p}let c;return e[11]!==o||e[12]!==s?(c=i.jsx(zt,{requestedOrgSlug:o,siteUrl:s}),e[11]=o,e[12]=s,e[13]=c):c=e[13],c}function zt(t){const e=E.c(95),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),a=ot(),l=st(),[n,c]=B.useState(null),[m,u]=B.useState(null),d=l.data?.map(kt)??[];let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={mutationFn:Lt,retry:!1,onSuccess:f=>{u(f)}},e[0]=g):g=e[0];const p=Ye(g);if(l.isPending){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(T,{children:i.jsx(Ae,{variant:"workspace"})}),e[1]=f):f=e[1],f}if(l.error){let f;e[2]!==r?(f=r("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=r,e[3]=f):f=e[3];let h;e[4]!==r?(h=r("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=r,e[5]=h):h=e[5];let x;e[6]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=x):x=e[7];let j;e[8]!==l?(j=()=>l.refetch(),e[8]=l,e[9]=j):j=e[9];let O;return e[10]!==f||e[11]!==h||e[12]!==x||e[13]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[10]=f,e[11]=h,e[12]=x,e[13]=j,e[14]=O):O=e[14],O}const v=o?d.find(f=>f.slug===o):null;if(v){let f;return e[15]!==v||e[16]!==s?(f=i.jsx(je,{org:v,initialSiteUrl:s}),e[15]=v,e[16]=s,e[17]=f):f=e[17],f}if(o){let f;e[18]!==r?(f=r("routes.commerceOnboarding.orgNotFound"),e[18]=r,e[19]=f):f=e[19];let h;e[20]!==r?(h=r("routes.commerceOnboarding.couldNotFindOrg"),e[20]=r,e[21]=h):h=e[21];let x;e[22]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[22]=r,e[23]=x):x=e[23];let j;e[24]!==l?(j=()=>l.refetch(),e[24]=l,e[25]=j):j=e[25];let O;return e[26]!==f||e[27]!==h||e[28]!==x||e[29]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[26]=f,e[27]=h,e[28]=x,e[29]=j,e[30]=O):O=e[30],O}if(n){let f;return e[31]!==n||e[32]!==s?(f=i.jsx(je,{org:n,initialSiteUrl:s}),e[31]=n,e[32]=s,e[33]=f):f=e[33],f}if(d.length===1&&d[0]){let f;return e[34]!==d[0]||e[35]!==s?(f=i.jsx(je,{org:d[0],initialSiteUrl:s}),e[34]=d[0],e[35]=s,e[36]=f):f=e[36],f}if(d.length>1){let f;e[37]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[37]=r,e[38]=f):f=e[38];let h;e[39]!==r?(h=r("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=r,e[40]=h):h=e[40];let x;e[41]!==f||e[42]!==h?(x=i.jsx(W,{title:f,description:h}),e[41]=f,e[42]=h,e[43]=x):x=e[43];let j;e[44]!==r?(j=r("routes.commerceOnboarding.authCopy.continue"),e[44]=r,e[45]=j):j=e[45];let O;e[46]!==a||e[47]!==s?(O=V=>a({to:"/commerce-onboarding",search:{org:V.slug,siteUrl:s}}),e[46]=a,e[47]=s,e[48]=O):O=e[48];let C;e[49]!==d||e[50]!==j||e[51]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:d,selectLabel:j,onSelected:O})}),e[49]=d,e[50]=j,e[51]=O,e[52]=C):C=e[52];let D;return e[53]!==x||e[54]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[53]=x,e[54]=C,e[55]=D):D=e[55],D}if(!m){let f;e[56]!==p?(f=()=>{p.reset(),p.mutate()},e[56]=p,e[57]=f):f=e[57];let h;return e[58]!==p||e[59]!==f?(h=i.jsx(Tt,{mutation:p,onRetry:f}),e[58]=p,e[59]=f,e[60]=h):h=e[60],h}const b=m;if(b?.success&&(b.status==="created"||b.status==="joined"||b.status==="already_has_organization")&&b.organization){let f;return e[61]!==b.organization||e[62]!==s?(f=i.jsx(je,{org:b.organization,initialSiteUrl:s}),e[61]=b.organization,e[62]=s,e[63]=f):f=e[63],f}if(b?.status==="ambiguous"&&b.organizations&&b.organizations.length>0){let f;e[64]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[64]=r,e[65]=f):f=e[65];let h;e[66]!==r?(h=r("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[66]=r,e[67]=h):h=e[67];let x;e[68]!==f||e[69]!==h?(x=i.jsx(W,{title:f,description:h}),e[68]=f,e[69]=h,e[70]=x):x=e[70];const j=b.domain??void 0;let O;e[71]!==a||e[72]!==s?(O=(V,q)=>{Je(),c({...V,slug:q}),a({to:"/commerce-onboarding",search:{org:q,siteUrl:s}})},e[71]=a,e[72]=s,e[73]=O):O=e[73];let C;e[74]!==b.organizations||e[75]!==j||e[76]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:b.organizations,domain:j,onJoined:O})}),e[74]=b.organizations,e[75]=j,e[76]=O,e[77]=C):C=e[77];let D;return e[78]!==x||e[79]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[78]=x,e[79]=C,e[80]=D):D=e[80],D}let w;e[81]!==r?(w=r("routes.commerceOnboarding.onboardingNeedsSupport"),e[81]=r,e[82]=w):w=e[82];let N;e[83]!==b?.error||e[84]!==r?(N=b?.error??r("routes.commerceOnboarding.couldNotDetermineOrg"),e[83]=b?.error,e[84]=r,e[85]=N):N=e[85];let P;e[86]!==r?(P=r("routes.commerceOnboarding.retryAgain"),e[86]=r,e[87]=P):P=e[87];let U;e[88]!==p?(U=()=>{u(null),p.reset()},e[88]=p,e[89]=U):U=e[89];let M;return e[90]!==w||e[91]!==N||e[92]!==P||e[93]!==U?(M=i.jsx(Ce,{title:w,description:N,actionLabel:P,onRetry:U}),e[90]=w,e[91]=N,e[92]=P,e[93]=U,e[94]=M):M=e[94],M}async function Lt(){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&&Je(),e}function kt(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Tt(t){const e=E.c(16),{mutation:o,onRetry:s}=t,r=$(),a=B.useRef(!1);let l;e[0]!==o?(l=u=>{!u||a.current||(a.current=!0,o.mutate())},e[0]=o,e[1]=l):l=e[1];const n=l;if(o.error){let u;e[2]!==r?(u=r("routes.commerceOnboarding.onboardingUnavailable"),e[2]=r,e[3]=u):u=e[3];let d;e[4]!==r?(d=r("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=r,e[5]=d):d=e[5];let g;e[6]!==r?(g=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=g):g=e[7];let p;return e[8]!==s||e[9]!==u||e[10]!==d||e[11]!==g?(p=i.jsx(Ce,{title:u,description:d,actionLabel:g,onRetry:s}),e[8]=s,e[9]=u,e[10]=d,e[11]=g,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ae,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=i.jsx(T,{children:i.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function W(t){const e=E.c(8),{title:o,description:s}=t,r=tt();let a;e[0]!==r?(a=r?i.jsx(Ze,{host:r}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==o?(l=(o||s)&&i.jsxs("div",{className:"space-y-2",children:[o&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:o}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let n;return e[5]!==a||e[6]!==l?(n=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=n):n=e[7],n}function Ce(t){const e=E.c(9),{title:o,description:s,actionLabel:r,onRetry:a}=t;let l;e[0]!==s||e[1]!==o?(l=i.jsx(W,{title:o,description:s}),e[0]=s,e[1]=o,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==a?(n=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:a,children:r}),e[3]=r,e[4]=a,e[5]=n):n=e[5];let c;return e[6]!==l||e[7]!==n?(c=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[l,n]})}),e[6]=l,e[7]=n,e[8]=c):c=e[8],c}function je(t){const e=E.c(13),{org:o,initialSiteUrl:s}=t,r=$(),{data:a}=Te.useSession(),[l]=Se(),n=a?.user?.email;let c;e[0]!==s||e[1]!==l.language||e[2]!==n?(c=Me({siteUrl:s,email:n,locale:l.language}),e[0]=s,e[1]=l.language,e[2]=n,e[3]=c):c=e[3];const m=c;let u;e[4]!==m||e[5]!==o.id?(u=i.jsx(De,{href:m,orgId:o.id}),e[4]=m,e[5]=o.id,e[6]=u):u=e[6];const d=u;let g;return e[7]!==s||e[8]!==d||e[9]!==o||e[10]!==a?.user?.email||e[11]!==r?(g=i.jsx(nt,{children:p=>{const{reset:v}=p;return i.jsx(lt,{fallback:b=>{const{error:w,resetError:N}=b;return i.jsx(T,{visual:d,children:i.jsx(Mt,{orgName:o.name,message:w instanceof Error?w.message:r("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{v(),N()}})})},children:i.jsx(B.Suspense,{fallback:i.jsx(rt,{visual:d}),children:i.jsx(Dt,{org:o,initialSiteUrl:s,sessionEmail:a?.user?.email},`${o.id}:${s??""}`)})})}}),e[7]=s,e[8]=d,e[9]=o,e[10]=a?.user?.email,e[11]=r,e[12]=g):g=e[12],g}function rt(t){const e=E.c(3),{visual:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[i.jsx(W,{}),i.jsx(Xe,{})]}),e[0]=s):s=e[0];let r;return e[1]!==o?(r=i.jsx(T,{align:"fill",visual:o,children:s}),e[1]=o,e[2]=r):r=e[2],r}function Mt(t){const e=E.c(19),{orgName:o,message:s,onRetry:r}=t,a=$();let l;e[0]!==a?(l=a("routes.commerceOnboarding.commerceDiagnostic"),e[0]=a,e[1]=l):l=e[1];let n;e[2]!==o||e[3]!==a?(n=a("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o}),e[2]=o,e[3]=a,e[4]=n):n=e[4];let c;e[5]!==l||e[6]!==n?(c=i.jsx(W,{title:l,description:n}),e[5]=l,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==s?(m=i.jsx(Oe,{message:s}),e[8]=s,e[9]=m):m=e[9];let u;e[10]!==a?(u=a("routes.commerceOnboarding.retryAgain"),e[10]=a,e[11]=u):u=e[11];let d;e[12]!==r||e[13]!==u?(d=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:r,children:u}),e[12]=r,e[13]=u,e[14]=d):d=e[14];let g;return e[15]!==c||e[16]!==m||e[17]!==d?(g=i.jsxs("div",{className:"grid gap-10",children:[c,m,d]}),e[15]=c,e[16]=m,e[17]=d,e[18]=g):g=e[18],g}function Dt(t){const e=E.c(135),{org:o,initialSiteUrl:s,sessionEmail:r}=t;let a;e[0]!==o.id||e[1]!==o.slug?(a={connectionId:bt,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=a):a=e[2];const l=xt(a),[n,c]=B.useState(s??""),[m,u]=B.useState(null),d=B.useRef(!1),g=yt.COMMERCE_DISCOVERY(o.id),p=jt(o.id),v=Fe.commerceDiscoveryConnection(o.id,g);let b;e[3]!==g||e[4]!==l?(b=async()=>{const y=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:g}});return Re(y)},e[3]=g,e[4]=l,e[5]=b):b=e[5];let w;e[6]!==v||e[7]!==b?(w={queryKey:v,queryFn:b,retry:!1},e[6]=v,e[7]=b,e[8]=w):w=e[8];const N=$e(w),P=Fe.commerceDiscoveryVirtualMcp(o.id,p);let U;e[9]!==l||e[10]!==p?(U=async()=>{const y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Re(y)},e[9]=l,e[10]=p,e[11]=U):U=e[11];let M;e[12]!==P||e[13]!==U?(M={queryKey:P,queryFn:U,retry:!1},e[12]=P,e[13]=U,e[14]=M):M=e[14];const f=$e(M);let h;e[15]!==l?(h=async y=>{const S=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Re(S)},e[15]=l,e[16]=h):h=e[16];let x;e[17]!==N||e[18]!==o.id||e[19]!==f?(x=(y,S)=>{se("commerce_onboarding_setup_succeeded",{domain:ke(S)??void 0,organization_id:o.id}),u(null),N.refetch(),f.refetch()},e[17]=N,e[18]=o.id,e[19]=f,e[20]=x):x=e[20];let j;e[21]!==o.id?(j=(y,S)=>{se("commerce_onboarding_setup_failed",{domain:ke(S)??void 0,organization_id:o.id,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:"__configurationFailed")},e[21]=o.id,e[22]=j):j=e[22];let O;e[23]!==j||e[24]!==h||e[25]!==x?(O={mutationFn:h,retry:!1,onSuccess:x,onError:j},e[23]=j,e[24]=h,e[25]=x,e[26]=O):O=e[26];const C=Ye(O),D=!!N.data.item&&!!f.data.item,V=N.data.item,q=typeof V?.metadata?.siteUrl=="string"?V.metadata.siteUrl:void 0,_e=s||n||"";let ne;e[27]!==q||e[28]!==_e?(ne=mt(_e,q),e[27]=q,e[28]=_e,e[29]=ne):ne=e[29];const le=D&&ne,ae=s||n||q||"",_=$(),[we]=Se();let ce;e[30]!==ae||e[31]!==we.language||e[32]!==r?(ce=Me({siteUrl:ae,email:r,locale:we.language}),e[30]=ae,e[31]=we.language,e[32]=r,e[33]=ce):ce=e[33];const Ne=ce;let me;e[34]!==Ne||e[35]!==o.id?(me=i.jsx(De,{href:Ne,orgId:o.id}),e[34]=Ne,e[35]=o.id,e[36]=me):me=e[36];const L=me;let de;e[37]!==m||e[38]!==_?(de=m?Ke(_,m):null,e[37]=m,e[38]=_,e[39]=de):de=e[39];const k=de;let ue;e[40]!==C?(ue=y=>{const S=Ie(y);if(!S.ok){u(S.error);return}u(null),C.mutate(S.value)},e[40]=C,e[41]=ue):ue=e[41];const K=ue;let ge;e[42]!==s||e[43]!==K||e[44]!==le?(ge=y=>{!y||d.current||le||!s||(d.current=!0,K(s))},e[42]=s,e[43]=K,e[44]=le,e[45]=ge):ge=e[45];const Ee=ge;let fe;e[46]!==o.id||e[47]!==K||e[48]!==n?(fe=y=>{y.preventDefault();const S=Ie(n);S.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:o.id}),K(n)},e[46]=o.id,e[47]=K,e[48]=n,e[49]=fe):fe=e[49];const A=fe;if(le){const y=o.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let I;e[51]!==o.slug?(I={org:y,taskId:S},e[51]=o.slug,e[52]=I):I=e[52];let R;e[53]!==o.id?(R=Ct(o.id),e[53]=o.id,e[54]=R):R=e[54];const H=ae||void 0;let z;e[55]!==R.id||e[56]!==H?(z={virtualmcpid:R.id,connect:"1",siteUrl:H},e[55]=R.id,e[56]=H,e[57]=z):z=e[57];let F;return e[58]!==I||e[59]!==z?(F=i.jsx(at,{to:"/$org/$taskId",params:I,search:z,replace:!0}),e[58]=I,e[59]=z,e[60]=F):F=e[60],F}if(C.isPending){let y;return e[61]!==L?(y=i.jsx(rt,{visual:L}),e[61]=L,e[62]=y):y=e[62],y}if(s){let y,S,I,R,H,z,F,Z;if(e[63]!==L||e[64]!==A||e[65]!==s||e[66]!==o.name||e[67]!==C.isPending||e[68]!==n||e[69]!==_||e[70]!==k||e[71]!==Ee){Z=Symbol.for("react.early_return_sentinel");e:{const Ue=Ie(s);if(!Ue.ok){let ie;e[80]!==_?(ie=_("routes.commerceOnboarding.commerceDiagnostic"),e[80]=_,e[81]=ie):ie=e[81];let oe;e[82]!==o.name||e[83]!==_?(oe=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[82]=o.name,e[83]=_,e[84]=oe):oe=e[84];let be;e[85]!==ie||e[86]!==oe?(be=i.jsx(W,{title:ie,description:oe}),e[85]=ie,e[86]=oe,e[87]=be):be=e[87];let xe;e[88]!==A||e[89]!==C.isPending||e[90]!==n||e[91]!==k?(xe=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[88]=A,e[89]=C.isPending,e[90]=n,e[91]=k,e[92]=xe):xe=e[92];const Pe=i.jsxs("div",{className:"grid gap-10",children:[be,i.jsx(Oe,{message:Ke(_,Ue.error)}),xe]});let ye;e[93]!==L||e[94]!==Pe?(ye=i.jsx(T,{visual:L,children:Pe}),e[93]=L,e[94]=Pe,e[95]=ye):ye=e[95],Z=ye;break e}S=T,F=L,H=Ee,z="grid gap-10",y=W,e[96]!==_?(I=_("routes.commerceOnboarding.commerceDiagnostic"),e[96]=_,e[97]=I):I=e[97],R=_("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Ue.value})}e[63]=L,e[64]=A,e[65]=s,e[66]=o.name,e[67]=C.isPending,e[68]=n,e[69]=_,e[70]=k,e[71]=Ee,e[72]=y,e[73]=S,e[74]=I,e[75]=R,e[76]=H,e[77]=z,e[78]=F,e[79]=Z}else y=e[72],S=e[73],I=e[74],R=e[75],H=e[76],z=e[77],F=e[78],Z=e[79];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let ee;e[98]!==y||e[99]!==I||e[100]!==R?(ee=i.jsx(y,{title:I,description:R}),e[98]=y,e[99]=I,e[100]=R,e[101]=ee):ee=e[101];let te;e[102]!==A||e[103]!==C.isPending||e[104]!==n||e[105]!==k?(te=k?i.jsxs(i.Fragment,{children:[i.jsx(Oe,{message:k}),i.jsx(ze,{siteUrl:n,error:null,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A})]}):i.jsx(Xe,{}),e[102]=A,e[103]=C.isPending,e[104]=n,e[105]=k,e[106]=te):te=e[106];let re;e[107]!==H||e[108]!==z||e[109]!==ee||e[110]!==te?(re=i.jsxs("div",{ref:H,className:z,children:[ee,te]}),e[107]=H,e[108]=z,e[109]=ee,e[110]=te,e[111]=re):re=e[111];let he;return e[112]!==S||e[113]!==F||e[114]!==re?(he=i.jsx(S,{visual:F,children:re}),e[112]=S,e[113]=F,e[114]=re,e[115]=he):he=e[115],he}let Q;e[116]!==_?(Q=_("routes.commerceOnboarding.commerceDiagnostic"),e[116]=_,e[117]=Q):Q=e[117];let G;e[118]!==o.name||e[119]!==_?(G=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[118]=o.name,e[119]=_,e[120]=G):G=e[120];let Y;e[121]!==Q||e[122]!==G?(Y=i.jsx(W,{title:Q,description:G}),e[121]=Q,e[122]=G,e[123]=Y):Y=e[123];let J;e[124]!==A||e[125]!==C.isPending||e[126]!==n||e[127]!==k?(J=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[124]=A,e[125]=C.isPending,e[126]=n,e[127]=k,e[128]=J):J=e[128];let X;e[129]!==Y||e[130]!==J?(X=i.jsxs("div",{className:"grid gap-10",children:[Y,J]}),e[129]=Y,e[130]=J,e[131]=X):X=e[131];let pe;return e[132]!==L||e[133]!==X?(pe=i.jsx(T,{visual:L,children:X}),e[132]=L,e[133]=X,e[134]=pe):pe=e[134],pe}function ze(t){const e=E.c(30),{siteUrl:o,error:s,isSubmitting:r,onSiteUrlChange:a,onSubmit:l}=t,n=$();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let u;e[4]!==a?(u=M=>a(M.target.value),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==n?(d=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=d):d=e[7];const g=!!s;let p;e[8]!==r||e[9]!==o||e[10]!==u||e[11]!==d||e[12]!==g?(p=i.jsx(gt,{id:"commerce-site-url",type:"text",inputMode:"url",value:o,onChange:u,placeholder:d,"aria-invalid":g,disabled:r}),e[8]=r,e[9]=o,e[10]=u,e[11]=d,e[12]=g,e[13]=p):p=e[13];let v;e[14]!==s?(v=s?i.jsx(Oe,{message:s}):null,e[14]=s,e[15]=v):v=e[15];let b;e[16]!==m||e[17]!==p||e[18]!==v?(b=i.jsxs("div",{className:"grid gap-2",children:[m,p,v]}),e[16]=m,e[17]=p,e[18]=v,e[19]=b):b=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Ot,{size:16}),e[22]=N):N=e[22];let P;e[23]!==r||e[24]!==w?(P=i.jsxs(ve,{type:"submit",size:"xl",className:"w-full",disabled:r,children:[w,N]}),e[23]=r,e[24]=w,e[25]=P):P=e[25];let U;return e[26]!==l||e[27]!==P||e[28]!==b?(U=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[b,P]}),e[26]=l,e[27]=P,e[28]=b,e[29]=U):U=e[29],U}function Oe(t){const e=E.c(2),{message:o}=t;let s;return e[0]!==o?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:o}),e[0]=o,e[1]=s):s=e[1],s}export{ii as default};
@@ -1 +1 @@
1
- import{b}from"./extract-connection-data-C4oZtxRq.js";import{b as h}from"./provision-repo-scoped-github-connection-DWINBxtd.js";import{g}from"./metadata-dUsYcpuu.js";const C=new Set(["google-analytics"]);function _(n){if(n.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return u(e?.accountName);case"google-analytics":return u(e?.propertyId);case"google-search-console":return u(e?.siteUrl);case"github":return u(t?.github_repo);default:return!0}}function T(n){const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function U(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&t.push({fieldKey:i,bindingType:a})}return t}const B=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function O(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function x(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function M(n,e,t,i){return{...n??{},[e]:{__type:t,value:i}}}function u(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(u):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&u(t)):!1}function I(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function N(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function v(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=N(t);return i?[{key:e,label:I(e),value:i}]:[]}):[]}function P({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function S(n,e,t){const i=n.filter(o=>(o.app_name===e||!!t&&o.app_id===t)&&h(o)===null);return i.length===0?null:(i.sort((o,r)=>{const s=a=>a.status==="active"?0:1;return s(o)!==s(r)?s(o)-s(r):(r.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function w(n){return n.server?.icons?.[0]?.src??b(n.server?.repository)??null}function K(n,e){const t=g(n._meta);return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function V(n){const e=[],t=new Map(n.connections.map(i=>[i.id,i]));for(const i of n.requirements){const o=n.curated[i.bindingType],r=o?n.itemsById[o.registryAppId]:n.itemsByName[i.bindingType];if(!r)continue;const s=n.configurationState?.[i.fieldKey]?.value,a=s?t.get(s):void 0,c=s&&a?s:null,y=c?n.connectionReadiness?.[c]!==!1:!1,p=!!c&&y,f=p?void 0:n.saBindings?.[i.bindingType],l=p||!!f,d=p?"oauth":f?"sa":null,m=l&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:r,title:K(r,i.bindingType),icon:w(r),headline:o?.headline??g(r._meta)?.short_description??null,area:o?.area??null,bullets:o?.bullets??[],satisfied:l,configured:m,required:C.has(i.bindingType),candidateConnectionId:l?null:c||S(n.connections,i.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null,connectedDetail:l?T({bindingType:i.bindingType,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null}):null})}return e}function W(n,e){if(!n)return null;const t=o=>{const r=o.startsWith("sc-domain:")?o.substring(10):(()=>{try{return new URL(o.startsWith("http")?o:`https://${o}`).hostname}catch{return null}})();return r===null?o:r.startsWith("www.")?r.substring(4):r},i=t(n);for(const o of e)if(t(o.siteUrl)===i)return o.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,v as g,W as m,U as p,P as s,q as t,x as u};
1
+ import{b}from"./extract-connection-data-BnMf-nfh.js";import{b as h}from"./provision-repo-scoped-github-connection-DWINBxtd.js";import{g}from"./metadata-dUsYcpuu.js";const C=new Set(["google-analytics"]);function _(n){if(n.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return u(e?.accountName);case"google-analytics":return u(e?.propertyId);case"google-search-console":return u(e?.siteUrl);case"github":return u(t?.github_repo);default:return!0}}function T(n){const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function U(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&t.push({fieldKey:i,bindingType:a})}return t}const B=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function O(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function x(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function M(n,e,t,i){return{...n??{},[e]:{__type:t,value:i}}}function u(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(u):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&u(t)):!1}function I(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function N(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function v(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=N(t);return i?[{key:e,label:I(e),value:i}]:[]}):[]}function P({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function S(n,e,t){const i=n.filter(o=>(o.app_name===e||!!t&&o.app_id===t)&&h(o)===null);return i.length===0?null:(i.sort((o,r)=>{const s=a=>a.status==="active"?0:1;return s(o)!==s(r)?s(o)-s(r):(r.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function w(n){return n.server?.icons?.[0]?.src??b(n.server?.repository)??null}function K(n,e){const t=g(n._meta);return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function V(n){const e=[],t=new Map(n.connections.map(i=>[i.id,i]));for(const i of n.requirements){const o=n.curated[i.bindingType],r=o?n.itemsById[o.registryAppId]:n.itemsByName[i.bindingType];if(!r)continue;const s=n.configurationState?.[i.fieldKey]?.value,a=s?t.get(s):void 0,c=s&&a?s:null,y=c?n.connectionReadiness?.[c]!==!1:!1,p=!!c&&y,f=p?void 0:n.saBindings?.[i.bindingType],l=p||!!f,d=p?"oauth":f?"sa":null,m=l&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:r,title:K(r,i.bindingType),icon:w(r),headline:o?.headline??g(r._meta)?.short_description??null,area:o?.area??null,bullets:o?.bullets??[],satisfied:l,configured:m,required:C.has(i.bindingType),candidateConnectionId:l?null:c||S(n.connections,i.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null,connectedDetail:l?T({bindingType:i.bindingType,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null}):null})}return e}function W(n,e){if(!n)return null;const t=o=>{const r=o.startsWith("sc-domain:")?o.substring(10):(()=>{try{return new URL(o.startsWith("http")?o:`https://${o}`).hostname}catch{return null}})();return r===null?o:r.startsWith("www.")?r.substring(4):r},i=t(n);for(const o of e)if(t(o.siteUrl)===i)return o.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,v as g,W as m,U as p,P as s,q as t,x as u};