decocms 4.63.2 → 4.63.3

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 (227) hide show
  1. package/dist/client/assets/{AlertCircle-BTBypCdn.js → AlertCircle-CqDLg4E0.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BhX94NDH.js → AreaChart-fkEDVRVu.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BJLl9TqD.js → ArrowUp-y4qiws93.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-sV3vc65w.js → ArrowUpRight-fu_iMwrL.js} +1 -1
  5. package/dist/client/assets/{Check-C6CkZg9-.js → Check-CQjJylK6.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-uMaPMHfw.js → CheckCircle-Bk4jVW7c.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-CnSiev6J.js → ChevronDown-D0HdYvxS.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Bl_yFHrD.js → ChevronRight-e9_7KV61.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BaPKVFC3.js → ChevronUp-hFG8HdCY.js} +1 -1
  10. package/dist/client/assets/{Circle-DWd5snPl.js → Circle-C2Vu6xbB.js} +1 -1
  11. package/dist/client/assets/{Copy01-q1_4xSoT.js → Copy01-B_L_kofR.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-3-1wg6CQ.js → DotsVertical-D2l5wspb.js} +1 -1
  13. package/dist/client/assets/{Eye-BkqHAYFU.js → Eye-DqWJbQD8.js} +1 -1
  14. package/dist/client/assets/{FilterLines-C3raf_4-.js → FilterLines-Cp18AAlg.js} +1 -1
  15. package/dist/client/assets/{Globe01-C_XmMjFu.js → Globe01-BPH4QSYr.js} +1 -1
  16. package/dist/client/assets/{Globe04-BrGU2s2F.js → Globe04-BHPtBBwM.js} +1 -1
  17. package/dist/client/assets/{HardDrive-BphckALA.js → HardDrive-BbOBIb1x.js} +1 -1
  18. package/dist/client/assets/{Key01-DGNNZHBM.js → Key01-MruRu6FB.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-DXTPhzEW.js → LayoutLeft-Btc5kA34.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-DLTXWmjD.js → LinkExternal01-DaXyeXMC.js} +1 -1
  21. package/dist/client/assets/{List-BwKSG732.js → List-B9BMYMsL.js} +1 -1
  22. package/dist/client/assets/{Monitor01-D7y4Pb1B.js → Monitor01-XhoZ48SW.js} +1 -1
  23. package/dist/client/assets/{Package-Q8Zv9Y_3.js → Package-D4FjGHlZ.js} +1 -1
  24. package/dist/client/assets/{Palette-D82zDHT4.js → Palette-Qilg0lma.js} +1 -1
  25. package/dist/client/assets/{Play-CF7bszTU.js → Play-BinR83so.js} +1 -1
  26. package/dist/client/assets/{Plus-ZkctvKC4.js → Plus-DUEQJ6Dq.js} +1 -1
  27. package/dist/client/assets/{SearchLg-iQhGcj-a.js → SearchLg-CFb4RdYX.js} +1 -1
  28. package/dist/client/assets/{SearchMd-D002K9LO.js → SearchMd-ClupCW3U.js} +1 -1
  29. package/dist/client/assets/{Settings02-Deuua6cy.js → Settings02-CiDkLfc2.js} +1 -1
  30. package/dist/client/assets/{Shield01-DPjv8Zam.js → Shield01-DwhqGz1N.js} +1 -1
  31. package/dist/client/assets/{Star01-BhWhGrZ_.js → Star01--k_y5js5.js} +1 -1
  32. package/dist/client/assets/{Stars01-Dw5HzSvc.js → Stars01-CUp5AWO9.js} +1 -1
  33. package/dist/client/assets/{Stars02-eG3W6QRG.js → Stars02-CjLOPFO-.js} +1 -1
  34. package/dist/client/assets/{Sun-CsySQ-v-.js → Sun-gdDoFC0z.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-h4mu2LgB.js → SwitchHorizontal01-Cx70rbaz.js} +1 -1
  36. package/dist/client/assets/{Tool01-BI49uxz7.js → Tool01-TTerLlhX.js} +1 -1
  37. package/dist/client/assets/{Tool02-bHBqq1Gb.js → Tool02-CuulG4Zm.js} +1 -1
  38. package/dist/client/assets/{Trash01-C4WuTo6-.js → Trash01-D6a6rHm7.js} +1 -1
  39. package/dist/client/assets/{Trash03-Cwg_hP4B.js → Trash03-ApRuYZcp.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Bp8GuuqE.js → TrendUp01-vfQPSjAQ.js} +1 -1
  41. package/dist/client/assets/{Upload01-0ls4OKAV.js → Upload01-qHg-k01G.js} +1 -1
  42. package/dist/client/assets/{User01-cqDu6Kgh.js → User01-Bh7a4wfo.js} +1 -1
  43. package/dist/client/assets/{Users01-BuDSv84q.js → Users01-BOa_T7-l.js} +1 -1
  44. package/dist/client/assets/{Users03-DMqPwFCP.js → Users03-CoBRlJkB.js} +1 -1
  45. package/dist/client/assets/{X-Arce-Ge0.js → X-DyjfKbz8.js} +1 -1
  46. package/dist/client/assets/{XCircle-rnvB6r1o.js → XCircle-C-sHcbib.js} +1 -1
  47. package/dist/client/assets/{XClose-Dq50L0Ca.js → XClose-hFrmy8Kh.js} +1 -1
  48. package/dist/client/assets/{Zap-cEit2Hj5.js → Zap-C54DyH6J.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-DyWoH3ti.js → ZapSquare-sm-ESnXi.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-CumCWj6X.js → ZoomOut-qGM7S5aC.js} +1 -1
  51. package/dist/client/assets/{access-gate-CIIsAfZg.js → access-gate-DU_TeSxf.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-DI17p83S.js → add-section-modal-CdFF32EI.js} +1 -1
  53. package/dist/client/assets/{agent-icon-BnuD7OG4.js → agent-icon-Cn3pvSY1.js} +1 -1
  54. package/dist/client/assets/{agents-list-Brg6uD_-.js → agents-list-CF4p5Rs9.js} +1 -1
  55. package/dist/client/assets/{ai-providers-Bh0y9jDE.js → ai-providers-BFICBoVk.js} +1 -1
  56. package/dist/client/assets/{alert-Cpp44T6I.js → alert-C7o1ddSa.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-B2NrMNUE.js → alert-dialog-qefhsonV.js} +1 -1
  58. package/dist/client/assets/{app-editor-Cy8vcnnM.js → app-editor-C4DdN908.js} +1 -1
  59. package/dist/client/assets/{auth-CWa2vT5L.js → auth-Dz4ZnGBZ.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-B0F8kAo5.js → auth-catchall-CWbMy765.js} +1 -1
  61. package/dist/client/assets/{auth-entry-BD9y6J-q.js → auth-entry-CUEj8xR9.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-DdUB_-Tg.js → auth-split-layout-ltcelxw4.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-CEQqfsIQ.js → authenticate-and-persist-oauth-C5bv8dSc.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-C16-DFOd.js → automation-list-row-TWr0b03X.js} +1 -1
  65. package/dist/client/assets/{automation-runs-8UgQ1V2y.js → automation-runs-LgYaU7NT.js} +1 -1
  66. package/dist/client/assets/{automations-BlDoHSuP.js → automations-CsAa80EW.js} +1 -1
  67. package/dist/client/assets/{autosend-CqddBdGe.js → autosend-nk4Rnt6q.js} +1 -1
  68. package/dist/client/assets/{avatar-hfq9tnFm.js → avatar-Mvk4Pr6q.js} +1 -1
  69. package/dist/client/assets/{badge-YHkNrrCW.js → badge-DPo5atq1.js} +1 -1
  70. package/dist/client/assets/{block-document-D76SqY1T.js → block-document-Dg30aQSW.js} +1 -1
  71. package/dist/client/assets/{brand-context-C7osILME.js → brand-context-Dhg7U_V0.js} +1 -1
  72. package/dist/client/assets/{buckets-B2Kkg2C1.js → buckets-BEmUUHe9.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-D-swgwub.js → bulk-category-panel-CycI-RhI.js} +1 -1
  74. package/dist/client/assets/{calendar-BKliC0dO.js → calendar-BJlaa-tp.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-CpFzHmR1.js → capability-load-error-BJsCCDoC.js} +1 -1
  76. package/dist/client/assets/{card-BuTTBPVv.js → card-CQ82z7ux.js} +1 -1
  77. package/dist/client/assets/{category-editor-DVOqZTFo.js → category-editor-BeORbrMO.js} +1 -1
  78. package/dist/client/assets/{chat-context-CbliNlff.js → chat-context-DWZk_XUk.js} +1 -1
  79. package/dist/client/assets/{checkbox-q4GScbrY.js → checkbox-Ci379OZ6.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BKrJV8hJ.js → cli-auth-success-H2Mu-YzX.js} +1 -1
  81. package/dist/client/assets/{collection-detail-CD7OwWYS.js → collection-detail-gbmXdfyo.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-BjSnIE-R.js → collection-display-button-BEL7jV2D.js} +1 -1
  83. package/dist/client/assets/{collection-search-CMyvx3uf.js → collection-search-zDpqz1Y6.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-L5cOGjNI.js → collection-table-wrapper-BwUeEiyV.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-DpKi-Pwv.js → collection-tabs-CpVhSZXL.js} +1 -1
  86. package/dist/client/assets/{command-xRIzaNK4.js → command-D0oHu6yC.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-wdm8gGPG.js → commerce-onboarding-DHHGk3Tu.js} +1 -1
  88. package/dist/client/assets/{connect-desktop-dialog-BIKJ6n-k.js → connect-desktop-dialog-kTPFYpDX.js} +1 -1
  89. package/dist/client/assets/{connection-card-DdMOmbQa.js → connection-card-i6t_iiUW.js} +1 -1
  90. package/dist/client/assets/{connection-detail-DqWeWMCH.js → connection-detail-CYgpB80y.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-_RrYdkdW.js → connection-form-helpers-BHtBtUMl.js} +1 -1
  92. package/dist/client/assets/{connections-DJaNcvRd.js → connections-C2SOOxBy.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-DQQBYQUt.js → decopilot-sse-pool-v_-kLso6.js} +1 -1
  94. package/dist/client/assets/{dialog-CzzC6F62.js → dialog-df3kXkJ6.js} +1 -1
  95. package/dist/client/assets/{domain-settings-mISoIv8l.js → domain-settings-D3lNyhbU.js} +1 -1
  96. package/dist/client/assets/{drawer-DuwjCdW6.js → drawer-CDEnz8Vo.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-JCGdvklS.js → dropdown-menu-Bccvvqlu.js} +1 -1
  98. package/dist/client/assets/{empty-state-Dl4HXkXF.js → empty-state-BIk42_em.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-_BJPZSvu.js → extract-connection-data-Ds-QcBxj.js} +1 -1
  100. package/dist/client/assets/{file-explorer-DBYEoeSj.js → file-explorer-BMPDp0P9.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-CrZXGPZz.js → file-type-icon-BA-Uo760.js} +1 -1
  102. package/dist/client/assets/{files-CIzhOaxH.js → files-N7PjuEfZ.js} +1 -1
  103. package/dist/client/assets/{form-Bezqbf8w.js → form-Dn-2qr3X.js} +1 -1
  104. package/dist/client/assets/{general-Bu6jSzvS.js → general-C_gTTNgW.js} +1 -1
  105. package/dist/client/assets/{github-repo-picker-oKYi49JD.js → github-repo-picker-DO2Q3TKU.js} +1 -1
  106. package/dist/client/assets/{hooks-Lb4O_GM3.js → hooks-hF_71sFE.js} +1 -1
  107. package/dist/client/assets/{index-C2BgM8Yk.js → index-3YUbhWxY.js} +1 -1
  108. package/dist/client/assets/{index-ESHPxC-C.js → index-B5nxmOre.js} +1 -1
  109. package/dist/client/assets/{index-B35SIJeq.js → index-BX44TYXY.js} +1 -1
  110. package/dist/client/assets/{index-UC-5Zxqy.js → index-Bhm9Bs1H.js} +3 -3
  111. package/dist/client/assets/{index-DYt6FiP0.js → index-CPBEAxML.js} +5 -5
  112. package/dist/client/assets/{index-C43SQexq.js → index-CjeRZZ8Z.js} +1 -1
  113. package/dist/client/assets/{index-BUMlAxI6.js → index-CvHdT8wM.js} +1 -1
  114. package/dist/client/assets/{index-D4CJqCP8.js → index-D6hE8whu.js} +1 -1
  115. package/dist/client/assets/{index-BM7GH0TM.js → index-DHeYoHcI.js} +1 -1
  116. package/dist/client/assets/{index-CyJbjnvf.js → index-DeNFvz9A.js} +1 -1
  117. package/dist/client/assets/{index-Iu2z9rV5.js → index-DgXATCJ-.js} +1 -1
  118. package/dist/client/assets/{index-Ak5DgymX.js → index-Dm83E3iX.js} +1 -1
  119. package/dist/client/assets/{index-BPuqsE1D.js → index-cxmaQW5O.js} +1 -1
  120. package/dist/client/assets/{index-Bkiwnc43.js → index-qJ1WxKPj.js} +1 -1
  121. package/dist/client/assets/{index-redirect-C-1Aum45.js → index-redirect-Bt11ZHdI.js} +1 -1
  122. package/dist/client/assets/{input-CdzdWrKi.js → input-DospeWmi.js} +1 -1
  123. package/dist/client/assets/{integration-icon-C9eGFf17.js → integration-icon-BGWuRbhS.js} +1 -1
  124. package/dist/client/assets/{invite-member-dialog-Dsrdx3GF.js → invite-member-dialog-GWLlNlTr.js} +1 -1
  125. package/dist/client/assets/{label-B6bwSWu6.js → label-BosGIEt_.js} +1 -1
  126. package/dist/client/assets/{layout-DozuMsvh.js → layout-Cb7BN-pG.js} +1 -1
  127. package/dist/client/assets/{login-C9GZMnFR.js → login-Dv68kU9z.js} +1 -1
  128. package/dist/client/assets/{mcp-oauth-DytXRgMV.js → mcp-oauth-BDrL0Lxz.js} +1 -1
  129. package/dist/client/assets/{members-BH9NbFKp.js → members-u0ZQQe44.js} +1 -1
  130. package/dist/client/assets/{monaco-editor-DBrHXynI.js → monaco-editor-DUt2Vaks.js} +1 -1
  131. package/dist/client/assets/{monitoring-stats-row-CO69tHOn.js → monitoring-stats-row-BRmrkF2L.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-CNY0mybS.js → oauth-callback-CPxVmlpn.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-CXTgzB5t.js → oauth-callback-ai-provider-81UU3hp1.js} +1 -1
  134. package/dist/client/assets/{onboarding-DDJYNxgP.js → onboarding-daOS8one.js} +1 -1
  135. package/dist/client/assets/{org-install-nly3Bzjd.js → org-install-DfNkFZLw.js} +1 -1
  136. package/dist/client/assets/{org-layout-BbVv-ivs.js → org-layout-DZc1KUks.js} +1 -1
  137. package/dist/client/assets/{organization-choice-DVQDFQLE.js → organization-choice-C2ERvF2i.js} +1 -1
  138. package/dist/client/assets/{orgs-prHljJU8.js → orgs-BR051vSM.js} +1 -1
  139. package/dist/client/assets/{page-seo-form-CqY6_i8R.js → page-seo-form-CojnY8G_.js} +1 -1
  140. package/dist/client/assets/page-seo-sheet-DGb4ld91.js +1 -0
  141. package/dist/client/assets/{popover-DSyswm1r.js → popover-CqoWWaG4.js} +1 -1
  142. package/dist/client/assets/{post-editor-BSxTbq-v.js → post-editor-DwHJt0-E.js} +1 -1
  143. package/dist/client/assets/{primitives-BYjlG1fS.js → primitives-DLS11ccE.js} +1 -1
  144. package/dist/client/assets/{profile-DSppTsnH.js → profile-Dkf4Cr8c.js} +1 -1
  145. package/dist/client/assets/project-app-view-BbX8ZVqk.js +1 -0
  146. package/dist/client/assets/record-editor-BCAeMtFU.js +1 -0
  147. package/dist/client/assets/registry-CA7_2i3l.js +2 -0
  148. package/dist/client/assets/{registry-layout-C4dGAHKX.js → registry-layout-D80tOcFJ.js} +1 -1
  149. package/dist/client/assets/{reports-rgCiaQfZ.js → reports-CWqLneIh.js} +1 -1
  150. package/dist/client/assets/{require-capability-CHqKvGf6.js → require-capability-Ct_Ojh8K.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-NaXT3_BP.js → required-auth-layout-C_gORevl.js} +1 -1
  152. package/dist/client/assets/{reset-password-wmRO1kQU.js → reset-password-DvcxKapF.js} +1 -1
  153. package/dist/client/assets/{roles-BCQT0qMS.js → roles-BKUN8edV.js} +1 -1
  154. package/dist/client/assets/{search-input-CedQS3fi.js → search-input-fh_pNTUU.js} +1 -1
  155. package/dist/client/assets/{secrets-NFKjvWj2.js → secrets-ag6AC19e.js} +1 -1
  156. package/dist/client/assets/{sections-editor-DFbXpELA.js → sections-editor-DFJpcghW.js} +1 -1
  157. package/dist/client/assets/{select-CBCIQKJa.js → select-b1vNfzCY.js} +1 -1
  158. package/dist/client/assets/{select-model-Ct4g3NyR.js → select-model-DdtZCC-h.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-xRS_KbBg.js → self-tool-result-DBIxxKX-.js} +1 -1
  160. package/dist/client/assets/{seo-editor-DF84QQ2c.js → seo-editor-CeADvhMm.js} +1 -1
  161. package/dist/client/assets/{settings-layout--8tic038.js → settings-layout-pVc_DMvj.js} +1 -1
  162. package/dist/client/assets/{settings-section-BO3lvI3u.js → settings-section-DmXhlL47.js} +1 -1
  163. package/dist/client/assets/{shell-controls-DHSs_8GA.js → shell-controls-YiekLdtP.js} +1 -1
  164. package/dist/client/assets/{shell-layout-CcwCsF5D.js → shell-layout-CXtvlsY5.js} +1 -1
  165. package/dist/client/assets/{sidebar-DKTHHq9w.js → sidebar-CVCJDFEY.js} +1 -1
  166. package/dist/client/assets/{skeleton-Bq-ZzOX2.js → skeleton-B7bqRPfS.js} +1 -1
  167. package/dist/client/assets/{sso-D5cfEoiQ.js → sso-CtB3sWb9.js} +1 -1
  168. package/dist/client/assets/{store-BNAUDVRg.js → store-Di7nhFnI.js} +1 -1
  169. package/dist/client/assets/store-registry-DgWk0Vtp.js +2 -0
  170. package/dist/client/assets/{studio-tools-LMp9AQEt.js → studio-tools-C158uWMN.js} +1 -1
  171. package/dist/client/assets/{switch-DSsZIKRQ.js → switch-jhzFDXbX.js} +1 -1
  172. package/dist/client/assets/{table-Ce-xb9xB.js → table-Cw-KhGHY.js} +1 -1
  173. package/dist/client/assets/{tabs-BKFP20BY.js → tabs-2LSj3D0O.js} +1 -1
  174. package/dist/client/assets/{textarea-hc_vGNu_.js → textarea-CaTaS5aM.js} +1 -1
  175. package/dist/client/assets/{toggle-group-BcRGmKwE.js → toggle-group-Baz9dJJh.js} +1 -1
  176. package/dist/client/assets/{toolbar-DummVT0p.js → toolbar-CJdn53aQ.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-DkhMlFlp.js → toolbar-icon-button-D9MmLXQ-.js} +1 -1
  178. package/dist/client/assets/{tools-list-BhzXdOBv.js → tools-list-BFSiq3Ya.js} +1 -1
  179. package/dist/client/assets/{tooltip-oF2dxKvS.js → tooltip-0Tj-MlQQ.js} +1 -1
  180. package/dist/client/assets/{use-ai-providers-DFrX5Ixe.js → use-ai-providers-Bp2eeB1_.js} +1 -1
  181. package/dist/client/assets/{use-automations-qBheTnHm.js → use-automations-9lVGXcc7.js} +1 -1
  182. package/dist/client/assets/{use-capability-BFUmGJ2c.js → use-capability-CxpcJysD.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-BgQszoea.js → use-clock-tick-CAhIFZB2.js} +1 -1
  184. package/dist/client/assets/{use-collections-blnu2tgv.js → use-collections-Dl176bBd.js} +1 -1
  185. package/dist/client/assets/{use-connection-Cw3xkHvl.js → use-connection-DZnUxHel.js} +1 -1
  186. package/dist/client/assets/{use-copy-CvJ-3ij0.js → use-copy-iOzmDtUv.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-0npVNTv_.js → use-create-virtual-mcp-C0MgphvT.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-CIB-GuAM.js → use-debounced-autosave-CcCn7QVF.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-DS-Y5UGJ.js → use-debounced-value-C58Qyt5I.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-CKlPfDA8.js → use-deco-credits-D-zIU8pp.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-DKbJl4ca.js → use-decopilot-events-DRFp7dsG.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-CNp_BsSE.js → use-delete-connection-CzrZ4mQH.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-CZgq6nwd.js → use-deployment-admin-C_vlzdm0.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-DY10vbdS.js → use-file-configs-sSRaKhuP.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-CgK6_i3r.js → use-infinite-scroll-BLQ78HyQ.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-BkeSpaw9.js → use-join-requests-Bmy8CfcY.js} +1 -1
  197. package/dist/client/assets/{use-mcp-client-Dh-Q8DTG.js → use-mcp-client-Cm__SCrY.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-DHliIetD.js → use-mcp-tools-BBTNMsyU.js} +1 -1
  199. package/dist/client/assets/{use-members-DMRYjiNZ.js → use-members-Ccfmy0Gn.js} +1 -1
  200. package/dist/client/assets/{use-mobile-Berquj-a.js → use-mobile-Bp-djo0i.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-CN7_pj2K.js → use-navigate-to-agent-C6M7Wtez.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-CYqoyStI.js → use-org-auth-client-Cv2k88wA.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-BjUBqdim.js → use-org-sso-mBCV7A_Y.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-D1FuSBs8.js → use-organization-roles-DSBH_MSz.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-Dioq4CT5.js → use-organization-settings-ChRdOQ4P.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-CfnMZ-zK.js → use-registry-connections-ByfUE9xQ.js} +1 -1
  207. package/dist/client/assets/{use-secrets-yUdF3bez.js → use-secrets-DU_HoJG7.js} +1 -1
  208. package/dist/client/assets/{use-status-sounds-CKrZbd8R.js → use-status-sounds-D1XP90rS.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-BS40WrZo.js → use-view-mode-B-CLvSm1.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-BxAPmhe1.js → use-virtual-mcp-Do4TNc3V.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-C1NVu96X.js +1 -0
  212. package/dist/client/assets/{useRouterState-BMsfOWFN.js → useRouterState-D8jCYuF7.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-9qA33-wr.js +1 -0
  214. package/dist/client/assets/{users-Hi3d7jft.js → users-BbtJ2R-L.js} +1 -1
  215. package/dist/client/assets/{variant-calendar-DmERYe5g.js → variant-calendar-sXMgN6GG.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-a9_CAW3t.js → view-mode-toggle-B9xOnDKv.js} +1 -1
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +375 -375
  219. package/dist/server/server.js +272 -272
  220. package/package.json +1 -1
  221. package/dist/client/assets/page-seo-sheet-BLlZasir.js +0 -1
  222. package/dist/client/assets/project-app-view-6KL604QS.js +0 -1
  223. package/dist/client/assets/record-editor-BYBgdt-l.js +0 -1
  224. package/dist/client/assets/registry-BK9rFqBw.js +0 -2
  225. package/dist/client/assets/store-registry-BhImI2Wc.js +0 -2
  226. package/dist/client/assets/useInfiniteQuery-gMRRahCY.js +0 -1
  227. package/dist/client/assets/useSuspenseInfiniteQuery-22jejaAh.js +0 -1
@@ -1 +1 @@
1
- import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-UC-5Zxqy.js";import{u as ie}from"./studio-tools-LMp9AQEt.js";import{b as se,S as ne,a as oe}from"./settings-section-BO3lvI3u.js";import{B as Q}from"./badge-YHkNrrCW.js";import{I as ae}from"./input-CdzdWrKi.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-CBCIQKJa.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-Bhm9Bs1H.js";import{u as ie}from"./studio-tools-C158uWMN.js";import{b as se,S as ne,a as oe}from"./settings-section-DmXhlL47.js";import{B as Q}from"./badge-DPo5atq1.js";import{I as ae}from"./input-DospeWmi.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-b1vNfzCY.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cr as i,l as c}from"./index-UC-5Zxqy.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,N as d,b as e,j as f,v as g};
1
+ import{c as d,j as s,cr as i,l as c}from"./index-Bhm9Bs1H.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,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-UC-5Zxqy.js";import{i as $}from"./Check-C6CkZg9-.js";import{i as D}from"./ChevronRight-Bl_yFHrD.js";import{i as M}from"./Circle-DWd5snPl.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 O(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("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,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(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 G(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 L(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("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",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
1
+ import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-Bhm9Bs1H.js";import{i as $}from"./Check-CQjJylK6.js";import{i as D}from"./ChevronRight-e9_7KV61.js";import{i as M}from"./Circle-C2Vu6xbB.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 O(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("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,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(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 G(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 L(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("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",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-UC-5Zxqy.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-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,l as N,j as t}from"./index-Bhm9Bs1H.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-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"./index-UC-5Zxqy.js";import{c as O}from"./use-mcp-client-Dh-Q8DTG.js";import{W as T}from"./constants-D_FQAPnt.js";function x(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 U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(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 L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(t){return t?L[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 O({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)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(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=t._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=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,A=o?.configuration_state,C=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??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[v]:null,l=y?null:g[S];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=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=g.length>1,M=p.length>1;let d="";c&&M?d=` (${W(c)})`:l&&N&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??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{j as a,K as b,X as c,Q as d,Z as e,J as f,U as g,B as i};
1
+ import"./index-Bhm9Bs1H.js";import{c as O}from"./use-mcp-client-Cm__SCrY.js";import{W as T}from"./constants-D_FQAPnt.js";function x(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 U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(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 L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(t){return t?L[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 O({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)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(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=t._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=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,A=o?.configuration_state,C=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??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[v]:null,l=y?null:g[S];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=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=g.length>1,M=p.length>1;let d="";c&&M?d=` (${W(c)})`:l&&N&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??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{j as a,K as b,X as c,Q as d,Z as e,J as f,U as g,B as i};
@@ -1,2 +1,2 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-UC-5Zxqy.js";import{F as Ut,l as Vt}from"./index-B35SIJeq.js";import{e as qt,aC as Qt,aD as Ht,aE as ue,aF as Xt,ab as _e}from"./agent-icon-BnuD7OG4.js";import{a as Jt}from"./Tool01-BI49uxz7.js";import{s as Yt}from"./XClose-Dq50L0Ca.js";import{A as Zt}from"./automation-runs-8UgQ1V2y.js";import{b as ze,T as We,a as Ge}from"./tooltip-oF2dxKvS.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-B2NrMNUE.js";import{b as cn}from"./chat-context-CbliNlff.js";import{u as dn}from"./shell-layout-CcwCsF5D.js";import{s as fe,a as Ke,f as un}from"./index-DYt6FiP0.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-CzzC6F62.js";import{I as Be}from"./input-CdzdWrKi.js";import{t as vn}from"./ChevronDown-CnSiev6J.js";import{i as yn}from"./ChevronRight-Bl_yFHrD.js";import{a as Cn}from"./ZoomOut-CumCWj6X.js";import{E as wn,v as Ue,w as Ce,x as bn,y as jn,z as Nn,A as U,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-Ak5DgymX.js";import"./AlertCircle-BTBypCdn.js";import"./Trash03-Cwg_hP4B.js";import"./ArrowUp-BJLl9TqD.js";import"./Settings02-Deuua6cy.js";import"./Tool02-bHBqq1Gb.js";import"./XCircle-rnvB6r1o.js";import"./ArrowUpRight-sV3vc65w.js";import"./TrendUp01-Bp8GuuqE.js";import"./ZapSquare-DyWoH3ti.js";import"./Users03-DMqPwFCP.js";import"./CheckCircle-uMaPMHfw.js";import"./Check-C6CkZg9-.js";import"./ChevronUp-BaPKVFC3.js";import"./Circle-DWd5snPl.js";import"./Stars02-eG3W6QRG.js";import"./Copy01-q1_4xSoT.js";import"./DotsVertical-3-1wg6CQ.js";import"./Globe01-C_XmMjFu.js";import"./Eye-BkqHAYFU.js";import"./FilterLines-C3raf_4-.js";import"./Star01-BhWhGrZ_.js";import"./Globe04-BrGU2s2F.js";import"./SwitchHorizontal01-h4mu2LgB.js";import"./HardDrive-BphckALA.js";import"./Key01-DGNNZHBM.js";import"./LayoutLeft-DXTPhzEW.js";import"./LinkExternal01-DLTXWmjD.js";import"./List-BwKSG732.js";import"./Monitor01-D7y4Pb1B.js";import"./Sun-CsySQ-v-.js";import"./Package-Q8Zv9Y_3.js";import"./Palette-D82zDHT4.js";import"./Play-CF7bszTU.js";import"./Plus-ZkctvKC4.js";import"./SearchLg-iQhGcj-a.js";import"./SearchMd-D002K9LO.js";import"./Shield01-DPjv8Zam.js";import"./Stars01-Dw5HzSvc.js";import"./Trash01-C4WuTo6-.js";import"./Upload01-0ls4OKAV.js";import"./User01-cqDu6Kgh.js";import"./Users01-BuDSv84q.js";import"./X-Arce-Ge0.js";import"./Zap-cEit2Hj5.js";import"./select-CBCIQKJa.js";import"./useInfiniteQuery-gMRRahCY.js";import"./use-infinite-scroll-CgK6_i3r.js";import"./use-connection-Cw3xkHvl.js";import"./use-collections-blnu2tgv.js";import"./use-mcp-client-Dh-Q8DTG.js";import"./constants-D_FQAPnt.js";import"./auth-CWa2vT5L.js";import"./use-virtual-mcp-BxAPmhe1.js";import"./card-BuTTBPVv.js";import"./sidebar-DKTHHq9w.js";import"./use-mobile-Berquj-a.js";import"./table-Ce-xb9xB.js";import"./empty-state-Dl4HXkXF.js";import"./use-members-DMRYjiNZ.js";import"./use-org-auth-client-CYqoyStI.js";import"./use-clock-tick-BgQszoea.js";import"./use-automations-qBheTnHm.js";import"./studio-tools-LMp9AQEt.js";import"./useSuspenseInfiniteQuery-22jejaAh.js";import"./badge-YHkNrrCW.js";import"./checkbox-q4GScbrY.js";import"./command-xRIzaNK4.js";import"./index-D4CJqCP8.js";import"./popover-DSyswm1r.js";import"./avatar-hfq9tnFm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CvJ-3ij0.js";import"./file-type-icon-CrZXGPZz.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DBrHXynI.js";import"./delay-CnY5UFtP.js";import"./index-Iu2z9rV5.js";import"./hooks-Lb4O_GM3.js";import"./decopilot-sse-pool-DQQBYQUt.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-C9eGFf17.js";import"./use-navigate-to-agent-CN7_pj2K.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BhX94NDH.js";import"./form-Bezqbf8w.js";import"./label-B6bwSWu6.js";import"./autosend-CqddBdGe.js";import"./use-ai-providers-DFrX5Ixe.js";import"./use-decopilot-events-DKbJl4ca.js";import"./use-organization-settings-Dioq4CT5.js";import"./required-auth-layout-NaXT3_BP.js";import"./use-org-sso-BjUBqdim.js";import"./drawer-DuwjCdW6.js";import"./collection-search-CMyvx3uf.js";import"./tabs-BKFP20BY.js";import"./toggle-group-BcRGmKwE.js";import"./use-deco-credits-CKlPfDA8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DdMOmbQa.js";import"./use-registry-connections-CfnMZ-zK.js";import"./extract-connection-data-_BJPZSvu.js";import"./collection-tabs-DpKi-Pwv.js";import"./textarea-hc_vGNu_.js";import"./connection-form-helpers-_RrYdkdW.js";import"./authenticate-and-persist-oauth-CEQqfsIQ.js";import"./mcp-oauth-DytXRgMV.js";import"./connect-desktop-dialog-BIKJ6n-k.js";import"./select-model-Ct4g3NyR.js";import"./skeleton-Bq-ZzOX2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BO3lvI3u.js";import"./dropdown-menu-JCGdvklS.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CKrZbd8R.js";import"./toolbar-DummVT0p.js";import"./use-mcp-tools-DHliIetD.js";import"./use-capability-BFUmGJ2c.js";import"./tools-list-BhzXdOBv.js";import"./switch-DSsZIKRQ.js";import"./use-debounced-autosave-CIB-GuAM.js";import"./index-BM7GH0TM.js";import"./search-input-CedQS3fi.js";import"./github-repo-picker-oKYi49JD.js";import"./use-debounced-value-DS-Y5UGJ.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-yUdF3bez.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-BPuqsE1D.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BKliC0dO.js";import"./toolbar-icon-button-DkhMlFlp.js";import"./use-file-configs-DY10vbdS.js";import"./automation-list-row-C16-DFOd.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),C=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let O;e[9]!==C.description?(O=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.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)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.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)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("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",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("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",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function os({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(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 st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:wn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||C(n=>[...n,t]),Te(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
1
+ import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-Bhm9Bs1H.js";import{F as Ut,l as Vt}from"./index-BX44TYXY.js";import{e as qt,aC as Qt,aD as Ht,aE as ue,aF as Xt,ab as _e}from"./agent-icon-Cn3pvSY1.js";import{a as Jt}from"./Tool01-TTerLlhX.js";import{s as Yt}from"./XClose-hFrmy8Kh.js";import{A as Zt}from"./automation-runs-LgYaU7NT.js";import{b as ze,T as We,a as Ge}from"./tooltip-0Tj-MlQQ.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-qefhsonV.js";import{b as cn}from"./chat-context-DWZk_XUk.js";import{u as dn}from"./shell-layout-CXtvlsY5.js";import{s as fe,a as Ke,f as un}from"./index-CPBEAxML.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-df3kXkJ6.js";import{I as Be}from"./input-DospeWmi.js";import{t as vn}from"./ChevronDown-D0HdYvxS.js";import{i as yn}from"./ChevronRight-e9_7KV61.js";import{a as Cn}from"./ZoomOut-qGM7S5aC.js";import{E as wn,v as Ue,w as Ce,x as bn,y as jn,z as Nn,A as U,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-Dm83E3iX.js";import"./AlertCircle-CqDLg4E0.js";import"./Trash03-ApRuYZcp.js";import"./ArrowUp-y4qiws93.js";import"./Settings02-CiDkLfc2.js";import"./Tool02-CuulG4Zm.js";import"./XCircle-C-sHcbib.js";import"./ArrowUpRight-fu_iMwrL.js";import"./TrendUp01-vfQPSjAQ.js";import"./ZapSquare-sm-ESnXi.js";import"./Users03-CoBRlJkB.js";import"./CheckCircle-Bk4jVW7c.js";import"./Check-CQjJylK6.js";import"./ChevronUp-hFG8HdCY.js";import"./Circle-C2Vu6xbB.js";import"./Stars02-CjLOPFO-.js";import"./Copy01-B_L_kofR.js";import"./DotsVertical-D2l5wspb.js";import"./Globe01-BPH4QSYr.js";import"./Eye-DqWJbQD8.js";import"./FilterLines-Cp18AAlg.js";import"./Star01--k_y5js5.js";import"./Globe04-BHPtBBwM.js";import"./SwitchHorizontal01-Cx70rbaz.js";import"./HardDrive-BbOBIb1x.js";import"./Key01-MruRu6FB.js";import"./LayoutLeft-Btc5kA34.js";import"./LinkExternal01-DaXyeXMC.js";import"./List-B9BMYMsL.js";import"./Monitor01-XhoZ48SW.js";import"./Sun-gdDoFC0z.js";import"./Package-D4FjGHlZ.js";import"./Palette-Qilg0lma.js";import"./Play-BinR83so.js";import"./Plus-DUEQJ6Dq.js";import"./SearchLg-CFb4RdYX.js";import"./SearchMd-ClupCW3U.js";import"./Shield01-DwhqGz1N.js";import"./Stars01-CUp5AWO9.js";import"./Trash01-D6a6rHm7.js";import"./Upload01-qHg-k01G.js";import"./User01-Bh7a4wfo.js";import"./Users01-BOa_T7-l.js";import"./X-DyjfKbz8.js";import"./Zap-C54DyH6J.js";import"./select-b1vNfzCY.js";import"./useInfiniteQuery-C1NVu96X.js";import"./use-infinite-scroll-BLQ78HyQ.js";import"./use-connection-DZnUxHel.js";import"./use-collections-Dl176bBd.js";import"./use-mcp-client-Cm__SCrY.js";import"./constants-D_FQAPnt.js";import"./auth-Dz4ZnGBZ.js";import"./use-virtual-mcp-Do4TNc3V.js";import"./card-CQ82z7ux.js";import"./sidebar-CVCJDFEY.js";import"./use-mobile-Bp-djo0i.js";import"./table-Cw-KhGHY.js";import"./empty-state-BIk42_em.js";import"./use-members-Ccfmy0Gn.js";import"./use-org-auth-client-Cv2k88wA.js";import"./use-clock-tick-CAhIFZB2.js";import"./use-automations-9lVGXcc7.js";import"./studio-tools-C158uWMN.js";import"./useSuspenseInfiniteQuery-9qA33-wr.js";import"./badge-DPo5atq1.js";import"./checkbox-Ci379OZ6.js";import"./command-D0oHu6yC.js";import"./index-D6hE8whu.js";import"./popover-CqoWWaG4.js";import"./avatar-Mvk4Pr6q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-iOzmDtUv.js";import"./file-type-icon-BA-Uo760.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DUt2Vaks.js";import"./delay-CnY5UFtP.js";import"./index-DgXATCJ-.js";import"./hooks-hF_71sFE.js";import"./decopilot-sse-pool-v_-kLso6.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BGWuRbhS.js";import"./use-navigate-to-agent-C6M7Wtez.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-fkEDVRVu.js";import"./form-Dn-2qr3X.js";import"./label-BosGIEt_.js";import"./autosend-nk4Rnt6q.js";import"./use-ai-providers-Bp2eeB1_.js";import"./use-decopilot-events-DRFp7dsG.js";import"./use-organization-settings-ChRdOQ4P.js";import"./required-auth-layout-C_gORevl.js";import"./use-org-sso-mBCV7A_Y.js";import"./drawer-CDEnz8Vo.js";import"./collection-search-zDpqz1Y6.js";import"./tabs-2LSj3D0O.js";import"./toggle-group-Baz9dJJh.js";import"./use-deco-credits-D-zIU8pp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-i6t_iiUW.js";import"./use-registry-connections-ByfUE9xQ.js";import"./extract-connection-data-Ds-QcBxj.js";import"./collection-tabs-CpVhSZXL.js";import"./textarea-CaTaS5aM.js";import"./connection-form-helpers-BHtBtUMl.js";import"./authenticate-and-persist-oauth-C5bv8dSc.js";import"./mcp-oauth-BDrL0Lxz.js";import"./connect-desktop-dialog-kTPFYpDX.js";import"./select-model-DdtZCC-h.js";import"./skeleton-B7bqRPfS.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DmXhlL47.js";import"./dropdown-menu-Bccvvqlu.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1XP90rS.js";import"./toolbar-CJdn53aQ.js";import"./use-mcp-tools-BBTNMsyU.js";import"./use-capability-CxpcJysD.js";import"./tools-list-BFSiq3Ya.js";import"./switch-jhzFDXbX.js";import"./use-debounced-autosave-CcCn7QVF.js";import"./index-DHeYoHcI.js";import"./search-input-fh_pNTUU.js";import"./github-repo-picker-DO2Q3TKU.js";import"./use-debounced-value-C58Qyt5I.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-DU_HoJG7.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-cxmaQW5O.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BJlaa-tp.js";import"./toolbar-icon-button-D9MmLXQ-.js";import"./use-file-configs-sSRaKhuP.js";import"./automation-list-row-TWr0b03X.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),C=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let O;e[9]!==C.description?(O=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.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)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.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)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("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",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("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",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function os({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(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 st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:wn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||C(n=>[...n,t]),Te(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",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(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&T.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Te(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),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:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&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()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(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:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"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&&ee?.loaded?r.jsx(Ut,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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:"Select a file to edit"})}),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:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{os as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-UC-5Zxqy.js";import{i as zb}from"./Check-C6CkZg9-.js";import{a as jb}from"./Copy01-q1_4xSoT.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-CzzC6F62.js";import{n as I0}from"./Globe01-C_XmMjFu.js";import{h as k0,n as R0}from"./ZoomOut-CumCWj6X.js";import{u as N0}from"./use-mobile-Berquj-a.js";import{h as C0}from"./tab-id-bb-jjgGv.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
1
+ import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-Bhm9Bs1H.js";import{i as zb}from"./Check-CQjJylK6.js";import{a as jb}from"./Copy01-B_L_kofR.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-df3kXkJ6.js";import{n as I0}from"./Globe01-BPH4QSYr.js";import{h as k0,n as R0}from"./ZoomOut-qGM7S5aC.js";import{u as N0}from"./use-mobile-Bp-djo0i.js";import{h as C0}from"./tab-id-bb-jjgGv.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Wb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xb=/^( {2,}|\\)\n(?!\s*$)/,$0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tr=/[\p{P}\p{S}]/u,Zl=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,z0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zl).getRegex(),Qb=/(?!~)[\p{P}\p{S}]/u,j0=/(?!~)[\s\p{P}\p{S}]/u,V0=/(?:[^\s\p{P}\p{S}]|~)/u,Y0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Jb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,W0=le(Jb,"u").replace(/punct/g,tr).getRegex(),K0=le(Jb,"u").replace(/punct/g,Qb).getRegex(),eE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=le(eE,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),Z0=le(eE,"gu").replace(/notPunctSpace/g,V0).replace(/punctSpace/g,j0).replace(/punct/g,Qb).getRegex(),Q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),J0=le(/\\(punct)/,"gu").replace(/punct/g,tr).getRegex(),eS=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=le(Kl).replace("(?:-->|$)","-->").getRegex(),nS=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tE=le(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Wl).getRegex(),nE=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wl).getRegex(),aS=le("reflink|nolink(?!\\()","g").replace("reflink",tE).replace("nolink",nE).getRegex(),Ql={_backpedal:ln,anyPunctuation:J0,autolink:eS,blockSkip:Y0,br:Xb,code:G0,del:ln,emStrongLDelim:W0,emStrongRDelimAst:X0,emStrongRDelimUnd:Q0,escape:q0,link:rS,nolink:nE,punctuation:z0,reflink:tE,reflinkSearch:aS,tag:nS,text:$0,url:ln},iS={...Ql,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},_l={...Ql,emStrongRDelimAst:Z0,emStrongLDelim:K0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={..._l,br:le(Xb).replace("{2,}","*").getRegex(),text:le(_l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:Xl,gfm:U0,pedantic:H0},Jt={normal:Ql,gfm:_l,breaks:oS,pedantic:iS},sS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pc=e=>sS[e];function Je(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Pc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Pc);return e}function Fc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Bc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function en(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function uS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Uc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function lS(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Vn=class{options;rules;lexer;constructor(e){this.options=e||Nt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:en(n,`
@@ -1 +1 @@
1
- import{c as a,e as o,j as i,N as l}from"./index-UC-5Zxqy.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
1
+ import{c as a,e as o,j as i,N as l}from"./index-Bhm9Bs1H.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
@@ -1 +1 @@
1
- import{dE as C,c as d,j as c,ag as j,r as f,l as p,bd as b,dF as v,dG as h}from"./index-UC-5Zxqy.js";import{L as N}from"./label-B6bwSWu6.js";const D=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{dE as C,c as d,j as c,ag as j,r as f,l as p,bd as b,dF as v,dG as h}from"./index-Bhm9Bs1H.js";import{L as N}from"./label-BosGIEt_.js";const D=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
@@ -1 +1 @@
1
- import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ag as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-UC-5Zxqy.js";import{P as k}from"./index-BM7GH0TM.js";import{u as W}from"./use-org-auth-client-CYqoyStI.js";import{u as X}from"./use-debounced-autosave-CIB-GuAM.js";import{A as ee}from"./avatar-hfq9tnFm.js";import{I as G}from"./input-CdzdWrKi.js";import{S as P,a as I,b as _,c as te}from"./settings-section-BO3lvI3u.js";import{D as ne}from"./domain-settings-mISoIv8l.js";import{S as ae}from"./switch-DSsZIKRQ.js";import{c as se,f as oe}from"./use-organization-settings-Dioq4CT5.js";import{u as ie}from"./studio-tools-LMp9AQEt.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-B2NrMNUE.js";import{R as pe}from"./require-capability-CHqKvGf6.js";import"./sidebar-DKTHHq9w.js";import"./LayoutLeft-DXTPhzEW.js";import"./use-mobile-Berquj-a.js";import"./X-Arce-Ge0.js";import"./tooltip-oF2dxKvS.js";import"./User01-cqDu6Kgh.js";import"./card-BuTTBPVv.js";import"./ArrowUpRight-sV3vc65w.js";import"./badge-YHkNrrCW.js";import"./select-CBCIQKJa.js";import"./Check-C6CkZg9-.js";import"./ChevronDown-CnSiev6J.js";import"./ChevronUp-BaPKVFC3.js";import"./constants-D_FQAPnt.js";import"./use-capability-BFUmGJ2c.js";import"./access-gate-CIIsAfZg.js";import"./capability-load-error-CpFzHmR1.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=ye,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=n.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{F("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{F("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
1
+ import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ag as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-Bhm9Bs1H.js";import{P as k}from"./index-DHeYoHcI.js";import{u as W}from"./use-org-auth-client-Cv2k88wA.js";import{u as X}from"./use-debounced-autosave-CcCn7QVF.js";import{A as ee}from"./avatar-Mvk4Pr6q.js";import{I as G}from"./input-DospeWmi.js";import{S as P,a as I,b as _,c as te}from"./settings-section-DmXhlL47.js";import{D as ne}from"./domain-settings-D3lNyhbU.js";import{S as ae}from"./switch-jhzFDXbX.js";import{c as se,f as oe}from"./use-organization-settings-ChRdOQ4P.js";import{u as ie}from"./studio-tools-C158uWMN.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-qefhsonV.js";import{R as pe}from"./require-capability-Ct_Ojh8K.js";import"./sidebar-CVCJDFEY.js";import"./LayoutLeft-Btc5kA34.js";import"./use-mobile-Bp-djo0i.js";import"./X-DyjfKbz8.js";import"./tooltip-0Tj-MlQQ.js";import"./User01-Bh7a4wfo.js";import"./card-CQ82z7ux.js";import"./ArrowUpRight-fu_iMwrL.js";import"./badge-DPo5atq1.js";import"./select-b1vNfzCY.js";import"./Check-CQjJylK6.js";import"./ChevronDown-D0HdYvxS.js";import"./ChevronUp-hFG8HdCY.js";import"./constants-D_FQAPnt.js";import"./use-capability-CxpcJysD.js";import"./access-gate-DU_TeSxf.js";import"./capability-load-error-BJsCCDoC.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=ye,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=n.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{F("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{F("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
@@ -1 +1 @@
1
- import{c as R,j as t,C as U,a as Z,n as B,r as T,am as $,i as L,d as V,t as F,dH as ee,K as P,m as te,B as ne,l as D,v as se,w as oe}from"./index-UC-5Zxqy.js";import{D as re,a as ie,d as le,e as ae}from"./dialog-CzzC6F62.js";import{C as ce}from"./collection-search-CMyvx3uf.js";import{u as ue}from"./use-debounced-value-DS-Y5UGJ.js";import{b as J,u as de}from"./use-connection-Cw3xkHvl.js";import{u as H}from"./use-mcp-client-Dh-Q8DTG.js";import{W as me,S as Y}from"./constants-D_FQAPnt.js";import{a as W}from"./authenticate-and-persist-oauth-CEQqfsIQ.js";import{b as X}from"./Settings02-Deuua6cy.js";import{K as fe}from"./agent-icon-BnuD7OG4.js";import{u as xe}from"./use-mcp-tools-DHliIetD.js";import{e as pe}from"./extract-connection-data-_BJPZSvu.js";import{c as ge}from"./use-navigate-to-agent-CN7_pj2K.js";import{G as q,a as he,f as ye}from"./github-installations-D2vHSx02.js";function G(i){const e=R.c(4),{size:n,className:r}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=f):f=e[0];let l;return e[1]!==r||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:f}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function be(i,e){const n=R.c(12),{org:r}=U();let f;n[0]!==r.id?(f=me.REGISTRY(r.id),n[0]=r.id,n[1]=f):f=n[1];const l=f;let o;n[2]!==r.id||n[3]!==r.slug||n[4]!==l?(o={connectionId:l,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=l,n[5]=o):o=n[5];const N=H(o);let x;n[6]!==i?(x={name:i},n[6]=i,n[7]=x):x=n[7];const y=e?.enabled??!0;let a;return n[8]!==N||n[9]!==x||n[10]!==y?(a={client:N,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:x,enabled:y,staleTime:3e5,select:Ne},n[8]=N,n[9]=x,n[10]=y,n[11]=a):a=n[11],xe(a)}function Ne(i){return i.structuredContent?.item??null}const je="deco/mcp-github";function we(i){const{org:e}=U(),{data:n}=Z.useSession(),r=J(),f=B(),[l,o]=T.useState("idle"),[N,x]=T.useState(null),[y,a]=T.useState(null),{data:j,isLoading:u}=be(je,{enabled:i.enabled}),c=T.useRef(!1);i.enabled&&j&&!u&&!c.current&&n?.user?.id&&l==="idle"&&(c.current=!0,m());async function m(){if(!(!j||!n?.user?.id||!e))try{o("installing"),x(null);const d=pe(j,e.id,n.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await r.create.mutateAsync(d);o("authenticating");const b=await W({connectionId:w,orgId:e.id,orgSlug:e.slug,persistFallback:s=>r.update.mutateAsync({id:w,data:{connection_token:s}}).then(()=>{})});if(b.ran&&!b.ok){try{await r.delete.mutateAsync(w)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}$(f,e.id),a(d),o("ready")}catch(d){x(d instanceof Error?d.message:String(d)),o("error")}}function p(){o("idle"),x(null),a(null),c.current=!1}return i.enabled&&u&&l==="idle"?{status:"installing",error:null,connection:null,retry:p}:{status:l,error:N,connection:y,retry:p}}const Q="GitHub MCP did not return refreshable repo grant metadata";function O(i){if(typeof i!="string")return null;const e=i.trim();return e.length>0?e:null}function Ce(i){try{const e=new URL(i);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function Ie(i){return typeof i=="number"&&Number.isFinite(i)&&Number.isInteger(i)&&i>0?i:void 0}async function K(i){const{orgSlug:e,sourceConnection:n,installationId:r,owner:f,repo:l,githubCallTool:o,selfCallTool:N,orgShared:x}=i,y=await o({name:"MINT_REPO_TOKEN",arguments:{installationId:r,owner:f,repo:l,permissions:q}}),a=y.structuredContent;if(y.isError||!a?.token){const h=y.content?.find(_=>_.type==="text")?.text;throw new Error(h?`Failed to mint a repo-scoped GitHub token: ${h}`:"Failed to mint a repo-scoped GitHub token")}const j=O(a.refreshToken),u=O(a.tokenEndpoint),c=O(a.clientId);if(!j||!u||!c)throw new Error(Q);if(!Ce(u))throw new Error(Q);const m=O(a.repository?.owner),p=O(a.repository?.name),d="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!m||m.toLowerCase()!==f.toLowerCase()))throw new Error(d);if(a.repository?.name!==void 0&&(!p||p.toLowerCase()!==l.toLowerCase()))throw new Error(d);const g=Ie(a.repository?.id),w=a.expiresAt?Date.parse(a.expiresAt):NaN,b=Number.isFinite(w)?Math.max(0,Math.floor((w-Date.now())/1e3)):null,C=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??b,S=await N({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${f}/${l}`,description:`Repo-scoped GitHub access for ${f}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...x?{orgShared:!0}:{},repoScope:{installationId:r,repositoryId:g,owner:f,repo:l,permissions:q,grantProvider:"github-mcp"}}}}}),v=S.structuredContent??S,I=v.item?.id??v.id;if(!I)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${I}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:j,expiresIn:C,scope:a.scope??null,clientId:c,tokenEndpoint:u})})).ok)throw await N({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:I}}function Qe(i){const e=R.c(22),{open:n,onOpenChange:r,title:f,onImportComplete:l,mode:o}=i,N=o===void 0?"agent":o,x=f??(N==="connection"?"Add repo":"Import from GitHub"),[y,a]=T.useState(null);let j;e[0]!==x?(j=t.jsx(re,{className:"sr-only",children:t.jsx(ie,{children:x})}),e[0]=x,e[1]=j):j=e[1];let u;e[2]!==x||e[3]!==y?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>a(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(X,{size:16})}),t.jsx("img",{src:y.avatarUrl,alt:y.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=y,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=c):c=e[5];let m;e[6]!==r?(m=()=>r(!1),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==N||e[9]!==l||e[10]!==n||e[11]!==y||e[12]!==m?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:c,children:t.jsx(Se,{open:n,onComplete:m,selectedInstallation:y,onSelectInstallation:a,onImportComplete:l,mode:N})})}),e[8]=N,e[9]=l,e[10]=n,e[11]=y,e[12]=m,e[13]=p):p=e[13];let d;e[14]!==j||e[15]!==u||e[16]!==p?(d=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,p]}),e[14]=j,e[15]=u,e[16]=p,e[17]=d):d=e[17];let g;return e[18]!==r||e[19]!==n||e[20]!==d?(g=t.jsx(ae,{open:n,onOpenChange:r,children:d}),e[18]=r,e[19]=n,e[20]=d,e[21]=g):g=e[21],g}function Se({open:i,onComplete:e,selectedInstallation:n,onSelectInstallation:r,onImportComplete:f,mode:l="agent"}){const{org:o}=U(),N=B(),x=ge(),[y,a]=T.useState(null),j=de({slug:"mcp-github"}),u=he(j),c=we({enabled:i&&u.length===0}),m=u.length===1?u[0]??null:y,p=H({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),d=H({connectionId:Y,orgId:o.id,orgSlug:o.slug}),g=async(s,C)=>{try{const v=await p.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:C}});if(v.isError)return null;const E=v.content?.find(h=>h.type==="resource")?.resource?.text;if(!E)return null;try{const h=JSON.parse(E);return typeof h=="string"?h:JSON.stringify(h)}catch{return E}}catch{return null}},w=(s,C)=>{Promise.all([g(C,"AGENTS.md"),g(C,"CLAUDE.md")]).then(async([S,v])=>{const I=S??v??null;I&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:I}}}}),$(N,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},b=V({mutationFn:async s=>{if(!m||!n)throw new Error("No GitHub connection or installation");const C=n.installationId;if(l==="connection"){const{childConnectionId:I}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:E=>p.callTool(E),selfCallTool:E=>d.callTool(E),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:I,item:null}}const{childConnectionId:S}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:I=>p.callTool(I),selfCallTool:I=>d.callTool(I)});let v=null;try{const I=await d.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:C,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),E=I.structuredContent??I,h=E.item?.id;if(!E.item||!h)throw new Error("Failed to create the imported agent");return v=h,{virtualMcpId:h,repo:s,connectionId:S,item:E.item}}catch(I){throw v&&await d.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:v}}).catch(()=>{}),await d.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:s,repo:C,connectionId:S,item:v})=>{if(l==="connection"||!s||!v){$(N,o.id),ee(N,o.id),F.success(`Added ${C.name}`),e();return}if(N.setQueryData(P.collectionItem(d,o.id,"","VIRTUAL_MCP",s),{item:v}),$(N,o.id),w(s,C),f){f({virtualMcpId:s,repo:C,connectionId:S});return}F.success(`Imported ${C.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(s)},onError:s=>{F.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(M,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(M,{status:"error",error:c.error,retry:c.retry}):u.length===0&&c.status==="idle"?t.jsx(M,{status:"installing",error:null,retry:c.retry}):u.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>a(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):m?n?t.jsx(Te,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>b.mutate(s),isSaving:b.isPending}):t.jsx(ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:r,showBackButton:u.length>1,onBack:()=>a(null)}):null}function ve(i){const e=R.c(47),{connectionId:n,orgId:r,orgSlug:f,onSelect:l,showBackButton:o,onBack:N}=i;let x;e[0]!==r||e[1]!==f?(x={connectionId:Y,orgId:r,orgSlug:f},e[0]=r,e[1]=f,e[2]=x):x=e[2];const y=H(x),a=B(),j=J();let u;e[3]!==n||e[4]!==r?(u=P.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=u):u=e[5];let c;e[6]!==n||e[7]!==y?(c=()=>ye(h=>y.callTool(h),n),e[6]=n,e[7]=y,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m={queryKey:u,queryFn:c},e[9]=u,e[10]=c,e[11]=m):m=e[11];const p=te(m);let d;e[12]!==j||e[13]!==n||e[14]!==p||e[15]!==r||e[16]!==f||e[17]!==a?(d={mutationFn:async()=>{const h=await W({connectionId:n,orgId:r,orgSlug:f,persistFallback:k=>j.update.mutateAsync({id:n,data:{connection_token:k}}).then(_e)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${f}/mcp/${n}`,window.location.origin);await a.invalidateQueries({queryKey:P.isMCPAuthenticated(_.href,null)}),await a.invalidateQueries({queryKey:P.mcpClientPrefix()}),await p.refetch()},onError:Ee},e[12]=j,e[13]=n,e[14]=p,e[15]=r,e[16]=f,e[17]=a,e[18]=d):d=e[18];const g=V(d);if(p.isLoading){let h;return e[19]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=h):h=e[19],h}if(p.isError){let h,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=h,e[21]=_):(h=e[20],_=e[21]);let k;e[22]!==g?(k=()=>g.mutate(),e[22]=g,e[23]=k):k=e[23];let A;e[24]!==g.isPending?(A=g.isPending?t.jsx(L,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=g.isPending,e[25]=A):A=e[25];let z;return e[26]!==g.isPending||e[27]!==k||e[28]!==A?(z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[h,_,t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:g.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=g.isPending,e[27]=k,e[28]=A,e[29]=z):z=e[29],z}const w=p.data;if(!w)return null;let b;e[30]!==N||e[31]!==o?(b=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(X,{size:12}),"Change connection"]})}),e[30]=N,e[31]=o,e[32]=b):b=e[32];let s;if(e[33]!==w.installations||e[34]!==l){let h;e[36]!==l?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=l,e[37]=h):h=e[37],s=w.installations.map(h),e[33]=w.installations,e[34]=l,e[35]=s}else s=e[35];let C;e[38]!==s?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=C):C=e[39];const S=w.appSlug?`https://github.com/apps/${w.appSlug}/installations/new`:"https://github.com/settings/installations";let v;e[40]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=v):v=e[40];let I;e[41]!==S?(I=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",v]})}),e[41]=S,e[42]=I):I=e[42];let E;return e[43]!==I||e[44]!==b||e[45]!==C?(E=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,I]}),e[43]=I,e[44]=b,e[45]=C,e[46]=E):E=e[46],E}function Ee(i){F.error("Failed to reconnect GitHub: "+(i instanceof Error?i.message:"Unknown error"))}function _e(){}function Te(i){const e=R.c(20),{connectionId:n,orgId:r,orgSlug:f,installation:l,onSelectRepo:o,isSaving:N}=i,[x,y]=T.useState(""),a=ue(x,300),j=T.useDeferredValue(a),u=x!==j;let c;e[0]!==u||e[1]!==x?(c=t.jsx(ce,{placeholder:"Search repositories...",value:x,onChange:y,isSearching:u}),e[0]=u,e[1]=x,e[2]=c):c=e[2];const m=u?"opacity-40":"opacity-100";let p;e[3]!==m?(p=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",m),e[3]=m,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=d):d=e[5];let g;e[6]!==n||e[7]!==j||e[8]!==l||e[9]!==N||e[10]!==o||e[11]!==r||e[12]!==f?(g=t.jsx(T.Suspense,{fallback:d,children:t.jsx(ke,{connectionId:n,orgId:r,orgSlug:f,installation:l,query:j,onSelectRepo:o,isSaving:N})}),e[6]=n,e[7]=j,e[8]=l,e[9]=N,e[10]=o,e[11]=r,e[12]=f,e[13]=g):g=e[13];let w;e[14]!==p||e[15]!==g?(w=t.jsx("div",{className:p,children:g}),e[14]=p,e[15]=g,e[16]=w):w=e[16];let b;return e[17]!==c||e[18]!==w?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c,w]}),e[17]=c,e[18]=w,e[19]=b):b=e[19],b}function ke(i){const e=R.c(29),{connectionId:n,orgId:r,orgSlug:f,installation:l,query:o,onSelectRepo:N,isSaving:x}=i;let y;e[0]!==n||e[1]!==r||e[2]!==f?(y={connectionId:n,orgId:r,orgSlug:f},e[0]=n,e[1]=r,e[2]=f,e[3]=y):y=e[3];const a=H(y),j=l.type==="User"?"user":"org",u=o?`${j}:${l.login} ${o} in:name`:`${j}:${l.login}`;let c;e[4]!==n||e[5]!==l.login||e[6]!==r||e[7]!==o?(c=P.githubOrgRepos(r,n,l.login,o),e[4]=n,e[5]=l.login,e[6]=r,e[7]=o,e[8]=c):c=e[8];let m;e[9]!==a||e[10]!==u?(m=async b=>{const{signal:s}=b,S=(await a.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Re)},e[9]=a,e[10]=u,e[11]=m):m=e[11];let p;e[12]!==c||e[13]!==m?(p={queryKey:c,queryFn:m},e[12]=c,e[13]=m,e[14]=p):p=e[14];const{data:d}=se(p);if(d.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let C;return e[18]!==s?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,s]}),e[18]=s,e[19]=C):C=e[19],C}let g;if(e[20]!==x||e[21]!==N||e[22]!==d){let b;e[24]!==x||e[25]!==N?(b=s=>t.jsxs("button",{type:"button",onClick:()=>N(s),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(G,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(oe,{size:10}):t.jsx(fe,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=x,e[25]=N,e[26]=b):b=e[26],g=d.map(b),e[20]=x,e[21]=N,e[22]=d,e[23]=g}else g=e[23];let w;return e[27]!==g?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=w):w=e[28],w}function Re(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function M(i){const e=R.c(33),{status:n,error:r,retry:f}=i;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const I=r??"Something went wrong while connecting to GitHub.";let E;e[2]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I})]}),e[2]=I,e[3]=E):E=e[3];let h;e[4]!==f?(h=t.jsx("button",{type:"button",onClick:f,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=f,e[5]=h):h=e[5];let _;return e[6]!==E||e[7]!==h?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,E,h]}),e[6]=E,e[7]=h,e[8]=_):_=e[8],_}const l=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(L,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=N):N=e[10];const x=l?"Authenticating with GitHub":"Setting up GitHub";let y;e[11]!==x?(y=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=y):y=e[12];const a=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==a?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let u;e[15]!==y||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,j]}),e[15]=y,e[16]=j,e[17]=u):u=e[17];const c=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[18]!==c?(m=D("size-1.5 rounded-full",c),e[18]=c,e[19]=m):m=e[19];let p;e[20]!==m?(p=t.jsx("span",{className:m}),e[20]=m,e[21]=p):p=e[21];const d=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==d?(g=D("size-1.5 rounded-full",d),e[22]=d,e[23]=g):g=e[23];let w;e[24]!==g?(w=t.jsx("span",{className:g}),e[24]=g,e[25]=w):w=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let s;e[27]!==p||e[28]!==w?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[p,w,b]}),e[27]=p,e[28]=w,e[29]=s):s=e[29];let C;return e[30]!==s||e[31]!==u?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,u,s]}),e[30]=s,e[31]=u,e[32]=C):C=e[32],C}export{Qe as G,G as a,we as b,K as p,be as u};
1
+ import{c as R,j as t,C as U,a as Z,n as B,r as T,am as $,i as L,d as V,t as F,dH as ee,K as P,m as te,B as ne,l as D,v as se,w as oe}from"./index-Bhm9Bs1H.js";import{D as re,a as ie,d as le,e as ae}from"./dialog-df3kXkJ6.js";import{C as ce}from"./collection-search-zDpqz1Y6.js";import{u as ue}from"./use-debounced-value-C58Qyt5I.js";import{b as J,u as de}from"./use-connection-DZnUxHel.js";import{u as H}from"./use-mcp-client-Cm__SCrY.js";import{W as me,S as Y}from"./constants-D_FQAPnt.js";import{a as W}from"./authenticate-and-persist-oauth-C5bv8dSc.js";import{b as X}from"./Settings02-CiDkLfc2.js";import{K as fe}from"./agent-icon-Cn3pvSY1.js";import{u as xe}from"./use-mcp-tools-BBTNMsyU.js";import{e as pe}from"./extract-connection-data-Ds-QcBxj.js";import{c as ge}from"./use-navigate-to-agent-C6M7Wtez.js";import{G as q,a as he,f as ye}from"./github-installations-D2vHSx02.js";function G(i){const e=R.c(4),{size:n,className:r}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=f):f=e[0];let l;return e[1]!==r||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:f}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function be(i,e){const n=R.c(12),{org:r}=U();let f;n[0]!==r.id?(f=me.REGISTRY(r.id),n[0]=r.id,n[1]=f):f=n[1];const l=f;let o;n[2]!==r.id||n[3]!==r.slug||n[4]!==l?(o={connectionId:l,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=l,n[5]=o):o=n[5];const N=H(o);let x;n[6]!==i?(x={name:i},n[6]=i,n[7]=x):x=n[7];const y=e?.enabled??!0;let a;return n[8]!==N||n[9]!==x||n[10]!==y?(a={client:N,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:x,enabled:y,staleTime:3e5,select:Ne},n[8]=N,n[9]=x,n[10]=y,n[11]=a):a=n[11],xe(a)}function Ne(i){return i.structuredContent?.item??null}const je="deco/mcp-github";function we(i){const{org:e}=U(),{data:n}=Z.useSession(),r=J(),f=B(),[l,o]=T.useState("idle"),[N,x]=T.useState(null),[y,a]=T.useState(null),{data:j,isLoading:u}=be(je,{enabled:i.enabled}),c=T.useRef(!1);i.enabled&&j&&!u&&!c.current&&n?.user?.id&&l==="idle"&&(c.current=!0,m());async function m(){if(!(!j||!n?.user?.id||!e))try{o("installing"),x(null);const d=pe(j,e.id,n.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await r.create.mutateAsync(d);o("authenticating");const b=await W({connectionId:w,orgId:e.id,orgSlug:e.slug,persistFallback:s=>r.update.mutateAsync({id:w,data:{connection_token:s}}).then(()=>{})});if(b.ran&&!b.ok){try{await r.delete.mutateAsync(w)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}$(f,e.id),a(d),o("ready")}catch(d){x(d instanceof Error?d.message:String(d)),o("error")}}function p(){o("idle"),x(null),a(null),c.current=!1}return i.enabled&&u&&l==="idle"?{status:"installing",error:null,connection:null,retry:p}:{status:l,error:N,connection:y,retry:p}}const Q="GitHub MCP did not return refreshable repo grant metadata";function O(i){if(typeof i!="string")return null;const e=i.trim();return e.length>0?e:null}function Ce(i){try{const e=new URL(i);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function Ie(i){return typeof i=="number"&&Number.isFinite(i)&&Number.isInteger(i)&&i>0?i:void 0}async function K(i){const{orgSlug:e,sourceConnection:n,installationId:r,owner:f,repo:l,githubCallTool:o,selfCallTool:N,orgShared:x}=i,y=await o({name:"MINT_REPO_TOKEN",arguments:{installationId:r,owner:f,repo:l,permissions:q}}),a=y.structuredContent;if(y.isError||!a?.token){const h=y.content?.find(_=>_.type==="text")?.text;throw new Error(h?`Failed to mint a repo-scoped GitHub token: ${h}`:"Failed to mint a repo-scoped GitHub token")}const j=O(a.refreshToken),u=O(a.tokenEndpoint),c=O(a.clientId);if(!j||!u||!c)throw new Error(Q);if(!Ce(u))throw new Error(Q);const m=O(a.repository?.owner),p=O(a.repository?.name),d="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!m||m.toLowerCase()!==f.toLowerCase()))throw new Error(d);if(a.repository?.name!==void 0&&(!p||p.toLowerCase()!==l.toLowerCase()))throw new Error(d);const g=Ie(a.repository?.id),w=a.expiresAt?Date.parse(a.expiresAt):NaN,b=Number.isFinite(w)?Math.max(0,Math.floor((w-Date.now())/1e3)):null,C=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??b,S=await N({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${f}/${l}`,description:`Repo-scoped GitHub access for ${f}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...x?{orgShared:!0}:{},repoScope:{installationId:r,repositoryId:g,owner:f,repo:l,permissions:q,grantProvider:"github-mcp"}}}}}),v=S.structuredContent??S,I=v.item?.id??v.id;if(!I)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${I}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:j,expiresIn:C,scope:a.scope??null,clientId:c,tokenEndpoint:u})})).ok)throw await N({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:I}}function Qe(i){const e=R.c(22),{open:n,onOpenChange:r,title:f,onImportComplete:l,mode:o}=i,N=o===void 0?"agent":o,x=f??(N==="connection"?"Add repo":"Import from GitHub"),[y,a]=T.useState(null);let j;e[0]!==x?(j=t.jsx(re,{className:"sr-only",children:t.jsx(ie,{children:x})}),e[0]=x,e[1]=j):j=e[1];let u;e[2]!==x||e[3]!==y?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>a(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(X,{size:16})}),t.jsx("img",{src:y.avatarUrl,alt:y.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=y,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=c):c=e[5];let m;e[6]!==r?(m=()=>r(!1),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==N||e[9]!==l||e[10]!==n||e[11]!==y||e[12]!==m?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:c,children:t.jsx(Se,{open:n,onComplete:m,selectedInstallation:y,onSelectInstallation:a,onImportComplete:l,mode:N})})}),e[8]=N,e[9]=l,e[10]=n,e[11]=y,e[12]=m,e[13]=p):p=e[13];let d;e[14]!==j||e[15]!==u||e[16]!==p?(d=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,p]}),e[14]=j,e[15]=u,e[16]=p,e[17]=d):d=e[17];let g;return e[18]!==r||e[19]!==n||e[20]!==d?(g=t.jsx(ae,{open:n,onOpenChange:r,children:d}),e[18]=r,e[19]=n,e[20]=d,e[21]=g):g=e[21],g}function Se({open:i,onComplete:e,selectedInstallation:n,onSelectInstallation:r,onImportComplete:f,mode:l="agent"}){const{org:o}=U(),N=B(),x=ge(),[y,a]=T.useState(null),j=de({slug:"mcp-github"}),u=he(j),c=we({enabled:i&&u.length===0}),m=u.length===1?u[0]??null:y,p=H({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),d=H({connectionId:Y,orgId:o.id,orgSlug:o.slug}),g=async(s,C)=>{try{const v=await p.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:C}});if(v.isError)return null;const E=v.content?.find(h=>h.type==="resource")?.resource?.text;if(!E)return null;try{const h=JSON.parse(E);return typeof h=="string"?h:JSON.stringify(h)}catch{return E}}catch{return null}},w=(s,C)=>{Promise.all([g(C,"AGENTS.md"),g(C,"CLAUDE.md")]).then(async([S,v])=>{const I=S??v??null;I&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:I}}}}),$(N,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},b=V({mutationFn:async s=>{if(!m||!n)throw new Error("No GitHub connection or installation");const C=n.installationId;if(l==="connection"){const{childConnectionId:I}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:E=>p.callTool(E),selfCallTool:E=>d.callTool(E),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:I,item:null}}const{childConnectionId:S}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:I=>p.callTool(I),selfCallTool:I=>d.callTool(I)});let v=null;try{const I=await d.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:C,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),E=I.structuredContent??I,h=E.item?.id;if(!E.item||!h)throw new Error("Failed to create the imported agent");return v=h,{virtualMcpId:h,repo:s,connectionId:S,item:E.item}}catch(I){throw v&&await d.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:v}}).catch(()=>{}),await d.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:s,repo:C,connectionId:S,item:v})=>{if(l==="connection"||!s||!v){$(N,o.id),ee(N,o.id),F.success(`Added ${C.name}`),e();return}if(N.setQueryData(P.collectionItem(d,o.id,"","VIRTUAL_MCP",s),{item:v}),$(N,o.id),w(s,C),f){f({virtualMcpId:s,repo:C,connectionId:S});return}F.success(`Imported ${C.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(s)},onError:s=>{F.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(M,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(M,{status:"error",error:c.error,retry:c.retry}):u.length===0&&c.status==="idle"?t.jsx(M,{status:"installing",error:null,retry:c.retry}):u.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>a(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):m?n?t.jsx(Te,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>b.mutate(s),isSaving:b.isPending}):t.jsx(ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:r,showBackButton:u.length>1,onBack:()=>a(null)}):null}function ve(i){const e=R.c(47),{connectionId:n,orgId:r,orgSlug:f,onSelect:l,showBackButton:o,onBack:N}=i;let x;e[0]!==r||e[1]!==f?(x={connectionId:Y,orgId:r,orgSlug:f},e[0]=r,e[1]=f,e[2]=x):x=e[2];const y=H(x),a=B(),j=J();let u;e[3]!==n||e[4]!==r?(u=P.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=u):u=e[5];let c;e[6]!==n||e[7]!==y?(c=()=>ye(h=>y.callTool(h),n),e[6]=n,e[7]=y,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m={queryKey:u,queryFn:c},e[9]=u,e[10]=c,e[11]=m):m=e[11];const p=te(m);let d;e[12]!==j||e[13]!==n||e[14]!==p||e[15]!==r||e[16]!==f||e[17]!==a?(d={mutationFn:async()=>{const h=await W({connectionId:n,orgId:r,orgSlug:f,persistFallback:k=>j.update.mutateAsync({id:n,data:{connection_token:k}}).then(_e)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${f}/mcp/${n}`,window.location.origin);await a.invalidateQueries({queryKey:P.isMCPAuthenticated(_.href,null)}),await a.invalidateQueries({queryKey:P.mcpClientPrefix()}),await p.refetch()},onError:Ee},e[12]=j,e[13]=n,e[14]=p,e[15]=r,e[16]=f,e[17]=a,e[18]=d):d=e[18];const g=V(d);if(p.isLoading){let h;return e[19]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=h):h=e[19],h}if(p.isError){let h,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=h,e[21]=_):(h=e[20],_=e[21]);let k;e[22]!==g?(k=()=>g.mutate(),e[22]=g,e[23]=k):k=e[23];let A;e[24]!==g.isPending?(A=g.isPending?t.jsx(L,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=g.isPending,e[25]=A):A=e[25];let z;return e[26]!==g.isPending||e[27]!==k||e[28]!==A?(z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[h,_,t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:g.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=g.isPending,e[27]=k,e[28]=A,e[29]=z):z=e[29],z}const w=p.data;if(!w)return null;let b;e[30]!==N||e[31]!==o?(b=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(X,{size:12}),"Change connection"]})}),e[30]=N,e[31]=o,e[32]=b):b=e[32];let s;if(e[33]!==w.installations||e[34]!==l){let h;e[36]!==l?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=l,e[37]=h):h=e[37],s=w.installations.map(h),e[33]=w.installations,e[34]=l,e[35]=s}else s=e[35];let C;e[38]!==s?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=C):C=e[39];const S=w.appSlug?`https://github.com/apps/${w.appSlug}/installations/new`:"https://github.com/settings/installations";let v;e[40]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=v):v=e[40];let I;e[41]!==S?(I=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",v]})}),e[41]=S,e[42]=I):I=e[42];let E;return e[43]!==I||e[44]!==b||e[45]!==C?(E=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,I]}),e[43]=I,e[44]=b,e[45]=C,e[46]=E):E=e[46],E}function Ee(i){F.error("Failed to reconnect GitHub: "+(i instanceof Error?i.message:"Unknown error"))}function _e(){}function Te(i){const e=R.c(20),{connectionId:n,orgId:r,orgSlug:f,installation:l,onSelectRepo:o,isSaving:N}=i,[x,y]=T.useState(""),a=ue(x,300),j=T.useDeferredValue(a),u=x!==j;let c;e[0]!==u||e[1]!==x?(c=t.jsx(ce,{placeholder:"Search repositories...",value:x,onChange:y,isSearching:u}),e[0]=u,e[1]=x,e[2]=c):c=e[2];const m=u?"opacity-40":"opacity-100";let p;e[3]!==m?(p=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",m),e[3]=m,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=d):d=e[5];let g;e[6]!==n||e[7]!==j||e[8]!==l||e[9]!==N||e[10]!==o||e[11]!==r||e[12]!==f?(g=t.jsx(T.Suspense,{fallback:d,children:t.jsx(ke,{connectionId:n,orgId:r,orgSlug:f,installation:l,query:j,onSelectRepo:o,isSaving:N})}),e[6]=n,e[7]=j,e[8]=l,e[9]=N,e[10]=o,e[11]=r,e[12]=f,e[13]=g):g=e[13];let w;e[14]!==p||e[15]!==g?(w=t.jsx("div",{className:p,children:g}),e[14]=p,e[15]=g,e[16]=w):w=e[16];let b;return e[17]!==c||e[18]!==w?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c,w]}),e[17]=c,e[18]=w,e[19]=b):b=e[19],b}function ke(i){const e=R.c(29),{connectionId:n,orgId:r,orgSlug:f,installation:l,query:o,onSelectRepo:N,isSaving:x}=i;let y;e[0]!==n||e[1]!==r||e[2]!==f?(y={connectionId:n,orgId:r,orgSlug:f},e[0]=n,e[1]=r,e[2]=f,e[3]=y):y=e[3];const a=H(y),j=l.type==="User"?"user":"org",u=o?`${j}:${l.login} ${o} in:name`:`${j}:${l.login}`;let c;e[4]!==n||e[5]!==l.login||e[6]!==r||e[7]!==o?(c=P.githubOrgRepos(r,n,l.login,o),e[4]=n,e[5]=l.login,e[6]=r,e[7]=o,e[8]=c):c=e[8];let m;e[9]!==a||e[10]!==u?(m=async b=>{const{signal:s}=b,S=(await a.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Re)},e[9]=a,e[10]=u,e[11]=m):m=e[11];let p;e[12]!==c||e[13]!==m?(p={queryKey:c,queryFn:m},e[12]=c,e[13]=m,e[14]=p):p=e[14];const{data:d}=se(p);if(d.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let C;return e[18]!==s?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,s]}),e[18]=s,e[19]=C):C=e[19],C}let g;if(e[20]!==x||e[21]!==N||e[22]!==d){let b;e[24]!==x||e[25]!==N?(b=s=>t.jsxs("button",{type:"button",onClick:()=>N(s),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(G,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(oe,{size:10}):t.jsx(fe,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=x,e[25]=N,e[26]=b):b=e[26],g=d.map(b),e[20]=x,e[21]=N,e[22]=d,e[23]=g}else g=e[23];let w;return e[27]!==g?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=w):w=e[28],w}function Re(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function M(i){const e=R.c(33),{status:n,error:r,retry:f}=i;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const I=r??"Something went wrong while connecting to GitHub.";let E;e[2]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I})]}),e[2]=I,e[3]=E):E=e[3];let h;e[4]!==f?(h=t.jsx("button",{type:"button",onClick:f,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=f,e[5]=h):h=e[5];let _;return e[6]!==E||e[7]!==h?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,E,h]}),e[6]=E,e[7]=h,e[8]=_):_=e[8],_}const l=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(L,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=N):N=e[10];const x=l?"Authenticating with GitHub":"Setting up GitHub";let y;e[11]!==x?(y=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=y):y=e[12];const a=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==a?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let u;e[15]!==y||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,j]}),e[15]=y,e[16]=j,e[17]=u):u=e[17];const c=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[18]!==c?(m=D("size-1.5 rounded-full",c),e[18]=c,e[19]=m):m=e[19];let p;e[20]!==m?(p=t.jsx("span",{className:m}),e[20]=m,e[21]=p):p=e[21];const d=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==d?(g=D("size-1.5 rounded-full",d),e[22]=d,e[23]=g):g=e[23];let w;e[24]!==g?(w=t.jsx("span",{className:g}),e[24]=g,e[25]=w):w=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let s;e[27]!==p||e[28]!==w?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[p,w,b]}),e[27]=p,e[28]=w,e[29]=s):s=e[29];let C;return e[30]!==s||e[31]!==u?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,u,s]}),e[30]=s,e[31]=u,e[32]=C):C=e[32],C}export{Qe as G,G as a,we as b,K as p,be as u};