decocms 4.88.1 → 4.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-Cw9yCE-i.js → AlertCircle-B0URQgGd.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BGspeNOh.js → AreaChart-Dx-hGqfv.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-DPdPikqD.js → ArrowUp-CcPNkpAT.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CP6scA3R.js → ArrowUpRight-D2bw5Lw6.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-DIW-Nhbw.js → CheckCircle-o2uf3wpa.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CL2bRCzf.js → ChevronDown-BNIjPnvj.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DjftMIpm.js → ChevronRight-BojPmzaA.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-KOrd5cUU.js → ChevronUp-PvPV8lxF.js} +1 -1
  9. package/dist/client/assets/{Copy01-CKNWZcLl.js → Copy01-BTRY-XwC.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DHGQKJQ3.js → DotsVertical-BHzrfCsv.js} +1 -1
  11. package/dist/client/assets/{Eye-C3frWI7b.js → Eye-TQRrToj1.js} +1 -1
  12. package/dist/client/assets/{FilterLines-BVmVR75h.js → FilterLines-DN6zcl6c.js} +1 -1
  13. package/dist/client/assets/{Globe01-D20i-VXn.js → Globe01-B92n43Uc.js} +1 -1
  14. package/dist/client/assets/{Globe04-CjF1XOfq.js → Globe04-D7iKFord.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Dzd4xRuN.js → HardDrive-DCmES8wO.js} +1 -1
  16. package/dist/client/assets/{Image01-Cia_sV5k.js → Image01-BAtXWLly.js} +1 -1
  17. package/dist/client/assets/{Key01-Bez2UiK4.js → Key01-1cVYuGX5.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-8SPosLnY.js → LayoutLeft-BwOz9Bsk.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-Ce7rLmFL.js → LinkExternal01-C8ysKQ12.js} +1 -1
  20. package/dist/client/assets/{Monitor01-nDZ8jgXm.js → Monitor01-CxqZxGb9.js} +1 -1
  21. package/dist/client/assets/{Package-B69RiVVU.js → Package-CbSVYZzS.js} +1 -1
  22. package/dist/client/assets/{Palette-C7KCkCoB.js → Palette-D8YZNJjv.js} +1 -1
  23. package/dist/client/assets/{Play-DXq0O4lB.js → Play-8-8n1yTh.js} +1 -1
  24. package/dist/client/assets/{Plus-ByMs73Uz.js → Plus-DU0xlr3N.js} +1 -1
  25. package/dist/client/assets/{SearchLg-AMecrvAq.js → SearchLg-DAhqRaHb.js} +1 -1
  26. package/dist/client/assets/{SearchMd-DSp0OYrz.js → SearchMd-B2yxnQNH.js} +1 -1
  27. package/dist/client/assets/{Settings02-CqKjAMaI.js → Settings02-DuZTT6Bi.js} +1 -1
  28. package/dist/client/assets/{Shield01-e85cxIie.js → Shield01-xQBpc_L5.js} +1 -1
  29. package/dist/client/assets/{Star01-CBhs-Q0y.js → Star01-CqU1Oqdx.js} +1 -1
  30. package/dist/client/assets/{Stars01-DgTAPZ52.js → Stars01-CrKz3LKP.js} +1 -1
  31. package/dist/client/assets/{Stars02-OCXqKqaD.js → Stars02-CBeuyfLt.js} +1 -1
  32. package/dist/client/assets/{Sun-jFQ8ORpO.js → Sun--xZWnTaM.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-BvaC-pRG.js → SwitchHorizontal01-eo8rqjTs.js} +1 -1
  34. package/dist/client/assets/{Tool01-Ejks2s80.js → Tool01-DPJl1z7j.js} +1 -1
  35. package/dist/client/assets/{Tool02-BiN5KVxd.js → Tool02-CBUPoyp_.js} +1 -1
  36. package/dist/client/assets/{Trash01-C_k41k5y.js → Trash01-CIV6X3VS.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-C_w4PRID.js → TrendUp01-BPLw8NRL.js} +1 -1
  38. package/dist/client/assets/{Upload01-92Zf66CI.js → Upload01-BTji0mxL.js} +1 -1
  39. package/dist/client/assets/{User01-Gffdi4XN.js → User01-CHz378m6.js} +1 -1
  40. package/dist/client/assets/{Users01-DxScEBVx.js → Users01-A7f5XOKL.js} +1 -1
  41. package/dist/client/assets/{Users03--WwVmO_e.js → Users03-Cptqh2Hn.js} +1 -1
  42. package/dist/client/assets/{X-Dm89h948.js → X-DoMMsRYG.js} +1 -1
  43. package/dist/client/assets/{XCircle-DM1bOn1E.js → XCircle-Br99XnAD.js} +1 -1
  44. package/dist/client/assets/{XClose-CO6cCLh6.js → XClose-By06I_bu.js} +1 -1
  45. package/dist/client/assets/{Zap-C08_643H.js → Zap-DsNmjI7C.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-CCwjZmp5.js → ZapSquare-Dq1V7J01.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-l5IPvWBR.js → ZoomOut-CqtPRrPx.js} +1 -1
  48. package/dist/client/assets/{access-gate-DGQ4SGrz.js → access-gate-DlQZ0dUP.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-D4Yh_quX.js → add-section-modal-EIdXf0Xu.js} +1 -1
  50. package/dist/client/assets/{agent-icon-zLkP0kYm.js → agent-icon-D8Fm5tYm.js} +1 -1
  51. package/dist/client/assets/{agents-list-Ltduha4F.js → agents-list-Dg7zR092.js} +1 -1
  52. package/dist/client/assets/ai-providers-C_Bg3HCA.js +1 -0
  53. package/dist/client/assets/{alert-C7hhQqYr.js → alert-CC1_oXQl.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-UUhdQgPz.js → alert-dialog-BffhJ_7p.js} +1 -1
  55. package/dist/client/assets/app-editor-CgYm4eVL.js +1 -0
  56. package/dist/client/assets/{auth-DQ_oeIMX.js → auth-B4mBZTYm.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-D7qFKmId.js → auth-catchall-DSSyXNZA.js} +1 -1
  58. package/dist/client/assets/{auth-entry-CPz8l15k.js → auth-entry-i4kd-NkP.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-BKZuW1of.js → auth-split-layout-DtETNpSL.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-DJatC_RM.js → authenticate-and-persist-oauth-Dpw3eku0.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-DcApL42P.js → automation-list-row-DeDkjOYB.js} +1 -1
  62. package/dist/client/assets/{automation-runs-Blj-pvUz.js → automation-runs-s8c1tWRE.js} +1 -1
  63. package/dist/client/assets/automations-D1pnwL1M.js +1 -0
  64. package/dist/client/assets/{autosend-DKCVt8HQ.js → autosend-nd6NfSt7.js} +1 -1
  65. package/dist/client/assets/{avatar-KoDyzfrm.js → avatar-Cxj-66ni.js} +1 -1
  66. package/dist/client/assets/{badge-T4AA6iZX.js → badge-DSyzmApw.js} +1 -1
  67. package/dist/client/assets/{block-document-DUuxGWOb.js → block-document-DXMHDTlQ.js} +1 -1
  68. package/dist/client/assets/brand-context-BcnkoR0d.js +1 -0
  69. package/dist/client/assets/buckets-DdBrgyC-.js +1 -0
  70. package/dist/client/assets/{bulk-category-panel-kMA9pAkq.js → bulk-category-panel-BIJpn-iZ.js} +1 -1
  71. package/dist/client/assets/{calendar-CNasvSCO.js → calendar-D1wDIBlL.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DqTvJvx-.js → capability-load-error-B452fzft.js} +1 -1
  73. package/dist/client/assets/{card-CULDlrA-.js → card-D7H9MxP9.js} +1 -1
  74. package/dist/client/assets/category-editor-CSy_jTtu.js +1 -0
  75. package/dist/client/assets/{chat-context-DLYBbFGY.js → chat-context-DcmiS1aH.js} +1 -1
  76. package/dist/client/assets/{checkbox-CCG4Kv9w.js → checkbox-DMjSK8lZ.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-C12GBibd.js → cli-auth-success-B-6g1Tzq.js} +1 -1
  78. package/dist/client/assets/{collection-detail-D7lAjJt0.js → collection-detail-r04peAwE.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-DXYSOviJ.js → collection-display-button-BdQvST7-.js} +1 -1
  80. package/dist/client/assets/{collection-search-DpljgvQ0.js → collection-search-CnfkqC4S.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-DPmE8FB1.js → collection-table-wrapper-CdtevO_0.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-2EQS29Kq.js → collection-tabs-DRIUqH5V.js} +1 -1
  83. package/dist/client/assets/{command-C7p6GqWL.js → command-OhE2G5BR.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-sZ7qbE7Q.js → commerce-onboarding-BBffEECj.js} +1 -1
  85. package/dist/client/assets/{companions-core-DIRKcNLf.js → companions-core-BgnmKH6B.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-BVw0SkEq.js → connect-desktop-dialog-D6xzOtOk.js} +1 -1
  87. package/dist/client/assets/{connection-card-Ds0iY_0G.js → connection-card-BXJkPT-6.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BwYu-bcp.js → connection-detail-DXv_wt3b.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-BRBYCjpo.js → connection-form-helpers-dtgDs3bL.js} +1 -1
  90. package/dist/client/assets/{connections-GV5_TuxU.js → connections-wuzO_CYF.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-eq4h-dhW.js → decopilot-sse-pool-Do0EBPg6.js} +1 -1
  92. package/dist/client/assets/{dialog-C5eQfWDF.js → dialog-DV6wzW_l.js} +1 -1
  93. package/dist/client/assets/domain-settings-CoV3rLv2.js +1 -0
  94. package/dist/client/assets/{drawer-Cpzxp9wL.js → drawer-BMeTlfMj.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-Dqv0OT41.js → dropdown-menu-C_gaW3LP.js} +1 -1
  96. package/dist/client/assets/{empty-state-B8oQuoho.js → empty-state-r3Ua2HeC.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-kMalwUxf.js → extract-connection-data-BFYmcR-x.js} +1 -1
  98. package/dist/client/assets/file-explorer-BbUwC6n6.js +2 -0
  99. package/dist/client/assets/{file-type-icon-T2F6oe7X.js → file-type-icon-v-Z0agLN.js} +1 -1
  100. package/dist/client/assets/{files-CCmIFK7b.js → files-CqB5MsDt.js} +1 -1
  101. package/dist/client/assets/{form-qbWegHOz.js → form-Bf1mCLCM.js} +1 -1
  102. package/dist/client/assets/general-C-02zJNf.js +1 -0
  103. package/dist/client/assets/{github-repo-picker-CotWNM2U.js → github-repo-picker-Wq9R0m-7.js} +1 -1
  104. package/dist/client/assets/{hooks-DBIIPHrB.js → hooks-DzO3IVwA.js} +1 -1
  105. package/dist/client/assets/{index-Da0YwmTS.js → index--9j6P9bM.js} +1 -1
  106. package/dist/client/assets/{index-BxSnvyHv.js → index-8s5nz1GZ.js} +3 -3
  107. package/dist/client/assets/{index-1JFGXVx9.js → index-B3nGIiNR.js} +1 -1
  108. package/dist/client/assets/{index-DlBEt0M3.js → index-BTK5hGZP.js} +1 -1
  109. package/dist/client/assets/{index-LlJCcbAi.js → index-BoqZq5yc.js} +1 -1
  110. package/dist/client/assets/{index-G2XxP8mO.js → index-BpKHjnpA.js} +1 -1
  111. package/dist/client/assets/{index-CAkUz10B.js → index-BsWyF3Nu.js} +2 -2
  112. package/dist/client/assets/{index-DhHvNH6W.js → index-Bu-YK2jZ.js} +1 -1
  113. package/dist/client/assets/{index-CGYl8LK_.js → index-D3VfQcL7.js} +1 -1
  114. package/dist/client/assets/{index-DZov7Yy3.js → index-DVSaKuSk.js} +1 -1
  115. package/dist/client/assets/{index-DiEozSEq.js → index-SWTxJVo3.js} +1 -1
  116. package/dist/client/assets/{index-BziUXGPc.js → index-ZxxPztil.js} +1 -1
  117. package/dist/client/assets/{index-Bq43shHN.js → index-e4E7qYRG.js} +5 -5
  118. package/dist/client/assets/{index-redirect-DFGyHM8x.js → index-redirect-QI5CM6GE.js} +1 -1
  119. package/dist/client/assets/{index-DvXbpAz5.js → index-tfZhXx_G.js} +1 -1
  120. package/dist/client/assets/{input-CwmyLALb.js → input-DdvT4oFx.js} +1 -1
  121. package/dist/client/assets/{integration-icon-D_JGFNsU.js → integration-icon-DRWJ2a2r.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-CL4XfzHy.js → invite-member-dialog-CBlNb3mw.js} +1 -1
  123. package/dist/client/assets/{label-CoWA5D5R.js → label-NOuCbhAn.js} +1 -1
  124. package/dist/client/assets/{layout-twNaIuEe.js → layout-BejZT_vF.js} +1 -1
  125. package/dist/client/assets/{login-CQeTdRky.js → login-BDEQQcKA.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-B9BkzrVi.js → mcp-oauth-D5MXhCB5.js} +1 -1
  127. package/dist/client/assets/members-DPYJQ0wF.js +1 -0
  128. package/dist/client/assets/{monaco-editor-Cto580m0.js → monaco-editor-CQbHR17m.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-UDe2k4nG.js → monitoring-stats-row-BtTrEMmS.js} +1 -1
  130. package/dist/client/assets/{multi-select-DIDFf8ZU.js → multi-select-DQRzD5eQ.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-CfPMd-jC.js → oauth-callback-B_ZDwcVk.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-CtEbIQW7.js → oauth-callback-ai-provider-Dm1OXo7k.js} +1 -1
  133. package/dist/client/assets/{onboarding-BvqmYRe-.js → onboarding-TrjwvrBw.js} +1 -1
  134. package/dist/client/assets/{org-install-CaXg9Vs9.js → org-install-P7AxoLR8.js} +1 -1
  135. package/dist/client/assets/{org-layout-B0FCORam.js → org-layout-BwVftCmQ.js} +1 -1
  136. package/dist/client/assets/{organization-choice-D_CQ-5rJ.js → organization-choice-Dsn24fVB.js} +1 -1
  137. package/dist/client/assets/{orgs-yOlxgoBQ.js → orgs-CN9Puf3O.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-ByRH8pNm.js → page-seo-form-AWATSby2.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-C--QscJo.js +1 -0
  140. package/dist/client/assets/{popover-Y0QG9sOo.js → popover-CAhKlVf9.js} +1 -1
  141. package/dist/client/assets/post-editor-Csgf7ki7.js +1 -0
  142. package/dist/client/assets/{primitives-FU9AMNO1.js → primitives-CX-hU7KU.js} +1 -1
  143. package/dist/client/assets/{profile-O968tSGR.js → profile-BEkaz-GQ.js} +1 -1
  144. package/dist/client/assets/project-app-view-wVhZVQFC.js +1 -0
  145. package/dist/client/assets/record-editor-CR_f_LeJ.js +1 -0
  146. package/dist/client/assets/redirect-editor-vlgwE56S.js +1 -0
  147. package/dist/client/assets/registry-B7Fw5COb.js +2 -0
  148. package/dist/client/assets/{registry-layout-BgDKIGtK.js → registry-layout-Dn15kyZf.js} +1 -1
  149. package/dist/client/assets/{reports-lqkkraSe.js → reports-DI6BcSyM.js} +1 -1
  150. package/dist/client/assets/{require-capability-C97tWNuh.js → require-capability-DN-a_DIB.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-_kPKrPAQ.js → required-auth-layout-DN4Wjshy.js} +1 -1
  152. package/dist/client/assets/{reset-password--6_ky4G0.js → reset-password-CDOtqEeQ.js} +1 -1
  153. package/dist/client/assets/roles-PrOPvs2-.js +1 -0
  154. package/dist/client/assets/{search-input-BiyJOa18.js → search-input-alvUaxMK.js} +1 -1
  155. package/dist/client/assets/secrets--y-HaPrF.js +1 -0
  156. package/dist/client/assets/{sections-editor-DGzBaEY9.js → sections-editor-qn31Ya7F.js} +2 -2
  157. package/dist/client/assets/{select-CIhUgwRQ.js → select-XCaY2RuM.js} +1 -1
  158. package/dist/client/assets/select-model-B5tydj-K.js +4 -0
  159. package/dist/client/assets/{self-tool-result-Bzxf7oXS.js → self-tool-result-BlSax-kV.js} +1 -1
  160. package/dist/client/assets/seo-editor-qL1Whfxr.js +1 -0
  161. package/dist/client/assets/{settings-layout-DMukmb03.js → settings-layout-Ckn5w25R.js} +1 -1
  162. package/dist/client/assets/{settings-section-DdXoByAD.js → settings-section-jGSJ0WMF.js} +1 -1
  163. package/dist/client/assets/{shell-controls-LG7-t4UY.js → shell-controls-BVJWCW3Y.js} +1 -1
  164. package/dist/client/assets/{shell-layout-BeX__GCn.js → shell-layout-BGwalXGU.js} +1 -1
  165. package/dist/client/assets/{sidebar-BAnGqNSt.js → sidebar-DJyr4LaE.js} +1 -1
  166. package/dist/client/assets/{skeleton-BIGkqEfs.js → skeleton-CPQ2mAgV.js} +1 -1
  167. package/dist/client/assets/sso-DM_JX1px.js +1 -0
  168. package/dist/client/assets/store-CAG21TlC.js +1 -0
  169. package/dist/client/assets/store-registry-Wn5jXeQ0.js +2 -0
  170. package/dist/client/assets/{studio-tools-Gw5yCtO3.js → studio-tools-bpvT2WVs.js} +1 -1
  171. package/dist/client/assets/{switch-BETtm1AS.js → switch-uvTTYTZa.js} +1 -1
  172. package/dist/client/assets/{table-BZqvj0A3.js → table-BAl0-wJs.js} +1 -1
  173. package/dist/client/assets/{tabs-BSSXntdl.js → tabs-Cna1qPC4.js} +1 -1
  174. package/dist/client/assets/{textarea-DP6Y400s.js → textarea-DuNE-Cm2.js} +1 -1
  175. package/dist/client/assets/{toggle-group-BSOhlYof.js → toggle-group-BesyXd7e.js} +1 -1
  176. package/dist/client/assets/{toolbar-Bw6tqp6s.js → toolbar-1EZfYNtV.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-C-dw2Lfg.js → toolbar-icon-button-Ds2YleaT.js} +1 -1
  178. package/dist/client/assets/{tooltip-D_SCaRHR.js → tooltip-BEYSB6_U.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-gqMxKR3J.js → use-ai-providers-CMVm57gp.js} +1 -1
  180. package/dist/client/assets/{use-automations-zhPgS02n.js → use-automations-CDQHZlaz.js} +1 -1
  181. package/dist/client/assets/{use-autosave-BPR--127.js → use-autosave-BDtDtAGq.js} +1 -1
  182. package/dist/client/assets/{use-capability-Bbp5deR3.js → use-capability-BO7tWRH0.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-DqIRxBts.js → use-clock-tick-ZW6OdOh-.js} +1 -1
  184. package/dist/client/assets/{use-collections-cc44LDcT.js → use-collections-DzQsQfCo.js} +1 -1
  185. package/dist/client/assets/{use-connection-Bo9HSDdo.js → use-connection-C8o3isYh.js} +1 -1
  186. package/dist/client/assets/{use-copy-Bwq9iT6j.js → use-copy-BcbxJz1l.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DphbIpFE.js → use-create-virtual-mcp-C5LGKLfr.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-vVyhbsS1.js → use-debounced-autosave-CYrhre1r.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-N9yCJGMl.js → use-debounced-value-DkdwFP-N.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits--FMRQZFv.js → use-deco-credits-D4soViX_.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-Bbm0n_Gq.js → use-decopilot-events-Brp2zRko.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-DnNOpnZ8.js → use-delete-connection-BRVf1fw-.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-DrpJfIKm.js → use-deployment-admin-Br8h7Bky.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-DNP4fmsa.js → use-file-configs-DiCpgKMc.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-CLiYEPeK.js → use-infinite-scroll-BlCvGIWj.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-CSsL5DRH.js → use-join-requests-HaKUFXXR.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-any-Ikex.js → use-mcp-auth-status-CndpvL7p.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-CGa1apHd.js → use-mcp-client-12oCENzi.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-e5Fx1vBw.js → use-mcp-tools-DnE0k3F3.js} +1 -1
  200. package/dist/client/assets/{use-members-BPzeTa5z.js → use-members-nBm0U6j8.js} +1 -1
  201. package/dist/client/assets/{use-mobile-urLns8jv.js → use-mobile-DayAwrkC.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-BWsiJtGE.js → use-navigate-to-agent-BsFkQXFv.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-BIIiixyg.js → use-org-auth-client-DZCRi5OY.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-DGqnPPs0.js → use-org-sso-Dd-6OVA0.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-CRvosx9g.js → use-organization-roles--YSPaHir.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-DL7ydVzg.js → use-organization-settings-CncY7EWt.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-BkS8-5ui.js → use-registry-app-B-Mbm9QR.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-DYbptSiR.js → use-registry-connections-DgBLdllo.js} +1 -1
  209. package/dist/client/assets/{use-secrets-Duv1Im0X.js → use-secrets-BVFAq9nK.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-C7tWsLM_.js → use-status-sounds-CnGuhDhm.js} +1 -1
  211. package/dist/client/assets/use-t-99c5H7RN.js +1 -0
  212. package/dist/client/assets/{use-view-mode-HPknXsbN.js → use-view-mode-_OQdnLwY.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BZrpfr1k.js → use-virtual-mcp-C-ISLlF9.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-BqEB_u0b.js +1 -0
  215. package/dist/client/assets/{useRouterState-BCtkdXDc.js → useRouterState-_dw9xY9x.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-DflSaD8l.js +1 -0
  217. package/dist/client/assets/{users-DH6YLrmH.js → users-CsUVCZWg.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-C4tkC6bx.js → variant-calendar-XRZpiPfb.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-BywuQzDT.js → view-mode-toggle-VqwSnJy7.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +1 -1
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/ai-providers-BMvAA9Vs.js +0 -1
  225. package/dist/client/assets/app-editor-sJSQ3qrv.js +0 -1
  226. package/dist/client/assets/automations-CuHA0Wni.js +0 -1
  227. package/dist/client/assets/brand-context-2fi7i-NQ.js +0 -1
  228. package/dist/client/assets/buckets-D7jxlt9L.js +0 -1
  229. package/dist/client/assets/category-editor-9ZlRSzAp.js +0 -1
  230. package/dist/client/assets/domain-settings-C2rAlgtI.js +0 -1
  231. package/dist/client/assets/file-explorer-C4Z_rQYH.js +0 -2
  232. package/dist/client/assets/general-DRAv1lV_.js +0 -1
  233. package/dist/client/assets/members-STkp86FP.js +0 -1
  234. package/dist/client/assets/page-seo-sheet-DWsLnwfK.js +0 -1
  235. package/dist/client/assets/post-editor-BpEjxgMo.js +0 -1
  236. package/dist/client/assets/project-app-view-BmS-SfEe.js +0 -1
  237. package/dist/client/assets/record-editor-BlPK-bqd.js +0 -1
  238. package/dist/client/assets/redirect-editor-DXE6Parr.js +0 -1
  239. package/dist/client/assets/registry-D55PCU48.js +0 -2
  240. package/dist/client/assets/roles-Lv4Zi4Tt.js +0 -1
  241. package/dist/client/assets/secrets-gyeDGOFy.js +0 -1
  242. package/dist/client/assets/select-model-2pm5halu.js +0 -4
  243. package/dist/client/assets/seo-editor-vovQVgpa.js +0 -1
  244. package/dist/client/assets/sso-2swZRQFT.js +0 -1
  245. package/dist/client/assets/store-DqcNgRzD.js +0 -1
  246. package/dist/client/assets/store-registry-Df0wEGhJ.js +0 -2
  247. package/dist/client/assets/use-t-KghRfCES.js +0 -1
  248. package/dist/client/assets/useInfiniteQuery-CVpcf-iZ.js +0 -1
  249. package/dist/client/assets/useSuspenseInfiniteQuery-hZ6Deicm.js +0 -1
@@ -1 +0,0 @@
1
- import{c as Y,j as t,B as le}from"./index-BxSnvyHv.js";import{i as ae}from"./AlertCircle-Cw9yCE-i.js";import{n as me}from"./LinkExternal01-Ce7rLmFL.js";import{aL as pe,h as ne}from"./agent-icon-zLkP0kYm.js";import{I as te}from"./input-CwmyLALb.js";import{L as X}from"./label-CoWA5D5R.js";import{M as ce}from"./multi-select-DIDFf8ZU.js";import{b as ie,c as de,T as se,a as fe}from"./tabs-BSSXntdl.js";import{T as ue}from"./textarea-DP6Y400s.js";import{v as xe,w as he,x as ge,o as ve,y as je,z as be,I as ye,A as Ce,B as Ne,C as ke}from"./index-Bq43shHN.js";import{b as Se,T as Pe,a as we}from"./tooltip-D_SCaRHR.js";import{b as _e,a as Be,B as Te}from"./block-document-DUuxGWOb.js";import{u as Ee}from"./use-autosave-BPR--127.js";import{s as T,E as Fe,R as Re,A as Ae}from"./primitives-FU9AMNO1.js";import"./Tool01-Ejks2s80.js";import"./ArrowUp-DPdPikqD.js";import"./Settings02-CqKjAMaI.js";import"./Tool02-BiN5KVxd.js";import"./XCircle-DM1bOn1E.js";import"./ArrowUpRight-CP6scA3R.js";import"./TrendUp01-C_w4PRID.js";import"./ZapSquare-CCwjZmp5.js";import"./ZoomOut-l5IPvWBR.js";import"./Users03--WwVmO_e.js";import"./CheckCircle-DIW-Nhbw.js";import"./ChevronUp-KOrd5cUU.js";import"./ChevronDown-CL2bRCzf.js";import"./ChevronRight-DjftMIpm.js";import"./DotsVertical-DHGQKJQ3.js";import"./Stars02-OCXqKqaD.js";import"./Copy01-CKNWZcLl.js";import"./Globe01-D20i-VXn.js";import"./Eye-C3frWI7b.js";import"./FilterLines-BVmVR75h.js";import"./Star01-CBhs-Q0y.js";import"./Globe04-CjF1XOfq.js";import"./SwitchHorizontal01-BvaC-pRG.js";import"./HardDrive-Dzd4xRuN.js";import"./Image01-Cia_sV5k.js";import"./Key01-Bez2UiK4.js";import"./LayoutLeft-8SPosLnY.js";import"./Monitor01-nDZ8jgXm.js";import"./Sun-jFQ8ORpO.js";import"./Package-B69RiVVU.js";import"./Palette-C7KCkCoB.js";import"./Play-DXq0O4lB.js";import"./Plus-ByMs73Uz.js";import"./SearchLg-AMecrvAq.js";import"./SearchMd-DSp0OYrz.js";import"./Shield01-e85cxIie.js";import"./Stars01-DgTAPZ52.js";import"./Trash01-C_k41k5y.js";import"./Upload01-92Zf66CI.js";import"./User01-Gffdi4XN.js";import"./Users01-DxScEBVx.js";import"./XClose-CO6cCLh6.js";import"./X-Dm89h948.js";import"./Zap-C08_643H.js";import"./badge-T4AA6iZX.js";import"./checkbox-CCG4Kv9w.js";import"./command-C7p6GqWL.js";import"./index-LlJCcbAi.js";import"./dialog-C5eQfWDF.js";import"./popover-Y0QG9sOo.js";import"./chat-context-DLYBbFGY.js";import"./autosend-DKCVt8HQ.js";import"./hooks-DBIIPHrB.js";import"./use-mcp-client-CGa1apHd.js";import"./auth-DQ_oeIMX.js";import"./decopilot-sse-pool-eq4h-dhW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Gw5yCtO3.js";import"./use-virtual-mcp-BZrpfr1k.js";import"./use-collections-cc44LDcT.js";import"./use-ai-providers-gqMxKR3J.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-Bbm0n_Gq.js";import"./use-organization-settings-DL7ydVzg.js";import"./automation-runs-Blj-pvUz.js";import"./select-CIhUgwRQ.js";import"./useInfiniteQuery-CVpcf-iZ.js";import"./use-infinite-scroll-CLiYEPeK.js";import"./use-connection-Bo9HSDdo.js";import"./card-CULDlrA-.js";import"./sidebar-BAnGqNSt.js";import"./use-mobile-urLns8jv.js";import"./table-BZqvj0A3.js";import"./empty-state-B8oQuoho.js";import"./use-members-BPzeTa5z.js";import"./use-org-auth-client-BIIiixyg.js";import"./use-clock-tick-DqIRxBts.js";import"./use-automations-zhPgS02n.js";import"./useSuspenseInfiniteQuery-hZ6Deicm.js";import"./avatar-KoDyzfrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwq9iT6j.js";import"./file-type-icon-T2F6oe7X.js";import"./monaco-editor-Cto580m0.js";import"./index-Da0YwmTS.js";import"./index-DhHvNH6W.js";import"./calendar-CNasvSCO.js";import"./shell-layout-BeX__GCn.js";import"./required-auth-layout-_kPKrPAQ.js";import"./use-org-sso-DGqnPPs0.js";import"./integration-icon-D_JGFNsU.js";import"./use-navigate-to-agent-BWsiJtGE.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BGspeNOh.js";import"./form-qbWegHOz.js";import"./drawer-Cpzxp9wL.js";import"./collection-search-DpljgvQ0.js";import"./index-CAkUz10B.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-BkS8-5ui.js";import"./use-mcp-tools-e5Fx1vBw.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DJatC_RM.js";import"./mcp-oauth-B9BkzrVi.js";import"./extract-connection-data-kMalwUxf.js";import"./dropdown-menu-Dqv0OT41.js";import"./companions-core-DIRKcNLf.js";import"./toggle-group-BSOhlYof.js";import"./use-deco-credits--FMRQZFv.js";import"./connection-card-Ds0iY_0G.js";import"./use-registry-connections-DYbptSiR.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-form-helpers-BRBYCjpo.js";import"./collection-tabs-2EQS29Kq.js";import"./connect-desktop-dialog-BVw0SkEq.js";import"./select-model-2pm5halu.js";import"./skeleton-BIGkqEfs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DdXoByAD.js";import"./index-DlBEt0M3.js";import"./alert-dialog-UUhdQgPz.js";import"./toolbar-Bw6tqp6s.js";import"./use-debounced-value-N9yCJGMl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C7tWsLM_.js";import"./use-capability-Bbp5deR3.js";import"./toolbar-icon-button-C-dw2Lfg.js";import"./use-debounced-autosave-vVyhbsS1.js";import"./index-CGYl8LK_.js";import"./search-input-BiyJOa18.js";import"./use-mcp-auth-status-any-Ikex.js";import"./switch-BETtm1AS.js";import"./github-repo-picker-CotWNM2U.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-Duv1Im0X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-DNP4fmsa.js";import"./automation-list-row-DcApL42P.js";function Le(j){return Array.isArray(j)?j.map(e=>({key:T(e?.key),value:T(e?.value)})):[]}function As(j){const e=Y.c(82),{orgSlug:s,virtualMcpId:r,branch:i,blockKey:f,block:m,decofile:a,meta:c,previewBaseUrl:h}=j;let x;e[0]!==i||e[1]!==s||e[2]!==r?(x={orgSlug:s,virtualMcpId:r,branch:i},e[0]=i,e[1]=s,e[2]=r,e[3]=x):x=e[3];const l=xe(x);let p;e[4]!==m?(p=he(m,"posts"),e[4]=m,e[5]=p):p=e[5];const d=p;let n;e[6]!==f||e[7]!==l?(n=E=>{l.mutate({blockKey:f,data:je(f,"posts",be(E))})},e[6]=f,e[7]=l,e[8]=n):n=e[8];const[o,N]=Ee(d,n);let k;e[9]!==o||e[10]!==N?(k=(E,re)=>N({...o,[E]:re}),e[9]=o,e[10]=N,e[11]=k):k=e[11];const b=k;let S;e[12]!==a||e[13]!==o||e[14]!==h?(S=_e({decofile:a,post:o,previewBaseUrl:h}),e[12]=a,e[13]=o,e[14]=h,e[15]=S):S=e[15];const y=S;let g,v,P,w;e[16]!==o?(v=ge(o),g=v.length>0,P=v.length===1?"field":"fields",w=v.join(", "),e[16]=o,e[17]=g,e[18]=v,e[19]=P,e[20]=w):(g=e[17],v=e[18],P=e[19],w=e[20]);const _=`Missing required ${P}: ${w}`;let C;e[21]!==o.title?(C=T(o.title)||"Untitled post",e[21]=o.title,e[22]=C):C=e[22];let B;e[23]!==C?(B=t.jsx("span",{className:"truncate text-sm font-medium",children:C}),e[23]=C,e[24]=B):B=e[24];let u;e[25]!==g||e[26]!==v||e[27]!==_?(u=g&&t.jsxs(Se,{children:[t.jsx(Pe,{asChild:!0,children:t.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-medium text-destructive",children:[t.jsx(ae,{size:14}),v.length," ",v.length===1?"issue":"issues"]})}),t.jsx(we,{side:"bottom",children:_})]}),e[25]=g,e[26]=v,e[27]=_,e[28]=u):u=e[28];let F;e[29]!==l.isError||e[30]!==l.isPending?(F=t.jsx(ve,{isPending:l.isPending,isError:l.isError}),e[29]=l.isError,e[30]=l.isPending,e[31]=F):F=e[31];const Z=!y||g,ee=g?_:y?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let R;e[32]!==g||e[33]!==y?(R=()=>{y&&!g&&window.open(y,"_blank","noopener,noreferrer")},e[32]=g,e[33]=y,e[34]=R):R=e[34];let H;e[35]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(me,{size:14}),e[35]=H):H=e[35];let A;e[36]!==Z||e[37]!==ee||e[38]!==R?(A=t.jsxs(le,{type:"button",variant:"outline",size:"sm",disabled:Z,title:ee,onClick:R,children:[H,"See preview"]}),e[36]=Z,e[37]=ee,e[38]=R,e[39]=A):A=e[39];let L;e[40]!==u||e[41]!==F||e[42]!==A?(L=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[u,F,A]}),e[40]=u,e[41]=F,e[42]=A,e[43]=L):L=e[43];let $;e[44]!==L||e[45]!==B?($=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[B,L]}),e[44]=L,e[45]=B,e[46]=$):$=e[46];let M;e[47]!==o.title?(M=T(o.title),e[47]=o.title,e[48]=M):M=e[48];let I;e[49]!==b?(I=E=>b("title",E),e[49]=b,e[50]=I):I=e[50];let U;e[51]!==M||e[52]!==I?(U=t.jsx(Fe,{value:M,onChange:I,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[51]=M,e[52]=I,e[53]=U):U=e[53];let J;e[54]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsxs(ie,{value:"content",children:[t.jsx(pe,{}),"Content"]}),e[54]=J):J=e[54];let Q;e[55]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsxs(de,{children:[J,t.jsxs(ie,{value:"settings",children:[t.jsx(ne,{}),"Settings"]})]}),e[55]=Q):Q=e[55];let V;e[56]!==o.sections?(V=Be(o.sections),e[56]=o.sections,e[57]=V):V=e[57];let z;e[58]!==b?(z=E=>b("sections",E),e[58]=b,e[59]=z):z=e[59];let D;e[60]!==i||e[61]!==s||e[62]!==r?(D={orgSlug:s,virtualMcpId:r,branch:i},e[60]=i,e[61]=s,e[62]=r,e[63]=D):D=e[63];let q;e[64]!==c||e[65]!==V||e[66]!==z||e[67]!==D?(q=t.jsx(se,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(Te,{value:V,onChange:z,meta:c,sandboxRef:D,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[64]=c,e[65]=V,e[66]=z,e[67]=D,e[68]=q):q=e[68];let K;e[69]!==a||e[70]!==o||e[71]!==b?(K=t.jsx(se,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx($e,{post:o,decofile:a,onChange:b})})}),e[69]=a,e[70]=o,e[71]=b,e[72]=K):K=e[72];let O;e[73]!==q||e[74]!==K?(O=t.jsxs(fe,{defaultValue:"content",className:"mt-6 gap-4",children:[Q,q,K]}),e[73]=q,e[74]=K,e[75]=O):O=e[75];let G;e[76]!==U||e[77]!==O?(G=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[U,O]})}),e[76]=U,e[77]=O,e[78]=G):G=e[78];let W;return e[79]!==$||e[80]!==G?(W=t.jsxs("div",{className:"flex h-full flex-col",children:[$,G]}),e[79]=$,e[80]=G,e[81]=W):W=e[81],W}function $e(j){const e=Y.c(57),{post:s,decofile:r,onChange:i}=j;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(X,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=f):f=e[0];let m;e[1]!==s.excerpt?(m=T(s.excerpt),e[1]=s.excerpt,e[2]=m):m=e[2];let a;e[3]!==i?(a=u=>i("excerpt",u.target.value),e[3]=i,e[4]=a):a=e[4];let c;e[5]!==m||e[6]!==a?(c=t.jsxs("div",{className:"space-y-2",children:[f,t.jsx(ue,{id:"post-excerpt",value:m,onChange:a,rows:2})]}),e[5]=m,e[6]=a,e[7]=c):c=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(X,{htmlFor:"post-slug",children:"Slug"}),e[8]=h):h=e[8];let x;e[9]!==s.slug?(x=T(s.slug),e[9]=s.slug,e[10]=x):x=e[10];let l;e[11]!==i?(l=u=>i("slug",u.target.value),e[11]=i,e[12]=l):l=e[12];let p;e[13]!==x||e[14]!==l?(p=t.jsxs("div",{className:"space-y-2",children:[h,t.jsx(te,{id:"post-slug",value:x,onChange:l,placeholder:"my-post",className:"h-10"})]}),e[13]=x,e[14]=l,e[15]=p):p=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d={type:"string",format:"date",title:"Date"},e[16]=d):d=e[16];let n;e[17]!==s.date?(n=T(s.date),e[17]=s.date,e[18]=n):n=e[18];let o;e[19]!==i?(o=u=>i("date",u),e[19]=i,e[20]=o):o=e[20];let N;e[21]!==n||e[22]!==o?(N=t.jsx(ke,{schema:d,value:n,onChange:o,path:"post-date",label:"Date"}),e[21]=n,e[22]=o,e[23]=N):N=e[23];let k;e[24]!==N||e[25]!==p?(k=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p,N]}),e[24]=N,e[25]=p,e[26]=k):k=e[26];let b;e[27]===Symbol.for("react.memo_cache_sentinel")?(b={type:"string",format:"image-uri",title:"Cover image"},e[27]=b):b=e[27];let S;e[28]!==i?(S=u=>i("image",u),e[28]=i,e[29]=S):S=e[29];let y;e[30]!==s.image||e[31]!==S?(y=t.jsx(ye,{schema:b,value:s.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=s.image,e[31]=S,e[32]=y):y=e[32];let g;e[33]!==i?(g=u=>i("authors",u),e[33]=i,e[34]=g):g=e[34];let v;e[35]!==r||e[36]!==s.authors||e[37]!==g?(v=t.jsx(oe,{label:"Authors",decofile:r,kind:"authors",valueField:"email",toRef:Ie,selected:s.authors,onChange:g}),e[35]=r,e[36]=s.authors,e[37]=g,e[38]=v):v=e[38];let P;e[39]!==i?(P=u=>i("categories",u),e[39]=i,e[40]=P):P=e[40];let w;e[41]!==r||e[42]!==s.categories||e[43]!==P?(w=t.jsx(oe,{label:"Categories",decofile:r,kind:"categories",valueField:"slug",toRef:Me,selected:s.categories,onChange:P}),e[41]=r,e[42]=s.categories,e[43]=P,e[44]=w):w=e[44];let _;e[45]!==i?(_=u=>i("extraProps",u),e[45]=i,e[46]=_):_=e[46];let C;e[47]!==s.extraProps||e[48]!==_?(C=t.jsx(Ue,{value:s.extraProps,onChange:_}),e[47]=s.extraProps,e[48]=_,e[49]=C):C=e[49];let B;return e[50]!==k||e[51]!==y||e[52]!==v||e[53]!==w||e[54]!==C||e[55]!==c?(B=t.jsxs("div",{className:"space-y-5",children:[c,k,y,v,w,C]}),e[50]=k,e[51]=y,e[52]=v,e[53]=w,e[54]=C,e[55]=c,e[56]=B):B=e[56],B}function Me(j){return{name:T(j.name),slug:T(j.slug)}}function Ie(j){return{...j}}function Ue(j){const e=Y.c(15),{value:s,onChange:r}=j;let i,f,m,a;if(e[0]!==r||e[1]!==s){i=Le(s);const x=(l,p)=>r(i.map((d,n)=>n===l?{...d,...p}:d));f="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(X,{children:"Extra props"}),e[6]=m):m=e[6],a=i.length>0&&t.jsx("ul",{className:"space-y-2",children:i.map((l,p)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(te,{value:l.key,onChange:d=>x(p,{key:d.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(te,{value:l.value,onChange:d=>x(p,{value:d.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(Re,{label:"Remove prop",onClick:()=>r(i.filter((d,n)=>n!==p))})]},p))}),e[0]=r,e[1]=s,e[2]=i,e[3]=f,e[4]=m,e[5]=a}else i=e[2],f=e[3],m=e[4],a=e[5];let c;e[7]!==i||e[8]!==r?(c=t.jsx(Ae,{label:"Add prop",onClick:()=>r([...i,{key:"",value:""}])}),e[7]=i,e[8]=r,e[9]=c):c=e[9];let h;return e[10]!==f||e[11]!==m||e[12]!==a||e[13]!==c?(h=t.jsxs("div",{className:f,children:[m,a,c]}),e[10]=f,e[11]=m,e[12]=a,e[13]=c,e[14]=h):h=e[14],h}function oe(j){const e=Y.c(17),{label:s,decofile:r,kind:i,valueField:f,toRef:m,selected:a,onChange:c}=j;let h;e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==m||e[4]!==f?(h=Ce({records:Ne(r,i),selected:a,valueField:f,toRef:m}),e[0]=r,e[1]=i,e[2]=a,e[3]=m,e[4]=f,e[5]=h):h=e[5];const{options:x,selectedValues:l,refsForValues:p}=h;let d;e[6]!==s?(d=t.jsx(X,{children:s}),e[6]=s,e[7]=d):d=e[7];let n;e[8]!==s||e[9]!==c||e[10]!==x||e[11]!==p||e[12]!==l?(n=x.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",s.toLowerCase()," yet — create some in the"," ",s.toLowerCase()," collection."]}):t.jsx(ce,{options:x,defaultValue:l,onValueChange:N=>c(p(N)),placeholder:`Select ${s.toLowerCase()}`,maxCount:4}),e[8]=s,e[9]=c,e[10]=x,e[11]=p,e[12]=l,e[13]=n):n=e[13];let o;return e[14]!==d||e[15]!==n?(o=t.jsxs("div",{className:"space-y-2",children:[d,n]}),e[14]=d,e[15]=n,e[16]=o):o=e[16],o}export{As as PostEditor};
@@ -1 +0,0 @@
1
- import{c as L,C as H,j as U}from"./index-BxSnvyHv.js";import{a as O,g as $,s as E}from"./automation-runs-Blj-pvUz.js";import{r as k,u as B}from"./use-mcp-client-CGa1apHd.js";import{b as V,c as Y}from"./use-mcp-tools-e5Fx1vBw.js";import{u as q}from"./index-Bq43shHN.js";import{c as G}from"./monaco-editor-Cto580m0.js";import{g as K,M as W,a as D}from"./index-DhHvNH6W.js";import{b as z,a as F}from"./chat-context-DLYBbFGY.js";import{u as J}from"./shell-layout-BeX__GCn.js";import{O as Q}from"./tab-id-BijBBRwE.js";import"./select-CIhUgwRQ.js";import"./tooltip-D_SCaRHR.js";import"./ChevronUp-KOrd5cUU.js";import"./ChevronDown-CL2bRCzf.js";import"./useInfiniteQuery-CVpcf-iZ.js";import"./use-infinite-scroll-CLiYEPeK.js";import"./use-connection-Bo9HSDdo.js";import"./use-collections-cc44LDcT.js";import"./use-virtual-mcp-BZrpfr1k.js";import"./card-CULDlrA-.js";import"./sidebar-BAnGqNSt.js";import"./LayoutLeft-8SPosLnY.js";import"./use-mobile-urLns8jv.js";import"./X-Dm89h948.js";import"./table-BZqvj0A3.js";import"./empty-state-B8oQuoho.js";import"./use-members-BPzeTa5z.js";import"./use-org-auth-client-BIIiixyg.js";import"./use-clock-tick-DqIRxBts.js";import"./AlertCircle-Cw9yCE-i.js";import"./CheckCircle-DIW-Nhbw.js";import"./DotsVertical-DHGQKJQ3.js";import"./agent-icon-zLkP0kYm.js";import"./Tool01-Ejks2s80.js";import"./ArrowUp-DPdPikqD.js";import"./Settings02-CqKjAMaI.js";import"./Tool02-BiN5KVxd.js";import"./XCircle-DM1bOn1E.js";import"./ArrowUpRight-CP6scA3R.js";import"./TrendUp01-C_w4PRID.js";import"./ZapSquare-CCwjZmp5.js";import"./ZoomOut-l5IPvWBR.js";import"./Users03--WwVmO_e.js";import"./ChevronRight-DjftMIpm.js";import"./Stars02-OCXqKqaD.js";import"./Copy01-CKNWZcLl.js";import"./Globe01-D20i-VXn.js";import"./Eye-C3frWI7b.js";import"./FilterLines-BVmVR75h.js";import"./Star01-CBhs-Q0y.js";import"./Globe04-CjF1XOfq.js";import"./SwitchHorizontal01-BvaC-pRG.js";import"./HardDrive-Dzd4xRuN.js";import"./Image01-Cia_sV5k.js";import"./Key01-Bez2UiK4.js";import"./LinkExternal01-Ce7rLmFL.js";import"./Monitor01-nDZ8jgXm.js";import"./Sun-jFQ8ORpO.js";import"./Package-B69RiVVU.js";import"./Palette-C7KCkCoB.js";import"./Play-DXq0O4lB.js";import"./Plus-ByMs73Uz.js";import"./SearchLg-AMecrvAq.js";import"./SearchMd-DSp0OYrz.js";import"./Shield01-e85cxIie.js";import"./Stars01-DgTAPZ52.js";import"./Trash01-C_k41k5y.js";import"./Upload01-92Zf66CI.js";import"./User01-Gffdi4XN.js";import"./Users01-DxScEBVx.js";import"./XClose-CO6cCLh6.js";import"./Zap-C08_643H.js";import"./use-automations-zhPgS02n.js";import"./studio-tools-Gw5yCtO3.js";import"./useSuspenseInfiniteQuery-hZ6Deicm.js";import"./avatar-KoDyzfrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwq9iT6j.js";import"./file-type-icon-T2F6oe7X.js";import"./dialog-C5eQfWDF.js";import"./hooks-DBIIPHrB.js";import"./decopilot-sse-pool-eq4h-dhW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./calendar-CNasvSCO.js";import"./integration-icon-D_JGFNsU.js";import"./use-navigate-to-agent-BWsiJtGE.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BGspeNOh.js";import"./form-qbWegHOz.js";import"./label-CoWA5D5R.js";import"./input-CwmyLALb.js";import"./auth-DQ_oeIMX.js";import"./drawer-Cpzxp9wL.js";import"./collection-search-DpljgvQ0.js";import"./autosend-DKCVt8HQ.js";import"./index-CAkUz10B.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-BkS8-5ui.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DJatC_RM.js";import"./mcp-oauth-B9BkzrVi.js";import"./extract-connection-data-kMalwUxf.js";import"./use-decopilot-events-Bbm0n_Gq.js";import"./dropdown-menu-Dqv0OT41.js";import"./popover-Y0QG9sOo.js";import"./command-C7p6GqWL.js";import"./index-LlJCcbAi.js";import"./use-organization-settings-DL7ydVzg.js";import"./companions-core-DIRKcNLf.js";import"./tabs-BSSXntdl.js";import"./toggle-group-BSOhlYof.js";import"./use-deco-credits--FMRQZFv.js";import"./connection-card-Ds0iY_0G.js";import"./use-registry-connections-DYbptSiR.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DP6Y400s.js";import"./connection-form-helpers-BRBYCjpo.js";import"./collection-tabs-2EQS29Kq.js";import"./badge-T4AA6iZX.js";import"./use-ai-providers-gqMxKR3J.js";import"./connect-desktop-dialog-BVw0SkEq.js";import"./select-model-2pm5halu.js";import"./checkbox-CCG4Kv9w.js";import"./skeleton-BIGkqEfs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DdXoByAD.js";import"./index-DlBEt0M3.js";import"./alert-dialog-UUhdQgPz.js";import"./toolbar-Bw6tqp6s.js";import"./use-debounced-value-N9yCJGMl.js";import"./location-BpLtHjTZ.js";import"./index-Da0YwmTS.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C7tWsLM_.js";import"./use-capability-Bbp5deR3.js";import"./toolbar-icon-button-C-dw2Lfg.js";import"./use-debounced-autosave-vVyhbsS1.js";import"./index-CGYl8LK_.js";import"./search-input-BiyJOa18.js";import"./use-mcp-auth-status-any-Ikex.js";import"./switch-BETtm1AS.js";import"./github-repo-picker-CotWNM2U.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-Duv1Im0X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-DNP4fmsa.js";import"./automation-list-row-DcApL42P.js";import"./required-auth-layout-_kPKrPAQ.js";import"./use-org-sso-DGqnPPs0.js";const X="studio://navigate";function Z(M){const[t]=M;if(M.length!==1||t?.type!=="resource_link"||!t.uri.startsWith(X))return{isNavigate:!1};let o=null;try{o=new URL(t.uri).searchParams.get("main")}catch{}return{isNavigate:!0,tab:o&&Q.has(o)?o:null}}const tt={};function ot(M){const t=L.c(38),{client:o,resourceURI:I,tool:i,connectionId:p,orgId:a,args:v}=M,{sendMessage:C}=z(),{setAppContext:f,clearAppContext:l}=F(),{openSidePanel:g,openTab:s}=J(),r=`${p}:${i.name}`;let c;t[0]!==s?(c=x=>x==="inline"?(s("0"),"inline"):"fullscreen",t[0]=s,t[1]=c):c=t[1];const m=c,n=v??tt;let u;t[2]!==o||t[3]!==i.name||t[4]!==n?(u={client:o,toolName:i.name,toolArguments:n},t[2]=o,t[3]=i.name,t[4]=n,t[5]=u):u=t[5];const{data:e}=Y(u);let h;if(t[6]!==i._meta||t[7]!==i.name){const x=$(i._meta);h=E(i.name,x),t[6]=i._meta,t[7]=i.name,t[8]=h}else h=t[8];const A=h;let d;t[9]!==i.inputSchema?(d=i.inputSchema??{type:"object"},t[9]=i.inputSchema,t[10]=d):d=t[10];let R;t[11]!==A||t[12]!==d||t[13]!==i?(R={...i,name:A,inputSchema:d},t[11]=A,t[12]=d,t[13]=i,t[14]=R):R=t[14];const b=R;let _;t[15]!==g||t[16]!==s||t[17]!==C?(_=x=>{const j=Z(x.content);if(j.isNavigate){j.tab&&s(j.tab);return}const w=G(x.content);w.content.length>0&&(g("chat"),C({tiptapDoc:w}))},t[15]=g,t[16]=s,t[17]=C,t[18]=_):_=t[18];const y=_;let P;t[19]!==b?(P={tool:b},t[19]=b,t[20]=P):P=t[20];let N;t[21]!==f||t[22]!==r?(N=x=>f(r,x),t[21]=f,t[22]=r,t[23]=N):N=t[23];let T;t[24]!==l||t[25]!==r?(T=()=>l(r),t[24]=l,t[25]=r,t[26]=T):T=t[26];let S;return t[27]!==o||t[28]!==y||t[29]!==m||t[30]!==a||t[31]!==I||t[32]!==P||t[33]!==N||t[34]!==T||t[35]!==n||t[36]!==e?(S=U.jsx(W,{resourceURI:I,orgId:a,toolInfo:P,toolInput:n,toolResult:e,displayMode:"fullscreen",minHeight:D.fullscreen.minHeight,maxHeight:D.fullscreen.maxHeight,client:o,onMessage:y,onUpdateModelContext:N,onTeardown:T,onRequestDisplayMode:m,className:"h-full"}),t[27]=o,t[28]=y,t[29]=m,t[30]=a,t[31]=I,t[32]=P,t[33]=N,t[34]=T,t[35]=n,t[36]=e,t[37]=S):S=t[37],S}function Wi(M){const t=L.c(24),{connectionId:o,toolName:I,args:i}=M,{org:p}=H(),a=q();let v;t[0]!==o||t[1]!==a?(v=k(o)&&a.vmEntry?.sandboxProviderKind==="user-desktop"&&a.previewUrl?`${a.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=o,t[1]=a,t[2]=v):v=t[2];const C=v;let f;t[3]!==o||t[4]!==C||t[5]!==p.id||t[6]!==p.slug?(f={connectionId:o,orgId:p.id,orgSlug:p.slug,mcpUrl:C},t[3]=o,t[4]=C,t[5]=p.id,t[6]=p.slug,t[7]=f):f=t[7];const l=B(f);let g;t[8]!==l?(g={client:l},t[8]=l,t[9]=g):g=t[9];const{data:s}=V(g);let r,c,m;t[10]!==I||t[11]!==s.tools?(r=O(decodeURIComponent(I)),m=s.tools.find(e=>e.name===r)??s.tools.find(e=>{const h=$(e._meta);if(!h)return!1;if(E(e.name,h)===r)return!0;const d=E(r,h);return d!==r&&e.name===d}),c=m?._meta?K(m._meta):void 0,t[10]=I,t[11]=s.tools,t[12]=r,t[13]=c,t[14]=m):(r=t[12],c=t[13],m=t[14]);const n=c;if(!m||!n){let e;return t[15]!==r?(e=U.jsx("div",{className:"flex items-center justify-center h-full w-full",children:U.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[15]=r,t[16]=e):e=t[16],e}let u;return t[17]!==i||t[18]!==l||t[19]!==o||t[20]!==p.id||t[21]!==n||t[22]!==m?(u=U.jsx(ot,{client:l,resourceURI:n,tool:m,connectionId:o,orgId:p.id,args:i}),t[17]=i,t[18]=l,t[19]=o,t[20]=p.id,t[21]=n,t[22]=m,t[23]=u):u=t[23],u}export{Wi as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as C,j as o}from"./index-BxSnvyHv.js";import{I as B}from"./input-CwmyLALb.js";import{L as T}from"./label-CoWA5D5R.js";import{S as L,a as A,b as R,c as z,d as O}from"./select-CIhUgwRQ.js";import{T as V}from"./textarea-DP6Y400s.js";import{v as D,w as J,o as K,y as M,I as _}from"./index-Bq43shHN.js";import{s as F}from"./primitives-FU9AMNO1.js";import{u as $}from"./use-autosave-BPR--127.js";import"./tooltip-D_SCaRHR.js";import"./ChevronUp-KOrd5cUU.js";import"./ChevronDown-CL2bRCzf.js";import"./ArrowUp-DPdPikqD.js";import"./chat-context-DLYBbFGY.js";import"./autosend-DKCVt8HQ.js";import"./hooks-DBIIPHrB.js";import"./use-mcp-client-CGa1apHd.js";import"./auth-DQ_oeIMX.js";import"./decopilot-sse-pool-eq4h-dhW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Gw5yCtO3.js";import"./use-virtual-mcp-BZrpfr1k.js";import"./use-collections-cc44LDcT.js";import"./use-ai-providers-gqMxKR3J.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-Bbm0n_Gq.js";import"./use-organization-settings-DL7ydVzg.js";import"./automation-runs-Blj-pvUz.js";import"./useInfiniteQuery-CVpcf-iZ.js";import"./use-infinite-scroll-CLiYEPeK.js";import"./use-connection-Bo9HSDdo.js";import"./card-CULDlrA-.js";import"./sidebar-BAnGqNSt.js";import"./LayoutLeft-8SPosLnY.js";import"./use-mobile-urLns8jv.js";import"./X-Dm89h948.js";import"./table-BZqvj0A3.js";import"./empty-state-B8oQuoho.js";import"./use-members-BPzeTa5z.js";import"./use-org-auth-client-BIIiixyg.js";import"./use-clock-tick-DqIRxBts.js";import"./AlertCircle-Cw9yCE-i.js";import"./CheckCircle-DIW-Nhbw.js";import"./DotsVertical-DHGQKJQ3.js";import"./agent-icon-zLkP0kYm.js";import"./Tool01-Ejks2s80.js";import"./Settings02-CqKjAMaI.js";import"./Tool02-BiN5KVxd.js";import"./XCircle-DM1bOn1E.js";import"./ArrowUpRight-CP6scA3R.js";import"./TrendUp01-C_w4PRID.js";import"./ZapSquare-CCwjZmp5.js";import"./ZoomOut-l5IPvWBR.js";import"./Users03--WwVmO_e.js";import"./ChevronRight-DjftMIpm.js";import"./Stars02-OCXqKqaD.js";import"./Copy01-CKNWZcLl.js";import"./Globe01-D20i-VXn.js";import"./Eye-C3frWI7b.js";import"./FilterLines-BVmVR75h.js";import"./Star01-CBhs-Q0y.js";import"./Globe04-CjF1XOfq.js";import"./SwitchHorizontal01-BvaC-pRG.js";import"./HardDrive-Dzd4xRuN.js";import"./Image01-Cia_sV5k.js";import"./Key01-Bez2UiK4.js";import"./LinkExternal01-Ce7rLmFL.js";import"./Monitor01-nDZ8jgXm.js";import"./Sun-jFQ8ORpO.js";import"./Package-B69RiVVU.js";import"./Palette-C7KCkCoB.js";import"./Play-DXq0O4lB.js";import"./Plus-ByMs73Uz.js";import"./SearchLg-AMecrvAq.js";import"./SearchMd-DSp0OYrz.js";import"./Shield01-e85cxIie.js";import"./Stars01-DgTAPZ52.js";import"./Trash01-C_k41k5y.js";import"./Upload01-92Zf66CI.js";import"./User01-Gffdi4XN.js";import"./Users01-DxScEBVx.js";import"./XClose-CO6cCLh6.js";import"./Zap-C08_643H.js";import"./use-automations-zhPgS02n.js";import"./useSuspenseInfiniteQuery-hZ6Deicm.js";import"./avatar-KoDyzfrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwq9iT6j.js";import"./file-type-icon-T2F6oe7X.js";import"./dialog-C5eQfWDF.js";import"./monaco-editor-Cto580m0.js";import"./index-Da0YwmTS.js";import"./index-DhHvNH6W.js";import"./calendar-CNasvSCO.js";import"./shell-layout-BeX__GCn.js";import"./required-auth-layout-_kPKrPAQ.js";import"./use-org-sso-DGqnPPs0.js";import"./integration-icon-D_JGFNsU.js";import"./use-navigate-to-agent-BWsiJtGE.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BGspeNOh.js";import"./form-qbWegHOz.js";import"./drawer-Cpzxp9wL.js";import"./collection-search-DpljgvQ0.js";import"./index-CAkUz10B.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-BkS8-5ui.js";import"./use-mcp-tools-e5Fx1vBw.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DJatC_RM.js";import"./mcp-oauth-B9BkzrVi.js";import"./extract-connection-data-kMalwUxf.js";import"./dropdown-menu-Dqv0OT41.js";import"./popover-Y0QG9sOo.js";import"./command-C7p6GqWL.js";import"./index-LlJCcbAi.js";import"./companions-core-DIRKcNLf.js";import"./tabs-BSSXntdl.js";import"./toggle-group-BSOhlYof.js";import"./use-deco-credits--FMRQZFv.js";import"./connection-card-Ds0iY_0G.js";import"./use-registry-connections-DYbptSiR.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-form-helpers-BRBYCjpo.js";import"./collection-tabs-2EQS29Kq.js";import"./badge-T4AA6iZX.js";import"./connect-desktop-dialog-BVw0SkEq.js";import"./select-model-2pm5halu.js";import"./checkbox-CCG4Kv9w.js";import"./skeleton-BIGkqEfs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DdXoByAD.js";import"./index-DlBEt0M3.js";import"./alert-dialog-UUhdQgPz.js";import"./toolbar-Bw6tqp6s.js";import"./use-debounced-value-N9yCJGMl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C7tWsLM_.js";import"./use-capability-Bbp5deR3.js";import"./toolbar-icon-button-C-dw2Lfg.js";import"./use-debounced-autosave-vVyhbsS1.js";import"./index-CGYl8LK_.js";import"./search-input-BiyJOa18.js";import"./use-mcp-auth-status-any-Ikex.js";import"./switch-BETtm1AS.js";import"./github-repo-picker-CotWNM2U.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-Duv1Im0X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-DNP4fmsa.js";import"./automation-list-row-DcApL42P.js";const q={authors:[{key:"name",label:"Name",widget:"text"},{key:"type",label:"Type",widget:"select",options:[{value:"Person",label:"Person"},{value:"Organization",label:"Organization"}]},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},G={authors:"Author"};function Ko(g){const t=C.c(34),{orgSlug:j,virtualMcpId:w,branch:S,kind:e,blockKey:h,block:E}=g;let y;t[0]!==S||t[1]!==j||t[2]!==w?(y={orgSlug:j,virtualMcpId:w,branch:S},t[0]=S,t[1]=j,t[2]=w,t[3]=y):y=t[3];const m=D(y);let d;t[4]!==E||t[5]!==e?(d=J(E,e),t[4]=E,t[5]=e,t[6]=d):d=t[6];const f=d;let k;t[7]!==h||t[8]!==e||t[9]!==m?(k=a=>{m.mutate({blockKey:h,data:M(h,e,a)})},t[7]=h,t[8]=e,t[9]=m,t[10]=k):k=t[10];const[i,N]=$(f,k);let b;t[11]!==i||t[12]!==N?(b=(a,r)=>N({...i,[a]:r}),t[11]=i,t[12]=N,t[13]=b):b=t[13];const p=b,I=G[e];let l;t[14]!==I?(l=o.jsx("span",{className:"text-sm font-medium",children:I}),t[14]=I,t[15]=l):l=t[15];let n;t[16]!==m.isError||t[17]!==m.isPending?(n=o.jsx(K,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=n):n=t[18];let c;t[19]!==l||t[20]!==n?(c=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[l,n]}),t[19]=l,t[20]=n,t[21]=c):c=t[21];const P=q[e];let u;if(t[22]!==i||t[23]!==p||t[24]!==P){let a;t[26]!==i||t[27]!==p?(a=r=>o.jsx("div",{className:"space-y-2",children:r.widget==="image"?o.jsx(_,{schema:{type:"string",format:"image-uri",title:r.label},value:i[r.key],onChange:s=>p(r.key,s),path:r.key,label:r.label}):r.widget==="select"?o.jsxs(o.Fragment,{children:[o.jsx(T,{htmlFor:r.key,children:r.label}),o.jsxs(L,{value:F(i[r.key])||r.options?.[0]?.value,onValueChange:s=>p(r.key,s),children:[o.jsx(A,{id:r.key,className:"h-10 w-full",children:o.jsx(R,{placeholder:r.label})}),o.jsx(z,{children:(r.options??[]).map(H)})]})]}):o.jsxs(o.Fragment,{children:[o.jsx(T,{htmlFor:r.key,children:r.label}),r.widget==="textarea"?o.jsx(V,{id:r.key,value:F(i[r.key]),onChange:s=>p(r.key,s.target.value),rows:3}):o.jsx(B,{id:r.key,value:F(i[r.key]),placeholder:r.placeholder,onChange:s=>p(r.key,s.target.value),className:"h-10"})]})},r.key),t[26]=i,t[27]=p,t[28]=a):a=t[28],u=P.map(a),t[22]=i,t[23]=p,t[24]=P,t[25]=u}else u=t[25];let x;t[29]!==u?(x=o.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:u})}),t[29]=u,t[30]=x):x=t[30];let v;return t[31]!==x||t[32]!==c?(v=o.jsxs("div",{className:"flex h-full flex-col",children:[c,x]}),t[31]=x,t[32]=c,t[33]=v):v=t[33],v}function H(g){return o.jsx(O,{value:g.value,children:g.label},g.value)}export{Ko as RecordEditor};
@@ -1 +0,0 @@
1
- import{c as z,j as t}from"./index-BxSnvyHv.js";import{C as G}from"./checkbox-CCG4Kv9w.js";import{I as K}from"./input-CwmyLALb.js";import{L as q}from"./label-CoWA5D5R.js";import{c as H,S as J,d as W,a as X,b as Z}from"./select-CIhUgwRQ.js";import{k as ee,a_ as te,o as re,a$ as M,b0 as ie}from"./index-Bq43shHN.js";import{u as oe}from"./use-autosave-BPR--127.js";import"./ChevronUp-KOrd5cUU.js";import"./tooltip-D_SCaRHR.js";import"./ChevronDown-CL2bRCzf.js";import"./ArrowUp-DPdPikqD.js";import"./chat-context-DLYBbFGY.js";import"./autosend-DKCVt8HQ.js";import"./hooks-DBIIPHrB.js";import"./use-mcp-client-CGa1apHd.js";import"./auth-DQ_oeIMX.js";import"./decopilot-sse-pool-eq4h-dhW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Gw5yCtO3.js";import"./use-virtual-mcp-BZrpfr1k.js";import"./use-collections-cc44LDcT.js";import"./use-ai-providers-gqMxKR3J.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-Bbm0n_Gq.js";import"./use-organization-settings-DL7ydVzg.js";import"./automation-runs-Blj-pvUz.js";import"./useInfiniteQuery-CVpcf-iZ.js";import"./use-infinite-scroll-CLiYEPeK.js";import"./use-connection-Bo9HSDdo.js";import"./card-CULDlrA-.js";import"./sidebar-BAnGqNSt.js";import"./LayoutLeft-8SPosLnY.js";import"./use-mobile-urLns8jv.js";import"./X-Dm89h948.js";import"./table-BZqvj0A3.js";import"./empty-state-B8oQuoho.js";import"./use-members-BPzeTa5z.js";import"./use-org-auth-client-BIIiixyg.js";import"./use-clock-tick-DqIRxBts.js";import"./AlertCircle-Cw9yCE-i.js";import"./CheckCircle-DIW-Nhbw.js";import"./DotsVertical-DHGQKJQ3.js";import"./agent-icon-zLkP0kYm.js";import"./Tool01-Ejks2s80.js";import"./Settings02-CqKjAMaI.js";import"./Tool02-BiN5KVxd.js";import"./XCircle-DM1bOn1E.js";import"./ArrowUpRight-CP6scA3R.js";import"./TrendUp01-C_w4PRID.js";import"./ZapSquare-CCwjZmp5.js";import"./ZoomOut-l5IPvWBR.js";import"./Users03--WwVmO_e.js";import"./ChevronRight-DjftMIpm.js";import"./Stars02-OCXqKqaD.js";import"./Copy01-CKNWZcLl.js";import"./Globe01-D20i-VXn.js";import"./Eye-C3frWI7b.js";import"./FilterLines-BVmVR75h.js";import"./Star01-CBhs-Q0y.js";import"./Globe04-CjF1XOfq.js";import"./SwitchHorizontal01-BvaC-pRG.js";import"./HardDrive-Dzd4xRuN.js";import"./Image01-Cia_sV5k.js";import"./Key01-Bez2UiK4.js";import"./LinkExternal01-Ce7rLmFL.js";import"./Monitor01-nDZ8jgXm.js";import"./Sun-jFQ8ORpO.js";import"./Package-B69RiVVU.js";import"./Palette-C7KCkCoB.js";import"./Play-DXq0O4lB.js";import"./Plus-ByMs73Uz.js";import"./SearchLg-AMecrvAq.js";import"./SearchMd-DSp0OYrz.js";import"./Shield01-e85cxIie.js";import"./Stars01-DgTAPZ52.js";import"./Trash01-C_k41k5y.js";import"./Upload01-92Zf66CI.js";import"./User01-Gffdi4XN.js";import"./Users01-DxScEBVx.js";import"./XClose-CO6cCLh6.js";import"./Zap-C08_643H.js";import"./use-automations-zhPgS02n.js";import"./useSuspenseInfiniteQuery-hZ6Deicm.js";import"./avatar-KoDyzfrm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bwq9iT6j.js";import"./file-type-icon-T2F6oe7X.js";import"./dialog-C5eQfWDF.js";import"./monaco-editor-Cto580m0.js";import"./index-Da0YwmTS.js";import"./index-DhHvNH6W.js";import"./calendar-CNasvSCO.js";import"./shell-layout-BeX__GCn.js";import"./required-auth-layout-_kPKrPAQ.js";import"./use-org-sso-DGqnPPs0.js";import"./integration-icon-D_JGFNsU.js";import"./use-navigate-to-agent-BWsiJtGE.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BGspeNOh.js";import"./form-qbWegHOz.js";import"./drawer-Cpzxp9wL.js";import"./collection-search-DpljgvQ0.js";import"./index-CAkUz10B.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-BkS8-5ui.js";import"./use-mcp-tools-e5Fx1vBw.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DJatC_RM.js";import"./mcp-oauth-B9BkzrVi.js";import"./extract-connection-data-kMalwUxf.js";import"./dropdown-menu-Dqv0OT41.js";import"./popover-Y0QG9sOo.js";import"./command-C7p6GqWL.js";import"./index-LlJCcbAi.js";import"./companions-core-DIRKcNLf.js";import"./tabs-BSSXntdl.js";import"./toggle-group-BSOhlYof.js";import"./use-deco-credits--FMRQZFv.js";import"./connection-card-Ds0iY_0G.js";import"./use-registry-connections-DYbptSiR.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DP6Y400s.js";import"./connection-form-helpers-BRBYCjpo.js";import"./collection-tabs-2EQS29Kq.js";import"./badge-T4AA6iZX.js";import"./connect-desktop-dialog-BVw0SkEq.js";import"./select-model-2pm5halu.js";import"./skeleton-BIGkqEfs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DdXoByAD.js";import"./index-DlBEt0M3.js";import"./alert-dialog-UUhdQgPz.js";import"./toolbar-Bw6tqp6s.js";import"./use-debounced-value-N9yCJGMl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C7tWsLM_.js";import"./use-capability-Bbp5deR3.js";import"./toolbar-icon-button-C-dw2Lfg.js";import"./use-debounced-autosave-vVyhbsS1.js";import"./index-CGYl8LK_.js";import"./search-input-BiyJOa18.js";import"./use-mcp-auth-status-any-Ikex.js";import"./switch-BETtm1AS.js";import"./github-repo-picker-CotWNM2U.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-Duv1Im0X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-DNP4fmsa.js";import"./automation-list-row-DcApL42P.js";const me=[{value:"temporary",label:`Temporary (${M.temporary})`},{value:"permanent",label:`Permanent (${M.permanent})`}];function Xr(_){const e=z.c(62),{orgSlug:$,virtualMcpId:A,branch:B,blockKey:D,block:O}=_;let S;e[0]!==B||e[1]!==$||e[2]!==A?(S={orgSlug:$,virtualMcpId:A,branch:B},e[0]=B,e[1]=$,e[2]=A,e[3]=S):S=e[3];const m=ee(S);let g;e[4]!==O?(g=te(O),e[4]=O,e[5]=g):g=e[5];const Y=g;let v;e[6]!==D||e[7]!==m?(v=o=>{m.mutate({blockKey:D,data:ie(o)})},e[6]=D,e[7]=m,e[8]=v):v=e[8];const[r,V]=oe(Y,v);let N;e[9]!==r||e[10]!==V?(N=o=>V({...r,...o}),e[9]=r,e[10]=V,e[11]=N):N=e[11];const i=N;let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"text-sm font-medium",children:"Redirect"}),e[12]=P):P=e[12];let p;e[13]!==m.isError||e[14]!==m.isPending?(p=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[P,t.jsx(re,{isPending:m.isPending,isError:m.isError})]}),e[13]=m.isError,e[14]=m.isPending,e[15]=p):p=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(q,{htmlFor:"redirect-from",children:"From"}),e[16]=T):T=e[16];let s;e[17]!==i?(s=o=>i({from:o.target.value}),e[17]=i,e[18]=s):s=e[18];let l;e[19]!==r.from||e[20]!==s?(l=t.jsx(K,{id:"redirect-from",value:r.from,placeholder:"/old-path",onChange:s,className:"h-10"}),e[19]=r.from,e[20]=s,e[21]=l):l=e[21];let E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs("p",{className:"text-xs text-muted-foreground",children:["The source path to match. Supports URLPattern syntax (e.g."," ",t.jsx("code",{children:"/product/:slug"}),")."]}),e[22]=E):E=e[22];let a;e[23]!==l?(a=t.jsxs("div",{className:"space-y-2",children:[T,l,E]}),e[23]=l,e[24]=a):a=e[24];let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(q,{htmlFor:"redirect-to",children:"To"}),e[25]=R):R=e[25];let c;e[26]!==i?(c=o=>i({to:o.target.value}),e[26]=i,e[27]=c):c=e[27];let n;e[28]!==r.to||e[29]!==c?(n=t.jsx(K,{id:"redirect-to",value:r.to,placeholder:"/new-path",onChange:c,className:"h-10"}),e[28]=r.to,e[29]=c,e[30]=n):n=e[30];let k;e[31]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("p",{className:"text-xs text-muted-foreground",children:"The destination — a relative path or an absolute URL."}),e[31]=k):k=e[31];let d;e[32]!==n?(d=t.jsxs("div",{className:"space-y-2",children:[R,n,k]}),e[32]=n,e[33]=d):d=e[33];let C;e[34]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(q,{htmlFor:"redirect-type",children:"Type"}),e[34]=C):C=e[34];let f;e[35]!==i?(f=o=>i({type:o}),e[35]=i,e[36]=f):f=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(X,{id:"redirect-type",className:"h-10 w-full",children:t.jsx(Z,{placeholder:"Type"})}),e[37]=w):w=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(H,{children:me.map(pe)}),e[38]=I):I=e[38];let h;e[39]!==r.type||e[40]!==f?(h=t.jsxs(J,{value:r.type,onValueChange:f,children:[w,I]}),e[39]=r.type,e[40]=f,e[41]=h):h=e[41];let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("strong",{children:"Temporary"}),e[42]=F):F=e[42];let L;e[43]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",F," when the redirect may change;"," ",t.jsx("strong",{children:"Permanent"})," lets browsers cache it."]}),e[43]=L):L=e[43];let x;e[44]!==h?(x=t.jsxs("div",{className:"space-y-2",children:[C,h,L]}),e[44]=h,e[45]=x):x=e[45];let u;e[46]!==i?(u=o=>i({discardQueryParameters:o===!0}),e[46]=i,e[47]=u):u=e[47];let y;e[48]!==r.discardQueryParameters||e[49]!==u?(y=t.jsx(G,{checked:r.discardQueryParameters,onCheckedChange:u}),e[48]=r.discardQueryParameters,e[49]=u,e[50]=y):y=e[50];let Q;e[51]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("span",{className:"text-sm",children:"Discard query parameters"}),e[51]=Q):Q=e[51];let j;e[52]!==y?(j=t.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[y,Q]}),e[52]=y,e[53]=j):j=e[53];let b;e[54]!==a||e[55]!==d||e[56]!==x||e[57]!==j?(b=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:t.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[a,d,x,j]})}),e[54]=a,e[55]=d,e[56]=x,e[57]=j,e[58]=b):b=e[58];let U;return e[59]!==b||e[60]!==p?(U=t.jsxs("div",{className:"flex h-full flex-col",children:[p,b]}),e[59]=b,e[60]=p,e[61]=U):U=e[61],U}function pe(_){return t.jsx(W,{value:_.value,children:_.label},_.value)}export{Xr as RedirectEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BgDKIGtK.js","assets/index-BxSnvyHv.js","assets/index-BtiM-Rn6.css","assets/Tool02-BiN5KVxd.js","assets/CheckCircle-DIW-Nhbw.js","assets/Settings02-CqKjAMaI.js","assets/use-mcp-client-CGa1apHd.js","assets/auth-DQ_oeIMX.js","assets/useInfiniteQuery-CVpcf-iZ.js","assets/use-infinite-scroll-CLiYEPeK.js","assets/studio-tools-Gw5yCtO3.js","assets/badge-T4AA6iZX.js","assets/input-CwmyLALb.js","assets/dropdown-menu-Dqv0OT41.js","assets/ChevronUp-KOrd5cUU.js","assets/ChevronRight-DjftMIpm.js","assets/DotsVertical-DHGQKJQ3.js","assets/table-BZqvj0A3.js","assets/toggle-group-BSOhlYof.js","assets/use-view-mode-HPknXsbN.js","assets/use-mobile-urLns8jv.js","assets/FilterLines-BVmVR75h.js","assets/Globe01-D20i-VXn.js","assets/SearchMd-DSp0OYrz.js","assets/dialog-C5eQfWDF.js","assets/X-Dm89h948.js","assets/AlertCircle-Cw9yCE-i.js","assets/Upload01-92Zf66CI.js","assets/alert-dialog-UUhdQgPz.js","assets/card-CULDlrA-.js","assets/Trash01-C_k41k5y.js","assets/label-CoWA5D5R.js","assets/select-CIhUgwRQ.js","assets/tooltip-D_SCaRHR.js","assets/ChevronDown-CL2bRCzf.js","assets/switch-BETtm1AS.js","assets/textarea-DP6Y400s.js","assets/XCircle-DM1bOn1E.js","assets/checkbox-CCG4Kv9w.js","assets/Eye-C3frWI7b.js","assets/LinkExternal01-Ce7rLmFL.js","assets/use-copy-Bwq9iT6j.js","assets/Copy01-CKNWZcLl.js","assets/Key01-Bez2UiK4.js","assets/Plus-ByMs73Uz.js","assets/mcp-oauth-B9BkzrVi.js","assets/Play-DXq0O4lB.js"])))=>i.map(i=>d[i]);
2
- import{c as s,j as e,r as i,i as a,aX as o}from"./index-BxSnvyHv.js";import{R as m}from"./require-capability-C97tWNuh.js";import"./use-capability-Bbp5deR3.js";import"./access-gate-DGQ4SGrz.js";import"./capability-load-error-DqTvJvx-.js";const n=i.lazy(()=>o(()=>import("./registry-layout-BgDKIGtK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1 +0,0 @@
1
- import{r as F,C as Ne,K as re,b4 as ct,m as Ce,j as s,l as K,i as fe,B as le,c as H,H as we,ad as be,I as se,af as Le,ag as Pe,n as ze,M as dt,J as mt,d as Ye,t as he,p as Ae,w as Fe,x as ut,E as ft,b as ht,u as xt}from"./index-BxSnvyHv.js";import{u as pt}from"./use-organization-roles-CRvosx9g.js";import{u as Re}from"./use-org-auth-client-BIIiixyg.js";import{g as $e,a as gt}from"./role-color-Dn2tXDDF.js";import{B as xe}from"./badge-T4AA6iZX.js";import{f as Ke,a as Qe,b as He,c as qe,d as Ze,A as Je,e as Xe,g as We}from"./alert-dialog-UUhdQgPz.js";import{D as Tt,a as Et,c as _t,d as It}from"./dropdown-menu-Dqv0OT41.js";import{i as bt}from"./DotsVertical-DHGQKJQ3.js";import{s as Se}from"./Plus-ByMs73Uz.js";import{s as Nt}from"./Trash01-C_k41k5y.js";import{C as St}from"./collection-table-wrapper-DPmE8FB1.js";import{P as te}from"./index-CGYl8LK_.js";import{E as De}from"./empty-state-B8oQuoho.js";import{S as Oe}from"./search-input-BiyJOa18.js";import{P as et,D as tt}from"./ai-providers-logos-DD3qZ33J.js";import{I as je}from"./integration-icon-D_JGFNsU.js";import{u as Ct}from"./use-infinite-scroll-CLiYEPeK.js";import{C as ve}from"./checkbox-CCG4Kv9w.js";import{b as At}from"./Settings02-CqKjAMaI.js";import{u as Rt}from"./useSuspenseInfiniteQuery-hZ6Deicm.js";import{u as Ot,S as jt}from"./use-mcp-client-CGa1apHd.js";import{C as vt}from"./collection-search-DpljgvQ0.js";import{u as st}from"./use-members-BPzeTa5z.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-Bo9HSDdo.js";import{u as Mt,c as wt}from"./use-ai-providers-gqMxKR3J.js";import{A as nt}from"./avatar-KoDyzfrm.js";import{S as pe}from"./switch-BETtm1AS.js";import{c as ge,b as Te,T as Ee,a as _e}from"./tooltip-D_SCaRHR.js";import{S as ke,a as Ge,b as Ue}from"./settings-section-DdXoByAD.js";import{t as Lt}from"./ChevronDown-CL2bRCzf.js";import{i as Pt}from"./ChevronRight-DjftMIpm.js";import{i as Be}from"./X-Dm89h948.js";import{a as Dt}from"./use-capability-Bbp5deR3.js";import{A as kt}from"./access-gate-DGQ4SGrz.js";import"./ChevronUp-KOrd5cUU.js";import"./table-BZqvj0A3.js";import"./ArrowUp-DPdPikqD.js";import"./sidebar-BAnGqNSt.js";import"./LayoutLeft-8SPosLnY.js";import"./use-mobile-urLns8jv.js";import"./SearchMd-DSp0OYrz.js";import"./Tool02-BiN5KVxd.js";import"./agent-icon-zLkP0kYm.js";import"./AlertCircle-Cw9yCE-i.js";import"./Tool01-Ejks2s80.js";import"./XCircle-DM1bOn1E.js";import"./ArrowUpRight-CP6scA3R.js";import"./TrendUp01-C_w4PRID.js";import"./ZapSquare-CCwjZmp5.js";import"./ZoomOut-l5IPvWBR.js";import"./Users03--WwVmO_e.js";import"./CheckCircle-DIW-Nhbw.js";import"./Stars02-OCXqKqaD.js";import"./Copy01-CKNWZcLl.js";import"./Globe01-D20i-VXn.js";import"./Eye-C3frWI7b.js";import"./FilterLines-BVmVR75h.js";import"./Star01-CBhs-Q0y.js";import"./Globe04-CjF1XOfq.js";import"./SwitchHorizontal01-BvaC-pRG.js";import"./HardDrive-Dzd4xRuN.js";import"./Image01-Cia_sV5k.js";import"./Key01-Bez2UiK4.js";import"./LinkExternal01-Ce7rLmFL.js";import"./Monitor01-nDZ8jgXm.js";import"./Sun-jFQ8ORpO.js";import"./Package-B69RiVVU.js";import"./Palette-C7KCkCoB.js";import"./Play-DXq0O4lB.js";import"./SearchLg-AMecrvAq.js";import"./Shield01-e85cxIie.js";import"./Stars01-DgTAPZ52.js";import"./Upload01-92Zf66CI.js";import"./User01-Gffdi4XN.js";import"./Users01-DxScEBVx.js";import"./XClose-CO6cCLh6.js";import"./Zap-C08_643H.js";import"./auth-DQ_oeIMX.js";import"./use-collections-cc44LDcT.js";import"./studio-tools-Gw5yCtO3.js";import"./card-CULDlrA-.js";import"./capability-load-error-DqTvJvx-.js";const ye="basic-usage",Me=[{id:ye,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===ye)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===ye)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function Bt(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function Vt(t,e,l){if(l){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function zt(t){const e=H.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,x=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==x?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(je,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let p;e[5]!==l.title?(p=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=p):p=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==p?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,p]}),e[7]=h,e[8]=a,e[9]=p,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==l.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(ve,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=l.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let N;return e[17]!==f||e[18]!==o||e[19]!==m?(N=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=N):N=e[20],N}function Yt(t){return t.stopPropagation()}function Ft(t){const e=H.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:r}=t,d=`tool-${l}-${n.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let x;e[2]!==c||e[3]!==n.name?(x=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:n.name})}),e[2]=c,e[3]=n.name,e[4]=x):x=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==x||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,f]}),e[7]=x,e[8]=f,e[9]=a):a=e[9];const p=`tool-${l}-${n.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==p?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ve,{id:p,checked:i,onCheckedChange:r,onClick:$t})}),e[10]=i,e[11]=r,e[12]=p,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function $t(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[i,r]=F.useState(""),d=n!==void 0?n:i,h=F.useDeferredValue(d),[c,x]=F.useState("all"),[f,a]=F.useState(!1),p=F.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,_=h.trim(),E=_?{operator:"or",conditions:[{field:["title"],operator:"contains",value:_},{field:["description"],operator:"contains",value:_}]}:void 0,S=!!l,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:g,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:T,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,D)=>{if(T?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=I?.pages.flatMap(T=>T?.items??[])??[],j=Ct(R,g??!1,O),u=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:ct(T.connection_url)!==l):b,M=p.current,A=[...M.values()].map(T=>u.find(D=>D.id===T)).filter(T=>T!==void 0),k=u.filter(T=>!M.has(T.id)),G=[...A,...k],U=T=>{const D=t[T];return D!==void 0&&D.length>0},B=G.filter(T=>{if(c==="all")return!0;const D=U(T.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=F.useState(G[0]?.id??null),y=w?G.find(T=>T.id===w)??null:null,{data:L,isFetching:Y}=Ce({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),$=L?.tools??[],J=(T,D)=>t[T]?.includes(D)??!1,X=(T,D)=>{const Q=t[T]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[T]:W[T]=Z}else W[T]=[...Q,D];e(W)},ne=T=>{const D=T===w?$:[];if(!D.length)return;const Q=t[T]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[T]:(Z[T]=q,z(T)),e(Z)},oe=T=>{z(T),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[n===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>x("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>x("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>x("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(T=>{const D=w===T.id,Q=D?$.length:0,q=t[T.id]?.length??0;return s.jsx(zt,{connection:{...T,tools:D?$:T.tools},isSelected:D,hasToolsEnabled:U(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(T.id),onToggle:()=>ne(T.id)},T.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(le,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(je,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:$.map(T=>s.jsx(Ft,{connectionId:y.id,tool:T,isSelected:J(y.id,T.name),onToggle:()=>X(y.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Qt=we({role:we({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Pe(),staticPermissions:be(se()),toolSet:Le(se(),be(se())),allowAllModels:Pe(),modelSet:Le(se(),be(se())),memberIds:be(se())});function Ve(t,e,l){const n=s.jsx(pe,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):n}function Ht(t){const e=H.c(28),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let x;e[0]!==h?(x=h.trim().toLowerCase(),e[0]=h,e[1]=x):x=e[1];const f=F.useDeferredValue(x);let a;if(e[2]!==l||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==n){const p=Ut(),o=(v,I)=>{if(!c){if(l&&I){const R=p.flatMap(Jt).flatMap(Zt);i(!1),r(R.filter(g=>!v.tools.includes(g)));return}l||r(Vt(v,n,!I))}};let m;e[10]!==f?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(g=>!f||g.label.toLowerCase().includes(f)||g.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=p.map(m).filter(qt);let _;e[12]!==l||e[13]!==i||e[14]!==r?(_=()=>{i(!l),r([])},e[12]=l,e[13]=i,e[14]=r,e[15]=_):_=e[15];let E;e[16]!==l||e[17]!==c||e[18]!==_?(E=Ve(l,c,_),e[16]=l,e[17]=c,e[18]=_,e[19]=E):E=e[19];let S;e[20]!==l||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!l),r([])},e[20]=l,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==E||e[26]!==S?(C=s.jsx(ke,{title:"General",children:s.jsx(Ge,{children:s.jsx(Ue,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:S})})}),e[25]=E,e[26]=S,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,N.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):N.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(ke,{title:I,children:s.jsx(Ge,{children:R.map(g=>{const O=Bt(g,n,l);return s.jsx(Ue,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[g.label,g.dangerous&&s.jsx(ut,{size:12,className:"text-warning shrink-0"})]}),description:g.description,action:Ve(O,c,()=>o(g,O)),onClick:c?void 0:()=>o(g,O)},g.id)})})},I)})]})}),e[2]=l,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=n,e[9]=a}else a=e[9];return a}function qt(t){return t.capabilities.length>0}function Zt(t){return t.tools}function Jt(t){return t.capabilities}const ot={anthropic:"Anthropic",openrouter:"OpenRouter"},Xt={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Wt(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function es(t){return Xt[t]??ot[t]??t}function ts(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const it=30;function ss(t){const e=H.c(44),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:x,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:p,readOnly:o,defaultExpanded:m}=t,[N,_]=F.useState(m),E=m||N,S=_,[C,v]=F.useState(it);let I;e[0]!==f||e[1]!==x||e[2]!==c?(I=j=>x||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=x,e[2]=c,e[3]=I):I=e[3];const R=I;let g;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],g=d.filter(j),e[4]=R,e[5]=d,e[6]=g}else g=e[6];const O=g.length;let b;if(e[9]!==h||e[10]!==x||e[11]!==l||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==p||e[18]!==a||e[19]!==o||e[20]!==n||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(is),e[24]=M):M=e[24];const A=r??et[n]??tt;let k;e[25]!==i||e[26]!==A?(k=s.jsx(je,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(xe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let w;e[36]!==E?(w=E?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=w):w=e[37];let z;e[38]!==w||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,w]}),e[38]=w,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:M,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],b=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),$=()=>{if(!o){if(x){p(l,h,L.id);return}a(l,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:$,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:os,children:o?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:Y,disabled:!0,onCheckedChange:ns})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:Y,onCheckedChange:$})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(ls),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=x,e[11]=l,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=p,e[18]=a,e[19]=o,e[20]=n,e[21]=i,e[22]=C,e[23]=b}else b=e[23];return b}function ls(t){return t+it}function ns(){}function os(t){return t.stopPropagation()}function is(t){return!t}function rs(t){const e=H.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:x}=t,f=wt(l.id);let a,p,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==x||e[9]!==c||e[10]!==n){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==l.label?(S=A=>({...A,id:A.modelId,provider:l.label}),e[16]=l.label,e[17]=S):S=e[17];const C=f.filter(ms).map(S),v=c.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){N=null;break e}const R=new Map;for(const A of I){const k=Wt(A.id,l.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ts(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const g=Array.from(R.entries()).map(ds).sort(cs),O=g.length===1||v.length>0;o="flex flex-col gap-3";const b=et[l.providerId]??tt;let j;e[18]!==l.providerId||e[19]!==b?(j=s.jsx("img",{src:b,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=b,e[20]=j):j=e[20];const u=ot[l.providerId]??l.providerId;let M;e[21]!==u?(M=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=M):M=e[22],e[23]!==M||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,M]}),e[23]=M,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",p=g.map(A=>s.jsx(ss,{connectionId:l.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(as),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:x,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=x,e[9]=c,e[10]=n,e[11]=a,e[12]=p,e[13]=o,e[14]=m,e[15]=N}else a=e[11],p=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let _;e[26]!==a||e[27]!==p?(_=s.jsx("div",{className:a,children:p}),e[26]=a,e[27]=p,e[28]=_):_=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==_?(E=s.jsxs("div",{className:o,children:[m,_]}),e[29]=o,e[30]=m,e[31]=_,e[32]=E):E=e[32],E}function as(t){return t.id}function cs(t,e){return t.name.localeCompare(e.name)}function ds(t){const[e,l]=t;return{id:e,name:es(e),logo:l.logo,models:l.models}}function ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function us(t){const e=H.c(35),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,x=F.useDeferredValue(h),f=Mt();let a;e[0]!==n||e[1]!==r?(a=(g,O)=>{const b=n[g]??[],j={...n};if(b.includes(O)){const u=b.filter(M=>M!==O);u.length===0?delete j[g]:j[g]=u}else j[g]=[...b,O];r(j)},e[0]=n,e[1]=r,e[2]=a):a=e[2];const p=a;let o;e[3]!==n||e[4]!==i||e[5]!==r?(o=(g,O,b)=>{i(!1),r({...n,[g]:O.filter(j=>j!==b)})},e[3]=n,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,N=!c&&"hover:bg-muted/50 cursor-pointer";let _;e[7]!==N?(_=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=_):_=e[8];let E;e[9]!==l||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const g=!l;i(g),g&&r({})},e[9]=l,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=S):S=e[14];let C;e[15]!==l||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:hs,children:c?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:l,disabled:!0,onCheckedChange:fs})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:l,onCheckedChange:g=>{i(g),g&&r({})}})}),e[15]=l,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==_||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:_,onClick:E,children:[S,C]}),e[20]=_,e[21]=E,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==f||e[25]!==l||e[26]!==x||e[27]!==m||e[28]!==n||e[29]!==c||e[30]!==p?(I=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(g=>s.jsx(F.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(rs,{connection:g,selectedModels:n[g.id]??[],allowAllModels:l,onToggleModel:p,onExitAllowAll:m,allConnectionModelsSelected:(n[g.id]??[]).includes("*"),searchQuery:x,readOnly:c})},g.id)),e[24]=f,e[25]=l,e[26]=x,e[27]=m,e[28]=n,e[29]=c,e[30]=p,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,e[33]=v,e[34]=R):R=e[34],R}function fs(){}function hs(t){return t.stopPropagation()}function xs(t){const e=H.c(52),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=F.useState(""),c=F.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[f,a]=F.useState(x),{data:p}=st();let o,m,N,_,E,S,C,v,I,R,g;if(e[1]!==p?.data?.members||e[2]!==c||e[3]!==r||e[4]!==n||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==i){const U=p?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const w=U.filter(B);let z;e[22]!==r||e[23]!==n||e[24]!==f?(z=()=>{r(f),a([]),n(!1)},e[22]=r,e[23]=n,e[24]=f,e[25]=z):z=e[25],N=z,m=Ke,R=l,g=n,o=Qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(qe,{children:"Add Members to Role"}),s.jsx(Ze,{children:"Select members to add to this role."})]}),e[26]=I):I=e[26],S="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Oe,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],_="flex-1 overflow-auto",E=w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:w.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),$=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ve,{checked:$||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(nt,{url:y.user?.image??void 0,fallback:lt(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(xe,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(xe,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=p?.data?.members,e[2]=c,e[3]=r,e[4]=n,e[5]=l,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=_,e[13]=E,e[14]=S,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=g}else o=e[9],m=e[10],N=e[11],_=e[12],E=e[13],S=e[14],C=e[15],v=e[16],I=e[17],R=e[18],g=e[19];let O;e[29]!==_||e[30]!==E?(O=s.jsx("div",{className:_,children:E}),e[29]=_,e[30]=E,e[31]=O):O=e[31];let b;e[32]!==O||e[33]!==S||e[34]!==C?(b=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=b):b=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==M?(A=s.jsxs(Xe,{className:"px-6 pb-6",children:[j,s.jsxs(We,{onClick:N,disabled:u,children:["Add ",M]})]}),e[37]=N,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==b||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(o,{className:v,children:[I,b,A]}),e[41]=o,e[42]=b,e[43]=A,e[44]=v,e[45]=I,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==g?(G=s.jsx(m,{open:R,onOpenChange:g,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=g,e[51]=G):G=e[51],G}function ps(t){const e=H.c(29),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,x=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=F.useDeferredValue(d),{data:p}=st();let o,m,N;if(e[0]!==p?.data?.members||e[1]!==a||e[2]!==l||e[3]!==n||e[4]!==x||e[5]!==f||e[6]!==d){const v=p?.data?.members??[];let I;e[10]!==l?(I=b=>l.includes(b.id),e[10]=l,e[11]=I):I=e[11];const R=v.filter(I);let g;e[12]!==a?(g=b=>{const j=a.toLowerCase();return b.user?.name?.toLowerCase().includes(j)||b.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=g):g=e[13];const O=R.filter(g);N="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(b=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(nt,{url:b.user?.image??void 0,fallback:lt(b.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.user?.email})]}),x?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(le,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Be,{size:16})})})}),s.jsx(_e,{children:s.jsx("p",{children:f})})]})}):s.jsx(le,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(j=>j!==b.id)),children:s.jsx(Be,{size:16})})]},b.id))}),e[0]=p?.data?.members,e[1]=a,e[2]=l,e[3]=n,e[4]=x,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=N}else o=e[7],m=e[8],N=e[9];let _;e[14]!==o||e[15]!==m?(_=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=_):_=e[16];let E;e[17]!==l||e[18]!==n?(E=v=>n([...l,...v]),e[17]=l,e[18]=n,e[19]=E):E=e[19];let S;e[20]!==h||e[21]!==l||e[22]!==c||e[23]!==E?(S=s.jsx(xs,{open:h,onOpenChange:c,selectedMemberIds:l,onAddMembers:E}),e[20]=h,e[21]=l,e[22]=c,e[23]=E,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==_||e[27]!==S?(C=s.jsxs("div",{className:N,children:[_,S]}),e[25]=N,e[26]=_,e[27]=S,e[28]=C):C=e[28],C}function gs(t){const e=H.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(F.Suspense,{fallback:l,children:s.jsx(ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Ts={owner:[],admin:[],user:[]};function Es(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Ts[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function _s(t,e,l){const n=t.permission||{},i=n.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,p]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const o of l)h[o.id]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p;else{const o=l.find(m=>m.id===a);o&&(h[a]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p)}const c=n.models||[],x=c.length===0||c.includes("*:*"),f={};if(!x)for(const a of c){const p=a.indexOf(":");if(p===-1)continue;const o=a.slice(0,p),m=a.slice(p+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:x,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Is(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===n)?.tools?.map(h=>h.name)??[];l[n]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)n.push(`${i}:${d}`);n.length>0&&(l.models=n)}return l}function bs(t,e,l){return t.kind==="builtin"?Es(t.role,e,void 0):t.kind==="custom"?_s(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ns(t){const e=H.c(6),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,r=n===void 0?"Owner membership cannot be changed":n;if(l){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(le,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Se,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let x;return e[1]!==r?(x=s.jsx(ge,{children:s.jsxs(Te,{children:[c,s.jsx(_e,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(le,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Ss(t){const e=H.c(14),{locator:l}=Ne(),n=Re(),i=yt();let r;e[0]!==l?(r=re.members(l),e[0]=l,e[1]=r):r=e[1];let d;e[2]!==n?(d=()=>n.organization.listMembers(),e[2]=n,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:x}=Ce(h);if(x||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let p;return e[10]!==i||e[11]!==a||e[12]!==t?(p=s.jsx(Cs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=p):p=e[13],p}function Cs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const{locator:r}=Ne(),d=Re(),h=ze(),c=t.kind==="builtin",x=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,p]=F.useState(c?"org":"mcp"),o=dt({resolver:mt(Qt),defaultValues:bs(t,n,i)}),m=o.formState.isValid,N=o.formState.isDirty,_=Ye({mutationFn:async u=>{const M=Is(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const w=n.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!w.includes(L)),y=w.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,w=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:M,...w?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(w?U:B,w?B:void 0),w?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:M});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const w=await d.organization.updateMemberRole({memberId:B,role:[A]});if(w?.error)throw new Error(w.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,M)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!M.role.id&&!M.role.slug,k=M.role.slug==="owner"&&!M.role.id;Ae(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:M.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),l(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}_.mutate(u)}),S=!x,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...x?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=F.useState(""),[g,O]=F.useState(!1),b=u=>{p(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:S&&s.jsxs(s.Fragment,{children:[s.jsx(le,{variant:"outline",size:"sm",onClick:e,disabled:_.isPending,children:"Cancel"}),s.jsx(le,{size:"sm",onClick:E,disabled:_.isPending||!m||!N,children:_.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?$e(t.role,!0):gt(o.watch("role.label")))}),x&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>b(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Oe,{value:I,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(Ns,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!x&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Ht,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="models"&&s.jsx(us,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="members"&&s.jsx(gs,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:I,addMemberDialogOpen:g,onAddMemberDialogOpenChange:O})]})})]})})}function As(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Rs(t){const e=H.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:l,children:n}),e[0]=l,e[1]=n,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const Os=[{role:"owner",label:"Owner"},{role:"admin",label:"Admin"},{role:"user",label:"User"}];function js(){const t=H.c(77),[e,l]=F.useState(""),[n,i]=F.useState(null),r=ht();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Ne(),x=Re(),f=ze(),{customRoles:a,refetch:p}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let N;e:{if(!h){N=null;break e}if(h==="new"){N={kind:"new"};break e}if(h.startsWith("builtin-")){N={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);N=V?{kind:"custom",role:V}:null}const _=N;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let S;t[7]!==x?(S=()=>x.organization.listMembers(),t[7]=x,t[8]=S):S=t[8];let C;t[9]!==E||t[10]!==S?(C={queryKey:E,queryFn:S},t[9]=E,t[10]=S,t[11]=C):C=t[11];const{data:v}=Ce(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;let g;t[14]!==R?(g=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=g):g=t[15];const O=g;let b;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=Os.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const rt=a.map(ae);if(b=[...V,...rt],e){const ce=e.toLowerCase();b=b.filter(at=>at.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=b}else b=t[19];let j;t[24]!==x?(j=async P=>{const V=await x.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=x,t[25]=j):j=t[25];const u=Ye({mutationFn:j,onSuccess:(P,V)=>{Ae("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),p(),_?.kind==="custom"&&_.role.id===V&&m(void 0)},onError:Ds});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Ps,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Ls,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:ws,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Ms,cellClassName:"w-24 shrink-0"},t[26]=M,t[27]=A,t[28]=k,t[29]=G):(M=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,M,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ys,children:s.jsx(bt,{size:16})})}),s.jsx(_t,{align:"end",onClick:vs,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(Nt,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let w;t[31]!==m?(w=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=w):w=t[32];const z=w;if(_){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==p||t[36]!==m?(V=()=>{p(),m(void 0)},t[35]=p,t[36]=m,t[37]=V):V=t[37],s.jsx(Ss,{target:_,onBack:P,onSaved:V},As(_))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(l(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(Oe,{value:e,onChange:l,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let $;t[42]!==m?($=()=>m("new"),t[42]=m,t[43]=$):$=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Se,{size:16}),t[44]=J):J=t[44];let X;t[45]!==$?(X=s.jsxs(le,{onClick:$,children:[J,"Create Role"]}),t[45]=$,t[46]=X):X=t[46];let ne;t[47]!==Y||t[48]!==X?(ne=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=ne):ne=t[49];let oe;t[50]!==e?(oe=e?s.jsx(De,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(De,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==b||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(St,{columns:B,data:b,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=b,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let T;t[57]!==ne||t[58]!==ie?(T=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,ne,ie]})})}),t[57]=ne,t[58]=ie,t[59]=T):T=t[59];const D=n!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(qe,{children:"Delete Role"}),t[61]=q):q=t[61];const W=n?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[q,s.jsxs(Ze,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==n?(de=s.jsxs(Xe,{children:[ee,s.jsx(We,{onClick:()=>{n?.id&&u.mutate(n.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=n,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(Qe,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Ke,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let Ie;return t[74]!==T||t[75]!==ue?(Ie=s.jsxs(te,{children:[T,ue]}),t[74]=T,t[75]=ue,t[76]=Ie):Ie=t[76],Ie}function vs(t){return t.stopPropagation()}function ys(t){return t.stopPropagation()}function Ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function ws(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,l=[];return e.allowsAllStaticPermissions?l.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&l.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?l.push("All connections"):e.connectionCount&&e.connectionCount>0&&l.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:l.length>0?l.join(", "):"No permissions"})}function Ls(t){return t.kind==="builtin"?s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(xe,{variant:"outline",className:"text-xs",children:"Custom"})}function Ps(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",$e(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Fe,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ds(t,e){Ae("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function ks(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ft,{fallback:e,children:s.jsx(F.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(js,{})})}),t[1]=l):l=t[1],l}function hn(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rs,{area:"roles",children:s.jsx(ks,{})}),t[0]=e):e=t[0],e}export{hn as default};
@@ -1 +0,0 @@
1
- import{c as p,j as t,E as P,r as j,w,B as S,t as y}from"./index-BxSnvyHv.js";import{i as k}from"./AlertCircle-Cw9yCE-i.js";import{s as z}from"./Plus-ByMs73Uz.js";import{s as E}from"./User01-Gffdi4XN.js";import{t as F}from"./Users01-DxScEBVx.js";import{e as $,d as I,D as O,a as A,h as R,c as T}from"./dialog-C5eQfWDF.js";import{I as N}from"./input-CwmyLALb.js";import{L as g}from"./label-CoWA5D5R.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-CIhUgwRQ.js";import{S as H}from"./skeleton-BIGkqEfs.js";import{T as K}from"./textarea-DP6Y400s.js";import{P as b}from"./index-CGYl8LK_.js";import{c as W}from"./settings-section-DdXoByAD.js";import{u as Y,a as G}from"./use-secrets-Duv1Im0X.js";import{R as J}from"./require-capability-C97tWNuh.js";import"./X-Dm89h948.js";import"./tooltip-D_SCaRHR.js";import"./ChevronUp-KOrd5cUU.js";import"./ChevronDown-CL2bRCzf.js";import"./sidebar-BAnGqNSt.js";import"./LayoutLeft-8SPosLnY.js";import"./use-mobile-urLns8jv.js";import"./card-CULDlrA-.js";import"./ArrowUpRight-CP6scA3R.js";import"./studio-tools-Gw5yCtO3.js";import"./use-capability-Bbp5deR3.js";import"./access-gate-DGQ4SGrz.js";import"./capability-load-error-DqTvJvx-.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function $e(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{$e as default};
@@ -1,4 +0,0 @@
1
- import{r as D,at as ot,c as U,j as s,H as Pe,I as ae,C as oe,n as xe,J as Re,M as Le,d as he,K as te,t as Z,B as ee,p as J,z as rt,l as ne,m as at,b as ct,E as dt,x as ut}from"./index-BxSnvyHv.js";import{c as $e,e as De,d as Fe,D as mt,a as Ke,h as ft,b as ht}from"./dialog-C5eQfWDF.js";import{g as pt,b as xt,a as gt,D as vt}from"./drawer-Cpzxp9wL.js";import{u as bt}from"./use-mobile-urLns8jv.js";import{S as Se,u as jt,m as yt,a as ge}from"./chat-context-DLYBbFGY.js";import{C as St}from"./checkbox-CCG4Kv9w.js";import{I as le}from"./input-CwmyLALb.js";import{S as kt,a as Nt,b as Ct,c as wt,d as It}from"./select-CIhUgwRQ.js";import{S as Y}from"./skeleton-BIGkqEfs.js";import{i as Be,b as Ue,c as _t,a as Mt,s as Et}from"./Settings02-CqKjAMaI.js";import{c as Ot,a as At,i as Tt}from"./Tool01-Ejks2s80.js";import{i as zt}from"./Key01-Bez2UiK4.js";import{i as We}from"./SearchMd-DSp0OYrz.js";import{b as ve,u as Pt,a as Rt}from"./use-ai-providers-gqMxKR3J.js";import{g as be}from"./ai-providers-logos-DD3qZ33J.js";import{i as Lt}from"./Monitor01-nDZ8jgXm.js";import{i as $t}from"./AlertCircle-Cw9yCE-i.js";import{u as pe}from"./studio-tools-Gw5yCtO3.js";import{i as Dt}from"./ChevronRight-DjftMIpm.js";import{A as Ft}from"./avatar-KoDyzfrm.js";import{S as ke,a as Ne,b as He}from"./settings-section-DdXoByAD.js";import{s as Ve}from"./Eye-C3frWI7b.js";import{a as me,b as fe,C as Kt}from"./connect-desktop-dialog-BVw0SkEq.js";import{t as Ce}from"./ChevronDown-CL2bRCzf.js";import{a as Bt}from"./Image01-Cia_sV5k.js";import{t as Ut}from"./Stars01-DgTAPZ52.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,I)=>{for(w=String(w);w.length<I;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
2
- font-size: .6rem;
3
- font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=a=>{l=a},r}function we(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Wt=(i,e)=>Math.abs(i-e)<1.01,Ht=(i,e,t)=>{let l;return function(...n){i.clearTimeout(l),l=i.setTimeout(()=>e.apply(this,n),t)}},Ie=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Vt=i=>i,qt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),l=[];for(let n=e;n<=t;n++)l.push(n);return l},Gt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;const n=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(n(Ie(t)),!l.ResizeObserver)return()=>{};const o=new l.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ie(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},Me=typeof window>"u"?!0:"onscrollend"in window,Xt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;let n=0;const o=i.options.useScrollendEvent&&Me?()=>{}:Ht(l,()=>{e(n,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:m,isRtl:h}=i.options;n=m?t.scrollLeft*(h&&-1||1):t.scrollTop,o(),e(n,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&Me;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Yt=(i,e,t)=>{if(e?.borderBoxSize){const l=e.borderBoxSize[0];if(l)return Math.round(l[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Qt=(i,{adjustments:e=0,behavior:t},l)=>{var n,o;const r=i+e;(o=(n=l.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[l.options.horizontal?"left":"top"]:r,behavior:t})};class Jt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,l,n;return((n=(l=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:l.now)==null?void 0:n.call(l))??Date.now()},this.observer=(()=>{let t=null;const l=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=l())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=l())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=l())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([l,n])=>{typeof n>"u"&&delete t[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Vt,rangeExtractor:qt,onChange:()=>{},measureElement:Yt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var l,n;(n=(l=this.options).onChange)==null||n.call(l,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.maybeNotify();return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,l)=>{const n=new Map,o=new Map;for(let r=l-1;r>=0;r--){const a=t[r];if(n.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,l,n,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,u),h=new Array(a).fill(void 0);for(let f=0;f<u;f++){const g=m[f];g&&(h[g.lane]=f)}for(let f=u;f<t;f++){const g=o(f),x=this.laneAssignments.get(f);let j,k;const w=c==="estimate"||d.has(g);if(x!==void 0&&this.options.lanes>1){j=x;const b=h[j],N=b!==void 0?m[b]:void 0;k=N?N.end+this.options.gap:l+n}else{const b=this.options.lanes===1?m[f-1]:this.getFurthestMeasurement(m,f);k=b?b.end+this.options.gap:l+n,j=b?b.lane:f%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(f,j)}const I=d.get(g),_=typeof I=="number"?I:this.options.estimateSize(f),M=k+_;m[f]={index:f,start:k,size:_,end:M,key:g,lane:j},h[j]=f}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,l,n,o)=>this.range=t.length>0&&l>0?Zt({measurements:t,outerSize:l,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,l=null;const n=this.calculateRange();return n&&(t=n.startIndex,l=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,l]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,l]},(t,l,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:l,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const l=this.options.indexAttribute,n=t.getAttribute(l);return n?parseInt(n,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var l;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((l=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:l.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const l=this.indexFromElement(t),n=this.options.getItemKey(l),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,l)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=l-r;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,l)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,l)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=l[a];n.push(c)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const l=this.getMeasurements();if(l.length!==0)return we(l[qe(0,l.length-1,n=>we(l[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,l,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();l==="auto"&&(l=t>=r+o?"end":"start"),l==="center"?t+=(n-o)/2:l==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,l="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(l==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)l="end";else if(r.start<=o+this.options.scrollPaddingStart)l="start";else return[o,l];if(l==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),l];const a=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,l,r.size),l]},this.scrollToOffset=(t,{align:l="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,l),r=this.now();this.scrollState={index:null,align:l,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:l="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,l);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:l="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:l,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const l=this.getMeasurements();let n;if(l.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=l[l.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=l.length-1;for(;r>=0&&o.some(a=>a===null);){const a=l[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:l,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:l},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const l=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=l?l[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&Wt(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const qe=(i,e,t,l)=>{for(;i<=e;){const n=(i+e)/2|0,o=t(n);if(o<l)i=n+1;else if(o>l)e=n-1;else return n}return i>0?i-1:0};function Zt({measurements:i,outerSize:e,scrollOffset:t,lanes:l}){const n=i.length-1,o=c=>i[c].start;if(i.length<=l)return{startIndex:0,endIndex:n};let r=qe(0,n,o,t),a=r;if(l===1)for(;a<n&&i[a].end<t+e;)a++;else if(l>1){const c=Array(l).fill(0);for(;a<n&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(l).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%l),a=Math.min(n,a+(l-1-a%l))}return{startIndex:r,endIndex:a}}const Ee=typeof document<"u"?D.useLayoutEffect:D.useEffect;function es({useFlushSync:i=!0,...e}){const t=D.useReducer(()=>({}),{})[1],l={...e,onChange:(o,r)=>{var a;i&&r?ot.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=D.useState(()=>new Jt(l));return n.setOptions(l),Ee(()=>n._didMount(),[]),Ee(()=>n._willUpdate()),n}function ts(i){return es({observeElementRect:Gt,observeElementOffset:Xt,scrollToFn:Qt,...i})}const Ge=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function ce(i){if(i)return Ge.find(e=>e.id===i)}const Oe=4;function re(i){const e=U.c(8),{logo:t,name:l,description:n,onClick:o}=i;let r;e[0]!==t||e[1]!==l?(r=t?s.jsx("img",{src:t,alt:l,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Ft,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let a;return e[3]!==n||e[4]!==l||e[5]!==o||e[6]!==r?(a=s.jsx(He,{onClick:o,icon:r,title:l,description:n}),e[3]=n,e[4]=l,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Xe(i){const e=U.c(32),{providers:t,onSelect:l,onShowAll:n}=i;let o;e[0]!==t?(o=t.find(ns),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==l||e[4]!==t){let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=(v,E)=>{const A=c[v.id]??Number.MAX_SAFE_INTEGER,z=c[E.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=I):I=e[6];const _=t.filter(ls).sort(I);let M;e[7]!==t?(M=t.find(is),e[7]=t,e[8]=M):M=e[8];const b=M;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ce("openai"),e[9]=N):N=e[9];const S=N;let C;e[10]!==l?(C=v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"provider",provider:v})},v.id),e[10]=l,e[11]=C):C=e[11];let p,y;e[12]!==l||e[13]!==b?(p=b&&S?[s.jsx(re,{logo:S.logo,name:S.name,description:S.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:S})},S.id)]:[],y=b?[...Ge.filter(ss).map(v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:v})},v.id)),s.jsx(re,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>l({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=l,e[13]=b,e[14]=p,e[15]=y):(p=e[14],y=e[15]),d=[..._.map(C),...p,...y],e[3]=l,e[4]=t,e[5]=d}else d=e[5];const u=d,m=u.length-Oe,h=!!n&&m>0;let f;e[16]!==u||e[17]!==h?(f=h?u.slice(0,Oe):u,e[16]=u,e[17]=h,e[18]=f):f=e[18];const g=f;let x;e[19]!==r||e[20]!==l?(x=r&&s.jsx(ke,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(Ne,{className:"relative",children:s.jsx(re,{logo:r.logo,name:r.name,description:r.description,onClick:()=>l({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=l,e[21]=x):x=e[21];let j;e[22]!==m||e[23]!==n||e[24]!==h?(j=h&&s.jsx(He,{onClick:n,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx(Dt,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=n,e[24]=h,e[25]=j):j=e[25];let k;e[26]!==j||e[27]!==g?(k=s.jsx(ke,{children:s.jsxs(Ne,{children:[g,j]})}),e[26]=j,e[27]=g,e[28]=k):k=e[28];let w;return e[29]!==x||e[30]!==k?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[x,k]}),e[29]=x,e[30]=k,e[31]=w):w=e[31],w}function ss(i){return i.id!=="openai"}function is(i){return i.id==="openai-compatible"}function ls(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function ns(i){return i.id==="deco"}const os=Pe({label:ae().optional(),apiKey:ae().min(1,"API key is required")});function rs(i){const e=U.c(60),{providerId:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:Re(os),defaultValues:{label:"",apiKey:""}},e[0]=u):u=e[0];const{register:m,handleSubmit:h,formState:f}=Le(u),{errors:g}=f;let x;e[1]!==t||e[2]!==r?(x=async H=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey})},e[1]=t,e[2]=r,e[3]=x):x=e[3];let j;e[4]!==n||e[5]!==o||e[6]!==a?(j=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Key saved successfully"),n()},e[4]=n,e[5]=o,e[6]=a,e[7]=j):j=e[7];let k;e[8]!==x||e[9]!==j?(k={mutationFn:x,onSuccess:j,onError:as},e[8]=x,e[9]=j,e[10]=k):k=e[10];const{mutate:w,isPending:I,error:_}=he(k);let M;e[11]!==w?(M=H=>w(H),e[11]=w,e[12]=M):M=e[12];let b;e[13]!==h||e[14]!==M?(b=h(M),e[13]=h,e[14]=M,e[15]=b):b=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=N):N=e[16];let S;e[17]!==m?(S=m("label"),e[17]=m,e[18]=S):S=e[18];let C;e[19]!==S?(C=s.jsxs("div",{className:"space-y-1",children:[N,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[19]=S,e[20]=C):C=e[20];let p;e[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=p):p=e[21];const y=c?"text":"password";let v;e[22]!==m?(v=m("apiKey"),e[22]=m,e[23]=v):v=e[23];let E;e[24]!==y||e[25]!==v?(E=s.jsx(le,{type:y,placeholder:"sk-...",...v,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=y,e[25]=v,e[26]=E):E=e[26];let A;e[27]!==c?(A=()=>d(!c),e[27]=c,e[28]=A):A=e[28];const z=c?"Hide API key":"Show API key";let O;e[29]!==c?(O=c?s.jsx(Be,{size:14}):s.jsx(Ve,{size:14}),e[29]=c,e[30]=O):O=e[30];let R;e[31]!==A||e[32]!==z||e[33]!==O?(R=s.jsx("button",{type:"button",onClick:A,"aria-label":z,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:O}),e[31]=A,e[32]=z,e[33]=O,e[34]=R):R=e[34];let P;e[35]!==E||e[36]!==R?(P=s.jsxs("div",{className:"relative",children:[E,R]}),e[35]=E,e[36]=R,e[37]=P):P=e[37];let L;e[38]!==g.apiKey?(L=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[38]=g.apiKey,e[39]=L):L=e[39];let F;e[40]!==P||e[41]!==L?(F=s.jsxs("div",{className:"space-y-1",children:[p,P,L]}),e[40]=P,e[41]=L,e[42]=F):F=e[42];let W;e[43]!==_?(W=_&&s.jsx("p",{className:"text-xs text-destructive",children:_.message}),e[43]=_,e[44]=W):W=e[44];let B;e[45]!==I||e[46]!==l?(B=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:I,children:"Cancel"}),e[45]=I,e[46]=l,e[47]=B):B=e[47];const G=I?"Saving...":"Save Key";let K;e[48]!==I||e[49]!==G?(K=s.jsx(ee,{type:"submit",size:"sm",disabled:I,children:G}),e[48]=I,e[49]=G,e[50]=K):K=e[50];let V;e[51]!==B||e[52]!==K?(V=s.jsxs($e,{children:[B,K]}),e[51]=B,e[52]=K,e[53]=V):V=e[53];let T;return e[54]!==C||e[55]!==F||e[56]!==W||e[57]!==V||e[58]!==b?(T=s.jsxs("form",{onSubmit:b,className:"space-y-3",children:[C,F,W,V]}),e[54]=C,e[55]=F,e[56]=W,e[57]=V,e[58]=b,e[59]=T):T=e[59],T}function as(i){Z.error(`Failed to save key: ${i.message}`)}const cs=Pe({label:ae().optional(),baseUrl:ae().min(1,"Base URL is required"),apiKey:ae().optional()});function ds(i){const e=U.c(71),{preset:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Re(cs),e[0]=u):u=e[0];const m=t?.defaultBaseUrl??"";let h;e[1]!==m?(h={resolver:u,defaultValues:{label:"",baseUrl:m,apiKey:""}},e[1]=m,e[2]=h):h=e[2];const{register:f,handleSubmit:g,formState:x}=Le(h),{errors:j}=x;let k;e[3]!==t||e[4]!==r?(k=async se=>{const nt=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:nt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==a?(w=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Connection saved successfully"),n()},e[6]=n,e[7]=o,e[8]=a,e[9]=w):w=e[9];let I;e[10]!==k||e[11]!==w?(I={mutationFn:k,onSuccess:w,onError:us},e[10]=k,e[11]=w,e[12]=I):I=e[12];const{mutate:_,isPending:M,error:b}=he(I),N=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let C;e[13]!==_?(C=se=>_(se),e[13]=_,e[14]=C):C=e[14];let p;e[15]!==g||e[16]!==C?(p=g(C),e[15]=g,e[16]=C,e[17]=p):p=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=y):y=e[18];let v;e[19]!==f?(v=f("label"),e[19]=f,e[20]=v):v=e[20];let E;e[21]!==N||e[22]!==v?(E=s.jsxs("div",{className:"space-y-1",children:[y,s.jsx(le,{placeholder:N,...v,className:"h-8 text-sm"})]}),e[21]=N,e[22]=v,e[23]=E):E=e[23];let A;e[24]!==S||e[25]!==j||e[26]!==t?.defaultBaseUrl||e[27]!==f?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...f("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[24]=S,e[25]=j,e[26]=t?.defaultBaseUrl,e[27]=f,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let O;e[29]!==z?(O=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=O):O=e[30];const R=c?"text":"password";let P;e[31]!==f?(P=f("apiKey"),e[31]=f,e[32]=P):P=e[32];let L;e[33]!==R||e[34]!==P?(L=s.jsx(le,{type:R,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=R,e[34]=P,e[35]=L):L=e[35];let F;e[36]!==c?(F=()=>d(!c),e[36]=c,e[37]=F):F=e[37];const W=c?"Hide API key":"Show API key";let B;e[38]!==c?(B=c?s.jsx(Be,{size:14}):s.jsx(Ve,{size:14}),e[38]=c,e[39]=B):B=e[39];let G;e[40]!==F||e[41]!==W||e[42]!==B?(G=s.jsx("button",{type:"button",onClick:F,"aria-label":W,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:B}),e[40]=F,e[41]=W,e[42]=B,e[43]=G):G=e[43];let K;e[44]!==L||e[45]!==G?(K=s.jsxs("div",{className:"relative",children:[L,G]}),e[44]=L,e[45]=G,e[46]=K):K=e[46];let V;e[47]!==O||e[48]!==K?(V=s.jsxs("div",{className:"space-y-1",children:[O,K]}),e[47]=O,e[48]=K,e[49]=V):V=e[49];let T;e[50]!==t?(T=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[50]=t,e[51]=T):T=e[51];let H;e[52]!==b?(H=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[52]=b,e[53]=H):H=e[53];let q;e[54]!==M||e[55]!==l?(q=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:M,children:"Cancel"}),e[54]=M,e[55]=l,e[56]=q):q=e[56];const Q=M?"Saving...":"Save Connection";let X;e[57]!==M||e[58]!==Q?(X=s.jsx(ee,{type:"submit",size:"sm",disabled:M,children:Q}),e[57]=M,e[58]=Q,e[59]=X):X=e[59];let $;e[60]!==q||e[61]!==X?($=s.jsxs($e,{children:[q,X]}),e[60]=q,e[61]=X,e[62]=$):$=e[62];let de;return e[63]!==E||e[64]!==A||e[65]!==V||e[66]!==T||e[67]!==H||e[68]!==$||e[69]!==p?(de=s.jsxs("form",{onSubmit:p,className:"space-y-3",children:[E,A,V,T,H,$]}),e[63]=E,e[64]=A,e[65]=V,e[66]=T,e[67]=H,e[68]=$,e[69]=p,e[70]=de):de=e[70],de}function us(i){Z.error(`Failed to save connection: ${i.message}`)}const ms={kind:"closed"};function fs(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function hs(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ps({open:i,onOpenChange:e,initialProvider:t}){const n=ve()?.providers??[],{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useReducer(fs,ms),u=D.useRef(!1);D.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const m=()=>{u.current=!1,d({type:"close"}),e(!1)},h=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:f}=he({mutationFn:async({providerId:p,code:y,stateToken:v,label:E})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:p,code:y,stateToken:v,label:E}),p),onSuccess:p=>{J("ai_provider_oauth_succeeded",{provider_id:p}),h();const y=n.find(v=>v.id===p);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(p,y)=>{J("ai_provider_oauth_failed",{provider_id:y.providerId,error:p.message}),Z.error(`OAuth connection failed: ${p.message}`),d({type:"oauth-failed"})}}),{mutate:g}=he({mutationFn:async p=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:p}),p),onSuccess:p=>{J("ai_provider_provision_succeeded",{provider_id:p}),h();const y=n.find(v=>v.id===p);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(p,y)=>{J("ai_provider_provision_failed",{provider_id:y,error:p.message}),d({type:"provision-error",error:p.message})}}),x=async p=>{const{provider:y}=p,v=p.kind==="openai-compatible"?p.preset?.id??null:null,E=y.supportedMethods.includes("oauth-pkce"),A=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){J("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),g(y.id);return}if(E){J("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const O=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!O?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:O.stateToken}),window.open(O.url,"AiProviderOAuth","width=600,height=700")}catch(O){Z.error(`Failed to start OAuth: ${O instanceof Error?O.message:String(O)}`)}return}A&&(J("ai_provider_connect_clicked",{provider_id:y.id,...v!==null?{preset_id:v}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:v}))},j=D.useRef(x);j.current=x;const k=D.useRef(t);k.current=t,D.useEffect(()=>{!k.current||c.kind!=="grid"||u.current||(u.current=!0,j.current(k.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,I=c.kind==="oauth-pending"?c.providerId:null;D.useEffect(()=>{if(c.kind!=="oauth-pending")return;let p=!1;const y=c.stateToken,v=c.providerId,E=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:O,stateToken:R}=z.data;if(R!==y){Z.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}p=!0;const P=n.find(L=>L.id===v);f({providerId:v,code:O,stateToken:y,label:P?.name??v})};window.addEventListener("message",E);const A=setTimeout(()=>{p||(J("ai_provider_oauth_timeout",{provider_id:v}),d({type:"oauth-failed"}),Z.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(A)}},[c.kind,w,I,f]);const _=hs(c),M=_?n.find(p=>p.id===_):null,N=(c.kind==="form"&&c.presetId?ce(c.presetId):null)?.name??M?.name??"Connect an AI provider",S=c.kind!=="grid"&&c.kind!=="closed",C=()=>{t?m():d({type:"back"})};return s.jsx(De,{open:c.kind!=="closed",onOpenChange:p=>!p&&m(),children:s.jsxs(Fe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(mt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[S&&s.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Back",className:"h-7 w-7",onClick:C,children:s.jsx(Ue,{size:16})}),s.jsx(Ke,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(ft,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Xe,{providers:n,onSelect:x}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(ds,{preset:c.presetId?ce(c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{h(),m()}}):s.jsx(rs,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{h(),m()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Se,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Se,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx($t,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),g(c.providerId)},children:"Retry"})]})]})]})})}function xs(){const i=U.c(7),{org:e}=oe(),t=pe();let l;i[0]!==e.id?(l=te.defaultBrand(e.id),i[0]=e.id,i[1]=l):l=i[1];let n;i[2]!==t?(n=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(gs)??null},i[2]=t,i[3]=n):n=i[3];let o;i[4]!==l||i[5]!==n?(o={queryKey:l,queryFn:n},i[4]=l,i[5]=n,i[6]=o):o=i[6];const{data:r}=at(o);return r??null}function gs(i){return i.isDefault&&!i.archivedAt}function vs(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),l=t?t.value:e[0]?.value;return typeof l=="string"?l:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function bs(i){const e=U.c(50);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:l,description:n,onLocalRuntimePicked:o}=t,{org:r}=oe(),{localMode:a}=rt(),c=xs(),d=jt(),u=yt(),[m,h]=D.useState(null),[f,g]=D.useState(!1),[x,j]=D.useState(!1),k=ve();let w;e[2]!==k?.providers?(w=k?.providers??[],e[2]=k?.providers,e[3]=w):w=e[3];const I=w;let _;if(e[4]!==d.capabilities||e[5]!==d.online){if(_=[],d.online){if(d.capabilities.includes("claude-code")){let $;e[7]===Symbol.for("react.memo_cache_sentinel")?($={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(me,{size:16})},e[7]=$):$=e[7],_.push($)}if(d.capabilities.includes("codex")){let $;e[8]===Symbol.for("react.memo_cache_sentinel")?($={option:"codex-desktop",label:"Codex",icon:s.jsx(fe,{size:16})},e[8]=$):$=e[8],_.push($)}}e[4]=d.capabilities,e[5]=d.online,e[6]=_}else _=e[6];const M=_.length>0&&u!==null,b=r.name;let N;e[9]!==c?(N=c?vs(c):null,e[9]=c,e[10]=N):N=e[10];const S=N,C=c?.favicon??c?.logo??null,p=l??(b?`${b} is ready for agents`:"Your agents are almost ready"),y=n??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":a?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),v=!!(C||S);let E;e[11]!==S?(E=S?{backgroundColor:`${S}18`,borderColor:`${S}30`}:void 0,e[11]=S,e[12]=E):E=e[12];const A=E,z=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let O;e[13]!==z||e[14]!==A||e[15]!==C||e[16]!==d.online||e[17]!==S?(O=C?s.jsx("div",{className:z,style:A,children:s.jsx("img",{src:C,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>j(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:ne(z,"cursor-pointer transition-colors hover:bg-accent"),style:A,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Lt,{size:24,style:S?{color:S}:void 0,className:ne(!S&&"text-muted-foreground")}),d.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[13]=z,e[14]=A,e[15]=C,e[16]=d.online,e[17]=S,e[18]=O):O=e[18];let R;e[19]!==p?(R=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:p}),e[19]=p,e[20]=R):R=e[20];let P;e[21]!==y?(P=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:y}),e[21]=y,e[22]=P):P=e[22];let L;e[23]!==R||e[24]!==P?(L=s.jsxs("div",{className:"space-y-2",children:[R,P]}),e[23]=R,e[24]=P,e[25]=L):L=e[25];let F;e[26]!==O||e[27]!==L?(F=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[O,L]}),e[26]=O,e[27]=L,e[28]=F):F=e[28];let W;e[29]!==u||e[30]!==M||e[31]!==_||e[32]!==o?(W=M&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:_.map($=>s.jsxs(ee,{variant:"default",className:"gap-2",onClick:()=>{u?.setPendingAgentOption($.option),o?.($.option)},children:[$.icon,"Use ",$.label]},$.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=u,e[30]=M,e[31]=_,e[32]=o,e[33]=W):W=e[33];let B,G;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=$=>h($),G=()=>g(!0),e[34]=B,e[35]=G):(B=e[34],G=e[35]);let K;e[36]!==I?(K=s.jsx("div",{className:"w-full",children:s.jsx(Xe,{providers:I,onSelect:B,onShowAll:G})}),e[36]=I,e[37]=K):K=e[37];const V=m!==null||f;let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=$=>{$||(h(null),g(!1))},e[38]=T):T=e[38];const H=m??void 0;let q;e[39]!==V||e[40]!==H?(q=s.jsx(ps,{open:V,onOpenChange:T,initialProvider:H}),e[39]=V,e[40]=H,e[41]=q):q=e[41];let Q;e[42]!==x?(Q=s.jsx(Kt,{open:x,onOpenChange:j}),e[42]=x,e[43]=Q):Q=e[43];let X;return e[44]!==W||e[45]!==K||e[46]!==q||e[47]!==Q||e[48]!==F?(X=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[F,W,K,q,Q]}),e[44]=W,e[45]=K,e[46]=q,e[47]=Q,e[48]=F,e[49]=X):X=e[49],X}function je(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const ys=["bg-destructive","bg-warning","bg-success","bg-success"],Ss=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function Ns(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Cs={text:{icon:s.jsx(At,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Bt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(_t,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Ot,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(We,{className:"size-3.5"}),label:"Web search"}};function ws(i){const e=U.c(5),{capability:t}=i;let l;e[0]!==t?(l=Cs[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=l):l=e[1];const n=l;let o;return e[2]!==n.icon||e[3]!==n.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function Is(i){const e=U.c(49),{model:t,compact:l}=i,n=l===void 0?!1:l;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=je(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(n){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let S;e[7]!==r?(S=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=S):S=e[8];let C;e[9]!==t.limits?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=C):C=e[10];let p;return e[11]!==b||e[12]!==N||e[13]!==S||e[14]!==C?(p=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,N,S,C]}),e[11]=b,e[12]=N,e[13]=S,e[14]=C,e[15]=p):p=e[15],p}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let h;e[21]!==d?(h=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=h):h=e[22];let f;e[23]!==m||e[24]!==h?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,h]}),e[23]=m,e[24]=h,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let x;e[28]!==u||e[29]!==f||e[30]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=x):x=e[31];let j;e[32]!==t.capabilities?(j=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(_s)}),e[32]=t.capabilities,e[33]=j):j=e[33];let k;e[34]!==t.limits?(k=t.limits?.contextWindow&&(()=>{const{level:b,label:N,description:S}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(C=>s.jsx("div",{className:ne("w-2 h-2 rounded-full",C<=b?ys[b-1]:"bg-muted")},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",S]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=k):k=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let I;e[38]!==o||e[39]!==r?(I=(o!=null||r!=null)&&(()=>{const{level:b,label:N}=o!=null?Ns(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(S=>s.jsx("span",{className:ne("text-sm font-bold leading-none",S<=b?Ss[b-1]:"text-muted-foreground/20"),children:"$"},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=I):I=e[40];let _;e[41]!==k||e[42]!==w||e[43]!==I?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[k,w,I]}),e[41]=k,e[42]=w,e[43]=I,e[44]=_):_=e[44];let M;return e[45]!==_||e[46]!==x||e[47]!==j?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[x,j,_]}),e[45]=_,e[46]=x,e[47]=j,e[48]=M):M=e[48],M}function _s(i){return s.jsx(ws,{capability:i},i)}function Ye(i){const e=U.c(19),{model:t,placeholder:l,isLoading:n}=i,o=l===void 0?"Select model":l;if(n===void 0?!1:n){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Y,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(Y,{className:"w-16 h-3 hidden md:block"})]}),e[0]=x):x=e[0],x}if(!t){let x;e[1]!==o?(x=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=x):x=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ce,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=j):j=e[3];let k;return e[4]!==x?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,j]}),e[4]=x,e[5]=k):k=e[5],k}let a;e[6]!==t?(a=je(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=be(t),e[8]=t,e[9]=d):d=e[9];const u=d;let m;e[10]!==t.title||e[11]!==u?(m=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=m):m=e[12];let h;e[13]!==c?(h=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ce,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==m||e[17]!==h?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,h,f]}),e[16]=m,e[17]=h,e[18]=g):g=e[18],g}const Ms=["vision","image","file","audio","video"],Qe=["image/png","image/jpeg","image/gif","image/webp"],Je=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ye(i){const e=i?.capabilities;return e?Ms.some(t=>e.includes(t)):!1}function Di(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],l=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(l&&Qe.includes(i)||n&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ye(e)&&Je.includes(i))}function Fi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Qe),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ye(i)&&t.push(...Je),t.join(",")}function Ki(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ye(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const Ze=["smarter","faster","cheaper"],et={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Es=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Os=Es.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),As="google/gemini-2.5-pro",Ae=new Map;function Ts(i){const e=Ae.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:l,prefix:n}of Os)if(i.startsWith(n)){if(n===As&&i.length>n.length&&i[n.length]==="-"){const r=i[n.length+1];if(!r||!/\d/.test(r))continue}t=l;break}return Ae.set(i,t),t}function Te(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const l=Ts(t.modelId);e[l??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((l,n)=>l.title.localeCompare(n.title));return e}const tt="mesh:model-shortlist:",zs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ps(i){try{const e=localStorage.getItem(tt+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Rs(i,e){localStorage.setItem(tt+i,JSON.stringify([...e]))}function Ls(i){const e=U.c(21),{model:t,onHover:l}=i;let n;e[0]!==t?(n=je(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==t?(a=be(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==l?(d=()=>l(t),e[4]=t,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=e[11];let h;e[12]!==r?(h=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=h):h=e[13];let f;e[14]!==m||e[15]!==h?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,h]}),e[14]=m,e[15]=h,e[16]=f):f=e[16];let g;return e[17]!==d||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,f]}),e[17]=d,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function $s(i){const e=U.c(10),{error:t,onRetry:l}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(ut,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Et,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:l,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=l,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ds(){const i=U.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Fs)}),i[0]=e):e=i[0],e}function Fs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Y,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Y,{className:"flex-1 h-4"}),s.jsx(Y,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ze(i){const e=U.c(12),{label:t,models:l,onSelect:n,onHover:o}=i;if(l.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==l||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=u=>s.jsx("div",{onClick:()=>n(u),className:"cursor-pointer",children:s.jsx(Ls,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=l.map(d),e[2]=l,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Ks(i){const e=U.c(21),{model:t,isChecked:l,onToggle:n,onHover:o}=i,[r,a]=D.useState(l);r!==l&&a(l);let c;e[0]!==t?(c=be(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==t.modelId||e[6]!==n?(m=()=>{a(Bs),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=m):m=e[7];let h;e[8]!==r||e[9]!==m?(h=s.jsx(St,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=h):h=e[10];let f;e[11]!==d||e[12]!==t.title?(f=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==h||e[18]!==f||e[19]!==g?(x=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[h,f,g]}),e[16]=u,e[17]=h,e[18]=f,e[19]=g,e[20]=x):x=e[20],x}function Bs(i){return!i}function Us(i){const e=[];for(const t of Ze)if(i[t].length>0){e.push({type:"header",label:et[t]});for(const l of i[t])e.push({type:"model",model:l})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ws({items:i,shortlistSet:e,onToggle:t,onHover:l}){const n=D.useRef(null),o=ts({count:i.length,getScrollElement:()=>n.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Ks,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:l})},r.key):null})})})}function Hs(i){const e=U.c(23),{keyId:t,searchTerm:l,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=Rt(t),u=c?d.filter(c):d.filter(Vs);let m;e[0]!==t?(m=()=>(t?Ps(t):null)??zs,e[0]=t,e[1]=m):m=e[1];const[h,f]=D.useState(m),[,g]=D.useTransition();let x;e[2]!==t||e[3]!==g?(x=p=>{t&&g(()=>{f(y=>{const v=new Set(y);return v.has(p)?v.delete(p):v.add(p),Rs(t,v),v})})},e[2]=t,e[3]=g,e[4]=x):x=e[4];const j=x,k=l.toLowerCase().trim(),w=p=>k?p.filter(y=>y.title.toLowerCase().includes(k)||y.modelId.toLowerCase().includes(k)):p;if(r){const p=Te(w(u)),y=Us(p);let v;e[5]!==h?(v=O=>h.has(O.modelId),e[5]=h,e[6]=v):v=e[6];const E=u.filter(v).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ue,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,"Back"]}),e[8]=a,e[9]=z):z=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[E," selected"]})]}),s.jsx(Ws,{items:y,shortlistSet:h,onToggle:j,onHover:n})]})}let I;e[10]!==h?(I=p=>h.has(p.modelId),e[10]=h,e[11]=I):I=e[11];const _=u.filter(I),M=_.length>0?_:u,b=Te(w(M));let N;e[12]!==b||e[13]!==n||e[14]!==o?(N=Ze.map(p=>s.jsx(ze,{label:et[p],models:b[p],onSelect:o,onHover:n},p)),e[12]=b,e[13]=n,e[14]=o,e[15]=N):N=e[15];let S;e[16]!==b.other||e[17]!==n||e[18]!==o?(S=s.jsx(ze,{label:"Other",models:b.other,onSelect:o,onHover:n}),e[16]=b.other,e[17]=n,e[18]=o,e[19]=S):S=e[19];let C;return e[20]!==N||e[21]!==S?(C=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,S]}),e[20]=N,e[21]=S,e[22]=C):C=e[22],C}function Vs(i){return i.asyncResearch!==!0}function qs(){const i=U.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(Y,{className:"size-4 shrink-0"}),s.jsx(Y,{className:"flex-1 h-6"}),s.jsx(Y,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Gs)})]}),i[1]=t):t=i[1];let l;i[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(Y,{className:"size-6 shrink-0"}),s.jsx(Y,{className:"h-6 w-32"})]}),i[2]=l):l=i[2];let n;i[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Y,{className:"h-6 w-20 rounded-md"}),s.jsx(Y,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=n):n=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Y,{className:"h-4 w-24"}),s.jsx(Y,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Y,{className:"h-4 w-16"}),s.jsx(Y,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Gs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Y,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Y,{className:"flex-1 h-4"}),s.jsx(Y,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function st(i){const e=U.c(49),{onClose:t,credentialId:l,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=D.useState(null),[u,m]=D.useState(""),[h,f]=D.useState(!1),g=D.useRef(null),x=ve(),j=Pt();let k;e[0]!==x?.providers?(k=Object.fromEntries((x?.providers??[]).map(Qs)),e[0]=x?.providers,e[1]=k):k=e[1];const w=k,I=ct(),{org:_}=oe();let M;e[2]!==n?(M=T=>{n(T),d(null)},e[2]=n,e[3]=M):M=e[3];const b=M;let N;e[4]!==l||e[5]!==t||e[6]!==r?(N=T=>{l&&(r(T),m(""),t())},e[4]=l,e[5]=t,e[6]=r,e[7]=N):N=e[7];const S=N;if(j.length===0){let T;return e[8]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(bs,{})}),e[8]=T):T=e[8],T}let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=C):C=e[9];const p=h?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=T=>m(T.target.value),e[10]=y):y=e[10];let v;e[11]!==u||e[12]!==p?(v=s.jsx(le,{ref:g,type:"text",placeholder:p,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=p,e[13]=v):v=e[13];let E;e[14]!==l||e[15]!==b||e[16]!==j||e[17]!==w?(E=j.length>0&&s.jsxs(kt,{value:l??"",onValueChange:b,children:[s.jsxs(Nt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ys,children:[s.jsx(Ct,{placeholder:"Key",children:(()=>{const T=j.find($=>$.id===l),H=T?w[T.providerId]:void 0,q=ce(T?.presetId),Q=q?.logo??H?.logo,X=q?.name??H?.name??T?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Q?s.jsx("img",{src:Q,alt:X,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:X.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:X})]})})()}),s.jsx(Tt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(wt,{children:j.map(T=>{const H=w[T.providerId],q=ce(T.presetId),Q=q?.logo??H?.logo,X=q?.name??H?.name??T.providerId;return s.jsx(It,{value:T.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Q?s.jsx("img",{src:Q,alt:X,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:X.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[X," — ",T.label]})]})},T.id)})})]}),e[14]=l,e[15]=b,e[16]=j,e[17]=w,e[18]=E):E=e[18];let A;e[19]!==v||e[20]!==E?(A=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[C,v,E]})}),e[19]=v,e[20]=E,e[21]=A):A=e[21];let z;e[22]!==l?(z=T=>{const{error:H,resetError:q}=T;return s.jsx($s,{error:H,onRetry:q,credentialId:l??void 0})},e[22]=l,e[23]=z):z=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ds,{}),e[24]=O):O=e[24];const R=l??void 0;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>f(Xs),e[25]=P):P=e[25];let L;e[26]!==a||e[27]!==S||e[28]!==h||e[29]!==u||e[30]!==R?(L=s.jsx(D.Suspense,{fallback:O,children:s.jsx(Hs,{keyId:R,searchTerm:u,onHover:d,onModelSelect:S,managing:h,onToggleManage:P,filterModels:a})}),e[26]=a,e[27]=S,e[28]=h,e[29]=u,e[30]=R,e[31]=L):L=e[31];let F;e[32]!==l||e[33]!==z||e[34]!==L?(F=s.jsx(dt,{fallback:z,children:L},l),e[32]=l,e[33]=z,e[34]=L,e[35]=F):F=e[35];let W;e[36]!==h||e[37]!==I||e[38]!==_?(W=!h&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>D.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Mt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>I({to:"/$org/settings/ai-providers",params:{org:_.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(zt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=h,e[37]=I,e[38]=_,e[39]=W):W=e[39];let B;e[40]!==F||e[41]!==W||e[42]!==A?(B=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[A,F,W]}),e[40]=F,e[41]=W,e[42]=A,e[43]=B):B=e[43];const G=c??o??null;let K;e[44]!==G?(K=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Is,{model:G})}),e[44]=G,e[45]=K):K=e[45];let V;return e[46]!==B||e[47]!==K?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,K]}),e[46]=B,e[47]=K,e[48]=V):V=e[48],V}function Xs(i){return!i}function Ys(i){return i.stopPropagation()}function Qs(i){return[i.id,i]}function Js(i){const e=U.c(12),{onClose:t}=i,{credentialId:l,setCredentialId:n,selectedModel:o,setModel:r}=ge();let a;e[0]!==n?(a=u=>{J("chat_credential_changed",{credential_id:u}),n(u)},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==o?.modelId||e[4]!==r?(c=u=>{l&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:l}),r({...u,keyId:l}))},e[2]=l,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(st,{onClose:t,credentialId:l,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=l,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Zs(i){const e=U.c(2),{onClose:t}=i;let l;return e[0]!==t?(l=s.jsx(Js,{onClose:t}),e[0]=t,e[1]=l):l=e[1],l}function ei(i){const e=U.c(2);let t;return e[0]!==i?(t=s.jsx(st,{...i}),e[0]=i,e[1]=t):t=e[1],t}const ti=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function it(i){const e=U.c(10),{modelSet:t,selectedModelId:l,onSelect:n}=i;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==l){const c=Object.fromEntries(t.models.map(si));o="flex flex-col p-2 w-[320px]",r=ti.map(d=>{const{tier:u,description:m}=d,h=t.tiers[u];if(!h.modelId)return null;const f=c[h.modelId];if(!f)return null;const g=l===h.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ne("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",g&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:h.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:h.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},u)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=l,e[5]=o,e[6]=r}else o=e[5],r=e[6];let a;return e[7]!==o||e[8]!==r?(a=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=a):a=e[9],a}function si(i){return[i.modelId,i]}const ii=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],ue="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",li=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null}],ni="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",oi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",ri={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(me,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(me,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(me,{size:16})}},ai={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(fe,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(fe,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(fe,{size:16})}};function lt(i){return i==="claude-code"?{logo:ni,tiers:ri,models:ii}:i==="codex"?{logo:oi,tiers:ai,models:li}:null}function ci(i){const e=U.c(11),{onClose:t,agent:l}=i,n=ge(),o=l??n.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=lt(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a){let m;return e[2]!==t?(m=s.jsx(Zs,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const c=n.selectedModel?.modelId??a.tiers[n.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==n?(d=m=>{n.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==c||e[9]!==d?(u=s.jsx(it,{modelSet:a,selectedModelId:c,onSelect:d}),e[7]=a,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function di(i){const e=U.c(13);let t,l;e[0]!==i?({agent:t,...l}=i,e[0]=i,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let n;e[3]!==t?(n=t?lt(t):null,e[3]=t,e[4]=n):n=e[4];const o=n;if(!o){let d;return e[5]!==l?(d=s.jsx(ei,{...l}),e[5]=l,e[6]=d):d=e[6],d}const r=l.selectedModel?.modelId??o.tiers.smart.modelId;let a;e[7]!==l?(a=d=>{l.onModelChange(d),l.onClose()},e[7]=l,e[8]=a):a=e[8];let c;return e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(it,{modelSet:o,selectedModelId:r,onSelect:a}),e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}function Bi(i){const e=U.c(39),{variant:t,className:l,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:c,onModelChange:d,filterModels:u,agent:m}=i,h=t===void 0?"borderless":t,f=n===void 0?"Select model":n,[g,x]=D.useState(!1),j=d!==void 0,k=bt(),w=h==="borderless"?"ghost":"outline",I=h==="borderless"&&"md:border-none";let _;e[0]!==l||e[1]!==I?(_=ne("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",I,l),e[0]=l,e[1]=I,e[2]=_):_=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==f||e[6]!==j?(M=j?s.jsx(Ye,{model:o??null,placeholder:f,isLoading:r}):s.jsx(mi,{placeholder:f}),e[3]=r,e[4]=o,e[5]=f,e[6]=j,e[7]=M):M=e[7];let b;e[8]!==w||e[9]!==_||e[10]!==M?(b=s.jsx(ee,{variant:w,size:"sm",className:_,children:M}),e[8]=w,e[9]=_,e[10]=M,e[11]=b):b=e[11];const N=b;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(qs,{}),e[12]=S):S=e[12];let C;e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==o||e[17]!==c||e[18]!==d||e[19]!==j?(C=s.jsx(D.Suspense,{fallback:S,children:j?s.jsx(di,{onClose:()=>x(!1),agent:m,credentialId:a??null,onCredentialChange:c??ui,selectedModel:o??null,onModelChange:d,filterModels:u}):s.jsx(ci,{onClose:()=>x(!1),agent:m})}),e[13]=m,e[14]=a,e[15]=u,e[16]=o,e[17]=c,e[18]=d,e[19]=j,e[20]=C):C=e[20];const p=C;if(k){let z;e[21]!==N?(z=s.jsx(pt,{asChild:!0,children:N}),e[21]=N,e[22]=z):z=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(xt,{className:"sr-only",children:"Select model"}),e[23]=O):O=e[23];let R;e[24]!==p?(R=s.jsxs(gt,{className:"p-0 flex flex-col max-h-[95vh]",children:[O,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:p})]}),e[24]=p,e[25]=R):R=e[25];let P;return e[26]!==g||e[27]!==z||e[28]!==R?(P=s.jsxs(vt,{open:g,onOpenChange:x,children:[z,R]}),e[26]=g,e[27]=z,e[28]=R,e[29]=P):P=e[29],P}let y;e[30]!==N?(y=s.jsx(ht,{asChild:!0,children:N}),e[30]=N,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{className:"sr-only",children:"Select model"}),e[32]=v):v=e[32];let E;e[33]!==p?(E=s.jsxs(Fe,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[v,p]}),e[33]=p,e[34]=E):E=e[34];let A;return e[35]!==g||e[36]!==y||e[37]!==E?(A=s.jsxs(De,{open:g,onOpenChange:x,children:[y,E]}),e[35]=g,e[36]=y,e[37]=E,e[38]=A):A=e[38],A}function ui(){}function mi(i){const e=U.c(4),{placeholder:t}=i,{selectedModel:l,isModelsLoading:n}=ge();let o;return e[0]!==n||e[1]!==l||e[2]!==t?(o=s.jsx(Ye,{model:l,placeholder:t,isLoading:n}),e[0]=n,e[1]=l,e[2]=t,e[3]=o):o=e[3],o}export{ps as C,Bi as M,bs as N,Xe as P,Fi as a,ce as b,Ki as g,Di as i,ye as m};