decocms 4.519.0 → 4.521.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 (417) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DpnSicPy.js → ActiveShapeUtils-NiXAWNnI.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DBK8R4dI.js → AlertCircle-DGVmeswV.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CeMTC5TB.js → AreaChart-DL7RX4W6.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BhYsdDhs.js → ArrowLeft-DDWHto_R.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B-samV76.js → ArrowUp-bm_9Fp5i.js} +1 -1
  6. package/dist/client/assets/{BarChart-D4vvVhNP.js → BarChart-DmTON82J.js} +1 -1
  7. package/dist/client/assets/{Building02-BVkscSyZ.js → Building02-p3_mZ-E2.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-D5TCh86n.js → CartesianChart-oH_IqMjj.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BlWkKGI4.js → CategoricalChart-Dy74bBD9.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Bnnstx7h.js → CheckCircle-Bx5iI6Lz.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-rEBuyaLs.js → ChevronSelectorVertical-CtVpNCaH.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-CBJitQaC.js → ChevronUp-ojSOtVX2.js} +1 -1
  13. package/dist/client/assets/{Copy01-B-Kqql1v.js → Copy01-CixCoZek.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-BuvGgoKU.js → CreditCard01-D0K-VlXU.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-kTicVrIf.js → DotsVertical-DzE0Ijkk.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-BUVr9l59.js → ErrorBarContext-DRS3e7xk.js} +1 -1
  17. package/dist/client/assets/{Globe04-KYEPLfFL.js → Globe04-CE15ScrO.js} +1 -1
  18. package/dist/client/assets/{Image01-D5xmdMv9.js → Image01-Bks737AT.js} +1 -1
  19. package/dist/client/assets/{Key01-egFT7DX9.js → Key01-CxbATohw.js} +1 -1
  20. package/dist/client/assets/{Link01-DbW4kVwR.js → Link01-DCdDhO7H.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-OntVHV0h.js → LinkBroken01-ZF7OlrXq.js} +1 -1
  22. package/dist/client/assets/{Minus-DN-1q402.js → Minus-DqMKpYLh.js} +1 -1
  23. package/dist/client/assets/{Monitor01-QBQW5XNf.js → Monitor01-B-_Pl3qs.js} +1 -1
  24. package/dist/client/assets/{Play-COeyqncs.js → Play-B6eaz3Uv.js} +1 -1
  25. package/dist/client/assets/{Plus-B4v3GkBC.js → Plus-B28tKNm1.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-5iYQv1Rq.js → ReferenceLine-C5aqWs1r.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DWVKWjSh.js → SearchMd-OCyidoZI.js} +1 -1
  28. package/dist/client/assets/{Sector-CExKcwxp.js → Sector-CtNXSnWN.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-BhCtEuhY.js → ShoppingBag01-DHyiQNjO.js} +1 -1
  30. package/dist/client/assets/{Sun-DXxrAWEA.js → Sun-BUl5hUgs.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-ByDhQXb-.js → SwitchHorizontal01-BKu4aB4V.js} +1 -1
  32. package/dist/client/assets/{Tool01-Bhwq8fKA.js → Tool01-CnZckhqi.js} +1 -1
  33. package/dist/client/assets/{Trash01-BJcybrX2.js → Trash01-C34kFeWG.js} +1 -1
  34. package/dist/client/assets/{Upload01-D6z8pgdP.js → Upload01-sDXthFWJ.js} +1 -1
  35. package/dist/client/assets/{User01-BaPQvgQq.js → User01-2Hx1yZRb.js} +1 -1
  36. package/dist/client/assets/UserSquare-UeuSXkL4.js +1 -0
  37. package/dist/client/assets/{Users01-OOPFNu5a.js → Users01-D78JG135.js} +1 -1
  38. package/dist/client/assets/{XClose-DbFkM30N.js → XClose-BbuvN9Qp.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-CKf6RmrA.js → ZoomOut-DnRMz8gp.js} +1 -1
  40. package/dist/client/assets/{access-gate-Bp5g1mrg.js → access-gate-B-XccyUi.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-C3wKqrUu.js → add-connection-dialog-3BCYyOlq.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CwuUduKr.js +1 -0
  43. package/dist/client/assets/agent-app-Dd83t7Jr.js +1 -0
  44. package/dist/client/assets/{agent-assets-CXlM6UQS.js → agent-assets-BX70IHOT.js} +1 -1
  45. package/dist/client/assets/{agent-automation-C1KFlSjr.js → agent-automation-DSOT91yw.js} +1 -1
  46. package/dist/client/assets/{agent-automations-BXeaRV79.js → agent-automations-DELrtNmQ.js} +1 -1
  47. package/dist/client/assets/agent-calendar-DAFHiZ7t.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-ByDR9dOm.js → agent-connect-sources-EYRSBit6.js} +1 -1
  49. package/dist/client/assets/agent-deck-19EIpeOv.js +1 -0
  50. package/dist/client/assets/agent-e2e-DgDrdrOU.js +1 -0
  51. package/dist/client/assets/agent-experiments-CDIR-vBl.js +1 -0
  52. package/dist/client/assets/agent-file-Crkwe1n0.js +1 -0
  53. package/dist/client/assets/agent-hosting-COv9KqxJ.js +1 -0
  54. package/dist/client/assets/agent-icon-2Sd6TPJR.js +1 -0
  55. package/dist/client/assets/agent-library-6vXi0pmB.js +1 -0
  56. package/dist/client/assets/agent-library-file-D_31XTpy.js +1 -0
  57. package/dist/client/assets/agent-monitor-DZGhzZ5b.js +1 -0
  58. package/dist/client/assets/{agent-overview-CSyXy3g4.js → agent-overview-jQR56ImR.js} +1 -1
  59. package/dist/client/assets/{agent-releases-srD8iHFc.js → agent-releases-1LcFLBWb.js} +1 -1
  60. package/dist/client/assets/agent-settings-BJW57Xya.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-C0gN8EWt.js → agent-site-editor-FH5rkph4.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-Dp5l17ta.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-BIwmC0as.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-DJt8FppE.js +1 -0
  65. package/dist/client/assets/agent-view-DuXo8UyN.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-IwJPeHon.js → agent-view-guard-BtSTYr3f.js} +1 -1
  67. package/dist/client/assets/{agents-list-kkn2potC.js → agents-list-BciltAjT.js} +1 -1
  68. package/dist/client/assets/{ai-providers-B1i5Zd64.js → ai-providers-1_g2-YFO.js} +1 -1
  69. package/dist/client/assets/{alert-CfW38lSF.js → alert-B6jt7ehz.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-DOm8vTAh.js → alert-dialog-C6IuYhIc.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-BnQKN24n.js → analytics-sections-CMbHJdjJ.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-BPISXjrq.js → analytics-tab-BptBREH9.js} +1 -1
  73. package/dist/client/assets/{api-keys-B0NZlktL.js → api-keys-DNoVGHBL.js} +1 -1
  74. package/dist/client/assets/api-keys-YdF23sAO.js +1 -0
  75. package/dist/client/assets/{app-editor-Cl4XOhpA.js → app-editor-DIGpXnGi.js} +1 -1
  76. package/dist/client/assets/app-preview-url-DmK5uokM.js +1 -0
  77. package/dist/client/assets/{asset-utils-DE9emOC4.js → asset-utils-BaoKrfcS.js} +1 -1
  78. package/dist/client/assets/{auth-JXZLGOBb.js → auth-MbbNpK0f.js} +1 -1
  79. package/dist/client/assets/{auth-catchall-DJ8C8A5P.js → auth-catchall-CQhqMFI7.js} +1 -1
  80. package/dist/client/assets/{auth-entry-CRJg2jV6.js → auth-entry-BytQWBJH.js} +1 -1
  81. package/dist/client/assets/{auth-split-layout-Cb2N96wc.js → auth-split-layout-BLy72f6M.js} +1 -1
  82. package/dist/client/assets/{authenticate-and-persist-oauth-Sm0OtDe1.js → authenticate-and-persist-oauth-ChOS0TQ8.js} +1 -1
  83. package/dist/client/assets/{automation-list-row-DLS7nqs1.js → automation-list-row-CDTQ4wXs.js} +1 -1
  84. package/dist/client/assets/{automation-runs-DGVHidy8.js → automation-runs-uGIsi6Hf.js} +1 -1
  85. package/dist/client/assets/{automations-w7eRZ4NJ.js → automations-CYPV9xM6.js} +1 -1
  86. package/dist/client/assets/{autosend-YiZkI0k7.js → autosend-nr-hPbHj.js} +1 -1
  87. package/dist/client/assets/{avatar-BD2PDf8q.js → avatar-DarGMVT9.js} +1 -1
  88. package/dist/client/assets/{badge-CDeaoqCi.js → badge-7nY_ai7T.js} +1 -1
  89. package/dist/client/assets/{block-document-BleRxhvK.js → block-document-BFjSBfhL.js} +1 -1
  90. package/dist/client/assets/{blocks-preview-workspace-context-D22eN4p4.js → blocks-preview-workspace-context-CPEN608S.js} +1 -1
  91. package/dist/client/assets/{blocks-tab-states-g8ibEmjD.js → blocks-tab-states-DEKXC5rW.js} +1 -1
  92. package/dist/client/assets/{blog-schema-CrKFhIXz.js → blog-schema-DXeDEF-x.js} +1 -1
  93. package/dist/client/assets/{buckets-DRYNl_Gz.js → buckets-Fnw-QnpR.js} +1 -1
  94. package/dist/client/assets/{build-improve-prompt-doc-C1y7z_kF.js → build-improve-prompt-doc-BNyp6j2d.js} +1 -1
  95. package/dist/client/assets/{calendar-jrNp7aMz.js → calendar-D8eqk8F_.js} +1 -1
  96. package/dist/client/assets/{campaigns-view-BgZ9KvqV.js → campaigns-view-DwenRJ4m.js} +1 -1
  97. package/dist/client/assets/{capability-load-error-tQkVlgGI.js → capability-load-error-DK8yJwbi.js} +1 -1
  98. package/dist/client/assets/{category-editor-CtUbDM-y.js → category-editor-CvvoknG-.js} +1 -1
  99. package/dist/client/assets/{cdn-tab-wOWVfYEi.js → cdn-tab-DGngqFre.js} +1 -1
  100. package/dist/client/assets/{chart-BBE_aWjm.js → chart-BVOKVwol.js} +1 -1
  101. package/dist/client/assets/{chat-context-C1JvjRtO.js → chat-context-4LDKQ9-8.js} +1 -1
  102. package/dist/client/assets/{chat-draft-B0O1aMg3.js → chat-draft-DtnFj70R.js} +1 -1
  103. package/dist/client/assets/{checkbox-BQV5rQq6.js → checkbox--QGg9JL6.js} +1 -1
  104. package/dist/client/assets/{choose-editor-Cco5iYhS.js → choose-editor-Co3gZPYu.js} +1 -1
  105. package/dist/client/assets/{cli-auth-success-C0BkGk_m.js → cli-auth-success-PhyGH5OW.js} +1 -1
  106. package/dist/client/assets/{client-icons-CSB7_p4A.js → client-icons-C_ct3pd0.js} +1 -1
  107. package/dist/client/assets/cms-settings-editor-VrhsAjtC.js +1 -0
  108. package/dist/client/assets/{collapsible-DyKYJwPy.js → collapsible-DGVOZrNj.js} +1 -1
  109. package/dist/client/assets/{collection-detail-BvgJ-RrS.js → collection-detail-BAmfEJxU.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-IJ7oRZnA.js → collection-display-button-ClKK9pYP.js} +1 -1
  111. package/dist/client/assets/{collection-search-DF8xKBAI.js → collection-search-DRo1WmLT.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-N4bJjHS6.js → collection-table-wrapper-Dgqpnsq8.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-DUP2Wv2k.js → collection-tabs-Dc2dImyc.js} +1 -1
  114. package/dist/client/assets/{column-rules-CzVSaEJv.js → column-rules-DiqfCnEN.js} +1 -1
  115. package/dist/client/assets/{combobox-DSv_uY1C.js → combobox-DZgmK343.js} +1 -1
  116. package/dist/client/assets/{command-C2RTsWLU.js → command-CPx9UwtG.js} +1 -1
  117. package/dist/client/assets/{companion-mcps-section-Om4Xi1g-.js → companion-mcps-section-CLb76BIo.js} +1 -1
  118. package/dist/client/assets/{config-CnSMG0Cu.js → config-CxVvKo3A.js} +1 -1
  119. package/dist/client/assets/{connect-Cyhyxw9Y.js → connect-A3Avs8Pl.js} +1 -1
  120. package/dist/client/assets/{connect-layout-Zlm12dcn.js → connect-layout-BksXTmdN.js} +1 -1
  121. package/dist/client/assets/{connect-source-dialog-DNnWnFk9.js → connect-source-dialog-DSaPW3-r.js} +1 -1
  122. package/dist/client/assets/{connection-CKGquOu0.js → connection-GML1C2tu.js} +1 -1
  123. package/dist/client/assets/{connection-card-CeElSdkP.js → connection-card-ZvVd_UVc.js} +1 -1
  124. package/dist/client/assets/{connection-detail-XrFXQKQo.js → connection-detail-DtbzbTIM.js} +1 -1
  125. package/dist/client/assets/{connection-form-helpers-D5tlzOOb.js → connection-form-helpers-CGyT85pi.js} +1 -1
  126. package/dist/client/assets/{connections-WO7Na7dg.js → connections-D4x-lAFA.js} +1 -1
  127. package/dist/client/assets/{content-tab-C3B5hAv_.js → content-tab-DgdEt3c6.js} +3 -3
  128. package/dist/client/assets/{context-BojR4HN9.js → context-BcuOiE0n.js} +1 -1
  129. package/dist/client/assets/{context-menu-22sCTgBs.js → context-menu-BPat3chT.js} +1 -1
  130. package/dist/client/assets/{context-shell-D1N7epOl.js → context-shell-BpD_TiZV.js} +3 -3
  131. package/dist/client/assets/{core.esm-QVBuVFEZ.js → core.esm-CumN7OYl.js} +2 -2
  132. package/dist/client/assets/{create-organization-dialog-D6kuk20k.js → create-organization-dialog-C7cTp33N.js} +1 -1
  133. package/dist/client/assets/{daily-pulse-CQHr9nNT.js → daily-pulse-DIdfLtIG.js} +1 -1
  134. package/dist/client/assets/{discover-C-_i2-PM.js → discover-CG4C5Odc.js} +1 -1
  135. package/dist/client/assets/{domain-settings-C-dCekXs.js → domain-settings-DkAHUlQw.js} +1 -1
  136. package/dist/client/assets/{drawer-_y_lX-Yn.js → drawer-Bp7WNOCz.js} +1 -1
  137. package/dist/client/assets/{editor-D3dE1UTI.js → editor-CmZJbc4Z.js} +1 -1
  138. package/dist/client/assets/{editor-classes-Bzr4sAFl.js → editor-classes-DYddjmhz.js} +1 -1
  139. package/dist/client/assets/{empty-state-C-9cwlrp.js → empty-state-DBHadTD8.js} +1 -1
  140. package/dist/client/assets/{empty-state-gsVYH7fP.js → empty-state-vh9cmtA2.js} +1 -1
  141. package/dist/client/assets/{experiments-tab-CeVz9r9-.js → experiments-tab-BaB_Zi0V.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-2QAdfouX.js → experiments-tab-choice-p3E1pILX.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-CgXJmK0-.js → extract-connection-data-C2lA8ZOm.js} +1 -1
  144. package/dist/client/assets/{feature-gate-C5He1Jql.js → feature-gate-D8HHU_kV.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-BKaJGna9.js → feature-paywall-CRRIPYfS.js} +1 -1
  146. package/dist/client/assets/{file-explorer-v9KulF9f.js → file-explorer-BTIbvupP.js} +1 -1
  147. package/dist/client/assets/{file-preview-BJJubHbu.js → file-preview-CsDpTAv6.js} +1 -1
  148. package/dist/client/assets/{file-share-button-Devx0UP5.js → file-share-button-BmWv4msr.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-CtKJHzOq.js → file-type-icon-Ixvc6_bA.js} +1 -1
  150. package/dist/client/assets/{folder-icon-v_un8oBh.js → folder-icon-ByIjnQde.js} +1 -1
  151. package/dist/client/assets/{form-B4txFZ9_.js → form-CIAWZjuP.js} +1 -1
  152. package/dist/client/assets/{general-D1PYsEPe.js → general-DEusZ5JT.js} +1 -1
  153. package/dist/client/assets/{home-Ce58QfRL.js → home-B9bSA6tC.js} +1 -1
  154. package/dist/client/assets/{icon-button-B2nkkF4s.js → icon-button-7F5Toil2.js} +1 -1
  155. package/dist/client/assets/{index-CBITis32.js → index-4NUDq9UX.js} +1 -1
  156. package/dist/client/assets/{index-CYvWDMig.js → index-B0ZOlWzX.js} +1 -1
  157. package/dist/client/assets/{index-uj-2aD6g.js → index-B1T14RYF.js} +1 -1
  158. package/dist/client/assets/{index-BjNnHm9S.js → index-BEqT-aNW.js} +1 -1
  159. package/dist/client/assets/index-BQfNeaI1.css +1 -0
  160. package/dist/client/assets/{index-DAeJjOY-.js → index-BZ3kN-UW.js} +1 -1
  161. package/dist/client/assets/{index-CBPFaqzb.js → index-CRYNJjMc.js} +1 -1
  162. package/dist/client/assets/{index-9zYu4OQI.js → index-CYGV5ggz.js} +1 -1
  163. package/dist/client/assets/{index-DfK7_snd.js → index-CblLVDuN.js} +1 -1
  164. package/dist/client/assets/{index-DofgWNDj.js → index-CfHLnaAs.js} +1 -1
  165. package/dist/client/assets/{index-C_vsZdEs.js → index-DJCD1T3p.js} +36 -36
  166. package/dist/client/assets/{index-CHOolU-2.js → index-DiKBQ93t.js} +1 -1
  167. package/dist/client/assets/index-DrxFcbdt.js +4 -0
  168. package/dist/client/assets/{index-ZeYytYg9.js → index-DxIuEmxM.js} +1 -1
  169. package/dist/client/assets/{index-Bp5c1HaS.js → index-MrGr5MGL.js} +1 -1
  170. package/dist/client/assets/{index-redirect-Jch1OTL_.js → index-redirect-BSxSh5S-.js} +1 -1
  171. package/dist/client/assets/{index-DC_lXxHn.js → index-xD4K2nG7.js} +1 -1
  172. package/dist/client/assets/{infiniteQueryObserver-C2uEQLvN.js → infiniteQueryObserver-5dM4o4Hf.js} +1 -1
  173. package/dist/client/assets/{infra-billing-BI2rcYbR.js → infra-billing-BW0f21OW.js} +1 -1
  174. package/dist/client/assets/{input-DlfhLXVo.js → input-2QjNp7qX.js} +1 -1
  175. package/dist/client/assets/{input-nGqpK_4e.js → input-Di5PUIe8.js} +3 -3
  176. package/dist/client/assets/{integration-icon-CeG7h1x5.js → integration-icon-CMGBZM9F.js} +1 -1
  177. package/dist/client/assets/{jira-icon-DLfJcRXS.js → jira-icon-DZrAPkCR.js} +1 -1
  178. package/dist/client/assets/{label-CCla7LnP.js → label-CBlQ82Fk.js} +1 -1
  179. package/dist/client/assets/{layout-C9sg2y3c.js → layout-jno9iSY1.js} +1 -1
  180. package/dist/client/assets/{legacy-agents-deep-BpXhG-Np.js → legacy-agents-deep-C-JHuDVd.js} +1 -1
  181. package/dist/client/assets/{legacy-main-redirect-CNUdNl6X.js → legacy-main-redirect-BjKbMolf.js} +1 -1
  182. package/dist/client/assets/library-DC_yyIum.js +1 -0
  183. package/dist/client/assets/{login-mhnZ1Cb9.js → login-DrbMDqlp.js} +1 -1
  184. package/dist/client/assets/{markdown-BDTHe610.js → markdown-BU6g98sq.js} +1 -1
  185. package/dist/client/assets/{mcp-app-renderer-CMRuQe66.js → mcp-app-renderer-B6MBkXrw.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-L6wgBjWx.js → mcp-oauth-CFQzR34b.js} +1 -1
  187. package/dist/client/assets/{mcp-oauth-CIkq3Lwg.js → mcp-oauth-DHXkg8Ce.js} +1 -1
  188. package/dist/client/assets/{members-V_RnUVXg.js → members-D1907SI-.js} +1 -1
  189. package/dist/client/assets/{memory-CB8DHXY4.js → memory-CaQIwNtK.js} +1 -1
  190. package/dist/client/assets/{mini-report-page-DZhVo3A1.js → mini-report-page-5Lry2_1Y.js} +1 -1
  191. package/dist/client/assets/{mock-board-Dy_pSyrX.js → mock-board-Dfc7Zn2k.js} +3 -3
  192. package/dist/client/assets/{monaco-editor-BzWTOVge.js → monaco-editor-D1yDvJd3.js} +1 -1
  193. package/dist/client/assets/{monitoring-UGiK-7BE.js → monitoring-CvGmGp-w.js} +1 -1
  194. package/dist/client/assets/{monitoring-stats-row-BagVDHFD.js → monitoring-stats-row-C-A-doof.js} +1 -1
  195. package/dist/client/assets/{multi-select-CKLuefuY.js → multi-select-BNUkLp8H.js} +1 -1
  196. package/dist/client/assets/{mustache-Co8KcLI0.js → mustache-CksHv2Dr.js} +1 -1
  197. package/dist/client/assets/{named-rule-uses-0L-mc_uD.js → named-rule-uses-BBl065fe.js} +1 -1
  198. package/dist/client/assets/{named-rule-view-DZyPdsij.js → named-rule-view-BXK5sJ8X.js} +1 -1
  199. package/dist/client/assets/{new-project-dialog-C5J4MWsO.js → new-project-dialog-CYkF5k4O.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-DGdoi3wa.js → oauth-callback-BPlDpCVw.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-ai-provider-DID3n8T6.js → oauth-callback-ai-provider-C-kNRGr2.js} +1 -1
  202. package/dist/client/assets/{onboarding-D9ovXhj0.js → onboarding-81KXiaqI.js} +1 -1
  203. package/dist/client/assets/{openai-conversation-CM0XUf2p.js → openai-conversation-Bi9e1sKc.js} +1 -1
  204. package/dist/client/assets/{optimistic-project-sidebar-views-Bfc4VpR_.js → optimistic-project-sidebar-views-CVVwXn2X.js} +1 -1
  205. package/dist/client/assets/{order-monitor-day-DXxkF6qy.js → order-monitor-day-BVSLADXz.js} +1 -1
  206. package/dist/client/assets/{organization-choice-BPMnBB4D.js → organization-choice-DmteYBAc.js} +1 -1
  207. package/dist/client/assets/{orgs-D8DaVl4f.js → orgs-BFPSbb2q.js} +1 -1
  208. package/dist/client/assets/{page-seo-form-BRaefSdh.js → page-seo-form-VA7wIeJU.js} +1 -1
  209. package/dist/client/assets/{pair-DO5ZeABu.js → pair-Cjnol9_x.js} +1 -1
  210. package/dist/client/assets/{parse-sections-C4YcWg_N.js → parse-sections-7Tm_vjpy.js} +1 -1
  211. package/dist/client/assets/{plan-0xsoBIKI.js → plan-KARVWZDV.js} +1 -1
  212. package/dist/client/assets/{plan-ladder-RZlDrpyw.js → plan-ladder-C-o1aFSi.js} +1 -1
  213. package/dist/client/assets/{popover-CjjSJX-T.js → popover-BsX8gIsV.js} +1 -1
  214. package/dist/client/assets/{post-calendar-CMfQVQhR.js → post-calendar-B6fP7Sp3.js} +1 -1
  215. package/dist/client/assets/{post-editor-DneZ_oYu.js → post-editor-B530kxYZ.js} +1 -1
  216. package/dist/client/assets/{preview-content-C045LLz9.js → preview-content-IEhLMW40.js} +1 -1
  217. package/dist/client/assets/{preview-dialog-C5KMdNHK.js → preview-dialog-B8MUF8yg.js} +1 -1
  218. package/dist/client/assets/{preview-panel-DbAGt6c_.js → preview-panel-C3yGSsCn.js} +1 -1
  219. package/dist/client/assets/preview-tab-DZ2jzEbi.js +551 -0
  220. package/dist/client/assets/{product-picker-dialog-BjUVIbA3.js → product-picker-dialog-Duu5EFXJ.js} +1 -1
  221. package/dist/client/assets/{profile-nkfQjNS7.js → profile-SgKnnlOX.js} +1 -1
  222. package/dist/client/assets/project-app-view-69GUddZy.js +1 -0
  223. package/dist/client/assets/{project-apps-BNVRAEb2.js → project-apps-DxvrGikA.js} +1 -1
  224. package/dist/client/assets/{project-feed-xXVaAcj7.js → project-feed-Dkn186cj.js} +1 -1
  225. package/dist/client/assets/{project-icon-N-_cW8IV.js → project-icon-DozUqz8V.js} +1 -1
  226. package/dist/client/assets/project-reports-6uzfgJoN.js +1 -0
  227. package/dist/client/assets/project-tasks-BLcB7Cwc.js +1 -0
  228. package/dist/client/assets/{projects-iwaahBWW.js → projects-BvtnS4il.js} +1 -1
  229. package/dist/client/assets/{projects-empty-state-zSj-H-15.js → projects-empty-state-Bd8sqs2o.js} +1 -1
  230. package/dist/client/assets/{prompts-DHg6zTlM.js → prompts-CfiuzCI2.js} +1 -1
  231. package/dist/client/assets/record-editor-DD-1yqpv.js +1 -0
  232. package/dist/client/assets/{redirect-editor-CUc3_Gjb.js → redirect-editor-Cq58-dw7.js} +1 -1
  233. package/dist/client/assets/{releases-api-FsFJ3Ao1.js → releases-api-toiaosbq.js} +1 -1
  234. package/dist/client/assets/reports-VJqlTUDX.js +1 -0
  235. package/dist/client/assets/{reports-BfO4SPfx.js → reports-X-r24zwl.js} +1 -1
  236. package/dist/client/assets/{reports-onboarding-C51nw6GE.js → reports-onboarding-B1eQP37P.js} +1 -1
  237. package/dist/client/assets/{reports-tab-D4zotKTH.js → reports-tab-BqceAQel.js} +2 -2
  238. package/dist/client/assets/{repositories-ChqgU36Q.js → repositories-CkzQSY8F.js} +1 -1
  239. package/dist/client/assets/repositories-DRGtDHym.js +1 -0
  240. package/dist/client/assets/{repository-binding-DAOz6vJw.js → repository-binding-CiDG0Cr0.js} +1 -1
  241. package/dist/client/assets/{repository-import-picker-BcrGb4sk.js → repository-import-picker-TlIvK00I.js} +1 -1
  242. package/dist/client/assets/{repository-picker-BIZQUbzV.js → repository-picker-BrjMgENb.js} +1 -1
  243. package/dist/client/assets/{require-capability-CW24vDTN.js → require-capability-D5vaDJ6i.js} +1 -1
  244. package/dist/client/assets/{required-auth-layout-DZbUxfmT.js → required-auth-layout-CLsGddT6.js} +1 -1
  245. package/dist/client/assets/{reset-password-CGOBWPvy.js → reset-password-BDTPUkZZ.js} +1 -1
  246. package/dist/client/assets/{resizable-CZKHd0We.js → resizable-LNv9WlFU.js} +1 -1
  247. package/dist/client/assets/{resolve-tab-icon-kIr1F8om.js → resolve-tab-icon-DDEl8WpS.js} +1 -1
  248. package/dist/client/assets/review-settings-CR1udLwz.js +1 -0
  249. package/dist/client/assets/{roles-DZEPLtk9.js → roles-DIBxviRh.js} +1 -1
  250. package/dist/client/assets/route-CMp29IPi.js +1 -0
  251. package/dist/client/assets/{route-lBtyO3bR.js → route-CwE5K4wd.js} +1 -1
  252. package/dist/client/assets/{route-BRcGegjD.js → route-DiDqKVTg.js} +1 -1
  253. package/dist/client/assets/{runnable-block-editor-DUtYxxN3.js → runnable-block-editor-D9HAcpIU.js} +3 -3
  254. package/dist/client/assets/{sandbox-lifecycle-context-wjpGI-pF.js → sandbox-lifecycle-context-BKUYq7kP.js} +1 -1
  255. package/dist/client/assets/{schema-CeHPVV-x.js → schema-6JU3flf4.js} +1 -1
  256. package/dist/client/assets/{schema-B-d5VC7M.js → schema-BbiQjr1e.js} +1 -1
  257. package/dist/client/assets/{scroll-area-DpJwcaMZ.js → scroll-area-CCVLtkoB.js} +1 -1
  258. package/dist/client/assets/{search-input-Dn_Mm6hP.js → search-input-43leKkGn.js} +1 -1
  259. package/dist/client/assets/{search-toggle-BlrCbEt-.js → search-toggle-Ds25LhLA.js} +1 -1
  260. package/dist/client/assets/{secret-ciphertext-x-rG3-SW.js → secret-ciphertext-BrIiDgyd.js} +1 -1
  261. package/dist/client/assets/{secret-picker-BjSmxw0L.js → secret-picker-aJPnp_F5.js} +1 -1
  262. package/dist/client/assets/{secrets-BOaO2wUC.js → secrets-CfWgVKjc.js} +1 -1
  263. package/dist/client/assets/{sections-B7NcoZr9.js → sections-Dvgo02ra.js} +1 -1
  264. package/dist/client/assets/{sections-editor-B65DWyde.js → sections-editor-BSfFPyUU.js} +1 -1
  265. package/dist/client/assets/{select-35KAqptX.js → select-CHmq3OGd.js} +1 -1
  266. package/dist/client/assets/{select-model-CRhm1POv.js → select-model-CvpLn49w.js} +1 -1
  267. package/dist/client/assets/{seo-editor-BD4rsTCg.js → seo-editor-BQ3pdKQv.js} +1 -1
  268. package/dist/client/assets/{separator-CN44jTdI.js → separator-vkFvxZ8m.js} +1 -1
  269. package/dist/client/assets/settings-tab-B_bx6QgP.js +1 -0
  270. package/dist/client/assets/{sheet--x4K5vq7.js → sheet-C_qetF7d.js} +1 -1
  271. package/dist/client/assets/{shell-layout-MuOSrWff.js → shell-layout-Bb-Bk8Da.js} +1 -1
  272. package/dist/client/assets/{site-draft-actions-C158kLWC.js → site-draft-actions-GBt56z1o.js} +1 -1
  273. package/dist/client/assets/site-draft-view-CZq-6QXP.js +2 -0
  274. package/dist/client/assets/site-editor-Dw86EYnX.js +1 -0
  275. package/dist/client/assets/{site-editor-toast-S3ZDWqj4.js → site-editor-toast-Dvaha1qd.js} +1 -1
  276. package/dist/client/assets/{skills-DLHcL6Ra.js → skills-CNP2yKUA.js} +1 -1
  277. package/dist/client/assets/{slider-CB0MGtcs.js → slider-Dt2pZuy0.js} +1 -1
  278. package/dist/client/assets/{sortable.esm-CnslkyN-.js → sortable.esm-Dgy_5_Gq.js} +1 -1
  279. package/dist/client/assets/{sso-HY_2IIv9.js → sso-BwMXXLZ-.js} +1 -1
  280. package/dist/client/assets/{suggestion-DZQHNrRW.js → suggestion-DUWht7S9.js} +1 -1
  281. package/dist/client/assets/{switch-CUuF3Lbb.js → switch-BKqScyl8.js} +1 -1
  282. package/dist/client/assets/{symbol-BF05cGJ-.js → symbol-Bw5pneOj.js} +1 -1
  283. package/dist/client/assets/{synced-repos-BSOSKhlb.js → synced-repos-DhRHDr6D.js} +1 -1
  284. package/dist/client/assets/{tab-icon-glyph-CJIOp39A.js → tab-icon-glyph-ALHCeulj.js} +1 -1
  285. package/dist/client/assets/{table-BlnsYBCM.js → table-DSiO4Kq6.js} +1 -1
  286. package/dist/client/assets/{tabs-6v8Cll9k.js → tabs-BcHqdI-j.js} +1 -1
  287. package/dist/client/assets/{task-assignee-avatar-C9Sk5bvn.js → task-assignee-avatar-CwyY8xOb.js} +1 -1
  288. package/dist/client/assets/{task-board-Bt136szd.js → task-board-ICmHlMKj.js} +1 -1
  289. package/dist/client/assets/{task-route-t6KGoxhC.js → task-route-SvQTR3TJ.js} +1 -1
  290. package/dist/client/assets/{task-status-DvsJuwH-.js → task-status-Dk0B9E0G.js} +1 -1
  291. package/dist/client/assets/{taskboard-analytics-Dsx_nKwf.js → taskboard-analytics-vr9mjCEM.js} +1 -1
  292. package/dist/client/assets/{tasks-B9wf25Tq.js → tasks-DUtkLCHD.js} +1 -1
  293. package/dist/client/assets/tasks-DzLAZqT6.js +1 -0
  294. package/dist/client/assets/{textarea-CzFPd8mY.js → textarea-CTbC00Fo.js} +1 -1
  295. package/dist/client/assets/{thread-analytics-BNsgRzDB.js → thread-analytics-CYtiXz-Q.js} +1 -1
  296. package/dist/client/assets/{thread-intent-Dimk3aQq.js → thread-intent-DcKV1aEK.js} +1 -1
  297. package/dist/client/assets/{thread-route-CBR-hVjV.js → thread-route-D05ck8nv.js} +1 -1
  298. package/dist/client/assets/{thread-route-Dx9_u5Jd.js → thread-route-DlbP9X8e.js} +1 -1
  299. package/dist/client/assets/{thread-sheet-body-BW-XRqLk.js → thread-sheet-body-DXSUCFvU.js} +1 -1
  300. package/dist/client/assets/{time-range-picker-CmcQeC_-.js → time-range-picker-cljXExVl.js} +1 -1
  301. package/dist/client/assets/{toggle-group-o8h9w6Rw.js → toggle-group-cK7x-LaG.js} +1 -1
  302. package/dist/client/assets/{tool-namespace-BohpB6u5.js → tool-namespace-CFMdc33T.js} +1 -1
  303. package/dist/client/assets/{toolbar-icon-button-eoL5rlvV.js → toolbar-icon-button-AJC8O64v.js} +1 -1
  304. package/dist/client/assets/{tooltip-BKiQ2c4S.js → tooltip-oRr5C_aw.js} +1 -1
  305. package/dist/client/assets/{tooltipContext-BKUF9aS4.js → tooltipContext-DBLuHkF3.js} +1 -1
  306. package/dist/client/assets/{track-BIe-Ry31.js → track-D3xYnfew.js} +1 -1
  307. package/dist/client/assets/{types-CjXbKtgO.js → types-BnGn2ply.js} +1 -1
  308. package/dist/client/assets/{url-slug-CKCta88_.js → url-slug-CiQKnf5R.js} +1 -1
  309. package/dist/client/assets/{usage-stats-CTkcwRGv.js → usage-stats-BFNP5B9b.js} +1 -1
  310. package/dist/client/assets/{use-ai-providers-De1swco5.js → use-ai-providers-DB7Q0SBY.js} +1 -1
  311. package/dist/client/assets/{use-apply-named-rule-Yk2R4vGY.js → use-apply-named-rule-DW6Wbxy3.js} +1 -1
  312. package/dist/client/assets/{use-automations-DOZ_ddWM.js → use-automations-BXbY6ysU.js} +1 -1
  313. package/dist/client/assets/{use-autosave-B8CxO0rS.js → use-autosave-BB3cf8aT.js} +1 -1
  314. package/dist/client/assets/{use-chat-layout-state-B0cKljGG.js → use-chat-layout-state-KA32sUXt.js} +1 -1
  315. package/dist/client/assets/{use-clock-tick-DXHhIXGi.js → use-clock-tick-CmSlUOB2.js} +1 -1
  316. package/dist/client/assets/{use-connect-companion-CNjzI2Gb.js → use-connect-companion-Dzb46un3.js} +1 -1
  317. package/dist/client/assets/{use-connection-Bb5luwYC.js → use-connection-PJ_l98GU.js} +1 -1
  318. package/dist/client/assets/{use-content-sync-9gqPWQll.js → use-content-sync-9tvG-lut.js} +1 -1
  319. package/dist/client/assets/{use-copy-GYYhLXBY.js → use-copy-D4R9cJ_t.js} +1 -1
  320. package/dist/client/assets/{use-create-virtual-mcp-CcifdRil.js → use-create-virtual-mcp-cYnUmw5j.js} +1 -1
  321. package/dist/client/assets/{use-date-fns-locale-CYgQL4Jo.js → use-date-fns-locale-BgdR-wYC.js} +1 -1
  322. package/dist/client/assets/{use-debounced-autosave-B9JjKQU0.js → use-debounced-autosave-CL6P-Lri.js} +1 -1
  323. package/dist/client/assets/{use-debounced-value-BOYaK5vY.js → use-debounced-value-BdOjhsVi.js} +1 -1
  324. package/dist/client/assets/{use-deco-credits-BOXZz3P1.js → use-deco-credits-DHNd5iXt.js} +1 -1
  325. package/dist/client/assets/{use-decopilot-events-DQQB-1qO.js → use-decopilot-events-CDLwP1Su.js} +1 -1
  326. package/dist/client/assets/{use-delete-connection-DeeN5sak.js → use-delete-connection-CkSINryc.js} +1 -1
  327. package/dist/client/assets/{use-deployment-admin-Bz_unjS_.js → use-deployment-admin-BZATCf2q.js} +1 -1
  328. package/dist/client/assets/{use-fast-preview-draft-url-DL15tTpN.js → use-fast-preview-draft-url-CGwz_fku.js} +1 -1
  329. package/dist/client/assets/{use-file-configs-Bs34_QXe.js → use-file-configs-nRV9S9D0.js} +1 -1
  330. package/dist/client/assets/{use-inbox-feed-CPLQGzQu.js → use-inbox-feed-CMEIMGZ6.js} +1 -1
  331. package/dist/client/assets/{use-infinite-scroll-TKtAAXad.js → use-infinite-scroll-CNz9_Nor.js} +1 -1
  332. package/dist/client/assets/{use-join-requests-Zw7OQ09c.js → use-join-requests-oCznfTNy.js} +1 -1
  333. package/dist/client/assets/{use-main-panel-tabs-w1hDvrxY.js → use-main-panel-tabs-BKmILeUa.js} +1 -1
  334. package/dist/client/assets/{use-mcp-auth-status-DTPo2TCr.js → use-mcp-auth-status-BlkUCjXO.js} +1 -1
  335. package/dist/client/assets/{use-mcp-client-Q83YdvIg.js → use-mcp-client-DKIfKwpJ.js} +1 -1
  336. package/dist/client/assets/{use-mcp-prompts-BcqS4HpY.js → use-mcp-prompts-MhXPkujh.js} +1 -1
  337. package/dist/client/assets/{use-mcp-tools-CFBxGHgP.js → use-mcp-tools-CTl2xkGk.js} +1 -1
  338. package/dist/client/assets/{use-members-CMq0EOLQ.js → use-members-BiXVclqd.js} +1 -1
  339. package/dist/client/assets/{use-mobile-DHwXmnJW.js → use-mobile-CCkX9zL-.js} +1 -1
  340. package/dist/client/assets/{use-move-blocks-BZQPOuio.js → use-move-blocks-C6LWTkiD.js} +1 -1
  341. package/dist/client/assets/{use-navigate-to-agent-CRetfCk1.js → use-navigate-to-agent-CEb5-IwU.js} +1 -1
  342. package/dist/client/assets/{use-open-billing-url-BoLb6LTQ.js → use-open-billing-url-D-NQ16Mb.js} +1 -1
  343. package/dist/client/assets/{use-org-auth-client-Im4HAiDN.js → use-org-auth-client-xXOFDOL1.js} +1 -1
  344. package/dist/client/assets/{use-org-fs-BkhssW-q.js → use-org-fs-DRaVeNa6.js} +1 -1
  345. package/dist/client/assets/{use-org-repo-syncs-CQwCJbKx.js → use-org-repo-syncs-LHzk4Keo.js} +1 -1
  346. package/dist/client/assets/{use-org-sso-ChZhVF-c.js → use-org-sso-Bx0Susbk.js} +1 -1
  347. package/dist/client/assets/{use-organization-roles-C3qIjIVy.js → use-organization-roles-CbO1bQ_O.js} +1 -1
  348. package/dist/client/assets/{use-organization-settings-BKC0vqj5.js → use-organization-settings-Bf2WDJz9.js} +1 -1
  349. package/dist/client/assets/{use-panel-navigate-D3V5oZgG.js → use-panel-navigate-CYYYdsdC.js} +1 -1
  350. package/dist/client/assets/{use-project-native-view-presence-BnccFS-g.js → use-project-native-view-presence-B2rH_d27.js} +1 -1
  351. package/dist/client/assets/{use-project-scope-CXdLsOUx.js → use-project-scope-C66L_LKx.js} +1 -1
  352. package/dist/client/assets/{use-recent-apps-B5QclJaN.js → use-recent-apps-DaFNVa3y.js} +1 -1
  353. package/dist/client/assets/{use-releases-BC3G5Pl0.js → use-releases-DwpIDRIp.js} +1 -1
  354. package/dist/client/assets/{use-reports-diagnostic-tcpLCmvm.js → use-reports-diagnostic-DnLCgooz.js} +1 -1
  355. package/dist/client/assets/{use-sandbox-events-DvplhdO9.js → use-sandbox-events-CioHBl5Q.js} +1 -1
  356. package/dist/client/assets/{use-secrets-Bc11D92Z.js → use-secrets-BrDaOgAh.js} +1 -1
  357. package/dist/client/assets/{use-section-preview-base-Dnt4agkC.js → use-section-preview-base-DxyD_MVI.js} +1 -1
  358. package/dist/client/assets/{use-session-runtime-C4oqymjC.js → use-session-runtime-DgSb1tZ1.js} +1 -1
  359. package/dist/client/assets/{use-sidebar-collapsed-BwUTTLp4.js → use-sidebar-collapsed-Lbn9i3wJ.js} +1 -1
  360. package/dist/client/assets/{use-tags-BB1h7o3t.js → use-tags-DxXXXYXQ.js} +1 -1
  361. package/dist/client/assets/{use-task-board-analytics-DGpoyTMw.js → use-task-board-analytics-B_lpE6sk.js} +1 -1
  362. package/dist/client/assets/{use-task-board-events-CavGFGcP.js → use-task-board-events-Ciu9fgM5.js} +1 -1
  363. package/dist/client/assets/{use-task-board-item-prs-DV_64vVH.js → use-task-board-item-prs-BXiZI60U.js} +1 -1
  364. package/dist/client/assets/{use-task-metadata-HTLDRogK.js → use-task-metadata-DXSFycil.js} +1 -1
  365. package/dist/client/assets/{use-thread-analytics-BpkGclpK.js → use-thread-analytics-BBBfMO-x.js} +1 -1
  366. package/dist/client/assets/{use-thread-outputs-DTZGPUxN.js → use-thread-outputs-Be0M4DCF.js} +1 -1
  367. package/dist/client/assets/useInfiniteQuery-C9OOM3iT.js +1 -0
  368. package/dist/client/assets/{useQueries-jpAcc0Og.js → useQueries-CjLpsE8j.js} +1 -1
  369. package/dist/client/assets/useSuspenseInfiniteQuery-DC4aZJSW.js +1 -0
  370. package/dist/client/assets/{users-rDy84J0H.js → users-DhWYm0Ur.js} +1 -1
  371. package/dist/client/assets/{utils-Azo2Yo1D.js → utils-BlqF72Vj.js} +1 -1
  372. package/dist/client/assets/{variant-calendar-EbCPgcKt.js → variant-calendar-Z__DuHea.js} +1 -1
  373. package/dist/client/assets/{variant-matcher-override-aUUxuYxP.js → variant-matcher-override-BcEAaLIA.js} +1 -1
  374. package/dist/client/assets/virtual-mcp-DQmDpfRM.js +1 -0
  375. package/dist/client/assets/{watch-sse-pool-BydfW6Wr.js → watch-sse-pool-9GQSHr-W.js} +1 -1
  376. package/dist/client/index.html +2 -2
  377. package/dist/server/server.js +510 -510
  378. package/package.json +1 -1
  379. package/dist/client/assets/UserSquare-BIGP81NS.js +0 -1
  380. package/dist/client/assets/agent-analytics-ga8WG0DD.js +0 -1
  381. package/dist/client/assets/agent-app-D3wD7b8f.js +0 -1
  382. package/dist/client/assets/agent-calendar-B3oKpSw2.js +0 -1
  383. package/dist/client/assets/agent-deck-CXdYMYf4.js +0 -1
  384. package/dist/client/assets/agent-e2e-BOVUEdNB.js +0 -1
  385. package/dist/client/assets/agent-experiments-HQCEx4Fq.js +0 -1
  386. package/dist/client/assets/agent-file-De8dU8yj.js +0 -1
  387. package/dist/client/assets/agent-hosting-BJaMFlfC.js +0 -1
  388. package/dist/client/assets/agent-icon-B7E6q_wB.js +0 -1
  389. package/dist/client/assets/agent-library-CycM9_xW.js +0 -1
  390. package/dist/client/assets/agent-library-file-CQfHiAWz.js +0 -1
  391. package/dist/client/assets/agent-monitor-DZTUJG_q.js +0 -1
  392. package/dist/client/assets/agent-settings-BzozrOuP.js +0 -1
  393. package/dist/client/assets/agent-site-editor-code-CfhAFGbw.js +0 -2
  394. package/dist/client/assets/agent-site-editor-content-HSi2zAV9.js +0 -1
  395. package/dist/client/assets/agent-site-editor-preview--Eh8H0cH.js +0 -1
  396. package/dist/client/assets/agent-view-i5fuA9y0.js +0 -1
  397. package/dist/client/assets/api-keys-9XoxlxPv.js +0 -1
  398. package/dist/client/assets/cms-settings-editor-DzowXA1R.js +0 -1
  399. package/dist/client/assets/index-AnCWAS83.js +0 -4
  400. package/dist/client/assets/index-MPdUOMBb.css +0 -1
  401. package/dist/client/assets/library-KPhgahQ-.js +0 -1
  402. package/dist/client/assets/preview-tab-BT-Dmpc3.js +0 -551
  403. package/dist/client/assets/project-app-view-bzcy9g1q.js +0 -1
  404. package/dist/client/assets/project-reports-CAf7P6Es.js +0 -1
  405. package/dist/client/assets/project-tasks-XqUcBopf.js +0 -1
  406. package/dist/client/assets/record-editor-hs79wE2U.js +0 -1
  407. package/dist/client/assets/reports-s1lwdSit.js +0 -1
  408. package/dist/client/assets/repositories-CGUqALW5.js +0 -1
  409. package/dist/client/assets/review-settings-9IMzIRKU.js +0 -1
  410. package/dist/client/assets/route-CYe3oAYd.js +0 -1
  411. package/dist/client/assets/settings-tab-BrPjDgOB.js +0 -1
  412. package/dist/client/assets/site-draft-view-cqx7I6xp.js +0 -2
  413. package/dist/client/assets/site-editor-Cepl1MM3.js +0 -1
  414. package/dist/client/assets/tasks-DUF77GAJ.js +0 -1
  415. package/dist/client/assets/useInfiniteQuery-XMmYWsXs.js +0 -1
  416. package/dist/client/assets/useSuspenseInfiniteQuery-BK6RRGGC.js +0 -1
  417. package/dist/client/assets/virtual-mcp-DSXubdao.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{c as q,b as Z,r as Q,j as t,B as ee,h as at,l as ge,X as Ns,T as Cs,V as ks,U as Qe,at as Bt,ar as Wt,as as Kt,t as re,a2 as Ee,D as Je,q as Ze,s as lt,v as rt,H as Be,a3 as Ms,fF as un,w as Dt,L as _s,I as Se,ak as mn,z as fn,ey as st,av as Gt,aj as pn,ex as Re,ew as We,an as Pt,m as Vs,K as Ot,fG as hn,fH as xn,fI as gn,b6 as be,fJ as je,n as Ye,P as vn,d as At,u as bn,af as ot,o as Ts,e as jn,aN as Ds,y as Ve,b2 as yn,a as wn,fK as It,fL as Sn,aX as Nn,ad as Cn,aF as kn,aE as Mn,a5 as _n,fM as Vn,aM as Tn}from"./index-DJCD1T3p.js";import{g as Dn}from"./extract-connection-data-C2lA8ZOm.js";import{b as Pn}from"./chat-context-4LDKQ9-8.js";import{U as On,b as An}from"./build-improve-prompt-doc-BNyp6j2d.js";import{E as In}from"./empty-state-vh9cmtA2.js";import{a as $n}from"./shell-layout-Bb-Bk8Da.js";import{g as pt,n as Fn,a as qt,e as En,u as zn,f as Rn}from"./use-date-fns-locale-BgdR-wYC.js";import{a as Ln}from"./mcp-oauth-CFQzR34b.js";import{f as Un,e as Yn,b as Bn,A as Wn,a as Kn,d as Gn,c as qn,g as Hn}from"./alert-dialog-C6IuYhIc.js";import{T as mt}from"./textarea-CTbC00Fo.js";import{c as Ce,T as ke,a as Me}from"./tooltip-oRr5C_aw.js";import{a as $t,b as Ps,u as Qn}from"./use-connection-PJ_l98GU.js";import{b as Xn,a as Os,g as As,d as Jn,k as Zn}from"./repository-binding-CiDG0Cr0.js";import{i as Ht}from"./mcp-oauth-DHXkg8Ce.js";import{bg as ei,k as ti,bh as si,bi as ni,aT as ii,aD as ai,aG as li,bj as ri,bk as Is,bl as $s,bm as oi,aq as ci,bn as di,bo as wt,bp as Qt,A as Xt,N as ui,bq as mi,br as fi,g as Fs,p as Jt,n as pi,x as hi,w as xi,v as gi,u as vi,r as bi,f as Es,E as Zt,aQ as ji,ae as yi,aw as wi}from"./agent-icon-2Sd6TPJR.js";import{s as Pe}from"./Plus-B28tKNm1.js";import{t as ut,a as Si}from"./Tool01-CnZckhqi.js";import{s as ht}from"./Trash01-C34kFeWG.js";import{u as es}from"./use-debounced-autosave-CL6P-Lri.js";import{A as Ni}from"./add-connection-dialog-3BCYyOlq.js";import{i as Mt}from"./SearchMd-OCyidoZI.js";import{F as ts}from"./file-type-icon-Ixvc6_bA.js";import{i as Ci,j as ki,k as Mi,l as _i}from"./use-org-fs-DRaVeNa6.js";import{I as et}from"./integration-icon-CMGBZM9F.js";import{C as zs}from"./checkbox--QGg9JL6.js";import{S as Vi}from"./search-input-43leKkGn.js";import{b as Ae,a as Ie,c as we,d as $e,S as Fe}from"./select-CHmq3OGd.js";import{s as Ft}from"./XClose-BbuvN9Qp.js";import{C as Ti}from"./collection-tabs-Dc2dImyc.js";import{T as Rs,u as Ls}from"./use-mcp-auth-status-BlkUCjXO.js";import{u as xt}from"./use-mcp-client-DKIfKwpJ.js";import{a as Us}from"./use-mcp-tools-CTl2xkGk.js";import{u as Di}from"./use-mcp-prompts-MhXPkujh.js";import{g as Pi}from"./connection-slug-CITJ0kGN.js";import{t as _t}from"./utils-CVEq3hMx.js";import{S as gt}from"./switch-BKqScyl8.js";import{a as Ys,b as Bs,P as Ws}from"./popover-BsX8gIsV.js";import{S as Oi}from"./scroll-area-CCVLtkoB.js";import{i as Ai}from"./Upload01-sDXthFWJ.js";import{i as Ii}from"./DotsVertical-DzE0Ijkk.js";import{a as $i}from"./Image01-Bks737AT.js";import{i as Fi}from"./Monitor01-B-_Pl3qs.js";import{g as Ei}from"./types-BnGn2ply.js";import{a as Ks,g as zi,u as Ri}from"./experiments-tab-choice-p3E1pILX.js";import{a as Li}from"./use-panel-navigate-CYYYdsdC.js";import{u as Ui,e as Vt,o as ss,r as Tt,p as Yi,g as Bi,s as Wi,t as Ki,h as Gi,i as qi,a as Hi}from"./use-project-native-view-presence-B2rH_d27.js";import{a as Gs,u as Qi,i as Xi,o as Ji,r as ns,p as Zi,w as ea,b as is}from"./optimistic-project-sidebar-views-CVVwXn2X.js";import{P as ta,a as sa,i as na}from"./sections-Dvgo02ra.js";import{i as Et}from"./Key01-CxbATohw.js";import{a as ia}from"./format-time-Cq80KKvY.js";import{a as vt}from"./Copy01-CixCoZek.js";import{u as aa}from"./use-copy-D4R9cJ_t.js";import{L as ye}from"./label-CBlQ82Fk.js";import{s as qs,n as la,r as ra}from"./thread-intent-DcKV1aEK.js";import{V as oa,E as bt,R as as,r as Hs,C as ca,w as da}from"./virtual-mcp-DQmDpfRM.js";import{s as Qs}from"./slugify-CEUa2lfQ.js";import{b as ua,a as ma,D as fa}from"./drawer-Bp7WNOCz.js";import{u as pa}from"./use-mobile-CCkX9zL-.js";import{d as jt}from"./delay-CnY5UFtP.js";import{b as ha}from"./sandbox-url-D3mC8qhT.js";import{S as xa,a as ga,b as va}from"./secret-picker-aJPnp_F5.js";import{u as ba,a as ja}from"./use-secrets-BrDaOgAh.js";import{o as ls}from"./omit-sandbox-map-jj4lCB2U.js";import{G as ya}from"./repository-picker-BrjMgENb.js";import{n as rs}from"./app-preview-url-DmK5uokM.js";import{a as wa}from"./use-organization-settings-Bf2WDJz9.js";import{r as Sa}from"./serial-task-queue-CGOeQgpr.js";import{t as Oe,c as Xe,m as Na,a as Xs}from"./differenceInSeconds-C3x8sHUj.js";function it(a,e){const s=pt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Oe(a,e?.in),l=i.getDay(),r=(l<n?7:0)+l-n;return i.setDate(i.getDate()-r),i.setHours(0,0,0,0),i}function ft(a,e){return it(a,{...e,weekStartsOn:1})}function Js(a,e){const s=Oe(a,e?.in),n=s.getFullYear(),i=Xe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=ft(i),r=Xe(s,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const o=ft(r);return s.getTime()>=l.getTime()?n+1:s.getTime()>=o.getTime()?n:n-1}function os(a,e){const s=Oe(a,e?.in);return s.setHours(0,0,0,0),s}function Ca(a,e,s){const[n,i]=Fn(s?.in,a,e),l=os(n),r=os(i),o=+l-qt(l),p=+r-qt(r);return Math.round((o-p)/Na)}function ka(a,e){const s=Js(a,e),n=Xe(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),ft(n)}function Ma(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function _a(a){return!(!Ma(a)&&typeof a!="number"||isNaN(+Oe(a)))}function Va(a,e){const s=Oe(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function Ta(a,e){const s=Oe(a,e?.in);return Ca(s,Va(s))+1}function Da(a,e){const s=Oe(a,e?.in),n=+ft(s)-+ka(s);return Math.round(n/Xs)+1}function Zs(a,e){const s=Oe(a,e?.in),n=s.getFullYear(),i=pt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Xe(e?.in||a,0);r.setFullYear(n+1,0,l),r.setHours(0,0,0,0);const o=it(r,e),p=Xe(e?.in||a,0);p.setFullYear(n,0,l),p.setHours(0,0,0,0);const c=it(p,e);return+s>=+o?n+1:+s>=+c?n:n-1}function Pa(a,e){const s=pt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=Zs(a,e),l=Xe(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),it(l,e)}function Oa(a,e){const s=Oe(a,e?.in),n=+it(s,e)-+Pa(s,e);return Math.round(n/Xs)+1}function le(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const ze={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return le(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):le(s+1,2)},d(a,e){return le(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return le(a.getHours()%12||12,e.length)},H(a,e){return le(a.getHours(),e.length)},m(a,e){return le(a.getMinutes(),e.length)},s(a,e){return le(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return le(i,e.length)}},He={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cs={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return ze.y(a,e)},Y:function(a,e,s,n){const i=Zs(a,n),l=i>0?i:1-i;if(e==="YY"){const r=l%100;return le(r,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):le(l,e.length)},R:function(a,e){const s=Js(a);return le(s,e.length)},u:function(a,e){const s=a.getFullYear();return le(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return le(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return le(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return ze.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return le(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Oa(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(a,e,s){const n=Da(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):le(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):ze.d(a,e)},D:function(a,e,s){const n=Ta(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):le(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return le(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return le(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=He.noon:n===0?i=He.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=He.evening:n>=12?i=He.afternoon:n>=4?i=He.morning:i=He.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return ze.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):ze.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):le(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):le(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):ze.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):ze.s(a,e)},S:function(a,e){return ze.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return us(n);case"XXXX":case"XX":return Ue(n);default:return Ue(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return us(n);case"xxxx":case"xx":return Ue(n);default:return Ue(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ds(n,":");default:return"GMT"+Ue(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ds(n,":");default:return"GMT"+Ue(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return le(n,e.length)},T:function(a,e,s){return le(+a,e.length)}};function ds(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+le(l,2)}function us(a,e){return a%60===0?(a>0?"-":"+")+le(Math.abs(a)/60,2):Ue(a,e)}function Ue(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=le(Math.trunc(n/60),2),l=le(n%60,2);return s+i+e+l}const ms=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},en=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Aa=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return ms(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",ms(n,e)).replace("{{time}}",en(i,e))},Ia={p:en,P:Aa},$a=/^D+$/,Fa=/^Y+$/,Ea=["D","DD","YY","YYYY"];function za(a){return $a.test(a)}function Ra(a){return Fa.test(a)}function La(a,e,s){const n=Ua(a,e,s);if(console.warn(n),Ea.includes(a))throw new RangeError(n)}function Ua(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ya=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ba=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wa=/^'([^]*?)'?$/,Ka=/''/g,Ga=/[a-zA-Z]/;function qa(a,e,s){const n=pt(),i=s?.locale??n.locale??En,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Oe(a,s?.in);if(!_a(o))throw new RangeError("Invalid time value");let p=e.match(Ba).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Ia[m];return u(f,i.formatLong)}return f}).join("").match(Ya).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Ha(f)};if(cs[m])return{isToken:!0,value:f};if(m.match(Ga))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(o,p));const c={firstWeekContainsDate:l,weekStartsOn:r,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&Ra(m)||!s?.useAdditionalDayOfYearTokens&&za(m))&&La(m,e,String(a));const u=cs[m[0]];return u(o,m,i.localize,c)}).join("")}function Ha(a){const e=a.match(Wa);return e?e[1].replace(Ka,"'"):a}const tn=25*1024*1024,St="home",Nt="knowledge";function fs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Le(a){return a.split("/").pop()??a}function Qa(a){const e=q.c(64),{form:s}=a,n=Z(),{upload:i}=Ci(St),l=ki(),r=Q.useRef(null),[o,p]=Q.useState(!1),[c,f]=Q.useState(""),[m,u]=Q.useState(!1);let h;e[0]!==o?(h={enabled:o},e[0]=o,e[1]=h):h=e[1];const{data:d}=Mi(60,h),x=d===void 0?[]:d;let g;e[2]!==o?(g={enabled:o},e[2]=o,e[3]=g):g=e[3];const{data:v}=_i(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,S]=Q.useState(j);let N;e[6]!==s?(N=F=>{S(F),s.setValue("metadata.knowledge",F,{shouldDirty:!0})},e[6]=s,e[7]=N):N=e[7];const k=N;let w;e[8]!==l||e[9]!==b||e[10]!==k||e[11]!==n||e[12]!==i?(w=async F=>{if(!F||F.length===0)return;const se=Array.from(F),Te=se.filter(nl),D=se.filter(sl);if(D.length>0&&re.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:D.map(tl).join(", ")})}),Te.length!==0){try{await i.mutateAsync({dir:Nt,files:Te})}catch(te){const ne=te;re.error(ne instanceof Error?ne.message:n("virtualMcp.filesSection.failedUploadFile"));return}k([...b,...Te.map(te=>({id:crypto.randomUUID(),name:te.name,volume:St,path:`${Nt}/${te.name}`,url:l(St,`${Nt}/${te.name}`),contentType:te.type||null,size:te.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=k,e[11]=n,e[12]=i,e[13]=w):w=e[13];const C=w;let M;e[14]!==l||e[15]!==b||e[16]!==k?(M=F=>{b.some(se=>se.volume===F.volume&&se.path===F.path)||(k([...b,{id:crypto.randomUUID(),name:Le(F.path),volume:F.volume,path:F.path,url:l(F.volume,F.path),contentType:null,size:F.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=l,e[15]=b,e[16]=k,e[17]=M):M=e[17];const _=M;let V;e[18]!==l||e[19]!==b||e[20]!==k?(V=F=>{b.some(se=>se.volume===F.volume&&se.path===F.path)||(k([...b,{id:crypto.randomUUID(),name:Le(F.path),kind:"skill",volume:F.volume,path:F.path,url:l(F.volume,F.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=l,e[19]=b,e[20]=k,e[21]=V):V=e[21];const E=V;let P;e[22]!==b||e[23]!==k?(P=F=>{k(b.filter(se=>se.id!==F))},e[22]=b,e[23]=k,e[24]=P):P=e[24];const I=P;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=F=>{p(F),F&&f("")},e[25]=A):A=e[25];const R=A;let U;e[26]!==b?(U=new Set(b.map(el)),e[26]=b,e[27]=U):U=e[27];const K=U,W=c.toLowerCase();let G;e[28]!==K?(G=F=>!K.has(`${F.volume}/${F.path}`),e[28]=K,e[29]=G):G=e[29];const L=x.filter(Za).filter(G).filter(F=>Le(F.path).toLowerCase().includes(W)).slice(0,5);let Y;e[30]!==K?(Y=F=>!K.has(`${F.volume}/${F.path}`),e[30]=K,e[31]=Y):Y=e[31];const X=y.filter(Y).filter(F=>Le(F.path).toLowerCase().includes(W)).slice(0,5),T=F=>t.jsxs(Ns,{open:o,onOpenChange:R,children:[t.jsx(Cs,{asChild:!0,children:F}),t.jsxs(ks,{align:"end",className:"w-56",children:[t.jsxs(Qe,{onSelect:()=>{r.current?.click()},children:[t.jsx(ei,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Bt,{children:[t.jsxs(Wt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ti,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Kt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Mt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:se=>f(se.target.value),onKeyDown:Ja,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:L.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):L.map(se=>t.jsxs(Qe,{onSelect:()=>_(se),children:[t.jsx(ts,{filename:Le(se.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Le(se.path)}),se.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:fs(se.size)})]},`${se.volume}/${se.path}`))})]})]}),t.jsxs(Bt,{children:[t.jsxs(Wt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(ut,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Kt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Mt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:se=>f(se.target.value),onKeyDown:Xa,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:X.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):X.map(se=>t.jsxs(Qe,{onSelect:()=>E(se),children:[t.jsx(ut,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Le(se.path)})]},`${se.volume}/${se.path}`))})]})]})]})]}),z="flex flex-col gap-3";let B;e[32]!==n?(B=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=B):B=e[33];let O;e[34]!==B?(O=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:B}),e[34]=B,e[35]=O):O=e[35];let $;e[36]!==n?($=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=$):$=e[37];let J;e[38]!==$?(J=t.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=J):J=e[39];let ie;e[40]!==O||e[41]!==J?(ie=t.jsxs("div",{className:"flex flex-col gap-1",children:[O,J]}),e[40]=O,e[41]=J,e[42]=ie):ie=e[42];const de=b.length>0&&T(t.jsxs(ee,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(at,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==ie||e[44]!==de?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ie,de]}),e[43]=ie,e[44]=de,e[45]=ae):ae=e[45];let oe;e[46]!==C?(oe=t.jsx("input",{ref:r,type:"file",multiple:!0,className:"hidden",onChange:F=>{C(F.target.files),F.target.value=""}}),e[46]=C,e[47]=oe):oe=e[47];let H,ce;e[48]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.preventDefault(),u(!0)},ce=()=>u(!1),e[48]=H,e[49]=ce):(H=e[48],ce=e[49]);let me;e[50]!==C?(me=F=>{F.preventDefault(),F.stopPropagation(),u(!1),C(F.dataTransfer.files)},e[50]=C,e[51]=me):me=e[51];const pe=m&&"outline outline-2 outline-dashed outline-primary";let fe;e[52]!==pe?(fe=ge("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=fe):fe=e[53];const he=b.length===0?T(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(F=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[F.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(ut,{size:16})}):t.jsx(ts,{filename:F.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:F.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:F.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):F.size!=null?fs(F.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>I(F.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:F.name}),children:t.jsx(ht,{size:16})})]},F.id));let ve;e[54]!==H||e[55]!==ce||e[56]!==me||e[57]!==fe||e[58]!==he?(ve=t.jsx("div",{onDragOver:H,onDragLeave:ce,onDrop:me,className:fe,children:he}),e[54]=H,e[55]=ce,e[56]=me,e[57]=fe,e[58]=he,e[59]=ve):ve=e[59];let ue;return e[60]!==ae||e[61]!==oe||e[62]!==ve?(ue=t.jsxs("section",{className:z,children:[ae,oe,ve]}),e[60]=ae,e[61]=oe,e[62]=ve,e[63]=ue):ue=e[63],ue}function Xa(a){return a.stopPropagation()}function Ja(a){return a.stopPropagation()}function Za(a){return a.kind!=="dir"}function el(a){return`${a.volume}/${a.path}`}function tl(a){return a.name}function sl(a){return a.size>tn}function nl(a){return a.size<=tn}function il(a){return a==null?"all":a.length===0?"self":"selected"}function al(a){const e=q.c(88),{form:s,currentAgentId:n}=a,i=Z(),{org:l}=Ee(),r=Xn(),[o,p]=Q.useState(!1);let c;e[0]!==s?(c=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=c):c=e[1];const f=c;let m;e[2]!==f?(m=()=>il(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=Q.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=Q.useState(d);let v,y,j,b,S,N;if(e[6]!==r||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let M;e[19]!==n||e[20]!==l?(M=H=>H.id!==n&&H.id!==l.id&&H.status==="active",e[19]=n,e[20]=l,e[21]=M):M=e[21],v=r.filter(M);let _;e[22]!==x?(_=H=>x.includes(H.id),e[22]=x,e[23]=_):_=e[23];const V=v.filter(_);let E;e[24]!==s?(E=(H,ce)=>s.setValue("metadata.subAgents",H==="all"?null:H==="self"?[]:ce,{shouldDirty:!0}),e[24]=s,e[25]=E):E=e[25];const P=E;let I;e[26]!==P||e[27]!==x?(I=H=>{h(H),P(H,x)},e[26]=P,e[27]=x,e[28]=I):I=e[28];const A=I;let R;e[29]!==P||e[30]!==x?(R=H=>{const ce=x.includes(H)?x.filter(me=>me!==H):[...x,H];g(ce),P("selected",ce)},e[29]=P,e[30]=x,e[31]=R):R=e[31],y=R,S="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let W;e[36]!==u||e[37]!==i?(W=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=W):W=e[38];let G;e[39]!==u||e[40]!==i?(G=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=G):G=e[41];let L;e[42]!==K||e[43]!==W||e[44]!==G?(L=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,W,G]}),e[42]=K,e[43]=W,e[44]=G,e[45]=L):L=e[45];const Y=u==="selected"&&V.length>0&&t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let X;e[46]!==A?(X=H=>A(H),e[46]=A,e[47]=X):X=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ae,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=T):T=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let B;e[51]!==z?(B=t.jsx(we,{value:"all",children:z}),e[51]=z,e[52]=B):B=e[52];let O;e[53]!==i?(O=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=O):O=e[54];let $;e[55]!==O?($=t.jsx(we,{value:"selected",children:O}),e[55]=O,e[56]=$):$=e[56];let J;e[57]!==i?(J=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=J):J=e[58];let ie;e[59]!==J?(ie=t.jsx(we,{value:"self",children:J}),e[59]=J,e[60]=ie):ie=e[60];let de;e[61]!==B||e[62]!==$||e[63]!==ie?(de=t.jsxs($e,{align:"end",children:[B,$,ie]}),e[61]=B,e[62]=$,e[63]=ie,e[64]=de):de=e[64];let ae;e[65]!==u||e[66]!==X||e[67]!==de?(ae=t.jsxs(Fe,{value:u,onValueChange:X,children:[T,de]}),e[65]=u,e[66]=X,e[67]=de,e[68]=ae):ae=e[68];let oe;e[69]!==Y||e[70]!==ae?(oe=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,ae]}),e[69]=Y,e[70]=ae,e[71]=oe):oe=e[71],e[72]!==L||e[73]!==oe?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[L,oe]}),e[72]=L,e[73]=oe,e[74]=N):N=e[74],j="flex flex-col gap-2",b=u==="selected"&&(V.length>0?V.map(H=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(et,{icon:H.icon,name:H.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:H.title}),H.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:H.description})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>y(H.id),children:t.jsx(Ft,{size:16})})]},H.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=r,e[7]=n,e[8]=s,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=S,e[18]=N}else v=e[13],y=e[14],j=e[15],b=e[16],S=e[17],N=e[18];let k;e[75]!==j||e[76]!==b?(k=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=k):k=e[77];let w;e[78]!==v||e[79]!==y||e[80]!==o||e[81]!==x?(w=t.jsx(ll,{open:o,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=o,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==k||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,k,w]}),e[83]=S,e[84]=N,e[85]=k,e[86]=w,e[87]=C):C=e[87],C}function ll(a){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:l,onToggle:r}=a,o=Z(),[p,c]=Q.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==p||e[5]!==l||e[6]!==o){const N=p.toLowerCase(),k=i.filter(M=>M.title.toLowerCase().includes(N)||M.description?.toLowerCase().includes(N));m=Je,v=s,y=n,f=Ze,d="max-w-md";let w;e[16]!==o?(w=o("virtualMcp.subAgentsSection.title"),e[16]=o,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(lt,{children:t.jsx(rt,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==o?(C=o("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=o,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(Vi,{value:p,onChange:c,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:o("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(M=>t.jsxs("button",{type:"button",onClick:()=>r(M.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx(zs,{checked:l.includes(M.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(et,{icon:M.icon,name:M.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:M.title}),M.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.description})]})]},M.id)),e[0]=i,e[1]=n,e[2]=r,e[3]=s,e[4]=p,e[5]=l,e[6]=o,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let S;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(S=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=S):S=e[38],S}function nt(){const a=q.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(at,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function dt(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ms,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function sn(a){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,r=l?"cursor-not-allowed opacity-50":"cursor-pointer",o=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==r||e[1]!==o?(p=ge("flex items-start gap-3 p-4 rounded-lg transition-colors",r,o),e[0]=r,e[1]=o,e[2]=p):p=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,f]}),e[7]=c,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==l||e[16]!==n||e[17]!==i?(d=t.jsx(zs,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function rl(a){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:r}=a,o=Z();let p;e[0]!==o?(p=o("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c={id:"tools",label:p},e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==o?(u=o("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=o,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==o?(d=o("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=o,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==m||e[18]!==h||e[19]!==x?(g=[c,m,h,x],e[16]=c,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=S=>n(S),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Ti,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==r||e[28]!==l||e[29]!==i||e[30]!==o?(j=i&&t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:o(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=r,e[28]=l,e[29]=i,e[30]=o,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function zt(a){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:r}=a;let o,p,c;if(e[0]!==r||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){c=Symbol.for("react.early_return_sentinel");e:{const m=s.map(ol);if(s.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}o="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(sn,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:r},u.id))}e[0]=r,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=o,e[6]=p,e[7]=c}else o=e[5],p=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let f;return e[10]!==o||e[11]!==p?(f=t.jsx("div",{className:o,children:p}),e[10]=o,e[11]=p,e[12]=f):f=e[12],f}function ol(a){return a.id}function cl(a){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Us(c),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==l||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(ul);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(dl);if(j.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let S;e[17]!==b?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=S):S=e[18],d=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(sn,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function dl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Rs,{annotations:a.annotations,_meta:a._meta})}}function ul(a){return a.name}function ml(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Us(c);let m;e[6]!==f.tools?(m=f.tools.map(fl),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function fl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Rs,{annotations:a.annotations,_meta:a._meta})}}function pl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=un(c);let m;e[6]!==f.resources?(m=f.resources.map(hl),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function hl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function xl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Ee();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=xt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=Di(c);let m;e[6]!==f.prompts?(m=f.prompts.map(gl),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(zt,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function gl(a){return{id:a.name,name:a.name,description:a.description}}function vl(a){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:r,toggleResource:o,togglePrompt:p,toggleAllTools:c,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=a,h=Z(),d=l[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==c?(v=()=>{n==="tools"?c(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=c,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let S;e[11]!==s.description?(S=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=S):S=e[12];let N;e[13]!==b||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[13]=b,e[14]=S,e[15]=N):N=e[15];let k;e[16]!==j||e[17]!==N?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=k):k=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(rl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==r?(C=n==="active"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(cl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(I,A)=>r(i,I,A)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=r,e[30]=C):C=e[30];let M;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==r?(M=n==="tools"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(ml,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(I,A)=>r(i,I,A)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=r,e[36]=M):M=e[36];let _;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==o?(_=n==="resources"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(pl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(I,A)=>o(i,I,A)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=o,e[42]=_):_=e[42];let V;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==p?(V=n==="prompts"&&t.jsx(Be,{fallback:dt(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(xl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(I,A)=>p(i,I,A)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=p,e[48]=V):V=e[48];let E;e[49]!==_||e[50]!==V||e[51]!==C||e[52]!==M?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,M,_,V]}),e[49]=_,e[50]=V,e[51]=C,e[52]=M,e[53]=E):E=e[53];let P;return e[54]!==E||e[55]!==k||e[56]!==w?(P=t.jsxs(t.Fragment,{children:[k,w,E]}),e[54]=E,e[55]=k,e[56]=w,e[57]=P):P=e[57],P}function bl(a){const e=q.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==l?(r=t.jsx(Dt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ee,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=r):r=e[6],r}function jl(a){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const o=Ls(r);if(o.supportsOAuth&&!o.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(si,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function yl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function ps(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function hs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function wl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Sl(a){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:r,onAuthenticate:o}=a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[c,f]=Q.useReducer(wl,p),m=$t(i??"");let u;e[1]!==r?(u=r??[],e[1]=r,e[2]=u):u=e[2];let h;e[3]!==u?(h=yl(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==l||e[6]!==d?(x=(L,Y,X,T)=>{const z=d[L]?.[Y];let B;z===null?B=T.filter(O=>O!==X):z?.includes(X)?B=z.filter(O=>O!==X):(B=[...z??[],X],B.length===T.length&&(B=null)),l.setValue("connections",ps(hs(d,L,Y,B)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==d?(v=(L,Y)=>{const T=d[L]?.[Y]===null?[]:null;l.setValue("connections",ps(hs(d,L,Y,T)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(L,Y,X)=>g(L,"tools",Y,X),e[11]=g,e[12]=j):j=e[12];const b=j;let S;e[13]!==g?(S=(L,Y,X)=>g(L,"resources",Y,X),e[13]=g,e[14]=S):S=e[14];const N=S;let k;e[15]!==g?(k=(L,Y,X)=>g(L,"prompts",Y,X),e[15]=g,e[16]=k):k=e[16];const w=k;let C;e[17]!==y?(C=L=>y(L,"tools"),e[17]=y,e[18]=C):C=e[18];const M=C;let _;e[19]!==y?(_=L=>y(L,"resources"),e[19]=y,e[20]=_):_=e[20];const V=_;let E;e[21]!==y?(E=L=>y(L,"prompts"),e[21]=y,e[22]=E):E=e[22];const P=E;if(!i||!m)return null;let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(nt,{}),e[23]=I):I=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=L=>f({type:"SET_ACTIVE_TAB",payload:L}),e[24]=A):A=e[24];let R;e[25]!==m||e[26]!==c.activeTab||e[27]!==d||e[28]!==i||e[29]!==P||e[30]!==V||e[31]!==M||e[32]!==w||e[33]!==N||e[34]!==b?(R=t.jsx(vl,{currentConnection:m,activeTab:c.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:N,togglePrompt:w,toggleAllTools:M,toggleAllResources:V,toggleAllPrompts:P,onTabChange:A},i),e[25]=m,e[26]=c.activeTab,e[27]=d,e[28]=i,e[29]=P,e[30]=V,e[31]=M,e[32]=w,e[33]=N,e[34]=b,e[35]=R):R=e[35];let U;e[36]!==o||e[37]!==i||e[38]!==R?(U=t.jsx(Q.Suspense,{fallback:I,children:t.jsx(jl,{connectionId:i,onAuthenticate:o,children:R})}),e[36]=o,e[37]=i,e[38]=R,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(bl,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let W;e[42]!==U||e[43]!==K?(W=t.jsxs(Ze,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=W):W=e[44];let G;return e[45]!==n||e[46]!==s||e[47]!==W?(G=t.jsx(Je,{open:s,onOpenChange:n,children:W}),e[45]=n,e[46]=s,e[47]=W,e[48]=G):G=e[48],G}const xs="__new_instance__";function Nl(a){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}=a,c=$t(s),{org:f}=Ee();if(!c){let g;return e[0]!==l?(g=t.jsx(_l,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==c?(m=Pi(c),e[2]=c,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Ml,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==s||e[13]!==r||e[14]!==p||e[15]!==i||e[16]!==l||e[17]!==o||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(kl,{connection_id:s,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:f.slug,appName:c.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=s,e[13]=r,e[14]=p,e[15]=i,e[16]=l,e[17]=o,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(Q.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function Cl(a){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:r}=a,o=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const c=Qn(p);if(c.length<=1&&!r)return null;let f;e[2]!==n||e[3]!==r||e[4]!==l?(f=g=>{g===xs?r?.():l(n,g)},e[2]=n,e[3]=r,e[4]=l,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ae,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==c||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=c.map(g),e[7]=n,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==r||e[15]!==o?(h=r&&t.jsxs(we,{value:xs,className:"text-xs text-muted-foreground",children:["+ ",o("virtualMcp.connectionItem.newInstance")]}),e[14]=r,e[15]=o,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs($e,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs(Fe,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function kl({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:r,orgSlug:o,appName:p,usedConnectionIds:c,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=Ls({connectionId:a}),g=Ps(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",b=Z(),S=async N=>{try{await g.update.mutateAsync({id:a,data:{status:N}}),re.success(b(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ge("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(_s,{to:"/$org/settings/connections/$appSlug",params:{org:o,appSlug:r},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(et,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(ni,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Si,{size:16})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(Cl,{appName:p,connectionId:a,usedConnectionIds:c,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(ii,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>S("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ai,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ft,{size:13})})}),t.jsx(Me,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Ml(a){const e=q.c(17),{connection_id:s}=a,n=$t(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(nn,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(et,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let r;e[6]!==n.description?(r=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=r):r=e[7];let o;e[8]!==l||e[9]!==r?(o=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,r]}),e[8]=l,e[9]=r,e[10]=o):o=e[10];let p;e[11]!==i||e[12]!==o?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,o]}),e[11]=i,e[12]=o,e[13]=p):p=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=c):c=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,c]}),e[15]=p,e[16]=f):f=e[16],f}function _l(a){const e=q.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ft,{size:13}),e[6]=o):o=e[6];let p;e[7]!==s||e[8]!==r?(p=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":r,children:o})}),e[7]=s,e[8]=r,e[9]=p):p=e[9];let c;e[10]!==n?(c=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=c):c=e[11];let f;e[12]!==c?(f=t.jsx(Me,{side:"bottom",children:c}),e[12]=c,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Ce,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==l||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function nn(){const a=q.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function an(a){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:r,className:o,avatarClassName:p,showHoverOverlay:c,disabled:f}=a,m=r===void 0?"lg":r,u=c===void 0?!0:c,h=f===void 0?!1:f,d=Z(),[x,g]=Q.useState(!1),[v,y]=Q.useState("icons"),[j,b]=Q.useState(""),[S,N]=Q.useState("blue");let k;e[0]!==s?(k=li(s),e[0]=s,e[1]=k):k=e[1];const w=k,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let M;e[2]!==n||e[3]!==C?(M=D=>{n(wt(D,C))},e[2]=n,e[3]=C,e[4]=M):M=e[4];const _=M;let V;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=D=>{N(D),i?.(D),w.type==="icon"?n(wt(w.name,D)):w.type==="url"&&n(Qt(w.url,D))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const E=V;let P;e[11]!==n||e[12]!==C?(P=D=>{n(Qt(D,C)),g(!1)},e[11]=n,e[12]=C,e[13]=P):P=e[13];const I=P;let A;e[14]!==n||e[15]!==C?(A=()=>{const D=Is(),te=D[Math.floor(Math.random()*D.length)];n(wt(te,C))},e[14]=n,e[15]=C,e[16]=A):A=e[16];const R=A,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const W=h?"cursor-default opacity-50":"cursor-pointer";let G;e[19]!==o||e[20]!==m||e[21]!==W?(G=ge("relative group overflow-hidden",W,ri(m),o),e[19]=o,e[20]=m,e[21]=W,e[22]=G):G=e[22];let L;e[23]!==p||e[24]!==l||e[25]!==m||e[26]!==s?(L=t.jsx(Xt,{icon:s,name:l,size:m,className:p}),e[23]=p,e[24]=l,e[25]=m,e[26]=s,e[27]=L):L=e[27];let Y;e[28]!==h||e[29]!==u?(Y=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ui,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=Y):Y=e[30];let X;e[31]!==h||e[32]!==K||e[33]!==G||e[34]!==L||e[35]!==Y?(X=t.jsx(Ys,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:G,children:[L,Y]})}),e[31]=h,e[32]=K,e[33]=G,e[34]=L,e[35]=Y,e[36]=X):X=e[36];let T;e[37]!==l||e[38]!==s?(T=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Xt,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=T):T=e[39];let z;e[40]!==v?(z=D=>{if(D.key!=="ArrowLeft"&&D.key!=="ArrowRight")return;D.preventDefault();const te=v==="icons"?"upload":"icons";y(te),document.getElementById(`icon-picker-tab-${te}`)?.focus()},e[40]=v,e[41]=z):z=e[41];const B=v==="icons",O=v==="icons"?0:-1;let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=()=>y("icons"),e[42]=$):$=e[42];const J=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ie;e[43]!==J?(ie=ge("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",J),e[43]=J,e[44]=ie):ie=e[44];let de;e[45]!==d?(de=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=de):de=e[46];let ae;e[47]!==B||e[48]!==O||e[49]!==ie||e[50]!==de?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:O,onClick:$,className:ie,children:de}),e[47]=B,e[48]=O,e[49]=ie,e[50]=de,e[51]=ae):ae=e[51];const oe=v==="upload",H=v==="upload"?0:-1;let ce;e[52]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>y("upload"),e[52]=ce):ce=e[52];const me=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==me?(pe=ge("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",me),e[53]=me,e[54]=pe):pe=e[54];let fe;e[55]!==d?(fe=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=fe):fe=e[56];let he;e[57]!==oe||e[58]!==H||e[59]!==pe||e[60]!==fe?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":oe,"aria-controls":"icon-picker-panel-upload",tabIndex:H,onClick:ce,className:pe,children:fe}),e[57]=oe,e[58]=H,e[59]=pe,e[60]=fe,e[61]=he):he=e[61];let ve;e[62]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("div",{className:"flex-1"}),e[62]=ve):ve=e[62];let ue;e[63]!==z||e[64]!==ae||e[65]!==he?(ue=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:z,children:[ae,he,ve]}),e[63]=z,e[64]=ae,e[65]=he,e[66]=ue):ue=e[66];let F;e[67]!==E||e[68]!==R||e[69]!==_||e[70]!==I||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==v?(F=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Pl,{search:j,onSearchChange:b,selectedColor:C,onColorChange:E,onSelectIcon:_,onRandom:R,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Ol,{onUpload:I})}),e[67]=E,e[68]=R,e[69]=_,e[70]=I,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=v,e[76]=F):F=e[76];let se;e[77]!==T||e[78]!==ue||e[79]!==F?(se=t.jsx(Bs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Vl,children:t.jsxs("div",{className:"flex flex-col",children:[T,ue,F]})}),e[77]=T,e[78]=ue,e[79]=F,e[80]=se):se=e[80];let Te;return e[81]!==X||e[82]!==se||e[83]!==U?(Te=t.jsxs(Ws,{open:U,onOpenChange:g,children:[X,se]}),e[81]=X,e[82]=se,e[83]=U,e[84]=Te):Te=e[84],Te}function Vl(a){return a.preventDefault()}function Tl(a){const e=q.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,r]=Q.useState(!1);let o,p,c,f,m,u,h;if(e[0]!==l||e[1]!==s){const S=$s(s);p=Ws,u=l,h=r,o=Ys,m=!0,c="button",f=ge("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=o,e[3]=p,e[4]=c,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else o=e[2],p=e[3],c=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:c,className:f,title:d,"aria-label":x}),e[13]=c,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==o||e[19]!==m||e[20]!==g?(v=t.jsx(o,{asChild:m,children:g}),e[18]=o,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=fi.map(S=>t.jsx("button",{type:"button",onClick:()=>{n(S.name),r(!1)},className:ge("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,s===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Bs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Dl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function Dl(a){return a.preventDefault()}function Pl(a){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:r,onRandom:o,currentIconName:p}=a,c=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==c){const S=Is(),N=$s(i);m=oi(S,s),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Mt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==n?(w=A=>n(A.target.value),e[16]=n,e[17]=w):w=e[17];let C;e[18]!==c?(C=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=C):C=e[19];let M;e[20]!==s||e[21]!==w||e[22]!==C?(M=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(Se,{value:s,onChange:w,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=C,e[23]=M):M=e[23];let _;e[24]!==c?(_=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=_):_=e[25];let V;e[26]!==c?(V=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=V):V=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(mi,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let P;e[29]!==o||e[30]!==_||e[31]!==V?(P=t.jsx(ee,{type:"button",variant:"outline",size:"icon",onClick:o,className:"shrink-0",title:_,"aria-label":V,children:E}),e[29]=o,e[30]=_,e[31]=V,e[32]=P):P=e[32];let I;e[33]!==l||e[34]!==i?(I=t.jsx(Tl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=I):I=e[35],e[36]!==P||e[37]!==I||e[38]!==M?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[M,P,I]}),e[36]=P,e[37]=I,e[38]=M,e[39]=g):g=e[39],f=Oi,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(A=>{const R=ci(A);return R?t.jsx("button",{type:"button",onClick:()=>r(A),className:ge("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===A?ge(N.bg,N.text):ge(N.text,"hover:bg-accent")),title:A,"aria-label":di(A),children:t.jsx(R,{size:18})},A):null}),e[0]=p,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=c,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==c?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=c,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Ol(a){const e=q.c(46),{onUpload:s}=a,n=Z(),i=Q.useRef(null);let l;e[0]!==s||e[1]!==n?(l=P=>{const I=P.target.files?.[0];if(!I)return;if(I.size>2097152){re.error(n("common.iconPicker.imageTooLarge")),P.target.value="";return}const A=new FileReader;A.onerror=()=>{re.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},A.onloadend=()=>{A.readyState===FileReader.DONE&&A.result&&s(A.result),i.current&&(i.current.value="")},A.readAsDataURL(I)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l,[o,p]=Q.useState("");let c;e[3]!==s||e[4]!==o?(c=()=>{const P=o.trim();P&&(s(P),p(""))},e[3]=s,e[4]=o,e[5]=c):c=e[5];const f=c;let m;e[6]!==r?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:r}),e[6]=r,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ai,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=P=>p(P.target.value),e[21]=b):b=e[21];let S;e[22]!==n?(S=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=S):S=e[23];let N;e[24]!==f?(N=P=>{P.key==="Enter"&&(P.preventDefault(),f())},e[24]=f,e[25]=N):N=e[25];let k;e[26]!==o||e[27]!==S||e[28]!==N?(k=t.jsx(Se,{value:o,onChange:b,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=o,e[27]=S,e[28]=N,e[29]=k):k=e[29];let w;e[30]!==o?(w=o.trim(),e[30]=o,e[31]=w):w=e[31];const C=!w;let M;e[32]!==n?(M=n("common.iconPicker.apply"),e[32]=n,e[33]=M):M=e[33];let _;e[34]!==f||e[35]!==C||e[36]!==M?(_=t.jsx(ee,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:M}),e[34]=f,e[35]=C,e[36]=M,e[37]=_):_=e[37];let V;e[38]!==k||e[39]!==_?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,_]}),e[38]=k,e[39]=_,e[40]=V):V=e[40];let E;return e[41]!==j||e[42]!==V||e[43]!==m||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,V]}),e[41]=j,e[42]=V,e[43]=m,e[44]=x,e[45]=E):E=e[45],E}function Al(a){const e=q.c(13),{viewId:s,blocksSite:n}=a,i=n===void 0?!1:n;if(s==="overview"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Fs,{size:16}),e[0]=r):r=e[0],r}if(s==="reports"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Jt,{size:16}),e[1]=r):r=e[1],r}if(s==="board"){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(pi,{size:16}),e[2]=r):r=e[2],r}if(s==="site-editor"){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Fi,{size:16}),e[3]=r):r=e[3],r}if(s==="assets"){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx($i,{size:16}),e[4]=r):r=e[4],r}if(s==="releases"){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(hi,{size:16}),e[5]=r):r=e[5],r}if(s==="hosting"){let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(mn,{size:16}),e[6]=r):r=e[6],r}if(s==="e2e"){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(xi,{size:16}),e[7]=r):r=e[7],r}if(s==="analytics"){let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Jt,{size:16}),e[8]=r):r=e[8],r}if(s==="cdn"){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(gi,{size:16}),e[9]=r):r=e[9],r}if(s==="experiments"&&i){let r;return e[10]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(vi,{size:16}),e[10]=r):r=e[10],r}if(s==="calendar"){let r;return e[11]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(bi,{size:16}),e[11]=r):r=e[11],r}let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Es,{size:16}),e[12]=l):l=e[12],l}function gs(a){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:r}=a,o=Z(),p=s?"text-foreground":"text-muted-foreground/40";let c;e[0]!==p?(c=ge("size-7",p),e[0]=p,e[1]=c):c=e[1];let f;e[2]!==s||e[3]!==o?(f=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=o,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Zt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==s||e[8]!==c||e[9]!==f?(u=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:c,"aria-label":f,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=c,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==o?(h=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=o,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(Me,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Ce,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==o?(g=o("virtualMcp.settings.views.rowActions"),e[19]=o,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ii,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(Cs,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(fn,{size:14}),e[24]=j):j=e[24];let b;e[25]!==o?(b=o("virtualMcp.settings.views.open"),e[25]=o,e[26]=b):b=e[26];let S;e[27]!==i||e[28]!==b?(S=t.jsxs(Qe,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Zt,{size:14}),e[30]=N):N=e[30];let k;e[31]!==s||e[32]!==o?(k=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=o,e[33]=k):k=e[33];let w;e[34]!==l||e[35]!==k?(w=t.jsxs(Qe,{onClick:l,children:[N,k]}),e[34]=l,e[35]=k,e[36]=w):w=e[36];let C;e[37]!==n||e[38]!==r||e[39]!==o?(C=n&&t.jsxs(Qe,{onClick:r,children:[t.jsx(Fs,{size:14}),o("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=r,e[39]=o,e[40]=C):C=e[40];let M;e[41]!==S||e[42]!==w||e[43]!==C?(M=t.jsxs(ks,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=M):M=e[44];let _;e[45]!==y||e[46]!==M?(_=t.jsxs(Ns,{children:[y,M]}),e[45]=y,e[46]=M,e[47]=_):_=e[47];let V;return e[48]!==_||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,_]}),e[48]=_,e[49]=x,e[50]=V):V=e[50],V}const vs=a=>a.stopPropagation();function Il(a){const e=q.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(et,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==i||e[6]!==l?(r=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=r):r=e[7],r}function $l(a){const e=q.c(70),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=r):r=e[5];const o=s.defaultMainView,p=s.setMainView;let c;e[6]!==n?(c=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=c):c=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==c||e[13]!==m?(u=t.jsx(Ae,{"aria-label":c,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=c,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(Fl),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx($e,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs(Fe,{value:o,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==r?(g=t.jsx(st,{title:l,description:r,action:x}),e[24]=x,e[25]=l,e[26]=r,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let S;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(S=t.jsx(ke,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(gt,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==n||e[40]!==s.noMainView?(N=s.noMainView&&t.jsx(Me,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=N):N=e[41];let k;e[42]!==S||e[43]!==N?(k=t.jsxs(Ce,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=k):k=e[44];let w;e[45]!==v||e[46]!==y||e[47]!==k?(w=t.jsx(st,{title:v,description:y,action:k}),e[45]=v,e[46]=y,e[47]=k,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(Re,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let M;e[52]!==i||e[53]!==C?(M=t.jsx(We,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=M):M=e[54];let _;e[55]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=_):_=e[56];let V;e[57]!==s?(V=s.projectViews.map(R=>{const U=s.pinned(R);return t.jsx(st,{icon:t.jsx(Al,{viewId:R,blocksSite:s.blocksSite}),title:s.labels[R],onClick:()=>s.openView(R),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(gs,{pinned:U,canSetMainView:U&&!s.isMainView(R),onOpen:()=>s.openView(R),onTogglePin:()=>s.togglePin(R,!U),onSetMainView:()=>s.setMainView(R)}),t.jsx("span",{onClick:()=>s.openView(R),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Gt,{size:16})})]})},R)}),e[57]=s,e[58]=V):V=e[58];let E;e[59]!==s?(E=s.connectionsData.flatMap(R=>[t.jsx(Il,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(U=>{const K=s.pinnedAppViews.find(Y=>Y.connectionId===R.id&&Y.toolName===U.name),W=!!K,G=pn(R.id,U.name),L=`ext-apps:${R.id}:${U.name}`;return t.jsx(st,{onClick:()=>s.openView(G),icon:W?t.jsx("span",{onClick:vs,children:t.jsx(an,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:Y=>s.setAppViewIcon(R.id,U.name,Y)})}):t.jsx(Es,{size:16}),title:W?t.jsx("span",{onClick:vs,children:t.jsx(Se,{value:K.label,onChange:Y=>s.setAppViewLabel(R.id,U.name,Y.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??_t(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??_t(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(gs,{pinned:W,canSetMainView:W&&!s.isMainView(L),onOpen:()=>s.openView(G),onTogglePin:()=>s.toggleAppViewPin(R.id,U.name),onSetMainView:()=>s.setMainView(L)}),t.jsx("span",{onClick:()=>s.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Gt,{size:16})})]})},`${R.id}:${U.name}`)})]),e[59]=s,e[60]=E):E=e[60];let P;e[61]!==V||e[62]!==E?(P=t.jsxs(Re,{children:[V,E]}),e[61]=V,e[62]=E,e[63]=P):P=e[63];let I;e[64]!==_||e[65]!==P?(I=t.jsx(We,{title:_,children:P}),e[64]=_,e[65]=P,e[66]=I):I=e[66];let A;return e[67]!==M||e[68]!==I?(A=t.jsxs(t.Fragment,{children:[M,I]}),e[67]=M,e[68]=I,e[69]=A):A=e[69],A}function Fl(a){return t.jsx(we,{value:a.value,children:a.label},a.value)}const ln="site-editor",El=new Set([ln,"content"]);function zl({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=Pt(),{openPanel:l}=Li(),r=Os(a),o=Ui(r),p=Gs(a),c=Qi(a),f=(r?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=Vs({queryKey:Ot.projectConnectionDetails(a,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async z=>{try{const{item:B}=await i.call("COLLECTION_CONNECTIONS_GET",{id:z}),O=(B?.tools??[]).flatMap($=>{const J=Ei($._meta);return J?[{name:$.name,title:$.title,description:$.description,resourceUri:J}]:[]});return{fetchOk:!0,id:z,title:B?.title??z,icon:B?.icon??null,uiTools:O}}catch{return{fetchOk:!1,id:z,title:z,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),h=new Set([...hn,...xn]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=o.presence.calendar,j=e.watch("metadata.sidebarViewsSeen"),b=Vt(Tt({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion"),ss(j,y)),S=c??(r?Vt(Tt(r.metadata),r.metadata.sidebarViewsVersion,ss(r.metadata.sidebarViewsSeen,y)):b),N=(()=>{if(!g||g.type==="chat")return"";const T=gn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":El.has(T)?ln:h.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),k=N==="",w=T=>{const[z,B,O]=T.split(":");return z?h.has(z)?{type:z}:z==="ext-apps"&&B?{type:"ext-apps",id:B,toolName:O||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},M=T=>{e.setValue("metadata.ui.layout",{...x,...T},{shouldDirty:!0})},_=Q.useRef(!1);if(m&&m.length>0&&!_.current){_.current=!0;const T=new Set((m??[]).filter($=>$.fetchOk).map($=>$.id)),z=new Set(u.flatMap($=>$.uiTools.map(J=>`${$.id}:${J.name}`))),B=new Set(f),O=d.filter($=>B.has($.connectionId)&&(!T.has($.connectionId)||z.has(`${$.connectionId}:${$.toolName}`)));O.length!==d.length&&(C(O),g?.type==="ext-apps"&&!O.some($=>$.connectionId===g.id&&$.toolName===g.toolName)&&M({defaultMainView:{type:"settings"}}))}const V=(T,z)=>{if(d.some(O=>O.connectionId===T&&O.toolName===z)){const O=d.filter(J=>!(J.connectionId===T&&J.toolName===z));C(O);const $=`ext-apps:${T}:${z}`;N===$&&M({defaultMainView:{type:"settings"}})}else{const O=u.find($=>$.id===T)?.uiTools.find($=>$.name===z)?.title;C([...d,{connectionId:T,toolName:z,label:O??_t(z),icon:null}])}s()},E=(T,z,B)=>{C(d.map(O=>O.connectionId===T&&O.toolName===z?{...O,label:B}:O))},P=()=>{s()},I=(T,z,B)=>{C(d.map(O=>O.connectionId===T&&O.toolName===z?{...O,icon:B}:O)),s()},A=T=>{M({defaultMainView:w(T)}),s()},R=(T,z)=>{const B=Ki(S,T,z,1);e.setValue("metadata.sidebarViews",B,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),y&&e.setValue("metadata.sidebarViewsSeen",Gi(r?.metadata.sidebarViewsSeen??j,y),{shouldDirty:!0}),p.stage(B,S);const O=qi(g,T,z);O!==g&&M({defaultMainView:O})},U=Ks(r?.metadata),K=Yi(U,o.presence),W=Bi(K),G=Wi(S,K,1),L={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title"),calendar:n("common.mainPanelTabs.calendar")},Y=[];for(const T of G)T!=="automations"&&Y.push({value:T,label:L[T]});for(const T of d)Y.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return G.includes("automations")&&Y.push({value:"automations",label:L.automations}),Y.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:W,blocksSite:y,labels:L,pinned:T=>S.includes(T),isMainView:T=>N===T,defaultMainView:N,defaultMainOptions:Y,noMainView:k,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:T=>l(T,{virtualmcpid:a}),togglePin:(T,z)=>R(T,z),setMainView:A,setChatDefaultOpen:T=>{M({chatDefaultOpen:T}),s()},toggleAppViewPin:V,setAppViewIcon:I,setAppViewLabel:E,commitAppViewLabel:P}}function Rl(a){const e=q.c(55),{form:s,onCommit:n}=a,i=Z(),l=Q.useId();let r;e[0]!==i?(r=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let c;e[6]!==p?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=c):c=e[7];let f;e[8]!==o||e[9]!==c?(f=t.jsxs("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=_=>{const{field:V}=_;return t.jsx("div",{className:"justify-self-start",children:t.jsx(an,{value:V.value??null,onChange:E=>{V.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=_=>{const{field:V}=_;return t.jsx(Se,{...V,id:`${l}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const b=`${l}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:S}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let k;e[41]!==l||e[42]!==n||e[43]!==i?(k=_=>{const{field:V}=_;return t.jsx(mt,{...V,id:`${l}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==s.control||e[46]!==k?(w=t.jsx(be,{name:"description",control:s.control,render:k}),e[45]=s.control,e[46]=k,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let M;return e[51]!==j||e[52]!==C||e[53]!==h?(M=t.jsxs(Re,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=M):M=e[54],M}function Ll(a){const e=q.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=ta.map(o=>{const{titleKey:p}=sa[o];return t.jsx(Ye.Tab,{active:s===o,asChild:!0,children:t.jsx(_s,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:o==="general"?void 0:o}),children:n(p)})},o)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let r;if(e[5]!==i||e[6]!==l){const o=t.jsx(Ye.Tabs,{"aria-label":i,children:l});r=t.jsx(vn.Toolbar.Left.Portal,{fallback:o,children:o}),e[5]=i,e[6]=l,e[7]=r}else r=e[7];return r}function Ul(){const a=q.c(8),e=At();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=bn(s);let i;a[1]!==n?(i=na(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=o=>e({to:".",search:p=>({...p,section:o??void 0})}),a[3]=e,a[4]=l):l=a[4];let r;return a[5]!==i||a[6]!==l?(r={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=r):r=a[7],r}function rn(a){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:r,className:o,copiedClassName:p}=a,c=l===void 0?"ghost":l,f=r===void 0?"icon-sm":r,{handleCopy:m,copied:u}=aa();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Yl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==o||e[4]!==d?(x=ge(o,d),e[3]=o,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(ot,{className:"text-success"}):t.jsx(vt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==c?(v=t.jsx(ee,{type:"button",variant:c,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=c,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function Yl(){}function Bl(a){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:r}=a;let o;e[0]!==r?(o=ge("relative h-fit",r),e[0]=r,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(Se,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=ge("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i||e[8]!==n?(f=t.jsx(rn,{value:n,label:i,copiedLabel:l,className:c,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:o,children:[p,f]}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function bs(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function Wl(a){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=a,i=Z(),l=Ts(),r=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let o;e[0]!==s||e[1]!==n?(o=Ot.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=o):o=e[2];const p=o,[c,f]=Q.useState(null),m=Q.useId();let u;e[3]!==r?(u=async()=>bs(await fetch(r)),e[3]=r,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Vs(h);let x;e[8]!==r?(x=async()=>bs(await fetch(r,{method:"POST"})),e[8]=r,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=ue=>{const{token:F}=ue;return f(F)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==l?(v=()=>l.invalidateQueries({queryKey:p}),e[11]=p,e[12]=l,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Kl,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=jn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const S=b,N=d.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let M;e[25]!==m||e[26]!==C?(M=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=M):M=e[27];let _;e[28]!==i?(_=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=_):_=e[29];let V;e[30]!==_?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:_}),e[30]=_,e[31]=V):V=e[31];let E;e[32]!==N||e[33]!==m||e[34]!==i?(E=N?t.jsx(Bl,{id:m,value:N,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=N,e[33]=m,e[34]=i,e[35]=E):E=e[35];const P=!d.data||j.isPending;let I;e[36]!==j?(I=()=>j.mutate(),e[36]=j,e[37]=I):I=e[37];let A;e[38]!==j.isPending?(A=j.isPending?t.jsx(at,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=A):A=e[39];let R;e[40]!==i?(R=i("siteTokens.issue"),e[40]=i,e[41]=R):R=e[41];let U;e[42]!==P||e[43]!==I||e[44]!==A||e[45]!==R?(U=t.jsxs(ee,{type:"button",size:"sm",className:"shrink-0",disabled:P,onClick:I,children:[A,R]}),e[42]=P,e[43]=I,e[44]=A,e[45]=R,e[46]=U):U=e[46];let K;e[47]!==E||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[E,U]}),e[47]=E,e[48]=U,e[49]=K):K=e[49];let W;e[50]!==M||e[51]!==V||e[52]!==K?(W=t.jsxs(je,{className:"group",children:[M,V,K]}),e[50]=M,e[51]=V,e[52]=K,e[53]=W):W=e[53];let G;e[54]!==d.error||e[55]!==d.isError?(G=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=G):G=e[56];let L;if(e[57]!==i||e[58]!==S){let ue;e[60]!==i?(ue=F=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Et,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:F.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:ia(new Date(F.iat*1e3))})})]})]})},F.kid),e[60]=i,e[61]=ue):ue=e[61],L=S.map(ue),e[57]=i,e[58]=S,e[59]=L}else L=e[59];let Y;e[62]!==W||e[63]!==G||e[64]!==L?(Y=t.jsxs(Re,{children:[W,G,L]}),e[62]=W,e[63]=G,e[64]=L,e[65]=Y):Y=e[65];const X=c!==null;let T;e[66]===Symbol.for("react.memo_cache_sentinel")?(T=ue=>!ue&&f(null),e[66]=T):T=e[66];let z;e[67]!==i?(z=i("siteTokens.createdTitle"),e[67]=i,e[68]=z):z=e[68];let B;e[69]!==z?(B=t.jsx(rt,{children:z}),e[69]=z,e[70]=B):B=e[70];let O;e[71]!==i?(O=i("siteTokens.createdDescription"),e[71]=i,e[72]=O):O=e[72];let $;e[73]!==O?($=t.jsx(Ds,{children:O}),e[73]=O,e[74]=$):$=e[74];let J;e[75]!==B||e[76]!==$?(J=t.jsxs(lt,{children:[B,$]}),e[75]=B,e[76]=$,e[77]=J):J=e[77];let ie;e[78]!==i?(ie=i("siteTokens.createdTitle"),e[78]=i,e[79]=ie):ie=e[79];const de=c??"";let ae;e[80]!==ie||e[81]!==de?(ae=t.jsx(Se,{readOnly:!0,"aria-label":ie,value:de,className:"font-mono text-xs"}),e[80]=ie,e[81]=de,e[82]=ae):ae=e[82];let oe;e[83]!==c||e[84]!==i?(oe=c?t.jsx(rn,{value:c,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=c,e[84]=i,e[85]=oe):oe=e[85];let H;e[86]!==ae||e[87]!==oe?(H=t.jsxs("div",{className:"flex items-center gap-2",children:[ae,oe]}),e[86]=ae,e[87]=oe,e[88]=H):H=e[88];let ce;e[89]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>f(null),e[89]=ce):ce=e[89];let me;e[90]!==i?(me=i("siteTokens.done"),e[90]=i,e[91]=me):me=e[91];let pe;e[92]!==me?(pe=t.jsx(Dt,{children:t.jsx(ee,{onClick:ce,children:me})}),e[92]=me,e[93]=pe):pe=e[93];let fe;e[94]!==J||e[95]!==H||e[96]!==pe?(fe=t.jsxs(Ze,{className:"sm:max-w-lg",children:[J,H,pe]}),e[94]=J,e[95]=H,e[96]=pe,e[97]=fe):fe=e[97];let he;e[98]!==X||e[99]!==fe?(he=t.jsx(Je,{open:X,onOpenChange:T,children:fe}),e[98]=X,e[99]=fe,e[100]=he):he=e[100];let ve;return e[101]!==w||e[102]!==Y||e[103]!==he||e[104]!==k?(ve=t.jsxs(We,{title:k,description:w,children:[Y,he]}),e[101]=w,e[102]=Y,e[103]=he,e[104]=k,e[105]=ve):ve=e[105],ve}function Kl(a){return re.error(a.message)}function Gl(a){const e=q.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=qs(n),e[0]=n,e[1]=l):l=e[1];const r=!!l;let o;e[2]!==r||e[3]!==i?(o=c=>{const{field:f}=c;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(r?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(gt,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&r,disabled:!r,onCheckedChange:m=>f.onChange(m)})]})},e[2]=r,e[3]=i,e[4]=o):o=e[4];let p;return e[5]!==s||e[6]!==o?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:o}),e[5]=s,e[6]=o,e[7]=p):p=e[7],p}function ql(a){const e=q.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(gt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:c=>p.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==l?(r=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=r):r=e[4],r}function Hl(a){const e=q.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let r;e[0]!==l?(r=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx(ye,{htmlFor:"preview-server-url",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==l?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(Se,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(la(g)),x.onBlur()}})},e[4]=l,e[5]=p):p=e[5];let c;e[6]!==s||e[7]!==p?(c=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=c):c=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==f?(m=l(f),e[9]=l,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==o||e[15]!==c||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[o,c,u]}),e[14]=o,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function Ql(a){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,r=Z(),o=n||!!l;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Hl,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let c;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r?(c=n?!qs(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Gl,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7];let f;e[8]!==s||e[9]!==o?(f=o&&t.jsx(je,{children:t.jsx(ql,{control:s,fastPreview:o})}),e[8]=s,e[9]=o,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==c||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,c,f]}),e[11]=p,e[12]=c,e[13]=f,e[14]=m):m=e[14],m}const Ct={tools:null,resources:null,prompts:null},Xl=oa.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Jl(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function on(a){return{"x-studio-client":a,"x-mesh-client":a}}function Zl(a){const e=q.c(15),{url:s,agentId:n}=a,i=Z(),[l,r]=Q.useState(!1);let o;e[0]!==n||e[1]!==i||e[2]!==s?(o=async()=>{Ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),r(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await jt(2e3),r(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3];const p=o;let c;e[4]!==l?(c=l?t.jsx(ot,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i?(f=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==c||e[13]!==m?(u=t.jsxs(ee,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,m]}),e[11]=p,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function er(a){const e=q.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let r;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(r=()=>{Ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Qs(n),h={type:"http",url:s,headers:on("Cursor")},d=Jl(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),re.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=r):r=e[4];const o=r;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=p):p=e[5];let c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let f;e[8]!==c?(f=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==f?(m=t.jsxs(ee,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=o,e[11]=f,e[12]=m):m=e[12],m}function tr(a){const e=q.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[r,o]=Q.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(p=async()=>{Ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Qs(n),x={type:"http",url:s,headers:on("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),o(!0),re.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await jt(2e3),o(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=p):p=e[4];const c=p;let f;e[5]!==r?(f=r?t.jsx(ot,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==r||e[8]!==l?(m=l(r?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=r,e[8]=l,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==c||e[13]!==f||e[14]!==u?(h=t.jsxs(ee,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=c,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const sr=720*60*60;function nr({virtualMcp:a}){const e=Z(),s=Pt(),[n,i]=Q.useState(null),[l,r]=Q.useState(!1),[o,p]=Q.useState(!1),c=a.id,f=a.title||`agent-${c.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{r(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[c]:["*"]},expiresIn:sr});if(!d)throw new Error("No key in response");i(d),Ve("agent_typegen_key_generated",{agent_id:c})}catch{Ve("agent_typegen_key_failed",{agent_id:c}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{r(!1)}},h=async()=>{Ve("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await jt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(at,{className:"size-3.5"}):t.jsx(Et,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:o?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(ir,{apiKey:n,agentId:c})]})}function ir(a){const e=q.c(21),{apiKey:s,agentId:n}=a,[i,l]=Q.useState(!1),r=window.location.origin,o=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${r}`,c=`${o}
2
+ ${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==c?(f=async()=>{Ve("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(c),l(!0),await jt(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=c,e[3]=f):f=e[3];const m=f,u=!s;let h;e[4]!==u?(h=ge({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let d;e[6]!==o||e[7]!==h?(d=t.jsx("span",{className:h,children:o}),e[6]=o,e[7]=h,e[8]=d):d=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:p}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==d?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[d,x,g]}),e[11]=d,e[12]=v):v=e[12];let y;e[13]!==i?(y=i?t.jsx(ot,{size:12,className:"text-success"}):t.jsx(vt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let b;return e[18]!==v||e[19]!==j?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,j]})}),e[18]=v,e[19]=j,e[20]=b):b=e[20],b}function ar(a){const e=q.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(Q.Suspense,{fallback:n,children:t.jsx(nr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function lr(a){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:r}=Ee(),o=`/api/${r.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==o?(p=new URL(o,window.location.origin),e[0]=o,e[1]=p):p=e[1];const c=p;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=pa();let h;e[5]!==i.id||e[6]!==c.href?(h=t.jsx(Zl,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==c.href?(d=t.jsx(er,{url:c.href,serverName:m,agentId:i.id}),x=t.jsx(tr,{url:c.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=c.href,e[11]=d,e[12]=x):(d=e[11],x=e[12]);let g;e[13]!==h||e[14]!==d||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,d,x]})}),e[13]=h,e[14]=d,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let y;e[18]!==i?(y=t.jsx(ar,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const b=j;if(u){let C;e[23]!==l?(C=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=C):C=e[24];let M;e[25]!==C?(M=t.jsx(ua,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=M):M=e[26];let _;e[27]!==b||e[28]!==M?(_=t.jsx(ma,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[M,b]})}),e[27]=b,e[28]=M,e[29]=_):_=e[29];let V;return e[30]!==n||e[31]!==s||e[32]!==_?(V=t.jsx(fa,{open:s,onOpenChange:n,children:_}),e[30]=n,e[31]=s,e[32]=_,e[33]=V):V=e[33],V}let S;e[34]!==l?(S=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=S):S=e[35];let N;e[36]!==S?(N=t.jsx(lt,{children:t.jsx(rt,{children:S})}),e[36]=S,e[37]=N):N=e[37];let k;e[38]!==b||e[39]!==N?(k=t.jsxs(Ze,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[N,b]}),e[38]=b,e[39]=N,e[40]=k):k=e[40];let w;return e[41]!==n||e[42]!==s||e[43]!==k?(w=t.jsx(Je,{open:s,onOpenChange:n,children:k}),e[41]=n,e[42]=s,e[43]=k,e[44]=w):w=e[44],w}const rr=/^[A-Za-z_][A-Za-z0-9_]*$/;function or(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const r=i.slice(0,l).trim();if(!rr.test(r))throw new Error(`Line ${n+1}: invalid key "${r}"`);let o=i.slice(l+1).trim();o.length>=2&&(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),e[r]=o}return e}function cr(a){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z();let p;e[0]!==o?(p=o("sandbox.envVarsField.title"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:p})}),e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("sandbox.envVarsField.description"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==r||e[12]!==i?(u=t.jsx(dr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}),e[8]=s,e[9]=n,e[10]=l,e[11]=r,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==o?(h=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??o("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=o,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(yn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(Q.Suspense,{fallback:d,children:t.jsx(mr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Be,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==c||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[c,m,u,g]}),e[23]=c,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function dr(a){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z(),c=wn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(js(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=Q.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=It(d);let g;e[4]!==x?(g=JSON.stringify(js(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==r||e[7]!==c?(j=c?Object.keys(r?.[c]??{}):[],e[6]=r,e[7]=c,e[8]=j):j=e[8];const b=j,S=b.length>0,[N,k]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==v||e[10]!==l||e[11]!==o||e[12]!==b||e[13]!==i?(w=async()=>{k(!0);const R=await Promise.allSettled(b.map(async K=>{const W=ha({orgSlug:l,virtualMcpId:i,branch:K,threadId:null},"setup/start"),G=await fetch(W,{method:"POST"});if(!G.ok){const L=await G.text().catch(()=>G.statusText);throw new Error(L||G.statusText)}}));k(!1);const U=R.filter(ur).length;U===0?(h(v),re.success(b.length===1?o("sandbox.envVarsField.restartedSingle"):o("sandbox.envVarsField.restartedMultiple",{count:b.length}))):re.error(o("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=l,e[11]=o,e[12]=b,e[13]=i,e[14]=w):w=e[14];const C=w;let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ms,{className:"size-3.5 shrink-0"}),e[15]=M):M=e[15];let _;e[16]!==o?(_=o("sandbox.envVarsField.sandboxRunningNotice"),e[16]=o,e[17]=_):_=e[17];let V;e[18]!==_?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[M,t.jsx("span",{className:"truncate",children:_})]}),e[18]=_,e[19]=V):V=e[19];let E;e[20]!==N?(E=N?t.jsx(at,{className:"size-3.5"}):t.jsx(Nn,{className:"size-3.5"}),e[20]=N,e[21]=E):E=e[21];let P;e[22]!==N||e[23]!==o?(P=o(N?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=N,e[23]=o,e[24]=P):P=e[24];let I;e[25]!==C||e[26]!==N||e[27]!==P||e[28]!==E?(I=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:N,className:"shrink-0",children:[E,P]}),e[25]=C,e[26]=N,e[27]=P,e[28]=E,e[29]=I):I=e[29];let A;return e[30]!==I||e[31]!==V?(A=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,I]}),e[30]=I,e[31]=V,e[32]=A):A=e[32],A}function ur(a){return a.status==="rejected"}function mr(a){const e=q.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let r;e[0]!==s?(r={control:s,name:l},e[0]=s,e[1]=r):r=e[1];const o=Sn(r),{fields:p,append:c,remove:f}=o;let m;e[2]!==n?(m=(W,G)=>{n.setValue(`${l}.${W}`,G,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=ba();let d;if(e[4]!==h){d=new Map;for(const W of h)d.set(W.id,W);e[4]=h,e[5]=d}else d=e[5];const[x,g]=Q.useState(null);let v;e[6]!==c?(v=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=v):v=e[7];const y=v;let j;e[8]!==c||e[9]!==n||e[10]!==i?(j=async()=>{let W;try{W=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!W.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let G;try{G=or(W)}catch(B){const O=B;re.error(O.message);return}const L=Object.entries(G);if(L.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const Y=n.getValues(l)??[],X=new Set;for(const B of Y){const O=(B.key??"").trim();O&&X.add(O)}let T=0,z=0;for(const[B,O]of L){if(X.has(B)){z++;continue}c({key:B,kind:"literal",value:O}),X.add(B),T++}T===0&&z>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:z})):re.success(z>0?i("sandbox.envVarsField.addedWithSkipped",{added:T,skipped:z}):i("sandbox.envVarsField.added",{added:T}))},e[8]=c,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let S;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let W;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(W=(G,L)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(fr,{index:L,control:s,form:n,onUpdateEntry:u,fieldPath:l,secrets:h,secretById:d,onSaveAsSecret:(Y,X)=>g({kind:"save-literal",index:L,presetKey:Y,presetValue:X}),onCreateNewSecret:Y=>g({kind:"create-new",index:L,presetKey:Y}),onRemove:()=>f(L)})},G.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=W):W=e[26],S=p.map(W),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=S}else S=e[19];let N;e[27]!==S?(N=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=N):N=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"size-3.5"}),e[29]=k):k=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let C;e[32]!==y||e[33]!==w?(C=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[k,w]}),e[32]=y,e[33]=w,e[34]=C):C=e[34];let M;e[35]!==i?(M=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=M):M=e[36];let _;e[37]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ji,{className:"size-3.5"}),e[37]=_):_=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let E;e[40]!==b||e[41]!==M||e[42]!==V?(E=t.jsx(ke,{asChild:!0,children:t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":M,children:[_,V]})}),e[40]=b,e[41]=M,e[42]=V,e[43]=E):E=e[43];let P;e[44]!==i?(P=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=P):P=e[45];let I;e[46]!==P?(I=t.jsx(Me,{children:P}),e[46]=P,e[47]=I):I=e[47];let A;e[48]!==E||e[49]!==I?(A=t.jsxs(Ce,{children:[E,I]}),e[48]=E,e[49]=I,e[50]=A):A=e[50];let R;e[51]!==A||e[52]!==C?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[C,A]}),e[51]=A,e[52]=C,e[53]=R):R=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(hr,{mode:x,onClose:()=>g(null),onSaved:W=>{const G=n.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:G,kind:"secret",secretId:W}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==R||e[59]!==U||e[60]!==N?(K=t.jsxs("div",{className:"space-y-2",children:[N,R,U]}),e[58]=R,e[59]=U,e[60]=N,e[61]=K):K=e[61],K}function fr(a){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:r,secrets:o,secretById:p,onSaveAsSecret:c,onCreateNewSecret:f,onRemove:m}=a,u=Z(),h=`${r}.${s}.key`,d=`${r}.${s}.value`,x=`${r}.${s}.secretId`,g=`${r}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const j=It(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==c||e[7]!==l||e[8]!==d?(b=O=>{const $=i.getValues(h)?.trim()??"";if(O==="literal"){l(s,{key:$,kind:"literal",value:""});return}const J=i.getValues(d)??"";if(J.length>0){c($,J);return}l(s,{key:$,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=c,e[7]=l,e[8]=d,e[9]=b):b=e[9];const S=b;let N;e[10]!==s||e[11]!==u?(N=O=>{const{field:$}=O,J=($.value??"").trim(),ie=J.length>0&&!bt.test(J);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Se,{...$,value:$.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ge("font-mono",ie&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ie,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:de=>{const ae=de.target.value.trim();$.onChange(ae),$.onBlur()}}),ie?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=N):N=e[12];let k;e[13]!==n||e[14]!==h||e[15]!==N?(k=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:N})}),e[13]=n,e[14]=h,e[15]=N,e[16]=k):k=e[16];let w;e[17]!==S?(w=O=>S(O),e[17]=S,e[18]=w):w=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ae,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=C):C=e[19];let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Et,{className:"size-3.5"}),e[20]=M):M=e[20];let _;e[21]!==u?(_=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=_):_=e[22];let V;e[23]!==_?(V=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[M,_]})}),e[23]=_,e[24]=V):V=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Cn,{className:"size-3.5"}),e[25]=E):E=e[25];let P;e[26]!==u?(P=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=P):P=e[27];let I;e[28]!==P?(I=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,P]})}),e[28]=P,e[29]=I):I=e[29];let A;e[30]!==I||e[31]!==V?(A=t.jsxs($e,{children:[V,I]}),e[30]=I,e[31]=V,e[32]=A):A=e[32];let R;e[33]!==j||e[34]!==A||e[35]!==w?(R=t.jsx("div",{className:"shrink-0",children:t.jsxs(Fe,{value:j,onValueChange:w,children:[C,A]})}),e[33]=j,e[34]=A,e[35]=w,e[36]=R):R=e[36];let U;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==j||e[42]!==f||e[43]!==p||e[44]!==x||e[45]!==o||e[46]!==u||e[47]!==d?(U=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(be,{control:n,name:d,render:O=>{const{field:$}=O;return t.jsx(Se,{...$,value:$.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:J=>{$.onChange(J.target.value),$.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:O=>{const{field:$}=O;return t.jsxs(Fe,{value:$.value||"",onValueChange:J=>$.onChange(J),children:[t.jsx(Ae,{className:ge("h-9 w-full",!$.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Ie,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(xa,{field:$,secretById:p})})}),t.jsx($e,{children:o.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):o.map(pr)})]})}}),t.jsxs(Ce,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"";f(O)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(Me,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=j,e[42]=f,e[43]=p,e[44]=x,e[45]=o,e[46]=u,e[47]=d,e[48]=U):U=e[48];let K;e[49]!==i||e[50]!==h||e[51]!==j||e[52]!==c||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Ce,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const O=i.getValues(h)?.trim()??"",$=i.getValues(d)??"";c(O,$)},children:t.jsx(yi,{className:"size-3.5"})})}),t.jsx(Me,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=c,e[53]=u,e[54]=d,e[55]=K):K=e[55];let W;e[56]!==u?(W=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=W):W=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ht,{className:"size-3.5"}),e[58]=G):G=e[58];let L;e[59]!==m||e[60]!==W?(L=t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":W,onClick:m,children:G})}),e[59]=m,e[60]=W,e[61]=L):L=e[61];let Y;e[62]!==u?(Y=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=Y):Y=e[63];let X;e[64]!==Y?(X=t.jsx(Me,{children:Y}),e[64]=Y,e[65]=X):X=e[65];let T;e[66]!==L||e[67]!==X?(T=t.jsxs(Ce,{children:[L,X]}),e[66]=L,e[67]=X,e[68]=T):T=e[68];let z;e[69]!==K||e[70]!==T?(z=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,T]}),e[69]=K,e[70]=T,e[71]=z):z=e[71];let B;return e[72]!==R||e[73]!==U||e[74]!==z||e[75]!==k?(B=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[k,R,U,z]}),e[72]=R,e[73]=U,e[74]=z,e[75]=k,e[76]=B):B=e[76],B}function pr(a){return t.jsx(we,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(va,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function hr({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[r,o]=Q.useState(()=>xr(l)),[p,c]=Q.useState("organization"),[f,m]=Q.useState(i),[u,h]=Q.useState(""),d=ja(),x=r.trim(),g=f.length>0&&x.length>0&&ga.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const S=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});re.success(n("sandbox.envVarsField.secretSaved",{name:S.name})),s(S.id)}catch(S){re.error(S instanceof Error?S.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Je,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(Ze,{className:"sm:max-w-md",children:[t.jsxs(lt,{children:[t.jsx(rt,{children:y}),t.jsx(Ds,{children:j})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(Fe,{value:p,onValueChange:b=>c(b),children:[t.jsx(Ae,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs($e,{children:[t.jsx(we,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(we,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Se,{id:"save-secret-name",value:r,onChange:b=>o(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Se,{id:"save-secret-value",type:"password",value:f,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(mt,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Dt,{children:[t.jsx(ee,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(ee,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function js(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!bt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function xr(a){const e=a.trim();return e&&bt.test(e)?e:""}function gr(a){const e=q.c(21),{repo:s,className:n}=a,i=Z();let l;e[0]!==n?(l=ge("space-y-2",n),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.repoRow.label"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==r?(o=t.jsx(ye,{children:r}),e[4]=r,e[5]=o):o=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ya,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let c;e[7]!==s||e[8]!==i?(c=t.jsx(ke,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[p,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=c):c=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Me,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==c||e[15]!==m?(u=t.jsxs(Ce,{children:[c,m]}),e[14]=c,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==l||e[18]!==o||e[19]!==u?(h=t.jsxs("div",{className:l,children:[o,u]}),e[17]=l,e[18]=o,e[19]=u,e[20]=h):h=e[20],h}const vr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function br(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const jr=Object.keys(vr),kt="__none__";function yr(a){const e=q.c(47),{control:s}=a,n=Z(),i=Q.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==l?(r=t.jsx(ye,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=r):r=e[3];let o;e[4]!==n?(o=w=>{const{field:C}=w;return t.jsxs(Fe,{value:C.value??kt,onValueChange:M=>C.onChange(M===kt?null:M),children:[t.jsx(Ae,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs($e,{children:[t.jsx(we,{value:kt,children:n("sandbox.runtimeFields.autoDetect")}),jr.map(Sr)]})]})},e[4]=n,e[5]=o):o=e[5];let p;e[6]!==s||e[7]!==o?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:o}),e[6]=s,e[7]=o,e[8]=p):p=e[8];let c;e[9]!==r||e[10]!==p?(c=t.jsxs("div",{className:"space-y-2",children:[r,p]}),e[9]=r,e[10]=p,e[11]=c):c=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(ye,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(be,{control:s,name:"metadata.runtime.path",render:wr}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let d;e[20]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=d):d=e[21];let x;e[22]!==d||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,d]}),e[22]=d,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let y;e[30]!==n?(y=w=>{const{field:C}=w;return t.jsx(Se,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:M=>{const _=br(M.target.value);_.ok?C.onChange(_.value):i.current&&(i.current.value=C.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(be,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let S;e[37]!==b?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=S):S=e[38];let N;e[39]!==v||e[40]!==j||e[41]!==S?(N=t.jsxs("div",{className:"space-y-2",children:[v,j,S]}),e[39]=v,e[40]=j,e[41]=S,e[42]=N):N=e[42];let k;return e[43]!==x||e[44]!==N||e[45]!==c?(k=t.jsxs("div",{className:"space-y-5",children:[c,x,N]}),e[43]=x,e[44]=N,e[45]=c,e[46]=k):k=e[46],k}function wr(a){const{field:e}=a;return t.jsx(Se,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Sr(a){return t.jsx(we,{value:a,children:a},a)}function Nr(a){const e=q.c(10),{control:s}=a,n=Z(),[i,l]=Q.useState(null),[r,o]=Q.useState(null),p=It({control:s,name:"metadata.runtime.path"})??"";let c;e[0]!==p?(c=rs(p),e[0]=p,e[1]=c):c=e[1];const f=c;let m;e[2]!==i||e[3]!==r||e[4]!==f||e[5]!==n?(m=h=>{const{field:d}=h,x=d.value??[],g=y=>d.onChange(y.length?y:null),v=()=>{if(i===null)return;const y=rs(i);if(!y){l(null),o(null);return}if(y===f||x.some(j=>j.path===y)){o(n("sandbox.runtimeApps.duplicate"));return}g([...x,{path:y}]),l(null),o(null)};return t.jsxs("div",{className:"space-y-2",children:[t.jsx(ye,{htmlFor:"runtime-apps-draft",children:n("sandbox.runtimeApps.title")}),x.length>0&&t.jsx("ul",{className:"space-y-1.5",children:x.map(y=>t.jsxs("li",{className:"flex h-9 items-center gap-2 rounded-md border border-border px-3",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:y.path}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":n("sandbox.runtimeApps.remove",{path:y.path}),onClick:()=>g(x.filter(j=>j.path!==y.path)),children:t.jsx(ht,{})})]},y.path))}),i!==null?t.jsx(Se,{id:"runtime-apps-draft",autoFocus:!0,placeholder:"apps/checkout",value:i,"aria-invalid":!!r,onChange:y=>{l(y.target.value),o(null)},onBlur:v,onKeyDown:y=>{y.key==="Enter"?(y.preventDefault(),v()):y.key==="Escape"&&(l(null),o(null))}}):x.length<as&&t.jsxs(ee,{id:"runtime-apps-draft",type:"button",variant:"outline",size:"sm",onClick:()=>l(""),children:[t.jsx(Pe,{}),n("sandbox.runtimeApps.add")]}),r?t.jsx("p",{className:"text-xs text-destructive",children:r}):t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.runtimeApps.description",{max:String(as)})})]})},e[2]=i,e[3]=r,e[4]=f,e[5]=n,e[6]=m):m=e[6];let u;return e[7]!==s||e[8]!==m?(u=t.jsx(be,{control:s,name:"metadata.runtime.apps",render:m}),e[7]=s,e[8]=m,e[9]=u):u=e[9],u}function Cr(a){const e=q.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=r=>{const{field:o}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(gt,{id:"field-description-tooltips",className:"shrink-0",checked:o.value??!1,onCheckedChange:p=>o.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function kr(a){const e=q.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"smart",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"code-review",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let d;e[21]!==o||e[22]!==f||e[23]!==h?(d=[o,f,h],e[21]=o,e[22]=f,e[23]=h,e[24]=d):d=e[24];const x=d;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,b=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(Fe,{value:b,onValueChange:S=>{j.onChange(S),n()},children:[t.jsx(Ae,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx($e,{className:"max-w-80",children:x.map(Mr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function Mr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function _r(a){const e=q.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"off",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"on",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=[o,f],e[14]=o,e[15]=f,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,y=Hs(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(Fe,{value:y,onValueChange:j=>{const b=ca.safeParse(j);b.success&&(g.onChange(da(v,b.data)),n())},children:[t.jsx(Ae,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx($e,{className:"max-w-80",children:u.map(Vr)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let d;return e[21]!==s||e[22]!==h?(d=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=d):d=e[23],d}function Vr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function ys(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Vt(Tt(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function ws(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Tr(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Dr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Pr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!bt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function Or(a,e){const s=a?.idToken??null;if(s){const i=Ss(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),r=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(r)return r}}catch{}return Ss(e)}function Ss(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Ar({virtualMcp:a,contextSection:e}){const s=Z(),n=zn(),{org:i}=Ee(),l=Jn(),{data:r}=Zn([a.id]),o=r?.get(a.id)?.last_used_at,p=Ps(),c=Ts(),f=Pt(),m=Gs(a.id),u=JSON.stringify([i.id,a.id]),h=Xi(a.metadata,m.snapshot()),d=kn({resolver:Mn(Xl),defaultValues:{...a,metadata:{...ls(a.metadata),previewServerUrl:ra(a.metadata),...h}}}),x=d.watch("connections"),g=wa("multi_app_preview"),v=zi(a),y=Ks(a?.metadata),j=y&&Hs(d.watch("metadata.ui.layout"))==="off",b=As(a),S=b?{owner:b.owner,name:b.name,url:b.url}:null,[N,k]=Q.useReducer(Tr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[w,C]=Q.useState(!1),[M,_]=Q.useState(!1),{openSidePanel:V}=$n(),{sendMessage:E}=Pn(),P=async()=>{if(M)return;const D=d.getValues("metadata.instructions");if(D?.trim()){_(!0);try{K(),Ve("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:D.length}),V();const te=Tn(i.id);await E({tiptapDoc:An({managerAgentId:te.id,managerName:te.title,kind:"agent",id:a.id,instructions:D})})}finally{_(!1)}}},[I,A]=Q.useReducer(Dr,null),R=()=>{I!==null&&(Ve("agent_updated",{agent_id:a.id,fields:Array.from(I.fields),instructions_length:I.instructionsLength,save_count:I.saveCount,edit_duration_ms:Date.now()-I.start}),A({type:"reset"}))},{schedule:U,flush:K}=es({delayMs:3e4,save:async()=>R()}),W=async()=>{const D=m.snapshot(),te={predicate:Ne=>is(Ne.queryKey,i.id)},ne=async()=>(await c.invalidateQueries({predicate:Ne=>is(Ne.queryKey,i.id),refetchType:"all"}),ns(c,i.id,a.id)),xe=(Ne,qe)=>{if(Ne){ws(d.getValues("metadata.sidebarViews"),Ne.rawViews)||d.setValue("metadata.sidebarViews",Ne.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Ne.version&&d.setValue("metadata.sidebarViewsVersion",Ne.version,{shouldDirty:!1}),ws(d.getValues("metadata.sidebarViewsSeen"),Ne.seen)||d.setValue("metadata.sidebarViewsSeen",Ne.seen,{shouldDirty:!1});return}qe!==null&&(d.setValue("metadata.sidebarViews",[...qe],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Hi,{shouldDirty:!1}))},_e=Ji(D),De=Object.keys(d.control._formState.dirtyFields);if(De.length===0&&!_e){await m.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const Ke=De.length>0?De:["metadata"],ct=Ke.includes("metadata"),Ge=d.getValues();d.reset(Ge,{keepValues:!0});const tt=Pr(Ge),cn=ns(c,i.id,a.id),dn=Zi({sidebarViews:tt.metadata?.sidebarViews,sidebarViewsVersion:tt.metadata?.sidebarViewsVersion},D,cn?.metadata);tt.metadata={...ls(tt.metadata),...dn};let yt;try{yt=await l.update.mutateAsync({id:a.id,data:tt})}catch(Ne){let qe=null;try{qe=await ne()}catch{}const Ut=qe?ys(qe):null,Yt=await m.settle({snapshot:D,saved:!1,authoritativeViews:Ut?.effectiveViews});throw Yt.settledLatest&&xe(Ut,Yt.reconciledViews),Ne}await c.cancelQueries(te),ea(c,i.id,yt);const Rt=ys(yt),Lt=await m.settle({snapshot:D,saved:!0,authoritativeViews:Rt.effectiveViews});Lt.settledLatest&&xe(Rt,Lt.reconciledViews),A({type:"accumulate",now:Date.now(),fields:Ke,instructionsLength:ct?Ge.metadata?.instructions?.length??0:null}),U()},G=()=>Sa(u,W),{schedule:L,flush:Y}=es({save:G});Q.useEffect(()=>{const D=d.watch(()=>L());return()=>D.unsubscribe()},[]);const X=()=>{Ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),k({type:"SET_ADD_DIALOG_OPEN",payload:!0})},T=async D=>{const te=d.getValues("connections");if(te.some(_e=>_e.connection_id===D))return;d.setValue("connections",[...te,{connection_id:D,selected_tools:Ct.tools,selected_resources:Ct.resources,selected_prompts:Ct.prompts}],{shouldDirty:!0}),k({type:"SET_ADD_DIALOG_OPEN",payload:!1});const ne=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin),xe=await Ht({url:ne.href,token:null,orgId:i.id});xe.supportsOAuth&&!xe.isAuthenticated&&await J(D)},z=D=>{const ne=d.getValues("connections").filter(xe=>xe.connection_id!==D);d.setValue("connections",ne,{shouldDirty:!0})},B=(D,te)=>{const ne=d.getValues("connections");if(ne.some(xe=>xe.connection_id===te)){re.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",ne.map(xe=>xe.connection_id===D?{...xe,connection_id:te}:xe),{shouldDirty:!0})},O=async D=>{if(d.getValues("connections").find(ne=>ne.connection_id===D))try{const{item:ne}=await f.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!ne)return;const xe=ne.title.replace(/\s*\(.*?\)\s*$/,""),_e=Dn("conn"),De=`${xe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:_e,title:De,description:ne.description??null,connection_type:ne.connection_type,connection_url:ne.connection_url??null,connection_token:null,icon:ne.icon??null,app_name:ne.app_name??null,app_id:ne.app_id??null,connection_headers:ne.connection_headers??null});const Ke=new URL(`/api/${i.slug}/mcp/${_e}`,window.location.origin),ct=await Ht({url:Ke.href,token:null,orgId:i.id});if(ct.supportsOAuth&&!ct.isAuthenticated){const Ge=await J(_e);if(!Ge){await p.delete.mutateAsync(_e);return}await p.update.mutateAsync({id:_e,data:{title:`${xe} (${Ge})`}})}B(D,_e),re.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(ne){console.error("Failed to create instance:",ne),re.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},$=D=>{k({type:"OPEN_SETTINGS",payload:D})},J=async D=>{const{token:te,tokenInfo:ne,error:xe}=await Ln({connectionId:D,orgSlug:i.slug,scope:"offline_access"});if(xe||!te)return re.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:xe??""})),null;if(ne)try{const De=await fetch(`/api/${i.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await p.update.mutateAsync({id:D,data:{connection_token:te}});else try{await p.update.mutateAsync({id:D,data:{}})}catch(Ke){console.warn("Failed to refresh connection tools after OAuth:",Ke)}}catch(De){console.error("Error saving OAuth token:",De),await p.update.mutateAsync({id:D,data:{connection_token:te}})}else await p.update.mutateAsync({id:D,data:{connection_token:te}});const _e=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin);return await c.invalidateQueries({queryKey:Ot.isMCPAuthenticated(_e.href,null)}),re.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Or(ne,te)},ie=()=>{const D=d.getValues("metadata.instructions")??"",te=s("virtualMcp.virtualMcp.promptTemplateContent"),ne=D.trim()?`${D}
3
+
4
+ ${te}`:te;d.setValue("metadata.instructions",ne,{shouldDirty:!0})},de=new Set(x.map(D=>D.connection_id)),{section:ae}=Ul(),oe=e!==null,H=e==="instructions"?null:e??ae,ce=H==="general",me=oe?e==="instructions":ce,pe=Ri(a.id)==="v8",fe=zl({virtualMcpId:a.id,form:d,flushAndSave:Y}),he=At(),[ve,ue]=Q.useState(!1),F=async()=>{K();try{await l.delete.mutateAsync(a.id),Ve("agent_deleted",{agent_id:a.id,source:"agent_detail"}),re.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),he({to:"/$org",params:{org:i.slug}})}catch{}},se=t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{Ve("agent_connect_modal_opened",{agent_id:a.id}),k({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(_n,{size:14}),s("virtualMcp.virtualMcp.connect")]}),Te=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(ee,{variant:"outline",size:"sm",onClick:ie,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ee,{variant:"outline",size:"sm",disabled:M||!d.watch("metadata.instructions")?.trim(),onClick:P,children:[t.jsx(ut,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ye,{children:[t.jsxs(t.Fragment,{children:[!oe&&t.jsxs(t.Fragment,{children:[t.jsx(Ye.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Ll,{section:H??"general"})]}),t.jsx(Ye.Actions,{secondary:H==="connections"?se:void 0,children:H==="connections"?t.jsxs(ee,{size:"sm",onClick:X,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):se}),t.jsx(Ye.Content,{children:t.jsx(Ye.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(Vn,{children:[ce&&t.jsx($l,{views:fe}),ce&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Rl,{form:d,onCommit:Y}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(On,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[s("virtualMcp.virtualMcp.created")," ",qa(new Date(a.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:o?s("virtualMcp.virtualMcp.lastUsed",{time:Rn(new Date(o),{addSuffix:!0,locale:n})}):s("virtualMcp.virtualMcp.neverUsed")})]})]}),H==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:X,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(D=>t.jsx(Be,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(nn,{}),children:t.jsx(Nl,{connection_id:D.connection_id,usedConnectionIds:de,onOpenSettings:()=>$(D.connection_id),onRemove:()=>z(D.connection_id),onAuthenticate:J,onSwitchInstance:B,onNewInstance:()=>O(D.connection_id)})})},D.connection_id))})}),me&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),Te]}),t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:D})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(mt,{...D,value:D.value??"",onChange:te=>{D.onChange(te)},onBlur:()=>{D.onBlur(),Y()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Ce,{delayDuration:0,children:[t.jsx(ke,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>C(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(wi,{size:14})})}),t.jsx(Me,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),me&&t.jsx(Qa,{form:d}),ce&&t.jsx(Be,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(al,{form:d,currentAgentId:a.id})})}),H==="site"&&y&&t.jsx(We,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(Re,{children:[t.jsx(je,{children:t.jsx(_r,{control:d.control,onCommit:Y})}),!j&&t.jsx(je,{children:t.jsx(Cr,{control:d.control})}),!j&&v&&t.jsx(je,{children:t.jsx(kr,{control:d.control,onCommit:Y})})]})}),H==="site"&&!j&&t.jsx(We,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(Re,{children:t.jsx(Ql,{control:d.control,isBlocksV8:pe,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),H==="site"&&pe&&v&&t.jsx(Wl,{orgSlug:i.slug,virtualMcpId:a.id}),H==="site"&&t.jsx(We,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(Re,{children:[t.jsx(je,{children:t.jsx(gr,{repo:S})}),t.jsx(je,{children:t.jsx(yr,{control:d.control})}),g&&t.jsx(je,{children:t.jsx(Nr,{control:d.control})}),t.jsx(je,{children:t.jsx(cr,{control:d.control,form:d,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ce&&t.jsx(We,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(Re,{children:t.jsx(st,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ee,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ue(!0),children:[t.jsx(ht,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??H)]}),t.jsx(Un,{open:ve,onOpenChange:ue,children:t.jsxs(Yn,{children:[t.jsxs(Bn,{children:[t.jsx(Wn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Kn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Gn,{children:[t.jsx(qn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Hn,{onClick:F,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(Ni,{open:N.addDialogOpen,onOpenChange:D=>k({type:"SET_ADD_DIALOG_OPEN",payload:D}),agentId:a.id,addedConnectionIds:de,onAdd:T}),t.jsx(Sl,{open:N.settingsDialogOpen,onOpenChange:D=>{D||k({type:"CLOSE_SETTINGS"})},selectedId:N.settingsConnectionId,form:d,connections:x,onAuthenticate:J}),t.jsx(lr,{open:N.shareDialogOpen,onOpenChange:D=>k({type:"SET_SHARE_DIALOG_OPEN",payload:D}),virtualMcp:a}),t.jsx(Je,{open:w,onOpenChange:C,children:t.jsxs(Ze,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(lt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(rt,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:D})=>t.jsx(mt,{...D,value:D.value??"",onChange:te=>{D.onChange(te)},onBlur:()=>{D.onBlur(),Y()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Qo(a){const e=q.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),r=At(),{org:o}=Ee(),p=Os(s);if(!p){let u;e[0]!==l?(u=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=u):u=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let d;e[4]!==r||e[5]!==o.slug?(d=()=>r({to:"/$org",params:{org:o.slug}}),e[4]=r,e[5]=o.slug,e[6]=d):d=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(ee,{variant:"outline",onClick:d,children:x}),e[9]=d,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(In,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let c;e[16]!==p?(c=As(p)?.connectionId??"",e[16]=p,e[17]=c):c=e[17];const f=`${p.id}:${c}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Ar,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{Qo as V};
@@ -1 +1 @@
1
- import{c as G,j as i,b as J,r as q,B as Ne,a as be,t as de,G as He,au as ye,aw as _e,l as Y,m as Xe,K as qe,ae as Ye,a2 as Le,d as Ue,aD as Je,k as Ve,E as Qe,L as ke,Y as Ze,y as je,aa as Pe,P as et}from"./index-C_vsZdEs.js";import{u as Re,c as De,i as tt,j as st,k as nt,l as it}from"./use-sidebar-collapsed-BwUTTLp4.js";import{S as rt,a as ot,b as lt}from"./sheet--x4K5vq7.js";import{u as at}from"./use-mobile-DHwXmnJW.js";import{u as ct,a as dt,D as ut,c as ft,C as ht,P as mt}from"./core.esm-QVBuVFEZ.js";import{S as gt,v as pt,u as xt}from"./sortable.esm-CnslkyN-.js";import{i as bt}from"./Tool01-Bhwq8fKA.js";import{D as jt,A as yt,E as Ae,F as vt}from"./agent-icon-B7E6q_wB.js";import{s as St}from"./Plus-B4v3GkBC.js";import{s as Me}from"./XClose-DbFkM30N.js";import{T as he,a as me,c as ge}from"./tooltip-BKiQ2c4S.js";import{C as ze,f as wt,g as zt,e as Ot}from"./context-menu-22sCTgBs.js";import{A as _t}from"./avatar-BD2PDf8q.js";import{C as Rt}from"./create-organization-dialog-D6kuk20k.js";import{P as Ct}from"./project-apps-BNVRAEb2.js";import{u as Nt,a as At}from"./use-recent-apps-B5QclJaN.js";import{b as Et}from"./use-navigate-to-agent-CRetfCk1.js";import{u as Tt,a as It}from"./use-project-scope-CXdLsOUx.js";import{i as Lt}from"./UserSquare-BIGP81NS.js";import{C as Ee,e as kt,b as Pt,c as Dt,f as Mt}from"./command-C2RTsWLU.js";import{u as $t}from"./use-debounced-value-BOYaK5vY.js";const Kt={xs:"xs",sm:"xs",lg:"md"};function Ce(t){const e=G.c(4),{org:s,size:o}=t,r=o===void 0?"sm":o,l=s.logo??void 0,n=Kt[r];let a;return e[0]!==s.name||e[1]!==l||e[2]!==n?(a=i.jsx(_t,{url:l,fallback:s.name,size:n,tone:"solid"}),e[0]=s.name,e[1]=l,e[2]=n,e[3]=a):a=e[3],a}function Gs({invitation:t,onChanged:e}){const s=J(),[o,r]=q.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){de.error(d.error.message),r(!1);return}}catch{de.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}de.success(s("header.orgSwitcher.joined",{name:l})),He();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});if(c.error){de.error(c.error.message),r(!1);return}de.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{de.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Ce,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(Ne,{size:"sm",variant:"default",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(Ne,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Me,{size:14})})]})]})}const Wt=3,$e=10,Ft=440,Bt=55;function Ke(t){const e=Math.floor((t-Ft)/Bt);return Math.min($e,Math.max(Wt,e))}function Gt(t,e,s=$e*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Ht(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Xt(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Te=[];function qt(){const t=G.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=_e.recentOrgs(),t[0]=e):e=t[0];const[s,o]=ye(e,Te),r=Array.isArray(s)?s:Te;let l;t[1]!==o?(l=(a,c)=>o(d=>Gt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const We={hidden:[],pinned:[],order:[]},fe=(t,e)=>t.filter(s=>s!==e);function ue(t){if(typeof t!="object"||t===null)return We;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Yt(t,e){return{...t,hidden:[...fe(t.hidden,e),e],pinned:fe(t.pinned,e)}}function Ut(t,e){return{...t,hidden:fe(t.hidden,e)}}function Jt(t,e){return t.pinned.includes(e)?{...t,pinned:fe(t.pinned,e)}:{...t,hidden:fe(t.hidden,e),pinned:[...t.pinned,e]}}function Vt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Qt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function ve(t){const e=G.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Zt(t){return typeof t=="object"&&t!==null&&Array.isArray(t.items)}function es(t){const e=G.c(13),s=t.trim(),{data:o}=be.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=qe.organizationSearch(r,s);let a;e[0]!==s?(a=async w=>{const{signal:O}=w,p=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!p.ok)throw new Error(`Organization search failed: ${p.status}`);const y=await p.json();if(!Zt(y))throw new Error("Invalid organization search response");return y},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Ye,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:g,isPlaceholderData:m,isError:h}=Xe(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const u=l&&g,x=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==u||e[11]!==x?(j={hits:f,isSearching:u,isStale:x,isError:h},e[8]=h,e[9]=f,e[10]=u,e[11]=x,e[12]=j):j=e[12],j}function ts(t){const e=G.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=q.useState(!1),[d,g]=q.useState("");let m;e[0]!==d?(m=d.trim(),e[0]=d,e[1]=m):m=e[1];const h=m,f=$t(h,150),u=h.length>0,x=f===h,{hits:j,isSearching:w,isStale:O,isError:p}=es(u?f:""),y=u?j:s;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=H=>{c(H),H||g("")},e[2]=v):v=e[2];const z=v;let b;e[3]!==n?(b=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=b):b=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>z(!0),e[5]=A):A=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=i.jsx(Lt,{size:18}),e[6]=I):I=e[6];let _;e[7]!==b?(_=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":b,onClick:A,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:I})}),e[7]=b,e[8]=_):_=e[8];let E;e[9]!==r||e[10]!==n?(E=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=E):E=e[11];let R;e[12]!==E?(R=i.jsx(me,{side:"right",children:E}),e[12]=E,e[13]=R):R=e[13];let T;e[14]!==_||e[15]!==R?(T=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[_,R]})}),e[14]=_,e[15]=R,e[16]=T):T=e[16];let P;e[17]!==n?(P=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=P):P=e[18];let S;e[19]!==n?(S=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=S):S=e[20];let C;e[21]!==n?(C=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=C):C=e[22];let M;e[23]!==d||e[24]!==C?(M=i.jsx(kt,{value:d,onValueChange:g,placeholder:C}),e[23]=d,e[24]=C,e[25]=M):M=e[25];const F=u&&(O||!x)&&"opacity-50";let K;e[26]!==F?(K=Y(F),e[26]=F,e[27]=K):K=e[27];let D;e[28]!==p||e[29]!==u||e[30]!==n?(D=u&&p&&i.jsx(Ee,{children:n("sidebar.rail.searchFailed")}),e[28]=p,e[29]=u,e[30]=n,e[31]=D):D=e[31];let $;e[32]!==p||e[33]!==w||e[34]!==y.length||e[35]!==x||e[36]!==n?($=!p&&x&&!w&&y.length===0&&i.jsx(Ee,{children:n("sidebar.rail.searchEmpty")}),e[32]=p,e[33]=w,e[34]=y.length,e[35]=x,e[36]=n,e[37]=$):$=e[37];let L;if(e[38]!==o||e[39]!==l||e[40]!==y||e[41]!==n){let H;e[43]!==o||e[44]!==l||e[45]!==n?(H=X=>i.jsxs(Pt,{value:X.slug,onSelect:()=>{z(!1),X.slug!==o&&l(X.slug)},className:"gap-2.5",children:[i.jsx(Ce,{org:X,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.name}),X.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},X.id),e[43]=o,e[44]=l,e[45]=n,e[46]=H):H=e[46],L=y.map(H),e[38]=o,e[39]=l,e[40]=y,e[41]=n,e[42]=L}else L=e[42];let k;e[47]!==K||e[48]!==D||e[49]!==$||e[50]!==L?(k=i.jsxs(Dt,{className:K,children:[D,$,L]}),e[47]=K,e[48]=D,e[49]=$,e[50]=L,e[51]=k):k=e[51];let W;e[52]!==a||e[53]!==P||e[54]!==S||e[55]!==M||e[56]!==k?(W=i.jsxs(Mt,{open:a,onOpenChange:z,title:P,description:S,shouldFilter:!1,children:[M,k]}),e[52]=a,e[53]=P,e[54]=S,e[55]=M,e[56]=k,e[57]=W):W=e[57];let U;return e[58]!==W||e[59]!==T?(U=i.jsxs(i.Fragment,{children:[T,W]}),e[58]=W,e[59]=T,e[60]=U):U=e[60],U}function ss(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const ns=()=>Ke(globalThis.innerHeight),is=()=>Ke(0);function rs(t){const e=G.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,d=J();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:u,isDragging:x}=xt(g);let j;e[2]!==f?(j=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const w=x?1:void 0,O=`rail-org-${s.slug}`;let p;e[4]!==j||e[5]!==w||e[6]!==O||e[7]!==u?(p={transform:j,transition:u,zIndex:w,viewTransitionName:O},e[4]=j,e[5]=w,e[6]=O,e[7]=u,e[8]=p):p=e[8];const y=s.name,v=o||void 0,z=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",b=r&&"cursor-pointer";let A;e[9]!==z||e[10]!==b?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",z,b),e[9]=z,e[10]=b,e[11]=A):A=e[11];let I;e[12]!==s?(I=i.jsx(Ce,{org:s,size:"lg"}),e[12]=s,e[13]=I):I=e[13];let _;e[14]!==l?(_=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(Ae,{size:9})}),e[14]=l,e[15]=_):_=e[15];let E;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==I||e[20]!==_||e[21]!==v?(E=i.jsx(he,{asChild:!0,children:i.jsx(wt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":y,"aria-current":v,onClick:r,className:A,children:[I,_]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=I,e[20]=_,e[21]=v,e[22]=E):E=e[22];let R;e[23]!==s.name?(R=i.jsx(me,{side:"right",children:s.name}),e[23]=s.name,e[24]=R):R=e[24];let T;e[25]!==E||e[26]!==R?(T=i.jsxs(ge,{children:[E,R]}),e[25]=E,e[26]=R,e[27]=T):T=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(vt,{}),e[28]=P):P=e[28];let S;e[29]!==d?(S=d("sidebar.rail.organizationSettings"),e[29]=d,e[30]=S):S=e[30];let C;e[31]!==n||e[32]!==S?(C=i.jsxs(ze,{onSelect:n,children:[P,S]}),e[31]=n,e[32]=S,e[33]=C):C=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ae,{}),e[34]=M):M=e[34];let F;e[35]!==l||e[36]!==d?(F=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=d,e[37]=F):F=e[37];let K;e[38]!==a||e[39]!==F?(K=i.jsxs(ze,{onSelect:a,children:[M,F]}),e[38]=a,e[39]=F,e[40]=K):K=e[40];let D;e[41]!==c||e[42]!==d?(D=c&&i.jsxs(ze,{onSelect:c,children:[i.jsx(bt,{}),d("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=d,e[43]=D):D=e[43];let $;e[44]!==C||e[45]!==K||e[46]!==D?($=i.jsxs(zt,{children:[C,K,D]}),e[44]=C,e[45]=K,e[46]=D,e[47]=$):$=e[47];let L;e[48]!==T||e[49]!==$?(L=i.jsxs(Ot,{children:[T,$]}),e[48]=T,e[49]=$,e[50]=L):L=e[50];let k;e[51]!==o||e[52]!==L?(k=i.jsx(ve,{active:o,children:L}),e[51]=o,e[52]=L,e[53]=k):k=e[53];let W;return e[54]!==h||e[55]!==m||e[56]!==k||e[57]!==p?(W=i.jsx("div",{ref:m,...h,style:p,className:"w-full shrink-0 touch-none",children:k}),e[54]=h,e[55]=m,e[56]=k,e[57]=p,e[58]=W):W=e[58],W}function os(t){const e=G.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,d,g,m,h,f,u,x,j,w,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const M=jt(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",g=ge,d=he,w=!0,c=ke,m=Ze.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,u=r||void 0,e[20]!==n?(x=()=>{je("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=x):x=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",M.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=d,e[8]=g,e[9]=m,e[10]=h,e[11]=f,e[12]=u,e[13]=x,e[14]=j,e[15]=w,e[16]=O}else c=e[6],d=e[7],g=e[8],m=e[9],h=e[10],f=e[11],u=e[12],x=e[13],j=e[14],w=e[15],O=e[16];let p;e[22]!==s.icon||e[23]!==s.title?(p=i.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=p):p=e[24];let y;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==u||e[30]!==x||e[31]!==j||e[32]!==p?(y=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":u,onClick:x,className:j,children:p}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=u,e[30]=x,e[31]=j,e[32]=p,e[33]=y):y=e[33];let v;e[34]!==d||e[35]!==y||e[36]!==w?(v=i.jsx(d,{asChild:w,children:y}),e[34]=d,e[35]=y,e[36]=w,e[37]=v):v=e[37];let z;e[38]!==s.title?(z=i.jsx(me,{side:"right",children:s.title}),e[38]=s.title,e[39]=z):z=e[39];let b;e[40]!==g||e[41]!==v||e[42]!==z?(b=i.jsxs(g,{children:[v,z]}),e[40]=g,e[41]=v,e[42]=z,e[43]=b):b=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let I;e[44]!==A?(I=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=I):I=e[45];let _;e[46]!==s.title||e[47]!==I?(_=i.jsx("span",{"aria-hidden":!0,className:I,children:s.title}),e[46]=s.title,e[47]=I,e[48]=_):_=e[48];let E;e[49]!==s.title||e[50]!==a?(E=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=E):E=e[51];let R;e[52]!==l?(R=()=>{je("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=R):R=e[53];let T,P;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=Y("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),P=i.jsx(Me,{size:10}),e[54]=T,e[55]=P):(T=e[54],P=e[55]);let S;e[56]!==E||e[57]!==R?(S=i.jsx("button",{type:"button","aria-label":E,onClick:R,className:T,children:P}),e[56]=E,e[57]=R,e[58]=S):S=e[58];let C;return e[59]!==b||e[60]!==_||e[61]!==S||e[62]!==O?(C=i.jsxs("div",{className:O,children:[b,_,S]}),e[59]=b,e[60]=_,e[61]=S,e[62]=O,e[63]=C):C=e[63],C}const ls={"site-editor":"/site-editor"};function as(t){const e=G.c(26),{app:s}=t,o=J(),r=Ct[s],l=ls[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let d;e[8]!==r.Icon?(d=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=d):d=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(g=i.jsx(he,{asChild:!0,children:i.jsx(ke,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=g):g=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(me,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==g||e[21]!==h?(f=i.jsxs(ge,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=f):f=e[22];let u;return e[23]!==n||e[24]!==f?(u=i.jsx(ve,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=u):u=e[25],u}function cs(){const{org:t}=Le();return Nt(t.slug),null}function Fe(t){const e=G.c(56),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Ue(),{org:l}=Le(),n=Je();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:hs},e[0]=a):a=e[0];const c=Ve(a);let d;e[1]!==c||e[2]!==n?(d=c?n({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=c,e[2]=n,e[3]=d):d=e[3];const g=d,m=g?g.org:l.slug,{data:h}=Qe(),[f,u]=q.useState(!1),x=Re(),{recent:j,forget:w}=Et(l.slug),{projects:O}=Tt(),p=It(),y=At(),v=y&&y.projectId===null?y.app:null,z=v?[]:j.flatMap(N=>O.filter(B=>B.id===N)),b=Ht(h??[],l),{recent:A,remember:I}=qt();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=_e.railOrgPrefs(),e[4]=_):_=e[4];const[E,R]=ye(_,We),T=ue(E),P=q.useSyncExternalStore(ss,ns,is),{shown:S}=Xt(Vt(b,T,l.slug),A,l.slug,P,T.pinned);let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[5]=C):C=e[5];const M=ct(dt(mt,C)),F=N=>{const{active:B,over:ce}=N;ce&&(je("org_rail_reordered"),R(Ge=>Qt(ue(Ge),S.map(fs),String(B.id),String(ce.id))))},K=N=>{s?.(),r({to:"/$org/home",params:{org:N},viewTransition:!0})},D=N=>{je("org_rail_travel");const B=S.some(ce=>ce.slug===N);R(ce=>Ut(ue(ce),N)),I(N,B?S.map(us):void 0),K(N)},$=!x&&"border-r border-sidebar-border";let L;e[6]!==$?(L=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",$),e[6]=$,e[7]=L):L=e[7];let k;e[8]!==o?(k=o("sidebar.rail.ariaLabel"),e[8]=o,e[9]=k):k=e[9];const W=ut,U=ft,H=gt,X=S.map(ds),Se=pt,we=S.map(N=>i.jsxs(q.Fragment,{children:[i.jsx(rs,{org:N,active:N.slug===m,pinned:T.pinned.includes(N.slug),onSelect:N.slug!==l.slug?()=>D(N.slug):p?()=>K(N.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>R(B=>Jt(ue(B),N.slug)),onHide:N.slug===l.slug?void 0:()=>R(B=>Yt(ue(B),N.slug))}),N.slug===l.slug&&z.length>0&&i.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:z.map(B=>i.jsx(os,{project:B,orgSlug:l.slug,active:p===B.id,onClose:()=>w(B.id),onNavigate:s},B.id))})]},N.id));let V;e[10]!==H||e[11]!==X||e[12]!==Se||e[13]!==we?(V=i.jsx(H,{items:X,strategy:Se,children:we}),e[10]=H,e[11]=X,e[12]=Se,e[13]=we,e[14]=V):V=e[14];let Q;e[15]!==W||e[16]!==F||e[17]!==M||e[18]!==V||e[19]!==U?(Q=i.jsx(W,{sensors:M,collisionDetection:U,onDragEnd:F,children:V}),e[15]=W,e[16]=F,e[17]=M,e[18]=V,e[19]=U,e[20]=Q):Q=e[20];let Z;e[21]!==l.slug||e[22]!==b||e[23]!==S.length||e[24]!==D?(Z=b.length>S.length&&i.jsx(ts,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-S.length,onSelect:D}),e[21]=l.slug,e[22]=b,e[23]=S.length,e[24]=D,e[25]=Z):Z=e[25];let ee;e[26]!==o?(ee=o("sidebar.picker.newOrganization"),e[26]=o,e[27]=ee):ee=e[27];let te;e[28]!==u?(te=()=>u(!0),e[28]=u,e[29]=te):te=e[29];let pe;e[30]===Symbol.for("react.memo_cache_sentinel")?(pe=i.jsx(St,{size:18}),e[30]=pe):pe=e[30];let se;e[31]!==ee||e[32]!==te?(se=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":ee,onClick:te,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:pe})}),e[31]=ee,e[32]=te,e[33]=se):se=e[33];let ne;e[34]!==o?(ne=o("sidebar.picker.newOrganization"),e[34]=o,e[35]=ne):ne=e[35];let ie;e[36]!==ne?(ie=i.jsx(me,{side:"right",children:ne}),e[36]=ne,e[37]=ie):ie=e[37];let re;e[38]!==se||e[39]!==ie?(re=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[se,ie]})}),e[38]=se,e[39]=ie,e[40]=re):re=e[40];let oe;e[41]!==v?(oe=v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(as,{app:v})]}),e[41]=v,e[42]=oe):oe=e[42];let le;e[43]!==Q||e[44]!==Z||e[45]!==re||e[46]!==oe||e[47]!==L||e[48]!==k?(le=i.jsxs("div",{className:L,"aria-label":k,children:[Q,Z,re,oe]}),e[43]=Q,e[44]=Z,e[45]=re,e[46]=oe,e[47]=L,e[48]=k,e[49]=le):le=e[49];let ae;e[50]!==f||e[51]!==u?(ae=i.jsx(Rt,{open:f,onOpenChange:u}),e[50]=f,e[51]=u,e[52]=ae):ae=e[52];let xe;return e[53]!==le||e[54]!==ae?(xe=i.jsxs(i.Fragment,{children:[le,ae]}),e[53]=le,e[54]=ae,e[55]=xe):xe=e[55],xe}function ds(t){return t.slug}function us(t){return t.slug}function fs(t){return t.slug}function hs(t){return t.isLoading}function ms(t){const e=G.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:d}=De(),g=Re();if(d||g)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},u=i.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 group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=u):(f=e[4],u=e[5]);let x;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(x=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:u}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=x):x=e[14],x}const Oe=400,Ie=16,gs="sidebar.width.v2";function ps(){const t=G.c(14),e=xs;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>typeof u=="number"?e(u):192,t[0]=s):s=t[0];const[o,r]=ye(gs,s),l=q.useRef(null);let n;t[1]!==r||t[2]!==o?(n=u=>{u.preventDefault();const x=u.clientX,j=e(o),w=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const v of O)v.style.transition="none";const p=v=>{const z=e(j+(v.clientX-x));w?.style.setProperty("--sidebar-width",`${z}px`)},y=v=>{const z=e(j+(v.clientX-x));r(z);for(const b of O)b.style.transition="";window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",p),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const d=c;let g;t[6]!==r||t[7]!==o?(g=u=>{if(u.key==="ArrowLeft")r(e(o-Ie));else if(u.key==="ArrowRight")r(e(o+Ie));else if(u.key==="Home")r(192);else if(u.key==="End")r(Oe);else return;u.preventDefault()},t[6]=r,t[7]=o,t[8]=g):g=t[8];const m=g,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==d||t[12]!==h?(f={width:h,minWidth:192,maxWidth:Oe,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:d},t[9]=m,t[10]=a,t[11]=d,t[12]=h,t[13]=f):f=t[13],f}function xs(t){return Math.max(192,Math.min(Oe,t))}const Be=q.createContext(null);function bs(){const t=q.use(Be);if(!t)throw new Error("Layout regions require a Layout");return t}function js({children:t,notice:e,outsideOrg:s}){const o=at(),[r,l]=ye(_e.sidebarOpen(),!0),n=ps(),a=Pe();return i.jsx(Be,{value:{isMobile:o,resize:n},children:i.jsx(tt,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(cs,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Fe,{}),i.jsx(st,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(nt,{children:t})})]})]})})})}function ys(t){const e=G.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=bs(),{openMobile:a,setOpenMobile:c}=De(),d=Re(),g=Pe();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const v=g&&d;let z;e[2]!==s||e[3]!==v?(z=i.jsx("div",{className:"contents",inert:v,children:s}),e[2]=s,e[3]=v,e[4]=z):z=e[4];let b;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(b=i.jsx(ms,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=b):b=e[11];let A;return e[12]!==z||e[13]!==b?(A=i.jsxs(i.Fragment,{children:[z,b]}),e[12]=z,e[13]=b,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let u;e[17]!==f?(u=i.jsx(rt,{className:"sr-only",children:f}),e[17]=f,e[18]=u):u=e[18];let x;e[19]!==h||e[20]!==g?(x=g&&i.jsx(Fe,{onNavigate:h}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let w;e[25]!==j?(w=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=w):w=e[26];let O;e[27]!==x||e[28]!==w?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[x,w]}),e[27]=x,e[28]=w,e[29]=O):O=e[29];let p;e[30]!==u||e[31]!==O?(p=i.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:vs,children:[u,O]}),e[30]=u,e[31]=O,e[32]=p):p=e[32];let y;return e[33]!==a||e[34]!==c||e[35]!==p?(y=i.jsx(lt,{open:a,onOpenChange:c,children:p}),e[33]=a,e[34]=c,e[35]=p,e[36]=y):y=e[36],y}function vs(t){return t.preventDefault()}function Ss(t){const e=G.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(it,{className:"flex flex-col min-h-0",style:o,children:i.jsx(et,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Hs=Object.assign(js,{Sidebar:ys,Content:Ss});export{Gs as I,Hs as L,Ce as O,es as u,Ht as w};
1
+ import{c as G,j as i,b as J,r as q,B as Ne,a as be,t as de,G as He,au as ye,aw as _e,l as Y,m as Xe,K as qe,ae as Ye,a2 as Le,d as Ue,aD as Je,k as Ve,E as Qe,L as ke,Y as Ze,y as je,aa as Pe,P as et}from"./index-DJCD1T3p.js";import{u as Re,c as De,i as tt,j as st,k as nt,l as it}from"./use-sidebar-collapsed-Lbn9i3wJ.js";import{S as rt,a as ot,b as lt}from"./sheet-C_qetF7d.js";import{u as at}from"./use-mobile-CCkX9zL-.js";import{u as ct,a as dt,D as ut,c as ft,C as ht,P as mt}from"./core.esm-CumN7OYl.js";import{S as gt,v as pt,u as xt}from"./sortable.esm-Dgy_5_Gq.js";import{i as bt}from"./Tool01-CnZckhqi.js";import{D as jt,A as yt,E as Ae,F as vt}from"./agent-icon-2Sd6TPJR.js";import{s as St}from"./Plus-B28tKNm1.js";import{s as Me}from"./XClose-BbuvN9Qp.js";import{T as he,a as me,c as ge}from"./tooltip-oRr5C_aw.js";import{C as ze,f as wt,g as zt,e as Ot}from"./context-menu-BPat3chT.js";import{A as _t}from"./avatar-DarGMVT9.js";import{C as Rt}from"./create-organization-dialog-C7cTp33N.js";import{P as Ct}from"./project-apps-DxvrGikA.js";import{u as Nt,a as At}from"./use-recent-apps-DaFNVa3y.js";import{b as Et}from"./use-navigate-to-agent-CEb5-IwU.js";import{u as Tt,a as It}from"./use-project-scope-C66L_LKx.js";import{i as Lt}from"./UserSquare-UeuSXkL4.js";import{C as Ee,e as kt,b as Pt,c as Dt,f as Mt}from"./command-CPx9UwtG.js";import{u as $t}from"./use-debounced-value-BdOjhsVi.js";const Kt={xs:"xs",sm:"xs",lg:"md"};function Ce(t){const e=G.c(4),{org:s,size:o}=t,r=o===void 0?"sm":o,l=s.logo??void 0,n=Kt[r];let a;return e[0]!==s.name||e[1]!==l||e[2]!==n?(a=i.jsx(_t,{url:l,fallback:s.name,size:n,tone:"solid"}),e[0]=s.name,e[1]=l,e[2]=n,e[3]=a):a=e[3],a}function Gs({invitation:t,onChanged:e}){const s=J(),[o,r]=q.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){de.error(d.error.message),r(!1);return}}catch{de.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}de.success(s("header.orgSwitcher.joined",{name:l})),He();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});if(c.error){de.error(c.error.message),r(!1);return}de.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{de.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Ce,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(Ne,{size:"sm",variant:"default",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(Ne,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Me,{size:14})})]})]})}const Wt=3,$e=10,Ft=440,Bt=55;function Ke(t){const e=Math.floor((t-Ft)/Bt);return Math.min($e,Math.max(Wt,e))}function Gt(t,e,s=$e*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Ht(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Xt(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Te=[];function qt(){const t=G.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=_e.recentOrgs(),t[0]=e):e=t[0];const[s,o]=ye(e,Te),r=Array.isArray(s)?s:Te;let l;t[1]!==o?(l=(a,c)=>o(d=>Gt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const We={hidden:[],pinned:[],order:[]},fe=(t,e)=>t.filter(s=>s!==e);function ue(t){if(typeof t!="object"||t===null)return We;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Yt(t,e){return{...t,hidden:[...fe(t.hidden,e),e],pinned:fe(t.pinned,e)}}function Ut(t,e){return{...t,hidden:fe(t.hidden,e)}}function Jt(t,e){return t.pinned.includes(e)?{...t,pinned:fe(t.pinned,e)}:{...t,hidden:fe(t.hidden,e),pinned:[...t.pinned,e]}}function Vt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Qt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function ve(t){const e=G.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Zt(t){return typeof t=="object"&&t!==null&&Array.isArray(t.items)}function es(t){const e=G.c(13),s=t.trim(),{data:o}=be.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=qe.organizationSearch(r,s);let a;e[0]!==s?(a=async w=>{const{signal:O}=w,p=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!p.ok)throw new Error(`Organization search failed: ${p.status}`);const y=await p.json();if(!Zt(y))throw new Error("Invalid organization search response");return y},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Ye,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:g,isPlaceholderData:m,isError:h}=Xe(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const u=l&&g,x=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==u||e[11]!==x?(j={hits:f,isSearching:u,isStale:x,isError:h},e[8]=h,e[9]=f,e[10]=u,e[11]=x,e[12]=j):j=e[12],j}function ts(t){const e=G.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=q.useState(!1),[d,g]=q.useState("");let m;e[0]!==d?(m=d.trim(),e[0]=d,e[1]=m):m=e[1];const h=m,f=$t(h,150),u=h.length>0,x=f===h,{hits:j,isSearching:w,isStale:O,isError:p}=es(u?f:""),y=u?j:s;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=H=>{c(H),H||g("")},e[2]=v):v=e[2];const z=v;let b;e[3]!==n?(b=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=b):b=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>z(!0),e[5]=A):A=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=i.jsx(Lt,{size:18}),e[6]=I):I=e[6];let _;e[7]!==b?(_=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":b,onClick:A,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:I})}),e[7]=b,e[8]=_):_=e[8];let E;e[9]!==r||e[10]!==n?(E=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=E):E=e[11];let R;e[12]!==E?(R=i.jsx(me,{side:"right",children:E}),e[12]=E,e[13]=R):R=e[13];let T;e[14]!==_||e[15]!==R?(T=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[_,R]})}),e[14]=_,e[15]=R,e[16]=T):T=e[16];let P;e[17]!==n?(P=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=P):P=e[18];let S;e[19]!==n?(S=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=S):S=e[20];let C;e[21]!==n?(C=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=C):C=e[22];let M;e[23]!==d||e[24]!==C?(M=i.jsx(kt,{value:d,onValueChange:g,placeholder:C}),e[23]=d,e[24]=C,e[25]=M):M=e[25];const F=u&&(O||!x)&&"opacity-50";let K;e[26]!==F?(K=Y(F),e[26]=F,e[27]=K):K=e[27];let D;e[28]!==p||e[29]!==u||e[30]!==n?(D=u&&p&&i.jsx(Ee,{children:n("sidebar.rail.searchFailed")}),e[28]=p,e[29]=u,e[30]=n,e[31]=D):D=e[31];let $;e[32]!==p||e[33]!==w||e[34]!==y.length||e[35]!==x||e[36]!==n?($=!p&&x&&!w&&y.length===0&&i.jsx(Ee,{children:n("sidebar.rail.searchEmpty")}),e[32]=p,e[33]=w,e[34]=y.length,e[35]=x,e[36]=n,e[37]=$):$=e[37];let L;if(e[38]!==o||e[39]!==l||e[40]!==y||e[41]!==n){let H;e[43]!==o||e[44]!==l||e[45]!==n?(H=X=>i.jsxs(Pt,{value:X.slug,onSelect:()=>{z(!1),X.slug!==o&&l(X.slug)},className:"gap-2.5",children:[i.jsx(Ce,{org:X,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.name}),X.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},X.id),e[43]=o,e[44]=l,e[45]=n,e[46]=H):H=e[46],L=y.map(H),e[38]=o,e[39]=l,e[40]=y,e[41]=n,e[42]=L}else L=e[42];let k;e[47]!==K||e[48]!==D||e[49]!==$||e[50]!==L?(k=i.jsxs(Dt,{className:K,children:[D,$,L]}),e[47]=K,e[48]=D,e[49]=$,e[50]=L,e[51]=k):k=e[51];let W;e[52]!==a||e[53]!==P||e[54]!==S||e[55]!==M||e[56]!==k?(W=i.jsxs(Mt,{open:a,onOpenChange:z,title:P,description:S,shouldFilter:!1,children:[M,k]}),e[52]=a,e[53]=P,e[54]=S,e[55]=M,e[56]=k,e[57]=W):W=e[57];let U;return e[58]!==W||e[59]!==T?(U=i.jsxs(i.Fragment,{children:[T,W]}),e[58]=W,e[59]=T,e[60]=U):U=e[60],U}function ss(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const ns=()=>Ke(globalThis.innerHeight),is=()=>Ke(0);function rs(t){const e=G.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,d=J();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:u,isDragging:x}=xt(g);let j;e[2]!==f?(j=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const w=x?1:void 0,O=`rail-org-${s.slug}`;let p;e[4]!==j||e[5]!==w||e[6]!==O||e[7]!==u?(p={transform:j,transition:u,zIndex:w,viewTransitionName:O},e[4]=j,e[5]=w,e[6]=O,e[7]=u,e[8]=p):p=e[8];const y=s.name,v=o||void 0,z=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",b=r&&"cursor-pointer";let A;e[9]!==z||e[10]!==b?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",z,b),e[9]=z,e[10]=b,e[11]=A):A=e[11];let I;e[12]!==s?(I=i.jsx(Ce,{org:s,size:"lg"}),e[12]=s,e[13]=I):I=e[13];let _;e[14]!==l?(_=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(Ae,{size:9})}),e[14]=l,e[15]=_):_=e[15];let E;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==I||e[20]!==_||e[21]!==v?(E=i.jsx(he,{asChild:!0,children:i.jsx(wt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":y,"aria-current":v,onClick:r,className:A,children:[I,_]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=I,e[20]=_,e[21]=v,e[22]=E):E=e[22];let R;e[23]!==s.name?(R=i.jsx(me,{side:"right",children:s.name}),e[23]=s.name,e[24]=R):R=e[24];let T;e[25]!==E||e[26]!==R?(T=i.jsxs(ge,{children:[E,R]}),e[25]=E,e[26]=R,e[27]=T):T=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(vt,{}),e[28]=P):P=e[28];let S;e[29]!==d?(S=d("sidebar.rail.organizationSettings"),e[29]=d,e[30]=S):S=e[30];let C;e[31]!==n||e[32]!==S?(C=i.jsxs(ze,{onSelect:n,children:[P,S]}),e[31]=n,e[32]=S,e[33]=C):C=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ae,{}),e[34]=M):M=e[34];let F;e[35]!==l||e[36]!==d?(F=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=d,e[37]=F):F=e[37];let K;e[38]!==a||e[39]!==F?(K=i.jsxs(ze,{onSelect:a,children:[M,F]}),e[38]=a,e[39]=F,e[40]=K):K=e[40];let D;e[41]!==c||e[42]!==d?(D=c&&i.jsxs(ze,{onSelect:c,children:[i.jsx(bt,{}),d("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=d,e[43]=D):D=e[43];let $;e[44]!==C||e[45]!==K||e[46]!==D?($=i.jsxs(zt,{children:[C,K,D]}),e[44]=C,e[45]=K,e[46]=D,e[47]=$):$=e[47];let L;e[48]!==T||e[49]!==$?(L=i.jsxs(Ot,{children:[T,$]}),e[48]=T,e[49]=$,e[50]=L):L=e[50];let k;e[51]!==o||e[52]!==L?(k=i.jsx(ve,{active:o,children:L}),e[51]=o,e[52]=L,e[53]=k):k=e[53];let W;return e[54]!==h||e[55]!==m||e[56]!==k||e[57]!==p?(W=i.jsx("div",{ref:m,...h,style:p,className:"w-full shrink-0 touch-none",children:k}),e[54]=h,e[55]=m,e[56]=k,e[57]=p,e[58]=W):W=e[58],W}function os(t){const e=G.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,d,g,m,h,f,u,x,j,w,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const M=jt(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",g=ge,d=he,w=!0,c=ke,m=Ze.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,u=r||void 0,e[20]!==n?(x=()=>{je("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=x):x=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",M.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=d,e[8]=g,e[9]=m,e[10]=h,e[11]=f,e[12]=u,e[13]=x,e[14]=j,e[15]=w,e[16]=O}else c=e[6],d=e[7],g=e[8],m=e[9],h=e[10],f=e[11],u=e[12],x=e[13],j=e[14],w=e[15],O=e[16];let p;e[22]!==s.icon||e[23]!==s.title?(p=i.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=p):p=e[24];let y;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==u||e[30]!==x||e[31]!==j||e[32]!==p?(y=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":u,onClick:x,className:j,children:p}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=u,e[30]=x,e[31]=j,e[32]=p,e[33]=y):y=e[33];let v;e[34]!==d||e[35]!==y||e[36]!==w?(v=i.jsx(d,{asChild:w,children:y}),e[34]=d,e[35]=y,e[36]=w,e[37]=v):v=e[37];let z;e[38]!==s.title?(z=i.jsx(me,{side:"right",children:s.title}),e[38]=s.title,e[39]=z):z=e[39];let b;e[40]!==g||e[41]!==v||e[42]!==z?(b=i.jsxs(g,{children:[v,z]}),e[40]=g,e[41]=v,e[42]=z,e[43]=b):b=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let I;e[44]!==A?(I=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=I):I=e[45];let _;e[46]!==s.title||e[47]!==I?(_=i.jsx("span",{"aria-hidden":!0,className:I,children:s.title}),e[46]=s.title,e[47]=I,e[48]=_):_=e[48];let E;e[49]!==s.title||e[50]!==a?(E=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=E):E=e[51];let R;e[52]!==l?(R=()=>{je("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=R):R=e[53];let T,P;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=Y("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),P=i.jsx(Me,{size:10}),e[54]=T,e[55]=P):(T=e[54],P=e[55]);let S;e[56]!==E||e[57]!==R?(S=i.jsx("button",{type:"button","aria-label":E,onClick:R,className:T,children:P}),e[56]=E,e[57]=R,e[58]=S):S=e[58];let C;return e[59]!==b||e[60]!==_||e[61]!==S||e[62]!==O?(C=i.jsxs("div",{className:O,children:[b,_,S]}),e[59]=b,e[60]=_,e[61]=S,e[62]=O,e[63]=C):C=e[63],C}const ls={"site-editor":"/site-editor"};function as(t){const e=G.c(26),{app:s}=t,o=J(),r=Ct[s],l=ls[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let d;e[8]!==r.Icon?(d=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=d):d=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(g=i.jsx(he,{asChild:!0,children:i.jsx(ke,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=g):g=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(me,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==g||e[21]!==h?(f=i.jsxs(ge,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=f):f=e[22];let u;return e[23]!==n||e[24]!==f?(u=i.jsx(ve,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=u):u=e[25],u}function cs(){const{org:t}=Le();return Nt(t.slug),null}function Fe(t){const e=G.c(56),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Ue(),{org:l}=Le(),n=Je();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:hs},e[0]=a):a=e[0];const c=Ve(a);let d;e[1]!==c||e[2]!==n?(d=c?n({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=c,e[2]=n,e[3]=d):d=e[3];const g=d,m=g?g.org:l.slug,{data:h}=Qe(),[f,u]=q.useState(!1),x=Re(),{recent:j,forget:w}=Et(l.slug),{projects:O}=Tt(),p=It(),y=At(),v=y&&y.projectId===null?y.app:null,z=v?[]:j.flatMap(N=>O.filter(B=>B.id===N)),b=Ht(h??[],l),{recent:A,remember:I}=qt();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=_e.railOrgPrefs(),e[4]=_):_=e[4];const[E,R]=ye(_,We),T=ue(E),P=q.useSyncExternalStore(ss,ns,is),{shown:S}=Xt(Vt(b,T,l.slug),A,l.slug,P,T.pinned);let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[5]=C):C=e[5];const M=ct(dt(mt,C)),F=N=>{const{active:B,over:ce}=N;ce&&(je("org_rail_reordered"),R(Ge=>Qt(ue(Ge),S.map(fs),String(B.id),String(ce.id))))},K=N=>{s?.(),r({to:"/$org/home",params:{org:N},viewTransition:!0})},D=N=>{je("org_rail_travel");const B=S.some(ce=>ce.slug===N);R(ce=>Ut(ue(ce),N)),I(N,B?S.map(us):void 0),K(N)},$=!x&&"border-r border-sidebar-border";let L;e[6]!==$?(L=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",$),e[6]=$,e[7]=L):L=e[7];let k;e[8]!==o?(k=o("sidebar.rail.ariaLabel"),e[8]=o,e[9]=k):k=e[9];const W=ut,U=ft,H=gt,X=S.map(ds),Se=pt,we=S.map(N=>i.jsxs(q.Fragment,{children:[i.jsx(rs,{org:N,active:N.slug===m,pinned:T.pinned.includes(N.slug),onSelect:N.slug!==l.slug?()=>D(N.slug):p?()=>K(N.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>R(B=>Jt(ue(B),N.slug)),onHide:N.slug===l.slug?void 0:()=>R(B=>Yt(ue(B),N.slug))}),N.slug===l.slug&&z.length>0&&i.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:z.map(B=>i.jsx(os,{project:B,orgSlug:l.slug,active:p===B.id,onClose:()=>w(B.id),onNavigate:s},B.id))})]},N.id));let V;e[10]!==H||e[11]!==X||e[12]!==Se||e[13]!==we?(V=i.jsx(H,{items:X,strategy:Se,children:we}),e[10]=H,e[11]=X,e[12]=Se,e[13]=we,e[14]=V):V=e[14];let Q;e[15]!==W||e[16]!==F||e[17]!==M||e[18]!==V||e[19]!==U?(Q=i.jsx(W,{sensors:M,collisionDetection:U,onDragEnd:F,children:V}),e[15]=W,e[16]=F,e[17]=M,e[18]=V,e[19]=U,e[20]=Q):Q=e[20];let Z;e[21]!==l.slug||e[22]!==b||e[23]!==S.length||e[24]!==D?(Z=b.length>S.length&&i.jsx(ts,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-S.length,onSelect:D}),e[21]=l.slug,e[22]=b,e[23]=S.length,e[24]=D,e[25]=Z):Z=e[25];let ee;e[26]!==o?(ee=o("sidebar.picker.newOrganization"),e[26]=o,e[27]=ee):ee=e[27];let te;e[28]!==u?(te=()=>u(!0),e[28]=u,e[29]=te):te=e[29];let pe;e[30]===Symbol.for("react.memo_cache_sentinel")?(pe=i.jsx(St,{size:18}),e[30]=pe):pe=e[30];let se;e[31]!==ee||e[32]!==te?(se=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":ee,onClick:te,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:pe})}),e[31]=ee,e[32]=te,e[33]=se):se=e[33];let ne;e[34]!==o?(ne=o("sidebar.picker.newOrganization"),e[34]=o,e[35]=ne):ne=e[35];let ie;e[36]!==ne?(ie=i.jsx(me,{side:"right",children:ne}),e[36]=ne,e[37]=ie):ie=e[37];let re;e[38]!==se||e[39]!==ie?(re=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[se,ie]})}),e[38]=se,e[39]=ie,e[40]=re):re=e[40];let oe;e[41]!==v?(oe=v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(as,{app:v})]}),e[41]=v,e[42]=oe):oe=e[42];let le;e[43]!==Q||e[44]!==Z||e[45]!==re||e[46]!==oe||e[47]!==L||e[48]!==k?(le=i.jsxs("div",{className:L,"aria-label":k,children:[Q,Z,re,oe]}),e[43]=Q,e[44]=Z,e[45]=re,e[46]=oe,e[47]=L,e[48]=k,e[49]=le):le=e[49];let ae;e[50]!==f||e[51]!==u?(ae=i.jsx(Rt,{open:f,onOpenChange:u}),e[50]=f,e[51]=u,e[52]=ae):ae=e[52];let xe;return e[53]!==le||e[54]!==ae?(xe=i.jsxs(i.Fragment,{children:[le,ae]}),e[53]=le,e[54]=ae,e[55]=xe):xe=e[55],xe}function ds(t){return t.slug}function us(t){return t.slug}function fs(t){return t.slug}function hs(t){return t.isLoading}function ms(t){const e=G.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:d}=De(),g=Re();if(d||g)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},u=i.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 group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=u):(f=e[4],u=e[5]);let x;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(x=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:u}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=x):x=e[14],x}const Oe=400,Ie=16,gs="sidebar.width.v2";function ps(){const t=G.c(14),e=xs;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>typeof u=="number"?e(u):192,t[0]=s):s=t[0];const[o,r]=ye(gs,s),l=q.useRef(null);let n;t[1]!==r||t[2]!==o?(n=u=>{u.preventDefault();const x=u.clientX,j=e(o),w=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const v of O)v.style.transition="none";const p=v=>{const z=e(j+(v.clientX-x));w?.style.setProperty("--sidebar-width",`${z}px`)},y=v=>{const z=e(j+(v.clientX-x));r(z);for(const b of O)b.style.transition="";window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",p),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const d=c;let g;t[6]!==r||t[7]!==o?(g=u=>{if(u.key==="ArrowLeft")r(e(o-Ie));else if(u.key==="ArrowRight")r(e(o+Ie));else if(u.key==="Home")r(192);else if(u.key==="End")r(Oe);else return;u.preventDefault()},t[6]=r,t[7]=o,t[8]=g):g=t[8];const m=g,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==d||t[12]!==h?(f={width:h,minWidth:192,maxWidth:Oe,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:d},t[9]=m,t[10]=a,t[11]=d,t[12]=h,t[13]=f):f=t[13],f}function xs(t){return Math.max(192,Math.min(Oe,t))}const Be=q.createContext(null);function bs(){const t=q.use(Be);if(!t)throw new Error("Layout regions require a Layout");return t}function js({children:t,notice:e,outsideOrg:s}){const o=at(),[r,l]=ye(_e.sidebarOpen(),!0),n=ps(),a=Pe();return i.jsx(Be,{value:{isMobile:o,resize:n},children:i.jsx(tt,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(cs,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Fe,{}),i.jsx(st,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(nt,{children:t})})]})]})})})}function ys(t){const e=G.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=bs(),{openMobile:a,setOpenMobile:c}=De(),d=Re(),g=Pe();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const v=g&&d;let z;e[2]!==s||e[3]!==v?(z=i.jsx("div",{className:"contents",inert:v,children:s}),e[2]=s,e[3]=v,e[4]=z):z=e[4];let b;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(b=i.jsx(ms,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=b):b=e[11];let A;return e[12]!==z||e[13]!==b?(A=i.jsxs(i.Fragment,{children:[z,b]}),e[12]=z,e[13]=b,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let u;e[17]!==f?(u=i.jsx(rt,{className:"sr-only",children:f}),e[17]=f,e[18]=u):u=e[18];let x;e[19]!==h||e[20]!==g?(x=g&&i.jsx(Fe,{onNavigate:h}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let w;e[25]!==j?(w=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=w):w=e[26];let O;e[27]!==x||e[28]!==w?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[x,w]}),e[27]=x,e[28]=w,e[29]=O):O=e[29];let p;e[30]!==u||e[31]!==O?(p=i.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:vs,children:[u,O]}),e[30]=u,e[31]=O,e[32]=p):p=e[32];let y;return e[33]!==a||e[34]!==c||e[35]!==p?(y=i.jsx(lt,{open:a,onOpenChange:c,children:p}),e[33]=a,e[34]=c,e[35]=p,e[36]=y):y=e[36],y}function vs(t){return t.preventDefault()}function Ss(t){const e=G.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(it,{className:"flex flex-col min-h-0",style:o,children:i.jsx(et,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Hs=Object.assign(js,{Sidebar:ys,Content:Ss});export{Gs as I,Hs as L,Ce as O,es as u,Ht as w};