decocms 4.69.1 → 4.70.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 (250) hide show
  1. package/dist/client/assets/{AlertCircle-CeJgODlb.js → AlertCircle-BNOqwgx3.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DjQ3-mxR.js → AreaChart-3JRvgH-V.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Cx_--6Z7.js → ArrowUp-BjDh9GoS.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-ywfBK9uD.js → ArrowUpRight-WsQ86Sav.js} +1 -1
  5. package/dist/client/assets/{Check-qklIr9eC.js → Check-3IF5XVXv.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-B5HHFx3h.js → CheckCircle-ZEQEanMr.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Dqw9pJbF.js → ChevronDown-Dh0YxG4m.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DX001g0F.js → ChevronRight-B0za1GaI.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-C-6o6d8u.js → ChevronUp-C4Tli0iP.js} +1 -1
  10. package/dist/client/assets/{Circle-DFIMbbWU.js → Circle-_nXntXCS.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-wzt5Huxh.js → DotsVertical-mrl_JLuU.js} +1 -1
  12. package/dist/client/assets/Eye-DfKp7NUv.js +1 -0
  13. package/dist/client/assets/{FilterLines-0m6crn3m.js → FilterLines-B7987f_9.js} +1 -1
  14. package/dist/client/assets/{Flag01-D_fUJHwZ.js → Flag01-dmABq59M.js} +1 -1
  15. package/dist/client/assets/{Globe01-Bwt4oV0U.js → Globe01-CAzQ40FN.js} +1 -1
  16. package/dist/client/assets/{Globe04-CD717DpH.js → Globe04-BSLFXkZQ.js} +1 -1
  17. package/dist/client/assets/{HardDrive-Cq-YbPK9.js → HardDrive-Bpoccm4h.js} +1 -1
  18. package/dist/client/assets/{Key01-DTTa_ngJ.js → Key01-2dKo95j0.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CY_ilnE-.js → LayoutLeft-XPlEsPpb.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-Cc-TIWai.js → LinkExternal01-CicBcUk_.js} +1 -1
  21. package/dist/client/assets/{List-1sCiilk_.js → List-DI-S7um9.js} +1 -1
  22. package/dist/client/assets/{Monitor01-BA72KgrB.js → Monitor01-ClTd61xm.js} +1 -1
  23. package/dist/client/assets/{Package-PE508kJN.js → Package-BD1-yOy0.js} +1 -1
  24. package/dist/client/assets/{Palette-CKmdnXoY.js → Palette-BsnVVQFi.js} +1 -1
  25. package/dist/client/assets/{Play-CcnDti9J.js → Play-_Jc_eD41.js} +1 -1
  26. package/dist/client/assets/{Plus-Dg6Y61Qh.js → Plus-CzOaS9c2.js} +1 -1
  27. package/dist/client/assets/{SearchLg-DCvqx7mk.js → SearchLg-DD-UdoBn.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CxXAIK8q.js → SearchMd-CSNeGPKX.js} +1 -1
  29. package/dist/client/assets/{Settings02-Rjz2fibP.js → Settings02-BQwKdsuJ.js} +1 -1
  30. package/dist/client/assets/{Shield01-DoN422Fp.js → Shield01-BcXvD17s.js} +1 -1
  31. package/dist/client/assets/{Star01-kGVgFut9.js → Star01-C71tFwZe.js} +1 -1
  32. package/dist/client/assets/{Stars01-BMHX9PwN.js → Stars01-C8ix5CtG.js} +1 -1
  33. package/dist/client/assets/{Stars02-pEQdLQRy.js → Stars02-SiVp-RDk.js} +1 -1
  34. package/dist/client/assets/{Sun-gRl2Ql5n.js → Sun-CRphR3X4.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-UaHGqUVt.js → SwitchHorizontal01-40LlearX.js} +1 -1
  36. package/dist/client/assets/{Tool01-Dym7sffh.js → Tool01-D_C6Zf3M.js} +1 -1
  37. package/dist/client/assets/{Tool02-DWpgQDA_.js → Tool02-BOYihgUI.js} +1 -1
  38. package/dist/client/assets/{Trash01-FLsHPD-j.js → Trash01-E9rhq6db.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-DJyrqfDN.js → TrendUp01-bNNl9jSM.js} +1 -1
  40. package/dist/client/assets/{Upload01-Bf-wW3fT.js → Upload01-CQeWR_O2.js} +1 -1
  41. package/dist/client/assets/{User01-Bp8xCtim.js → User01-CmPqsWmo.js} +1 -1
  42. package/dist/client/assets/{UserPlus01-CxsIZHHu.js → UserPlus01-CaGaFCm_.js} +1 -1
  43. package/dist/client/assets/{Users01-CUB4jTbh.js → Users01-DkwjnP6Y.js} +1 -1
  44. package/dist/client/assets/{Users03-C601mmDP.js → Users03-pCpJhsft.js} +1 -1
  45. package/dist/client/assets/{X-Dg3UHk4M.js → X-DerIQqEq.js} +1 -1
  46. package/dist/client/assets/{XCircle-BVO-AfDl.js → XCircle-SgruRFyv.js} +1 -1
  47. package/dist/client/assets/{XClose-CSAbqx7t.js → XClose-4d3Ekw3d.js} +1 -1
  48. package/dist/client/assets/{Zap-C5e_tw0_.js → Zap-BU3_Y9iC.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-CYxtM-xd.js → ZapSquare-D2hGGAJJ.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-FOnWv2R3.js → ZoomOut-DsOajlUw.js} +1 -1
  51. package/dist/client/assets/{access-gate-DQJOwmen.js → access-gate-Csdvu-UF.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-DI0ZRr1J.js → add-section-modal-CPN_Hmpi.js} +1 -1
  53. package/dist/client/assets/agent-icon-kOtA_IhQ.js +1 -0
  54. package/dist/client/assets/agents-list-CcSmAla9.js +1 -0
  55. package/dist/client/assets/ai-providers-o9s-qd2V.js +1 -0
  56. package/dist/client/assets/{alert-BDhkte4t.js → alert-BifE7hdt.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-NEl6qUgZ.js → alert-dialog-D73O6ger.js} +1 -1
  58. package/dist/client/assets/app-editor-CvJ7YKTa.js +1 -0
  59. package/dist/client/assets/{auth-JAYu2Sn7.js → auth-B0HzsFCi.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-Cgz9JzrM.js → auth-catchall-Bxupe1gH.js} +1 -1
  61. package/dist/client/assets/{auth-entry-DrKXHOq7.js → auth-entry-CJTv7s_R.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-B2IihxK4.js → auth-split-layout-CbYux2Im.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-CHpUAxht.js → authenticate-and-persist-oauth-D5njsg9t.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BqcM-T9k.js → automation-list-row-KpNtWKEt.js} +1 -1
  65. package/dist/client/assets/{automation-runs-CG9qLUqb.js → automation-runs-DtKXmpPB.js} +10 -10
  66. package/dist/client/assets/automations-DReJI2C7.js +1 -0
  67. package/dist/client/assets/{autosend-BOPTLlfV.js → autosend-kL3igx-R.js} +1 -1
  68. package/dist/client/assets/{avatar-B8GP78HG.js → avatar-0A1e58j2.js} +1 -1
  69. package/dist/client/assets/{badge-DAQJGlmB.js → badge-7Z5jGci0.js} +1 -1
  70. package/dist/client/assets/{block-document-jnC_u02j.js → block-document-Bf5WD0Qs.js} +1 -1
  71. package/dist/client/assets/{brand-context-2o9hRue5.js → brand-context-bxHXa3iq.js} +1 -1
  72. package/dist/client/assets/{buckets-BtaV1x-j.js → buckets-C52hN0lf.js} +1 -1
  73. package/dist/client/assets/bulk-category-panel-C7Vrf6XB.js +1 -0
  74. package/dist/client/assets/{calendar-C6LcfVwu.js → calendar-CsdE4y5P.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-BX02m8_A.js → capability-load-error-Bx0jWv13.js} +1 -1
  76. package/dist/client/assets/{card-B5uBFViO.js → card-D7MOybia.js} +1 -1
  77. package/dist/client/assets/category-editor-D1NwSTJe.js +1 -0
  78. package/dist/client/assets/{chat-context-Csy5cRMg.js → chat-context-DIsUMp8x.js} +1 -1
  79. package/dist/client/assets/{checkbox-BfaUpDdG.js → checkbox-CRqoFMHX.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-C2yADy5e.js → cli-auth-success-Cd9GcWJe.js} +1 -1
  81. package/dist/client/assets/collection-detail-BVAwlQbB.js +1 -0
  82. package/dist/client/assets/{collection-display-button-75P1XTko.js → collection-display-button-C3Pd_Rr4.js} +1 -1
  83. package/dist/client/assets/{collection-search-Qnz6jxTV.js → collection-search-CdwG_TnF.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-C14aED27.js → collection-table-wrapper-IjhQtuAG.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-BCpGbCT5.js → collection-tabs-BAHBfanx.js} +1 -1
  86. package/dist/client/assets/{command-CaofFN3p.js → command-BzQrN4Oz.js} +1 -1
  87. package/dist/client/assets/commerce-onboarding-1scfp130.js +1 -0
  88. package/dist/client/assets/{companions-core-DcZqHo8p.js → companions-core-CoO0W52M.js} +1 -1
  89. package/dist/client/assets/connect-desktop-dialog-BtBlll0t.js +1 -0
  90. package/dist/client/assets/{connection-card-CL_n4ga5.js → connection-card-BDoXl9QB.js} +1 -1
  91. package/dist/client/assets/connection-detail-D52wzMX8.js +1 -0
  92. package/dist/client/assets/{connection-form-helpers-Dx2pWKQg.js → connection-form-helpers-jkR8ueBb.js} +1 -1
  93. package/dist/client/assets/connections-C695p8vC.js +1 -0
  94. package/dist/client/assets/{decopilot-sse-pool-DhL2hPm4.js → decopilot-sse-pool-BrfR8yDr.js} +1 -1
  95. package/dist/client/assets/{dialog-94MC6GNA.js → dialog-BpcKr7fb.js} +1 -1
  96. package/dist/client/assets/{domain-settings-6cMISGv0.js → domain-settings-ZvzCf_Cs.js} +1 -1
  97. package/dist/client/assets/{drawer-Co_r3vYF.js → drawer-CQub3ABe.js} +1 -1
  98. package/dist/client/assets/{dropdown-menu-CwZxSb5T.js → dropdown-menu-QhLak1ll.js} +1 -1
  99. package/dist/client/assets/{empty-state-BAbUNiFM.js → empty-state-BlIZNo1-.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-kn2oock2.js → extract-connection-data-CnMohdbQ.js} +1 -1
  101. package/dist/client/assets/file-explorer-B6AAPK7-.js +2 -0
  102. package/dist/client/assets/{file-type-icon-cxQD2Gow.js → file-type-icon-DfCaCg6V.js} +1 -1
  103. package/dist/client/assets/{files-CcGZ4JiL.js → files-BHWjJjB5.js} +1 -1
  104. package/dist/client/assets/{form-DkmV3bZG.js → form-BkPit2Fp.js} +1 -1
  105. package/dist/client/assets/{general-DKb_Qm-7.js → general-BQ1mb0eL.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-ZKvJa1LN.js → github-repo-picker-CC9gKo_Q.js} +1 -1
  107. package/dist/client/assets/{hooks-gTEmV-hn.js → hooks-zmQaKd-R.js} +1 -1
  108. package/dist/client/assets/index-4IC7hlwf.js +2 -0
  109. package/dist/client/assets/index-BK4VrurV.js +1 -0
  110. package/dist/client/assets/{index-CBrazrjF.js → index-BWf_eLeI.js} +2 -2
  111. package/dist/client/assets/{index-DYZDo-Fd.js → index-BaCctu7w.js} +1 -1
  112. package/dist/client/assets/{index-CXseUXwz.js → index-CAjbesqI.js} +1 -1
  113. package/dist/client/assets/{index-DFa2bm2W.js → index-CByZAC4o.js} +1 -1
  114. package/dist/client/assets/{index-C3jqpDLL.js → index-CUaHOXdB.js} +1 -1
  115. package/dist/client/assets/{index-Ce2Igu8Z.js → index-CUjcDMZh.js} +1 -1
  116. package/dist/client/assets/{index-F9o1E2LM.js → index-CqoWSr4N.js} +14 -14
  117. package/dist/client/assets/{index-Cw_MOEue.js → index-DH7zklM0.js} +3 -3
  118. package/dist/client/assets/{index-BxUWUc0Q.js → index-DMYfiTOn.js} +4 -4
  119. package/dist/client/assets/{index-HcnPt-QL.js → index-Dg95Ys7g.js} +1 -1
  120. package/dist/client/assets/{index-CC1ISC2f.js → index-Odrpcpin.js} +1 -1
  121. package/dist/client/assets/{index-BOigHE8Y.js → index-pZYTL3gT.js} +1 -1
  122. package/dist/client/assets/{index-redirect-CiVAic-b.js → index-redirect-knXeoplu.js} +1 -1
  123. package/dist/client/assets/{input-C57OE_bz.js → input-D0_6xqhd.js} +1 -1
  124. package/dist/client/assets/{integration-icon-B9AX6sxk.js → integration-icon-pGNpQQDl.js} +1 -1
  125. package/dist/client/assets/{invite-member-dialog-hx-Vtguq.js → invite-member-dialog-B_e5L4KN.js} +1 -1
  126. package/dist/client/assets/{label-wqLdGJT0.js → label-DRoGiWBx.js} +1 -1
  127. package/dist/client/assets/{layout-DL1n-2wE.js → layout-C4YlUJFP.js} +1 -1
  128. package/dist/client/assets/{login-CFcAh8bA.js → login-D2YYqmYp.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-CaQ5w7vv.js → mcp-oauth-7o_jQoAy.js} +1 -1
  130. package/dist/client/assets/{members-BAjXYSQt.js → members-CC2V91UE.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-DOlDq43r.js → monaco-editor-BgdPIkzz.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-nS4gMGbj.js → monitoring-stats-row-DMX98sXh.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ZhS1jSul.js → oauth-callback-C2b7S_aL.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ai-provider-DlYmR-ko.js → oauth-callback-ai-provider-DBbZMJJV.js} +1 -1
  135. package/dist/client/assets/{onboarding-C30KM3Il.js → onboarding-CdmJTagu.js} +1 -1
  136. package/dist/client/assets/{org-install-Dov3tr6h.js → org-install-B8v1ZDQ_.js} +1 -1
  137. package/dist/client/assets/{org-layout-C-r61Ynx.js → org-layout-uv-DYlXE.js} +1 -1
  138. package/dist/client/assets/{organization-choice-BfZpkHfP.js → organization-choice-BraFU9SN.js} +1 -1
  139. package/dist/client/assets/{orgs-DlU5vUAi.js → orgs-twpkVhQs.js} +1 -1
  140. package/dist/client/assets/{page-seo-form-wNQQn_dv.js → page-seo-form-C0_lHlHD.js} +1 -1
  141. package/dist/client/assets/page-seo-sheet-D-mG8-Ef.js +1 -0
  142. package/dist/client/assets/{popover-YRjoqx5c.js → popover-DswiBWaZ.js} +1 -1
  143. package/dist/client/assets/post-editor-C6sg0SGJ.js +1 -0
  144. package/dist/client/assets/{primitives-BdN7cTl_.js → primitives-DJg685w3.js} +1 -1
  145. package/dist/client/assets/{profile-CnQ30y2Q.js → profile-B8uOnMm1.js} +1 -1
  146. package/dist/client/assets/project-app-view-BJRkyY4N.js +1 -0
  147. package/dist/client/assets/record-editor-Ba4ARQv7.js +1 -0
  148. package/dist/client/assets/registry-CB-3sTY8.js +2 -0
  149. package/dist/client/assets/{registry-layout-DVCFd28u.js → registry-layout-CWWrrzgL.js} +2 -2
  150. package/dist/client/assets/{reports-xVM-jqFU.js → reports-Dn5yUqtP.js} +1 -1
  151. package/dist/client/assets/{require-capability-wLbHZZOZ.js → require-capability-CjlCMijn.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-CkCZ1VH2.js → required-auth-layout-deeKYyju.js} +1 -1
  153. package/dist/client/assets/{reset-password-D2Bs61Iv.js → reset-password-D4sIl2PA.js} +1 -1
  154. package/dist/client/assets/roles-CwwKXLnp.js +1 -0
  155. package/dist/client/assets/{search-input-CqxCn4Rx.js → search-input-CT1Vy8nA.js} +1 -1
  156. package/dist/client/assets/{secrets-qpRPZVro.js → secrets-B10n6al5.js} +1 -1
  157. package/dist/client/assets/{sections-editor-3nxhaKth.js → sections-editor-Bt4yh0np.js} +2 -2
  158. package/dist/client/assets/{select-BbQScYUM.js → select-DA4hTrMt.js} +1 -1
  159. package/dist/client/assets/{select-model-Ivlt_Hjk.js → select-model-D6sutcd8.js} +1 -1
  160. package/dist/client/assets/self-tool-result-BQx1UAN9.js +1 -0
  161. package/dist/client/assets/seo-editor-C__7f096.js +1 -0
  162. package/dist/client/assets/{settings-layout-Demq1bVu.js → settings-layout-BP2_6N6d.js} +1 -1
  163. package/dist/client/assets/{settings-section-kWU5lPTB.js → settings-section-DlXfHUrn.js} +1 -1
  164. package/dist/client/assets/{shell-controls-LyDwufi9.js → shell-controls-2QAE8PKI.js} +1 -1
  165. package/dist/client/assets/{shell-layout-C3vwcwKJ.js → shell-layout-D1iB1iz9.js} +1 -1
  166. package/dist/client/assets/{sidebar-B4yomm08.js → sidebar-CHhIA2_1.js} +1 -1
  167. package/dist/client/assets/{skeleton-Dn-HzxdH.js → skeleton-BLia0aJh.js} +1 -1
  168. package/dist/client/assets/{sso-DQ2NY5wZ.js → sso-BYuFPa8x.js} +1 -1
  169. package/dist/client/assets/{store-DjRJNmMy.js → store-B4sEgX_u.js} +1 -1
  170. package/dist/client/assets/store-registry-CzD3pT4R.js +2 -0
  171. package/dist/client/assets/{studio-tools-bcpgTNof.js → studio-tools-VPSoJENp.js} +1 -1
  172. package/dist/client/assets/{switch-Dj8a0W96.js → switch-l_jNqg2T.js} +1 -1
  173. package/dist/client/assets/{table-D6kZLJZo.js → table-C8627oiU.js} +1 -1
  174. package/dist/client/assets/{tabs-uog8ypZ5.js → tabs-BW23ICh6.js} +1 -1
  175. package/dist/client/assets/{textarea-D96KZ_bk.js → textarea-DYKJhtdG.js} +1 -1
  176. package/dist/client/assets/{toggle-group-xXar88Zl.js → toggle-group-DYOX47AO.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-CwX9OsPP.js → toolbar-icon-button-BdxOmkFX.js} +1 -1
  178. package/dist/client/assets/{toolbar-DF6E_99x.js → toolbar-uw_BlVTg.js} +1 -1
  179. package/dist/client/assets/{tools-list-DyJkBr3l.js → tools-list-BBn3cWuf.js} +1 -1
  180. package/dist/client/assets/{tooltip-CEMhn06S.js → tooltip-BNT8_4k3.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-CfC4MjYU.js → use-ai-providers-DeNJCel0.js} +1 -1
  182. package/dist/client/assets/{use-automations-BV8BAFK6.js → use-automations-B0lPI23G.js} +1 -1
  183. package/dist/client/assets/{use-capability-IeWRUHjn.js → use-capability-Br3alpfk.js} +1 -1
  184. package/dist/client/assets/{use-clock-tick-BoYgP8-u.js → use-clock-tick-BtY-dmwQ.js} +1 -1
  185. package/dist/client/assets/{use-collections-Mmumb7Jv.js → use-collections-SMze160o.js} +1 -1
  186. package/dist/client/assets/{use-connection-BwHNV7F-.js → use-connection-CNteuS_S.js} +1 -1
  187. package/dist/client/assets/{use-copy-DwaNL7ao.js → use-copy-5Lg1HZD-.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-D2T3uhyt.js → use-create-virtual-mcp-DOdHpSnn.js} +1 -1
  189. package/dist/client/assets/{use-debounced-autosave-CAJHdpnz.js → use-debounced-autosave-B9Taq78v.js} +1 -1
  190. package/dist/client/assets/{use-debounced-value-B3ktPBBI.js → use-debounced-value-DuA_CSYV.js} +1 -1
  191. package/dist/client/assets/{use-deco-credits-JXELkRA8.js → use-deco-credits-BDxz919c.js} +1 -1
  192. package/dist/client/assets/{use-decopilot-events-Cy3Splz7.js → use-decopilot-events-ClRYCZQV.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-CxJzNx9n.js → use-delete-connection-DdKXZc8T.js} +1 -1
  194. package/dist/client/assets/{use-deployment-admin-BTxxZCfp.js → use-deployment-admin-pH8aBMoB.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-C5MIjZBk.js → use-file-configs-CkWDz8sb.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-BJxks4Oh.js → use-infinite-scroll-Bh5Bj59F.js} +1 -1
  197. package/dist/client/assets/{use-join-requests-DY-BgYQ_.js → use-join-requests-CMvn5PG1.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-CwxQ2mu8.js → use-mcp-client-Bg2hi37O.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-DS-HH6so.js → use-mcp-tools-C6Ydm7Lm.js} +1 -1
  200. package/dist/client/assets/{use-members-HgTG6V2z.js → use-members-B2Xrs_Th.js} +1 -1
  201. package/dist/client/assets/{use-mobile-CDGvObYb.js → use-mobile-CUGrxsZ2.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-JH1aTgiP.js → use-navigate-to-agent-B4gExwxr.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-CR847Rtk.js → use-org-auth-client-xSa_WGpy.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-_zvIWw2Z.js → use-org-sso-BsWJIm5V.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-BbeankM2.js → use-organization-roles-CeHtDzdR.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-D2FVOkxT.js → use-organization-settings-BBLw1B9O.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-DYAxxhes.js → use-registry-connections-N-VxHS8u.js} +1 -1
  208. package/dist/client/assets/{use-secrets-DVIAQNCJ.js → use-secrets-CiyZ7iKQ.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-BkjfcEfu.js → use-status-sounds-C2Blkzad.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-CsLEkxLJ.js → use-view-mode-BxieHG7P.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-R-nHNI8F.js → use-virtual-mcp-B-SEUFlF.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-DyQZ4zvT.js +1 -0
  213. package/dist/client/assets/{useRouterState-Cc9PhPdx.js → useRouterState-Bd410ZCv.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-CRRdyCZx.js +1 -0
  215. package/dist/client/assets/{users-CpC44hMP.js → users-C4shcaNt.js} +1 -1
  216. package/dist/client/assets/variant-calendar-Br4U6L_4.js +1 -0
  217. package/dist/client/assets/{view-mode-toggle-CAR5myEG.js → view-mode-toggle-cA-Df5WU.js} +1 -1
  218. package/dist/client/index.html +1 -1
  219. package/dist/server/cli.js +1 -1
  220. package/dist/server/server.js +1 -1
  221. package/package.json +1 -1
  222. package/dist/client/assets/Copy01-LCtBKUFe.js +0 -1
  223. package/dist/client/assets/Eye-CTCWS-BQ.js +0 -1
  224. package/dist/client/assets/agent-icon-BF217Hvb.js +0 -1
  225. package/dist/client/assets/agents-list-BOzpPY1B.js +0 -1
  226. package/dist/client/assets/ai-providers-DYUJycRo.js +0 -1
  227. package/dist/client/assets/app-editor-B0LyS2cF.js +0 -1
  228. package/dist/client/assets/automations-CqaC3ITe.js +0 -1
  229. package/dist/client/assets/bulk-category-panel-CsQAiHNK.js +0 -1
  230. package/dist/client/assets/category-editor-CB5l-iJg.js +0 -1
  231. package/dist/client/assets/collection-detail-DUlRTL-K.js +0 -1
  232. package/dist/client/assets/commerce-onboarding-B6RlPqiN.js +0 -1
  233. package/dist/client/assets/connect-desktop-dialog-Dd78-wLs.js +0 -1
  234. package/dist/client/assets/connection-detail-DyOveWRW.js +0 -1
  235. package/dist/client/assets/connections-Bg5digaa.js +0 -1
  236. package/dist/client/assets/file-explorer-CvWK-izX.js +0 -2
  237. package/dist/client/assets/index-DFZw1AWG.js +0 -2
  238. package/dist/client/assets/index-DecIG0NH.js +0 -1
  239. package/dist/client/assets/page-seo-sheet-Zcv6el6V.js +0 -1
  240. package/dist/client/assets/post-editor-u5ErFP-V.js +0 -1
  241. package/dist/client/assets/project-app-view-BEk1Bg1Q.js +0 -1
  242. package/dist/client/assets/record-editor-V7CpHQBF.js +0 -1
  243. package/dist/client/assets/registry-ePWsWM0c.js +0 -2
  244. package/dist/client/assets/roles-B7SYVuty.js +0 -1
  245. package/dist/client/assets/self-tool-result-DKljt9Fd.js +0 -1
  246. package/dist/client/assets/seo-editor--BAcfPmJ.js +0 -1
  247. package/dist/client/assets/store-registry-DKWSaM3m.js +0 -2
  248. package/dist/client/assets/useInfiniteQuery-DNK1YDMj.js +0 -1
  249. package/dist/client/assets/useSuspenseInfiniteQuery-DIBoNO1Z.js +0 -1
  250. package/dist/client/assets/variant-calendar-0EdePQ2u.js +0 -1
@@ -1 +0,0 @@
1
- import{c as A,b as de,C as Z,D as Hs,j as s,B as Ge,r as F,F as Bs,E as St,a as re,v as Gs,K as es,d as gt,p as ne,G as et,l as D,H as Ws,I as qs,J as Vs,M as Ks,P as Ys,q as Xs,t as ae,s as Qs,i as ts,e as _t,u as tt,L as Js,R as Zs,U as en,V as tn,W as sn,m as nn,X as ln,O as rn,Y as on}from"./index-Cw_MOEue.js";import{u as pe,S as Nt,a as Ct,b as ie,c as J,d as V,e as ss,f as an,g as ns,h as cn,i as Re,j as dn,k as mn,l as un}from"./sidebar-B4yomm08.js";import{u as wt}from"./use-mobile-CDGvObYb.js";import{C as fn,p as ut,s as hn,b as xn,S as pn,d as gn,e as bn,c as jn,n as vn}from"./self-tool-result-DKljt9Fd.js";import{f as yn,a as is,e as ls,g as Sn,D as _n,h as Nn,d as Cn}from"./dialog-94MC6GNA.js";import{f as wn}from"./tab-id-bb-jjgGv.js";import{u as rs}from"./use-mcp-client-CwxQ2mu8.js";import{C as kn,W as os,g as In,S as as,a as Qe,i as An,b as zn}from"./constants-D_FQAPnt.js";import{i as cs}from"./XCircle-BVO-AfDl.js";import{S as ce}from"./skeleton-Dn-HzxdH.js";import{i as ds}from"./LayoutLeft-CY_ilnE-.js";import{t as kt}from"./ChevronDown-Dqw9pJbF.js";import{T as fe,a as he,b as xe,c as bt}from"./tooltip-CEMhn06S.js";import{u as ms,a as It}from"./use-virtual-mcp-R-nHNI8F.js";import{A as je,a as Tt,i as Ot,t as $n,b as Tn,c as Mt,d as On,s as Mn,e as En}from"./agent-icon-BF217Hvb.js";import{P as Fe,a as st,b as nt}from"./popover-YRjoqx5c.js";import{i as us}from"./Check-qklIr9eC.js";import{s as Le}from"./Plus-Dg6Y61Qh.js";import{i as fs}from"./SearchMd-CxXAIK8q.js";import{s as Dn}from"./XClose-CSAbqx7t.js";import{A as Pn,a as Fn,b as Rn,c as Ln,d as Un,e as Hn,f as Bn}from"./alert-dialog-NEl6qUgZ.js";import{F as Gn,a as Wn,b as qn,c as Vn,d as Kn,e as Yn,f as Xn}from"./form-DkmV3bZG.js";import{I as Qn}from"./input-C57OE_bz.js";import{S as Jn,u as Zn,C as ei}from"./chat-context-Csy5cRMg.js";import{T as ve}from"./toolbar-icon-button-CwX9OsPP.js";import{D as hs,a as xs,b as ps}from"./drawer-Co_r3vYF.js";import{G as ti,a as si}from"./github-repo-picker-ZKvJa1LN.js";import{u as gs,a as At,b as ni,T as ii}from"./hooks-gTEmV-hn.js";import{r as li,u as zt,f as ri}from"./shell-layout-C3vwcwKJ.js";import{u as oi,g as ai,a as ci,b as di,S as bs}from"./use-navigate-to-agent-JH1aTgiP.js";import{g as mi,a as js,u as ui,A as fi,b as hi}from"./use-deco-credits-JXELkRA8.js";import{f as xi}from"./reusable-new-chat-CouMjkYR.js";import{A as Je}from"./avatar-B8GP78HG.js";import{a as Et}from"./Copy01-LCtBKUFe.js";import{n as pi,i as gi}from"./Globe01-Bwt4oV0U.js";import{i as bi}from"./ZoomOut-FOnWv2R3.js";import{i as Dt,a as ji}from"./ZapSquare-CYxtM-xd.js";import{i as jt}from"./Monitor01-BA72KgrB.js";import{n as vi,a as yi}from"./Sun-gRl2Ql5n.js";import{a as it}from"./Settings02-Rjz2fibP.js";import{i as Si}from"./Shield01-DoN422Fp.js";import{a as _i}from"./Users03-C601mmDP.js";import{u as Ni}from"./use-deployment-admin-BTxxZCfp.js";import"./index-C3jqpDLL.js";import{t as vs}from"./UserPlus01-CxsIZHHu.js";import{I as ys}from"./invite-member-dialog-hx-Vtguq.js";import{v as Ci,C as Pt}from"./connect-desktop-dialog-Dd78-wLs.js";import{u as lt}from"./use-organization-settings-D2FVOkxT.js";import{i as wi}from"./FilterLines-0m6crn3m.js";import{T as ki,a as Ii}from"./toggle-group-xXar88Zl.js";import{C as Ai,a as zi,b as $i,c as Ti,d as Oi}from"./command-CaofFN3p.js";import{u as Ss}from"./studio-tools-bcpgTNof.js";import{i as _s}from"./Zap-C5e_tw0_.js";import{S as Ns,M as Mi}from"./shell-controls-LyDwufi9.js";import{n as Ei}from"./Stars02-pEQdLQRy.js";import{g as Di,u as Pi,S as Fi}from"./use-clock-tick-BoYgP8-u.js";import{a as Ri}from"./format-time-BnbuEtat.js";import{i as Li}from"./ChevronRight-DX001g0F.js";import{T as se}from"./toolbar-DF6E_99x.js";import"./X-Dg3UHk4M.js";import"./integration-icon-B9AX6sxk.js";import"./Tool02-DWpgQDA_.js";import"./CheckCircle-B5HHFx3h.js";import"./companions-core-DcZqHo8p.js";import"./extract-connection-data-kn2oock2.js";import"./github-installations-ChFezl8I.js";import"./Eye-CTCWS-BQ.js";import"./use-debounced-value-B3ktPBBI.js";import"./authenticate-and-persist-oauth-CHpUAxht.js";import"./mcp-oauth-CaQ5w7vv.js";import"./auth-JAYu2Sn7.js";import"./ArrowUpRight-ywfBK9uD.js";import"./use-collections-Mmumb7Jv.js";import"./AlertCircle-CeJgODlb.js";import"./Tool01-Dym7sffh.js";import"./ArrowUp-Cx_--6Z7.js";import"./TrendUp01-DJyrqfDN.js";import"./ChevronUp-C-6o6d8u.js";import"./Circle-DFIMbbWU.js";import"./DotsVertical-wzt5Huxh.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LinkExternal01-Cc-TIWai.js";import"./List-1sCiilk_.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./SearchLg-DCvqx7mk.js";import"./Stars01-BMHX9PwN.js";import"./Trash01-FLsHPD-j.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./label-wqLdGJT0.js";import"./autosend-BOPTLlfV.js";import"./use-ai-providers-CfC4MjYU.js";import"./use-decopilot-events-Cy3Splz7.js";import"./decopilot-sse-pool-DhL2hPm4.js";import"./backoff-CrEUbyZT.js";import"./collection-search-Qnz6jxTV.js";import"./use-connection-BwHNV7F-.js";import"./use-mcp-tools-DS-HH6so.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-CkCZ1VH2.js";import"./use-org-sso-_zvIWw2Z.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CL_n4ga5.js";import"./use-registry-connections-DYAxxhes.js";import"./useInfiniteQuery-DNK1YDMj.js";import"./use-infinite-scroll-BJxks4Oh.js";import"./card-B5uBFViO.js";import"./collection-tabs-BCpGbCT5.js";import"./badge-DAQJGlmB.js";import"./select-BbQScYUM.js";import"./textarea-D96KZ_bk.js";import"./connection-form-helpers-Dx2pWKQg.js";import"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import"./use-org-auth-client-CR847Rtk.js";import"./use-organization-roles-BbeankM2.js";import"./index-CXseUXwz.js";import"./differenceInSeconds-NQ4PDo0z.js";function Ui(t){const e=A.c(15),{siteUrl:n}=t,l=de(),{org:i}=Z();let r;e[0]!==l||e[1]!==i.id||e[2]!==i.slug?(r=()=>{localStorage.setItem(Hs.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:In(i.id),main:wn(os.COMMERCE_DISCOVERY(i.id),kn),sidepanel:0}})},e[0]=l,e[1]=i.id,e[2]=i.slug,e[3]=r):r=e[3];const o=r;let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yn,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(is,{className:"sr-only",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),e[5]=m):m=e[5];let c;e[6]!==o?(c=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar as integrações. Você pode continuar e abrir o relatório mesmo assim."}),s.jsxs(Ge,{type:"button",size:"xl",className:"w-full",onClick:o,children:["Continuar",s.jsx(cs,{size:18})]})]}),e[6]=o,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(fn,{}),e[8]=d):d=e[8];let u;e[9]!==o||e[10]!==n?(u=s.jsx(F.Suspense,{fallback:d,children:s.jsx(Wi,{siteUrlFromUrl:n,onComplete:o})}),e[9]=o,e[10]=n,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=s.jsx(ls,{open:!0,children:s.jsxs(Sn,{children:[a,s.jsxs(Bs,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Gi,onPointerDownOutside:Bi,onInteractOutside:Hi,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,s.jsx(St,{fallback:c,children:u})]})]})}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function Hi(t){return t.preventDefault()}function Bi(t){return t.preventDefault()}function Gi(t){return t.preventDefault()}function Wi({siteUrlFromUrl:t,onComplete:e}){const{org:n}=Z(),{data:l}=re.useSession(),i=os.COMMERCE_DISCOVERY(n.id),r=rs({connectionId:as,orgId:n.id,orgSlug:n.slug}),a=Gs({queryKey:es.commerceDiscoveryConnection(n.id,i),queryFn:async()=>{const y=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ut(y)},retry:!1}).data.item,m=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||m,d=hn(c),[u,f]=F.useState(!0),[h,x]=F.useState(null),g=gt({mutationFn:async y=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}})),retry:!1}),p=gt({mutationFn:async y=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:y}})),retry:!1}),b=xn({siteUrl:c,email:l?.user?.email}),j=async()=>{x(null),ne("commerce_onboarding_open_report_clicked",{domain:d??void 0,organization_id:n.id});const y=c?vn(c):null;if(y?.ok)try{let v=await p.mutateAsync(y.value);if(v.triggered||(ne("commerce_onboarding_run_reclaim",{domain:d??void 0,organization_id:n.id,reason:v.reason??"not_upgraded"}),await g.mutateAsync(y.value),v=await p.mutateAsync(y.value)),!v.triggered){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:v.reason??"not_triggered"}),x("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(v){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:v instanceof Error?v.message:String(v)}),x("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[d?s.jsx(pn,{host:d}):null,s.jsx(gn,{org:n,cdConnectionId:i,siteUrl:c,onReadinessChange:f}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(bn,{href:b,orgId:n.id,className:"lg:hidden"}),h?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:h}):null,s.jsxs(Ge,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{j()},disabled:p.isPending||!u,children:[p.isPending?"Abrindo relatório...":u?"Ver relatório completo":"Conecte uma ferramenta para continuar",!p.isPending&&u?s.jsx(cs,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(jn,{href:b,orgId:n.id})})]})}function qi(t){const e=A.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=o,e[1]=a):(o=e[0],a=e[1]);let m;return e[2]!==l||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=m):m=e[4],m}const $t=240,Vi=400,Ki="sidebar.width";function Ue(t){return Math.max($t,Math.min(Vi,t))}function Yi(){const t=A.c(11),[e,n]=et(Ki,Xi),l=F.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,f=Ue(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=Ue(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=Ue(f+(b.clientX-u));n(j);for(const y of x)y.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let o;t[3]!==n?(o=()=>{n($t)},t[3]=n,t[4]=o):o=t[4];const a=o;let m;t[5]!==e?(m=Ue(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:l,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function Xi(t){return typeof t=="number"?Ue(t):$t}function Cs(){return[]}function ws(t){const e=A.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(Nt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(Ct,{children:s.jsx(ie,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function ks(t){const e=A.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{ne("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const o=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=D(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(V,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Qi(t){const e=A.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ss,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Zi),e[2]=n.group.items,e[3]=r):r=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(o=s.jsx(ws,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(Ji),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ji(t){return s.jsx(ks,{item:t},t.key)}function Zi(t){return s.jsx(ks,{item:t},t.key)}function el(t){const e=A.c(17),{sections:n,footer:l,additionalContent:i,header:r,variant:o,contentClassName:a}=t,m=o===void 0?"sidebar":o;let c;e[0]!==r?(c=r&&s.jsx(an,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=D("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map(tl),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==i?(f=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[6]=i,e[7]=f):f=e[7];let h;e[8]!==d||e[9]!==u||e[10]!==f?(h=s.jsxs(ns,{className:d,children:[u,f]}),e[8]=d,e[9]=u,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==m?(x=s.jsxs(cn,{variant:m,children:[c,h,l]}),e[12]=l,e[13]=c,e[14]=h,e[15]=m,e[16]=x):x=e[16],x}function tl(t,e){return s.jsx(Qi,{section:t},e)}function Is(t){const e=A.c(2);let n;return e[0]!==t?(n=s.jsx(el,{...t}),e[0]=t,e[1]=n):n=e[1],n}Is.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(ce,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function As(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sl=Ws({name:qs().min(2,"Organization name is required")});function nl(t){const e=A.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Vs(sl),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Ks(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:ll,onSuccess:il},e[1]=o):o=e[1];const a=gt(o),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Rn,{children:[s.jsx(Ln,{children:"Create a new organization"}),s.jsx(Un,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],d=r.handleSubmit(_),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(qn,{children:[s.jsx(Vn,{children:"Organization Name"}),s.jsx(Kn,{children:s.jsx(Qn,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(Yn,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",As(S.value)]})]}),s.jsx(Xn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(Gn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==m?(h=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(Pn,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Jn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(Ge,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==g?(y=s.jsxs(Hn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==d||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=d,e[31]=f,e[32]=h,e[33]=v):v=e[33];let C;e[34]!==r||e[35]!==v?(C=s.jsxs(Fn,{children:[c,s.jsx(Wn,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=C):C=e[36];let N;return e[37]!==l||e[38]!==n||e[39]!==C?(N=s.jsx(Bn,{open:n,onOpenChange:l,children:C}),e[37]=l,e[38]=n,e[39]=C,e[40]=N):N=e[40],N}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=As(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await re.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function zs(){const t=F.useContext(Ys),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function rl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function rt(t){const e=A.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",o=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=D(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:rl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:D("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function ol({invitation:t,onChanged:e}){const[n,l]=F.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const m=await re.organization.acceptInvitation({invitationId:t.id});if(m.error){ae.error(m.error.message),l(!1);return}}catch{ae.error("Failed to accept invitation"),l(!1);return}ae.success(`Joined ${i}`),Qs();let a;try{a=(await re.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},o=async()=>{l(!0);try{const a=await re.organization.rejectInvitation({invitationId:t.id});if(a.error){ae.error(a.error.message),l(!1);return}ae.success("Invitation declined"),l(!1),e()}catch{ae.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(rt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Ge,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Ge,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:o,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(Dn,{size:14})})]})]})}function al(t){const e=A.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Xs(),{invitations:o,refetch:a}=zs();let m;e[0]!==n?(m=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=F.useState(""),f=d.toLowerCase(),h=f?c.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fs,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=w=>u(w.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=w=>w.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Le,{size:16}),e[9]=j):j=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];const C="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let N;e[15]!==o||e[16]!==d||e[17]!==a?(N=!d&&o.map(w=>s.jsx(ol,{invitation:w,onChanged:a},w.id)),e[15]=o,e[16]=d,e[17]=a,e[18]=N):N=e[18];const _=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=w=>s.jsxs("button",{type:"button",onClick:()=>l(w.slug),className:D("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(rt,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const k=h.map(S);let I;e[22]!==N||e[23]!==_||e[24]!==k?(I=s.jsxs("div",{className:C,children:[N,_,k]}),e[22]=N,e[23]=_,e[24]=k,e[25]=I):I=e[25];let $;return e[26]!==I||e[27]!==v?($=s.jsxs(s.Fragment,{children:[v,I]}),e[26]=I,e[27]=v,e[28]=$):$=e[28],$}function $s(t){const e=A.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,o=i===void 0?"start":i,a=r===void 0?"bottom":r,m=de(),[c,d]=F.useState(!1),[u,f]=F.useState(!1);let h;e[0]!==n?(h=s.jsx(Fe,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const x=String(c);let g;e[2]!==m?(g=N=>{d(!1),m({to:"/$org",params:{org:N}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),f(!0)},e[4]=p):p=e[4];let b;e[5]!==l||e[6]!==x||e[7]!==g?(b=s.jsx(al,{orgParam:l,onSelectOrg:g,onCreateOrg:p},x),e[5]=l,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(st,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:dl,onCloseAutoFocus:cl,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==j?(y=s.jsxs(nt,{open:c,onOpenChange:d,children:[h,j]}),e[13]=c,e[14]=h,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(nl,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let C;return e[19]!==v||e[20]!==y?(C=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=C):C=e[21],C}function cl(t){return t.preventDefault()}function dl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ml(t){const e=A.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==o?(d=D("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=D("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(ts,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(fs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==l?(x=j=>l(j.target.value),e[6]=l,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==f||e[15]!==h||e[16]!==g?(p=s.jsxs("label",{className:f,children:[h,g]}),e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const ul="Select an existing agent";function fl(t){const e=A.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{side:"right",sideOffset:8,children:ul}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(xe,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function hl(t){const e=de(),{create:n}=gs(),{locator:l}=Z(),i=_t({strict:!1}),r=tt({strict:!1});return async o=>{const a=crypto.randomUUID(),m=o===r.virtualmcpid?li(t,l,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function ft(t){const e=A.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==r?(o=D("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(je,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==l?(u=l&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==o||e[16]!==a||e[17]!==d||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:o,children:[a,d,u]}),e[14]=i,e[15]=o,e[16]=a,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=A.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function xl(t){const e=A.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[o,a]=F.useState(""),m=ms(),c=m??[],{org:d}=Z(),{data:u}=re.useSession(),f=u?.user?.id??"anon",h=ai(m),x=ci(),g=hl(d.slug),p=mi(m),b=o.toLowerCase(),j=c.filter(jl).filter(W=>!p.has(W.id)).filter(bl).filter(W=>!o||W.title.toLowerCase().includes(b)),y=j.filter(gl),v=j.filter(pl),C=Qe(d.id),N=!o||C.title.toLowerCase().includes(b),_=!!(l&&N);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const k=S,I=W=>{if(l){l(W.id),n(),a("");return}di({orgId:d.id,userId:f},W.id,h),x(),n(),a(""),g(W.id)},$="flex flex-col max-h-[min(640px,80dvh)]";let w;e[3]!==o?(w=s.jsx(ml,{value:o,onChange:a,placeholder:"Search agents..."}),e[3]=o,e[4]=w):w=e[4];const z="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&N&&C&&s.jsx(ft,{agent:C,selected:!i||i===C.id,onClick:k}),P=v.length>0&&s.jsx(Ft,{children:"Agents"}),U=v.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id)),R=(y.length>0||!o)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(si,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),E=y.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id));let O;e[5]!==_||e[6]!==o||e[7]!==j.length?(O=j.length===0&&!_&&o&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=_,e[6]=o,e[7]=j.length,e[8]=O):O=e[8];let H;e[9]!==O||e[10]!==M||e[11]!==P||e[12]!==U||e[13]!==R||e[14]!==E?(H=s.jsxs("div",{className:z,children:[M,P,U,R,E,O]}),e[9]=O,e[10]=M,e[11]=P,e[12]=U,e[13]=R,e[14]=E,e[15]=H):H=e[15];let G;e[16]!==d.slug?(G={org:d.slug},e[16]=d.slug,e[17]=G):G=e[17];let L;e[18]!==n?(L=()=>n(),e[18]=n,e[19]=L):L=e[19];let B;e[20]!==G||e[21]!==L?(B=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Js,{to:"/$org/settings/agents",params:G,onClick:L,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=G,e[21]=L,e[22]=B):B=e[22];let Y;return e[23]!==H||e[24]!==B||e[25]!==w?(Y=s.jsxs("div",{className:$,children:[w,H,B]}),e[23]=H,e[24]=B,e[25]=w,e[26]=Y):Y=e[26],Y}function pl(t){return!js(t.metadata)}function gl(t){return js(t.metadata)}function bl(t){return!zn(t.id)}function jl(t){return!An(t.id)}function vl(t){const e=A.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:o,side:a,align:m}=n,c=l===void 0?!1:l,d=a===void 0?"right":a,u=m===void 0?"start":m,[f,h]=F.useState(!1),[x,g]=F.useState(!1),p=wt(),{setOpenMobile:b}=pe(),j=oi(),y=j?"border border-border":void 0;let v;e[2]!==j?(v=P=>j?s.jsx(fl,{children:P}):P,e[2]=j,e[3]=v):v=e[3];const C=v;let N;e[4]!==p||e[5]!==b?(N=()=>{h(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=N):N=e[6];const _=N;let S;e[7]!==_?(S=()=>{_(),g(!0)},e[7]=_,e[8]=S):S=e[8];const k=S;let I;e[9]!==_||e[10]!==k||e[11]!==r||e[12]!==f||e[13]!==o?(I=f&&s.jsx(F.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ce,{className:"h-4 w-24"})}),children:s.jsx(xl,{onClose:_,onSelectAgent:r,selectedAgentId:o,onImportFromGithub:k})}),e[9]=_,e[10]=k,e[11]=r,e[12]=f,e[13]=o,e[14]=I):I=e[14];const $=I;let w;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==j||e[19]!==p||e[20]!==f||e[21]!==$||e[22]!==d||e[23]!==i||e[24]!==C?(w=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?C(s.jsx(ve,{"aria-label":"Browse agents",className:D(y),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Le,{className:"size-4"})})):s.jsx(V,{children:C(s.jsxs(J,{tooltip:j?void 0:"Browse agents",className:D(y),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(hs,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(xs,{className:"max-h-[85dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Browse agents"}),$]})})]}):s.jsxs(nt,{open:f,onOpenChange:P=>{P&&!f&&ne("agent_browser_opened",{surface:"desktop_popover"}),h(P)},children:[i?s.jsx(Fe,{asChild:!0,children:i}):c?C(s.jsx(Fe,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:D(y),children:s.jsx(Le,{className:"size-4"})})})):s.jsx(V,{children:C(s.jsx(Fe,{asChild:!0,children:s.jsxs(J,{tooltip:j?void 0:"Browse agents",className:D(y),children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(st,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:$})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=j,e[19]=p,e[20]=f,e[21]=$,e[22]=d,e[23]=i,e[24]=C,e[25]=w):w=e[25];let z;e[26]!==x?(z=s.jsx(ti,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=z):z=e[27];let M;return e[28]!==z||e[29]!==w?(M=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=M):M=e[30],M}const yl="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Sl(t){const e=A.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,o=It(n)??l??null,a=o?.title??"Super Agent",m=`Open ${a} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(je,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:yl,children:[f,h]}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(vl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function vt(t){const e=A.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:i}=Z(),{state:r,isMobile:o}=pe(),a=zs().invitations.length>0,m=r==="collapsed"||o,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx(rt,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:D("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=f):f=e[9];let h;e[10]!==i.name||e[11]!==l?(h=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=l,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==h?(g=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[f,h,x]})}),e[14]=c,e[15]=f,e[16]=h,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx($s,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(he,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(xe,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function ot(t){const e=A.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:i}=Z(),r=de();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const a=_t(o);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=tt(m),{threads:d}=At(),{data:u}=re.useSession(),{setTaskId:f,createNewTask:h}=zt();let x;e[4]!==i.id?(x=Qe(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==h||e[7]!==p||e[8]!==r||e[9]!==l||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==d?(j=S=>{if(!S||S===p){r({to:"/$org",params:{org:i.slug}}),l?.();return}const k=xi(d,S,u?.user?.id);k?f(k.id,S):h(S),l?.()},e[6]=h,e[7]=p,e[8]=r,e[9]=l,e[10]=i.slug,e[11]=u?.user?.id,e[12]=f,e[13]=d,e[14]=j):j=e[14];const y=j;let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=v):v=e[15];const C=b===p?g:void 0;let N;e[16]!==b||e[17]!==y?(N=()=>y(b),e[16]=b,e[17]=y,e[18]=N):N=e[18];let _;return e[19]!==b||e[20]!==y||e[21]!==C||e[22]!==N?(_=s.jsx(F.Suspense,{fallback:v,children:s.jsx(Sl,{agentId:b,fallback:C,onOpenHome:N,onPick:y})}),e[19]=b,e[20]=y,e[21]=C,e[22]=N,e[23]=_):_=e[23],_}function Rt(t){const e=A.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=D(i),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==m?(c=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(V,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function _l(t){const e=A.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ss,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let m;e[5]!==l?(m=c=>s.jsx(Rt,{item:c,onClose:l},c.key),e[5]=l,e[6]=m):m=e[6],o=n.group.items.map(m),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ws,{label:i,defaultExpanded:r,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(Rt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],i=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function Nl(t){const e=A.c(24),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(ot,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{size:16}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx(ve,{onClick:l,"aria-label":"Close sidebar",children:c}),e[5]=l,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[o,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;if(e[10]!==l||e[11]!==n){let p;e[13]!==l?(p=(b,j)=>s.jsx(_l,{section:b,onClose:l},j),e[13]=l,e[14]=p):p=e[14],f=n.map(p),e[10]=l,e[11]=n,e[12]=f}else f=e[12];let h;e[15]!==r?(h=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs(ns,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function Pe(t){const e=A.c(26),{item:n,onClose:l}=t;let i;e[0]!==n.className?(i=D("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let h;e[4]!==n.label?(h=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=h):h=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==l||e[9]!==d||e[10]!==u||e[11]!==f||e[12]!==h?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:l,children:[f,h]}),e[6]=r,e[7]=n.href,e[8]=l,e[9]=d,e[10]=u,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}let o;e[14]!==n||e[15]!==l?(o=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=o):o=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==o||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m]}),e[21]=r,e[22]=o,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function Lt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-amber-100 dark:bg-amber-500/20 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-400",children:"Impersonating"}),t[0]=e):e=t[0],e}function Ut(t){const e=A.c(144),{user:n,userImage:l,menuItems:i,signOutItem:r,stopImpersonatingItem:o,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:f}=t;if(f){const X=n?.name??"U";let ee;e[0]!==X||e[1]!==l?(ee=s.jsx(Je,{url:l,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=l,e[2]=ee):ee=e[2];const ge=n?.name??"User";let te;e[3]!==ge?(te=s.jsx("p",{className:"text-sm font-medium truncate",children:ge}),e[3]=ge,e[4]=te):te=e[4];let oe;e[5]!==a?(oe=a&&s.jsx(Lt,{}),e[5]=a,e[6]=oe):oe=e[6];let le;e[7]!==te||e[8]!==oe?(le=s.jsxs("div",{className:"flex items-center gap-2",children:[te,oe]}),e[7]=te,e[8]=oe,e[9]=le):le=e[9];const T=n?.email;let q;e[10]!==T?(q=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:T}),e[10]=T,e[11]=q):q=e[11];let Q;e[12]!==le||e[13]!==q?(Q=s.jsxs("div",{className:"flex-1 min-w-0",children:[le,q]}),e[12]=le,e[13]=q,e[14]=Q):Q=e[14];let K;e[15]!==n?(K=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Il)},e[15]=n,e[16]=K):K=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Et,{size:14}),e[17]=be):be=e[17];let Se;e[18]!==K?(Se=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:K,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:be})}),e[18]=K,e[19]=Se):Se=e[19];let We;e[20]===Symbol.for("react.memo_cache_sentinel")?(We=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[20]=We):We=e[20];let _e;e[21]!==Se?(_e=s.jsx(bt,{delayDuration:300,children:s.jsxs(xe,{children:[Se,We]})}),e[21]=Se,e[22]=_e):_e=e[22];let Ne;e[23]!==_e||e[24]!==ee||e[25]!==Q?(Ne=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[ee,Q,_e]}),e[23]=_e,e[24]=ee,e[25]=Q,e[26]=Ne):Ne=e[26];let Ce;if(e[27]!==u||e[28]!==i){let ue;e[30]!==u?(ue=Ke=>s.jsx(Pe,{item:Ke,onClose:u},Ke.key),e[30]=u,e[31]=ue):ue=e[31],Ce=i.map(ue),e[27]=u,e[28]=i,e[29]=Ce}else Ce=e[29];let we;e[32]!==u||e[33]!==o?(we=o&&s.jsx(Pe,{item:o,onClose:u}),e[32]=u,e[33]=o,e[34]=we):we=e[34];let ke;e[35]!==u||e[36]!==r?(ke=s.jsx(Pe,{item:r,onClose:u}),e[35]=u,e[36]=r,e[37]=ke):ke=e[37];let Ie;e[38]!==Ce||e[39]!==we||e[40]!==ke?(Ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ce,we,ke]})}),e[38]=Ce,e[39]=we,e[40]=ke,e[41]=Ie):Ie=e[41];let Ae;if(e[42]!==c.theme||e[43]!==d||e[44]!==m){let ue;e[46]!==c.theme||e[47]!==d?(ue=Ke=>{const{value:mt,icon:Rs,label:Ls}=Ke;return s.jsx("button",{type:"button","aria-label":Ls,onClick:()=>d(Us=>({...Us,theme:mt})),className:D("size-8 rounded-md flex items-center justify-center transition-colors",c.theme===mt?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Rs},mt)},e[46]=c.theme,e[47]=d,e[48]=ue):ue=e[48],Ae=m.map(ue),e[42]=c.theme,e[43]=d,e[44]=m,e[45]=Ae}else Ae=e[45];let ze;e[49]!==Ae?(ze=s.jsx("div",{className:"flex items-center gap-0.5",children:Ae}),e[49]=Ae,e[50]=ze):ze=e[50];const ct=c.enableSounds?"Disable sounds":"Enable sounds";let $e;e[51]!==d?($e=()=>d(kl),e[51]=d,e[52]=$e):$e=e[52];const dt=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Te;e[53]!==dt?(Te=D("size-8 rounded-md flex items-center justify-center transition-colors",dt),e[53]=dt,e[54]=Te):Te=e[54];let Oe;e[55]!==c.enableSounds?(Oe=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[55]=c.enableSounds,e[56]=Oe):Oe=e[56];let Me;e[57]!==ct||e[58]!==$e||e[59]!==Te||e[60]!==Oe?(Me=s.jsx("button",{type:"button","aria-label":ct,onClick:$e,className:Te,children:Oe}),e[57]=ct,e[58]=$e,e[59]=Te,e[60]=Oe,e[61]=Me):Me=e[61];let qe;e[62]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.69.1"]}),e[62]=qe):qe=e[62];let Ee;e[63]!==Me?(Ee=s.jsxs("div",{className:"flex items-center gap-2",children:[Me,qe]}),e[63]=Me,e[64]=Ee):Ee=e[64];let De;e[65]!==ze||e[66]!==Ee?(De=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ze,Ee]}),e[65]=ze,e[66]=Ee,e[67]=De):De=e[67];let Ve;return e[68]!==Ne||e[69]!==Ie||e[70]!==De?(Ve=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Ne,Ie,De]}),e[68]=Ne,e[69]=Ie,e[70]=De,e[71]=Ve):Ve=e[71],Ve}const h=n?.name??"U";let x;e[72]!==h||e[73]!==l?(x=s.jsx(Je,{url:l,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[72]=h,e[73]=l,e[74]=x):x=e[74];const g=n?.name??"User";let p;e[75]!==g?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[75]=g,e[76]=p):p=e[76];let b;e[77]!==a?(b=a&&s.jsx(Lt,{}),e[77]=a,e[78]=b):b=e[78];let j;e[79]!==p||e[80]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[79]=p,e[80]=b,e[81]=j):j=e[81];const y=n?.email;let v;e[82]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[82]=y,e[83]=v):v=e[83];let C;e[84]!==j||e[85]!==v?(C=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[84]=j,e[85]=v,e[86]=C):C=e[86];let N;e[87]!==n?(N=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wl)},e[87]=n,e[88]=N):N=e[88];let _;e[89]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Et,{size:14}),e[89]=_):_=e[89];let S;e[90]!==N?(S=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:N,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[90]=N,e[91]=S):S=e[91];let k;e[92]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[92]=k):k=e[92];let I;e[93]!==S?(I=s.jsx(bt,{delayDuration:300,children:s.jsxs(xe,{children:[S,k]})}),e[93]=S,e[94]=I):I=e[94];let $;e[95]!==I||e[96]!==x||e[97]!==C?($=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[x,C,I]}),e[95]=I,e[96]=x,e[97]=C,e[98]=$):$=e[98];let w;if(e[99]!==u||e[100]!==i){let X;e[102]!==u?(X=ee=>s.jsx(Pe,{item:ee,onClose:u},ee.key),e[102]=u,e[103]=X):X=e[103],w=i.map(X),e[99]=u,e[100]=i,e[101]=w}else w=e[101];let z;e[104]!==u||e[105]!==o?(z=o&&s.jsx(Pe,{item:o,onClose:u}),e[104]=u,e[105]=o,e[106]=z):z=e[106];let M;e[107]!==u||e[108]!==r?(M=s.jsx(Pe,{item:r,onClose:u}),e[107]=u,e[108]=r,e[109]=M):M=e[109];let P;e[110]!==w||e[111]!==z||e[112]!==M?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[w,z,M]}),e[110]=w,e[111]=z,e[112]=M,e[113]=P):P=e[113];let U;if(e[114]!==c.theme||e[115]!==d||e[116]!==m){let X;e[118]!==c.theme||e[119]!==d?(X=ee=>{const{value:ge,icon:te,label:oe}=ee;return s.jsx("button",{type:"button","aria-label":oe,onClick:()=>d(le=>({...le,theme:ge})),className:D("size-7 rounded-md flex items-center justify-center transition-colors",c.theme===ge?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:te},ge)},e[118]=c.theme,e[119]=d,e[120]=X):X=e[120],U=m.map(X),e[114]=c.theme,e[115]=d,e[116]=m,e[117]=U}else U=e[117];let R;e[121]!==U?(R=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[121]=U,e[122]=R):R=e[122];const E=c.enableSounds?"Disable sounds":"Enable sounds";let O;e[123]!==d?(O=()=>d(Cl),e[123]=d,e[124]=O):O=e[124];const H=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let G;e[125]!==H?(G=D("size-7 rounded-md flex items-center justify-center transition-colors",H),e[125]=H,e[126]=G):G=e[126];let L;e[127]!==c.enableSounds?(L=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[127]=c.enableSounds,e[128]=L):L=e[128];let B;e[129]!==E||e[130]!==O||e[131]!==G||e[132]!==L?(B=s.jsx("button",{type:"button","aria-label":E,onClick:O,className:G,children:L}),e[129]=E,e[130]=O,e[131]=G,e[132]=L,e[133]=B):B=e[133];let Y;e[134]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.69.1"]}),e[134]=Y):Y=e[134];let W;e[135]!==B?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[B,Y]}),e[135]=B,e[136]=W):W=e[136];let me;e[137]!==R||e[138]!==W?(me=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[R,W]}),e[137]=R,e[138]=W,e[139]=me):me=e[139];let ye;return e[140]!==$||e[141]!==P||e[142]!==me?(ye=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[$,P,me]})}),e[140]=$,e[141]=P,e[142]=me,e[143]=ye):ye=e[143],ye}function Cl(t){return{...t,enableSounds:!t.enableSounds}}function wl(){ae.success("User ID copied")}function kl(t){return{...t,enableSounds:!t.enableSounds}}function Il(){ae.success("User ID copied")}function He(){const t=A.c(43),{data:e}=re.useSession(),{org:n}=Z(),l=de();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const o=Zs(i)?.params.org,[a,m]=en(),c=wt(),{isAdmin:d}=Ni(),[u,f]=F.useState(!1),h=e?.user,x=h?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>f(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(it,{size:16}),t[2]=j):j=t[2];let y;t[3]!==l||t[4]!==o?(y={key:"preferences",label:"Preferences",icon:j,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=y):y=t[5];let v;t[6]!==n||t[7]!==l?(v=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(pi,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=v):v=t[8];let C;t[9]===Symbol.for("react.memo_cache_sentinel")?(C={key:"terms",label:"Terms of Use",icon:s.jsx(bi,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=C):C=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N={key:"privacy",label:"Privacy Policy",icon:s.jsx(Si,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=N):N=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(tn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S={key:"community",label:"Community",icon:s.jsx(_i,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=S):S=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k={key:"homepage",label:"Homepage",icon:s.jsx(gi,{size:16}),href:"https://decocms.com",external:!0},t[13]=k):k=t[13];let I;t[14]!==d||t[15]!==l?(I=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx($n,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-amber-700 dark:text-amber-400"}]:[],t[14]=d,t[15]=l,t[16]=I):I=t[16];let $;t[17]!==I||t[18]!==y||t[19]!==v?($=[y,...v,C,N,_,S,k,...I],t[17]=I,t[18]=y,t[19]=v,t[20]=$):$=t[20];const w=$;let z;t[21]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Dt,{size:16}),onClick:$l},t[21]=z):z=t[21];const M=z;let P;t[22]!==g?(P=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(Dt,{size:16}),onClick:zl,className:"text-amber-700 dark:text-amber-400"}:null,t[22]=g,t[23]=P):P=t[23];const U=P;let R;t[24]===Symbol.for("react.memo_cache_sentinel")?(R={value:"light",icon:s.jsx(vi,{size:14}),label:"Light theme"},t[24]=R):R=t[24];let E;t[25]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(yi,{size:14}),label:"Dark theme"},t[25]=E):E=t[25];let O;t[26]===Symbol.for("react.memo_cache_sentinel")?(O=[R,E,{value:"system",icon:s.jsx(jt,{size:14}),label:"System theme"}],t[26]=O):O=t[26];const H=O;let G;t[27]!==g||t[28]!==c||t[29]!==w||t[30]!==a||t[31]!==m||t[32]!==U||t[33]!==h||t[34]!==x?(G={user:h,userImage:x,menuItems:w,signOutItem:M,stopImpersonatingItem:U,isImpersonating:g,themeOptions:H,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=w,t[30]=a,t[31]=m,t[32]=U,t[33]=h,t[34]=x,t[35]=G):G=t[35];const L=G;let B;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==L||t[40]!==h?.name||t[41]!==x?(B=s.jsx(s.Fragment,{children:c?s.jsxs(hs,{open:u,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:D("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(xs,{className:"h-[80dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Account"}),s.jsx(Ut,{...L})]})]}):s.jsxs(nt,{open:u,onOpenChange:f,children:[s.jsx(Fe,{asChild:!0,children:s.jsxs(J,{tooltip:h?.name??"Account",className:D("rounded-md",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]})}),s.jsx(st,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Al,children:s.jsx(Ut,{...L})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=L,t[40]=h?.name,t[41]=x,t[42]=B):B=t[42],B}function Al(t){return t.preventDefault()}async function zl(){const{error:t}=await re.admin.stopImpersonating();if(t){ae.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function $l(){ne("signed_out",{source:"account_popover"}),sn(),re.signOut()}function Be(t){const e=A.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=Zn(),[r,o]=F.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=Ci(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>o(!0),v=s.jsx(jt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let C;e[8]!==a?(C=s.jsx("span",{children:a}),e[8]=a,e[9]=C):C=e[9];let N;e[10]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=N):N=e[11];let _;e[12]!==a||e[13]!==C||e[14]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(J,{tooltip:a,onClick:y,children:[v,C,N]})}),e[12]=a,e[13]=C,e[14]=N,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(he,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let k;e[18]!==_||e[19]!==S?(k=s.jsxs(xe,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=k):k=e[20];let I;e[21]!==r?(I=s.jsx(Pt,{open:r,onOpenChange:o}),e[21]=r,e[22]=I):I=e[22];let $;return e[23]!==I||e[24]!==k?($=s.jsxs(s.Fragment,{children:[k,I]}),e[23]=I,e[24]=k,e[25]=$):$=e[25],$}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(jt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let x;e[30]!==u||e[31]!==h?(x=s.jsx(fe,{asChild:!0,children:s.jsxs(ve,{onClick:d,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(he,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(xe,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(Pt,{open:r,onOpenChange:o}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class Tl extends F.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Ol(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ml(){const t=A.c(17),e=de(),{org:n}=Z(),{hasDecoKey:l,balanceDollars:i}=ui();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let o;t[2]!==i?(o=D(i!=null&&Ol(i)),t[2]=i,t[3]=o):o=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Tn,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==o||t[14]!==a||t[15]!==d?(u=s.jsx(ie,{children:s.jsx(V,{children:s.jsxs(J,{tooltip:r,className:o,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=o,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function Ht(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Tl,{children:s.jsx(F.Suspense,{fallback:null,children:s.jsx(Ml,{})})}),t[0]=e):e=t[0],e}function ht(){const t=A.c(7),e=de(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let o;return t[5]!==l?(o=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=o):o=t[6],o}function El(){const t=A.c(6),e=de(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==l?(r=s.jsx("button",{type:"button","aria-label":"Settings",onClick:l,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:i}),t[4]=l,t[5]=r):r=t[5],r}function Bt(){const t=A.c(4),[e,n]=F.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ie,{className:"gap-0.5",children:[l,s.jsx(V,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(ji,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(fi,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Gt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"gap-0.5",children:s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function Dl(){const t=A.c(17),{state:e}=pe(),n=e==="collapsed";if(lt()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{}),t[0]=f):f=t[0];let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Be,{})})}),t[1]=h):h=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(V,{children:s.jsx(ht,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(ie,{children:[h,x,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Gt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(V,{children:s.jsx(Be,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(ie,{className:"gap-0.5",children:[d,s.jsx(V,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(He,{})}),s.jsx(El,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Bt,{}),d=s.jsx(Ht,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Be,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(V,{children:s.jsx(ht,{})}),t[10]=f):f=t[10];let h;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(ie,{children:[u,f,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[11]=h):h=t[11],h}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{}),r=s.jsx(Ht,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(V,{children:s.jsx(Be,{variant:"full"})}),t[14]=o):o=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(V,{children:s.jsx(ht,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ie,{className:"gap-0.5",children:[o,a,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[16]=m):m=t[16],m}function Pl(){const t=A.c(8),e=de(),{org:n}=Z(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ie,{children:s.jsx(V,{children:s.jsx(He,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(it,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==r?(a=s.jsx(Re,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:o})]})}),t[6]=r,t[7]=a):a=t[7],a}function Wt(t){const e=A.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,o]=F.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==l?(u=D("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let x;e[7]!==h?(x=D("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==g?(p=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=p):p=e[14],p}function Fl(t){const e=A.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let o;e[0]!==r||e[1]!==n?(o=n?s.jsx(Rl,{virtualMcpId:n,size:r}):s.jsx(je,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(_s,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=m):m=e[7],m}function Rl(t){const e=A.c(6),{virtualMcpId:n,size:l}=t,i=It(n);if(!i){let a;return e[0]!==l?(a=s.jsx(je,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const r=i.icon??null;let o;return e[2]!==i.title||e[3]!==l||e[4]!==r?(o=s.jsx(je,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=o):o=e[5],o}function qt(t){const e=A.c(36),{open:n,onOpenChange:l}=t,[i,r]=F.useState(""),{org:o}=Z(),{setTaskId:a}=zt(),m=Ss();let c,d,u;e[0]!==o.id||e[1]!==i?(u=i.trim(),d=nn,c=es.globalSearch(o.id,u),e[0]=o.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==m||e[6]!==u?(h=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==h?(x={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==l?(y=z=>{z||r(""),l(z)},e[14]=l,e[15]=y):y=e[15];const v=y;let C;e[16]!==v||e[17]!==a?(C=z=>{v(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=C):C=e[18];const N=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(_n,{className:"sr-only",children:[s.jsx(is,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==i?(S=s.jsx($i,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let k;e[22]!==N||e[23]!==p||e[24]!==j||e[25]!==u?(k=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ai,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(zi,{value:`thread:${z.id}:${z.title}`,onSelect:()=>N(z),className:"gap-2.5",children:[s.jsx(Fl,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled chat"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=N,e[23]=p,e[24]=j,e[25]=u,e[26]=k):k=e[26];let I;e[27]!==k?(I=s.jsx(Ti,{children:k}),e[27]=k,e[28]=I):I=e[28];let $;e[29]!==S||e[30]!==I?($=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Oi,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,I]})]}),e[29]=S,e[30]=I,e[31]=$):$=e[31];let w;return e[32]!==v||e[33]!==n||e[34]!==$?(w=s.jsx(ls,{open:n,onOpenChange:v,children:$}),e[32]=v,e[33]=n,e[34]=$,e[35]=w):w=e[35],w}function Ll(t){return t==="ephemeral"||t.startsWith("thread:")}function Ts(t){const e=A.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:o,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=Di(n.status),u=d.icon,f=n.metadata?.kind==="tool_call_run",h=It(f?void 0:n.virtual_mcp_id);let x;e[0]!==h?(x=hi(h),e[0]=h,e[1]=x):x=e[1];const g=x;Pi(6e4);const p=o||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==i?(v=H=>{H.target===H.currentTarget&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==C||e[5]!==N?(_=D("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(S=a&&!f&&s.jsx(je,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let k;e[12]!==p?(k=p&&s.jsx(_s,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=k):k=e[13];const I=n.title||"Untitled task";let $;e[14]!==I?($=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[14]=I,e[15]=$):$=e[15];let w;e[16]!==k||e[17]!==$?(w=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,$]}),e[16]=k,e[17]=$,e[18]=w):w=e[18];let z;e[19]!==g||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:D("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ll(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Ri(new Date(n.updated_at))})]}),e[19]=g,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=z):z=e[23];let M;e[24]!==w||e[25]!==z?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[w,z]}),e[24]=w,e[25]=z,e[26]=M):M=e[26];const P="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!m&&s.jsx("span",{className:D("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:D(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let R;e[27]!==r?(R=r&&s.jsxs(xe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H=>{H.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ln,{size:14})})}),s.jsx(he,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=R):R=e[28];let E;e[29]!==U||e[30]!==R?(E=s.jsxs("div",{className:P,children:[U,R]}),e[29]=U,e[30]=R,e[31]=E):E=e[31];let O;return e[32]!==i||e[33]!==M||e[34]!==E||e[35]!==v||e[36]!==_||e[37]!==S||e[38]!==n.id?(O=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:i,onKeyDown:v,className:_,children:[S,M,E]}),e[32]=i,e[33]=M,e[34]=E,e[35]=v,e[36]=_,e[37]=S,e[38]=n.id,e[39]=O):O=e[39],O}const Vt=["requires_action","in_progress","failed","expired","completed"];function Ul(t){const e=new Map(Vt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Vt.map(n=>({status:n,threads:e.get(n)}))}const Hl="sidebar.group.expanded.";function Bl(t,e){const n=A.c(3),[l,i]=et(`${Hl}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function Os(t){const e=A.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==r?(o=D("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(ts,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const m=l?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Gl(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Wl(t){return t.member==="mine"&&!t.currentUserId}const Ms=4;let Xe=0;const yt=[];function ql(){for(;Xe<Ms&&yt.length>0;){const t=yt.shift();t&&t()}}function Es(t){return new Promise((e,n)=>{const l=()=>{Xe++,t().then(e,n).finally(()=>{Xe--,ql()})};Xe<Ms?l():yt.push(l)})}const at=10;function Kt(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const o={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Vl(t,e,n,l){let i=0;for(const r of t)Ds(r,e,n,l)&&i++;return i}function xt(t,e,n,l){return Vl(t,e,n,l)}function Kl(t,e){return!!(t>=at||t===0&&e)}function Yt(t,e){return t<e}function Yl(t,e){return e===!1?!1:e===!0?!0:t}function Ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Ze=new Map,Ye=new Map;function Xl(t,e){return e?t>=at?!0:null:!1}function Xt(t){return Ze.get(t)}function Ql(t,e){Ze.set(t,e)}function Jl(t,e,n){const l=Ze.get(t);if(l!==void 0){n(l);return}let i=Ye.get(t);i||(i=Es(e).then(r=>(Ze.set(t,r),Ye.delete(t),r)).catch(()=>(Ye.delete(t),Promise.reject(new Error("group probe failed")))),Ye.set(t,i)),i.then(n,()=>n(!1))}function Qt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===at,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Zl(t,e,n,l,i){let r=0;for(const o of t)e.has(o.id)||Ds(o,n,l,i)&&r++;return r}function er(t,e,n,l){const i=A.c(8),{org:r}=Z(),o=Gl(r.id,t,e,n);let a;i[0]!==n?(a=Wl(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=F.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=ni(),{threads:f,hasMore:h}=At(),x=xt(f,t,e,n),g=Kl(x,h),p=Xl(x,h),b=Ss();if(c.identity===o&&c.serverHasMore===null){const _=p??Xt(o);_!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!m&&c.identity===o&&c.serverHasMore===null&&p===null&&Xt(o)===void 0&&c.probeSubscribedIdentity!==o&&(d(_=>_.identity===o?{..._,isProbing:!0,probeSubscribedIdentity:o}:_),Jl(o,async()=>{const _=Kt(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:k}=Qt(S),I=xt(u.threads.get(),t,e,n);return k===void 0?!1:Yt(I,k)},_=>{d(S=>S.identity!==o?S:{...S,isProbing:!1,serverHasMore:_})}));const y=async function(){if(c.isFetching||c.isProbing||m)return;const S=o;d(k=>k.identity===S?{...k,isFetching:!0}:k);try{const k=xt(f,t,e,n),I=Kt(t,e,k,n,at),$=await Es(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:w,hasMore:z,totalCount:M}=Qt($),P=new Set(f.map(tr)),U=Zl(w,P,t,e,n),R=k;u.mergeThreads(w),d(E=>{if(E.identity!==S)return E;let O;return M!==void 0?O=Yt(R+U,M):O=w.length===0||U===0?!1:z,Ql(S,O),{...E,isFetching:!1,serverHasMore:O}})}catch(k){const I=k,$=I instanceof Error?I.message:String(I);ae.error(`Could not load more tasks: ${$}`),d(w=>w.identity===S?{...w,isFetching:!1}:w)}},v=c.isFetching||c.isProbing,C=!m&&!v&&Yl(g,c.serverHasMore);let N;return i[2]!==v||i[3]!==y||i[4]!==C||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(N={hasMore:C,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=C,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=N):N=i[7],N}function tr(t){return t.id}function sr(t){const e=A.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:f,serverHasMore:h}=er("status",n,m),[x,g]=F.useState(!1);!x&&l.length===0&&h===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==o||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==o||e[11]!==r?(y=v=>s.jsx(Ts,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:a&&v.created_by===m.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=a,e[9]=m,e[10]=o,e[11]=r,e[12]=y):y=e[12],p=l.map(y),e[0]=i,e[1]=a,e[2]=m,e[3]=o,e[4]=r,e[5]=l,e[6]=p}else p=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(Os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function nr(t){const e=A.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,c=Fi[n],d=c.icon,[u,f]=Bl(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const x=h;let g;e[3]!==x?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=p):p=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(kt,{size:14}):s.jsx(Li,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let C;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==y||e[22]!==v?(C=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,y,v]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=y,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==o||e[29]!==r||e[30]!==n||e[31]!==l?(N=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(sr,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=o,e[29]=r,e[30]=n,e[31]=l,e[32]=N):N=e[32];let _;return e[33]!==C||e[34]!==N?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[C,N]}),e[33]=C,e[34]=N,e[35]=_):_=e[35],_}function Jt(t){const e=A.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ei,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||m;if(l==="status"){let p;if(e[3]!==i||e[4]!==f||e[5]!==a||e[6]!==o||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==f||e[12]!==a||e[13]!==o||e[14]!==r?(j=y=>s.jsx(nr,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:f,filters:a},y.status),e[10]=i,e[11]=f,e[12]=a,e[13]=o,e[14]=r,e[15]=j):j=e[15],p=Ul(n).map(j),e[3]=i,e[4]=f,e[5]=a,e[6]=o,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let h;if(e[18]!==i||e[19]!==f||e[20]!==a||e[21]!==o||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==f||e[27]!==a||e[28]!==o||e[29]!==r?(p=b=>s.jsx(Ts,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:f&&b.created_by===a.currentUserId?()=>o(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=f,e[27]=a,e[28]=o,e[29]=r,e[30]=p):p=e[30],h=n.map(p),e[18]=i,e[19]=f,e[20]=a,e[21]=o,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(Os,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==h||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[h,x]}),e[35]=h,e[36]=x,e[37]=g):g=e[37],g}function ir(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Zt(t){const e=A.c(17),{label:n,onClick:l,active:i,children:r}=t,[o,a]=F.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=D("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=h):h=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(x=s.jsx(fe,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(he,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==o||e[14]!==x||e[15]!==g?(p=s.jsxs(xe,{open:o,children:[x,g]}),e[13]=o,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function pt(t){const e=A.c(13),{label:n,value:l,onChange:i,options:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(lr),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==l?(c=s.jsx(Ii,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=l,e[9]=c):c=e[9];let d;return e[10]!==o||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=d):d=e[12],d}function lr(t){return s.jsxs(ki,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function Ps({onNavigate:t}={}){const{data:e}=re.useSession(),n=e?.user?.id,{org:l}=Z(),i=rs({connectionId:as,orgId:l.id,orgSlug:l.slug}),r=Qe(l.id).id,o=ms(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=At(),u=a.filter(T=>!T.hidden),{hide:f}=gs(),h=de(),{setTaskId:x,createNewTask:g}=zt(),p=_t({strict:!1}),b=tt({strict:!1}),j=p.taskId??null,y=b.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},C=[...u].sort((T,q)=>(q.updated_at??"").localeCompare(T.updated_at??"")),[N,_]=F.useState("all"),[S,k]=F.useState("flat"),[I,$]=et("sidebar-threads-scope-all",!1),[w,z]=F.useState(!1),[M,P]=F.useState(!1),U={type:N,member:"mine",currentUserId:n??null},R=T=>n?T.filter(q=>q.created_by===n):[],E=T=>N==="automation"?T.filter(q=>!!q.trigger_id):N==="manual"?T.filter(q=>!q.trigger_id):T,O=R(C),H=E(O),G=E(C),L=I?G:H,B=T=>{if(n&&T.created_by&&T.created_by!==n)return;const q=T.id===j;if(f(T.id),ri(T.id),!q)return;const Q=ir(L,T.id,n);v(),Q?x(Q.id,Q.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},Y=T=>{v(),x(T.id,T.virtual_mcp_id)},W=async T=>{try{const q=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((q.structuredContent??q).items?.length??0)===0}catch{return!1}},me=async()=>{const T=y??r;ne("sidebar_new_thread_clicked",{virtual_mcp_id:T});const q=O.find(Q=>Q.virtual_mcp_id===T&&Q.title==="New chat");if(q&&await W(q.id)){v(),x(q.id,T);return}v(),g(T)},{state:ye,isMobile:X,toggleSidebar:ee}=pe();if(ye==="collapsed"&&!X){const T=Qe(l.id),q=new Map((o??[]).map(K=>[K.id,K])),Q=K=>(K?q.get(K):void 0)??(K===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx($s,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(J,{tooltip:l.name,children:s.jsx(rt,{org:l,size:"sm"})})})}),s.jsxs(ie,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(V,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ee,children:s.jsx(ds,{size:16})})}),s.jsx(V,{children:s.jsx(J,{tooltip:"New chat",onClick:()=>{me()},children:s.jsx(Mt,{size:16})})}),L.map(K=>{const be=Q(K.virtual_mcp_id);return s.jsx(V,{children:s.jsx(J,{tooltip:K.title||"New chat",isActive:K.id===j,onClick:()=>Y(K),children:s.jsx(je,{icon:be?.icon??null,name:be?.title??"Agent",size:"xs"})})},K.id)})]})]})}const te=S!=="flat"||N!=="all"||I===!0,oe=s.jsxs(nt,{children:[s.jsxs(xe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(Fe,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter chats",active:te,className:"md:size-[34px] rounded-lg",children:[s.jsx(wi,{size:16}),te&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(he,{side:"bottom",children:"Filter chats"})]}),s.jsxs(st,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(pt,{label:"View",value:S,onChange:T=>{ne("tasks_panel_group_by_changed",{to_value:T}),k(T)},options:[{value:"flat",label:"List",icon:s.jsx(Mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(En,{size:13})}]}),s.jsx(pt,{label:"Type",value:N,onChange:T=>{ne("tasks_panel_filter_changed",{to_value:T}),_(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(pt,{label:"Scope",value:I?"team":"mine",onChange:T=>$(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),le=T=>s.jsx(bt,{delayDuration:300,children:s.jsxs("div",{className:D("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Ns,{className:"md:size-[34px] rounded-lg"}),oe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Zt,{label:"Search chats",onClick:()=>{ne("tasks_panel_search_opened"),P(!0),z(!0)},children:s.jsx(On,{size:16})}),s.jsx(Zt,{label:"New chat",onClick:()=>{me()},children:s.jsx(Mt,{size:16})})]})]})});return X?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[le(!0),s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Jt,{threads:L,groupBy:S,activeTaskId:j,onSelectTask:Y,onArchiveTask:B,filters:U,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})}),M&&s.jsx(qt,{open:w,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[le(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Jt,{threads:L,groupBy:S,activeTaskId:j,onSelectTask:Y,onArchiveTask:B,filters:U,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})})}),M&&s.jsx(qt,{open:w,onOpenChange:z})]})}const rr=5,or=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Fs(){const t=A.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:rr}).map(dr)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ce,{className:"size-6 rounded-md"}),s.jsx(ce,{className:"size-6 rounded-md"}),s.jsx(ce,{className:"size-6 rounded-md"})]}),s.jsx(ce,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:or.map(ar)})]}),t[2]=l):l=t[2],l}function ar(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(ce,{className:"size-5 rounded-full shrink-0"}),s.jsx(ce,{className:D("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(cr)})]},e)}function cr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(ce,{className:"h-3 flex-1 rounded-sm"})},e)}function dr(t,e){return s.jsx(ce,{className:"size-10 rounded-lg mx-auto"},e)}function mr(){const t=A.c(2);if(lt()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(vt,{}),s.jsx(ot,{})]}),t[1]=n):n=t[1],n}function ur(){const t=A.c(5),e=Cs();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),l=s.jsx(mr,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(St,{children:s.jsx(F.Suspense,{fallback:s.jsx(Fs,{}),children:s.jsx(Ps,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(bs,{children:s.jsx(Is,{sections:e,footer:n,header:l,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function fr(t){const e=A.c(8),{onClose:n}=t,l=Cs();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pl,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Fs,{}),e[1]=r):r=e[1];let o;e[2]!==n?(o=s.jsx(St,{children:s.jsx(F.Suspense,{fallback:r,children:s.jsx(Ps,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(bs,{children:s.jsx(Nl,{sections:l,onClose:n,footer:i,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}const hr="sidebar.open";function xr(){const t=A.c(1),{state:e}=pe(),n=lt();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ot,{}),t[0]=l):l=t[0],l}function pr(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(on,{}),t[0]=e):e=t[0],e}function Da(){const t=A.c(43),e=wt(),n=lt();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{connect:i,siteUrl:r}=tt(l),o=i==="1",[a,m]=et(hr,!1),{width:c,wrapperRef:d,onStartResize:u,resetWidth:f}=Yi(),h=!e;let x,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(se.LeftColumn,{children:[s.jsx(xr,{}),s.jsx(se.TogglesSlot,{})]}),g=s.jsx(se.CenterSlot,{}),t[1]=x,t[2]=g):(x=t[1],g=t[2]);let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(se.Header,{children:[x,g,s.jsxs(se.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(se.TabsSlot,{})}),s.jsx(se.RightSlot,{})]})]}),t[3]=p):p=t[3];const b=p;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ns,{}),t[4]=j):j=t[4];let y;t[5]!==n?(y=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(ot,{})}),t[5]=n,t[6]=y):y=t[6];let v,C,N,_,S;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Be,{}),N=s.jsx(se.TogglesSlot,{}),_=s.jsx(se.TabsSlot,{className:"shrink-0"}),S=s.jsx(se.CenterSlot,{}),v=s.jsx(se.RightSlot,{}),t[7]=v,t[8]=C,t[9]=N,t[10]=_,t[11]=S):(v=t[7],C=t[8],N=t[9],_=t[10],S=t[11]);let k;t[12]!==y?(k=s.jsx(se.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,y,C,N,_,S,v]})}),t[12]=y,t[13]=k):k=t[13];const I=k;let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={background:"transparent",containerType:"inline-size"},t[14]=$):$=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(dn,{className:"flex flex-col min-h-0",style:$,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(F.Suspense,{fallback:s.jsx(pr,{}),children:s.jsx(rn,{})})})})}),t[15]=w):w=t[15];const z=w,M=!h&&(e?I:b),P=`${c}px`;let U;t[16]!==P?(U={"--sidebar-width":P,"--sidebar-width-icon":"3.125rem"},t[16]=P,t[17]=U):U=t[17];const R=U;let E;t[18]!==e||t[19]!==u||t[20]!==f?(E=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ur,{}),s.jsx(qi,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=E):E=t[21];let O;t[22]!==h?(O=h?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,z]}):z,t[22]=h,t[23]=O):O=t[23];let H;t[24]!==R||t[25]!==E||t[26]!==O||t[27]!==d?(H=s.jsxs(mn,{ref:d,className:"flex-1 bg-sidebar relative min-h-0",style:R,children:[E,O]}),t[24]=R,t[25]=E,t[26]=O,t[27]=d,t[28]=H):H=t[28];let G;t[29]!==e?(G=e&&s.jsx(Mi,{renderSidebar:gr}),t[29]=e,t[30]=G):G=t[30];let L;t[31]!==r||t[32]!==o?(L=o&&s.jsx(Ui,{siteUrl:r}),t[31]=r,t[32]=o,t[33]=L):L=t[33];let B;t[34]!==M||t[35]!==H||t[36]!==G||t[37]!==L?(B=s.jsx(ei,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[M,H,G,L]})}),t[34]=M,t[35]=H,t[36]=G,t[37]=L,t[38]=B):B=t[38];let Y;return t[39]!==m||t[40]!==a||t[41]!==B?(Y=s.jsx(ii,{children:s.jsx(se.Provider,{children:s.jsx(un,{open:a,onOpenChange:m,children:B})})}),t[39]=m,t[40]=a,t[41]=B,t[42]=Y):Y=t[42],Y}function gr(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(fr,{onClose:e})})})}export{Da as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-Cw_MOEue.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-B4yomm08.js";import{A as nt}from"./automation-runs-CG9qLUqb.js";import{r as lt,u as ct,a as dt,b as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-wNQQn_dv.js";import{r as xt}from"./index-F9o1E2LM.js";import"./LayoutLeft-CY_ilnE-.js";import"./use-mobile-CDGvObYb.js";import"./X-Dg3UHk4M.js";import"./tooltip-CEMhn06S.js";import"./select-BbQScYUM.js";import"./Check-qklIr9eC.js";import"./ChevronDown-Dqw9pJbF.js";import"./ChevronUp-C-6o6d8u.js";import"./useInfiniteQuery-DNK1YDMj.js";import"./use-infinite-scroll-BJxks4Oh.js";import"./use-connection-BwHNV7F-.js";import"./use-collections-Mmumb7Jv.js";import"./use-mcp-client-CwxQ2mu8.js";import"./constants-D_FQAPnt.js";import"./auth-JAYu2Sn7.js";import"./use-virtual-mcp-R-nHNI8F.js";import"./card-B5uBFViO.js";import"./table-D6kZLJZo.js";import"./empty-state-BAbUNiFM.js";import"./use-members-HgTG6V2z.js";import"./use-org-auth-client-CR847Rtk.js";import"./use-clock-tick-BoYgP8-u.js";import"./AlertCircle-CeJgODlb.js";import"./CheckCircle-B5HHFx3h.js";import"./Circle-DFIMbbWU.js";import"./agent-icon-BF217Hvb.js";import"./UserPlus01-CxsIZHHu.js";import"./Tool01-Dym7sffh.js";import"./ArrowUp-Cx_--6Z7.js";import"./Settings02-Rjz2fibP.js";import"./Tool02-DWpgQDA_.js";import"./XCircle-BVO-AfDl.js";import"./ArrowUpRight-ywfBK9uD.js";import"./TrendUp01-DJyrqfDN.js";import"./ZapSquare-CYxtM-xd.js";import"./Users03-C601mmDP.js";import"./ChevronRight-DX001g0F.js";import"./Stars02-pEQdLQRy.js";import"./Copy01-LCtBKUFe.js";import"./ZoomOut-FOnWv2R3.js";import"./DotsVertical-wzt5Huxh.js";import"./Globe01-Bwt4oV0U.js";import"./Eye-CTCWS-BQ.js";import"./FilterLines-0m6crn3m.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LinkExternal01-Cc-TIWai.js";import"./List-1sCiilk_.js";import"./Monitor01-BA72KgrB.js";import"./Sun-gRl2Ql5n.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./Plus-Dg6Y61Qh.js";import"./SearchLg-DCvqx7mk.js";import"./SearchMd-CxXAIK8q.js";import"./Shield01-DoN422Fp.js";import"./Stars01-BMHX9PwN.js";import"./Trash01-FLsHPD-j.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./XClose-CSAbqx7t.js";import"./Zap-C5e_tw0_.js";import"./use-automations-BV8BAFK6.js";import"./studio-tools-bcpgTNof.js";import"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import"./badge-DAQJGlmB.js";import"./checkbox-BfaUpDdG.js";import"./command-CaofFN3p.js";import"./index-CXseUXwz.js";import"./dialog-94MC6GNA.js";import"./popover-YRjoqx5c.js";import"./avatar-B8GP78HG.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DwaNL7ao.js";import"./file-type-icon-cxQD2Gow.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DOlDq43r.js";import"./index-DFa2bm2W.js";import"./chat-context-Csy5cRMg.js";import"./autosend-BOPTLlfV.js";import"./hooks-gTEmV-hn.js";import"./decopilot-sse-pool-DhL2hPm4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CfC4MjYU.js";import"./use-decopilot-events-Cy3Splz7.js";import"./use-organization-settings-D2FVOkxT.js";import"./index-Ce2Igu8Z.js";import"./shell-layout-C3vwcwKJ.js";import"./alert-dialog-NEl6qUgZ.js";import"./required-auth-layout-CkCZ1VH2.js";import"./use-org-sso-_zvIWw2Z.js";import"./integration-icon-B9AX6sxk.js";import"./use-navigate-to-agent-JH1aTgiP.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DjQ3-mxR.js";import"./form-DkmV3bZG.js";import"./label-wqLdGJT0.js";import"./input-C57OE_bz.js";import"./switch-Dj8a0W96.js";import"./drawer-Co_r3vYF.js";import"./collection-search-Qnz6jxTV.js";import"./tabs-uog8ypZ5.js";import"./toggle-group-xXar88Zl.js";import"./use-deco-credits-JXELkRA8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CL_n4ga5.js";import"./use-registry-connections-DYAxxhes.js";import"./extract-connection-data-kn2oock2.js";import"./collection-tabs-BCpGbCT5.js";import"./textarea-D96KZ_bk.js";import"./connection-form-helpers-Dx2pWKQg.js";import"./authenticate-and-persist-oauth-CHpUAxht.js";import"./mcp-oauth-CaQ5w7vv.js";import"./connect-desktop-dialog-Dd78-wLs.js";import"./select-model-Ivlt_Hjk.js";import"./skeleton-Dn-HzxdH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-kWU5lPTB.js";import"./dropdown-menu-CwZxSb5T.js";import"./index-BxUWUc0Q.js";import"./toolbar-DF6E_99x.js";import"./use-debounced-value-B3ktPBBI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkjfcEfu.js";import"./use-mcp-tools-DS-HH6so.js";import"./use-capability-IeWRUHjn.js";import"./tools-list-DyJkBr3l.js";import"./use-debounced-autosave-CAJHdpnz.js";import"./index-BOigHE8Y.js";import"./search-input-CqxCn4Rx.js";import"./github-repo-picker-ZKvJa1LN.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-DVIAQNCJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DcZqHo8p.js";import"./index-DFZw1AWG.js";import"./get-initials-D-f_fDFw.js";import"./calendar-C6LcfVwu.js";import"./toolbar-icon-button-CwX9OsPP.js";import"./use-file-configs-C5MIjZBk.js";import"./automation-list-row-BqcM-T9k.js";function ui(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const A=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const M=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const V=F,q=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,z=m.kind==="site"&&o&&n,B=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==q?(l=e.jsx(mt,{className:"text-sm font-semibold",children:q}),t[13]=q,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==$||t[22]!==H||t[23]!==A||t[24]!==v||t[25]!==h||t[26]!==B||t[27]!==x||t[28]!==M||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==z||t[37]!==_?(S=!o||!T&&!z?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:B}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:A,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:M})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=A,t[24]=v,t[25]=h,t[26]=B,t[27]=x,t[28]=M,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=z,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==V||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:V,children:f}),t[42]=V,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ui as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as H,j as t,B as Z}from"./index-Cw_MOEue.js";import{n as ee}from"./LinkExternal01-Cc-TIWai.js";import{aE as te,g as ie}from"./agent-icon-BF217Hvb.js";import{I as J}from"./input-C57OE_bz.js";import{L as G}from"./label-wqLdGJT0.js";import{a1 as oe}from"./automation-runs-CG9qLUqb.js";import{b as Q,c as se,T as W,a as re}from"./tabs-uog8ypZ5.js";import{T as le}from"./textarea-D96KZ_bk.js";import{v as ae,w as me,o as pe,x as ne,y as ce,I as de,z as fe,A as ue,B as xe}from"./index-F9o1E2LM.js";import{b as he,a as ge,B as ve}from"./block-document-jnC_u02j.js";import{u as je,s as E,E as be,R as ye,A as Ce}from"./primitives-BdN7cTl_.js";import"./AlertCircle-CeJgODlb.js";import"./UserPlus01-CxsIZHHu.js";import"./Tool01-Dym7sffh.js";import"./ArrowUp-Cx_--6Z7.js";import"./Settings02-Rjz2fibP.js";import"./Tool02-DWpgQDA_.js";import"./XCircle-BVO-AfDl.js";import"./ArrowUpRight-ywfBK9uD.js";import"./TrendUp01-DJyrqfDN.js";import"./ZapSquare-CYxtM-xd.js";import"./Users03-C601mmDP.js";import"./CheckCircle-B5HHFx3h.js";import"./Check-qklIr9eC.js";import"./ChevronDown-Dqw9pJbF.js";import"./ChevronRight-DX001g0F.js";import"./ChevronUp-C-6o6d8u.js";import"./Circle-DFIMbbWU.js";import"./Stars02-pEQdLQRy.js";import"./Copy01-LCtBKUFe.js";import"./ZoomOut-FOnWv2R3.js";import"./DotsVertical-wzt5Huxh.js";import"./Globe01-Bwt4oV0U.js";import"./Eye-CTCWS-BQ.js";import"./FilterLines-0m6crn3m.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LayoutLeft-CY_ilnE-.js";import"./List-1sCiilk_.js";import"./Monitor01-BA72KgrB.js";import"./Sun-gRl2Ql5n.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./Plus-Dg6Y61Qh.js";import"./SearchLg-DCvqx7mk.js";import"./SearchMd-CxXAIK8q.js";import"./Shield01-DoN422Fp.js";import"./Stars01-BMHX9PwN.js";import"./Trash01-FLsHPD-j.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./XClose-CSAbqx7t.js";import"./X-Dg3UHk4M.js";import"./Zap-C5e_tw0_.js";import"./select-BbQScYUM.js";import"./tooltip-CEMhn06S.js";import"./useInfiniteQuery-DNK1YDMj.js";import"./use-infinite-scroll-BJxks4Oh.js";import"./use-connection-BwHNV7F-.js";import"./use-collections-Mmumb7Jv.js";import"./use-mcp-client-CwxQ2mu8.js";import"./constants-D_FQAPnt.js";import"./auth-JAYu2Sn7.js";import"./use-virtual-mcp-R-nHNI8F.js";import"./card-B5uBFViO.js";import"./sidebar-B4yomm08.js";import"./use-mobile-CDGvObYb.js";import"./table-D6kZLJZo.js";import"./empty-state-BAbUNiFM.js";import"./use-members-HgTG6V2z.js";import"./use-org-auth-client-CR847Rtk.js";import"./use-clock-tick-BoYgP8-u.js";import"./use-automations-BV8BAFK6.js";import"./studio-tools-bcpgTNof.js";import"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import"./badge-DAQJGlmB.js";import"./checkbox-BfaUpDdG.js";import"./command-CaofFN3p.js";import"./index-CXseUXwz.js";import"./dialog-94MC6GNA.js";import"./popover-YRjoqx5c.js";import"./avatar-B8GP78HG.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DwaNL7ao.js";import"./file-type-icon-cxQD2Gow.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DOlDq43r.js";import"./index-DFa2bm2W.js";import"./chat-context-Csy5cRMg.js";import"./autosend-BOPTLlfV.js";import"./hooks-gTEmV-hn.js";import"./decopilot-sse-pool-DhL2hPm4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CfC4MjYU.js";import"./use-decopilot-events-Cy3Splz7.js";import"./use-organization-settings-D2FVOkxT.js";import"./index-Ce2Igu8Z.js";import"./shell-layout-C3vwcwKJ.js";import"./alert-dialog-NEl6qUgZ.js";import"./required-auth-layout-CkCZ1VH2.js";import"./use-org-sso-_zvIWw2Z.js";import"./integration-icon-B9AX6sxk.js";import"./use-navigate-to-agent-JH1aTgiP.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DjQ3-mxR.js";import"./form-DkmV3bZG.js";import"./drawer-Co_r3vYF.js";import"./collection-search-Qnz6jxTV.js";import"./toggle-group-xXar88Zl.js";import"./use-deco-credits-JXELkRA8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CL_n4ga5.js";import"./use-registry-connections-DYAxxhes.js";import"./extract-connection-data-kn2oock2.js";import"./collection-tabs-BCpGbCT5.js";import"./connection-form-helpers-Dx2pWKQg.js";import"./authenticate-and-persist-oauth-CHpUAxht.js";import"./mcp-oauth-CaQ5w7vv.js";import"./connect-desktop-dialog-Dd78-wLs.js";import"./select-model-Ivlt_Hjk.js";import"./skeleton-Dn-HzxdH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-kWU5lPTB.js";import"./dropdown-menu-CwZxSb5T.js";import"./index-BxUWUc0Q.js";import"./toolbar-DF6E_99x.js";import"./use-debounced-value-B3ktPBBI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkjfcEfu.js";import"./use-mcp-tools-DS-HH6so.js";import"./use-capability-IeWRUHjn.js";import"./tools-list-DyJkBr3l.js";import"./switch-Dj8a0W96.js";import"./use-debounced-autosave-CAJHdpnz.js";import"./index-BOigHE8Y.js";import"./search-input-CqxCn4Rx.js";import"./github-repo-picker-ZKvJa1LN.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-DVIAQNCJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DcZqHo8p.js";import"./index-DFZw1AWG.js";import"./get-initials-D-f_fDFw.js";import"./calendar-C6LcfVwu.js";import"./toolbar-icon-button-CwX9OsPP.js";import"./use-file-configs-C5MIjZBk.js";import"./automation-list-row-BqcM-T9k.js";function ke(g){return Array.isArray(g)?g.map(e=>({key:E(e?.key),value:E(e?.value)})):[]}function Co(g){const e=H.c(66),{orgSlug:o,virtualMcpId:m,branch:i,blockKey:f,block:a,decofile:l,meta:c,previewBaseUrl:h}=g;let x;e[0]!==i||e[1]!==o||e[2]!==m?(x={orgSlug:o,virtualMcpId:m,branch:i},e[0]=i,e[1]=o,e[2]=m,e[3]=x):x=e[3];const r=ae(x);let p;e[4]!==a?(p=me(a,"posts"),e[4]=a,e[5]=p):p=e[5];const d=p;let n;e[6]!==f||e[7]!==r?(n=F=>{r.mutate({blockKey:f,data:ne(f,"posts",ce(F))})},e[6]=f,e[7]=r,e[8]=n):n=e[8];const[s,N]=je(d,n);let S;e[9]!==s||e[10]!==N?(S=(F,Y)=>N({...s,[F]:Y}),e[9]=s,e[10]=N,e[11]=S):S=e[11];const v=S;let w;e[12]!==l||e[13]!==s||e[14]!==h?(w=he({decofile:l,post:s,previewBaseUrl:h}),e[12]=l,e[13]=s,e[14]=h,e[15]=w):w=e[15];const j=w;let b;e[16]!==s.title?(b=E(s.title)||"Untitled post",e[16]=s.title,e[17]=b):b=e[17];let y;e[18]!==b?(y=t.jsx("span",{className:"truncate text-sm font-medium",children:b}),e[18]=b,e[19]=y):y=e[19];let C;e[20]!==r.isError||e[21]!==r.isPending?(C=t.jsx(pe,{isPending:r.isPending,isError:r.isError}),e[20]=r.isError,e[21]=r.isPending,e[22]=C):C=e[22];const P=!j,_=j?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let k;e[23]!==j?(k=()=>{j&&window.open(j,"_blank","noopener,noreferrer")},e[23]=j,e[24]=k):k=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let u;e[26]!==_||e[27]!==k||e[28]!==P?(u=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:P,title:_,onClick:k,children:[B,"See preview"]}),e[26]=_,e[27]=k,e[28]=P,e[29]=u):u=e[29];let T;e[30]!==u||e[31]!==C?(T=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[C,u]}),e[30]=u,e[31]=C,e[32]=T):T=e[32];let R;e[33]!==T||e[34]!==y?(R=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[y,T]}),e[33]=T,e[34]=y,e[35]=R):R=e[35];let A;e[36]!==s.title?(A=E(s.title),e[36]=s.title,e[37]=A):A=e[37];let L;e[38]!==v?(L=F=>v("title",F),e[38]=v,e[39]=L):L=e[39];let I;e[40]!==A||e[41]!==L?(I=t.jsx(be,{value:A,onChange:L,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=A,e[41]=L,e[42]=I):I=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=K):K=e[43];let O;e[44]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(se,{children:[K,t.jsxs(Q,{value:"settings",children:[t.jsx(ie,{}),"Settings"]})]}),e[44]=O):O=e[44];let U;e[45]!==s.sections?(U=ge(s.sections),e[45]=s.sections,e[46]=U):U=e[46];let V;e[47]!==v?(V=F=>v("sections",F),e[47]=v,e[48]=V):V=e[48];let $;e[49]!==c||e[50]!==U||e[51]!==V?($=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(ve,{value:U,onChange:V,meta:c,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=c,e[50]=U,e[51]=V,e[52]=$):$=e[52];let M;e[53]!==l||e[54]!==s||e[55]!==v?(M=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ne,{post:s,decofile:l,onChange:v})})}),e[53]=l,e[54]=s,e[55]=v,e[56]=M):M=e[56];let z;e[57]!==$||e[58]!==M?(z=t.jsxs(re,{defaultValue:"content",className:"mt-6 gap-4",children:[O,$,M]}),e[57]=$,e[58]=M,e[59]=z):z=e[59];let D;e[60]!==I||e[61]!==z?(D=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:[I,z]})}),e[60]=I,e[61]=z,e[62]=D):D=e[62];let q;return e[63]!==R||e[64]!==D?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[R,D]}),e[63]=R,e[64]=D,e[65]=q):q=e[65],q}function Ne(g){const e=H.c(57),{post:o,decofile:m,onChange:i}=g;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=f):f=e[0];let a;e[1]!==o.excerpt?(a=E(o.excerpt),e[1]=o.excerpt,e[2]=a):a=e[2];let l;e[3]!==i?(l=u=>i("excerpt",u.target.value),e[3]=i,e[4]=l):l=e[4];let c;e[5]!==a||e[6]!==l?(c=t.jsxs("div",{className:"space-y-2",children:[f,t.jsx(le,{id:"post-excerpt",value:a,onChange:l,rows:2})]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=h):h=e[8];let x;e[9]!==o.slug?(x=E(o.slug),e[9]=o.slug,e[10]=x):x=e[10];let r;e[11]!==i?(r=u=>i("slug",u.target.value),e[11]=i,e[12]=r):r=e[12];let p;e[13]!==x||e[14]!==r?(p=t.jsxs("div",{className:"space-y-2",children:[h,t.jsx(J,{id:"post-slug",value:x,onChange:r,placeholder:"my-post",className:"h-10"})]}),e[13]=x,e[14]=r,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]!==o.date?(n=E(o.date),e[17]=o.date,e[18]=n):n=e[18];let s;e[19]!==i?(s=u=>i("date",u),e[19]=i,e[20]=s):s=e[20];let N;e[21]!==n||e[22]!==s?(N=t.jsx(xe,{schema:d,value:n,onChange:s,path:"post-date",label:"Date"}),e[21]=n,e[22]=s,e[23]=N):N=e[23];let S;e[24]!==N||e[25]!==p?(S=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p,N]}),e[24]=N,e[25]=p,e[26]=S):S=e[26];let v;e[27]===Symbol.for("react.memo_cache_sentinel")?(v={type:"string",format:"image-uri",title:"Cover image"},e[27]=v):v=e[27];let w;e[28]!==i?(w=u=>i("image",u),e[28]=i,e[29]=w):w=e[29];let j;e[30]!==o.image||e[31]!==w?(j=t.jsx(de,{schema:v,value:o.image,onChange:w,path:"post-image",label:"Cover image"}),e[30]=o.image,e[31]=w,e[32]=j):j=e[32];let b;e[33]!==i?(b=u=>i("authors",u),e[33]=i,e[34]=b):b=e[34];let y;e[35]!==m||e[36]!==o.authors||e[37]!==b?(y=t.jsx(X,{label:"Authors",decofile:m,kind:"authors",valueField:"email",toRef:we,selected:o.authors,onChange:b}),e[35]=m,e[36]=o.authors,e[37]=b,e[38]=y):y=e[38];let C;e[39]!==i?(C=u=>i("categories",u),e[39]=i,e[40]=C):C=e[40];let P;e[41]!==m||e[42]!==o.categories||e[43]!==C?(P=t.jsx(X,{label:"Categories",decofile:m,kind:"categories",valueField:"slug",toRef:Se,selected:o.categories,onChange:C}),e[41]=m,e[42]=o.categories,e[43]=C,e[44]=P):P=e[44];let _;e[45]!==i?(_=u=>i("extraProps",u),e[45]=i,e[46]=_):_=e[46];let k;e[47]!==o.extraProps||e[48]!==_?(k=t.jsx(Pe,{value:o.extraProps,onChange:_}),e[47]=o.extraProps,e[48]=_,e[49]=k):k=e[49];let B;return e[50]!==S||e[51]!==j||e[52]!==y||e[53]!==P||e[54]!==k||e[55]!==c?(B=t.jsxs("div",{className:"space-y-5",children:[c,S,j,y,P,k]}),e[50]=S,e[51]=j,e[52]=y,e[53]=P,e[54]=k,e[55]=c,e[56]=B):B=e[56],B}function Se(g){return{name:E(g.name),slug:E(g.slug)}}function we(g){return{...g}}function Pe(g){const e=H.c(15),{value:o,onChange:m}=g;let i,f,a,l;if(e[0]!==m||e[1]!==o){i=ke(o);const x=(r,p)=>m(i.map((d,n)=>n===r?{...d,...p}:d));f="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:"Extra props"}),e[6]=a):a=e[6],l=i.length>0&&t.jsx("ul",{className:"space-y-2",children:i.map((r,p)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:r.key,onChange:d=>x(p,{key:d.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:r.value,onChange:d=>x(p,{value:d.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>m(i.filter((d,n)=>n!==p))})]},p))}),e[0]=m,e[1]=o,e[2]=i,e[3]=f,e[4]=a,e[5]=l}else i=e[2],f=e[3],a=e[4],l=e[5];let c;e[7]!==i||e[8]!==m?(c=t.jsx(Ce,{label:"Add prop",onClick:()=>m([...i,{key:"",value:""}])}),e[7]=i,e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==f||e[11]!==a||e[12]!==l||e[13]!==c?(h=t.jsxs("div",{className:f,children:[a,l,c]}),e[10]=f,e[11]=a,e[12]=l,e[13]=c,e[14]=h):h=e[14],h}function X(g){const e=H.c(17),{label:o,decofile:m,kind:i,valueField:f,toRef:a,selected:l,onChange:c}=g;let h;e[0]!==m||e[1]!==i||e[2]!==l||e[3]!==a||e[4]!==f?(h=fe({records:ue(m,i),selected:l,valueField:f,toRef:a}),e[0]=m,e[1]=i,e[2]=l,e[3]=a,e[4]=f,e[5]=h):h=e[5];const{options:x,selectedValues:r,refsForValues:p}=h;let d;e[6]!==o?(d=t.jsx(G,{children:o}),e[6]=o,e[7]=d):d=e[7];let n;e[8]!==o||e[9]!==c||e[10]!==x||e[11]!==p||e[12]!==r?(n=x.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",o.toLowerCase()," yet — create some in the"," ",o.toLowerCase()," collection."]}):t.jsx(oe,{options:x,defaultValue:r,onValueChange:N=>c(p(N)),placeholder:`Select ${o.toLowerCase()}`,maxCount:4}),e[8]=o,e[9]=c,e[10]=x,e[11]=p,e[12]=r,e[13]=n):n=e[13];let s;return e[14]!==d||e[15]!==n?(s=t.jsxs("div",{className:"space-y-2",children:[d,n]}),e[14]=d,e[15]=n,e[16]=s):s=e[16],s}export{Co as PostEditor};
@@ -1 +0,0 @@
1
- import{c as $,C as H,j as v}from"./index-Cw_MOEue.js";import{a as L,g as E,s as b}from"./automation-runs-CG9qLUqb.js";import{u as O}from"./use-mcp-client-CwxQ2mu8.js";import{p as k}from"./constants-D_FQAPnt.js";import{b as q,c as B}from"./use-mcp-tools-DS-HH6so.js";import{u as Y}from"./index-F9o1E2LM.js";import{c as G}from"./monaco-editor-DOlDq43r.js";import{g as K,M as V,a as w}from"./index-Ce2Igu8Z.js";import{b as z,a as F}from"./chat-context-Csy5cRMg.js";import{u as J}from"./shell-layout-C3vwcwKJ.js";import"./select-BbQScYUM.js";import"./tooltip-CEMhn06S.js";import"./Check-qklIr9eC.js";import"./ChevronDown-Dqw9pJbF.js";import"./ChevronUp-C-6o6d8u.js";import"./useInfiniteQuery-DNK1YDMj.js";import"./use-infinite-scroll-BJxks4Oh.js";import"./use-connection-BwHNV7F-.js";import"./use-collections-Mmumb7Jv.js";import"./use-virtual-mcp-R-nHNI8F.js";import"./card-B5uBFViO.js";import"./sidebar-B4yomm08.js";import"./LayoutLeft-CY_ilnE-.js";import"./use-mobile-CDGvObYb.js";import"./X-Dg3UHk4M.js";import"./table-D6kZLJZo.js";import"./empty-state-BAbUNiFM.js";import"./use-members-HgTG6V2z.js";import"./use-org-auth-client-CR847Rtk.js";import"./use-clock-tick-BoYgP8-u.js";import"./AlertCircle-CeJgODlb.js";import"./CheckCircle-B5HHFx3h.js";import"./Circle-DFIMbbWU.js";import"./agent-icon-BF217Hvb.js";import"./UserPlus01-CxsIZHHu.js";import"./Tool01-Dym7sffh.js";import"./ArrowUp-Cx_--6Z7.js";import"./Settings02-Rjz2fibP.js";import"./Tool02-DWpgQDA_.js";import"./XCircle-BVO-AfDl.js";import"./ArrowUpRight-ywfBK9uD.js";import"./TrendUp01-DJyrqfDN.js";import"./ZapSquare-CYxtM-xd.js";import"./Users03-C601mmDP.js";import"./ChevronRight-DX001g0F.js";import"./Stars02-pEQdLQRy.js";import"./Copy01-LCtBKUFe.js";import"./ZoomOut-FOnWv2R3.js";import"./DotsVertical-wzt5Huxh.js";import"./Globe01-Bwt4oV0U.js";import"./Eye-CTCWS-BQ.js";import"./FilterLines-0m6crn3m.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LinkExternal01-Cc-TIWai.js";import"./List-1sCiilk_.js";import"./Monitor01-BA72KgrB.js";import"./Sun-gRl2Ql5n.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./Plus-Dg6Y61Qh.js";import"./SearchLg-DCvqx7mk.js";import"./SearchMd-CxXAIK8q.js";import"./Shield01-DoN422Fp.js";import"./Stars01-BMHX9PwN.js";import"./Trash01-FLsHPD-j.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./XClose-CSAbqx7t.js";import"./Zap-C5e_tw0_.js";import"./use-automations-BV8BAFK6.js";import"./studio-tools-bcpgTNof.js";import"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import"./badge-DAQJGlmB.js";import"./checkbox-BfaUpDdG.js";import"./command-CaofFN3p.js";import"./index-CXseUXwz.js";import"./dialog-94MC6GNA.js";import"./popover-YRjoqx5c.js";import"./avatar-B8GP78HG.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DwaNL7ao.js";import"./file-type-icon-cxQD2Gow.js";import"./tab-id-bb-jjgGv.js";import"./hooks-gTEmV-hn.js";import"./decopilot-sse-pool-DhL2hPm4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./integration-icon-B9AX6sxk.js";import"./use-navigate-to-agent-JH1aTgiP.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DjQ3-mxR.js";import"./form-DkmV3bZG.js";import"./label-wqLdGJT0.js";import"./input-C57OE_bz.js";import"./auth-JAYu2Sn7.js";import"./drawer-Co_r3vYF.js";import"./collection-search-Qnz6jxTV.js";import"./autosend-BOPTLlfV.js";import"./tabs-uog8ypZ5.js";import"./toggle-group-xXar88Zl.js";import"./use-deco-credits-JXELkRA8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CL_n4ga5.js";import"./use-registry-connections-DYAxxhes.js";import"./use-organization-settings-D2FVOkxT.js";import"./extract-connection-data-kn2oock2.js";import"./collection-tabs-BCpGbCT5.js";import"./textarea-D96KZ_bk.js";import"./connection-form-helpers-Dx2pWKQg.js";import"./authenticate-and-persist-oauth-CHpUAxht.js";import"./mcp-oauth-CaQ5w7vv.js";import"./use-ai-providers-CfC4MjYU.js";import"./connect-desktop-dialog-Dd78-wLs.js";import"./select-model-Ivlt_Hjk.js";import"./skeleton-Dn-HzxdH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-kWU5lPTB.js";import"./dropdown-menu-CwZxSb5T.js";import"./index-BxUWUc0Q.js";import"./alert-dialog-NEl6qUgZ.js";import"./toolbar-DF6E_99x.js";import"./use-debounced-value-B3ktPBBI.js";import"./index-DFa2bm2W.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkjfcEfu.js";import"./use-decopilot-events-Cy3Splz7.js";import"./use-capability-IeWRUHjn.js";import"./tools-list-DyJkBr3l.js";import"./switch-Dj8a0W96.js";import"./use-debounced-autosave-CAJHdpnz.js";import"./index-BOigHE8Y.js";import"./search-input-CqxCn4Rx.js";import"./github-repo-picker-ZKvJa1LN.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-DVIAQNCJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DcZqHo8p.js";import"./index-DFZw1AWG.js";import"./get-initials-D-f_fDFw.js";import"./calendar-C6LcfVwu.js";import"./toolbar-icon-button-CwX9OsPP.js";import"./use-file-configs-C5MIjZBk.js";import"./automation-list-row-BqcM-T9k.js";import"./required-auth-layout-CkCZ1VH2.js";import"./use-org-sso-_zvIWw2Z.js";const Q={};function W(A){const t=$.c(37),{client:i,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=A,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{openSidePanel:f,openTab:g}=J(),r=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==i||t[3]!==o.name||t[4]!==s?(c={client:i,toolName:o.name,toolArguments:s},t[2]=i,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:e}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=b(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const j=N;let S;t[15]!==f||t[16]!==I?(S=C=>{const D=G(C.content);D.content.length>0&&(f("chat"),I({tiptapDoc:D}))},t[15]=f,t[16]=I,t[17]=S):S=t[17];const y=S;let P;t[18]!==j?(P={tool:j},t[18]=j,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==r?(T=C=>u(r,C),t[20]=u,t[21]=r,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==r?(R=()=>n(r),t[23]=n,t[24]=r,t[25]=R):R=t[25];let _;return t[26]!==i||t[27]!==y||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==e?(_=v.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:e,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:i,onMessage:y,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=i,t[27]=y,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=e,t[36]=_):_=t[36],_}function Gr(A){const t=$.c(24),{connectionId:i,toolName:h,args:o}=A,{org:p}=H(),l=Y();let M;t[0]!==i||t[1]!==l?(M=k(i)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=i,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==i||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:i,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=i,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=O(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let r,a,m;t[10]!==h||t[11]!==g.tools?(r=L(decodeURIComponent(h)),m=g.tools.find(e=>e.name===r)??g.tools.find(e=>{const x=E(e._meta);if(!x)return!1;if(b(e.name,x)===r)return!0;const d=b(r,x);return d!==r&&e.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=r,t[13]=a,t[14]=m):(r=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let e;return t[15]!==r?(e=v.jsx("div",{className:"flex items-center justify-center h-full w-full",children:v.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 c;return t[17]!==o||t[18]!==n||t[19]!==i||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=v.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:i,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=i,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{Gr as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as f,j as o}from"./index-Cw_MOEue.js";import{I as B}from"./input-C57OE_bz.js";import{L as T}from"./label-wqLdGJT0.js";import{S as L,a as A,b as R,c as z,d as O}from"./select-BbQScYUM.js";import{T as V}from"./textarea-D96KZ_bk.js";import{v as D,w as J,o as K,x as M,I as _}from"./index-F9o1E2LM.js";import{u as $,s as F}from"./primitives-BdN7cTl_.js";import"./tooltip-CEMhn06S.js";import"./Check-qklIr9eC.js";import"./ChevronDown-Dqw9pJbF.js";import"./ChevronUp-C-6o6d8u.js";import"./ArrowUp-Cx_--6Z7.js";import"./chat-context-Csy5cRMg.js";import"./autosend-BOPTLlfV.js";import"./hooks-gTEmV-hn.js";import"./use-mcp-client-CwxQ2mu8.js";import"./constants-D_FQAPnt.js";import"./auth-JAYu2Sn7.js";import"./decopilot-sse-pool-DhL2hPm4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-bcpgTNof.js";import"./use-virtual-mcp-R-nHNI8F.js";import"./use-collections-Mmumb7Jv.js";import"./use-ai-providers-CfC4MjYU.js";import"./use-decopilot-events-Cy3Splz7.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-D2FVOkxT.js";import"./automation-runs-CG9qLUqb.js";import"./useInfiniteQuery-DNK1YDMj.js";import"./use-infinite-scroll-BJxks4Oh.js";import"./use-connection-BwHNV7F-.js";import"./card-B5uBFViO.js";import"./sidebar-B4yomm08.js";import"./LayoutLeft-CY_ilnE-.js";import"./use-mobile-CDGvObYb.js";import"./X-Dg3UHk4M.js";import"./table-D6kZLJZo.js";import"./empty-state-BAbUNiFM.js";import"./use-members-HgTG6V2z.js";import"./use-org-auth-client-CR847Rtk.js";import"./use-clock-tick-BoYgP8-u.js";import"./AlertCircle-CeJgODlb.js";import"./CheckCircle-B5HHFx3h.js";import"./Circle-DFIMbbWU.js";import"./agent-icon-BF217Hvb.js";import"./UserPlus01-CxsIZHHu.js";import"./Tool01-Dym7sffh.js";import"./Settings02-Rjz2fibP.js";import"./Tool02-DWpgQDA_.js";import"./XCircle-BVO-AfDl.js";import"./ArrowUpRight-ywfBK9uD.js";import"./TrendUp01-DJyrqfDN.js";import"./ZapSquare-CYxtM-xd.js";import"./Users03-C601mmDP.js";import"./ChevronRight-DX001g0F.js";import"./Stars02-pEQdLQRy.js";import"./Copy01-LCtBKUFe.js";import"./ZoomOut-FOnWv2R3.js";import"./DotsVertical-wzt5Huxh.js";import"./Globe01-Bwt4oV0U.js";import"./Eye-CTCWS-BQ.js";import"./FilterLines-0m6crn3m.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LinkExternal01-Cc-TIWai.js";import"./List-1sCiilk_.js";import"./Monitor01-BA72KgrB.js";import"./Sun-gRl2Ql5n.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./Plus-Dg6Y61Qh.js";import"./SearchLg-DCvqx7mk.js";import"./SearchMd-CxXAIK8q.js";import"./Shield01-DoN422Fp.js";import"./Stars01-BMHX9PwN.js";import"./Trash01-FLsHPD-j.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./XClose-CSAbqx7t.js";import"./Zap-C5e_tw0_.js";import"./use-automations-BV8BAFK6.js";import"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import"./badge-DAQJGlmB.js";import"./checkbox-BfaUpDdG.js";import"./command-CaofFN3p.js";import"./index-CXseUXwz.js";import"./dialog-94MC6GNA.js";import"./popover-YRjoqx5c.js";import"./avatar-B8GP78HG.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DwaNL7ao.js";import"./file-type-icon-cxQD2Gow.js";import"./monaco-editor-DOlDq43r.js";import"./index-DFa2bm2W.js";import"./index-Ce2Igu8Z.js";import"./shell-layout-C3vwcwKJ.js";import"./alert-dialog-NEl6qUgZ.js";import"./required-auth-layout-CkCZ1VH2.js";import"./use-org-sso-_zvIWw2Z.js";import"./integration-icon-B9AX6sxk.js";import"./use-navigate-to-agent-JH1aTgiP.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DjQ3-mxR.js";import"./form-DkmV3bZG.js";import"./drawer-Co_r3vYF.js";import"./collection-search-Qnz6jxTV.js";import"./tabs-uog8ypZ5.js";import"./toggle-group-xXar88Zl.js";import"./use-deco-credits-JXELkRA8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CL_n4ga5.js";import"./use-registry-connections-DYAxxhes.js";import"./extract-connection-data-kn2oock2.js";import"./collection-tabs-BCpGbCT5.js";import"./connection-form-helpers-Dx2pWKQg.js";import"./authenticate-and-persist-oauth-CHpUAxht.js";import"./mcp-oauth-CaQ5w7vv.js";import"./connect-desktop-dialog-Dd78-wLs.js";import"./select-model-Ivlt_Hjk.js";import"./skeleton-Dn-HzxdH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-kWU5lPTB.js";import"./dropdown-menu-CwZxSb5T.js";import"./index-BxUWUc0Q.js";import"./toolbar-DF6E_99x.js";import"./use-debounced-value-B3ktPBBI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkjfcEfu.js";import"./use-mcp-tools-DS-HH6so.js";import"./use-capability-IeWRUHjn.js";import"./tools-list-DyJkBr3l.js";import"./switch-Dj8a0W96.js";import"./use-debounced-autosave-CAJHdpnz.js";import"./index-BOigHE8Y.js";import"./search-input-CqxCn4Rx.js";import"./github-repo-picker-ZKvJa1LN.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-DVIAQNCJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DcZqHo8p.js";import"./index-DFZw1AWG.js";import"./get-initials-D-f_fDFw.js";import"./calendar-C6LcfVwu.js";import"./toolbar-icon-button-CwX9OsPP.js";import"./use-file-configs-C5MIjZBk.js";import"./automation-list-row-BqcM-T9k.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=f.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 C=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]=$(C,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,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DVCFd28u.js","assets/index-Cw_MOEue.js","assets/index-BO2t38sV.css","assets/Tool02-DWpgQDA_.js","assets/CheckCircle-B5HHFx3h.js","assets/Settings02-Rjz2fibP.js","assets/use-mcp-client-CwxQ2mu8.js","assets/constants-D_FQAPnt.js","assets/auth-JAYu2Sn7.js","assets/useInfiniteQuery-DNK1YDMj.js","assets/use-infinite-scroll-BJxks4Oh.js","assets/studio-tools-bcpgTNof.js","assets/badge-DAQJGlmB.js","assets/input-C57OE_bz.js","assets/dropdown-menu-CwZxSb5T.js","assets/Check-qklIr9eC.js","assets/ChevronRight-DX001g0F.js","assets/Circle-DFIMbbWU.js","assets/table-D6kZLJZo.js","assets/toggle-group-xXar88Zl.js","assets/use-view-mode-CsLEkxLJ.js","assets/use-mobile-CDGvObYb.js","assets/DotsVertical-wzt5Huxh.js","assets/FilterLines-0m6crn3m.js","assets/Globe01-Bwt4oV0U.js","assets/SearchMd-CxXAIK8q.js","assets/dialog-94MC6GNA.js","assets/X-Dg3UHk4M.js","assets/AlertCircle-CeJgODlb.js","assets/Upload01-Bf-wW3fT.js","assets/alert-dialog-NEl6qUgZ.js","assets/card-B5uBFViO.js","assets/Trash01-FLsHPD-j.js","assets/label-wqLdGJT0.js","assets/select-BbQScYUM.js","assets/tooltip-CEMhn06S.js","assets/ChevronDown-Dqw9pJbF.js","assets/ChevronUp-C-6o6d8u.js","assets/switch-Dj8a0W96.js","assets/textarea-D96KZ_bk.js","assets/XCircle-BVO-AfDl.js","assets/checkbox-BfaUpDdG.js","assets/Eye-CTCWS-BQ.js","assets/LinkExternal01-Cc-TIWai.js","assets/use-copy-DwaNL7ao.js","assets/Copy01-LCtBKUFe.js","assets/Key01-DTTa_ngJ.js","assets/Plus-Dg6Y61Qh.js","assets/mcp-oauth-CaQ5w7vv.js","assets/Play-CcnDti9J.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-Cw_MOEue.js";import{R as m}from"./require-capability-wLbHZZOZ.js";import"./use-capability-IeWRUHjn.js";import"./access-gate-DQJOwmen.js";import"./capability-load-error-BX02m8_A.js";const n=i.lazy(()=>o(()=>import("./registry-layout-DVCFd28u.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,47,48,49])));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 $,C as Se,K as re,b4 as dt,m as Re,j as s,l as K,i as fe,B as ne,c as H,H as Pe,ac as Ie,I as se,ae as De,af as ke,n as $e,M as mt,J as ut,d as Fe,t as he,p as Oe,w as Ke,x as ft,E as ht,b as gt,u as xt}from"./index-Cw_MOEue.js";import{u as pt}from"./use-organization-roles-BbeankM2.js";import{u as je}from"./use-org-auth-client-CR847Rtk.js";import{B as ge}from"./badge-DAQJGlmB.js";import{f as Qe,a as He,b as qe,c as Ze,d as Je,A as Xe,e as We,g as et}from"./alert-dialog-NEl6qUgZ.js";import{D as bt,a as Tt,c as Et,d as _t}from"./dropdown-menu-CwZxSb5T.js";import{i as It}from"./DotsVertical-wzt5Huxh.js";import{s as Ae}from"./Plus-Dg6Y61Qh.js";import{s as St}from"./Trash01-FLsHPD-j.js";import{C as Nt}from"./collection-table-wrapper-C14aED27.js";import{P as te}from"./index-BOigHE8Y.js";import{E as Ge}from"./empty-state-BAbUNiFM.js";import{S as ve}from"./search-input-CqxCn4Rx.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-B9AX6sxk.js";import{u as Ct}from"./use-infinite-scroll-BJxks4Oh.js";import{C as Me}from"./checkbox-BfaUpDdG.js";import{b as At}from"./Settings02-Rjz2fibP.js";import{u as Rt}from"./useSuspenseInfiniteQuery-DIBoNO1Z.js";import{u as Ot}from"./use-mcp-client-CwxQ2mu8.js";import{S as jt}from"./constants-D_FQAPnt.js";import{C as vt}from"./collection-search-Qnz6jxTV.js";import{u as nt}from"./use-members-HgTG6V2z.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-BwHNV7F-.js";import{u as Mt,c as wt}from"./use-ai-providers-CfC4MjYU.js";import{A as ot}from"./avatar-B8GP78HG.js";import{S as xe}from"./switch-Dj8a0W96.js";import{c as pe,b as be,T as Te,a as Ee}from"./tooltip-CEMhn06S.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-kWU5lPTB.js";import{t as Lt}from"./ChevronDown-Dqw9pJbF.js";import{i as Pt}from"./ChevronRight-DX001g0F.js";import{i as ze}from"./X-Dg3UHk4M.js";import{a as Dt}from"./use-capability-IeWRUHjn.js";import{A as kt}from"./access-gate-DQJOwmen.js";import"./Check-qklIr9eC.js";import"./Circle-DFIMbbWU.js";import"./table-D6kZLJZo.js";import"./ArrowUp-Cx_--6Z7.js";import"./sidebar-B4yomm08.js";import"./LayoutLeft-CY_ilnE-.js";import"./use-mobile-CDGvObYb.js";import"./SearchMd-CxXAIK8q.js";import"./Tool02-DWpgQDA_.js";import"./agent-icon-BF217Hvb.js";import"./AlertCircle-CeJgODlb.js";import"./UserPlus01-CxsIZHHu.js";import"./Tool01-Dym7sffh.js";import"./XCircle-BVO-AfDl.js";import"./ArrowUpRight-ywfBK9uD.js";import"./TrendUp01-DJyrqfDN.js";import"./ZapSquare-CYxtM-xd.js";import"./Users03-C601mmDP.js";import"./CheckCircle-B5HHFx3h.js";import"./ChevronUp-C-6o6d8u.js";import"./Stars02-pEQdLQRy.js";import"./Copy01-LCtBKUFe.js";import"./ZoomOut-FOnWv2R3.js";import"./Globe01-Bwt4oV0U.js";import"./Eye-CTCWS-BQ.js";import"./FilterLines-0m6crn3m.js";import"./Flag01-D_fUJHwZ.js";import"./Star01-kGVgFut9.js";import"./Globe04-CD717DpH.js";import"./SwitchHorizontal01-UaHGqUVt.js";import"./HardDrive-Cq-YbPK9.js";import"./Key01-DTTa_ngJ.js";import"./LinkExternal01-Cc-TIWai.js";import"./List-1sCiilk_.js";import"./Monitor01-BA72KgrB.js";import"./Sun-gRl2Ql5n.js";import"./Package-PE508kJN.js";import"./Palette-CKmdnXoY.js";import"./Play-CcnDti9J.js";import"./SearchLg-DCvqx7mk.js";import"./Shield01-DoN422Fp.js";import"./Stars01-BMHX9PwN.js";import"./Upload01-Bf-wW3fT.js";import"./User01-Bp8xCtim.js";import"./Users01-CUB4jTbh.js";import"./XClose-CSAbqx7t.js";import"./Zap-C5e_tw0_.js";import"./auth-JAYu2Sn7.js";import"./use-collections-Mmumb7Jv.js";import"./studio-tools-bcpgTNof.js";import"./card-B5uBFViO.js";import"./capability-load-error-BX02m8_A.js";const we="basic-usage",Le=[{id:we,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}];[...Le.find(t=>t.id===we)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===we)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=H.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(Me,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let S;return e[17]!==f||e[18]!==o||e[19]!==m?(S=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=S):S=e[20],S}function Yt(t){return t.stopPropagation()}function $t(t){const e=H.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.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 g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Me,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,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 Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Se(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),S=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,N=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:b,...N&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,M=x.current,A=[...M.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!M.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=$.useState(G[0]?.id??null),y=w?G.find(b=>b.id===w)??null:null,{data:L,isFetching:Y}=Re({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}),F=L?.tools??[],J=(b,D)=>t[b]?.includes(D)??!1,X=(b,D)=>{const Q=t[b]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===w?F:[];if(!D.length)return;const Q=t[b]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=q,z(b)),e(Z)},oe=b=>{z(b),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:[l===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:()=>g("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:()=>g("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:()=>g("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(b=>{const D=w===b.id,Q=D?F.length:0,q=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.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(ne,{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(ye,{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"})}):F.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:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:J(y.id,b.name),onToggle:()=>X(y.id,b.name)},b.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 Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ht(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function qt(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Jt(t){const e=H.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const S=x.map(m).filter(Xt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let N;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(N=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=N):N=e[24];let C;e[25]!==T||e[26]!==N?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:N})})}),e[25]=T,e[26]=N,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,S.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):S.map(v=>{const{section:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Xt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={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 ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=H.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[S,E]=$.useState(m),T=m||S,N=E,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;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],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||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=()=>N(cs),e[24]=M):M=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{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(ge,{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]!==T?(w=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,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],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),F=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,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:F,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:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},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(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=H.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=wt(n.id);let a,x,o,m,S;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){S=Symbol.for("react.early_return_sentinel");e:{let N;e[16]!==n.label?(N=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=N):N=e[17];const C=f.filter(hs).map(N),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){S=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.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",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=S}else a=e[11],x=e[12],o=e[13],m=e[14],S=e[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=H.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=Mt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(M=>M!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,S=!c&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=N):N=e[14];let C;e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[N,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=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(p=>s.jsx($.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(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=H.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,S,E,T,N,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.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]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],S=z,m=Qe,R=n,p=l,o=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Je,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],N="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=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=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(Me,{checked:F||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(ot,{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(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=S,e[12]=E,e[13]=T,e[14]=N,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],S=e[11],E=e[12],T=e[13],N=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==N||e[34]!==C?(I=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=I):I=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Xe,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==S||e[38]!==u||e[39]!==M?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:S,disabled:u,children:["Add ",M]})]}),e[37]=S,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=H.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,S;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);S="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(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(ot,{url:I.user?.image??void 0,fallback:lt(I.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:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=S}else o=e[7],m=e[8],S=e[9];let E;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let N;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(N=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=N):N=e[24];let C;return e[25]!==S||e[26]!==E||e[27]!==N?(C=s.jsxs("div",{className:S,children:[E,N]}),e[25]=S,e[26]=E,e[27]=N,e[28]=C):C=e[28],C}function Es(t){const e=H.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ss(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+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:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ns(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ss(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=H.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,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:g}=Re(h);if(g||!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 x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Se(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,S=o.formState.isDirty,E=Fe({mutationFn:async u=>{const M=Ns(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=l.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;Oe(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),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),N=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(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:N&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!S,children:E.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"?qt(t.role):Ht(o.watch("role.label")))}),g&&s.jsx(Ke,{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:()=>I(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(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{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"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Jt,{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:g,searchQuery:_}),a==="models"&&s.jsx(gs,{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:g,searchQuery:_}),a==="members"&&s.jsx(Es,{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:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=H.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Ms(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const ws={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?ws[t]??"bg-neutral-400":Ms(t)}function Ps(){const t=H.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();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}=Se(),g=je(),f=$e(),{customRoles:a,refetch:x}=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 S;e:{if(!h){S=null;break e}if(h==="new"){S={kind:"new"};break e}if(h.startsWith("builtin-")){S={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);S=V?{kind:"custom",role:V}:null}const E=S;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let N;t[7]!==g?(N=()=>g.organization.listMembers(),t[7]=g,t[8]=N):N=t[8];let C;t[9]!==T||t[10]!==N?(C={queryKey:T,queryFn:N},t[9]=T,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;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=ys.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 at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,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(bt,{children:[s.jsx(Tt,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(It,{size:16})})}),s.jsx(Et,{align:"end",onClick:Ds,children:s.jsxs(_t,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{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(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:E,onBack:P,onSaved:V},js(E))}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"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ae,{size:16}),t[44]=J):J=t[44];let X;t[45]!==F?(X=s.jsxs(ne,{onClick:F,children:[J,"Create Role"]}),t[45]=F,t[46]=X):X=t[46];let le;t[47]!==Y||t[48]!==X?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==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(Ze,{children:"Delete Role"}),t[61]=q):q=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(qe,{children:[q,s.jsxs(Je,{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(Xe,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(He,{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(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(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,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(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(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("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 Ys(){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 n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.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(Ps,{})})}),t[1]=n):n=t[1],n}function Nl(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{Nl as default};