decocms 3.35.8 → 3.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/client/assets/{AlertCircle-BhiQLzAa.js → AlertCircle-BnqV2fhH.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-zWQi9yeG.js → ArrowUpRight-DLu3LSuz.js} +1 -1
  3. package/dist/client/assets/{Check-BE5llaCo.js → Check-eh46ZGML.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-BZzInqah.js → CheckCircle-C0r3mBzW.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-igtaXLHI.js → ChevronDown-4LxQ5oPz.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-D7ypV5AW.js → ChevronLeft-D0NHXMar.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B2MPJG0Y.js → ChevronRight-CxxNo5xV.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CEzo-UYH.js → ChevronUp-ATBl3MAi.js} +1 -1
  9. package/dist/client/assets/{Container-DxPsYKnX.js → Container-CV0p7hHO.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Bqz0rpkg.js → DotsVertical-CNRvkzVu.js} +1 -1
  11. package/dist/client/assets/{Eye-DeAUvKsB.js → Eye-DVlN5jxk.js} +1 -1
  12. package/dist/client/assets/{FilterLines-LorPzSpm.js → FilterLines-L07hHUB-.js} +1 -1
  13. package/dist/client/assets/{Globe01-9a7DzMR4.js → Globe01-B9VL3QNT.js} +1 -1
  14. package/dist/client/assets/{HardDrive-D6xAeAT3.js → HardDrive-COh7IrR0.js} +1 -1
  15. package/dist/client/assets/{Key01-z4ZY9P3F.js → Key01-aulVwqL7.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BlcyI03M.js → LayoutLeft-DWk83m69.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-wGfNOyG-.js → LinkExternal01-D_x8dxjY.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Bz9bsY6F.js → Monitor01-2xEKWZVQ.js} +1 -1
  19. package/dist/client/assets/{Palette-cOZdFvCP.js → Palette-IBuOwnrk.js} +1 -1
  20. package/dist/client/assets/{Play-DUFgIaEa.js → Play-C1Dc-lf9.js} +1 -1
  21. package/dist/client/assets/{Plus-C9BCwyU7.js → Plus-BLTD9g1p.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DcRdM_Fc.js → RefreshCcw01-CXJQK3v9.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DL_JjGfK.js → SearchMd-B3lNgj0Q.js} +1 -1
  24. package/dist/client/assets/{Settings02-B67J_b-Z.js → Settings02-BtL-CPg2.js} +1 -1
  25. package/dist/client/assets/{Shield01-12NhwCwh.js → Shield01-JtF9z5lI.js} +1 -1
  26. package/dist/client/assets/{Star01-DVJ2VIkN.js → Star01-D0denzoA.js} +1 -1
  27. package/dist/client/assets/{Stars01-Csutpvum.js → Stars01-b6QvFAbV.js} +1 -1
  28. package/dist/client/assets/{Stars02-EFTlH55e.js → Stars02-DiuJq52q.js} +1 -1
  29. package/dist/client/assets/{Sun-C4ItnLzg.js → Sun-BQHzenzm.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-iSGzLP3G.js → SwitchHorizontal01-C4dRfRR7.js} +1 -1
  31. package/dist/client/assets/{Tool01-DnoUjwuW.js → Tool01-DCdaNaEY.js} +1 -1
  32. package/dist/client/assets/{Trash01-HFZG34bv.js → Trash01-mLRbM1z9.js} +1 -1
  33. package/dist/client/assets/{Upload01-D0zblu1D.js → Upload01-BP26EgoC.js} +1 -1
  34. package/dist/client/assets/{User01-GmyJVsk_.js → User01-DpZZxZQw.js} +1 -1
  35. package/dist/client/assets/{Users01-D_irbv8j.js → Users01-CTI49oYx.js} +1 -1
  36. package/dist/client/assets/{Users03-CsJCzoB9.js → Users03-CORMvH6Y.js} +1 -1
  37. package/dist/client/assets/{X-Dz8XfAUE.js → X-gn1ly4Nc.js} +1 -1
  38. package/dist/client/assets/{XCircle-THthyWG1.js → XCircle-BGJwPzuZ.js} +1 -1
  39. package/dist/client/assets/{XClose-9eaBHjn_.js → XClose-BwlE-Nu8.js} +1 -1
  40. package/dist/client/assets/{Zap-4WoTcb5S.js → Zap-DqD6AduN.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-C-w_2LWP.js → ZapSquare-B2POR1ZS.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-DC7naWv-.js → ZoomOut-BM2NUDgV.js} +1 -1
  43. package/dist/client/assets/{access-gate-XBdT3iPT.js → access-gate-DACRNgiY.js} +1 -1
  44. package/dist/client/assets/{accordion-B2o3m3ys.js → accordion-DggLsDzc.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-BOfJx4s8.js → add-section-modal-C3xNe_xo.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-CX7B9V1k.js → agent-capabilities-Bm-PLFs1.js} +1 -1
  47. package/dist/client/assets/{agent-icon-iCRxqonQ.js → agent-icon-CkXhv6DR.js} +1 -1
  48. package/dist/client/assets/{agents-list-Dddtvx5O.js → agents-list-_LMmNXh7.js} +1 -1
  49. package/dist/client/assets/{ai-providers-DOw3qbxO.js → ai-providers-CdE9elzv.js} +1 -1
  50. package/dist/client/assets/{alert-Cb2hF1jc.js → alert-Di1nAgGl.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-DQCfLTeL.js → alert-dialog-ZJsAqfzl.js} +1 -1
  52. package/dist/client/assets/app-editor-CwrKwl6S.js +1 -0
  53. package/dist/client/assets/{auth-BR3kunRm.js → auth-C28A30Tc.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-BMkEHnr7.js → auth-catchall-Gykc1ayZ.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CKdvz2MS.js → auth-split-layout-BLQZfqqR.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-D0LrxtQM.js → automation-list-row-BS580Xxk.js} +1 -1
  57. package/dist/client/assets/{automation-runs-sZhsYDdn.js → automation-runs-C1x-2avW.js} +1 -1
  58. package/dist/client/assets/{automations-Cjr8mJZr.js → automations-D045v3lS.js} +1 -1
  59. package/dist/client/assets/{avatar-I3WwYEoT.js → avatar-B_BYzpDz.js} +1 -1
  60. package/dist/client/assets/{badge-B0F_sgaz.js → badge-BzbbNtAh.js} +1 -1
  61. package/dist/client/assets/{brand-context-AsrwXDeK.js → brand-context-BwCpbN9i.js} +1 -1
  62. package/dist/client/assets/{buckets-D9xOFAgF.js → buckets-UoUGoesM.js} +1 -1
  63. package/dist/client/assets/{calendar-5jwZC3XX.js → calendar-CVM_PlWs.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-vjCbAJOq.js → capability-load-error-C8q5gpVF.js} +1 -1
  65. package/dist/client/assets/{card-BFRGLx6P.js → card-DV27UhYe.js} +1 -1
  66. package/dist/client/assets/{chat-context-DZNmbrat.js → chat-context-B17fAiGJ.js} +1 -1
  67. package/dist/client/assets/{checkbox-DInBbeSC.js → checkbox-C8E6yiOS.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Cu93Pf3C.js → cli-auth-success-DXKtTRqn.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BlvXfl8F.js → collection-detail-DYTXe-vX.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-CcexmhB5.js → collection-display-button-DkvliZfy.js} +1 -1
  71. package/dist/client/assets/{collection-search-ykImYcNC.js → collection-search-6oM8sAkn.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-ubGqDv-6.js → collection-table-wrapper-BoznEa1p.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BlMNH4hh.js → collection-tabs-IWqiXV1e.js} +1 -1
  74. package/dist/client/assets/{collections-C6Af1Q9d.js → collections-DFNd7jPX.js} +1 -1
  75. package/dist/client/assets/{command-CVb7Xyz-.js → command-D1SdiPwD.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-BFdzqeA3.js → connect-desktop-dialog-D-tmt4pE.js} +1 -1
  77. package/dist/client/assets/{connection-card-Dpl0Au98.js → connection-card-DIcosm0X.js} +1 -1
  78. package/dist/client/assets/{connection-detail-GZegjuob.js → connection-detail-Bb7E7eEJ.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-CQ-0zB3Z.js → connection-form-helpers-ChlYhyg6.js} +1 -1
  80. package/dist/client/assets/{connections-CLnO7l3E.js → connections-BkTeF878.js} +1 -1
  81. package/dist/client/assets/{decopilot-IEJmKYNS.js → decopilot-D_s8NcrD.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-DqoHsSxc.js +1 -0
  83. package/dist/client/assets/{dialog-BNTma1n7.js → dialog-BSB689j7.js} +1 -1
  84. package/dist/client/assets/{domain-settings-qDqN6DsU.js → domain-settings-DHNs_g_j.js} +1 -1
  85. package/dist/client/assets/{drawer-BFu_Vykr.js → drawer-C82Ms0Cv.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BPajkRHT.js → dropdown-menu-FYqDJehF.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-CxYTTzo3.js → dynamic-plugin-layout-5sKc8jyc.js} +1 -1
  88. package/dist/client/assets/{empty-state-pMCkbkbn.js → empty-state-BxzxLrPP.js} +1 -1
  89. package/dist/client/assets/{empty-state-DQQwJkAH.js → empty-state-C1tavIlq.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-EpMFgcjc.js → extract-connection-data-CnLrafQF.js} +1 -1
  91. package/dist/client/assets/{features-BZKr28L7.js → features-BpHY8f6J.js} +1 -1
  92. package/dist/client/assets/{file-explorer-BuBL2stT.js → file-explorer-BZVx-0O5.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-CjY-L87B.js → file-type-icon-Bw8qs6o2.js} +1 -1
  94. package/dist/client/assets/{files-CgSwSC5P.js → files-DxGJVld5.js} +1 -1
  95. package/dist/client/assets/{form-D08b7dFe.js → form-UO3a-lMt.js} +1 -1
  96. package/dist/client/assets/{general-HwaMhz2i.js → general-B1BA_GZn.js} +1 -1
  97. package/dist/client/assets/{generate-id-BPoX5AZG.js → generate-id-CZUSC7-8.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-Bv5u83FS.js → github-repo-picker-FLFbegfT.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-DWUYKjvd.js → header-tab-button-BOKDj9bu.js} +1 -1
  100. package/dist/client/assets/{hover-card-CM7471N3.js → hover-card-C3LYC-kn.js} +1 -1
  101. package/dist/client/assets/{image-field-DRWjALOn.js → image-field-B-axyZ2P.js} +1 -1
  102. package/dist/client/assets/{index-CxFf1mIw.js → index-B1OoDAS2.js} +1 -1
  103. package/dist/client/assets/{index-CRu4VNhf.js → index-BHwbsS0f.js} +1 -1
  104. package/dist/client/assets/{index-CYfMTPm6.js → index-BMLWSX3S.js} +1 -1
  105. package/dist/client/assets/{index-qpz1aTWR.js → index-C6tCJ6iD.js} +1 -1
  106. package/dist/client/assets/{index-UEt8s5KD.js → index-CPTdDHuM.js} +1 -1
  107. package/dist/client/assets/{index-BCN4LBSr.js → index-Cb4WTt-q.js} +4 -4
  108. package/dist/client/assets/{index-Bu0ZznB2.js → index-CflW-8xl.js} +1 -1
  109. package/dist/client/assets/{index-DJxRbue6.js → index-CiybtfLu.js} +3 -3
  110. package/dist/client/assets/{index-UuGgKIpr.js → index-DEbs6yYd.js} +1 -1
  111. package/dist/client/assets/{index-SEyWzaM3.js → index-DGUKxx9B.js} +1 -1
  112. package/dist/client/assets/{index-dgPRflW5.js → index-DJOtAj7h.js} +1 -1
  113. package/dist/client/assets/{index-DcLhl-5Q.js → index-DR94I8IC.js} +1 -1
  114. package/dist/client/assets/{index-D-XyK333.js → index-DppM2zVg.js} +1 -1
  115. package/dist/client/assets/{index-C_5MF2Y3.js → index-SkqPgX26.js} +1 -1
  116. package/dist/client/assets/{index-C2WXOm5m.js → index-WvB9UFs-.js} +1 -1
  117. package/dist/client/assets/{index-redirect-Bgc0AzrY.js → index-redirect-DxTNMkbp.js} +1 -1
  118. package/dist/client/assets/{input-DrBjEN1K.js → input-BIou7x1s.js} +1 -1
  119. package/dist/client/assets/{integration-icon-CBmdz72e.js → integration-icon-BG6b6lUb.js} +1 -1
  120. package/dist/client/assets/{label-DPtACVyH.js → label-BALZ87Ne.js} +1 -1
  121. package/dist/client/assets/{layout-ChSwM-QK.js → layout-D3wKVNIg.js} +1 -1
  122. package/dist/client/assets/{login-lrwL4f_O.js → login-njuJcB71.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-COFe1Qcp.js → mcp-oauth-CJ3fuseB.js} +1 -1
  124. package/dist/client/assets/{members-BaLik2bf.js → members-BeYdJt0r.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-D9q3BMcP.js → monaco-editor-CLILoFVJ.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-DK9_KPle.js → monitoring-stats-row-u_reVPx1.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-D8hDCZsz.js → oauth-callback-DirC5TV0.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-ClG2kZkP.js → oauth-callback-ai-provider-BDRagMAu.js} +1 -1
  129. package/dist/client/assets/{onboarding-D-nWMG3s.js → onboarding-DlgWGyxq.js} +1 -1
  130. package/dist/client/assets/{org-install-CSh2gL1g.js → org-install-DVgIW0Qi.js} +1 -1
  131. package/dist/client/assets/{org-layout-BzdyjBgb.js → org-layout-Bre11PNt.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-hz3PdzSx.js → org-plugin-layout-BXBCHZWd.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-o10VY06i.js → page-seo-form-DUSMHeEJ.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-NSwZ2Bog.js +1 -0
  135. package/dist/client/assets/{pair-B3JvusRD.js → pair-lHmdq1Qv.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-qUc9EE_w.js → plugin-empty-state-DAWeTPEc.js} +1 -1
  137. package/dist/client/assets/{plugin-header-Wee2-vBE.js → plugin-header-DFfO2BIK.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-DQH5MxMz.js → plugin-layout-syGxbFUV.js} +1 -1
  139. package/dist/client/assets/{popover-CxSOgrnQ.js → popover-DwdaLh0V.js} +1 -1
  140. package/dist/client/assets/{post-editor-49rnCC5W.js → post-editor-C9ncA3ry.js} +1 -1
  141. package/dist/client/assets/{primitives-DIR4NDi7.js → primitives-B-U4LZoe.js} +1 -1
  142. package/dist/client/assets/{profile-CnzeSYsG.js → profile-Ht_-FnbL.js} +1 -1
  143. package/dist/client/assets/project-app-view-HB2vBeZ5.js +1 -0
  144. package/dist/client/assets/record-editor-8FmeVsnk.js +1 -0
  145. package/dist/client/assets/registry-FHAA-0GH.js +2 -0
  146. package/dist/client/assets/{registry-layout-BbZF87a1.js → registry-layout-Bw_kbjOh.js} +1 -1
  147. package/dist/client/assets/{require-capability-CP41TlGl.js → require-capability-BJtu48OI.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Bakgp2v2.js → required-auth-layout-DI6zQAQY.js} +1 -1
  149. package/dist/client/assets/{reset-password-ZxK_LvZM.js → reset-password-D4hK6pUY.js} +1 -1
  150. package/dist/client/assets/{resizable-C-hPk_F_.js → resizable-B2XskWDt.js} +1 -1
  151. package/dist/client/assets/{roles-D7m3YYSg.js → roles-Cqt-ohZl.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-CjAVAUIA.js +1 -0
  153. package/dist/client/assets/{save-status-CLNRCBUu.js → save-status-B5RVyMMa.js} +1 -1
  154. package/dist/client/assets/{schema-form-B2H-b_em.js → schema-form-MsvEbpzs.js} +1 -1
  155. package/dist/client/assets/{scroll-area-KSI08Bdg.js → scroll-area-CUtpZ3i2.js} +1 -1
  156. package/dist/client/assets/{search-input-LClJsC0R.js → search-input-D_Czo7sj.js} +1 -1
  157. package/dist/client/assets/{secrets-DakIQ3h4.js → secrets-DqDtbfQI.js} +1 -1
  158. package/dist/client/assets/{sections-editor-BlwTeLMB.js → sections-editor-TRTd4goB.js} +1 -1
  159. package/dist/client/assets/{select-BD3-KIUg.js → select-DyYLWAtt.js} +1 -1
  160. package/dist/client/assets/{select-model-Dbbl0Ax5.js → select-model-Bgdox0ak.js} +1 -1
  161. package/dist/client/assets/{seo-editor-CRarakJm.js → seo-editor-NEYssb1U.js} +1 -1
  162. package/dist/client/assets/{settings-layout-C6Td3mdo.js → settings-layout-BjHnX_Rv.js} +1 -1
  163. package/dist/client/assets/{settings-section-ooondd_C.js → settings-section-ByNQkiKy.js} +1 -1
  164. package/dist/client/assets/{sheet-BB5BvZRD.js → sheet-CJSR0f_J.js} +1 -1
  165. package/dist/client/assets/{shell-controls-BYqwKGk9.js → shell-controls-0WsfKqkV.js} +1 -1
  166. package/dist/client/assets/{shell-layout-C11kPZct.js → shell-layout-CvbgPIaO.js} +1 -1
  167. package/dist/client/assets/{shell-route-loading-D23tu6UU.js → shell-route-loading-BQKfSVKy.js} +1 -1
  168. package/dist/client/assets/{sidebar-DQGireBE.js → sidebar-CT4nDj9F.js} +1 -1
  169. package/dist/client/assets/{skeleton-C_PdNCnO.js → skeleton-C0n2MBSC.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-DATKg__i.js → sortable.esm-BzXaOB_3.js} +1 -1
  171. package/dist/client/assets/{spinner-ph9V8K3G.js → spinner-DBVYiKjc.js} +1 -1
  172. package/dist/client/assets/{sso-CVFsn2i8.js → sso-DqRvx49i.js} +1 -1
  173. package/dist/client/assets/{store-C6H7hDrQ.js → store-BYx1pzM7.js} +1 -1
  174. package/dist/client/assets/store-registry-6iSO897G.js +2 -0
  175. package/dist/client/assets/{studio-tools-CyXwEskA.js → studio-tools-ByWE0fVB.js} +1 -1
  176. package/dist/client/assets/{switch-BwW6aBRl.js → switch-CFZgZOoT.js} +1 -1
  177. package/dist/client/assets/{tab-id-DBFKLiy5.js → tab-id-D6XV4CDL.js} +1 -1
  178. package/dist/client/assets/{table-DRZq5QeC.js → table-DRy0atlv.js} +1 -1
  179. package/dist/client/assets/{tabs-DS796tVx.js → tabs-B4Xt74wj.js} +1 -1
  180. package/dist/client/assets/{task-status-Rw4KZiD7.js → task-status-CizXRJxN.js} +1 -1
  181. package/dist/client/assets/{textarea-H9HcvvO3.js → textarea-CpqLWirc.js} +1 -1
  182. package/dist/client/assets/{toggle-group-DEp8BrmP.js → toggle-group-CUuptLSP.js} +1 -1
  183. package/dist/client/assets/{toolbar-CGZIlwHR.js → toolbar-Brcztx2Q.js} +1 -1
  184. package/dist/client/assets/{tools-list-2oZSXDvR.js → tools-list-DJunsBR9.js} +1 -1
  185. package/dist/client/assets/{tooltip-BsiBfMRx.js → tooltip-BjyXwk4-.js} +1 -1
  186. package/dist/client/assets/{types-BDYvGU56.js → types-CTAso5N_.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-CLGsHtDy.js → use-ai-providers-BJZDY8Y9.js} +1 -1
  188. package/dist/client/assets/{use-automations-BFkAWLBs.js → use-automations-Cmrz96gF.js} +1 -1
  189. package/dist/client/assets/{use-capability-BgmZSEFV.js → use-capability-B0pYY0r2.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-CaCQW7f3.js → use-clock-tick-B7ba5G_w.js} +1 -1
  191. package/dist/client/assets/{use-collections-LXN6LFio.js → use-collections-DJpkyqRG.js} +1 -1
  192. package/dist/client/assets/{use-connection-DBT-O2Ot.js → use-connection-B5A06L65.js} +1 -1
  193. package/dist/client/assets/{use-copy-Be1923zu.js → use-copy-Dp9AIDyE.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-CUFB7E50.js → use-create-virtual-mcp-DvFTy-qt.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-Dl4w5-6p.js → use-debounced-autosave-BYXOYkk-.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-BgQev1Df.js → use-delete-connection-WF5NfIcz.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-D8QyTqtG.js → use-file-configs-DZ1IbDAN.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-DmcTgb_Z.js → use-infinite-scroll-DUQ6svQh.js} +1 -1
  199. package/dist/client/assets/{use-list-state-COdpgZQx.js → use-list-state-Bx7Ncrk2.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-DEVh0wrA.js → use-mcp-client-D1Wt1Ama.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-wVJtCACz.js → use-mcp-prompts-C3lAYJn0.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-Do5DPz0G.js → use-mcp-tools-B_6LkwOm.js} +1 -1
  203. package/dist/client/assets/{use-members-Dyv5s6Ln.js → use-members-Ch8rP11v.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-em-bmKWL.js → use-navigate-to-agent-Df96tRB5.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-RfCN5nxl.js → use-org-auth-client-BafLVU4c.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-Dn-IiDHF.js → use-org-sso-Dy5nNvp5.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-BsAcGhUy.js → use-organization-roles-D6FDnuQ7.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-BmyIHq31.js → use-organization-settings-9bjAS-Lz.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-R7xxuxMJ.js → use-registry-connections-zD4mCaEh.js} +1 -1
  210. package/dist/client/assets/{use-secrets-a1pHbRuq.js → use-secrets-ClIBWX3M.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-jx0BT_gy.js → use-status-sounds-DCDAeOy7.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-BORPaXws.js → use-view-mode-lpAtoRqW.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-CsBEf_ak.js → use-virtual-mcp-BsZRrdSO.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-CvW-Zfuj.js +1 -0
  215. package/dist/client/assets/{useRouterState-CpJi3eeH.js → useRouterState-D6isJH0F.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-DGYfhNPQ.js +1 -0
  217. package/dist/client/assets/{user-CBCnDRYu.js → user-BLD1kA1s.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-CI6odJEz.js → view-mode-toggle-C-NsBriE.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-LhxM1ddy.js → watch-sse-pool-BSUvJM1x.js} +1 -1
  220. package/dist/client/assets/{workflow-BgPeOS0D.js → workflow-BxTaQjnF.js} +1 -1
  221. package/dist/client/assets/workflow-detail-Dw0wzylw.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +663 -696
  224. package/dist/server/server.js +338 -344
  225. package/package.json +5 -3
  226. package/dist/client/assets/app-editor-CRIIKlDH.js +0 -1
  227. package/dist/client/assets/decopilot-sse-pool-BTIZKXdE.js +0 -1
  228. package/dist/client/assets/page-seo-sheet-DQlXJBao.js +0 -1
  229. package/dist/client/assets/project-app-view-D4KDZyfT.js +0 -1
  230. package/dist/client/assets/record-editor-U1lNDcKg.js +0 -1
  231. package/dist/client/assets/registry-C-XSpMct.js +0 -2
  232. package/dist/client/assets/save-referenced-block-DXNQX0iw.js +0 -1
  233. package/dist/client/assets/store-registry-B9IEgjs2.js +0 -2
  234. package/dist/client/assets/useInfiniteQuery-e_b9pntx.js +0 -1
  235. package/dist/client/assets/useSuspenseInfiniteQuery-CAwDmp_D.js +0 -1
  236. package/dist/client/assets/workflow-detail-CWUm2dJS.js +0 -1
@@ -1 +1 @@
1
- import{e as se,j as s,B as Z,p as me,r as Y,t as v,n as de}from"./index-DJxRbue6.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-BPajkRHT.js";import{s as pe}from"./Star01-DVJ2VIkN.js";import{a as fe}from"./Users03-CsJCzoB9.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-Bv5u83FS.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-CsBEf_ak.js";import{P as q}from"./index-qpz1aTWR.js";import{i as ye}from"./DotsVertical-Bqz0rpkg.js";import{a as Ne}from"./Settings02-B67J_b-Z.js";import{s as Se}from"./Trash01-HFZG34bv.js";import{A as De,aq as ve}from"./agent-icon-iCRxqonQ.js";import{l as Ae}from"./use-navigate-to-agent-em-bmKWL.js";import{C as ke}from"./card-BFRGLx6P.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-BgmZSEFV.js";import{E as Te}from"./empty-state-pMCkbkbn.js";import{u as ze}from"./use-create-virtual-mcp-CUFB7E50.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-DQCfLTeL.js";import{S as $e}from"./search-input-LClJsC0R.js";import{s as le}from"./Plus-C9BCwyU7.js";import"./Check-BE5llaCo.js";import"./ChevronRight-B2MPJG0Y.js";import"./use-connection-DBT-O2Ot.js";import"./use-collections-LXN6LFio.js";import"./use-mcp-client-DEVh0wrA.js";import"./auth-BR3kunRm.js";import"./dialog-BNTma1n7.js";import"./X-Dz8XfAUE.js";import"./RefreshCcw01-DcRdM_Fc.js";import"./collection-search-ykImYcNC.js";import"./SearchMd-DL_JjGfK.js";import"./checkbox-DInBbeSC.js";import"./mcp-oauth-COFe1Qcp.js";import"./use-mcp-tools-Do5DPz0G.js";import"./extract-connection-data-EpMFgcjc.js";import"./generate-id-BPoX5AZG.js";import"./collections-C6Af1Q9d.js";import"./sidebar-DQGireBE.js";import"./LayoutLeft-BlcyI03M.js";import"./tooltip-BsiBfMRx.js";import"./sheet-BB5BvZRD.js";import"./AlertCircle-BhiQLzAa.js";import"./Tool01-DnoUjwuW.js";import"./SwitchHorizontal01-iSGzLP3G.js";import"./XCircle-THthyWG1.js";import"./ArrowUpRight-zWQi9yeG.js";import"./ZapSquare-C-w_2LWP.js";import"./CheckCircle-BZzInqah.js";import"./ChevronDown-igtaXLHI.js";import"./ChevronLeft-D7ypV5AW.js";import"./ChevronUp-CEzo-UYH.js";import"./Container-DxPsYKnX.js";import"./Eye-DeAUvKsB.js";import"./ZoomOut-DC7naWv-.js";import"./Globe01-9a7DzMR4.js";import"./FilterLines-LorPzSpm.js";import"./Palette-cOZdFvCP.js";import"./HardDrive-D6xAeAT3.js";import"./Stars02-EFTlH55e.js";import"./Key01-z4ZY9P3F.js";import"./LinkExternal01-wGfNOyG-.js";import"./Monitor01-Bz9bsY6F.js";import"./Sun-C4ItnLzg.js";import"./Play-DUFgIaEa.js";import"./Shield01-12NhwCwh.js";import"./Stars01-Csutpvum.js";import"./Upload01-D0zblu1D.js";import"./User01-GmyJVsk_.js";import"./Users01-D_irbv8j.js";import"./XClose-9eaBHjn_.js";import"./Zap-4WoTcb5S.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function as(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{as as default};
1
+ import{e as se,j as s,B as Z,p as me,r as Y,t as v,n as de}from"./index-CiybtfLu.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-FYqDJehF.js";import{s as pe}from"./Star01-D0denzoA.js";import{a as fe}from"./Users03-CORMvH6Y.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-FLFbegfT.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-BsZRrdSO.js";import{P as q}from"./index-C6tCJ6iD.js";import{i as ye}from"./DotsVertical-CNRvkzVu.js";import{a as Ne}from"./Settings02-BtL-CPg2.js";import{s as Se}from"./Trash01-mLRbM1z9.js";import{A as De,aq as ve}from"./agent-icon-CkXhv6DR.js";import{l as Ae}from"./use-navigate-to-agent-Df96tRB5.js";import{C as ke}from"./card-DV27UhYe.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-B0pYY0r2.js";import{E as Te}from"./empty-state-BxzxLrPP.js";import{u as ze}from"./use-create-virtual-mcp-DvFTy-qt.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-ZJsAqfzl.js";import{S as $e}from"./search-input-D_Czo7sj.js";import{s as le}from"./Plus-BLTD9g1p.js";import"./Check-eh46ZGML.js";import"./ChevronRight-CxxNo5xV.js";import"./use-connection-B5A06L65.js";import"./use-collections-DJpkyqRG.js";import"./use-mcp-client-D1Wt1Ama.js";import"./auth-C28A30Tc.js";import"./dialog-BSB689j7.js";import"./X-gn1ly4Nc.js";import"./RefreshCcw01-CXJQK3v9.js";import"./collection-search-6oM8sAkn.js";import"./SearchMd-B3lNgj0Q.js";import"./checkbox-C8E6yiOS.js";import"./mcp-oauth-CJ3fuseB.js";import"./use-mcp-tools-B_6LkwOm.js";import"./extract-connection-data-CnLrafQF.js";import"./generate-id-CZUSC7-8.js";import"./collections-DFNd7jPX.js";import"./sidebar-CT4nDj9F.js";import"./LayoutLeft-DWk83m69.js";import"./tooltip-BjyXwk4-.js";import"./sheet-CJSR0f_J.js";import"./AlertCircle-BnqV2fhH.js";import"./Tool01-DCdaNaEY.js";import"./SwitchHorizontal01-C4dRfRR7.js";import"./XCircle-BGJwPzuZ.js";import"./ArrowUpRight-DLu3LSuz.js";import"./ZapSquare-B2POR1ZS.js";import"./CheckCircle-C0r3mBzW.js";import"./ChevronDown-4LxQ5oPz.js";import"./ChevronLeft-D0NHXMar.js";import"./ChevronUp-ATBl3MAi.js";import"./Container-CV0p7hHO.js";import"./Eye-DVlN5jxk.js";import"./ZoomOut-BM2NUDgV.js";import"./Globe01-B9VL3QNT.js";import"./FilterLines-L07hHUB-.js";import"./Palette-IBuOwnrk.js";import"./HardDrive-COh7IrR0.js";import"./Stars02-DiuJq52q.js";import"./Key01-aulVwqL7.js";import"./LinkExternal01-D_x8dxjY.js";import"./Monitor01-2xEKWZVQ.js";import"./Sun-BQHzenzm.js";import"./Play-C1Dc-lf9.js";import"./Shield01-JtF9z5lI.js";import"./Stars01-b6QvFAbV.js";import"./Upload01-BP26EgoC.js";import"./User01-DpZZxZQw.js";import"./Users01-CTI49oYx.js";import"./XClose-BwlE-Nu8.js";import"./Zap-DqD6AduN.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function as(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{as as default};
@@ -1 +1 @@
1
- import{P as V,R as C,aE as ne,aG as le,aH as he,aF as xe,b7 as me,e as z,H as ge,G as be,r as O,j as s,C as Ee,n as Q,z as ye,p as oe,F as re,a as J,K as G,m as ve,c as ue,B as L,t as je,E as Fe}from"./index-DJxRbue6.js";import{i as Re}from"./AlertCircle-BhiQLzAa.js";import{P as te}from"./index-qpz1aTWR.js";import{S as ae}from"./skeleton-C_PdNCnO.js";import{b as _e,a as ce,S as de,c as $e}from"./settings-section-ooondd_C.js";import{u as X,b as se,c as Se}from"./use-ai-providers-CLGsHtDy.js";import{i as Oe}from"./CheckCircle-BZzInqah.js";import{p as Me}from"./chat-context-DZNmbrat.js";import{e as Te,f as ze}from"./use-organization-settings-BmyIHq31.js";import{M as Ue}from"./select-model-Dbbl0Ax5.js";import{u as qe}from"./use-debounced-autosave-Dl4w5-6p.js";import{I as ie}from"./input-DrBjEN1K.js";import{a as fe,T as Le}from"./toggle-group-DEp8BrmP.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-DQCfLTeL.js";import{u as W}from"./studio-tools-CyXwEskA.js";import{s as Ve}from"./Plus-C9BCwyU7.js";import{i as Ge}from"./Tool01-DnoUjwuW.js";import{s as Be}from"./Trash01-HFZG34bv.js";import{A as Qe}from"./avatar-I3WwYEoT.js";import{O as Ke,P as Ye,C as pe}from"./decopilot-IEJmKYNS.js";import{a as We}from"./RefreshCcw01-DcRdM_Fc.js";import{s as He}from"./Eye-DeAUvKsB.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-BNTma1n7.js";import{S as st}from"./spinner-ph9V8K3G.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-CP41TlGl.js";import"./sidebar-DQGireBE.js";import"./LayoutLeft-BlcyI03M.js";import"./tooltip-BsiBfMRx.js";import"./sheet-BB5BvZRD.js";import"./X-Dz8XfAUE.js";import"./card-BFRGLx6P.js";import"./ArrowUpRight-zWQi9yeG.js";import"./use-mcp-client-DEVh0wrA.js";import"./auth-BR3kunRm.js";import"./tab-id-DBFKLiy5.js";import"./watch-sse-pool-LhxM1ddy.js";import"./decopilot-sse-pool-BTIZKXdE.js";import"./use-virtual-mcp-CsBEf_ak.js";import"./use-collections-LXN6LFio.js";import"./drawer-BFu_Vykr.js";import"./connect-desktop-dialog-BFdzqeA3.js";import"./Check-BE5llaCo.js";import"./User01-GmyJVsk_.js";import"./checkbox-DInBbeSC.js";import"./select-BD3-KIUg.js";import"./ChevronDown-igtaXLHI.js";import"./ChevronUp-CEzo-UYH.js";import"./Key01-z4ZY9P3F.js";import"./SearchMd-DL_JjGfK.js";import"./Settings02-B67J_b-Z.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-Bz9bsY6F.js";import"./ChevronRight-B2MPJG0Y.js";import"./Stars01-Csutpvum.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BgmZSEFV.js";import"./access-gate-XBdT3iPT.js";import"./capability-load-error-vjCbAJOq.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=z.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=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]=f):f=t[9];const k=f;if(o&&!j){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(Ue,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=z.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=z.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=ze(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),F={};c?.id&&(F[c.id]=v),u?.id&&(F[u.id]=j),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,U=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&U)return;const B=Me(t,F);r.reset({tiers:{fast:N.fast??B.chat.fast,smart:N.smart??B.chat.smart,thinking:N.thinking??B.chat.thinking,image:N.image??B.image,web_research:N.web_research??B.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const $=b&&!d;let A;e[30]!==_||e[31]!==$?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:$})]}),e[30]=_,e[31]=$,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=z.c(26),t=W(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(k=i&&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:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=z.c(58),{org:t}=oe(),i=W(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>_(!0),e[22]=T):T=e[22];let $;e[23]!==c?($=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=$):$=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&gt(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let U;e[47]!==S||e[48]!==q?(U=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=U):U=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=B):B=e[50];let Y;e[51]!==U?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[U,B]}),e[51]=U,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==$||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[$,E,Y,Z]})})}),e[54]=$,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=z.c(8),{org:t}=oe(),i=W(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=z.c(10),{mutate:t,isPending:i}=jt();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 o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),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:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=W(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:G.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),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:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(We,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=z.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=W();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=z.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=W(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let U;t[3]!==i.createdAt?(U=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=U):U=t[4],v=`${q} · added ${U} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:G.aiProviders(o.id)}),r.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ge,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Be,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let $;t[21]!==p?($=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=$):$=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==$||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:$}),t[23]=j,t[24]=u,t[25]=$,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(De,{open:x,onOpenChange:_,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=z.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=z.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=z.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(Ye,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function $t(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs($e,{children:[t,s.jsx(Fe,{fallback:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{error:t??new Error("Failed to load AI providers")})}function Ls(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx($t,{})}),e[0]=t):t=e[0],t}export{Ls as default};
1
+ import{P as V,R as C,aE as ne,aG as le,aH as he,aF as xe,b7 as me,e as z,H as ge,G as be,r as O,j as s,C as Ee,n as Q,z as ye,p as oe,F as re,a as J,K as G,m as ve,c as ue,B as L,t as je,E as Fe}from"./index-CiybtfLu.js";import{i as Re}from"./AlertCircle-BnqV2fhH.js";import{P as te}from"./index-C6tCJ6iD.js";import{S as ae}from"./skeleton-C0n2MBSC.js";import{b as _e,a as ce,S as de,c as $e}from"./settings-section-ByNQkiKy.js";import{u as X,b as se,c as Se}from"./use-ai-providers-BJZDY8Y9.js";import{i as Oe}from"./CheckCircle-C0r3mBzW.js";import{p as Me}from"./chat-context-B17fAiGJ.js";import{e as Te,f as ze}from"./use-organization-settings-9bjAS-Lz.js";import{M as Ue}from"./select-model-Bgdox0ak.js";import{u as qe}from"./use-debounced-autosave-BYXOYkk-.js";import{I as ie}from"./input-BIou7x1s.js";import{a as fe,T as Le}from"./toggle-group-CUuptLSP.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-ZJsAqfzl.js";import{u as W}from"./studio-tools-ByWE0fVB.js";import{s as Ve}from"./Plus-BLTD9g1p.js";import{i as Ge}from"./Tool01-DCdaNaEY.js";import{s as Be}from"./Trash01-mLRbM1z9.js";import{A as Qe}from"./avatar-B_BYzpDz.js";import{O as Ke,P as Ye,C as pe}from"./decopilot-D_s8NcrD.js";import{a as We}from"./RefreshCcw01-CXJQK3v9.js";import{s as He}from"./Eye-DVlN5jxk.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-BSB689j7.js";import{S as st}from"./spinner-DBVYiKjc.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-BJtu48OI.js";import"./sidebar-CT4nDj9F.js";import"./LayoutLeft-DWk83m69.js";import"./tooltip-BjyXwk4-.js";import"./sheet-CJSR0f_J.js";import"./X-gn1ly4Nc.js";import"./card-DV27UhYe.js";import"./ArrowUpRight-DLu3LSuz.js";import"./use-mcp-client-D1Wt1Ama.js";import"./auth-C28A30Tc.js";import"./tab-id-D6XV4CDL.js";import"./watch-sse-pool-BSUvJM1x.js";import"./decopilot-sse-pool-DqoHsSxc.js";import"./use-virtual-mcp-BsZRrdSO.js";import"./use-collections-DJpkyqRG.js";import"./drawer-C82Ms0Cv.js";import"./connect-desktop-dialog-D-tmt4pE.js";import"./Check-eh46ZGML.js";import"./User01-DpZZxZQw.js";import"./checkbox-C8E6yiOS.js";import"./select-DyYLWAtt.js";import"./ChevronDown-4LxQ5oPz.js";import"./ChevronUp-ATBl3MAi.js";import"./Key01-aulVwqL7.js";import"./SearchMd-B3lNgj0Q.js";import"./Settings02-BtL-CPg2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-2xEKWZVQ.js";import"./ChevronRight-CxxNo5xV.js";import"./Stars01-b6QvFAbV.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-B0pYY0r2.js";import"./access-gate-DACRNgiY.js";import"./capability-load-error-C8q5gpVF.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=z.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=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]=f):f=t[9];const k=f;if(o&&!j){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(Ue,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=z.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=z.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=ze(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),F={};c?.id&&(F[c.id]=v),u?.id&&(F[u.id]=j),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,U=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&U)return;const B=Me(t,F);r.reset({tiers:{fast:N.fast??B.chat.fast,smart:N.smart??B.chat.smart,thinking:N.thinking??B.chat.thinking,image:N.image??B.image,web_research:N.web_research??B.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const $=b&&!d;let A;e[30]!==_||e[31]!==$?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:$})]}),e[30]=_,e[31]=$,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=z.c(26),t=W(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(k=i&&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:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=z.c(58),{org:t}=oe(),i=W(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>_(!0),e[22]=T):T=e[22];let $;e[23]!==c?($=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(L,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=$):$=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&gt(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let U;e[47]!==S||e[48]!==q?(U=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=U):U=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=B):B=e[50];let Y;e[51]!==U?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[U,B]}),e[51]=U,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==$||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[$,E,Y,Z]})})}),e[54]=$,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=z.c(8),{org:t}=oe(),i=W(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=z.c(10),{mutate:t,isPending:i}=jt();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 o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),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:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=W(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:G.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),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:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(We,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=z.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=W();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=z.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=W(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let U;t[3]!==i.createdAt?(U=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=U):U=t[4],v=`${q} · added ${U} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:G.aiProviders(o.id)}),r.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ge,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Be,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let $;t[21]!==p?($=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=$):$=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==$||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:$}),t[23]=j,t[24]=u,t[25]=$,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(De,{open:x,onOpenChange:_,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=z.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=z.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=z.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(Ye,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function $t(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs($e,{children:[t,s.jsx(Fe,{fallback:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{error:t??new Error("Failed to load AI providers")})}function Ls(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx($t,{})}),e[0]=t):t=e[0],t}export{Ls as default};
@@ -1 +1 @@
1
- import{e as n,c as o,j as c,bq as d}from"./index-DJxRbue6.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
1
+ import{e as n,c as o,j as c,bq as d}from"./index-CiybtfLu.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
@@ -1,4 +1,4 @@
1
- import{r as i,bu as m,j as r,dp as A,dm as w,dn as T,dL as O,bB as M,a5 as I,cw as L,dM as D,cx as z,dA as F,ad as G,dq as k,cy as q,e as n,c as p,dN as v}from"./index-DJxRbue6.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
1
+ import{r as i,bu as m,j as r,dp as A,dm as w,dn as T,dL as O,bB as M,a5 as I,cw as L,dM as D,cx as z,dA as F,ad as G,dq as k,cy as q,e as n,c as p,dN as v}from"./index-CiybtfLu.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -0,0 +1 @@
1
+ import{e as W,r as B,j as e,c as X,l as Y}from"./index-CiybtfLu.js";import{i as Z}from"./ChevronRight-CxxNo5xV.js";import{S as tt}from"./scroll-area-CUtpZ3i2.js";import{aa as et,ab as rt,f as ot}from"./index-Cb4WTt-q.js";import{c as it}from"./save-referenced-block-CjAVAUIA.js";import{S as mt}from"./schema-form-MsvEbpzs.js";import{S as pt}from"./save-status-B5RVyMMa.js";import"./select-DyYLWAtt.js";import"./tooltip-BjyXwk4-.js";import"./Check-eh46ZGML.js";import"./ChevronDown-4LxQ5oPz.js";import"./ChevronUp-ATBl3MAi.js";import"./agent-capabilities-Bm-PLFs1.js";import"./chat-context-B17fAiGJ.js";import"./tab-id-D6XV4CDL.js";import"./use-mcp-client-D1Wt1Ama.js";import"./auth-C28A30Tc.js";import"./watch-sse-pool-BSUvJM1x.js";import"./decopilot-sse-pool-DqoHsSxc.js";import"./use-virtual-mcp-BsZRrdSO.js";import"./use-collections-DJpkyqRG.js";import"./use-ai-providers-BJZDY8Y9.js";import"./use-organization-settings-9bjAS-Lz.js";import"./pair-lHmdq1Qv.js";import"./agent-icon-CkXhv6DR.js";import"./AlertCircle-BnqV2fhH.js";import"./Tool01-DCdaNaEY.js";import"./SwitchHorizontal01-C4dRfRR7.js";import"./RefreshCcw01-CXJQK3v9.js";import"./XCircle-BGJwPzuZ.js";import"./ArrowUpRight-DLu3LSuz.js";import"./ZapSquare-B2POR1ZS.js";import"./Users03-CORMvH6Y.js";import"./CheckCircle-C0r3mBzW.js";import"./ChevronLeft-D0NHXMar.js";import"./DotsVertical-CNRvkzVu.js";import"./Container-CV0p7hHO.js";import"./Eye-DVlN5jxk.js";import"./ZoomOut-BM2NUDgV.js";import"./Globe01-B9VL3QNT.js";import"./FilterLines-L07hHUB-.js";import"./Star01-D0denzoA.js";import"./Palette-IBuOwnrk.js";import"./HardDrive-COh7IrR0.js";import"./Stars02-DiuJq52q.js";import"./Key01-aulVwqL7.js";import"./LayoutLeft-DWk83m69.js";import"./LinkExternal01-D_x8dxjY.js";import"./Monitor01-2xEKWZVQ.js";import"./Sun-BQHzenzm.js";import"./Play-C1Dc-lf9.js";import"./Plus-BLTD9g1p.js";import"./SearchMd-B3lNgj0Q.js";import"./Settings02-BtL-CPg2.js";import"./Shield01-JtF9z5lI.js";import"./Stars01-b6QvFAbV.js";import"./Trash01-mLRbM1z9.js";import"./Upload01-BP26EgoC.js";import"./User01-DpZZxZQw.js";import"./Users01-CTI49oYx.js";import"./XClose-BwlE-Nu8.js";import"./X-gn1ly4Nc.js";import"./Zap-DqD6AduN.js";import"./use-clock-tick-B7ba5G_w.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dp9AIDyE.js";import"./file-type-icon-Bw8qs6o2.js";import"./dialog-BSB689j7.js";import"./content-blocks-o63cs2vh.js";import"./types-CTAso5N_.js";import"./studio-tools-ByWE0fVB.js";import"./shell-layout-CvbgPIaO.js";import"./avatar-B_BYzpDz.js";import"./required-auth-layout-DI6zQAQY.js";import"./useRouterState-D6isJH0F.js";import"./use-org-sso-Dy5nNvp5.js";import"./integration-icon-BG6b6lUb.js";import"./use-navigate-to-agent-Df96tRB5.js";import"./use-connection-B5A06L65.js";import"./use-mcp-prompts-C3lAYJn0.js";import"./form-UO3a-lMt.js";import"./label-BALZ87Ne.js";import"./input-BIou7x1s.js";import"./spinner-DBVYiKjc.js";import"./drawer-C82Ms0Cv.js";import"./collection-search-6oM8sAkn.js";import"./tabs-B4Xt74wj.js";import"./toggle-group-CUuptLSP.js";import"./sortable.esm-BzXaOB_3.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DIcosm0X.js";import"./use-registry-connections-zD4mCaEh.js";import"./useInfiniteQuery-CvW-Zfuj.js";import"./use-infinite-scroll-DUQ6svQh.js";import"./extract-connection-data-CnLrafQF.js";import"./generate-id-CZUSC7-8.js";import"./collections-DFNd7jPX.js";import"./card-DV27UhYe.js";import"./collection-tabs-IWqiXV1e.js";import"./badge-BzbbNtAh.js";import"./textarea-CpqLWirc.js";import"./connection-form-helpers-ChlYhyg6.js";import"./useSuspenseInfiniteQuery-DGYfhNPQ.js";import"./mcp-oauth-CJ3fuseB.js";import"./connect-desktop-dialog-D-tmt4pE.js";import"./decopilot-D_s8NcrD.js";import"./checkbox-C8E6yiOS.js";import"./skeleton-C0n2MBSC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ByNQkiKy.js";import"./popover-DwdaLh0V.js";import"./command-D1SdiPwD.js";import"./index-B1OoDAS2.js";import"./index-DEbs6yYd.js";import"./dropdown-menu-FYqDJehF.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BQKfSVKy.js";import"./sidebar-CT4nDj9F.js";import"./sheet-CJSR0f_J.js";import"./toolbar-Brcztx2Q.js";import"./use-create-virtual-mcp-DvFTy-qt.js";import"./github-repo-picker-FLFbegfT.js";import"./use-mcp-tools-B_6LkwOm.js";import"./alert-dialog-ZJsAqfzl.js";import"./index-SkqPgX26.js";import"./use-org-auth-client-BafLVU4c.js";import"./hover-card-C3LYC-kn.js";import"./task-status-CizXRJxN.js";import"./use-status-sounds-DCDAeOy7.js";import"./empty-state-BxzxLrPP.js";import"./resizable-B2XskWDt.js";import"./use-capability-B0pYY0r2.js";import"./header-tab-button-BOKDj9bu.js";import"./index-BMLWSX3S.js";import"./user-BLD1kA1s.js";import"./tools-list-DJunsBR9.js";import"./switch-CFZgZOoT.js";import"./use-debounced-autosave-BYXOYkk-.js";import"./index-C6tCJ6iD.js";import"./search-input-D_Czo7sj.js";import"./use-secrets-ClIBWX3M.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DggLsDzc.js";import"./view-mode-toggle-C-NsBriE.js";import"./select-model-Bgdox0ak.js";import"./use-automations-Cmrz96gF.js";import"./monaco-editor-CLILoFVJ.js";import"./automation-runs-C1x-2avW.js";import"./table-DRy0atlv.js";import"./use-members-Ch8rP11v.js";import"./automation-list-row-BS580Xxk.js";import"./calendar-CVM_PlWs.js";import"./image-field-B-axyZ2P.js";import"./use-file-configs-DZ1IbDAN.js";function eo(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{eo as AppEditor};
@@ -1 +1 @@
1
- import{cE as v,cF as $,cG as W,cH as L,cI as H,cJ as D,cK as V,cL as x,cM as q,cN as j,cO as y,cP as N,cQ as B,cR as F,cS as Z}from"./index-DJxRbue6.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
1
+ import{cE as v,cF as $,cG as W,cH as L,cI as H,cJ as D,cK as V,cL as x,cM as q,cN as j,cO as y,cP as N,cQ as B,cR as F,cS as Z}from"./index-CiybtfLu.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
@@ -1 +1 @@
1
- import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-DJxRbue6.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
1
+ import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-CiybtfLu.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
@@ -1 +1 @@
1
- import{e as o,j as i}from"./index-DJxRbue6.js";function f(r){const e=o.c(9),{children:n,visual:c}=r;let l;e[0]!==n?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:n})}),e[0]=n,e[1]=l):l=e[1];let s;e[2]!==c?(s=c??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=c,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
1
+ import{e as o,j as i}from"./index-CiybtfLu.js";function f(r){const e=o.c(9),{children:n,visual:c}=r;let l;e[0]!==n?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:n})}),e[0]=n,e[1]=l):l=e[1];let s;e[2]!==c?(s=c??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=c,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
@@ -1 +1 @@
1
- import{e as E,r as F,c as $,j as t,B as K}from"./index-DJxRbue6.js";import{b as O,d as B,e as I,g as L,c as H,f as V,a as q,A as G}from"./alert-dialog-DQCfLTeL.js";import{a as J,D as Q,b as U,c as W}from"./dropdown-menu-BPajkRHT.js";import{A as X,R as Y}from"./agent-icon-iCRxqonQ.js";import{i as Z}from"./DotsVertical-Bqz0rpkg.js";import{s as ee}from"./Trash01-HFZG34bv.js";import{i as te}from"./Zap-4WoTcb5S.js";import{u as se}from"./use-virtual-mcp-CsBEf_ak.js";import{u as ne}from"./use-automations-BFkAWLBs.js";function pe(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=se(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const R=A,T=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==T?(c=$("inline-block size-2 rounded-full shrink-0",T),e[5]=T,e[6]=c):c=e[6];const M=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==M?(m=t.jsx("span",{className:c,"aria-label":M}),e[7]=c,e[8]=M,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(X,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Z,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(ee,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==R||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:R,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=R,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{pe as A};
1
+ import{e as E,r as F,c as $,j as t,B as K}from"./index-CiybtfLu.js";import{b as O,d as B,e as I,g as L,c as H,f as V,a as q,A as G}from"./alert-dialog-ZJsAqfzl.js";import{a as J,D as Q,b as U,c as W}from"./dropdown-menu-FYqDJehF.js";import{A as X,R as Y}from"./agent-icon-CkXhv6DR.js";import{i as Z}from"./DotsVertical-CNRvkzVu.js";import{s as ee}from"./Trash01-mLRbM1z9.js";import{i as te}from"./Zap-DqD6AduN.js";import{u as se}from"./use-virtual-mcp-BsZRrdSO.js";import{u as ne}from"./use-automations-Cmrz96gF.js";function pe(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=se(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const R=A,T=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==T?(c=$("inline-block size-2 rounded-full shrink-0",T),e[5]=T,e[6]=c):c=e[6];const M=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==M?(m=t.jsx("span",{className:c,"aria-label":M}),e[7]=c,e[8]=M,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(X,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Z,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(ee,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==R||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:R,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=R,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{pe as A};