decocms 4.150.2 → 4.150.4

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 (239) hide show
  1. package/dist/client/assets/{AlertCircle-CAbc8MAP.js → AlertCircle-DTjquTrK.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BpGDlewJ.js → AreaChart-BXmrHuOS.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Cbgz6edS.js → ArrowUp-C_RbLm19.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-rLTsVWA_.js → ArrowUpRight-Bgytz22C.js} +1 -1
  5. package/dist/client/assets/{Check-aJK60dGs.js → Check-Dns2c6Pe.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DyT8St9I.js → CheckCircle-moO4E3Pd.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-QKGLHDtk.js → ChevronDown-Tys9SsIT.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-ByhOJDuf.js → ChevronRight-ClNdXo6E.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Bua8mQg_.js → ChevronUp-B8jNRGSm.js} +1 -1
  10. package/dist/client/assets/{Copy01-MoyRnx9Y.js → Copy01-CU-w216i.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-BRse3wgD.js → CpuChip01-CuupaCsN.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DDt1Z0of.js → DotsVertical-01u7hyT5.js} +1 -1
  13. package/dist/client/assets/{Eye-CN7MnuxX.js → Eye-B6QNwZfk.js} +1 -1
  14. package/dist/client/assets/{FilterLines-D6T2TLxw.js → FilterLines-BRMYqGE1.js} +1 -1
  15. package/dist/client/assets/{HardDrive-k_osV2fx.js → HardDrive-IIAfnN7r.js} +1 -1
  16. package/dist/client/assets/{Key01-DgWg9XoR.js → Key01-D56HyrYp.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DuThLaX3.js → LayoutLeft-CPGTnCZU.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BjO4mb1B.js → LinkExternal01-dNR13sFy.js} +1 -1
  19. package/dist/client/assets/{LogOut01-BaLbb-JK.js → LogOut01-C07Nl-bH.js} +1 -1
  20. package/dist/client/assets/{Monitor01-BbOMT_Bf.js → Monitor01-Ubwy69Fy.js} +1 -1
  21. package/dist/client/assets/{Palette-Bu3LAepu.js → Palette-hMb2kP_c.js} +1 -1
  22. package/dist/client/assets/{Play-ZUjJ9tm4.js → Play-BL78n60V.js} +1 -1
  23. package/dist/client/assets/{Plus-DNcVUobv.js → Plus-B3gJnzuO.js} +1 -1
  24. package/dist/client/assets/{SearchLg-pvNMPdx7.js → SearchLg-DhvOuE0-.js} +1 -1
  25. package/dist/client/assets/{SearchMd-BMhVoBl-.js → SearchMd-BLYySQIw.js} +1 -1
  26. package/dist/client/assets/{Settings02-DqVBXHWa.js → Settings02-BFa2mTNh.js} +1 -1
  27. package/dist/client/assets/{Shield01-DqbjKqjF.js → Shield01-CZo9_r2S.js} +1 -1
  28. package/dist/client/assets/{Star01-C6wv5tg7.js → Star01-C9x3Su1w.js} +1 -1
  29. package/dist/client/assets/{Stars01-cbnx-58G.js → Stars01-CC0wV3Nx.js} +1 -1
  30. package/dist/client/assets/{Stars02-BteVxWQx.js → Stars02-Cb-iJvXW.js} +1 -1
  31. package/dist/client/assets/{Sun-jlM4_jk2.js → Sun-CcONFEfR.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-CcYoskYm.js → SwitchHorizontal01-Cx37rdU2.js} +1 -1
  33. package/dist/client/assets/{Tool01-y5Zo-2kp.js → Tool01-D7iuvGFJ.js} +1 -1
  34. package/dist/client/assets/{Tool02-DxIXF41R.js → Tool02-ByjOLKI2.js} +1 -1
  35. package/dist/client/assets/{Trash01-8tMNvAGj.js → Trash01-CiPGnldi.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-Bvixesdw.js → TrendUp01-lA0Lvdp_.js} +1 -1
  37. package/dist/client/assets/{Upload01-DEb40SuQ.js → Upload01-OX7F4voU.js} +1 -1
  38. package/dist/client/assets/{User01-B1EqqZKM.js → User01-YOmoXJGu.js} +1 -1
  39. package/dist/client/assets/{Users01-Ca4M-Dx2.js → Users01-BeeYOzxV.js} +1 -1
  40. package/dist/client/assets/{Users03-DdrNKhEH.js → Users03-B5s8YvRc.js} +1 -1
  41. package/dist/client/assets/{X-6E3IZLpq.js → X-DBOS7r3S.js} +1 -1
  42. package/dist/client/assets/{XCircle-Dv7GY9Ae.js → XCircle-DUjAvWnb.js} +1 -1
  43. package/dist/client/assets/{XClose-outHzlfY.js → XClose-uNckWCz9.js} +1 -1
  44. package/dist/client/assets/{Zap-7KA5ZNQg.js → Zap-BLRYQTIt.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-Cvx15c67.js → ZapSquare-xmkoMn7X.js} +1 -1
  46. package/dist/client/assets/{access-gate-BtdxRPzC.js → access-gate-XVhbpoxy.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-1gI2_SbS.js → add-section-modal-2gWJRg19.js} +1 -1
  48. package/dist/client/assets/{agent-icon-qAcwCm4B.js → agent-icon-CAUHBfW4.js} +1 -1
  49. package/dist/client/assets/{agents-list-B7vHkEUR.js → agents-list-B3KIIZ8c.js} +1 -1
  50. package/dist/client/assets/ai-providers-Bgy7BySr.js +1 -0
  51. package/dist/client/assets/{alert-D_OxeHCG.js → alert-CZEzrgN2.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BzE_binL.js → alert-dialog-D4-tJrWc.js} +1 -1
  53. package/dist/client/assets/app-editor-CQh1Mxgi.js +1 -0
  54. package/dist/client/assets/{auth-BKADTSIm.js → auth-DLvKR-oW.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-DCbf-FPB.js → auth-catchall-SxF2tMT6.js} +1 -1
  56. package/dist/client/assets/auth-entry-D0vXB9U-.js +1 -0
  57. package/dist/client/assets/{auth-split-layout-fl1tt8El.js → auth-split-layout-XrKLbaYe.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BXgFAJ7b.js → authenticate-and-persist-oauth-CPUxemKr.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-3FdiUeBz.js → automation-list-row-C1QkJRmc.js} +1 -1
  60. package/dist/client/assets/{automation-runs-AODBXa-8.js → automation-runs-BP2HQSMl.js} +14 -14
  61. package/dist/client/assets/{automations-DP78jBC4.js → automations-2Z80LrOL.js} +1 -1
  62. package/dist/client/assets/{avatar-Bl8FLdrm.js → avatar-Cp11uPnq.js} +1 -1
  63. package/dist/client/assets/{badge-LURmYsxa.js → badge-DZEFMINc.js} +1 -1
  64. package/dist/client/assets/{block-document-B-Vw2I-7.js → block-document-DJaxeaHu.js} +1 -1
  65. package/dist/client/assets/{brand-context-Chvs1V4k.js → brand-context-BQLwG1sk.js} +1 -1
  66. package/dist/client/assets/{buckets-LD_Kv7DZ.js → buckets-BTjJCtaA.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-BE_Fi8je.js +1 -0
  68. package/dist/client/assets/{calendar-RjMy83m7.js → calendar-d9OJELhO.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-DywZlInh.js → capability-load-error-CLrQQQL6.js} +1 -1
  70. package/dist/client/assets/{card-lRKCCLQw.js → card-B1SlHP18.js} +1 -1
  71. package/dist/client/assets/category-editor-DmHVdEM4.js +1 -0
  72. package/dist/client/assets/chat-context-BSsWMhXR.js +36 -0
  73. package/dist/client/assets/{checkbox-gzTh7FP3.js → checkbox-blTthb_w.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BMeDbwDU.js → cli-auth-success-2PYSple7.js} +1 -1
  75. package/dist/client/assets/collection-detail-DmkqZ5KP.js +1 -0
  76. package/dist/client/assets/{collection-display-button-CDMiZ4wp.js → collection-display-button-BSkmpV6C.js} +1 -1
  77. package/dist/client/assets/{collection-search-ljHjogUZ.js → collection-search-lN6Cz3Vq.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-07iU-rKc.js → collection-table-wrapper-CGVWvOoV.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-DWzHRz5O.js → collection-tabs-B_bEWIMS.js} +1 -1
  80. package/dist/client/assets/{command-j9BWJhQ1.js → command-DJEzQEc-.js} +1 -1
  81. package/dist/client/assets/commerce-onboarding-Bn3zcYnn.js +1 -0
  82. package/dist/client/assets/{companions-core-CeShKWs_.js → companions-core-X9hhII14.js} +1 -1
  83. package/dist/client/assets/{connect-Dyp_F0m0.js → connect-M7szAnSj.js} +1 -1
  84. package/dist/client/assets/{connection-DDpagRMI.js → connection-D5e6QSqD.js} +1 -1
  85. package/dist/client/assets/{connection-card-BRV9KXgc.js → connection-card-CdR4Hjjd.js} +1 -1
  86. package/dist/client/assets/{connection-detail-DT_FeXpQ.js → connection-detail-_TM8VOyY.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-CI7ZaQlB.js → connection-form-helpers-CMLafiF2.js} +1 -1
  88. package/dist/client/assets/{connections-BuFxk7y9.js → connections-B71Rrl76.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-CjEW6498.js → decopilot-sse-pool-DvpSsfO0.js} +1 -1
  90. package/dist/client/assets/{dialog-BUJ-AcXn.js → dialog-BKsM-_ty.js} +1 -1
  91. package/dist/client/assets/{domain-settings-Dh870ukR.js → domain-settings-KnXPsIKC.js} +1 -1
  92. package/dist/client/assets/{drawer-kWTjBHBr.js → drawer-C3ySVHPO.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BOOIaYmO.js → dropdown-menu-BOosQCKo.js} +1 -1
  94. package/dist/client/assets/{empty-state-XIb0GhoJ.js → empty-state-Yd3uikaK.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DPzwGu6f.js → extract-connection-data-DBKBY2DO.js} +1 -1
  96. package/dist/client/assets/file-explorer-tSZaxorQ.js +2 -0
  97. package/dist/client/assets/{form-DhWAfAxx.js → form-7PUQGVWb.js} +1 -1
  98. package/dist/client/assets/{general-CjTdG6rX.js → general-BQLAilMm.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-DGEn8-6q.js → github-repo-picker-LSrDvfra.js} +1 -1
  100. package/dist/client/assets/{hooks-FOgIFNPr.js → hooks-dXrX1ifh.js} +1 -1
  101. package/dist/client/assets/index-B7E5jDaS.js +1 -0
  102. package/dist/client/assets/{index-Ac0om1NX.js → index-BXpMNetJ.js} +1 -1
  103. package/dist/client/assets/index-C-FF6Oyi.js +8 -0
  104. package/dist/client/assets/{index-C-_pDHOJ.js → index-DFZL_gYC.js} +2 -2
  105. package/dist/client/assets/{index-CIyNbcah.js → index-Dgu2Vpgr.js} +12 -12
  106. package/dist/client/assets/{index-CQ0WoKUM.js → index-DhUACU_F.js} +1 -1
  107. package/dist/client/assets/{index-BCxi5_7f.js → index-FipZjjSd.js} +1 -1
  108. package/dist/client/assets/{index-EeV9OJhC.js → index-KbL_drb4.js} +1 -1
  109. package/dist/client/assets/{index-BWQ8J_Ql.js → index-THgqetzw.js} +26 -26
  110. package/dist/client/assets/{index-_IZqLwb-.js → index-fhesSFXa.js} +1 -1
  111. package/dist/client/assets/{index-BX2N3HzA.js → index-k5RBNCDf.js} +1 -1
  112. package/dist/client/assets/{index-redirect-BjGSlCrH.js → index-redirect-C7v0tQkO.js} +1 -1
  113. package/dist/client/assets/{input-IzR9qH12.js → input-lozpQHHu.js} +1 -1
  114. package/dist/client/assets/{integration-icon-CaGyRRyP.js → integration-icon-DLqzR71a.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-CTeaS8vD.js → invite-member-dialog-BK8_nU5D.js} +1 -1
  116. package/dist/client/assets/{label-zD_AlFJF.js → label-BHh6uR9Q.js} +1 -1
  117. package/dist/client/assets/{layout-uxu7b6O6.js → layout-CVO9-v6r.js} +1 -1
  118. package/dist/client/assets/login-BO1GPVdu.js +1 -0
  119. package/dist/client/assets/{mcp-oauth-CNzwJzT5.js → mcp-oauth-B-mM8bX2.js} +1 -1
  120. package/dist/client/assets/{members-DcNYgo-P.js → members-BZzgkWfy.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-Co8sJEI7.js → monaco-editor-Cfqzc-8w.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-CbXMz8km.js → monitoring-stats-row-BzXx_eKv.js} +1 -1
  123. package/dist/client/assets/{multi-select-Czw1wHcN.js → multi-select-9hlGjhzz.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-B0H3IWVN.js → oauth-callback-DTtEChwC.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-b5YfaX3T.js → oauth-callback-ai-provider-CQ_u2Jm1.js} +1 -1
  126. package/dist/client/assets/{onboarding-CB5K-VlR.js → onboarding-BzhQXIUY.js} +1 -1
  127. package/dist/client/assets/{org-install-YGw7zvFP.js → org-install-_nJomANu.js} +1 -1
  128. package/dist/client/assets/{org-layout-B1R0Q8-o.js → org-layout-gfvnKDyg.js} +1 -1
  129. package/dist/client/assets/{organization-choice-Ne0KB-x0.js → organization-choice-fz82Zhx8.js} +1 -1
  130. package/dist/client/assets/{orgs-BnIgEs74.js → orgs-OO6LdEDN.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-D5M2Mesd.js → page-seo-form-FEC9DgJs.js} +1 -1
  132. package/dist/client/assets/{popover-CkXP0cF6.js → popover-CXjrMSw4.js} +1 -1
  133. package/dist/client/assets/post-editor-DaAB3sPQ.js +1 -0
  134. package/dist/client/assets/{primitives-C2lr9KO1.js → primitives-DLg7fu6K.js} +1 -1
  135. package/dist/client/assets/{profile-jB7FMt3l.js → profile-CKqNnO3L.js} +1 -1
  136. package/dist/client/assets/project-app-view-CUxC4D9q.js +1 -0
  137. package/dist/client/assets/record-editor-CjDlKsNP.js +1 -0
  138. package/dist/client/assets/redirect-editor-Dgn7lqDs.js +1 -0
  139. package/dist/client/assets/registry-BVmFFYL8.js +2 -0
  140. package/dist/client/assets/{registry-layout-HtTY1XfQ.js → registry-layout-D46I0UMg.js} +1 -1
  141. package/dist/client/assets/{reports-YssXN6Zx.js → reports-aojMnw1Q.js} +2 -2
  142. package/dist/client/assets/{require-capability-DEFFZdkS.js → require-capability-jlNhkTb6.js} +1 -1
  143. package/dist/client/assets/{required-auth-layout-CcfxFPTq.js → required-auth-layout-R3pnumOj.js} +1 -1
  144. package/dist/client/assets/{reset-password-DjZyqOt5.js → reset-password-D0q-th4_.js} +1 -1
  145. package/dist/client/assets/{roles-CjsNVENm.js → roles-DwHjRTS_.js} +1 -1
  146. package/dist/client/assets/{search-input-Di-RLxL2.js → search-input-mQjjHRqZ.js} +1 -1
  147. package/dist/client/assets/{secrets-BSG0owhI.js → secrets-D6sNIB6g.js} +1 -1
  148. package/dist/client/assets/{sections-editor-BTGC7Dfw.js → sections-editor-CPNQXr9a.js} +2 -2
  149. package/dist/client/assets/{select-BeoMfuBi.js → select-C1_7MrrX.js} +1 -1
  150. package/dist/client/assets/{select-model-Ba2cltVj.js → select-model-BXeJJeNe.js} +2 -2
  151. package/dist/client/assets/{self-tool-result-BLIGgLaX.js → self-tool-result-rdFZlvBc.js} +1 -1
  152. package/dist/client/assets/seo-editor-BtBWG2vp.js +1 -0
  153. package/dist/client/assets/{settings-layout-C0qTcOnX.js → settings-layout-BscWQQeN.js} +1 -1
  154. package/dist/client/assets/{settings-section-DMX_R5s3.js → settings-section-Ed6F2WGu.js} +1 -1
  155. package/dist/client/assets/{shell-controls-CrY__EeP.js → shell-controls-AtSbxQ9D.js} +1 -1
  156. package/dist/client/assets/{shell-layout-Cq8rmUZ4.js → shell-layout-CUR6yOq-.js} +1 -1
  157. package/dist/client/assets/{sidebar-Dqyoi3Jo.js → sidebar-BGbzDXr_.js} +1 -1
  158. package/dist/client/assets/{skeleton-mzmR9D0W.js → skeleton-vF_x3eWZ.js} +1 -1
  159. package/dist/client/assets/spinner-elZlai98.js +1 -0
  160. package/dist/client/assets/{sso-DQ3A7eYM.js → sso-B1YEXDzc.js} +1 -1
  161. package/dist/client/assets/{store-DE5Iz_hB.js → store-hKyCRaph.js} +1 -1
  162. package/dist/client/assets/store-registry-Bkh2WPCf.js +2 -0
  163. package/dist/client/assets/{studio-tools-BziqPhXE.js → studio-tools-BvDeY2Lo.js} +1 -1
  164. package/dist/client/assets/{switch-DEnDWJad.js → switch-Du2_QzTg.js} +1 -1
  165. package/dist/client/assets/{tab-id-CpKaVM9t.js → tab-id-JenI7Odu.js} +1 -1
  166. package/dist/client/assets/{table-8sezDnga.js → table-x2c6Pdi4.js} +1 -1
  167. package/dist/client/assets/{tabs-BDABIwTP.js → tabs-mJBYrWlc.js} +1 -1
  168. package/dist/client/assets/{textarea-w4chswNw.js → textarea-IxMMo1Wd.js} +1 -1
  169. package/dist/client/assets/{toggle-group-Dlgb2--d.js → toggle-group-BZBw0hKn.js} +1 -1
  170. package/dist/client/assets/{toolbar-BV83UGjr.js → toolbar-BKdNDIaH.js} +1 -1
  171. package/dist/client/assets/{tooltip-E9C3lYtr.js → tooltip-ydp7540T.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-CPseYMhM.js → use-ai-providers-BKoVdYIR.js} +1 -1
  173. package/dist/client/assets/{use-automations-B5e1sys8.js → use-automations-Cbph7N0j.js} +1 -1
  174. package/dist/client/assets/{use-autosave-DsiUg614.js → use-autosave-0ks8GWhg.js} +1 -1
  175. package/dist/client/assets/{use-capability-0p8XXo7t.js → use-capability-ohi-NDa2.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-CNICdDqm.js → use-clock-tick-BWPSm4QE.js} +1 -1
  177. package/dist/client/assets/{use-connection-DhT-Eyoh.js → use-connection-B3zwqmOM.js} +1 -1
  178. package/dist/client/assets/{use-copy-CitgQbMn.js → use-copy-CadQ4GTt.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-CwmieGOB.js → use-create-virtual-mcp-Dwjgmype.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-DT68jL4f.js → use-debounced-autosave-DZjx9e1o.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-C2iB9iww.js → use-debounced-value-B7WDykY3.js} +1 -1
  182. package/dist/client/assets/use-deco-credits-D-OAu1B7.js +1 -0
  183. package/dist/client/assets/{use-decopilot-events-BqtjxaPd.js → use-decopilot-events-_F542Ow4.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-Cq0Jmwza.js → use-delete-connection-DCYFUQQ9.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-CBXNcw9O.js → use-deployment-admin-BLsN25B5.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-CNJh9wYK.js → use-file-configs-AU8ZBjy7.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-DDpxPDP2.js → use-infinite-scroll-Ca8lEh5t.js} +1 -1
  188. package/dist/client/assets/use-is-desktop-app-BNujXJc_.js +1 -0
  189. package/dist/client/assets/{use-join-requests-C3KDTC7_.js → use-join-requests-C_AV2WPf.js} +1 -1
  190. package/dist/client/assets/{use-mcp-auth-status-D0D4mOkH.js → use-mcp-auth-status-C01Nvxgg.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-DxfTC5E_.js → use-mcp-client-B3iWdLa8.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-B2Sf-NwM.js → use-mcp-tools-DJnHPzkz.js} +1 -1
  193. package/dist/client/assets/{use-members-RZeFEjqN.js → use-members-CKdOjNRN.js} +1 -1
  194. package/dist/client/assets/{use-mobile-DLuY7pVt.js → use-mobile-Dnz9IUlf.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-CPiWe3y7.js → use-navigate-to-agent-DOL8zg4L.js} +1 -1
  196. package/dist/client/assets/{use-org-auth-client-CuzKnrVt.js → use-org-auth-client-UOYwn4Tw.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-BwjPrTQu.js → use-org-sso-oyqJGuYe.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-aahUHPIP.js → use-organization-roles-C8vIfGb-.js} +1 -1
  199. package/dist/client/assets/{use-organization-settings-OE3Lr1-V.js → use-organization-settings-C5L3Xtp2.js} +1 -1
  200. package/dist/client/assets/{use-registry-connections-Bw8B7hj8.js → use-registry-connections-BlstzWOE.js} +1 -1
  201. package/dist/client/assets/{use-secrets-BOMoixiw.js → use-secrets-CufpBwD2.js} +1 -1
  202. package/dist/client/assets/{use-status-sounds-DayrZ7TG.js → use-status-sounds-G7ifNzp9.js} +1 -1
  203. package/dist/client/assets/{use-tags-DqEuQ6vZ.js → use-tags-B3b9FAI4.js} +1 -1
  204. package/dist/client/assets/{use-view-mode-Bk25Hg6x.js → use-view-mode-D8yNzl-W.js} +1 -1
  205. package/dist/client/assets/{use-virtual-mcp-CiSjSkCo.js → use-virtual-mcp-B4IBQNll.js} +1 -1
  206. package/dist/client/assets/useInfiniteQuery-x5tDdtWN.js +1 -0
  207. package/dist/client/assets/{useQueries-D3rnFNlM.js → useQueries-Bf_u2aEG.js} +1 -1
  208. package/dist/client/assets/{useRouterState-DDLhvHVC.js → useRouterState-8mB78CkW.js} +1 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-rZqLQHwD.js +1 -0
  210. package/dist/client/assets/{users-153qH5_-.js → users-DYkva5mS.js} +1 -1
  211. package/dist/client/assets/variant-calendar-lkfMxqtr.js +1 -0
  212. package/dist/client/assets/{view-mode-toggle-BtnmUoq6.js → view-mode-toggle-7lUC7xD-.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +1 -1
  215. package/dist/server/server.js +1 -1
  216. package/package.json +1 -1
  217. package/dist/client/assets/ai-providers-Cy0WUCI6.js +0 -1
  218. package/dist/client/assets/app-editor-D6kzTyQl.js +0 -1
  219. package/dist/client/assets/auth-entry-n0kUqZDU.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-DalBiXPR.js +0 -1
  221. package/dist/client/assets/category-editor-BNU81d-v.js +0 -1
  222. package/dist/client/assets/chat-context-CUD5YWfE.js +0 -36
  223. package/dist/client/assets/collection-detail-BpRPJJJO.js +0 -1
  224. package/dist/client/assets/commerce-onboarding-BDrLxXBN.js +0 -1
  225. package/dist/client/assets/file-explorer-mQ9cuAlm.js +0 -2
  226. package/dist/client/assets/index-MlZsnJSA.js +0 -1
  227. package/dist/client/assets/index-bM-iCUGb.js +0 -8
  228. package/dist/client/assets/login-Br6hVgnv.js +0 -1
  229. package/dist/client/assets/post-editor-BEQMlvQZ.js +0 -1
  230. package/dist/client/assets/project-app-view-3XgFTSvm.js +0 -1
  231. package/dist/client/assets/record-editor-DJqb0slJ.js +0 -1
  232. package/dist/client/assets/redirect-editor-BJUT-zFR.js +0 -1
  233. package/dist/client/assets/registry-CCTRqEtG.js +0 -2
  234. package/dist/client/assets/seo-editor-D25oK2rX.js +0 -1
  235. package/dist/client/assets/store-registry-DJq2Z-1C.js +0 -2
  236. package/dist/client/assets/use-deco-credits-BxIFs0tR.js +0 -1
  237. package/dist/client/assets/useInfiniteQuery-CYxhJzgo.js +0 -1
  238. package/dist/client/assets/useSuspenseInfiniteQuery-0jsu_qzK.js +0 -1
  239. package/dist/client/assets/variant-calendar-rRxsmTgu.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.150.2",
3
+ "version": "4.150.4",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{X,Y as I,a2 as Me,a4 as Ae,a5 as Ie,a3 as ze,b0 as Te,c as Z,b as oe,Z as He,_ as qe,r as J,j as s,a6 as rt,t as ae,aw as Be,F as Ke,o as we,e as Se,K as re,n as Le,m as $e,B as le,p as Ve,v as ot,E as nt}from"./index-BWQ8J_Ql.js";import{i as at}from"./AlertCircle-CAbc8MAP.js";import{P as Pe}from"./index-EeV9OJhC.js";import{S as Ee}from"./skeleton-mzmR9D0W.js";import{b as Qe,a as Re,S as Fe,c as ct}from"./settings-section-DMX_R5s3.js";import{u as _e,b as Ne,i as dt,c as mt,p as ft,d as Ge}from"./use-ai-providers-CPseYMhM.js";import{i as ut}from"./CheckCircle-DyT8St9I.js";import{b as pt,i as gt}from"./use-organization-settings-OE3Lr1-V.js";import{e as ht,f as Ye,P as xt,h as Oe}from"./select-model-Ba2cltVj.js";import{u as bt}from"./use-debounced-autosave-DT68jL4f.js";import{I as De}from"./input-IzR9qH12.js";import{T as Ue,a as vt}from"./toggle-group-Dlgb2--d.js";import{c as We,d as Je,b as Xe,f as Ze,g as et,e as tt,a as st,A as it}from"./alert-dialog-BzE_binL.js";import{u as je}from"./studio-tools-BziqPhXE.js";import{s as yt}from"./Plus-DNcVUobv.js";import{p as jt,f as St}from"./pt-BR-CLy76QW2.js";import{c as _t}from"./Tool01-y5Zo-2kp.js";import{s as Ct}from"./Trash01-8tMNvAGj.js";import{A as kt}from"./avatar-Bl8FLdrm.js";import{i as Pt}from"./Settings02-DqVBXHWa.js";import{s as Nt}from"./Eye-CN7MnuxX.js";import{b as Dt,a as It,d as Kt,e as wt,c as At}from"./dialog-BUJ-AcXn.js";import{S as Mt}from"./chat-context-CUD5YWfE.js";import{R as Et}from"./require-capability-DEFFZdkS.js";import"./sidebar-Dqyoi3Jo.js";import"./LayoutLeft-DuThLaX3.js";import"./use-mobile-DLuY7pVt.js";import"./X-6E3IZLpq.js";import"./tooltip-E9C3lYtr.js";import"./card-lRKCCLQw.js";import"./ArrowUpRight-rLTsVWA_.js";import"./use-mcp-client-DxfTC5E_.js";import"./auth-BKADTSIm.js";import"./drawer-kWTjBHBr.js";import"./checkbox-gzTh7FP3.js";import"./Check-aJK60dGs.js";import"./select-BeoMfuBi.js";import"./ChevronDown-QKGLHDtk.js";import"./ChevronUp-Bua8mQg_.js";import"./Key01-DgWg9XoR.js";import"./SearchMd-BMhVoBl-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BbOMT_Bf.js";import"./ChevronRight-ByhOJDuf.js";import"./tab-id-CpKaVM9t.js";import"./Copy01-MoyRnx9Y.js";import"./Stars01-cbnx-58G.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-B1EqqZKM.js";import"./hooks-FOgIFNPr.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CjEW6498.js";import"./use-virtual-mcp-CiSjSkCo.js";import"./use-decopilot-events-BqtjxaPd.js";import"./use-capability-0p8XXo7t.js";import"./access-gate-BtdxRPzC.js";import"./capability-load-error-DywZlInh.js";X({title:I(),url:I(),icon:I()});X({registries:Ae(I(),X({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Me(I()).describe("List of MCP app_name or app_id values to hide from the store.")});const ce=X({keyId:I(),modelId:I(),title:I().optional()}).nullable();ze(["fast","smart","thinking","image","web_search","deep_research"]);ze(["fast","smart","thinking"]);const Rt=X({tiers:X({fast:ce,smart:ce,thinking:ce,image:ce,web_search:ce,deep_research:ce})});X({tiers:X({fast:ce.optional(),smart:ce.optional(),thinking:ce.optional()})});X({ids:Me(I()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:Ie().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:Ie().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding.")});X({id:I().describe("Brand context ID"),name:I().describe("Company name"),domain:I().describe("Company domain (e.g. example.com)"),overview:I().describe("Company overview / description"),logo:I().nullable().optional().describe("Logo URL"),favicon:I().nullable().optional().describe("Favicon URL"),ogImage:I().nullable().optional().describe("OG image URL"),fonts:X({heading:I().optional().describe("Font family for headings"),body:I().optional().describe("Font family for body text"),code:I().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:I().optional().describe("Primary brand color (hex)"),secondary:I().optional().describe("Secondary brand color (hex)"),accent:I().optional().describe("Accent / highlight color (hex)"),background:I().optional().describe("Background color (hex)"),foreground:I().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Me(Ae(I(),Te())).nullable().optional().describe("Brand images"),metadata:Ae(I(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:I().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});const Ft=e=>e.capabilities?.includes("image")===!0,Tt=e=>dt(e),$t=e=>mt(e),Ot=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ft},{key:"web_search",filter:Tt},{key:"deep_research",filter:$t}];function Ut(e){const t=Z.c(26),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=_e(),[o,v]=J.useState(i?.keyId??a);let C;t[0]!==i?(C=()=>{i?.keyId&&v(i.keyId)},t[0]=i,t[1]=C):C=t[1];const y=i?.keyId;let l;t[2]!==y?(l=[y],t[2]=y,t[3]=l):l=t[3],J.useEffect(C,l);const d=o??a;let m;t[4]!==d||t[5]!==c?(m=d?c.find(b=>b.id===d):null,t[4]=d,t[5]=c,t[6]=m):m=t[6];const u=m,{models:h,isLoading:g}=Ne(n?d??void 0:void 0),k=n?g||h.some(n):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const j=p,N=oe();if(n&&!k){let b;t[10]!==N?(b=N("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=N,t[11]=b):b=t[11];let K;return t[12]!==b?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[12]=b,t[13]=K):K=t[13],K}let S;t[14]!==N?(S=N("settings.simpleModeSection.pickModel"),t[14]=N,t[15]=S):S=t[15];let _;t[16]===Symbol.for("react.memo_cache_sentinel")?(_=b=>v(b),t[16]=_):_=t[16];let f;t[17]!==d||t[18]!==r?(f=b=>{const K=b.keyId??d??"";v(K),r({keyId:K,modelId:b.modelId,title:b.title})},t[17]=d,t[18]=r,t[19]=f):f=t[19];let P;return t[20]!==d||t[21]!==n||t[22]!==j||t[23]!==S||t[24]!==f?(P=s.jsx(ht,{variant:"bordered",placeholder:S,model:j,credentialId:d,filterModels:n,onCredentialChange:_,onModelChange:f}),t[20]=d,t[21]=n,t[22]=j,t[23]=S,t[24]=f,t[25]=P):P=t[25],P}function zt(e){const t=Z.c(10),{isPending:i,showSaved:r}=e,n=oe();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ut,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function Ht(){const e=Z.c(58),t=oe(),i=_e(),r=pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=He(Rt),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const o=qe(c),{mutate:v,isPending:C,isSuccess:y}=gt(),l=o.formState.isDirty;let d;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==v?(d={delayMs:250,save:async()=>{const x=o.getValues();v(x,{onSuccess:()=>o.reset(x,{keepValues:!0}),onError:A=>{o.reset(r),ae.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=v,e[7]=d):d=e[7];const{schedule:m}=bt(d),u=i[0],h=i[1],g=i[2],{models:k}=Ne(u?.id),{models:p}=Ne(h?.id),{models:j}=Ne(g?.id);let N,S;e[8]!==o||e[9]!==n?(N=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},S=[n,o],e[8]=o,e[9]=n,e[10]=N,e[11]=S):(N=e[10],S=e[11]),J.useEffect(N,S);let _;e[12]!==i||e[13]!==o||e[14]!==u||e[15]!==h||e[16]!==g||e[17]!==k||e[18]!==p||e[19]!==j?(_=()=>{const x=o.getValues(),A=new Set(i.map(qt)),M={};u?.id&&(M[u.id]=k),h?.id&&(M[h.id]=p),g?.id&&(M[g.id]=j);const w=L=>L!=null&&!A.has(L.keyId),D={fast:w(x.tiers.fast)?null:x.tiers.fast,smart:w(x.tiers.smart)?null:x.tiers.smart,thinking:w(x.tiers.thinking)?null:x.tiers.thinking,image:w(x.tiers.image)?null:x.tiers.image,web_search:w(x.tiers.web_search)?null:x.tiers.web_search,deep_research:w(x.tiers.deep_research)?null:x.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,W=D.fast===x.tiers.fast&&D.smart===x.tiers.smart&&D.thinking===x.tiers.thinking&&D.image===x.tiers.image&&D.web_search===x.tiers.web_search&&D.deep_research===x.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);o.reset({tiers:{fast:D.fast??$.chat.fast,smart:D.smart??$.chat.smart,thinking:D.thinking??$.chat.thinking,image:D.image??$.image,web_search:D.web_search??$.webSearch,deep_research:D.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=u,e[15]=h,e[16]=g,e[17]=k,e[18]=p,e[19]=j,e[20]=_):_=e[20];const f=u?.id,P=h?.id,b=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==p||e[25]!==j||e[26]!==f||e[27]!==P||e[28]!==b?(K=[o,i,k,p,j,f,P,b],e[21]=i,e[22]=o,e[23]=k,e[24]=p,e[25]=j,e[26]=f,e[27]=P,e[28]=b,e[29]=K):K=e[29],J.useEffect(_,K);let V;e[30]!==t?(V=x=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[x]||x,e[30]=t,e[31]=V):V=e[31];const B=V;let O;e[32]!==t?(O=x=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[x]||"",e[32]=t,e[33]=O):O=e[33];const Q=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let E;e[36]!==t?(E=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=E):E=e[37];let z;e[38]!==E?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:E}),e[38]=E,e[39]=z):z=e[39];const G=y&&!l;let H;e[40]!==C||e[41]!==G?(H=s.jsx(zt,{isPending:C,showSaved:G}),e[40]=C,e[41]=G,e[42]=H):H=e[42];let R;e[43]!==z||e[44]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,H]}),e[43]=z,e[44]=H,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==Q||e[49]!==B||e[50]!==m?(F=Ot.map(x=>s.jsx(rt,{control:o.control,name:`tiers.${x.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:B(x.key),description:Q(x.key),action:s.jsx(Ut,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:x.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},x.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=Q,e[49]=B,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Re,{children:F}),e[52]=F,e[53]=T):T=e[53];let q;return e[54]!==U||e[55]!==R||e[56]!==T?(q=s.jsxs(Fe,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=q):q=e[57],q}function qt(e){return e.id}const Bt={usd:[10,20,100],brl:[50,100,500]};function Lt(){const e=Z.c(30),t=oe(),i=je(),[r,n]=J.useState(!1);let a;e[0]!==t?(a=f=>{ae.error(t("settings.decoCreditsHero.topUpFailed",{message:f.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:c,isPending:o}=Se({mutationFn:async f=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:f,currency:d});return P},onSuccess:Vt,onError:a}),[v,C]=J.useState(""),[y,l]=J.useState("usd"),d=y,m=parseFloat(v),u=!isNaN(m)&&m>=1,h=d==="brl"?"R$":"$";let g;e[2]!==l?(g=f=>{f&&l(f)},e[2]=l,e[3]=g):g=e[3];let k,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=p):(k=e[4],p=e[5]);let j;e[6]!==d||e[7]!==g?(j=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:d,onValueChange:g,children:[k,p]}),e[6]=d,e[7]=g,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==h||e[11]!==r||e[12]!==o||e[13]!==t||e[14]!==c?(N=!r&&s.jsxs(s.Fragment,{children:[Bt[d].map(f=>s.jsxs(le,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>c(f*100),children:[h,f]},f)),s.jsx(le,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=h,e[11]=r,e[12]=o,e[13]=t,e[14]=c,e[15]=N):N=e[15];let S;e[16]!==h||e[17]!==v||e[18]!==m||e[19]!==r||e[20]!==u||e[21]!==o||e[22]!==C||e[23]!==t||e[24]!==c?(S=r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),s.jsx(De,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:v,onChange:f=>C(f.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(le,{className:"h-10",disabled:!u||o,onClick:()=>c(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(le,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),C("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=v,e[18]=m,e[19]=r,e[20]=u,e[21]=o,e[22]=C,e[23]=t,e[24]=c,e[25]=S):S=e[25];let _;return e[26]!==j||e[27]!==N||e[28]!==S?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,S]})}),e[26]=j,e[27]=N,e[28]=S,e[29]=_):_=e[29],_}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Qt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Gt(){const e=Z.c(121),t=oe(),{org:i}=Ke(),r=je(),n=we(),a=_e();let c;e[0]!==a?(c=a.find(Yt),e[0]=a,e[1]=c):c=e[1];const o=c,[v,C]=J.useState(!1);let y;e[2]!==o||e[3]!==r?(y=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=y):y=e[4];let l;e[5]!==i.id||e[6]!==n||e[7]!==t?(l=()=>{n.invalidateQueries({queryKey:re.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:re.aiProviders(i.id)}),ae.success(t("settings.decoCreditsHero.disconnectSuccess")),C(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=l):l=e[8];let d;e[9]!==t?(d=lt=>{ae.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==y||e[12]!==l||e[13]!==d?(m={mutationFn:y,onSuccess:l,onError:d},e[11]=y,e[12]=l,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:h}=Se(m);let g;e[15]!==i.id?(g=re.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let p;e[17]!==r?(p=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=p):p=e[18];let j;e[19]!==g||e[20]!==k||e[21]!==p?(j={queryKey:g,enabled:k,staleTime:6e4,queryFn:p},e[19]=g,e[20]=k,e[21]=p,e[22]=j):j=e[22];const{data:N,isLoading:S,refetch:_,isFetching:f}=Le(j);if(!o)return null;const P=N?.balanceCents!=null?N.balanceCents/100:null;let b;e[23]!==P?(b=P!=null?`$${P.toFixed(2)}`:"—",e[23]=P,e[24]=b):b=e[24];const K=b;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let B;e[27]!==t?(B=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=B):B=e[28];let O;e[29]!==B?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:B,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=B,e[30]=O):O=e[30];let Q;e[31]!==t?(Q=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=Q):Q=e[32];let U;e[33]!==Q?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:Q})}),e[33]=Q,e[34]=U):U=e[34];let E;e[35]!==O||e[36]!==U?(E=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=E):E=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>C(!0),e[38]=z):z=e[38];let G;e[39]!==t?(G=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=G):G=e[40];let H;e[41]!==h||e[42]!==G?(H=s.jsx(le,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:h,children:G}),e[41]=h,e[42]=G,e[43]=H):H=e[43];let R;e[44]!==E||e[45]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[E,H]}),e[44]=E,e[45]=H,e[46]=R):R=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let q;e[51]!==t?(q=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=q):q=e[52];let x;e[53]!==q?(x=s.jsx(Je,{children:q}),e[53]=q,e[54]=x):x=e[54];let A;e[55]!==T||e[56]!==x?(A=s.jsxs(Xe,{children:[T,x]}),e[55]=T,e[56]=x,e[57]=A):A=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let w;e[60]!==M?(w=s.jsx(Ze,{children:M}),e[60]=M,e[61]=w):w=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==D||e[67]!==Y?(W=s.jsx(et,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==w||e[70]!==W?($=s.jsxs(tt,{children:[w,W]}),e[69]=w,e[70]=W,e[71]=$):$=e[71];let L;e[72]!==A||e[73]!==$?(L=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=L):L=e[74];let ee;e[75]!==v||e[76]!==L?(ee=s.jsx(it,{open:v,onOpenChange:C,children:L}),e[75]=v,e[76]=L,e[77]=ee):ee=e[77];let te;e[78]!==P||e[79]!==K||e[80]!==f||e[81]!==S?(te=S||f?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:$e("text-3xl font-semibold tabular-nums tracking-tight",P!=null&&Qt(P)),children:K}),e[78]=P,e[79]=K,e[80]=f,e[81]=S,e[82]=te):te=e[82];let se;e[83]!==_?(se=()=>_(),e[83]=_,e[84]=se):se=e[84];let ie;e[85]!==t?(ie=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ie):ie=e[86];const ne=f&&"animate-spin";let de;e[87]!==ne?(de=$e(ne),e[87]=ne,e[88]=de):de=e[88];let me;e[89]!==de?(me=s.jsx(Be,{size:14,className:de}),e[89]=de,e[90]=me):me=e[90];let fe;e[91]!==f||e[92]!==se||e[93]!==ie||e[94]!==me?(fe=s.jsx("button",{type:"button",onClick:se,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ie,children:me}),e[91]=f,e[92]=se,e[93]=ie,e[94]=me,e[95]=fe):fe=e[95];let ue;e[96]!==te||e[97]!==fe?(ue=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ue):ue=e[98];let pe;e[99]!==t?(pe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=pe):pe=e[100];let ge;e[101]!==pe?(ge=s.jsx("p",{className:"text-xs text-muted-foreground",children:pe}),e[101]=pe,e[102]=ge):ge=e[102];let he;e[103]!==ue||e[104]!==ge?(he=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ue,ge]}),e[103]=ue,e[104]=ge,e[105]=he):he=e[105];let xe;e[106]!==t?(xe=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=xe):xe=e[107];let be;e[108]!==xe?(be=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:xe}),e[108]=xe,e[109]=be):be=e[109];let Ce;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Lt,{}),e[110]=Ce):Ce=e[110];let ve;e[111]!==be?(ve=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[be,Ce]}),e[111]=be,e[112]=ve):ve=e[112];let ye;e[113]!==R||e[114]!==ee||e[115]!==he||e[116]!==ve?(ye=s.jsx(Re,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,ee,he,ve]})}),e[113]=R,e[114]=ee,e[115]=he,e[116]=ve,e[117]=ye):ye=e[117];let ke;return e[118]!==V||e[119]!==ye?(ke=s.jsx(Fe,{title:V,children:ye}),e[118]=V,e[119]=ye,e[120]=ke):ke=e[120],ke}function Yt(e){return e.providerId==="deco"}function Wt(){const e=Z.c(8),{org:t}=Ke(),i=je(),r=we();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==r?(a=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:re.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:re.aiProviders(t.id)}),ae.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:Jt},e[5]=n,e[6]=a,e[7]=c):c=e[7],Se(c)}function Jt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ae.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Xt(){const e=Z.c(37),t=oe(),{mutate:i,isPending:r}=Wt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let v;e[6]!==t?(v=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=v):v=e[7];let C;e[8]!==v?(C=s.jsx("p",{className:"text-base font-semibold",children:v}),e[8]=v,e[9]=C):C=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let l;e[12]!==y?(l=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=l):l=e[13];let d;e[14]!==C||e[15]!==l?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[C,l]}),e[14]=C,e[15]=l,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let h;e[21]!==u||e[22]!==d?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=h):h=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==r||e[27]!==t?(k=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=k):k=e[28];let p;e[29]!==r||e[30]!==g||e[31]!==k?(p=s.jsx(le,{variant:"outline",disabled:r,onClick:g,children:k}),e[29]=r,e[30]=g,e[31]=k,e[32]=p):p=e[32];let j;return e[33]!==h||e[34]!==p||e[35]!==o?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,h,p]})]}),e[33]=h,e[34]=p,e[35]=o,e[36]=j):j=e[36],j}const Zt=e=>X({label:I().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:I().optional(),baseUrl:I().optional()});function es({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function ts({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:v}=Ke(),C=je(),y=we(),l=oe(),[d,m]=J.useState(!1),u=t.id==="openai-compatible",h=t.supportedMethods.includes("api-key"),g=Zt(l),{register:k,handleSubmit:p,watch:j,setError:N,formState:{errors:S}}=qe({resolver:He(g),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),_=j("apiKey")??"",{mutate:f,isPending:P}=Se({mutationFn:async b=>{let K;b.apiKey&&(u?K=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):K=b.apiKey),await C.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:re.aiProviderKeys(v.id)}),y.invalidateQueries({queryKey:re.aiProviders(v.id)}),ae.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:b=>ae.error(l("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:p(b=>{if(es({isOpenAICompatible:u,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){N("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}f(b)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.label")}),s.jsx(De,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),S.label&&s.jsx("p",{className:"text-xs text-destructive",children:S.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(De,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),h&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(De,{type:d&&_?"text":"password",placeholder:r,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),_&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":l(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Pt,{size:14}):s.jsx(Nt,{size:14})})]}),S.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(At,{children:[s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:P,children:l("settings.editProviderDialog.cancel")}),s.jsx(le,{type:"submit",size:"sm",disabled:P,children:l(P?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ss(e){const t=Z.c(31),{providerKey:i,provider:r,open:n,onOpenChange:a}=e,c=oe(),o=je(),v=r.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,C=v?.name??r.name;let y;t[0]!==i.id?(y=re.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let d;t[5]!==n||t[6]!==y||t[7]!==l?(d={queryKey:y,queryFn:l,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=l,t[8]=d):d=t[8];const{data:m,isLoading:u}=Le(d),h=wt,g=Kt,k="sm:max-w-md",p=It,j=Dt,N=c("settings.editProviderDialog.editTitle",{name:C});let S;t[9]!==j||t[10]!==N?(S=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=S):S=t[11];let _;t[12]!==p||t[13]!==S?(_=s.jsx(p,{children:S}),t[12]=p,t[13]=S,t[14]=_):_=t[14];let f;t[15]!==u||t[16]!==a||t[17]!==v||t[18]!==m||t[19]!==r||t[20]!==i?(f=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Mt,{})}):s.jsx(ts,{providerKey:i,provider:r,preset:v,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=u,t[16]=a,t[17]=v,t[18]=m,t[19]=r,t[20]=i,t[21]=f):f=t[21];let P;t[22]!==g||t[23]!==_||t[24]!==f?(P=s.jsxs(g,{className:k,children:[_,f]}),t[22]=g,t[23]=_,t[24]=f,t[25]=P):P=t[25];let b;return t[26]!==h||t[27]!==a||t[28]!==n||t[29]!==P?(b=s.jsx(h,{open:n,onOpenChange:a,children:P}),t[26]=h,t[27]=a,t[28]=n,t[29]=P,t[30]=b):b=t[30],b}function is(e){const t=Z.c(88),{providerKey:i,provider:r}=e,{org:n}=Ke(),a=je(),c=we(),[o,v]=J.useState(!1),[C,y]=J.useState(!1),l=oe(),[d]=ot(),m=d.language==="pt-BR"?jt:void 0,u=r.id==="openai-compatible";let h;t[0]!==u||t[1]!==i.presetId?(h=u&&i.presetId?Ye(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=h):h=t[2];const g=h;let k;t[3]!==u||t[4]!==g||t[5]!==r.name||t[6]!==l?(k=g?g.name:u?l("settings.aiProviders.customOpenAiCompatible"):r.name,t[3]=u,t[4]=g,t[5]=r.name,t[6]=l,t[7]=k):k=t[7];const p=k,j=g?.logo??r.logo;let N;e:{if(u){N=i.label;break e}let ne;t[8]!==m||t[9]!==i.createdAt||t[10]!==i.label||t[11]!==l?(ne=l("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:St(new Date(i.createdAt),{locale:m})}),t[8]=m,t[9]=i.createdAt,t[10]=i.label,t[11]=l,t[12]=ne):ne=t[12],N=ne}const S=N;let _;t[13]!==i.id||t[14]!==a?(_=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[13]=i.id,t[14]=a,t[15]=_):_=t[15];let f;t[16]!==n||t[17]!==i.id||t[18]!==c||t[19]!==l?(f=()=>{c.invalidateQueries({queryKey:re.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:re.aiProviders(n.id)}),c.invalidateQueries({queryKey:re.aiProviderModels(n.id,i.id)}),ae.success(l("settings.providerKeyRow.keyDeleted")),v(!1)},t[16]=n,t[17]=i.id,t[18]=c,t[19]=l,t[20]=f):f=t[20];let P;t[21]!==l?(P=ne=>ae.error(l("settings.providerKeyRow.failedToDeleteKey",{error:ne.message})),t[21]=l,t[22]=P):P=t[22];let b;t[23]!==_||t[24]!==f||t[25]!==P?(b={mutationFn:_,onSuccess:f,onError:P},t[23]=_,t[24]=f,t[25]=P,t[26]=b):b=t[26];const{mutate:K,isPending:V}=Se(b);let B;t[27]!==p||t[28]!==j?(B=j?s.jsx("img",{src:j,alt:p,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(kt,{fallback:p.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[27]=p,t[28]=j,t[29]=B):B=t[29];let O;t[30]!==l?(O=l("settings.providerKeyRow.editProviderKey"),t[30]=l,t[31]=O):O=t[31];let Q,U;t[32]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>y(!0),U=s.jsx(_t,{size:14}),t[32]=Q,t[33]=U):(Q=t[32],U=t[33]);let E;t[34]!==O?(E=s.jsx(le,{variant:"ghost",size:"icon","aria-label":O,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:Q,children:U}),t[34]=O,t[35]=E):E=t[35];let z;t[36]!==l?(z=l("settings.providerKeyRow.deleteProviderKey"),t[36]=l,t[37]=z):z=t[37];let G,H;t[38]===Symbol.for("react.memo_cache_sentinel")?(G=()=>v(!0),H=s.jsx(Ct,{size:14}),t[38]=G,t[39]=H):(G=t[38],H=t[39]);let R;t[40]!==V||t[41]!==z?(R=s.jsx(le,{variant:"ghost",size:"icon","aria-label":z,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:V,onClick:G,children:H}),t[40]=V,t[41]=z,t[42]=R):R=t[42];let F;t[43]!==E||t[44]!==R?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[E,R]}),t[43]=E,t[44]=R,t[45]=F):F=t[45];let T;t[46]!==S||t[47]!==p||t[48]!==F||t[49]!==B?(T=s.jsx(Qe,{icon:B,title:p,description:S,action:F}),t[46]=S,t[47]=p,t[48]=F,t[49]=B,t[50]=T):T=t[50];let q;t[51]!==C||t[52]!==r||t[53]!==i?(q=s.jsx(ss,{providerKey:i,provider:r,open:C,onOpenChange:y}),t[51]=C,t[52]=r,t[53]=i,t[54]=q):q=t[54];let x;t[55]!==l?(x=l("settings.providerKeyRow.deleteApiKey"),t[55]=l,t[56]=x):x=t[56];let A;t[57]!==x?(A=s.jsx(We,{children:x}),t[57]=x,t[58]=A):A=t[58];let M;t[59]!==i.label?(M=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[59]=i.label,t[60]=M):M=t[60];let w;t[61]!==A||t[62]!==M?(w=s.jsxs(Xe,{children:[A,M]}),t[61]=A,t[62]=M,t[63]=w):w=t[63];let D;t[64]!==l?(D=l("settings.providerKeyRow.cancel"),t[64]=l,t[65]=D):D=t[65];let Y;t[66]!==D?(Y=s.jsx(Ze,{children:D}),t[66]=D,t[67]=Y):Y=t[67];let W;t[68]!==K?(W=()=>K(),t[68]=K,t[69]=W):W=t[69];let $;t[70]!==l?($=l("settings.providerKeyRow.delete"),t[70]=l,t[71]=$):$=t[71];let L;t[72]!==W||t[73]!==$?(L=s.jsx(et,{onClick:W,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),t[72]=W,t[73]=$,t[74]=L):L=t[74];let ee;t[75]!==Y||t[76]!==L?(ee=s.jsxs(tt,{children:[Y,L]}),t[75]=Y,t[76]=L,t[77]=ee):ee=t[77];let te;t[78]!==w||t[79]!==ee?(te=s.jsxs(st,{children:[w,ee]}),t[78]=w,t[79]=ee,t[80]=te):te=t[80];let se;t[81]!==o||t[82]!==te?(se=s.jsx(it,{open:o,onOpenChange:v,children:te}),t[81]=o,t[82]=te,t[83]=se):se=t[83];let ie;return t[84]!==T||t[85]!==q||t[86]!==se?(ie=s.jsxs(s.Fragment,{children:[T,q,se]}),t[84]=T,t[85]=q,t[86]=se,t[87]=ie):ie=t[87],ie}function ls(e){const t=Z.c(17),{onConnectClick:i}=e,r=oe(),n=_e(),a=Ge();let c;t[0]!==a?.providers?(c=a?.providers??[],t[0]=a?.providers,t[1]=c):c=t[1];const o=c;let v;if(t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==r){let C;t[7]!==o?(C=h=>({key:h,provider:o.find(g=>g.id===h.providerId)}),t[7]=o,t[8]=C):C=t[8];const y=n.filter(ns).map(C).filter(os);let l;t[9]!==r?(l=r("settings.connectedProvidersSection.sectionTitle"),t[9]=r,t[10]=l):l=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(yt,{size:14}),t[11]=d):d=t[11];let m;t[12]!==r?(m=r("settings.connectedProvidersSection.connectButton"),t[12]=r,t[13]=m):m=t[13];let u;t[14]!==i||t[15]!==m?(u=s.jsxs(le,{size:"sm",onClick:i,children:[d,m]}),t[14]=i,t[15]=m,t[16]=u):u=t[16],v=s.jsx(Fe,{title:l,headerClassName:"px-0",actions:u,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Re,{children:y.map(rs)})}),t[2]=n,t[3]=i,t[4]=o,t[5]=r,t[6]=v}else v=t[6];return v}function rs(e){const{key:t,provider:i}=e;return s.jsx(is,{providerKey:t,provider:i},t.id)}function os(e){return e.provider!==void 0}function ns(e){return e.providerId!=="deco"}function as(e){const t=Z.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(at,{size:16}),t[0]=r):r=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[r,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=Z.c(23),t=_e();let i;e[0]!==t?(i=t.some(ds),e[0]=t,e[1]=i):i=e[1];const r=i,n=t.length>0,[a,c]=J.useState(!1),[o,v]=J.useState(null),C=Ge();let y;e[2]!==C?.providers?(y=C?.providers??[],e[2]=C?.providers,e[3]=y):y=e[3];const l=y;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(!0),e[4]=k):k=e[4];let p;e[5]!==l?(p=s.jsx(xt,{providers:l,onSelect:v,onShowAll:k}),e[5]=l,e[6]=p):p=e[6];const j=o!==null||a;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=P=>{P||(v(null),c(!1))},e[7]=N):N=e[7];const S=o??void 0;let _;e[8]!==j||e[9]!==S?(_=s.jsx(Oe,{open:j,onOpenChange:N,initialProvider:S}),e[8]=j,e[9]=S,e[10]=_):_=e[10];let f;return e[11]!==p||e[12]!==_?(f=s.jsxs(s.Fragment,{children:[p,_]}),e[11]=p,e[12]=_,e[13]=f):f=e[13],f}let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(J.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Ht,{})}),e[14]=d):d=e[14];let m;e[15]!==r?(m=r?s.jsx(Gt,{}):s.jsx(Xt,{}),e[15]=r,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ls,{onConnectClick:()=>c(!0)}),e[17]=u):u=e[17];let h;e[18]!==a?(h=s.jsx(Oe,{open:a,onOpenChange:c}),e[18]=a,e[19]=h):h=e[19];let g;return e[20]!==m||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[d,m,u,h]}),e[20]=m,e[21]=h,e[22]=g):g=e[22],g}function ds(e){return e.providerId==="deco"}function ms(){const e=Z.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let r;e[2]!==i?(r=s.jsx(Pe.Title,{children:i}),e[2]=i,e[3]=r):r=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nt,{fallback:fs,children:s.jsx(J.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(cs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==r?(a=s.jsx(Pe,{children:s.jsx(Pe.Content,{children:s.jsx(Pe.Body,{children:s.jsxs(ct,{children:[r,n]})})})}),e[5]=r,e[6]=a):a=e[6],a}function fs(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function xi(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Et,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ms,{})}),e[0]=t):t=e[0],t}export{xi as default};
@@ -1 +0,0 @@
1
- import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-BWQ8J_Ql.js";import{i as jt}from"./ChevronRight-ByhOJDuf.js";import{n as Bt}from"./automation-runs-AODBXa-8.js";import{A as At}from"./add-section-modal-1gI2_SbS.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-CIyNbcah.js";import"./select-BeoMfuBi.js";import"./tooltip-E9C3lYtr.js";import"./Check-aJK60dGs.js";import"./ChevronDown-QKGLHDtk.js";import"./ChevronUp-Bua8mQg_.js";import"./useInfiniteQuery-CYxhJzgo.js";import"./use-infinite-scroll-DDpxPDP2.js";import"./use-connection-DhT-Eyoh.js";import"./use-mcp-client-DxfTC5E_.js";import"./auth-BKADTSIm.js";import"./use-virtual-mcp-CiSjSkCo.js";import"./card-lRKCCLQw.js";import"./sidebar-Dqyoi3Jo.js";import"./LayoutLeft-DuThLaX3.js";import"./use-mobile-DLuY7pVt.js";import"./X-6E3IZLpq.js";import"./table-8sezDnga.js";import"./empty-state-XIb0GhoJ.js";import"./use-members-RZeFEjqN.js";import"./use-org-auth-client-CuzKnrVt.js";import"./use-clock-tick-CNICdDqm.js";import"./AlertCircle-CAbc8MAP.js";import"./CheckCircle-DyT8St9I.js";import"./DotsVertical-DDt1Z0of.js";import"./agent-icon-qAcwCm4B.js";import"./Tool01-y5Zo-2kp.js";import"./ArrowUp-Cbgz6edS.js";import"./Settings02-DqVBXHWa.js";import"./Tool02-DxIXF41R.js";import"./XCircle-Dv7GY9Ae.js";import"./ArrowUpRight-rLTsVWA_.js";import"./TrendUp01-Bvixesdw.js";import"./ZapSquare-Cvx15c67.js";import"./Users03-DdrNKhEH.js";import"./Stars02-BteVxWQx.js";import"./Copy01-MoyRnx9Y.js";import"./CpuChip01-BRse3wgD.js";import"./Eye-CN7MnuxX.js";import"./FilterLines-D6T2TLxw.js";import"./Star01-C6wv5tg7.js";import"./Palette-Bu3LAepu.js";import"./SwitchHorizontal01-CcYoskYm.js";import"./HardDrive-k_osV2fx.js";import"./Key01-DgWg9XoR.js";import"./LinkExternal01-BjO4mb1B.js";import"./LogOut01-BaLbb-JK.js";import"./Monitor01-BbOMT_Bf.js";import"./Sun-jlM4_jk2.js";import"./Play-ZUjJ9tm4.js";import"./Plus-DNcVUobv.js";import"./SearchLg-pvNMPdx7.js";import"./SearchMd-BMhVoBl-.js";import"./Shield01-DqbjKqjF.js";import"./Stars01-cbnx-58G.js";import"./Trash01-8tMNvAGj.js";import"./Upload01-DEb40SuQ.js";import"./User01-B1EqqZKM.js";import"./Users01-Ca4M-Dx2.js";import"./XClose-outHzlfY.js";import"./Zap-7KA5ZNQg.js";import"./use-automations-B5e1sys8.js";import"./studio-tools-BziqPhXE.js";import"./useSuspenseInfiniteQuery-0jsu_qzK.js";import"./avatar-Bl8FLdrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CitgQbMn.js";import"./dialog-BUJ-AcXn.js";import"./tab-id-CpKaVM9t.js";import"./hooks-FOgIFNPr.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CjEW6498.js";import"./chat-context-CUD5YWfE.js";import"./use-ai-providers-CPseYMhM.js";import"./use-decopilot-events-BqtjxaPd.js";import"./use-organization-settings-OE3Lr1-V.js";import"./monaco-editor-Co8sJEI7.js";import"./index-Ac0om1NX.js";import"./calendar-RjMy83m7.js";import"./shell-layout-Cq8rmUZ4.js";import"./required-auth-layout-CcfxFPTq.js";import"./use-org-sso-BwjPrTQu.js";import"./integration-icon-CaGyRRyP.js";import"./use-navigate-to-agent-CPiWe3y7.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BpGDlewJ.js";import"./form-DhWAfAxx.js";import"./label-zD_AlFJF.js";import"./input-IzR9qH12.js";import"./drawer-kWTjBHBr.js";import"./collection-search-ljHjogUZ.js";import"./index-bM-iCUGb.js";import"./get-initials-D-f_fDFw.js";import"./popover-CkXP0cF6.js";import"./dropdown-menu-BOOIaYmO.js";import"./github-repo-picker-DGEn8-6q.js";import"./use-debounced-value-C2iB9iww.js";import"./authenticate-and-persist-oauth-BXgFAJ7b.js";import"./mcp-oauth-CNzwJzT5.js";import"./use-mcp-tools-B2Sf-NwM.js";import"./extract-connection-data-DPzwGu6f.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-DqEuQ6vZ.js";import"./command-j9BWJhQ1.js";import"./index-BCxi5_7f.js";import"./companions-core-CeShKWs_.js";import"./tabs-BDABIwTP.js";import"./toggle-group-Dlgb2--d.js";import"./use-deco-credits-BxIFs0tR.js";import"./alert-dialog-BzE_binL.js";import"./toolbar-BV83UGjr.js";import"./skeleton-mzmR9D0W.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BRV9KXgc.js";import"./use-registry-connections-Bw8B7hj8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-w4chswNw.js";import"./connection-form-helpers-CI7ZaQlB.js";import"./collection-tabs-DWzHRz5O.js";import"./badge-LURmYsxa.js";import"./select-model-Ba2cltVj.js";import"./checkbox-gzTh7FP3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DMX_R5s3.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DayrZ7TG.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-0p8XXo7t.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-D0D4mOkH.js";import"./use-debounced-autosave-DT68jL4f.js";import"./index-EeV9OJhC.js";import"./search-input-Di-RLxL2.js";import"./switch-DEnDWJad.js";import"./use-secrets-BOMoixiw.js";import"./useQueries-D3rnFNlM.js";import"./use-file-configs-CNJh9wYK.js";import"./automation-list-row-3FdiUeBz.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function jr(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{jr as AppEditor};
@@ -1 +0,0 @@
1
- import{a as O,D as be,r as v,e as Z,p as R,j as t,m as u,B as fe,c as _e,b as ve,S as ye}from"./index-BWQ8J_Ql.js";import{I as B}from"./input-IzR9qH12.js";import{r as ke,R as Le}from"./retry-CErkP7V6.js";const we={submitEmailPassword:({mode:a,email:e,password:g,name:f})=>a==="sign_up"?O.signUp.email({email:e,password:g,name:f||""}):O.signIn.email({email:e,password:g}),requestPasswordReset:({email:a,redirectTo:e})=>O.requestPasswordReset({email:a,redirectTo:e}),sendOtp:({email:a})=>O.emailOtp.sendVerificationOtp({email:a,type:"sign-in"}),submitOtp:({email:a,otp:e})=>O.signIn.emailOtp({email:a,otp:e}),socialSignIn:({provider:a,callbackURL:e})=>O.signIn.social({provider:a,callbackURL:e}),ssoSignIn:({providerId:a,callbackURL:e})=>O.signIn.sso({providerId:a,callbackURL:e}),onAuthenticated:a=>{window.location.href=a}},ee="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Fe={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:a=>`Code sent to ${a}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:a=>`Continue with ${a}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Oe({redirectUrl:a,callbackUrl:e="/",title:g,subtitle:f,brand:I,copy:y,variant:o="default",allowedSocialProviders:c,allowPassword:m=!0,onAuthEvent:H,actions:z}){const{emailAndPassword:T,resetPassword:w,emailOtp:x,socialProviders:A}=be(),E={...we,...z},d=s=>{try{H?.(s)}catch{}},p=o==="compact",K=c?A.providers.filter(s=>c.includes(s.name)):A.providers,J=A.enabled&&K.length>0,te=T.enabled&&(m||!x.enabled&&!J),Q=A.enabled&&A.providers.length>0&&!J&&!x.enabled&&!te?A.providers:K,j=A.enabled&&Q.length>0,N=T.enabled&&(m||!x.enabled&&!j),[r,S]=v.useState(""),[C,h]=v.useState(""),[se,le]=v.useState(""),[ne,ae]=v.useState(""),[M,ie]=v.useState(!1),[re,Ee]=v.useState(()=>x.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[P,U]=v.useState(""),[de,ce]=v.useState(!1),n={...Fe,...y},b=re==="signUp",k=re==="forgotPassword",_=re==="emailOtp",$=Z({mutationFn:async({email:s,password:i,name:L})=>{try{const V=await E.submitEmailPassword({mode:b?"sign_up":"sign_in",email:s,password:i,name:L});if(V.error)throw new Error(V.error.message||(b?n.signUpFailed:n.signInFailed));return V}catch(V){throw V instanceof Error?V:new Error(n.authenticationFailed)}},onMutate:()=>{d({type:"started",method:"email_password",mode:b?"sign_up":"sign_in"})},onSuccess:()=>{d({type:"succeeded",method:"email_password",mode:b?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),E.onAuthenticated(a??e)},onError:s=>{d({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),R(b?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),G=Z({mutationFn:async({email:s})=>{const i=await E.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(i.error)throw new Error(i.error.message||n.resetEmailFailed);return i},onSuccess:()=>{R("password_reset_requested"),ce(!0)},onError:s=>{R("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),W=Z({mutationFn:async({email:s})=>{const i=await E.sendOtp({email:s});if(i.error)throw new Error(i.error.message||n.otpSendFailed);return i},onMutate:()=>{d({type:"started",method:"email_otp"})},onSuccess:()=>{d({type:"otp_sent",method:"email_otp"}),R("email_otp_sent"),ie(!0)},onError:s=>{d({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),R("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),q=Z({mutationFn:async({email:s,otp:i})=>{const L=await E.submitOtp({email:s,otp:i});if(L.error)throw new Error(L.error.message||n.invalidCode);return L},onMutate:()=>{d({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{d({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),E.onAuthenticated(a??e)},onError:s=>{d({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),R("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),X=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),oe=()=>{r.trim()&&!X(r)&&U(n.invalidEmail)},Se=s=>{if(s.preventDefault(),!X(r)){U(n.invalidEmail),d({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}$.mutate({email:r,password:C,name:se})},je=s=>{if(s.preventDefault(),!X(r)){U(n.invalidEmail);return}G.mutate({email:r})},Ne=s=>{if(s.preventDefault(),!X(r)){U(n.invalidEmail),d({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}W.mutate({email:r})},Pe=s=>{s.preventDefault(),q.mutate({email:r,otp:ne})},D=s=>i=>{s(i.target.value),me&&$.reset(),ue&&G.reset(),ge&&(W.reset(),q.reset()),s===S&&P&&U("")},Y=s=>{Ee(s),le(""),ae(""),ie(!1),U(""),ce(!1),$.reset(),G.reset(),W.reset(),q.reset()},l=$.isPending||G.isPending||W.isPending||q.isPending,me=$.error,ue=G.error,ge=W.error||q.error,F=b?r.trim()&&C.trim()&&se.trim():k?r.trim():_?M?ne.trim():r.trim():r.trim()&&C.trim(),Ie=s=>{if(!s)return null;const i=s.message.toLowerCase();return i.includes("unauthorized")||i.includes("401")?n.invalidEmailOrPassword:i.includes("already exists")||i.includes("409")?n.accountExists:i.includes("network")||i.includes("fetch")?n.networkError:i.includes("rate limit")||i.includes("429")?n.tooManyAttempts:i.includes("invalid")&&i.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},he=me||ue||ge,Ae=async s=>{d({type:"started",method:"social",provider:s});try{const i=await E.socialSignIn({provider:s,callbackURL:a??e});if(i.error)throw new Error(i.error.message||n.authenticationFailed)}catch(i){const L=i instanceof Error?i.message:String(i);d({type:"failed",method:"social",provider:s,stage:"redirect",error:L}),R("social_signin_failed",{provider:s,error:L})}},Ce=k?n.resetPasswordTitle:_&&M?n.verificationCodeTitle:g??n.welcomeTitle,pe=k?n.resetPasswordSubtitle:_&&M?n.codeSentTo(r):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:u("grid w-full",p?"gap-5":"gap-10"),children:[I??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:u("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:Ce}),pe&&t.jsx("p",{className:u("text-muted-foreground",p?"text-sm leading-5":"text-base leading-6"),children:pe})]}),he&&t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:Ie(he)}),de&&t.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!k&&!(_&&M)&&j&&t.jsx("div",{className:"grid gap-2",children:Q.map(s=>t.jsxs("button",{type:"button",disabled:l,onClick:()=>{Ae(s.name)},className:u("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",p?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:u("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!k&&!(_&&M)&&j&&(N||x.enabled)&&t.jsxs("div",{className:u("flex items-center gap-2.5",p?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:u("text-muted-foreground",p?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),_&&x.enabled&&t.jsx(t.Fragment,{children:M?t.jsxs("form",{onSubmit:Pe,className:u("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{className:u("text-sm font-medium text-foreground",p&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(B,{type:"text",placeholder:n.enterCodePlaceholder,value:ne,onChange:D(ae),required:!0,disabled:l,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:l||!F,className:u("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",p?"h-11 sm:w-auto":"h-12 w-full"),children:l?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{ie(!1),ae(""),W.reset(),q.reset()},disabled:l,className:u("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",p&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Ne,className:u("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{className:u("text-sm font-medium text-foreground",p&&"sr-only"),children:n.emailLabel}),t.jsx(B,{type:"email",placeholder:n.emailPlaceholder,value:r,onChange:D(S),onBlur:oe,required:!0,disabled:l,"aria-invalid":!!P,className:"h-11 rounded-lg"}),P&&t.jsx("p",{className:"text-xs text-destructive",children:P})]}),t.jsx("button",{type:"submit",disabled:l||!F,className:u("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",p?"h-11 sm:w-auto":"h-12 w-full"),children:l?n.sending:n.sendCode})]})}),k&&N&&!de&&t.jsxs("form",{onSubmit:je,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(B,{type:"email",placeholder:"you@example.com",value:r,onChange:D(S),onBlur:oe,required:!0,disabled:l,"aria-invalid":!!P,className:"h-11 rounded-lg"}),P&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:P})]}),t.jsx(fe,{type:"submit",disabled:l||!F,className:"w-full font-semibold",size:"xl",children:l?n.sending:n.sendResetLink})]}),!k&&!_&&N&&t.jsxs("form",{onSubmit:Se,className:"grid gap-5",children:[b&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(B,{type:"text",placeholder:n.namePlaceholder,value:se,onChange:D(le),required:!0,disabled:l,className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(B,{type:"email",placeholder:"you@example.com",value:r,onChange:D(S),onBlur:oe,required:!0,disabled:l,"aria-invalid":!!P,className:"h-11 rounded-lg"}),P&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:P})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!b&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>Y("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(B,{type:"password",placeholder:"••••••••",value:C,onChange:D(h),required:!0,disabled:l,className:"h-11 rounded-lg"})]}),t.jsx("div",{className:u("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",F?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:u("p-1",!F&&"pointer-events-none"),children:t.jsx(fe,{type:"submit",disabled:l||!F,className:u("w-full font-semibold"),size:"xl","aria-hidden":!F,children:l?b?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:k?t.jsx("button",{type:"button",onClick:()=>Y("signIn"),disabled:l,className:ee,children:n.backToSignIn}):_&&N?t.jsx("button",{type:"button",onClick:()=>Y("signIn"),disabled:l,className:ee,children:n.signInWithPassword}):!_&&N?t.jsxs(t.Fragment,{children:[b?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Y(b?"signIn":"signUp"),disabled:l,className:ee,children:b?n.signIn:n.signUp}),x.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>Y("emailOtp"),disabled:l,className:ee,children:n.signInWithEmailCode})]})]}):null})]})}class xe{constructor(e){this.response=e}response}function Re(a){return a.startsWith("/")&&!a.startsWith("//")?a:"/"}function Te({redirectTo:a,onAuthEvent:e}){const g=ve(),[f,I]=v.useState(null),y=v.useEffectEvent(o=>{try{e?.(o)}catch{}});return v.useEffect(()=>{let o=!1;return(async()=>{y({type:"started",method:"local"});try{let c;try{c=await ke(async()=>{const m=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(m.status>=500)throw new xe(m);return m},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(m){if(m instanceof Le&&m.cause instanceof xe)c=m.cause.response;else throw m}if(!c.ok){const m=await c.json().catch(()=>({}));throw new Error(m?.error||g("common.authEntry.autoLoginFailed"))}o||(y({type:"succeeded",method:"local"}),window.location.href=Re(a))}catch(c){o||(y({type:"failed",method:"local",stage:"authenticate",error:c instanceof Error?c.message:String(c)}),I(c instanceof Error?c.message:g("common.authEntry.autoLoginFailed")))}})(),()=>{o=!0}},[a]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:g("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:g("common.authEntry.tryRestartingServer")})]})}):t.jsx(ye,{})}function Me({callbackURL:a,providerId:e,ssoSignIn:g,onAuthEvent:f}){const I=v.useEffectEvent(o=>{try{f?.(o)}catch{}}),y=v.useEffectEvent(g);return v.useEffect(()=>{(async()=>{I({type:"started",method:"sso",provider:e});try{const o=await y({providerId:e,callbackURL:a});if(o.error)throw new Error(o.error.message||"SSO redirect failed")}catch(o){I({type:"failed",method:"sso",provider:e,stage:"redirect",error:o instanceof Error?o.message:String(o)})}})()},[e,a]),t.jsx(ye,{})}function De(a){const e=_e.c(26),{callbackUrl:g,redirectUrl:f,allowAutoLogin:I,title:y,subtitle:o,brand:c,copy:m,variant:H,allowedSocialProviders:z,allowPassword:T,onAuthEvent:w,actions:x}=a,A=I===void 0?!0:I,E=ve(),{sso:d,emailAndPassword:p,magicLink:K,emailOtp:J,socialProviders:te,localMode:Q}=be(),j=f||g;let N;e[0]!==x?(N={...we,...x},e[0]=x,e[1]=N):N=e[1];const r=N;if(Q&&A){let h;return e[2]!==w||e[3]!==j?(h=t.jsx(Te,{redirectTo:j,onAuthEvent:w}),e[2]=w,e[3]=j,e[4]=h):h=e[4],h}if(d.enabled){let h;return e[5]!==w||e[6]!==j||e[7]!==r.ssoSignIn||e[8]!==d.providerId?(h=t.jsx(Me,{callbackURL:j,providerId:d.providerId,ssoSignIn:r.ssoSignIn,onAuthEvent:w}),e[5]=w,e[6]=j,e[7]=r.ssoSignIn,e[8]=d.providerId,e[9]=h):h=e[9],h}if(p.enabled||K.enabled||J.enabled||te.enabled){let h;return e[10]!==x||e[11]!==T||e[12]!==z||e[13]!==c||e[14]!==g||e[15]!==m||e[16]!==w||e[17]!==f||e[18]!==o||e[19]!==y||e[20]!==H?(h=t.jsx(Oe,{redirectUrl:f,callbackUrl:g,title:y,subtitle:o,brand:c,copy:m,variant:H,allowedSocialProviders:z,allowPassword:T,onAuthEvent:w,actions:x}),e[10]=x,e[11]=T,e[12]=z,e[13]=c,e[14]=g,e[15]=m,e[16]=w,e[17]=f,e[18]=o,e[19]=y,e[20]=H,e[21]=h):h=e[21],h}let S;e[22]!==E?(S=E("common.authEntry.noLoginOptions"),e[22]=E,e[23]=S):S=e[23];let C;return e[24]!==S?(C=t.jsx("div",{children:S}),e[24]=S,e[25]=C):C=e[25],C}export{De as A};
@@ -1 +0,0 @@
1
- import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-BWQ8J_Ql.js";import{C as ue}from"./agent-icon-qAcwCm4B.js";import{i as ke}from"./X-6E3IZLpq.js";import{L as ce}from"./label-zD_AlFJF.js";import{ak as xe,al as Ne}from"./index-CIyNbcah.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-BeoMfuBi.js";import{T as Te,a as we,c as Be}from"./tooltip-E9C3lYtr.js";import"./AlertCircle-CAbc8MAP.js";import"./Tool01-y5Zo-2kp.js";import"./ArrowUp-Cbgz6edS.js";import"./Settings02-DqVBXHWa.js";import"./Tool02-DxIXF41R.js";import"./XCircle-Dv7GY9Ae.js";import"./ArrowUpRight-rLTsVWA_.js";import"./TrendUp01-Bvixesdw.js";import"./ZapSquare-Cvx15c67.js";import"./Users03-DdrNKhEH.js";import"./CheckCircle-DyT8St9I.js";import"./Check-aJK60dGs.js";import"./ChevronDown-QKGLHDtk.js";import"./ChevronRight-ByhOJDuf.js";import"./ChevronUp-Bua8mQg_.js";import"./DotsVertical-DDt1Z0of.js";import"./Stars02-BteVxWQx.js";import"./Copy01-MoyRnx9Y.js";import"./CpuChip01-BRse3wgD.js";import"./Eye-CN7MnuxX.js";import"./FilterLines-D6T2TLxw.js";import"./Star01-C6wv5tg7.js";import"./Palette-Bu3LAepu.js";import"./SwitchHorizontal01-CcYoskYm.js";import"./HardDrive-k_osV2fx.js";import"./Key01-DgWg9XoR.js";import"./LayoutLeft-DuThLaX3.js";import"./LinkExternal01-BjO4mb1B.js";import"./LogOut01-BaLbb-JK.js";import"./Monitor01-BbOMT_Bf.js";import"./Sun-jlM4_jk2.js";import"./Play-ZUjJ9tm4.js";import"./Plus-DNcVUobv.js";import"./SearchLg-pvNMPdx7.js";import"./SearchMd-BMhVoBl-.js";import"./Shield01-DqbjKqjF.js";import"./Stars01-cbnx-58G.js";import"./Trash01-8tMNvAGj.js";import"./Upload01-DEb40SuQ.js";import"./User01-B1EqqZKM.js";import"./Users01-Ca4M-Dx2.js";import"./XClose-outHzlfY.js";import"./Zap-7KA5ZNQg.js";import"./chat-context-CUD5YWfE.js";import"./tab-id-CpKaVM9t.js";import"./dialog-BUJ-AcXn.js";import"./hooks-FOgIFNPr.js";import"./use-mcp-client-DxfTC5E_.js";import"./auth-BKADTSIm.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CjEW6498.js";import"./studio-tools-BziqPhXE.js";import"./use-virtual-mcp-CiSjSkCo.js";import"./use-ai-providers-CPseYMhM.js";import"./use-decopilot-events-BqtjxaPd.js";import"./use-organization-settings-OE3Lr1-V.js";import"./automation-runs-AODBXa-8.js";import"./useInfiniteQuery-CYxhJzgo.js";import"./use-infinite-scroll-DDpxPDP2.js";import"./use-connection-DhT-Eyoh.js";import"./card-lRKCCLQw.js";import"./sidebar-Dqyoi3Jo.js";import"./use-mobile-DLuY7pVt.js";import"./table-8sezDnga.js";import"./empty-state-XIb0GhoJ.js";import"./use-members-RZeFEjqN.js";import"./use-org-auth-client-CuzKnrVt.js";import"./use-clock-tick-CNICdDqm.js";import"./use-automations-B5e1sys8.js";import"./useSuspenseInfiniteQuery-0jsu_qzK.js";import"./avatar-Bl8FLdrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CitgQbMn.js";import"./monaco-editor-Co8sJEI7.js";import"./index-Ac0om1NX.js";import"./calendar-RjMy83m7.js";import"./shell-layout-Cq8rmUZ4.js";import"./required-auth-layout-CcfxFPTq.js";import"./use-org-sso-BwjPrTQu.js";import"./integration-icon-CaGyRRyP.js";import"./use-navigate-to-agent-CPiWe3y7.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BpGDlewJ.js";import"./form-DhWAfAxx.js";import"./input-IzR9qH12.js";import"./drawer-kWTjBHBr.js";import"./collection-search-ljHjogUZ.js";import"./index-bM-iCUGb.js";import"./get-initials-D-f_fDFw.js";import"./popover-CkXP0cF6.js";import"./dropdown-menu-BOOIaYmO.js";import"./github-repo-picker-DGEn8-6q.js";import"./use-debounced-value-C2iB9iww.js";import"./authenticate-and-persist-oauth-BXgFAJ7b.js";import"./mcp-oauth-CNzwJzT5.js";import"./use-mcp-tools-B2Sf-NwM.js";import"./extract-connection-data-DPzwGu6f.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-DqEuQ6vZ.js";import"./command-j9BWJhQ1.js";import"./index-BCxi5_7f.js";import"./companions-core-CeShKWs_.js";import"./tabs-BDABIwTP.js";import"./toggle-group-Dlgb2--d.js";import"./use-deco-credits-BxIFs0tR.js";import"./alert-dialog-BzE_binL.js";import"./toolbar-BV83UGjr.js";import"./skeleton-mzmR9D0W.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BRV9KXgc.js";import"./use-registry-connections-Bw8B7hj8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-w4chswNw.js";import"./connection-form-helpers-CI7ZaQlB.js";import"./collection-tabs-DWzHRz5O.js";import"./badge-LURmYsxa.js";import"./select-model-Ba2cltVj.js";import"./checkbox-gzTh7FP3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DMX_R5s3.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DayrZ7TG.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-0p8XXo7t.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-D0D4mOkH.js";import"./use-debounced-autosave-DT68jL4f.js";import"./index-EeV9OJhC.js";import"./search-input-Di-RLxL2.js";import"./switch-DEnDWJad.js";import"./use-secrets-BOMoixiw.js";import"./useQueries-D3rnFNlM.js";import"./use-file-configs-CNJh9wYK.js";import"./automation-list-row-3FdiUeBz.js";function bi(i){const e=he.c(121),{posts:X,categories:r,initialSlug:le,isPending:s,onApply:re,onClose:p}=i,o=je(),[m,fe]=de.useState(le&&r.some(a=>a.slug===le)?le:r[0]?.slug??""),[n,ge]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=be=>be.slug===m,e[3]=m,e[4]=a):a=e[4],Y=r.find(a),e[0]=r,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,l=X.length,me=String(l);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(ke,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let k;e[29]!==y?(k=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=k):k=e[30];let N;e[31]!==l||e[32]!==o?(N=l===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(l)}),e[31]=l,e[32]=o,e[33]=N):N=e[33];let C;e[34]!==N?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:N}),e[34]=N,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==r||e[41]!==m||e[42]!==o?(v=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{children:r.map(ze)})]}),e[40]=r,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>ge(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(Ne,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||l===0;let G;e[82]!==n||e[83]!==re||e[84]!==c?(G=()=>c&&re(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=re,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(l);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==l||e[107]!==X||e[108]!==o?(O=l===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=l,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==k||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[k,C,H,Q]})}),e[113]=k,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(_e,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{bi as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as J,r as k,m as V,j as t,b as X,B as I,k as Y,t as $}from"./index-BWQ8J_Ql.js";import{i as Z}from"./XCircle-Dv7GY9Ae.js";import{b0 as _,C as U}from"./agent-icon-qAcwCm4B.js";import{n as K}from"./LinkExternal01-BjO4mb1B.js";import{A as tt,a as ot,b as et,c as rt,d as it,e as st,f as at,g as nt}from"./alert-dialog-BzE_binL.js";import{I as W}from"./input-IzR9qH12.js";import{L as H}from"./label-zD_AlFJF.js";import{P as mt,O as lt,Q as pt,ai as ct,I as dt,T as B,W as gt,aj as ut,U as xt}from"./index-CIyNbcah.js";import{c as ft,B as ht,a as yt}from"./block-document-B-Vw2I-7.js";import{u as bt}from"./use-autosave-DsiUg614.js";import{t as jt}from"./ChevronDown-QKGLHDtk.js";import{t as vt,v as Et,r as Ct}from"./automation-runs-AODBXa-8.js";import{s as b,E as Nt}from"./primitives-C2lr9KO1.js";import"./AlertCircle-CAbc8MAP.js";import"./Tool01-y5Zo-2kp.js";import"./ArrowUp-Cbgz6edS.js";import"./Settings02-DqVBXHWa.js";import"./Tool02-DxIXF41R.js";import"./ArrowUpRight-rLTsVWA_.js";import"./TrendUp01-Bvixesdw.js";import"./ZapSquare-Cvx15c67.js";import"./Users03-DdrNKhEH.js";import"./CheckCircle-DyT8St9I.js";import"./Check-aJK60dGs.js";import"./ChevronRight-ByhOJDuf.js";import"./ChevronUp-Bua8mQg_.js";import"./DotsVertical-DDt1Z0of.js";import"./Stars02-BteVxWQx.js";import"./Copy01-MoyRnx9Y.js";import"./CpuChip01-BRse3wgD.js";import"./Eye-CN7MnuxX.js";import"./FilterLines-D6T2TLxw.js";import"./Star01-C6wv5tg7.js";import"./Palette-Bu3LAepu.js";import"./SwitchHorizontal01-CcYoskYm.js";import"./HardDrive-k_osV2fx.js";import"./Key01-DgWg9XoR.js";import"./LayoutLeft-DuThLaX3.js";import"./LogOut01-BaLbb-JK.js";import"./Monitor01-BbOMT_Bf.js";import"./Sun-jlM4_jk2.js";import"./Play-ZUjJ9tm4.js";import"./Plus-DNcVUobv.js";import"./SearchLg-pvNMPdx7.js";import"./SearchMd-BMhVoBl-.js";import"./Shield01-DqbjKqjF.js";import"./Stars01-cbnx-58G.js";import"./Trash01-8tMNvAGj.js";import"./Upload01-DEb40SuQ.js";import"./User01-B1EqqZKM.js";import"./Users01-Ca4M-Dx2.js";import"./XClose-outHzlfY.js";import"./X-6E3IZLpq.js";import"./Zap-7KA5ZNQg.js";import"./chat-context-CUD5YWfE.js";import"./tab-id-CpKaVM9t.js";import"./dialog-BUJ-AcXn.js";import"./hooks-FOgIFNPr.js";import"./use-mcp-client-DxfTC5E_.js";import"./auth-BKADTSIm.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CjEW6498.js";import"./studio-tools-BziqPhXE.js";import"./use-virtual-mcp-CiSjSkCo.js";import"./use-ai-providers-CPseYMhM.js";import"./use-decopilot-events-BqtjxaPd.js";import"./use-organization-settings-OE3Lr1-V.js";import"./tooltip-E9C3lYtr.js";import"./drawer-kWTjBHBr.js";import"./collection-search-ljHjogUZ.js";import"./use-mobile-DLuY7pVt.js";import"./AreaChart-BpGDlewJ.js";import"./index-Ac0om1NX.js";import"./calendar-RjMy83m7.js";import"./shell-layout-Cq8rmUZ4.js";import"./avatar-Bl8FLdrm.js";import"./required-auth-layout-CcfxFPTq.js";import"./use-org-sso-BwjPrTQu.js";import"./index-bM-iCUGb.js";import"./get-initials-D-f_fDFw.js";import"./popover-CkXP0cF6.js";import"./dropdown-menu-BOOIaYmO.js";import"./github-repo-picker-DGEn8-6q.js";import"./use-debounced-value-C2iB9iww.js";import"./use-connection-DhT-Eyoh.js";import"./authenticate-and-persist-oauth-BXgFAJ7b.js";import"./mcp-oauth-CNzwJzT5.js";import"./use-mcp-tools-B2Sf-NwM.js";import"./extract-connection-data-DPzwGu6f.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-CPiWe3y7.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-members-RZeFEjqN.js";import"./use-org-auth-client-CuzKnrVt.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-tags-DqEuQ6vZ.js";import"./use-copy-CitgQbMn.js";import"./command-j9BWJhQ1.js";import"./index-BCxi5_7f.js";import"./companions-core-CeShKWs_.js";import"./form-DhWAfAxx.js";import"./select-BeoMfuBi.js";import"./tabs-BDABIwTP.js";import"./toggle-group-Dlgb2--d.js";import"./use-deco-credits-BxIFs0tR.js";import"./sidebar-Dqyoi3Jo.js";import"./toolbar-BV83UGjr.js";import"./skeleton-mzmR9D0W.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BRV9KXgc.js";import"./use-registry-connections-Bw8B7hj8.js";import"./useInfiniteQuery-CYxhJzgo.js";import"./use-infinite-scroll-DDpxPDP2.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-lRKCCLQw.js";import"./integration-icon-CaGyRRyP.js";import"./textarea-w4chswNw.js";import"./connection-form-helpers-CI7ZaQlB.js";import"./collection-tabs-DWzHRz5O.js";import"./badge-LURmYsxa.js";import"./useSuspenseInfiniteQuery-0jsu_qzK.js";import"./select-model-Ba2cltVj.js";import"./checkbox-gzTh7FP3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DMX_R5s3.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DayrZ7TG.js";import"./empty-state-XIb0GhoJ.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-0p8XXo7t.js";import"./monaco-editor-Co8sJEI7.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-D0D4mOkH.js";import"./use-debounced-autosave-DT68jL4f.js";import"./index-EeV9OJhC.js";import"./search-input-Di-RLxL2.js";import"./switch-DEnDWJad.js";import"./use-secrets-BOMoixiw.js";import"./useQueries-D3rnFNlM.js";import"./use-file-configs-CNJh9wYK.js";import"./use-automations-B5e1sys8.js";import"./automation-list-row-3FdiUeBz.js";import"./table-8sezDnga.js";import"./use-clock-tick-CNICdDqm.js";function St(j){const o=J.c(18),{icon:x,title:m,defaultOpen:v,children:u}=j,w=v===void 0?!1:v,[f,P]=k.useState(w);let l;o[0]!==x?(l=t.jsx(x,{size:15}),o[0]=x,o[1]=l):l=o[1];let r;o[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),o[2]=m,o[3]=r):r=o[3];const a=f&&"rotate-180";let p;o[4]!==a?(p=V("transition-transform",a),o[4]=a,o[5]=p):p=o[5];let i;o[6]!==p?(i=t.jsx(jt,{size:15,className:p}),o[6]=p,o[7]=i):i=o[7];let c;o[8]!==l||o[9]!==r||o[10]!==i?(c=t.jsx(vt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,i]})}),o[8]=l,o[9]=r,o[10]=i,o[11]=c):c=o[11];let d;o[12]!==u?(d=t.jsx(Et,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=d):d=o[13];let n;return o[14]!==f||o[15]!==c||o[16]!==d?(n=t.jsxs(Ct,{open:f,onOpenChange:P,className:"mt-4",children:[c,d]}),o[14]=f,o[15]=c,o[16]=d,o[17]=n):n=o[17],n}function gr({orgSlug:j,virtualMcpId:o,branch:x,blockKey:m,block:v,decofile:u,meta:w,onManagePosts:f,onOpenPost:P,previewBaseUrl:l}){const r=X(),a=mt({orgSlug:j,virtualMcpId:o,branch:x,packagePath:lt(o)}),p=pt(v,"categories"),[i,c,d]=bt(p,e=>{a.mutate({blockKey:m,data:B(m,"categories",e)})}),n=(e,S)=>c({...i,[e]:S}),A=ft({decofile:u,category:i,previewBaseUrl:l}),s=b(i.slug),[D,y]=k.useState(s),[g,E]=k.useState(null),[C,T]=k.useState(!1),z=s?ct(u).filter(e=>e.categorySlugs.includes(s)):[],N=z.length,M=e=>n("slug",e),Q=async(e,S)=>{const G=b(i.name);T(!0);try{let h=0;for(const{key:O,payload:R}of gt(u,"posts")){const L=ut(R,e,{name:G,slug:S});L!==R&&(await a.mutateAsync({blockKey:O,data:B(O,"posts",xt(L))}),h+=1)}const F={...i,slug:S};await a.mutateAsync({blockKey:m,data:B(m,"categories",F)}),d(F),$.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),E(null)}catch(h){y(e),E(null),$.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},q=()=>{const e=D.trim();if(e===s){D!==e&&y(e);return}if(!e){y(s);return}if(N===0){M(e);return}E({oldSlug:s,newSlug:e,count:N})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:b(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(dt,{isPending:a.isPending,isError:a.isError}),A&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(A,"_blank","noopener,noreferrer"),children:[t.jsx(K,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(Nt,{value:b(i.name),onChange:e=>n("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:D,onChange:e=>y(e.target.value),onBlur:q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:b(i.description),onChange:e=>n("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(St,{icon:_,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(ht,{value:yt(i.sections),onChange:e=>n("sections",e),meta:w,sandboxRef:{orgSlug:j,virtualMcpId:o,branch:x},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(N)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>f(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(Z,{size:14})]})]}),N>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>P(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(tt,{open:!!g,onOpenChange:e=>{e||C||(y(s),E(null))},children:t.jsxs(ot,{children:[t.jsxs(et,{children:[t.jsx(rt,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(it,{children:g?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:g.oldSlug,newSlug:g.newSlug,count:String(g.count)}):null})]}),t.jsxs(st,{children:[t.jsx(at,{disabled:C,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(nt,{onClick:e=>{e.preventDefault(),g&&Q(g.oldSlug,g.newSlug)},disabled:C,children:C?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{gr as CategoryEditor};
@@ -1,36 +0,0 @@
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-BWQ8J_Ql.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-CpKaVM9t.js";import{S as Nt,u as Ft,e as jt,b as qt}from"./hooks-FOgIFNPr.js";import{u as ut,c as Kt}from"./studio-tools-BziqPhXE.js";import{a as Vt,u as Qt,S as Bt}from"./use-mcp-client-DxfTC5E_.js";import{u as Ht}from"./use-virtual-mcp-CiSjSkCo.js";import{p as Wt,u as zt,b as ve,i as Gt,c as Xt}from"./use-ai-providers-CPseYMhM.js";import{u as Zt}from"./use-decopilot-events-BqtjxaPd.js";import{b as Yt}from"./use-organization-settings-OE3Lr1-V.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
- The user has this file open in the Library and is most likely referring to it:
5
- - Name: ${I}
6
- - Library path: ${l}${y?`
7
- - Read/edit it with your file tools at: \`${y}\``:""}
8
-
9
- When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let u;e[17]!==n?.params.appSlug||e[18]!==n?.params.collectionName||e[19]!==n?.params.itemId?(u=[],n?.params.appSlug&&u.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&u.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&u.push(`- Item ID: ${n?.params.itemId}`),e[17]=n?.params.appSlug,e[18]=n?.params.collectionName,e[19]=n?.params.itemId,e[20]=u):u=e[20],u.length>0&&p.push(`### Current Resource
10
- The user is viewing the following resource:
11
- ${u.join(`
12
- `)}
13
-
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
-
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
- ${r.content.trim()}
20
- </skill-file>`).join(`
21
-
22
- `),o=n.length>0?`
23
-
24
- Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{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
- ${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 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
-
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(...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
- ${M}`).join(`
33
-
34
- `):"",k=[A,g].filter(Boolean).join(`
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=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 +0,0 @@
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-BWQ8J_Ql.js";import{E as Fe}from"./empty-state-XIb0GhoJ.js";import{u as ge}from"./use-mcp-client-DxfTC5E_.js";import{F as ae,a as lt,b as ce,d as de}from"./form-DhWAfAxx.js";import{I as pe}from"./input-IzR9qH12.js";import{T as xe}from"./textarea-w4chswNw.js";import{a as ot,b as nt,V as je,O as it,M as rt}from"./index-BX2N3HzA.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-qAcwCm4B.js";import{g as xt,M as ft,a as we}from"./index-Ac0om1NX.js";import{A as ht,a as gt,b as jt}from"./alert-D_OxeHCG.js";import{S as Ce,a as Ie,b as $e,c as Te,d as me}from"./select-BeoMfuBi.js";import{b as bt,c as Pe,T as ke,a as Ae}from"./tooltip-E9C3lYtr.js";import{i as Nt}from"./AlertCircle-CAbc8MAP.js";import{s as vt}from"./Stars02-BteVxWQx.js";import{a as St}from"./Copy01-MoyRnx9Y.js";import{i as yt}from"./Play-ZUjJ9tm4.js";import{i as wt}from"./ChevronRight-ByhOJDuf.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./use-mcp-auth-status-D0D4mOkH.js";import{a as Me,u as ze}from"./use-connection-DhT-Eyoh.js";import{a as Tt}from"./use-mcp-tools-B2Sf-NwM.js";import{M as Pt,c as kt}from"./monaco-editor-Co8sJEI7.js";import{I as De}from"./integration-icon-CaGyRRyP.js";import{l as At,F as Dt}from"./chat-context-CUD5YWfE.js";import{u as Et}from"./shell-layout-Cq8rmUZ4.js";import{a as Ot}from"./Tool02-DxIXF41R.js";import"./auth-BKADTSIm.js";import"./label-zD_AlFJF.js";import"./index-EeV9OJhC.js";import"./sidebar-Dqyoi3Jo.js";import"./LayoutLeft-DuThLaX3.js";import"./use-mobile-DLuY7pVt.js";import"./X-6E3IZLpq.js";import"./Key01-DgWg9XoR.js";import"./extract-connection-data-DPzwGu6f.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-Bw8B7hj8.js";import"./use-organization-settings-OE3Lr1-V.js";import"./studio-tools-BziqPhXE.js";import"./Plus-DNcVUobv.js";import"./index-BCxi5_7f.js";import"./popover-CkXP0cF6.js";import"./use-virtual-mcp-CiSjSkCo.js";import"./Check-aJK60dGs.js";import"./SearchMd-BMhVoBl-.js";import"./Users03-DdrNKhEH.js";import"./use-create-virtual-mcp-CwmieGOB.js";import"./use-navigate-to-agent-CPiWe3y7.js";import"./hooks-FOgIFNPr.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CjEW6498.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-y5Zo-2kp.js";import"./ArrowUp-Cbgz6edS.js";import"./Settings02-DqVBXHWa.js";import"./XCircle-Dv7GY9Ae.js";import"./ArrowUpRight-rLTsVWA_.js";import"./TrendUp01-Bvixesdw.js";import"./ZapSquare-Cvx15c67.js";import"./CheckCircle-DyT8St9I.js";import"./ChevronDown-QKGLHDtk.js";import"./ChevronUp-Bua8mQg_.js";import"./DotsVertical-DDt1Z0of.js";import"./CpuChip01-BRse3wgD.js";import"./Eye-CN7MnuxX.js";import"./FilterLines-D6T2TLxw.js";import"./Star01-C6wv5tg7.js";import"./Palette-Bu3LAepu.js";import"./SwitchHorizontal01-CcYoskYm.js";import"./HardDrive-k_osV2fx.js";import"./LinkExternal01-BjO4mb1B.js";import"./LogOut01-BaLbb-JK.js";import"./Monitor01-BbOMT_Bf.js";import"./Sun-jlM4_jk2.js";import"./SearchLg-pvNMPdx7.js";import"./Shield01-DqbjKqjF.js";import"./Stars01-cbnx-58G.js";import"./Trash01-8tMNvAGj.js";import"./Upload01-DEb40SuQ.js";import"./User01-B1EqqZKM.js";import"./Users01-Ca4M-Dx2.js";import"./XClose-outHzlfY.js";import"./Zap-7KA5ZNQg.js";import"./badge-LURmYsxa.js";import"./mcp-oauth-CNzwJzT5.js";import"./tab-id-CpKaVM9t.js";import"./dialog-BUJ-AcXn.js";import"./use-ai-providers-CPseYMhM.js";import"./use-decopilot-events-BqtjxaPd.js";import"./avatar-Bl8FLdrm.js";import"./required-auth-layout-CcfxFPTq.js";import"./use-org-sso-BwjPrTQu.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 +0,0 @@
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-BWQ8J_Ql.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-BLIGgLaX.js";import{A as dt}from"./auth-entry-n0kUqZDU.js";import{A as ut}from"./auth-split-layout-fl1tt8El.js";import{O as Be}from"./organization-choice-Ne0KB-x0.js";import{I as gt}from"./input-IzR9qH12.js";import{D as ft,a as We,b as pt,c as ht}from"./dropdown-menu-BOOIaYmO.js";import{S as bt,u as xt,W as yt,g as jt,a as Ct}from"./use-mcp-client-DxfTC5E_.js";import{i as Ot}from"./XCircle-Dv7GY9Ae.js";import{i as vt}from"./ArrowUpRight-rLTsVWA_.js";import"./integration-icon-CaGyRRyP.js";import"./Tool02-DxIXF41R.js";import"./agent-icon-qAcwCm4B.js";import"./AlertCircle-CAbc8MAP.js";import"./Tool01-y5Zo-2kp.js";import"./ArrowUp-Cbgz6edS.js";import"./Settings02-DqVBXHWa.js";import"./TrendUp01-Bvixesdw.js";import"./ZapSquare-Cvx15c67.js";import"./Users03-DdrNKhEH.js";import"./CheckCircle-DyT8St9I.js";import"./Check-aJK60dGs.js";import"./ChevronDown-QKGLHDtk.js";import"./ChevronRight-ByhOJDuf.js";import"./ChevronUp-Bua8mQg_.js";import"./DotsVertical-DDt1Z0of.js";import"./Stars02-BteVxWQx.js";import"./Copy01-MoyRnx9Y.js";import"./CpuChip01-BRse3wgD.js";import"./Eye-CN7MnuxX.js";import"./FilterLines-D6T2TLxw.js";import"./Star01-C6wv5tg7.js";import"./Palette-Bu3LAepu.js";import"./SwitchHorizontal01-CcYoskYm.js";import"./HardDrive-k_osV2fx.js";import"./Key01-DgWg9XoR.js";import"./LayoutLeft-DuThLaX3.js";import"./LinkExternal01-BjO4mb1B.js";import"./LogOut01-BaLbb-JK.js";import"./Monitor01-BbOMT_Bf.js";import"./Sun-jlM4_jk2.js";import"./Play-ZUjJ9tm4.js";import"./Plus-DNcVUobv.js";import"./SearchLg-pvNMPdx7.js";import"./SearchMd-BMhVoBl-.js";import"./Shield01-DqbjKqjF.js";import"./Stars01-cbnx-58G.js";import"./Trash01-8tMNvAGj.js";import"./Upload01-DEb40SuQ.js";import"./User01-B1EqqZKM.js";import"./Users01-Ca4M-Dx2.js";import"./XClose-outHzlfY.js";import"./X-6E3IZLpq.js";import"./Zap-7KA5ZNQg.js";import"./dialog-BUJ-AcXn.js";import"./tooltip-E9C3lYtr.js";import"./companions-core-CeShKWs_.js";import"./extract-connection-data-DPzwGu6f.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./form-DhWAfAxx.js";import"./label-zD_AlFJF.js";import"./use-debounced-value-C2iB9iww.js";import"./useQueries-D3rnFNlM.js";import"./authenticate-and-persist-oauth-BXgFAJ7b.js";import"./mcp-oauth-CNzwJzT5.js";import"./auth-BKADTSIm.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-Bl8FLdrm.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};