decocms 4.213.3 → 4.213.5

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 (228) hide show
  1. package/dist/client/assets/{AlertCircle-CHfb9x-t.js → AlertCircle-BWDnTsmK.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DgCu30RO.js → AreaChart-IB77Vhp3.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BppNd44v.js → ArrowLeft-DVsBvE7g.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CoPBJP5F.js → ArrowUp-BIWZ-Zm0.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BoRcUfPT.js → ArrowUpRight-9a2Pp6SJ.js} +1 -1
  6. package/dist/client/assets/{Check-oDnQWrwG.js → Check-7WAvFi-X.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DYHnrji_.js → CheckCircle-BxGsU5ea.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-B_Kkx94b.js → ChevronDown-DDAzQt6T.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-zfsu59r1.js → ChevronRight-CumQ7Y3c.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-EPvH8PkI.js → ChevronUp-CfrRYWx0.js} +1 -1
  11. package/dist/client/assets/{Copy01-eDDf5Tut.js → Copy01-emQNe-na.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-CLo4Ix8E.js → CpuChip01-BZERwn-Y.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-xE5_nqV3.js → CreditCard01-ChcGWPdA.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-D_v8MV1q.js → DotsVertical-CVGyjria.js} +1 -1
  15. package/dist/client/assets/{Eye-C-shpZBx.js → Eye-B2iGLYP5.js} +1 -1
  16. package/dist/client/assets/{FilterLines-eIVOYmnR.js → FilterLines-CmwMvBpb.js} +1 -1
  17. package/dist/client/assets/{Globe01-CRzaXNDn.js → Globe01-CG8woUvQ.js} +1 -1
  18. package/dist/client/assets/{Globe04-DNZHTV5G.js → Globe04-Ce-zfyTK.js} +1 -1
  19. package/dist/client/assets/{HardDrive-D838hg9y.js → HardDrive-D0B55OwB.js} +1 -1
  20. package/dist/client/assets/{Key01-D5nk6wZa.js → Key01-CSUPWNtZ.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-lpjOn5oi.js → LayoutLeft-abZzAh0Z.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-i_xcWupG.js → LinkExternal01-CIUiuJI2.js} +1 -1
  23. package/dist/client/assets/{LogOut01-BjxuTdOd.js → LogOut01-BipgIR60.js} +1 -1
  24. package/dist/client/assets/{Monitor01-CdHR20C9.js → Monitor01-BxT46IoP.js} +1 -1
  25. package/dist/client/assets/{Palette-C4JrvRwY.js → Palette-D6vOAUYn.js} +1 -1
  26. package/dist/client/assets/{Play-B_-mBOJ3.js → Play-sVwBY1NN.js} +1 -1
  27. package/dist/client/assets/{Plus-CM2iw1bv.js → Plus-KRh9j6XC.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DzzT_0F0.js → SearchLg-D9_yLnhj.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CCKu2g_A.js → SearchMd-g2EyVZW3.js} +1 -1
  30. package/dist/client/assets/{Settings02-G48i2TjO.js → Settings02-D5EXr4GC.js} +1 -1
  31. package/dist/client/assets/{Share07-DsYUX-zt.js → Share07-CmNWLd8X.js} +1 -1
  32. package/dist/client/assets/{Shield01-BoXn0azv.js → Shield01-BLHZd-DF.js} +1 -1
  33. package/dist/client/assets/{Star01-BDPsn3iM.js → Star01-C-jBz2wz.js} +1 -1
  34. package/dist/client/assets/{Stars01-DfGag_qD.js → Stars01-DD_9MFaY.js} +1 -1
  35. package/dist/client/assets/{Stars02-uHXuTrxv.js → Stars02-ByC2w8gM.js} +1 -1
  36. package/dist/client/assets/{Sun-C1BvCEJt.js → Sun-wg-cv_Yg.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-B1Yc4H4f.js → SwitchHorizontal01-Bd3QKMh1.js} +1 -1
  38. package/dist/client/assets/{Tool01-CGHeK1WE.js → Tool01-DJWvUdRn.js} +1 -1
  39. package/dist/client/assets/{Tool02-B1POxF2I.js → Tool02-DpdVhL0m.js} +1 -1
  40. package/dist/client/assets/{Trash01-CpLttFqU.js → Trash01-h_oyaZP1.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-CjL_HE91.js → TrendUp01-B18kPLjE.js} +1 -1
  42. package/dist/client/assets/{Upload01-Jc9Qf52D.js → Upload01-DRey_V3_.js} +1 -1
  43. package/dist/client/assets/{User01-DdVFKZ7n.js → User01-DsPz_8Cg.js} +1 -1
  44. package/dist/client/assets/{Users01-H9nHn8vh.js → Users01-WLzsa5xo.js} +1 -1
  45. package/dist/client/assets/{Users03-DLe7GAgY.js → Users03-CGwaCKmz.js} +1 -1
  46. package/dist/client/assets/{X-BJV63bzn.js → X-BLMSR2fx.js} +1 -1
  47. package/dist/client/assets/{XCircle-e8oZxnqK.js → XCircle-B278tfex.js} +1 -1
  48. package/dist/client/assets/{XClose-CZmy9H1H.js → XClose-DiVQMRNE.js} +1 -1
  49. package/dist/client/assets/{Zap-Blr-6e3X.js → Zap-Cy8qu-W6.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-BakcP9-y.js → ZapSquare-DS9QQvEJ.js} +1 -1
  51. package/dist/client/assets/{access-gate-DmHQwKVk.js → access-gate-CeqGFdH3.js} +1 -1
  52. package/dist/client/assets/{agent-icon-CcGcwzy7.js → agent-icon-CFXZTI_j.js} +1 -1
  53. package/dist/client/assets/{agents-list-Be_OHGrc.js → agents-list-hcYe0Sui.js} +1 -1
  54. package/dist/client/assets/{ai-providers-CmgiWm5v.js → ai-providers-D_sicqWa.js} +1 -1
  55. package/dist/client/assets/{alert-CI_5B43q.js → alert-BY1c0DW2.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-r60zVmnF.js → alert-dialog-ynETGH7r.js} +1 -1
  57. package/dist/client/assets/{app-editor-CN-vz_rI.js → app-editor-CpahxM1F.js} +1 -1
  58. package/dist/client/assets/{auth-CqUqMsnu.js → auth-BXPQkeoy.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-CIvttEN1.js → auth-catchall-CPwGBP0l.js} +1 -1
  60. package/dist/client/assets/{auth-entry-D4lmldKW.js → auth-entry-C8KVZm2g.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-BJHpY4m1.js → auth-split-layout-BGDr1mma.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-C2niz4aW.js → authenticate-and-persist-oauth-BgSdBXRI.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DOKJeKYO.js → automation-list-row-DKmikVqJ.js} +1 -1
  64. package/dist/client/assets/{automation-runs-OtdSB4BI.js → automation-runs-DRXVnqv2.js} +1 -1
  65. package/dist/client/assets/{automations-B9ewyt3l.js → automations-lHIqKALS.js} +1 -1
  66. package/dist/client/assets/{avatar-BXWNF77j.js → avatar-D4Gp0_T6.js} +1 -1
  67. package/dist/client/assets/{badge-DAoU6Imp.js → badge-CQc7UGAT.js} +1 -1
  68. package/dist/client/assets/{billing-B_QTma3a.js → billing-CtYc_JlW.js} +2 -2
  69. package/dist/client/assets/{block-document-BjlKi5WF.js → block-document-DSgYnJ-r.js} +1 -1
  70. package/dist/client/assets/{brand-context-D4Ly8FY6.js → brand-context-CCAdiaO8.js} +1 -1
  71. package/dist/client/assets/{buckets-Bqv0L4nF.js → buckets-3ZxZ_5Ji.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-D6dr2KuO.js → bulk-category-panel-CKDrGr50.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-D7FJThIs.js → capability-load-error-Bx4ZqJun.js} +1 -1
  74. package/dist/client/assets/{card-CqzhZRSV.js → card-B1MB2XIq.js} +1 -1
  75. package/dist/client/assets/{cards--2WkELWt.js → cards-D_Lke0Fw.js} +1 -1
  76. package/dist/client/assets/{category-editor-DzJMnASB.js → category-editor-CyQ3EzCh.js} +1 -1
  77. package/dist/client/assets/{chat-context-CPTHsiXT.js → chat-context-DOTgxfnO.js} +1 -1
  78. package/dist/client/assets/{checkbox-DQLcQWSw.js → checkbox-B3tu6pXL.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-DjUc2KM9.js → cli-auth-success-lxO8kwV0.js} +1 -1
  80. package/dist/client/assets/{collection-detail-CQ42GoY4.js → collection-detail-CI4-mlAE.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-Cblelkyf.js → collection-display-button-CG2AhdBO.js} +1 -1
  82. package/dist/client/assets/{collection-search-DgyknVYJ.js → collection-search-TzXSHwsA.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-CLzjGn94.js → collection-table-wrapper-Ddud7U0h.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-_w1KzSrn.js → collection-tabs-C-pb2dPt.js} +1 -1
  85. package/dist/client/assets/{command-ZczUCKOE.js → command-Be0gh_Jx.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-Ch2Kvk2v.js → commerce-onboarding-QpBQYIAb.js} +1 -1
  87. package/dist/client/assets/{connect-C3Le2MXn.js → connect-DsryHhVD.js} +1 -1
  88. package/dist/client/assets/{connection-CEk4ULDk.js → connection-DfWKdLFm.js} +1 -1
  89. package/dist/client/assets/{connection-card-DdbLECLO.js → connection-card-C9V1KBF_.js} +1 -1
  90. package/dist/client/assets/{connection-detail-C3tTPFQD.js → connection-detail-C2UbhEZW.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-pxk9NpaA.js → connection-form-helpers-U9QEikZB.js} +1 -1
  92. package/dist/client/assets/connections-BxMwkkUO.js +1 -0
  93. package/dist/client/assets/{decopilot-sse-pool-l6_CQjlA.js → decopilot-sse-pool-KSjCShMZ.js} +1 -1
  94. package/dist/client/assets/{dialog-C1nMHamp.js → dialog-BlfHYeFc.js} +1 -1
  95. package/dist/client/assets/{domain-settings-DS_O4W-Z.js → domain-settings-CkIV6Ggu.js} +1 -1
  96. package/dist/client/assets/{drawer-DEkxI9w4.js → drawer-FBry2ukP.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-A0sNkJ-D.js → dropdown-menu-B6LwWkvh.js} +1 -1
  98. package/dist/client/assets/{empty-state-DXjPkc2c.js → empty-state-s02r9CMc.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-Cn56rg8y.js → extract-connection-data-CzvlGw-U.js} +1 -1
  100. package/dist/client/assets/{file-explorer-C3DFjQ2p.js → file-explorer-BSjXdYV7.js} +2 -2
  101. package/dist/client/assets/{file-type-icon-CfHt3K89.js → file-type-icon-Dq3kZ9vZ.js} +1 -1
  102. package/dist/client/assets/{form-R10hO2J-.js → form-BhiAOBc7.js} +1 -1
  103. package/dist/client/assets/{general-BR8lLLsO.js → general-B2jho8T4.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-C7HmB7sD.js → github-repo-picker-CyTvg6P_.js} +1 -1
  105. package/dist/client/assets/{hooks-PrPdbNKh.js → hooks-DR_K28WC.js} +1 -1
  106. package/dist/client/assets/{index-CWpL3L1c.js → index-B10yhMyf.js} +1 -1
  107. package/dist/client/assets/{index-fnW3g-fp.js → index-BSmhfQjB.js} +1 -1
  108. package/dist/client/assets/{index-UJExPiWH.js → index-BoGslO39.js} +1 -1
  109. package/dist/client/assets/{index-6CjSbeiO.js → index-Bs4Wh_Lx.js} +5 -5
  110. package/dist/client/assets/{index-D5m1bkFb.js → index-C1T7qyVj.js} +1 -1
  111. package/dist/client/assets/{index-BncSXQMZ.js → index-ChqvT3Jw.js} +1 -1
  112. package/dist/client/assets/{index-D05cQ3iM.js → index-Cs1qeBli.js} +1 -1
  113. package/dist/client/assets/{index-S4-F33Y4.js → index-D2tWT1ul.js} +1 -1
  114. package/dist/client/assets/{index-B3atnTOD.js → index-D5h-RA3J.js} +36 -36
  115. package/dist/client/assets/{index-D0v2h85f.js → index-DqAzmrb9.js} +4 -4
  116. package/dist/client/assets/{index-redirect-pKYyB43h.js → index-redirect-DredFhdd.js} +1 -1
  117. package/dist/client/assets/{input-CGnplup6.js → input-CBPk2Ds2.js} +1 -1
  118. package/dist/client/assets/{integration-icon-C_pPMzGj.js → integration-icon-c7-JobNw.js} +1 -1
  119. package/dist/client/assets/{invite-member-dialog-C_aJOXl_.js → invite-member-dialog-ZOgeDUHg.js} +1 -1
  120. package/dist/client/assets/{label-DfxdANU7.js → label-BOB3sH-D.js} +1 -1
  121. package/dist/client/assets/{layout-uQx0l2IO.js → layout-B7Vwd8PM.js} +1 -1
  122. package/dist/client/assets/{login-CqR87GVZ.js → login-CsK4f2_D.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-BsOFbQiK.js → mcp-oauth-GA_AotKT.js} +1 -1
  124. package/dist/client/assets/{members-B_mSaJSC.js → members-CjisA7Y2.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-7A-fQDgF.js → monaco-editor-NXDX0zKn.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BIhRW2GN.js → monitoring-stats-row-DD877zmw.js} +3 -3
  127. package/dist/client/assets/{multi-select-CYuaNCqS.js → multi-select-DetlY38B.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-D3o7fRHA.js → oauth-callback-DIMAojfg.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-BDp9u1N_.js → oauth-callback-ai-provider-ROvHq7Uo.js} +1 -1
  130. package/dist/client/assets/{onboarding-CWgzyIuE.js → onboarding-D5V-Ei3r.js} +1 -1
  131. package/dist/client/assets/{org-layout-hJGjBdI1.js → org-layout-FMbF3Jb4.js} +1 -1
  132. package/dist/client/assets/{organization-choice-CfASQLFM.js → organization-choice-BcQb-6_S.js} +1 -1
  133. package/dist/client/assets/{orgs-BCbdr2Ag.js → orgs-DWS-cePv.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-CZ55g9px.js → page-seo-form-CJi3xngJ.js} +1 -1
  135. package/dist/client/assets/{popover-CWSecgpe.js → popover-CrgGQkZP.js} +1 -1
  136. package/dist/client/assets/{post-editor--VaER4Le.js → post-editor-BXiHX0mU.js} +1 -1
  137. package/dist/client/assets/{primitives-DUTJ8tSg.js → primitives-DlwS8xQ4.js} +1 -1
  138. package/dist/client/assets/{profile-BHMEwPiN.js → profile-thBIGym-.js} +1 -1
  139. package/dist/client/assets/{project-app-view-CnenONgb.js → project-app-view-Kl8fw9HK.js} +1 -1
  140. package/dist/client/assets/record-editor-C6HPDAGJ.js +1 -0
  141. package/dist/client/assets/redirect-editor-kxELZ2uK.js +1 -0
  142. package/dist/client/assets/registry-CSEPHjEw.js +2 -0
  143. package/dist/client/assets/{registry-layout-qYPm_LZb.js → registry-layout-ByKSiacx.js} +1 -1
  144. package/dist/client/assets/{reports-Dlzghqyq.js → reports-B1K85RSW.js} +1 -1
  145. package/dist/client/assets/{require-capability-BG_iELo7.js → require-capability-DPn__sbL.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-D6aEDoml.js → required-auth-layout-C8XW5pPu.js} +1 -1
  147. package/dist/client/assets/{reset-password-CtLUTKQQ.js → reset-password-DiSxyTP5.js} +1 -1
  148. package/dist/client/assets/{roles-D6ATKv7U.js → roles-DlBYcNbs.js} +1 -1
  149. package/dist/client/assets/{search-input-hKyul0tm.js → search-input-WVzZekD4.js} +1 -1
  150. package/dist/client/assets/{secrets-D9vMgbHZ.js → secrets-T6WF4iED.js} +1 -1
  151. package/dist/client/assets/{sections-editor-BlmmXO47.js → sections-editor-cnSkggZl.js} +1 -1
  152. package/dist/client/assets/{select-model-CoMCgT-3.js → select-model-5S1ChDGt.js} +1 -1
  153. package/dist/client/assets/{select-n13gZUR4.js → select-rJkR_gvP.js} +1 -1
  154. package/dist/client/assets/self-tool-result-C_0Vo1wf.js +1 -0
  155. package/dist/client/assets/{seo-editor-C1qvHDNz.js → seo-editor-CsAHfVj0.js} +1 -1
  156. package/dist/client/assets/{settings-layout-CApJl47p.js → settings-layout-Ct0LPR0G.js} +1 -1
  157. package/dist/client/assets/{settings-section-D4f-00oI.js → settings-section-3LqbPXnx.js} +1 -1
  158. package/dist/client/assets/{shell-controls-BnST0ag_.js → shell-controls-Bubj5ofh.js} +1 -1
  159. package/dist/client/assets/{shell-layout-CPfuamIU.js → shell-layout-C01QrzQo.js} +1 -1
  160. package/dist/client/assets/{sidebar-Lv799Z-V.js → sidebar-vViO6g4B.js} +1 -1
  161. package/dist/client/assets/{skeleton-Djn5TkUR.js → skeleton-CL3BTEwq.js} +1 -1
  162. package/dist/client/assets/{spinner-ChNwS7_i.js → spinner-CvvlYw0Q.js} +1 -1
  163. package/dist/client/assets/{sso-BkEIQ9Cs.js → sso-DCuM-zOQ.js} +1 -1
  164. package/dist/client/assets/{store-Cc1VFpBL.js → store-CyiQhz58.js} +1 -1
  165. package/dist/client/assets/store-registry-BMFwrlo8.js +2 -0
  166. package/dist/client/assets/{studio-tools-BtWHGFPU.js → studio-tools-BeO54KZA.js} +1 -1
  167. package/dist/client/assets/{switch-1BnhIFND.js → switch-CGDS1hSQ.js} +1 -1
  168. package/dist/client/assets/{synced-repos-BKWg-xbi.js → synced-repos-BTwCnrQj.js} +1 -1
  169. package/dist/client/assets/{tab-id-CRGilEHg.js → tab-id-CW_C6dRF.js} +1 -1
  170. package/dist/client/assets/{table-0E7ZOwvy.js → table-B6xpWVKL.js} +1 -1
  171. package/dist/client/assets/{tabs-D8y23nM4.js → tabs-DXyCPlWJ.js} +1 -1
  172. package/dist/client/assets/{textarea-C5-ccd3M.js → textarea-DIWSPxFy.js} +1 -1
  173. package/dist/client/assets/{toggle-group-DHdlMPfI.js → toggle-group-C-BMgiwu.js} +1 -1
  174. package/dist/client/assets/{toolbar-DDqrHoei.js → toolbar-B6misCX5.js} +1 -1
  175. package/dist/client/assets/{tooltip-KklTekq-.js → tooltip-DvFWNEDZ.js} +1 -1
  176. package/dist/client/assets/{track-Dw02MQy6.js → track-B5LlpjI7.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-CN1yjbVc.js → use-ai-providers-C2iu6mzc.js} +1 -1
  178. package/dist/client/assets/{use-automations-CC95HsJ3.js → use-automations-CUmQkHyY.js} +1 -1
  179. package/dist/client/assets/{use-autosave-DqUaFQu2.js → use-autosave-BTbZvksM.js} +1 -1
  180. package/dist/client/assets/{use-capability-BJXC5dNN.js → use-capability-DrzlW7so.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-D1xip4IB.js → use-clock-tick-9QE_PsZO.js} +1 -1
  182. package/dist/client/assets/{use-connection-C1X3lSVO.js → use-connection-1Q4RUKqc.js} +1 -1
  183. package/dist/client/assets/{use-copy-CeBzb7Hf.js → use-copy-Do31Tm4X.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-C5qrolYI.js → use-create-virtual-mcp-kZcs1owq.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-BQ-qnhi7.js → use-debounced-autosave-Cwchio0s.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-D7TAcVXO.js → use-debounced-value-CzHGrIM_.js} +1 -1
  187. package/dist/client/assets/{use-deco-credits-LrXk-MBS.js → use-deco-credits-CKR9xaP4.js} +1 -1
  188. package/dist/client/assets/{use-decopilot-events-CxiZgv6A.js → use-decopilot-events-eJfwl8Sl.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-BAm9G1ay.js → use-delete-connection-D_FLVtNN.js} +1 -1
  190. package/dist/client/assets/{use-deployment-admin-DCwfUCBl.js → use-deployment-admin-C3d7M3a9.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-MR70qXpO.js → use-file-configs-BmKjVP8T.js} +1 -1
  192. package/dist/client/assets/{use-infinite-scroll-B7qrPvcH.js → use-infinite-scroll-qQ-p16F-.js} +1 -1
  193. package/dist/client/assets/{use-join-requests-DHGypITc.js → use-join-requests-CBhzjRSL.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-DkEyYZ91.js → use-mcp-client-DodrDlG1.js} +4 -4
  195. package/dist/client/assets/{use-mcp-tools-Bt0DfVe_.js → use-mcp-tools-76H7sAkU.js} +1 -1
  196. package/dist/client/assets/{use-members-JHZsQmeP.js → use-members-DuHtO7Sk.js} +1 -1
  197. package/dist/client/assets/{use-mobile-C4LZ2U9I.js → use-mobile-CIuAlh23.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-BsT9Q7NC.js → use-navigate-to-agent-Byr2x6oE.js} +1 -1
  199. package/dist/client/assets/{use-open-billing-url-DPFRpHrg.js → use-open-billing-url-CQoiy6Fb.js} +1 -1
  200. package/dist/client/assets/{use-org-auth-client-Cmf_KmfK.js → use-org-auth-client-DIZfUC7y.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-C2ZQyqYB.js → use-org-sso-DZxsRh1Z.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-Bk3bgJkD.js → use-organization-roles-D1BqGC-i.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-DkHjE6yi.js → use-organization-settings-G_H8gyEH.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-DcHhsRqb.js → use-registry-connections-F_KHZ1hv.js} +1 -1
  205. package/dist/client/assets/{use-secrets-BGgsRw_P.js → use-secrets-BHBstyau.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-DIDG5POH.js → use-section-preview-base-DTO26oqg.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-hGNAJHvg.js → use-status-sounds-BVkHD11_.js} +1 -1
  208. package/dist/client/assets/{use-tags-DEzUFQ7U.js → use-tags-BSUXaArl.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-BegGRW-e.js → use-view-mode-BVEIc4Dr.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-BUnJVmrT.js → use-virtual-mcp-V4Sk9KJ8.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-DFEPuFoR.js +1 -0
  212. package/dist/client/assets/{useRouterState-Ca4BToWn.js → useRouterState-BCkEpW-V.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-xmUv9tiN.js +1 -0
  214. package/dist/client/assets/{users-DLfBM_bR.js → users-BXcTKKsT.js} +1 -1
  215. package/dist/client/assets/{variant-calendar-Buhzl5PJ.js → variant-calendar-BwpKEKRh.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-CAtnr8E3.js → view-mode-toggle-CnCHSty9.js} +1 -1
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +448 -448
  219. package/dist/server/server.js +300 -300
  220. package/package.json +1 -1
  221. package/dist/client/assets/connections-DgpUiyqr.js +0 -1
  222. package/dist/client/assets/record-editor-dBivEJpB.js +0 -1
  223. package/dist/client/assets/redirect-editor-CW3Oe-2X.js +0 -1
  224. package/dist/client/assets/registry-C21U36Lk.js +0 -2
  225. package/dist/client/assets/self-tool-result-DUk5meEa.js +0 -1
  226. package/dist/client/assets/store-registry-DBPVslgv.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-BtNh17CA.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-BT-eDQF7.js +0 -1
@@ -1 +1 @@
1
- import{Z as R,a3 as A,b8 as I,$ as a,_ as j,a0 as z,c as L,j as u,B as C}from"./index-B3atnTOD.js";import{I as H}from"./input-CGnplup6.js";import{s as W}from"./Plus-CM2iw1bv.js";import{s as $}from"./Trash01-CpLttFqU.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:K(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx($,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Z(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,Z as a,J as b,M as c,Q as d,Y as i,F as p,D as r};
1
+ import{Z as R,a3 as A,b9 as I,$ as a,_ as j,a0 as z,c as L,j as u,B as C}from"./index-D5h-RA3J.js";import{I as H}from"./input-CBPk2Ds2.js";import{s as W}from"./Plus-KRh9j6XC.js";import{s as $}from"./Trash01-h_oyaZP1.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function K(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:K(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx($,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Z(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,Z as a,J as b,M as c,Q as d,Y as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{r as B,c as ae,b as de,j as t,B as G,k as pe,p as re,m as je,E as Ye,F as Ne,d as ke,u as Ze,a as Te,D as et,I as tt,G as nt,a1 as st,a2 as ot,o as it,t as Y,K as ct}from"./index-D5h-RA3J.js";import{a as Ae,b as lt,g as rt,e as at}from"./extract-connection-data-CzvlGw-U.js";import{C as dt}from"./collection-display-button-CG2AhdBO.js";import{S as ut}from"./search-input-WVzZekD4.js";import{C as mt}from"./collection-tabs-C-pb2dPt.js";import{C as ve,u as gt,a as we,g as pt}from"./connection-card-C9V1KBF_.js";import{E as ft}from"./empty-state-s02r9CMc.js";import{P as fe}from"./index-D2tWT1ul.js";import{u as ht,D as xt}from"./use-delete-connection-D_FLVtNN.js";import{u as Ce}from"./use-capability-DrzlW7so.js";import{u as jt}from"./use-infinite-scroll-qQ-p16F-.js";import{u as yt}from"./use-view-mode-BVEIc4Dr.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{A as Ie,a as Pe,b as Le,c as Oe,d as Me,e as Fe,f as $e,g as Ue}from"./alert-dialog-ynETGH7r.js";import{n as ye}from"./Tool02-DpdVhL0m.js";import{g as St}from"./metadata-dUsYcpuu.js";import{b as Ve,h as ze,a as Ee,c as Be,d as Ke,e as He}from"./dialog-BlfHYeFc.js";import{D as Ct,a as vt,c as bt,b as _t,g as Dt,e as Nt,f as kt}from"./drawer-FBry2ukP.js";import{u as Tt}from"./use-mobile-CIuAlh23.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-BhiAOBc7.js";import{I as ue}from"./input-CBPk2Ds2.js";import{S as At,a as wt,b as It,c as Pt,d as ge}from"./select-rJkR_gvP.js";import{T as Lt}from"./textarea-DIWSPxFy.js";import{b as Re,u as Ot}from"./use-connection-1Q4RUKqc.js";import{a as Mt}from"./use-virtual-mcp-V4Sk9KJ8.js";import{u as Ft}from"./studio-tools-BeO54KZA.js";import{s as Se}from"./Star01-C-jBz2wz.js";import{s as We}from"./Plus-KRh9j6XC.js";import{aE as $t,Q as Ut,P as Vt,ae as zt}from"./agent-icon-CFXZTI_j.js";import{s as Xe}from"./XClose-DiVQMRNE.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-U9QEikZB.js";import{a as Wt}from"./authenticate-and-persist-oauth-BgSdBXRI.js";import{I as Xt}from"./integration-icon-c7-JobNw.js";import{C as Ge}from"./checkbox-B3tu6pXL.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-B6LwWkvh.js";import{a as Jt}from"./DotsVertical-CVGyjria.js";import{s as qe}from"./Eye-B2iGLYP5.js";import{s as Qe}from"./Trash01-h_oyaZP1.js";import"./use-mcp-client-DodrDlG1.js";import"./auth-BXPQkeoy.js";import"./ArrowUp-BIWZ-Zm0.js";import"./Check-7WAvFi-X.js";import"./SwitchHorizontal01-Bd3QKMh1.js";import"./tooltip-DvFWNEDZ.js";import"./view-mode-toggle-CnCHSty9.js";import"./badge-CQc7UGAT.js";import"./SearchMd-g2EyVZW3.js";import"./use-registry-connections-F_KHZ1hv.js";import"./use-organization-settings-G_H8gyEH.js";import"./useInfiniteQuery-DFEPuFoR.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-B1MB2XIq.js";import"./sidebar-vViO6g4B.js";import"./LayoutLeft-abZzAh0Z.js";import"./X-BLMSR2fx.js";import"./label-BOB3sH-D.js";import"./ChevronDown-DDAzQt6T.js";import"./ChevronUp-CfrRYWx0.js";import"./AlertCircle-BWDnTsmK.js";import"./Tool01-DJWvUdRn.js";import"./ArrowLeft-DVsBvE7g.js";import"./XCircle-B278tfex.js";import"./ArrowUpRight-9a2Pp6SJ.js";import"./TrendUp01-B18kPLjE.js";import"./ZapSquare-DS9QQvEJ.js";import"./Users03-CGwaCKmz.js";import"./CheckCircle-BxGsU5ea.js";import"./ChevronRight-CumQ7Y3c.js";import"./Stars02-ByC2w8gM.js";import"./Copy01-emQNe-na.js";import"./CpuChip01-BZERwn-Y.js";import"./CreditCard01-ChcGWPdA.js";import"./Globe01-CG8woUvQ.js";import"./Settings02-D5EXr4GC.js";import"./FilterLines-CmwMvBpb.js";import"./Share07-CmNWLd8X.js";import"./Globe04-Ce-zfyTK.js";import"./HardDrive-D0B55OwB.js";import"./Key01-CSUPWNtZ.js";import"./LinkExternal01-CIUiuJI2.js";import"./LogOut01-BipgIR60.js";import"./Monitor01-BxT46IoP.js";import"./Sun-wg-cv_Yg.js";import"./Palette-D6vOAUYn.js";import"./Play-sVwBY1NN.js";import"./SearchLg-D9_yLnhj.js";import"./Shield01-BLHZd-DF.js";import"./Stars01-DD_9MFaY.js";import"./Upload01-DRey_V3_.js";import"./User01-DsPz_8Cg.js";import"./Users01-WLzsa5xo.js";import"./Zap-Cy8qu-W6.js";import"./mcp-oauth-GA_AotKT.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=O=>{y(O),globalThis.localStorage?.setItem(x,String(O))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=yt(`studio-${p}-${n}`,l),{sortKey:L,sortDirection:M,handleSort:A}=Zt(o),K=L;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==M||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:M,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=M,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Le,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Oe,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Me,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=St(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||lt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const L=T;let M;e[14]!==n?(M=nn(n),e[14]=n,e[15]=M):M=e[15];const A=M,K=u||p;let U,O;e[16]!==L||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=L[0];J&&l(J);return}O()},O=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=L,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=O):(U=e[22],O=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==O||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),O()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=O,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Le,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Oe,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Me,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let L;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(L=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=L):L=e[36];let M;e[37]!==p?(M=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=M):M=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==M||e[43]!==K?(U=t.jsxs(me,{onClick:M,children:[A,K]}),e[42]=M,e[43]=K,e[44]=U):U=e[44];let O;e[45]!==r||e[46]!==U?(O=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=O):O=e[47];let V;e[48]!==L||e[49]!==O?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[L,O]}),e[48]=L,e[49]=O,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.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:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let M;return e[41]!==p||e[42]!==n||e[43]!==L?(M=t.jsx(He,{open:n,onOpenChange:p,children:L}),e[41]=p,e[42]=n,e[43]=L,e[44]=M):M=e[44],M}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=it(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Ot(s),v=ht(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,L]=B.useState(null),M=Mt(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=pt(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},O=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=jt(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),L(m.id);try{const h=at(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:ct.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{L(null)}}},C=Ft(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),O()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),O()},ee=async m=>{const h=M.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),O()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:M,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(ft,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:O})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=Tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=tt(nt.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=gt(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=st({resolver:ot(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),M=i.watch("npx_package"),A=he({uiType:T,connectionUrl:L??"",npxPackage:M??""})??De({uiType:T,connectionUrl:L??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=rt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),O(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&O(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(At,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(wt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(Ct,{open:H,onOpenChange:q,children:t.jsxs(vt,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(_t,{children:S}),t.jsx(Dt,{className:"mt-1",children:w})]}),t.jsx(Nt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(dt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:g,onChange:S=>v(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:S=>_(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(mt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function to(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{to as default};
@@ -1 +1 @@
1
- import"./index-B3atnTOD.js";import{e as R}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},w=Object.values(k),Y="super-agent",p=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],O=p[0];function x(r){return p[r%p.length]??O}function G(r){return r.createdBy==="system"}const K=["qa","code_review"],N={qa:"QA Agent",code_review:"Code Reviewer"};function j(r,s){return r?.startsWith(`${N[s]}:`)??!1}function I(r){let s=0;for(const l of r)l.action==="status_changed"&&l.data?.to==="in_review"&&(s=Math.max(s,new Date(l.occurredAt).getTime()));return s}function M(r,s){const l=I(r),a=new Map;for(const o of r){if(o.action!=="review_approved"&&o.action!=="review_changes_requested"||new Date(o.occurredAt).getTime()<l)continue;const i=o.data??{};i.reviewer!=="qa"&&i.reviewer!=="code_review"||(o.action==="review_approved"?a.set(i.reviewer,"approved"):a.set(i.reviewer,"changes_requested"))}return a}function F(r,s,l){if(s.length===0)return!1;const a=M(r);return s.every(o=>a.get(o)==="approved")}const S="task-board.item.updated",v="task-board.item.deleted",P=3e4,V=1e3;function B(r){const{buildUrl:s,eventTypes:l,name:a,crossTab:o=!1}=r,i=new Map,d=o&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(d&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function f(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function E(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function T(e){const t=new EventSource(s(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(E(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const n=u=>{e.channel?.postMessage({kind:"event",type:u.type,data:u.data}),f(e,u)};for(const u of l)t.addEventListener(u,n)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=R(P,V,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),T(e))},t)}function h(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,T(e)}function L(e){if(!d){h(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,h(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?f(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&E(e)}function g(e){const t=i.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(i.set(e,n),d){const u=new BroadcastChannel(`sse:${a}:${e}`);u.onmessage=c=>D(n,c.data),n.channel=u}return n}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,i.delete(e.key)}return{subscribe(e,t,n){const u=!i.has(e),c=g(e);c.refCount++,c.handlers.add(t),n&&c.reconnectHandlers.add(n),u&&L(c);let _=!1;return()=>{_||(_=!0,c.handlers.delete(t),n&&c.reconnectHandlers.delete(n),c.refCount--,c.refCount<=0&&y(c))}}}}function A(r,s){const l=new Set(s);return{subscribe(a,o,i){const d=f=>{l.has(f.type)&&o(f)};return r.subscribe(a,d,i)}}}const b=[...w,S,v],H=b,W=b,C=B({name:"watch",buildUrl:r=>`/api/${encodeURIComponent(r)}/watch?types=${H.join(",")}`,eventTypes:W,crossTab:!0}),q=A(C,[...w]),J=A(C,[S,v]),Q=q;export{O as D,K as R,Y as S,v as T,F as a,G as b,k as c,Q as d,j as i,x as n,J as t};
1
+ import"./index-D5h-RA3J.js";import{e as R}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},w=Object.values(k),Y="super-agent",p=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],O=p[0];function x(r){return p[r%p.length]??O}function G(r){return r.createdBy==="system"}const K=["qa","code_review"],N={qa:"QA Agent",code_review:"Code Reviewer"};function j(r,s){return r?.startsWith(`${N[s]}:`)??!1}function I(r){let s=0;for(const l of r)l.action==="status_changed"&&l.data?.to==="in_review"&&(s=Math.max(s,new Date(l.occurredAt).getTime()));return s}function M(r,s){const l=I(r),a=new Map;for(const o of r){if(o.action!=="review_approved"&&o.action!=="review_changes_requested"||new Date(o.occurredAt).getTime()<l)continue;const i=o.data??{};i.reviewer!=="qa"&&i.reviewer!=="code_review"||(o.action==="review_approved"?a.set(i.reviewer,"approved"):a.set(i.reviewer,"changes_requested"))}return a}function F(r,s,l){if(s.length===0)return!1;const a=M(r);return s.every(o=>a.get(o)==="approved")}const S="task-board.item.updated",v="task-board.item.deleted",P=3e4,V=1e3;function B(r){const{buildUrl:s,eventTypes:l,name:a,crossTab:o=!1}=r,i=new Map,d=o&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(d&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function f(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function E(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function T(e){const t=new EventSource(s(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(E(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const n=u=>{e.channel?.postMessage({kind:"event",type:u.type,data:u.data}),f(e,u)};for(const u of l)t.addEventListener(u,n)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=R(P,V,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),T(e))},t)}function h(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,T(e)}function L(e){if(!d){h(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,h(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?f(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&E(e)}function g(e){const t=i.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(i.set(e,n),d){const u=new BroadcastChannel(`sse:${a}:${e}`);u.onmessage=c=>D(n,c.data),n.channel=u}return n}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,i.delete(e.key)}return{subscribe(e,t,n){const u=!i.has(e),c=g(e);c.refCount++,c.handlers.add(t),n&&c.reconnectHandlers.add(n),u&&L(c);let _=!1;return()=>{_||(_=!0,c.handlers.delete(t),n&&c.reconnectHandlers.delete(n),c.refCount--,c.refCount<=0&&y(c))}}}}function A(r,s){const l=new Set(s);return{subscribe(a,o,i){const d=f=>{l.has(f.type)&&o(f)};return r.subscribe(a,d,i)}}}const b=[...w,S,v],H=b,W=b,C=B({name:"watch",buildUrl:r=>`/api/${encodeURIComponent(r)}/watch?types=${H.join(",")}`,eventTypes:W,crossTab:!0}),q=A(C,[...w]),J=A(C,[S,v]),Q=q;export{O as D,K as R,Y as S,v as T,F as a,G as b,k as c,Q as d,j as i,x as n,J as t};
@@ -1 +1 @@
1
- import{c as n,j as i,cU as u,m as c,H as m,cT as x,cV as j,cW as N,cY as b,d5 as D,cX as g}from"./index-B3atnTOD.js";import{i as h}from"./X-BJV63bzn.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};
1
+ import{c as n,j as i,cV as u,m as c,H as m,cU as x,cW as j,cX as N,cZ as b,d6 as D,cY as g}from"./index-D5h-RA3J.js";import{i as h}from"./X-BLMSR2fx.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};
@@ -1 +1 @@
1
- import{c as oe,b as ae,F as re,o as de,r as ce,K as ie,n as me,e as X,p as ge,t as N,j as s,B as te}from"./index-B3atnTOD.js";import{u as ue}from"./studio-tools-BtWHGFPU.js";import{b as fe,a as xe,S as Se}from"./settings-section-D4f-00oI.js";import{B as ne}from"./badge-DAoU6Imp.js";import{I as je}from"./input-CGnplup6.js";import{S as pe,a as he,b as Ne,c as ve,d as se}from"./select-n13gZUR4.js";function Me(e,t,o){switch(e){case"auto":return o("settings.domainSettings.joinModeHelpAuto",{domain:t});case"request":return o("settings.domainSettings.joinModeHelpRequest",{domain:t});default:return o("settings.domainSettings.joinModeHelpOff")}}function Re(){const e=oe.c(101),t=ae(),{org:o}=re(),p=de(),i=ue(),[r,v]=ce.useState("");let c;e[0]!==o.id?(c=ie.organizationDomains(o.id),e[0]=o.id,e[1]=c):c=e[1];let m;e[2]!==i?(m=()=>i.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==c||e[5]!==m?(x={queryKey:c,queryFn:m},e[4]=c,e[5]=m,e[6]=x):x=e[6];const{data:h,isPending:M}=me(x);let S;e[7]!==o.id||e[8]!==p?(S=()=>p.invalidateQueries({queryKey:ie.organizationDomains(o.id)}),e[7]=o.id,e[8]=p,e[9]=S):S=e[9];const a=S;let g;e[10]!==i?(g=n=>i.call("ORGANIZATION_DOMAIN_ADD",{domain:n}),e[10]=i,e[11]=g):g=e[11];let u;e[12]!==a||e[13]!==o.id||e[14]!==t?(u=()=>{ge("organization_domain_added",{organization_id:o.id}),v(""),a(),N.success(t("settings.domainSettings.domainAdded"))},e[12]=a,e[13]=o.id,e[14]=t,e[15]=u):u=e[15];let f;e[16]!==t?(f=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedAddDomain")),e[16]=t,e[17]=f):f=e[17];let j;e[18]!==g||e[19]!==u||e[20]!==f?(j={mutationFn:g,onSuccess:u,onError:f},e[18]=g,e[19]=u,e[20]=f,e[21]=j):j=e[21];const d=X(j);let I;e[22]!==i?(I=n=>{const{id:l,joinMode:D}=n;return i.call("ORGANIZATION_DOMAIN_UPDATE",{id:l,joinMode:D})},e[22]=i,e[23]=I):I=e[23];let A;e[24]!==a||e[25]!==t?(A=()=>{a(),N.success(t("settings.domainSettings.joinModeUpdated"))},e[24]=a,e[25]=t,e[26]=A):A=e[26];let b;e[27]!==t?(b=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedUpdate")),e[27]=t,e[28]=b):b=e[28];let U;e[29]!==b||e[30]!==I||e[31]!==A?(U={mutationFn:I,onSuccess:A,onError:b},e[29]=b,e[30]=I,e[31]=A,e[32]=U):U=e[32];const Q=X(U);let O;e[33]!==i?(O=n=>i.call("ORGANIZATION_DOMAIN_VERIFY",{id:n}),e[33]=i,e[34]=O):O=e[34];let y;e[35]!==a||e[36]!==t?(y=n=>{a(),n.verified?N.success(t("settings.domainSettings.domainVerified")):N.error(t("settings.domainSettings.txtRecordNotFound"))},e[35]=a,e[36]=t,e[37]=y):y=e[37];let E;e[38]!==t?(E=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedVerify")),e[38]=t,e[39]=E):E=e[39];let Y;e[40]!==O||e[41]!==y||e[42]!==E?(Y={mutationFn:O,onSuccess:y,onError:E},e[40]=O,e[41]=y,e[42]=E,e[43]=Y):Y=e[43];const R=X(Y);let C;e[44]!==i?(C=n=>i.call("ORGANIZATION_DOMAIN_REMOVE",{id:n}),e[44]=i,e[45]=C):C=e[45];let P;e[46]!==a||e[47]!==t?(P=()=>{a(),N.success(t("settings.domainSettings.domainRemoved"))},e[46]=a,e[47]=t,e[48]=P):P=e[48];let _;e[49]!==t?(_=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedRemove")),e[49]=t,e[50]=_):_=e[50];let $;e[51]!==C||e[52]!==P||e[53]!==_?($={mutationFn:C,onSuccess:P,onError:_},e[51]=C,e[52]=P,e[53]=_,e[54]=$):$=e[54];const T=X($);if(M)return null;let L;e[55]!==h?.domains?(L=h?.domains??[],e[55]=h?.domains,e[56]=L):L=e[56];const ee=L;let V;e[57]!==t?(V=t("settings.domainSettings.emailDomains"),e[57]=t,e[58]=V):V=e[58];let F;e[59]!==t?(F=t("settings.domainSettings.emailDomainsDescription"),e[59]=t,e[60]=F):F=e[60];let k;if(e[61]!==ee||e[62]!==T||e[63]!==t||e[64]!==Q||e[65]!==R){let n;e[67]!==T||e[68]!==t||e[69]!==Q||e[70]!==R?(n=l=>{const D=l.verificationStatus==="verified";return s.jsx(fe,{title:s.jsxs("span",{className:"flex items-center gap-2",children:[l.domain,D?s.jsx(ne,{variant:"secondary",children:t("settings.domainSettings.verified")}):s.jsx(ne,{variant:"outline",children:t("settings.domainSettings.pending")})]}),description:D?Me(l.joinMode,l.domain,t):t("settings.domainSettings.addDnsRecordInstruction"),action:s.jsxs("div",{className:"flex items-center gap-2",children:[D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:t("settings.domainSettings.joinMode")}),s.jsxs(pe,{value:l.joinMode,onValueChange:le=>Q.mutate({id:l.id,joinMode:le}),children:[s.jsx(he,{className:"w-44",size:"sm",children:s.jsx(Ne,{})}),s.jsxs(ve,{children:[s.jsx(se,{value:"off",children:t("settings.domainSettings.joinModeOff")}),s.jsx(se,{value:"auto",children:t("settings.domainSettings.joinModeAuto")}),s.jsx(se,{value:"request",children:t("settings.domainSettings.joinModeRequest")})]})]})]}),!D&&s.jsx(te,{size:"sm",variant:"outline",onClick:()=>R.mutate(l.id),disabled:R.isPending,children:t("settings.domainSettings.verify")}),s.jsx(te,{size:"sm",variant:"ghost",onClick:()=>T.mutate(l.id),disabled:T.isPending,children:t("settings.domainSettings.remove")})]}),children:!D&&l.recordName&&l.recordValue&&s.jsx(Ie,{recordName:l.recordName,recordValue:l.recordValue})},l.id)},e[67]=T,e[68]=t,e[69]=Q,e[70]=R,e[71]=n):n=e[71],k=ee.map(n),e[61]=ee,e[62]=T,e[63]=t,e[64]=Q,e[65]=R,e[66]=k}else k=e[66];let J;e[72]===Symbol.for("react.memo_cache_sentinel")?(J=n=>v(n.target.value),e[72]=J):J=e[72];let q;e[73]!==t?(q=t("settings.domainSettings.domainPlaceholder"),e[73]=t,e[74]=q):q=e[74];let z;e[75]!==r||e[76]!==q?(z=s.jsx(je,{value:r,onChange:J,placeholder:q,className:"max-w-xs"}),e[75]=r,e[76]=q,e[77]=z):z=e[77];let w;e[78]!==d||e[79]!==r?(w=()=>d.mutate(r.trim()),e[78]=d,e[79]=r,e[80]=w):w=e[80];let G;e[81]!==d.isPending||e[82]!==r?(G=!r.trim()||d.isPending,e[81]=d.isPending,e[82]=r,e[83]=G):G=e[83];let Z;e[84]!==d.isPending||e[85]!==t?(Z=d.isPending?t("settings.domainSettings.adding"):t("settings.domainSettings.addDomain"),e[84]=d.isPending,e[85]=t,e[86]=Z):Z=e[86];let B;e[87]!==w||e[88]!==G||e[89]!==Z?(B=s.jsx(te,{size:"sm",onClick:w,disabled:G,children:Z}),e[87]=w,e[88]=G,e[89]=Z,e[90]=B):B=e[90];let H;e[91]!==z||e[92]!==B?(H=s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[z,B]}),e[91]=z,e[92]=B,e[93]=H):H=e[93];let K;e[94]!==k||e[95]!==H?(K=s.jsxs(xe,{children:[k,H]}),e[94]=k,e[95]=H,e[96]=K):K=e[96];let W;return e[97]!==V||e[98]!==F||e[99]!==K?(W=s.jsx(Se,{title:V,description:F,children:K}),e[97]=V,e[98]=F,e[99]=K,e[100]=W):W=e[100],W}function Ie(e){const t=oe.c(34),{recordName:o,recordValue:p}=e,i=ae();let r;t[0]!==i?(r=I=>{navigator.clipboard?.writeText(I),N.success(i("settings.domainSettings.copied"))},t[0]=i,t[1]=r):r=t[1];const v=r;let c;t[2]!==i?(c=i("settings.domainSettings.dnsInstructions"),t[2]=i,t[3]=c):c=t[3];let m;t[4]!==c?(m=s.jsx("p",{className:"text-muted-foreground",children:c}),t[4]=c,t[5]=m):m=t[5];let x;t[6]!==v||t[7]!==o?(x=()=>v(o),t[6]=v,t[7]=o,t[8]=x):x=t[8];let h;t[9]!==i?(h=i("settings.domainSettings.txt"),t[9]=i,t[10]=h):h=t[10];let M;t[11]!==h?(M=s.jsxs("span",{className:"text-muted-foreground",children:[h," "]}),t[11]=h,t[12]=M):M=t[12];let S;t[13]!==o||t[14]!==x||t[15]!==M?(S=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:x,children:[M,o]}),t[13]=o,t[14]=x,t[15]=M,t[16]=S):S=t[16];let a;t[17]!==v||t[18]!==p?(a=()=>v(p),t[17]=v,t[18]=p,t[19]=a):a=t[19];let g;t[20]!==i?(g=i("settings.domainSettings.value"),t[20]=i,t[21]=g):g=t[21];let u;t[22]!==g?(u=s.jsxs("span",{className:"text-muted-foreground",children:[g," "]}),t[22]=g,t[23]=u):u=t[23];let f;t[24]!==p||t[25]!==u||t[26]!==a?(f=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:a,children:[u,p]}),t[24]=p,t[25]=u,t[26]=a,t[27]=f):f=t[27];let j;t[28]!==f||t[29]!==S?(j=s.jsxs("div",{className:"grid gap-1",children:[S,f]}),t[28]=f,t[29]=S,t[30]=j):j=t[30];let d;return t[31]!==j||t[32]!==m?(d=s.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[m,j]}),t[31]=j,t[32]=m,t[33]=d):d=t[33],d}export{Re as D};
1
+ import{c as oe,b as ae,F as re,o as de,r as ce,K as ie,n as me,e as X,p as ge,t as N,j as s,B as te}from"./index-D5h-RA3J.js";import{u as ue}from"./studio-tools-BeO54KZA.js";import{b as fe,a as xe,S as Se}from"./settings-section-3LqbPXnx.js";import{B as ne}from"./badge-CQc7UGAT.js";import{I as je}from"./input-CBPk2Ds2.js";import{S as pe,a as he,b as Ne,c as ve,d as se}from"./select-rJkR_gvP.js";function Me(e,t,o){switch(e){case"auto":return o("settings.domainSettings.joinModeHelpAuto",{domain:t});case"request":return o("settings.domainSettings.joinModeHelpRequest",{domain:t});default:return o("settings.domainSettings.joinModeHelpOff")}}function Re(){const e=oe.c(101),t=ae(),{org:o}=re(),p=de(),i=ue(),[r,v]=ce.useState("");let c;e[0]!==o.id?(c=ie.organizationDomains(o.id),e[0]=o.id,e[1]=c):c=e[1];let m;e[2]!==i?(m=()=>i.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==c||e[5]!==m?(x={queryKey:c,queryFn:m},e[4]=c,e[5]=m,e[6]=x):x=e[6];const{data:h,isPending:M}=me(x);let S;e[7]!==o.id||e[8]!==p?(S=()=>p.invalidateQueries({queryKey:ie.organizationDomains(o.id)}),e[7]=o.id,e[8]=p,e[9]=S):S=e[9];const a=S;let g;e[10]!==i?(g=n=>i.call("ORGANIZATION_DOMAIN_ADD",{domain:n}),e[10]=i,e[11]=g):g=e[11];let u;e[12]!==a||e[13]!==o.id||e[14]!==t?(u=()=>{ge("organization_domain_added",{organization_id:o.id}),v(""),a(),N.success(t("settings.domainSettings.domainAdded"))},e[12]=a,e[13]=o.id,e[14]=t,e[15]=u):u=e[15];let f;e[16]!==t?(f=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedAddDomain")),e[16]=t,e[17]=f):f=e[17];let j;e[18]!==g||e[19]!==u||e[20]!==f?(j={mutationFn:g,onSuccess:u,onError:f},e[18]=g,e[19]=u,e[20]=f,e[21]=j):j=e[21];const d=X(j);let I;e[22]!==i?(I=n=>{const{id:l,joinMode:D}=n;return i.call("ORGANIZATION_DOMAIN_UPDATE",{id:l,joinMode:D})},e[22]=i,e[23]=I):I=e[23];let A;e[24]!==a||e[25]!==t?(A=()=>{a(),N.success(t("settings.domainSettings.joinModeUpdated"))},e[24]=a,e[25]=t,e[26]=A):A=e[26];let b;e[27]!==t?(b=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedUpdate")),e[27]=t,e[28]=b):b=e[28];let U;e[29]!==b||e[30]!==I||e[31]!==A?(U={mutationFn:I,onSuccess:A,onError:b},e[29]=b,e[30]=I,e[31]=A,e[32]=U):U=e[32];const Q=X(U);let O;e[33]!==i?(O=n=>i.call("ORGANIZATION_DOMAIN_VERIFY",{id:n}),e[33]=i,e[34]=O):O=e[34];let y;e[35]!==a||e[36]!==t?(y=n=>{a(),n.verified?N.success(t("settings.domainSettings.domainVerified")):N.error(t("settings.domainSettings.txtRecordNotFound"))},e[35]=a,e[36]=t,e[37]=y):y=e[37];let E;e[38]!==t?(E=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedVerify")),e[38]=t,e[39]=E):E=e[39];let Y;e[40]!==O||e[41]!==y||e[42]!==E?(Y={mutationFn:O,onSuccess:y,onError:E},e[40]=O,e[41]=y,e[42]=E,e[43]=Y):Y=e[43];const R=X(Y);let C;e[44]!==i?(C=n=>i.call("ORGANIZATION_DOMAIN_REMOVE",{id:n}),e[44]=i,e[45]=C):C=e[45];let P;e[46]!==a||e[47]!==t?(P=()=>{a(),N.success(t("settings.domainSettings.domainRemoved"))},e[46]=a,e[47]=t,e[48]=P):P=e[48];let _;e[49]!==t?(_=n=>N.error(n instanceof Error?n.message:t("settings.domainSettings.failedRemove")),e[49]=t,e[50]=_):_=e[50];let $;e[51]!==C||e[52]!==P||e[53]!==_?($={mutationFn:C,onSuccess:P,onError:_},e[51]=C,e[52]=P,e[53]=_,e[54]=$):$=e[54];const T=X($);if(M)return null;let L;e[55]!==h?.domains?(L=h?.domains??[],e[55]=h?.domains,e[56]=L):L=e[56];const ee=L;let V;e[57]!==t?(V=t("settings.domainSettings.emailDomains"),e[57]=t,e[58]=V):V=e[58];let F;e[59]!==t?(F=t("settings.domainSettings.emailDomainsDescription"),e[59]=t,e[60]=F):F=e[60];let k;if(e[61]!==ee||e[62]!==T||e[63]!==t||e[64]!==Q||e[65]!==R){let n;e[67]!==T||e[68]!==t||e[69]!==Q||e[70]!==R?(n=l=>{const D=l.verificationStatus==="verified";return s.jsx(fe,{title:s.jsxs("span",{className:"flex items-center gap-2",children:[l.domain,D?s.jsx(ne,{variant:"secondary",children:t("settings.domainSettings.verified")}):s.jsx(ne,{variant:"outline",children:t("settings.domainSettings.pending")})]}),description:D?Me(l.joinMode,l.domain,t):t("settings.domainSettings.addDnsRecordInstruction"),action:s.jsxs("div",{className:"flex items-center gap-2",children:[D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:t("settings.domainSettings.joinMode")}),s.jsxs(pe,{value:l.joinMode,onValueChange:le=>Q.mutate({id:l.id,joinMode:le}),children:[s.jsx(he,{className:"w-44",size:"sm",children:s.jsx(Ne,{})}),s.jsxs(ve,{children:[s.jsx(se,{value:"off",children:t("settings.domainSettings.joinModeOff")}),s.jsx(se,{value:"auto",children:t("settings.domainSettings.joinModeAuto")}),s.jsx(se,{value:"request",children:t("settings.domainSettings.joinModeRequest")})]})]})]}),!D&&s.jsx(te,{size:"sm",variant:"outline",onClick:()=>R.mutate(l.id),disabled:R.isPending,children:t("settings.domainSettings.verify")}),s.jsx(te,{size:"sm",variant:"ghost",onClick:()=>T.mutate(l.id),disabled:T.isPending,children:t("settings.domainSettings.remove")})]}),children:!D&&l.recordName&&l.recordValue&&s.jsx(Ie,{recordName:l.recordName,recordValue:l.recordValue})},l.id)},e[67]=T,e[68]=t,e[69]=Q,e[70]=R,e[71]=n):n=e[71],k=ee.map(n),e[61]=ee,e[62]=T,e[63]=t,e[64]=Q,e[65]=R,e[66]=k}else k=e[66];let J;e[72]===Symbol.for("react.memo_cache_sentinel")?(J=n=>v(n.target.value),e[72]=J):J=e[72];let q;e[73]!==t?(q=t("settings.domainSettings.domainPlaceholder"),e[73]=t,e[74]=q):q=e[74];let z;e[75]!==r||e[76]!==q?(z=s.jsx(je,{value:r,onChange:J,placeholder:q,className:"max-w-xs"}),e[75]=r,e[76]=q,e[77]=z):z=e[77];let w;e[78]!==d||e[79]!==r?(w=()=>d.mutate(r.trim()),e[78]=d,e[79]=r,e[80]=w):w=e[80];let G;e[81]!==d.isPending||e[82]!==r?(G=!r.trim()||d.isPending,e[81]=d.isPending,e[82]=r,e[83]=G):G=e[83];let Z;e[84]!==d.isPending||e[85]!==t?(Z=d.isPending?t("settings.domainSettings.adding"):t("settings.domainSettings.addDomain"),e[84]=d.isPending,e[85]=t,e[86]=Z):Z=e[86];let B;e[87]!==w||e[88]!==G||e[89]!==Z?(B=s.jsx(te,{size:"sm",onClick:w,disabled:G,children:Z}),e[87]=w,e[88]=G,e[89]=Z,e[90]=B):B=e[90];let H;e[91]!==z||e[92]!==B?(H=s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[z,B]}),e[91]=z,e[92]=B,e[93]=H):H=e[93];let K;e[94]!==k||e[95]!==H?(K=s.jsxs(xe,{children:[k,H]}),e[94]=k,e[95]=H,e[96]=K):K=e[96];let W;return e[97]!==V||e[98]!==F||e[99]!==K?(W=s.jsx(Se,{title:V,description:F,children:K}),e[97]=V,e[98]=F,e[99]=K,e[100]=W):W=e[100],W}function Ie(e){const t=oe.c(34),{recordName:o,recordValue:p}=e,i=ae();let r;t[0]!==i?(r=I=>{navigator.clipboard?.writeText(I),N.success(i("settings.domainSettings.copied"))},t[0]=i,t[1]=r):r=t[1];const v=r;let c;t[2]!==i?(c=i("settings.domainSettings.dnsInstructions"),t[2]=i,t[3]=c):c=t[3];let m;t[4]!==c?(m=s.jsx("p",{className:"text-muted-foreground",children:c}),t[4]=c,t[5]=m):m=t[5];let x;t[6]!==v||t[7]!==o?(x=()=>v(o),t[6]=v,t[7]=o,t[8]=x):x=t[8];let h;t[9]!==i?(h=i("settings.domainSettings.txt"),t[9]=i,t[10]=h):h=t[10];let M;t[11]!==h?(M=s.jsxs("span",{className:"text-muted-foreground",children:[h," "]}),t[11]=h,t[12]=M):M=t[12];let S;t[13]!==o||t[14]!==x||t[15]!==M?(S=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:x,children:[M,o]}),t[13]=o,t[14]=x,t[15]=M,t[16]=S):S=t[16];let a;t[17]!==v||t[18]!==p?(a=()=>v(p),t[17]=v,t[18]=p,t[19]=a):a=t[19];let g;t[20]!==i?(g=i("settings.domainSettings.value"),t[20]=i,t[21]=g):g=t[21];let u;t[22]!==g?(u=s.jsxs("span",{className:"text-muted-foreground",children:[g," "]}),t[22]=g,t[23]=u):u=t[23];let f;t[24]!==p||t[25]!==u||t[26]!==a?(f=s.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:a,children:[u,p]}),t[24]=p,t[25]=u,t[26]=a,t[27]=f):f=t[27];let j;t[28]!==f||t[29]!==S?(j=s.jsxs("div",{className:"grid gap-1",children:[S,f]}),t[28]=f,t[29]=S,t[30]=j):j=t[30];let d;return t[31]!==j||t[32]!==m?(d=s.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[m,j]}),t[31]=j,t[32]=m,t[33]=d):d=t[33],d}export{Re as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cw as i,m as c}from"./index-B3atnTOD.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,v as d,b as e,j as f,N as g};
1
+ import{c as d,j as s,cx as i,m as c}from"./index-D5h-RA3J.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(w,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(m,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,v as d,b as e,j as f,N as g};
@@ -1 +1 @@
1
- import{c,j as i,dK as f,dL as m,m as u,dM as g,dN as x,dO as v,dP as b,dQ as h,dR as w,dS as j,dT as N,dU as z,dV as _,dW as y,dX as p}from"./index-B3atnTOD.js";import{i as $}from"./Check-oDnQWrwG.js";import{i as D}from"./ChevronRight-zfsu59r1.js";import{i as M}from"./DotsVertical-D_v8MV1q.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,translate:"no",className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function K(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Q(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function U(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function V(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function W(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",translate:"no",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{T as D,O as a,L as b,C as c,U as d,V as e,W as f,G as g,P as h,Q as i,K as j,E as k};
1
+ import{c,j as i,dL as f,dM as m,m as u,dN as g,dO as x,dP as v,dQ as b,dR as h,dS as w,dT as j,dU as N,dV as z,dW as _,dX as y,dY as p}from"./index-D5h-RA3J.js";import{i as $}from"./Check-7WAvFi-X.js";import{i as D}from"./ChevronRight-CumQ7Y3c.js";import{i as M}from"./DotsVertical-CVGyjria.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,translate:"no",className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",translate:"no",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{T as D,O as a,L as b,C as c,V as d,W as e,X as f,G as g,P as h,U as i,Q as j,E as k};
@@ -1 +1 @@
1
- import{c as v,m as N,j as t}from"./index-B3atnTOD.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-center text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,m as N,j as t}from"./index-D5h-RA3J.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-center text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import{g as I}from"./metadata-dUsYcpuu.js";import"./index-B3atnTOD.js";import{W as T,n as E}from"./use-mcp-client-DkEyYZ91.js";function U(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function H(t){const e=U(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function L(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return L(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(t){return t?D[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await E({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}let Y="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Y[n[t]&63];return e};function j(t){return`${t}_${$()}`}function V(t){return I(t._meta)?.appName||t.server?.name||null}function K(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=I(t._meta),s=new Date().toISOString(),R=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,w=r?.icons?.[0]?.src||H(r?.repository)||null,i=o?.oauth_config,A=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,C=o?.configuration_state,v=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,N=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[N];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,O=p.length>1;let d="";c&&O?d=` (${W(c)})`:l&&M&&(d=` (${K(l)})`);const x=R+d;return{id:j("conn"),title:x,description:k,icon:w,app_name:V(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:A,configuration_state:C??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{V as a,H as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
1
+ import{g as I}from"./metadata-dUsYcpuu.js";import"./index-D5h-RA3J.js";import{W as T,n as E}from"./use-mcp-client-DodrDlG1.js";function U(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function H(t){const e=U(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function L(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return L(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(t){return t?D[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await E({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}let Y="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Y[n[t]&63];return e};function j(t){return`${t}_${$()}`}function V(t){return I(t._meta)?.appName||t.server?.name||null}function K(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=I(t._meta),s=new Date().toISOString(),R=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,w=r?.icons?.[0]?.src||H(r?.repository)||null,i=o?.oauth_config,A=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,C=o?.configuration_state,v=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,N=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[N];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,O=p.length>1;let d="";c&&O?d=` (${W(c)})`:l&&M&&(d=` (${K(l)})`);const x=R+d;return{id:j("conn"),title:x,description:k,icon:w,app_name:V(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:A,configuration_state:C??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{V as a,H as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
@@ -1,2 +1,2 @@
1
- import{c as se,b as Me,r as u,j as r,k as fe,B as De,e7 as Jt,aH as Zt,aN as xe,e8 as en,e9 as tn,ea as nn,eb as rn,bT as on,ec as sn,ed as lt,aJ as an,ee as ln,ef as cn,eg as dn,eh as un,ei as fn,ej as pn,ek as mn,el as xn,em as hn,m as le,o as gn,t as ne,K as Ze}from"./index-B3atnTOD.js";import{F as bn,l as yn}from"./monaco-editor-7A-fQDgF.js";import{e as vn,aX as Cn,aY as wn}from"./agent-icon-CcGcwzy7.js";import{s as Nn}from"./XClose-CZmy9H1H.js";import{B as jn}from"./automation-runs-OtdSB4BI.js";import{c as et,T as tt,a as nt}from"./tooltip-KklTekq-.js";import{a as En}from"./chat-context-CPTHsiXT.js";import{u as Sn}from"./shell-layout-CPfuamIU.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as je,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-6CjSbeiO.js";import{b as _n,h as Gn,a as Bn,c as Vn,d as Un,e as Hn}from"./dialog-C1nMHamp.js";import{I as ot}from"./input-CGnplup6.js";import{A as qn,a as Wn,b as Qn,c as Xn,d as Yn,e as Jn,f as Zn,g as er}from"./alert-dialog-r60zVmnF.js";import{t as tr}from"./ChevronDown-B_Kkx94b.js";import{i as nr}from"./ChevronRight-zfsu59r1.js";import{i as rr}from"./Share07-DsYUX-zt.js";import"./spinner-ChNwS7_i.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-CHfb9x-t.js";import"./Tool01-CGHeK1WE.js";import"./ArrowUp-CoPBJP5F.js";import"./ArrowLeft-BppNd44v.js";import"./Tool02-B1POxF2I.js";import"./XCircle-e8oZxnqK.js";import"./ArrowUpRight-BoRcUfPT.js";import"./TrendUp01-CjL_HE91.js";import"./ZapSquare-BakcP9-y.js";import"./Users03-DLe7GAgY.js";import"./CheckCircle-DYHnrji_.js";import"./Check-oDnQWrwG.js";import"./ChevronUp-EPvH8PkI.js";import"./DotsVertical-D_v8MV1q.js";import"./Stars02-uHXuTrxv.js";import"./Copy01-eDDf5Tut.js";import"./CpuChip01-CLo4Ix8E.js";import"./CreditCard01-xE5_nqV3.js";import"./Globe01-CRzaXNDn.js";import"./Settings02-G48i2TjO.js";import"./Eye-C-shpZBx.js";import"./FilterLines-eIVOYmnR.js";import"./Star01-BDPsn3iM.js";import"./Globe04-DNZHTV5G.js";import"./SwitchHorizontal01-B1Yc4H4f.js";import"./HardDrive-D838hg9y.js";import"./Key01-D5nk6wZa.js";import"./LayoutLeft-lpjOn5oi.js";import"./LinkExternal01-i_xcWupG.js";import"./LogOut01-BjxuTdOd.js";import"./Monitor01-CdHR20C9.js";import"./Sun-C1BvCEJt.js";import"./Palette-C4JrvRwY.js";import"./Play-B_-mBOJ3.js";import"./Plus-CM2iw1bv.js";import"./SearchLg-DzzT_0F0.js";import"./SearchMd-CCKu2g_A.js";import"./Shield01-BoXn0azv.js";import"./Stars01-DfGag_qD.js";import"./Trash01-CpLttFqU.js";import"./Upload01-Jc9Qf52D.js";import"./User01-DdVFKZ7n.js";import"./Users01-H9nHn8vh.js";import"./X-BJV63bzn.js";import"./Zap-Blr-6e3X.js";import"./select-n13gZUR4.js";import"./useInfiniteQuery-BtNh17CA.js";import"./use-infinite-scroll-B7qrPvcH.js";import"./use-connection-C1X3lSVO.js";import"./use-mcp-client-DkEyYZ91.js";import"./auth-CqUqMsnu.js";import"./use-virtual-mcp-BUnJVmrT.js";import"./card-CqzhZRSV.js";import"./sidebar-Lv799Z-V.js";import"./use-mobile-C4LZ2U9I.js";import"./table-0E7ZOwvy.js";import"./empty-state-DXjPkc2c.js";import"./use-members-JHZsQmeP.js";import"./use-org-auth-client-Cmf_KmfK.js";import"./use-clock-tick-D1xip4IB.js";import"./use-automations-CC95HsJ3.js";import"./studio-tools-BtWHGFPU.js";import"./useSuspenseInfiniteQuery-BT-eDQF7.js";import"./avatar-BXWNF77j.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CeBzb7Hf.js";import"./tab-id-CRGilEHg.js";import"./hooks-PrPdbNKh.js";import"./decopilot-sse-pool-l6_CQjlA.js";import"./backoff-CrEUbyZT.js";import"./index-D0v2h85f.js";import"./integration-icon-C_pPMzGj.js";import"./use-navigate-to-agent-BsT9Q7NC.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DgCu30RO.js";import"./form-R10hO2J-.js";import"./label-DfxdANU7.js";import"./file-type-icon-CfHt3K89.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CN1yjbVc.js";import"./use-decopilot-events-CxiZgv6A.js";import"./use-organization-settings-DkHjE6yi.js";import"./required-auth-layout-D6aEDoml.js";import"./use-org-sso-C2ZQyqYB.js";import"./drawer-DEkxI9w4.js";import"./collection-search-DgyknVYJ.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-D8y23nM4.js";import"./toggle-group-DHdlMPfI.js";import"./use-deco-credits-LrXk-MBS.js";import"./popover-CWSecgpe.js";import"./self-tool-result-DUk5meEa.js";import"./extract-connection-data-Cn56rg8y.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-D7TAcVXO.js";import"./authenticate-and-persist-oauth-C2niz4aW.js";import"./mcp-oauth-BsOFbQiK.js";import"./track-Dw02MQy6.js";import"./toolbar-DDqrHoei.js";import"./skeleton-Djn5TkUR.js";import"./github-repo-picker-C7HmB7sD.js";import"./use-mcp-tools-Bt0DfVe_.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DdbLECLO.js";import"./use-registry-connections-DcHhsRqb.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-C5-ccd3M.js";import"./connection-form-helpers-pxk9NpaA.js";import"./collection-tabs-_w1KzSrn.js";import"./badge-DAoU6Imp.js";import"./use-open-billing-url-DPFRpHrg.js";import"./select-model-CoMCgT-3.js";import"./checkbox-DQLcQWSw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D4f-00oI.js";import"./cards--2WkELWt.js";import"./dropdown-menu-A0sNkJ-D.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-hGNAJHvg.js";import"./use-capability-BJXC5dNN.js";import"./pt-BR-CLy76QW2.js";import"./switch-1BnhIFND.js";import"./use-debounced-autosave-BQ-qnhi7.js";import"./index-S4-F33Y4.js";import"./search-input-hKyul0tm.js";import"./index-fnW3g-fp.js";import"./use-secrets-BGgsRw_P.js";import"./use-tags-DEzUFQ7U.js";import"./get-initials-D-f_fDFw.js";import"./command-ZczUCKOE.js";import"./index-D05cQ3iM.js";import"./use-file-configs-MR70qXpO.js";import"./automation-list-row-DOKJeKYO.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Vn,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Un,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(qn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Wn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Jn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(er,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=Fn(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function $a({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S($n(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await On(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Rn(h,f),Xe=Tn(qt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
2
- `)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=kn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{$a as FileExplorer};
1
+ import{c as se,b as Me,r as u,j as r,k as fe,B as De,e8 as Jt,aH as Zt,aN as xe,e9 as en,ea as tn,eb as nn,ec as rn,bU as on,ed as sn,ee as lt,aJ as an,ef as ln,eg as cn,eh as dn,ei as un,ej as fn,ek as pn,el as mn,em as xn,en as hn,m as le,o as gn,t as ne,K as Ze}from"./index-D5h-RA3J.js";import{F as bn,l as yn}from"./monaco-editor-NXDX0zKn.js";import{e as vn,aX as Cn,aY as wn}from"./agent-icon-CFXZTI_j.js";import{s as Nn}from"./XClose-DiVQMRNE.js";import{B as jn}from"./automation-runs-DRXVnqv2.js";import{c as et,T as tt,a as nt}from"./tooltip-DvFWNEDZ.js";import{a as En}from"./chat-context-DOTgxfnO.js";import{u as Sn}from"./shell-layout-C01QrzQo.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as je,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-Bs4Wh_Lx.js";import{b as _n,h as Gn,a as Bn,c as Un,d as Vn,e as Hn}from"./dialog-BlfHYeFc.js";import{I as ot}from"./input-CBPk2Ds2.js";import{A as qn,a as Wn,b as Qn,c as Xn,d as Yn,e as Jn,f as Zn,g as er}from"./alert-dialog-ynETGH7r.js";import{t as tr}from"./ChevronDown-DDAzQt6T.js";import{i as nr}from"./ChevronRight-CumQ7Y3c.js";import{i as rr}from"./Share07-CmNWLd8X.js";import"./spinner-CvvlYw0Q.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-BWDnTsmK.js";import"./Tool01-DJWvUdRn.js";import"./ArrowUp-BIWZ-Zm0.js";import"./ArrowLeft-DVsBvE7g.js";import"./Tool02-DpdVhL0m.js";import"./XCircle-B278tfex.js";import"./ArrowUpRight-9a2Pp6SJ.js";import"./TrendUp01-B18kPLjE.js";import"./ZapSquare-DS9QQvEJ.js";import"./Users03-CGwaCKmz.js";import"./CheckCircle-BxGsU5ea.js";import"./Check-7WAvFi-X.js";import"./ChevronUp-CfrRYWx0.js";import"./DotsVertical-CVGyjria.js";import"./Stars02-ByC2w8gM.js";import"./Copy01-emQNe-na.js";import"./CpuChip01-BZERwn-Y.js";import"./CreditCard01-ChcGWPdA.js";import"./Globe01-CG8woUvQ.js";import"./Settings02-D5EXr4GC.js";import"./Eye-B2iGLYP5.js";import"./FilterLines-CmwMvBpb.js";import"./Star01-C-jBz2wz.js";import"./Globe04-Ce-zfyTK.js";import"./SwitchHorizontal01-Bd3QKMh1.js";import"./HardDrive-D0B55OwB.js";import"./Key01-CSUPWNtZ.js";import"./LayoutLeft-abZzAh0Z.js";import"./LinkExternal01-CIUiuJI2.js";import"./LogOut01-BipgIR60.js";import"./Monitor01-BxT46IoP.js";import"./Sun-wg-cv_Yg.js";import"./Palette-D6vOAUYn.js";import"./Play-sVwBY1NN.js";import"./Plus-KRh9j6XC.js";import"./SearchLg-D9_yLnhj.js";import"./SearchMd-g2EyVZW3.js";import"./Shield01-BLHZd-DF.js";import"./Stars01-DD_9MFaY.js";import"./Trash01-h_oyaZP1.js";import"./Upload01-DRey_V3_.js";import"./User01-DsPz_8Cg.js";import"./Users01-WLzsa5xo.js";import"./X-BLMSR2fx.js";import"./Zap-Cy8qu-W6.js";import"./select-rJkR_gvP.js";import"./useInfiniteQuery-DFEPuFoR.js";import"./use-infinite-scroll-qQ-p16F-.js";import"./use-connection-1Q4RUKqc.js";import"./use-mcp-client-DodrDlG1.js";import"./auth-BXPQkeoy.js";import"./use-virtual-mcp-V4Sk9KJ8.js";import"./card-B1MB2XIq.js";import"./sidebar-vViO6g4B.js";import"./use-mobile-CIuAlh23.js";import"./table-B6xpWVKL.js";import"./empty-state-s02r9CMc.js";import"./use-members-DuHtO7Sk.js";import"./use-org-auth-client-DIZfUC7y.js";import"./use-clock-tick-9QE_PsZO.js";import"./use-automations-CUmQkHyY.js";import"./studio-tools-BeO54KZA.js";import"./useSuspenseInfiniteQuery-xmUv9tiN.js";import"./avatar-D4Gp0_T6.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Do31Tm4X.js";import"./tab-id-CW_C6dRF.js";import"./hooks-DR_K28WC.js";import"./decopilot-sse-pool-KSjCShMZ.js";import"./backoff-CrEUbyZT.js";import"./index-DqAzmrb9.js";import"./integration-icon-c7-JobNw.js";import"./use-navigate-to-agent-Byr2x6oE.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-IB77Vhp3.js";import"./form-BhiAOBc7.js";import"./label-BOB3sH-D.js";import"./file-type-icon-Dq3kZ9vZ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-C2iu6mzc.js";import"./use-decopilot-events-eJfwl8Sl.js";import"./use-organization-settings-G_H8gyEH.js";import"./required-auth-layout-C8XW5pPu.js";import"./use-org-sso-DZxsRh1Z.js";import"./drawer-FBry2ukP.js";import"./collection-search-TzXSHwsA.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-DXyCPlWJ.js";import"./toggle-group-C-BMgiwu.js";import"./use-deco-credits-CKR9xaP4.js";import"./popover-CrgGQkZP.js";import"./self-tool-result-C_0Vo1wf.js";import"./extract-connection-data-CzvlGw-U.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CzHGrIM_.js";import"./authenticate-and-persist-oauth-BgSdBXRI.js";import"./mcp-oauth-GA_AotKT.js";import"./track-B5LlpjI7.js";import"./toolbar-B6misCX5.js";import"./skeleton-CL3BTEwq.js";import"./github-repo-picker-CyTvg6P_.js";import"./use-mcp-tools-76H7sAkU.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-C9V1KBF_.js";import"./use-registry-connections-F_KHZ1hv.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DIWSPxFy.js";import"./connection-form-helpers-U9QEikZB.js";import"./collection-tabs-C-pb2dPt.js";import"./badge-CQc7UGAT.js";import"./use-open-billing-url-CQoiy6Fb.js";import"./select-model-5S1ChDGt.js";import"./checkbox-B3tu6pXL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-3LqbPXnx.js";import"./cards-D_Lke0Fw.js";import"./dropdown-menu-B6LwWkvh.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BVkHD11_.js";import"./use-capability-DrzlW7so.js";import"./pt-BR-CLy76QW2.js";import"./switch-CGDS1hSQ.js";import"./use-debounced-autosave-Cwchio0s.js";import"./index-D2tWT1ul.js";import"./search-input-WVzZekD4.js";import"./index-BSmhfQjB.js";import"./use-secrets-BHBstyau.js";import"./use-tags-BSUXaArl.js";import"./get-initials-D-f_fDFw.js";import"./command-Be0gh_Jx.js";import"./index-Cs1qeBli.js";import"./use-file-configs-BmKjVP8T.js";import"./automation-list-row-DKmikVqJ.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let U;e[56]!==B||e[57]!==L?(U=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=U):U=e[58];let O;e[59]!==z||e[60]!==U?(O=r.jsxs(Un,{children:[z,U]}),e[59]=z,e[60]=U,e[61]=O):O=e[61];let V;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(V=r.jsx(Vn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=V):V=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==V?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:V}),e[67]=F,e[68]=s,e[69]=V,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(qn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Wn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Jn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(er,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let U;e[43]!==b?(U=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=U):U=e[44];let O;e[45]!==Z||e[46]!==U?(O=r.jsx(ue,{onSelect:Z,children:U}),e[45]=Z,e[46]=U,e[47]=O):O=e[47];let V;e[48]!==b?(V=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=V):V=e[49];let ee;e[50]!==q||e[51]!==V?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:V}),e[50]=q,e[51]=V,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Ur(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=Fn(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Vr),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Vr(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function $a({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),U=u.useRef(null),O=u.useRef(null),V=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ue(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ue(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ve(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ve(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;U.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ue(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=U.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(U.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S($n(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=V.current;if(!n||n.path!==d)return;V.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){V.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await On(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ve(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Ut(t,n){if(n){We(t);return}await Bt(t)}async function Vt(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Vt(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Rn(h,f),Xe=Tn(qt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
2
+ `)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=kn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Ut(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Ur,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{$a as FileExplorer};