decocms 2.181.1 → 2.181.2

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 (181) hide show
  1. package/dist/client/assets/{AlertCircle-CwQ-M1BH.js → AlertCircle-Hpsw9_tf.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-7hoUFjWA.js → ArrowLeft-U7OUoBhv.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-C8UJr_8S.js → ArrowUp-BrSLqvQo.js} +1 -1
  4. package/dist/client/assets/{Check-wCq9US95.js → Check-CVKUMJv3.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-C4UuUfvP.js → ChevronDown-Ds3IOx8p.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-8vS2LfiE.js → ChevronRight-CTHCKnjF.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-eUIC7wig.js → ChevronUp-DJbt-mXd.js} +1 -1
  8. package/dist/client/assets/{Container-OKF_GeCq.js → Container-D4n2e11R.js} +1 -1
  9. package/dist/client/assets/{Dataflow03-CYOanaoD.js → Dataflow03-q5kzWw4s.js} +1 -1
  10. package/dist/client/assets/{Download01-D6Ut3-TC.js → Download01-BBRbjA11.js} +1 -1
  11. package/dist/client/assets/{FolderClosed-DWPM1ogz.js → FolderClosed-CgbAGtho.js} +1 -1
  12. package/dist/client/assets/{Grid01-CFCqtKvs.js → Grid01-CbgVFQNg.js} +1 -1
  13. package/dist/client/assets/{List-Dm7hE_p7.js → List-D35z7ORx.js} +1 -1
  14. package/dist/client/assets/{Loading01-CKkwknOS.js → Loading01-DDv5lfhX.js} +1 -1
  15. package/dist/client/assets/{Play-B44HkfJ8.js → Play-Q9uDVIa5.js} +1 -1
  16. package/dist/client/assets/{Plus-B_tfkXz3.js → Plus-DcUxQQXw.js} +1 -1
  17. package/dist/client/assets/{RefreshCcw01-Dd-MCL9x.js → RefreshCcw01-nS96T2bf.js} +1 -1
  18. package/dist/client/assets/{SearchMd-DwH-zFLD.js → SearchMd-CTpXH6F3.js} +1 -1
  19. package/dist/client/assets/{Settings01-Cc_jPdtk.js → Settings01-BVY96Vsg.js} +1 -1
  20. package/dist/client/assets/{Trash01-DFCUs2vM.js → Trash01-CzfVJZjl.js} +1 -1
  21. package/dist/client/assets/{Type01-DmSAzri2.js → Type01-BwsSTKh1.js} +1 -1
  22. package/dist/client/assets/{Upload01-B4UOm_Kf.js → Upload01-Bn_9d04P.js} +1 -1
  23. package/dist/client/assets/{User01-a2C2h2ws.js → User01-Dl4j8Eui.js} +1 -1
  24. package/dist/client/assets/{VideoRecorder-b8m_Ituf.js → VideoRecorder-0-qQusnp.js} +1 -1
  25. package/dist/client/assets/{X-CVr_hKcl.js → X-DvXlEl9E.js} +1 -1
  26. package/dist/client/assets/{XCircle-Dv-O5jd1.js → XCircle-DI9HiD4A.js} +1 -1
  27. package/dist/client/assets/{XClose-DXhO2ZT2.js → XClose-Bw5018RM.js} +1 -1
  28. package/dist/client/assets/{Zap-D6ZQZPYh.js → Zap-DGbTVlYq.js} +1 -1
  29. package/dist/client/assets/{agent-connections-preview-hZGsihWU.js → agent-connections-preview-Cfflc0J5.js} +1 -1
  30. package/dist/client/assets/{agent-detail-D_DBZ4Bl.js → agent-detail-CehIC3W1.js} +1 -1
  31. package/dist/client/assets/{agents-CpLdJw8X.js → agents-DmtfY0M7.js} +1 -1
  32. package/dist/client/assets/{ai-providers-logos-HDlTKyFP.js → ai-providers-logos-BtOy-_hY.js} +1 -1
  33. package/dist/client/assets/{alert-dialog-Dqc_24Os.js → alert-dialog-CIdU20ao.js} +1 -1
  34. package/dist/client/assets/{auth-catchall-DZ2DNfI0.js → auth-catchall-DklKmwQO.js} +1 -1
  35. package/dist/client/assets/{automation-detail-5-Ty44fE.js → automation-detail-CIe1WG8E.js} +1 -1
  36. package/dist/client/assets/{automations-COLW1OP9.js → automations-KsqaYtsv.js} +1 -1
  37. package/dist/client/assets/{avatar-BCNSpjov.js → avatar-Dz9Au16I.js} +1 -1
  38. package/dist/client/assets/{badge-C9kSd2rC.js → badge-BIY4HSu4.js} +1 -1
  39. package/dist/client/assets/{binder-1tH_sZqU.js → binder-DaeU7_Yt.js} +1 -1
  40. package/dist/client/assets/{breadcrumb-BjaszutD.js → breadcrumb-DNInqlES.js} +1 -1
  41. package/dist/client/assets/{card-C_4nJrQs.js → card-CoTaf7Bb.js} +1 -1
  42. package/dist/client/assets/{checkbox-CKx9MIya.js → checkbox-UWf_Spym.js} +1 -1
  43. package/dist/client/assets/{collapsible-DKOKNSjC.js → collapsible-DGsDf05s.js} +1 -1
  44. package/dist/client/assets/{collection-detail-CpVZhrBd.js → collection-detail-jT6_1Zus.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-07J7hFqi.js → collection-display-button-CIwF6qiP.js} +1 -1
  46. package/dist/client/assets/{collection-search-C014T-nI.js → collection-search-DmeA1lkM.js} +1 -1
  47. package/dist/client/assets/{collection-table-wrapper-1AJGYm4t.js → collection-table-wrapper-DZ9kkHHz.js} +1 -1
  48. package/dist/client/assets/{collection-tabs-BZp_rh35.js → collection-tabs-VEtVQj8e.js} +1 -1
  49. package/dist/client/assets/{command-DOoFRPUJ.js → command-DS9L8dE9.js} +1 -1
  50. package/dist/client/assets/{connection-card-Dvo5xeIo.js → connection-card-DY8BmloD.js} +1 -1
  51. package/dist/client/assets/{connection-detail-B512SIke.js → connection-detail-D6zDmZps.js} +1 -1
  52. package/dist/client/assets/{connections-BOj_J2If.js → connections-BvDULZyp.js} +1 -1
  53. package/dist/client/assets/{constants-C2NIYyeK.js → constants-C5g6K3-0.js} +1 -1
  54. package/dist/client/assets/{context-Cfhj-jDE.js → context-0-m5aPvK.js} +1 -1
  55. package/dist/client/assets/{create-organization-dialog-CoH8Z4xz.js → create-organization-dialog-Bw7JkHCW.js} +1 -1
  56. package/dist/client/assets/{create-project-dialog-Bo88aywl.js → create-project-dialog-CofGaj8t.js} +1 -1
  57. package/dist/client/assets/{danger-Cm2vTS1T.js → danger-BxwsLFA0.js} +1 -1
  58. package/dist/client/assets/{danger-zone-DT2ENIL0.js → danger-zone-DNgGGkaE.js} +1 -1
  59. package/dist/client/assets/{dependencies-DwJHkCHB.js → dependencies-CscQrQx3.js} +1 -1
  60. package/dist/client/assets/{dialog-D2mcZnzN.js → dialog-Beaz2erB.js} +1 -1
  61. package/dist/client/assets/{drawer-vD6YQ-sA.js → drawer-DuM10S-O.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-5AX5yqCQ.js → dropdown-menu-IA1w2fjK.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-CVwFp6hh.js → dynamic-plugin-layout-CtDEEZnp.js} +1 -1
  64. package/dist/client/assets/{editable-task-title-DSaRvdkK.js → editable-task-title-DuDIwQf_.js} +1 -1
  65. package/dist/client/assets/{empty-state-BnwPT1fd.js → empty-state-DnJSxmJA.js} +1 -1
  66. package/dist/client/assets/{empty-state-C_h_kfhM.js → empty-state-hwIP0sm6.js} +1 -1
  67. package/dist/client/assets/{env-vars-editor-Cdhuqusz.js → env-vars-editor-Ceyzo9UT.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-BJKmDa-6.js → extract-connection-data-D13QyL30.js} +1 -1
  69. package/dist/client/assets/{file-browser-C-yRGqGr.js → file-browser-B-JXooL8.js} +2 -2
  70. package/dist/client/assets/{form-3OFR-VJQ.js → form-CccEC3cm.js} +1 -1
  71. package/dist/client/assets/{general-Bc8nPdrN.js → general-axIGxWAv.js} +1 -1
  72. package/dist/client/assets/{generate-id-Dz9QYszT.js → generate-id-0beDKMoR.js} +1 -1
  73. package/dist/client/assets/{grid-view-B8S8xAuj.js → grid-view-VGzy6bo9.js} +1 -1
  74. package/dist/client/assets/{home-CgBkZx75.js → home-ED4EKgWV.js} +1 -1
  75. package/dist/client/assets/{index-1_kpvnU4.js → index-Be3yjubl.js} +1 -1
  76. package/dist/client/assets/{index-Ums8T5hF.js → index-BfJLXP0j.js} +1 -1
  77. package/dist/client/assets/{index-t6xY8FYJ.js → index-BjxqoU_w.js} +3 -3
  78. package/dist/client/assets/{index-B0rHyq8i.js → index-C2aMuEoP.js} +1 -1
  79. package/dist/client/assets/{index-CU9cIMQQ.js → index-CDessA1I.js} +1 -1
  80. package/dist/client/assets/{index-BN5_gDph.js → index-DQTOgFOw.js} +1 -1
  81. package/dist/client/assets/{index-aw4p2K_Q.js → index-DqQdLYr7.js} +1 -1
  82. package/dist/client/assets/{index-CqfM11ms.js → index-DsV3YD3P.js} +1 -1
  83. package/dist/client/assets/{index-D9tlV5w6.js → index-DxFKywdp.js} +1 -1
  84. package/dist/client/assets/{index-CpTXJjPF.js → index-JasJqXzm.js} +1 -1
  85. package/dist/client/assets/{index-BKuN2Iot.js → index-VZp2CIbR.js} +1 -1
  86. package/dist/client/assets/{infiniteQueryObserver-cSGG5mU_.js → infiniteQueryObserver-C0OPB4rx.js} +1 -1
  87. package/dist/client/assets/{input-qMconvxq.js → input-Be0bLLQW.js} +1 -1
  88. package/dist/client/assets/{integration-icon-BlldxArX.js → integration-icon-C9ac9VOj.js} +1 -1
  89. package/dist/client/assets/{label-DQB9xwZM.js → label-C6smVCIk.js} +1 -1
  90. package/dist/client/assets/{layout-D0kNFrGz.js → layout-CYi_63K3.js} +1 -1
  91. package/dist/client/assets/{layout-CXznpTUY.js → layout-D0N63fj1.js} +1 -1
  92. package/dist/client/assets/{login-ByYrGnuD.js → login-B4SjGwXr.js} +1 -1
  93. package/dist/client/assets/{logo-upload-DXmtyQTR.js → logo-upload-DwLQLlu7.js} +1 -1
  94. package/dist/client/assets/{mcp-app-renderer-BgFTGV3R.js → mcp-app-renderer-BWF6RI84.js} +1 -1
  95. package/dist/client/assets/{mcp-server-card-CbbQ9zmv.js → mcp-server-card-ksfI1Eyh.js} +1 -1
  96. package/dist/client/assets/{mcp-server-detail-C4NpEsJs.js → mcp-server-detail-Cb-T_-Mb.js} +2 -2
  97. package/dist/client/assets/{members-DwVIkRhC.js → members-DJ6DA7d5.js} +1 -1
  98. package/dist/client/assets/{monaco-editor-DlS1kIEY.js → monaco-editor-D0GS_D3E.js} +1 -1
  99. package/dist/client/assets/{monitoring-dashboard-edit-B-Anvw32.js → monitoring-dashboard-edit-Bxyyp3mT.js} +1 -1
  100. package/dist/client/assets/{monitoring-dashboard-view-B4EKAI4H.js → monitoring-dashboard-view-D1jhpkzD.js} +1 -1
  101. package/dist/client/assets/{monitoring-BP_I8oHA.js → monitoring-osT0IqjS.js} +1 -1
  102. package/dist/client/assets/{monitoring-stats-row-_pMtDdXo.js → monitoring-stats-row-BzJ0yham.js} +1 -1
  103. package/dist/client/assets/{oauth-callback-oqOHT12Q.js → oauth-callback-B9dLIXA2.js} +1 -1
  104. package/dist/client/assets/{oauth-callback-ai-provider-BQrF4HBs.js → oauth-callback-ai-provider-mFsE32vf.js} +1 -1
  105. package/dist/client/assets/{org-ai-providers-DJ2pJYJP.js → org-ai-providers-UG6FIdxB.js} +1 -1
  106. package/dist/client/assets/{page-BwYkJelt.js → page-C4W1F739.js} +1 -1
  107. package/dist/client/assets/{page-C2dXKJSu.js → page-Drtt1B9w.js} +1 -1
  108. package/dist/client/assets/{plugin-empty-state-CWHcbfRs.js → plugin-empty-state-C-XfLac2.js} +1 -1
  109. package/dist/client/assets/{plugin-empty-state-ZcHYGE5m.js → plugin-empty-state-C7t75jMS.js} +1 -1
  110. package/dist/client/assets/{plugin-header-CYJy88Hz.js → plugin-header-5ST0P5Q7.js} +1 -1
  111. package/dist/client/assets/{plugin-header-BdlNegyr.js → plugin-header-BJKUaApF.js} +1 -1
  112. package/dist/client/assets/plugins-EgDqBTdv.js +1 -0
  113. package/dist/client/assets/{popover-CRTw2B4t.js → popover-Dn0X9Fr1.js} +1 -1
  114. package/dist/client/assets/{project-app-view-Dd-mlwjV.js → project-app-view-CcUsagsx.js} +1 -1
  115. package/dist/client/assets/{project-layout-B74T6y-f.js → project-layout-D9UABDEG.js} +1 -1
  116. package/dist/client/assets/{project-plugins-wKxoF0hg.js → project-plugins-B2zBuBKC.js} +1 -1
  117. package/dist/client/assets/{projects-list-wmEMeN4i.js → projects-list-BWN1T4nW.js} +1 -1
  118. package/dist/client/assets/{registry-layout-BTO44Pm9.js → registry-layout-tQMWJSmp.js} +1 -1
  119. package/dist/client/assets/{registry-utils-q14xY1bA.js → registry-utils-CVkiAvdy.js} +1 -1
  120. package/dist/client/assets/{reset-password-BzKcrrar.js → reset-password-DJ4VaB6B.js} +1 -1
  121. package/dist/client/assets/{resizable-Cd0SSbbe.js → resizable-BD6CMEjd.js} +1 -1
  122. package/dist/client/assets/{save-actions--GeWosdW.js → save-actions-BFbH4lFH.js} +1 -1
  123. package/dist/client/assets/{scroll-area-XEIbL86H.js → scroll-area-VqeDMOPN.js} +1 -1
  124. package/dist/client/assets/{select-D64t3Q_g.js → select-VEJvYQo7.js} +1 -1
  125. package/dist/client/assets/{select-virtual-mcp-7C78QF32.js → select-virtual-mcp-BVFbfMoH.js} +1 -1
  126. package/dist/client/assets/{shell-layout-ClRvSlWW.js → shell-layout-lPP98AcT.js} +2 -2
  127. package/dist/client/assets/{sidebar-settings-DgIvJCIQ.js → sidebar-settings-Cvi9DQQC.js} +1 -1
  128. package/dist/client/assets/{skeleton-BPyW696G.js → skeleton-HKYMRn58.js} +1 -1
  129. package/dist/client/assets/{spinner-CV28jHZI.js → spinner-BFdTwge6.js} +1 -1
  130. package/dist/client/assets/{store-invite-DbwSzRRK.js → store-invite-BqHShMlA.js} +1 -1
  131. package/dist/client/assets/{switch-BI7Srio5.js → switch-CG6Wlm7Y.js} +1 -1
  132. package/dist/client/assets/{table-CvLgTwxu.js → table-C915-j5j.js} +1 -1
  133. package/dist/client/assets/{tabs-BcgepvIr.js → tabs-EJf8mrdN.js} +1 -1
  134. package/dist/client/assets/{task-status-E_WeHLB-.js → task-status-DwSGaLCq.js} +1 -1
  135. package/dist/client/assets/tasks-B-KbBDgd.js +1 -0
  136. package/dist/client/assets/{tasks-panel-CgnSZwBZ.js → tasks-panel-j-1pM09U.js} +1 -1
  137. package/dist/client/assets/{textarea-BjXJvI0O.js → textarea-BpJcJgEu.js} +1 -1
  138. package/dist/client/assets/{time-range-picker-CTHuop4k.js → time-range-picker-CBrng89O.js} +1 -1
  139. package/dist/client/assets/{toggle-group-DF6ThyrQ.js → toggle-group-D3jOZx6Z.js} +1 -1
  140. package/dist/client/assets/{tools-list-BYjVtR4b.js → tools-list-BJKvrBYn.js} +1 -1
  141. package/dist/client/assets/{tooltip-CKRAIo8e.js → tooltip-SqkLa6wk.js} +1 -1
  142. package/dist/client/assets/{topbar-portal-w0rGTzsN.js → topbar-portal-Ul2d-lg1.js} +1 -1
  143. package/dist/client/assets/{types-CEJbDNRj.js → types-CdHbWvSx.js} +1 -1
  144. package/dist/client/assets/{use-automations-CZzmdooE.js → use-automations-xjYa92g6.js} +1 -1
  145. package/dist/client/assets/{use-collections-CLlnuJpl.js → use-collections-Zp8eOwPm.js} +1 -1
  146. package/dist/client/assets/{use-connection-DSXGpH93.js → use-connection-B-vgK3kN.js} +1 -1
  147. package/dist/client/assets/{use-copy-C8N2hXkR.js → use-copy-Bor2cPit.js} +1 -1
  148. package/dist/client/assets/{use-create-virtual-mcp-CCjeFnH5.js → use-create-virtual-mcp-DLLVUJBK.js} +1 -1
  149. package/dist/client/assets/{use-infinite-scroll-C1MEbO72.js → use-infinite-scroll-QweqoXs4.js} +1 -1
  150. package/dist/client/assets/{use-install-from-registry-OGBcaDCK.js → use-install-from-registry-BWF2XusE.js} +1 -1
  151. package/dist/client/assets/{use-list-state-CsPnDRB0.js → use-list-state-BpX2jytt.js} +1 -1
  152. package/dist/client/assets/{use-mcp-prompts-DSysuR0s.js → use-mcp-prompts-qi4FHPHh.js} +1 -1
  153. package/dist/client/assets/{use-mcp-resources-BWxiCCmX.js → use-mcp-resources-B8ERGBbF.js} +1 -1
  154. package/dist/client/assets/{use-mcp-tools-Ca8lRrYA.js → use-mcp-tools-DNLvgz5O.js} +1 -1
  155. package/dist/client/assets/{use-members-CRSSGJnt.js → use-members-CcTYAvXH.js} +1 -1
  156. package/dist/client/assets/{use-project-Cpu-iDuV.js → use-project-D_8V3WFM.js} +1 -1
  157. package/dist/client/assets/{use-store-discovery-1Qhmse-y.js → use-store-discovery-iIFblh2E.js} +1 -1
  158. package/dist/client/assets/{use-view-mode-CjInGBUv.js → use-view-mode-BBlaOBUn.js} +1 -1
  159. package/dist/client/assets/{use-virtual-mcp-D5bKIffF.js → use-virtual-mcp-BnUWdVw5.js} +1 -1
  160. package/dist/client/assets/useInfiniteQuery-KvMZbxSR.js +1 -0
  161. package/dist/client/assets/{useMutation-Bncnalv9.js → useMutation-oWI4nFQG.js} +1 -1
  162. package/dist/client/assets/useQuery-CmP1G4DA.js +1 -0
  163. package/dist/client/assets/useSuspenseInfiniteQuery-4eRk30PP.js +1 -0
  164. package/dist/client/assets/{user-CwGhUrKE.js → user-BtGr8jKI.js} +1 -1
  165. package/dist/client/assets/{workflow-D6XUy7ku.js → workflow-CKtu7TZc.js} +1 -1
  166. package/dist/client/index.html +1 -1
  167. package/dist/server/cli.js +7 -2
  168. package/dist/server/server.js +7 -2
  169. package/package.json +1 -1
  170. package/dist/client/assets/plugins-vFW-WlI8.js +0 -1
  171. package/dist/client/assets/tasks-Db5wfUei.js +0 -1
  172. package/dist/client/assets/useInfiniteQuery-C-1ZqiFa.js +0 -1
  173. package/dist/client/assets/useQuery-CIPIMOb2.js +0 -1
  174. package/dist/client/assets/useSuspenseInfiniteQuery-Dah_qudN.js +0 -1
  175. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  176. package/dist/server/node_modules/xtend/LICENSE +0 -20
  177. package/dist/server/node_modules/xtend/README.md +0 -32
  178. package/dist/server/node_modules/xtend/immutable.js +0 -19
  179. package/dist/server/node_modules/xtend/mutable.js +0 -17
  180. package/dist/server/node_modules/xtend/package.json +0 -55
  181. package/dist/server/node_modules/xtend/test.js +0 -103
@@ -1 +1 @@
1
- import{c as n,D as r,j as i,aj as p}from"./index-t6xY8FYJ.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{c as n,D as r,j as i,aj as p}from"./index-BjxqoU_w.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
@@ -1 +1 @@
1
- import{c as p,r,aJ as w,j as n}from"./index-t6xY8FYJ.js";import{P as x}from"./index-1_kpvnU4.js";const R=r.createContext(null);function H(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=w.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function L(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=w.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function $(m){const e=p.c(18),{children:l,breadcrumb:t}=m,[s,y]=r.useState(null),[j,C]=r.useState(null),S=r.useRef(null),V=r.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{S.current=c,c&&y(c)},e[0]=E):E=e[0];const g=E;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=c=>{V.current=c,c&&C(c)},e[1]=b):b=e[1];const v=b;let a;e[2]!==j||e[3]!==s?(a={tabsEl:s,actionsEl:j},e[2]=j,e[3]=s,e[4]=a):a=e[4];let o;e[5]!==t?(o=n.jsx(x.Header.Left,{children:t}),e[5]=t,e[6]=o):o=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(x.Header.Right,{children:[n.jsx("div",{ref:g,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:v,className:"flex items-center gap-2 shrink-0"})]}),e[7]=h):h=e[7];let i;e[8]!==o?(i=n.jsxs(x.Header,{children:[o,h]}),e[8]=o,e[9]=i):i=e[9];let f;e[10]!==l?(f=n.jsx(x.Content,{children:l}),e[10]=l,e[11]=f):f=e[11];let u;e[12]!==i||e[13]!==f?(u=n.jsxs(x,{children:[i,f]}),e[12]=i,e[13]=f,e[14]=u):u=e[14];let d;return e[15]!==a||e[16]!==u?(d=n.jsx(R,{value:a,children:u}),e[15]=a,e[16]=u,e[17]=d):d=e[17],d}export{$ as V,L as a,H as b};
1
+ import{c as p,r,aJ as w,j as n}from"./index-BjxqoU_w.js";import{P as x}from"./index-Be3yjubl.js";const R=r.createContext(null);function H(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=w.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function L(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=w.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function $(m){const e=p.c(18),{children:l,breadcrumb:t}=m,[s,y]=r.useState(null),[j,C]=r.useState(null),S=r.useRef(null),V=r.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{S.current=c,c&&y(c)},e[0]=E):E=e[0];const g=E;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=c=>{V.current=c,c&&C(c)},e[1]=b):b=e[1];const v=b;let a;e[2]!==j||e[3]!==s?(a={tabsEl:s,actionsEl:j},e[2]=j,e[3]=s,e[4]=a):a=e[4];let o;e[5]!==t?(o=n.jsx(x.Header.Left,{children:t}),e[5]=t,e[6]=o):o=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(x.Header.Right,{children:[n.jsx("div",{ref:g,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:v,className:"flex items-center gap-2 shrink-0"})]}),e[7]=h):h=e[7];let i;e[8]!==o?(i=n.jsxs(x.Header,{children:[o,h]}),e[8]=o,e[9]=i):i=e[9];let f;e[10]!==l?(f=n.jsx(x.Content,{children:l}),e[10]=l,e[11]=f):f=e[11];let u;e[12]!==i||e[13]!==f?(u=n.jsxs(x,{children:[i,f]}),e[12]=i,e[13]=f,e[14]=u):u=e[14];let d;return e[15]!==a||e[16]!==u?(d=n.jsx(R,{value:a,children:u}),e[15]=a,e[16]=u,e[17]=d):d=e[17],d}export{$ as V,L as a,H as b};
@@ -1 +1 @@
1
- import{j as t,a7 as ie,c as W,aL as re,e as ae,g as ne,D as X,r as Y,u as ce,G as q,O as K,aM as me,P as de}from"./index-t6xY8FYJ.js";import{S as D}from"./skeleton-BPyW696G.js";import{u as fe}from"./use-project-Cpu-iDuV.js";import{i as xe,P as d}from"./index-1_kpvnU4.js";import{b as w,d as Q,B as ee,a as te,e as V,c as se}from"./breadcrumb-BjaszutD.js";import{i as je}from"./ArrowLeft-7hoUFjWA.js";import{n as he}from"./Container-OKF_GeCq.js";import{t as ue}from"./Settings01-Cc_jPdtk.js";import{i as pe}from"./Zap-D6ZQZPYh.js";import"./useQuery-CIPIMOb2.js";import"./constants-C2NIYyeK.js";import"./useMutation-Bncnalv9.js";import"./tooltip-CKRAIo8e.js";import"./index-BKuN2Iot.js";import"./X-CVr_hKcl.js";import"./ChevronRight-8vS2LfiE.js";const oe=[{key:"general",label:"General",icon:t.jsx(ue,{size:14})},{key:"dependencies",label:"Connections",icon:t.jsx(he,{size:14})},{key:"sidebar",label:"Sidebar",icon:t.jsx(xe,{size:14})},{key:"plugins",label:"Features",icon:t.jsx(pe,{size:14})},{key:"danger",label:"Danger Zone",icon:t.jsx(ie,{size:14})}];function ge(e){const s=W.c(10),{onNavigate:r}=e,{location:n}=re(),$=ae();let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},s[0]=a):a=s[0];const f=ne(a);let x;s[1]!==$||s[2]!==r||s[3]!==f?(x=i=>{const j=`/${f.org}/${f.project}/settings/${i}`;$({href:j}),r?.(i)},s[1]=$,s[2]=r,s[3]=f,s[4]=x):x=s[4];const l=x;let c;s[5]!==l||s[6]!==n?(c=oe.map(i=>{const j=n.pathname.endsWith(`/settings/${i.key}`);return t.jsxs("button",{type:"button",onClick:()=>l(i.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",j?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[t.jsx("span",{className:"shrink-0",children:i.icon}),t.jsx("span",{className:"truncate",children:i.label})]},i.key)}),s[5]=l,s[6]=n,s[7]=c):c=s[7];let o;return s[8]!==c?(o=t.jsx("div",{className:"w-full sm:w-52 shrink-0 sm:border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-0.5 px-2 flex-1",children:c}),s[8]=c,s[9]=o):o=s[9],o}function le(){const e=W.c(3);let s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(D,{className:"h-6 w-48"}),r=t.jsx(D,{className:"h-4 w-80"}),e[0]=s,e[1]=r):(s=e[0],r=e[1]);let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s,r,t.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[t.jsx(D,{className:"h-12 w-full"}),t.jsx(D,{className:"h-12 w-full"})]})]}),e[2]=n):n=e[2],n}function be(){const e=W.c(60);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=ne(s),{org:n}=ce(),$=r.project,{location:a}=re(),[f,x]=Y.useState(!0),{data:l,isLoading:c}=fe(n.id,$);let o;e[1]!==a?(o=oe.find(m=>a.pathname.endsWith(`/settings/${m.key}`)),e[1]=a,e[2]=o):o=e[2];const j=o?.label??"Settings";if(c||!l){let m;e[3]!==r.org?(m=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project/projects",params:{org:r.org,project:K},children:"Projects"})})}),e[3]=r.org,e[4]=m):m=e[4];let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(V,{}),e[5]=H):H=e[5];let M;e[6]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(w,{children:t.jsx(se,{children:"Settings"})}),e[6]=M):M=e[6];let k;e[7]!==m?(k=t.jsx(d.Header,{children:t.jsx(d.Header.Left,{children:t.jsx(ee,{children:t.jsxs(te,{children:[m,H,M]})})})}),e[7]=m,e[8]=k):k=e[8];let T;e[9]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(d.Content,{children:t.jsx("div",{className:"p-8",children:t.jsx(le,{})})}),e[9]=T):T=e[9];let A;return e[10]!==k?(A=t.jsxs(d,{children:[k,T]}),e[10]=k,e[11]=A):A=e[11],A}const F=l.slug===K;let C;e[12]!==l.description||e[13]!==l.enabledPlugins||e[14]!==l.id||e[15]!==l.name||e[16]!==l.organizationId||e[17]!==l.slug||e[18]!==l.ui||e[19]!==F?(C={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:F},e[12]=l.description,e[13]=l.enabledPlugins,e[14]=l.id,e[15]=l.name,e[16]=l.organizationId,e[17]=l.slug,e[18]=l.ui,e[19]=F,e[20]=C):C=e[20];const J=C;let h;e[21]!==r.org?(h=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project/projects",params:{org:r.org,project:K},children:"Projects"})})}),e[21]=r.org,e[22]=h):h=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(V,{}),e[23]=z):z=e[23];let u;e[24]!==r.org||e[25]!==l.slug?(u={org:r.org,project:l.slug},e[24]=r.org,e[25]=l.slug,e[26]=u):u=e[26];let p;e[27]!==l.name||e[28]!==u?(p=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project",params:u,children:l.name})})}),e[27]=l.name,e[28]=u,e[29]=p):p=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(V,{}),e[30]=I):I=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(w,{children:t.jsx(se,{children:"Settings"})}),e[31]=L):L=e[31];let g;e[32]!==h||e[33]!==p?(g=t.jsx(d.Header,{children:t.jsx(d.Header.Left,{children:t.jsx(ee,{children:t.jsxs(te,{children:[h,z,p,I,L]})})})}),e[32]=h,e[33]=p,e[34]=g):g=e[34];const U=f?"hidden":"flex";let b;e[35]!==U?(b=X(U,"sm:flex flex-col w-full sm:w-auto"),e[35]=U,e[36]=b):b=e[36];let B;e[37]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ge,{onNavigate:()=>x(!0)}),e[37]=B):B=e[37];let S;e[38]!==b?(S=t.jsx("div",{className:b,children:B}),e[38]=b,e[39]=S):S=e[39];const Z=f?"flex":"hidden";let y;e[40]!==Z?(y=X(Z,"sm:flex flex-1 min-w-0 flex-col overflow-hidden"),e[40]=Z,e[41]=y):y=e[41];let E;e[42]===Symbol.for("react.memo_cache_sentinel")?(E=()=>x(!1),e[42]=E):E=e[42];let G;e[43]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs("button",{type:"button",onClick:E,className:"rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity",children:[t.jsx(je,{size:16}),t.jsx("span",{className:"sr-only",children:"Back"})]}),e[43]=G):G=e[43];let _;e[44]!==j?(_=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border sm:hidden",children:[G,t.jsx("span",{className:"text-sm font-semibold",children:j})]}),e[44]=j,e[45]=_):_=e[45];let O;e[46]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("div",{className:"flex-1 overflow-y-auto p-5 sm:p-8",children:t.jsx(Y.Suspense,{fallback:t.jsx(le,{}),children:t.jsx(me,{})})}),e[46]=O):O=e[46];let N;e[47]!==y||e[48]!==_?(N=t.jsxs("div",{className:y,children:[_,O]}),e[47]=y,e[48]=_,e[49]=N):N=e[49];let v;e[50]!==S||e[51]!==N?(v=t.jsxs(d.Content,{className:"flex",children:[S,N]}),e[50]=S,e[51]=N,e[52]=v):v=e[52];let P;e[53]!==g||e[54]!==v?(P=t.jsxs(d,{children:[g,v]}),e[53]=g,e[54]=v,e[55]=P):P=e[55];let R;return e[56]!==J||e[57]!==n||e[58]!==P?(R=t.jsx(de,{org:n,project:J,children:P}),e[56]=J,e[57]=n,e[58]=P,e[59]=R):R=e[59],R}function Oe(){const e=W.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Y.Suspense,{fallback:null,children:t.jsx(be,{})}),e[0]=s):s=e[0],s}export{Oe as default};
1
+ import{j as t,a7 as ie,c as W,aL as re,e as ae,g as ne,D as X,r as Y,u as ce,G as q,O as K,aM as me,P as de}from"./index-BjxqoU_w.js";import{S as D}from"./skeleton-HKYMRn58.js";import{u as fe}from"./use-project-D_8V3WFM.js";import{i as xe,P as d}from"./index-Be3yjubl.js";import{b as w,d as Q,B as ee,a as te,e as V,c as se}from"./breadcrumb-DNInqlES.js";import{i as je}from"./ArrowLeft-U7OUoBhv.js";import{n as he}from"./Container-D4n2e11R.js";import{t as ue}from"./Settings01-BVY96Vsg.js";import{i as pe}from"./Zap-DGbTVlYq.js";import"./useQuery-CmP1G4DA.js";import"./constants-C5g6K3-0.js";import"./useMutation-oWI4nFQG.js";import"./tooltip-SqkLa6wk.js";import"./index-VZp2CIbR.js";import"./X-DvXlEl9E.js";import"./ChevronRight-CTHCKnjF.js";const oe=[{key:"general",label:"General",icon:t.jsx(ue,{size:14})},{key:"dependencies",label:"Connections",icon:t.jsx(he,{size:14})},{key:"sidebar",label:"Sidebar",icon:t.jsx(xe,{size:14})},{key:"plugins",label:"Features",icon:t.jsx(pe,{size:14})},{key:"danger",label:"Danger Zone",icon:t.jsx(ie,{size:14})}];function ge(e){const s=W.c(10),{onNavigate:r}=e,{location:n}=re(),$=ae();let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},s[0]=a):a=s[0];const f=ne(a);let x;s[1]!==$||s[2]!==r||s[3]!==f?(x=i=>{const j=`/${f.org}/${f.project}/settings/${i}`;$({href:j}),r?.(i)},s[1]=$,s[2]=r,s[3]=f,s[4]=x):x=s[4];const l=x;let c;s[5]!==l||s[6]!==n?(c=oe.map(i=>{const j=n.pathname.endsWith(`/settings/${i.key}`);return t.jsxs("button",{type:"button",onClick:()=>l(i.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",j?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[t.jsx("span",{className:"shrink-0",children:i.icon}),t.jsx("span",{className:"truncate",children:i.label})]},i.key)}),s[5]=l,s[6]=n,s[7]=c):c=s[7];let o;return s[8]!==c?(o=t.jsx("div",{className:"w-full sm:w-52 shrink-0 sm:border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-0.5 px-2 flex-1",children:c}),s[8]=c,s[9]=o):o=s[9],o}function le(){const e=W.c(3);let s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(D,{className:"h-6 w-48"}),r=t.jsx(D,{className:"h-4 w-80"}),e[0]=s,e[1]=r):(s=e[0],r=e[1]);let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s,r,t.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[t.jsx(D,{className:"h-12 w-full"}),t.jsx(D,{className:"h-12 w-full"})]})]}),e[2]=n):n=e[2],n}function be(){const e=W.c(60);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=ne(s),{org:n}=ce(),$=r.project,{location:a}=re(),[f,x]=Y.useState(!0),{data:l,isLoading:c}=fe(n.id,$);let o;e[1]!==a?(o=oe.find(m=>a.pathname.endsWith(`/settings/${m.key}`)),e[1]=a,e[2]=o):o=e[2];const j=o?.label??"Settings";if(c||!l){let m;e[3]!==r.org?(m=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project/projects",params:{org:r.org,project:K},children:"Projects"})})}),e[3]=r.org,e[4]=m):m=e[4];let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(V,{}),e[5]=H):H=e[5];let M;e[6]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(w,{children:t.jsx(se,{children:"Settings"})}),e[6]=M):M=e[6];let k;e[7]!==m?(k=t.jsx(d.Header,{children:t.jsx(d.Header.Left,{children:t.jsx(ee,{children:t.jsxs(te,{children:[m,H,M]})})})}),e[7]=m,e[8]=k):k=e[8];let T;e[9]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(d.Content,{children:t.jsx("div",{className:"p-8",children:t.jsx(le,{})})}),e[9]=T):T=e[9];let A;return e[10]!==k?(A=t.jsxs(d,{children:[k,T]}),e[10]=k,e[11]=A):A=e[11],A}const F=l.slug===K;let C;e[12]!==l.description||e[13]!==l.enabledPlugins||e[14]!==l.id||e[15]!==l.name||e[16]!==l.organizationId||e[17]!==l.slug||e[18]!==l.ui||e[19]!==F?(C={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:F},e[12]=l.description,e[13]=l.enabledPlugins,e[14]=l.id,e[15]=l.name,e[16]=l.organizationId,e[17]=l.slug,e[18]=l.ui,e[19]=F,e[20]=C):C=e[20];const J=C;let h;e[21]!==r.org?(h=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project/projects",params:{org:r.org,project:K},children:"Projects"})})}),e[21]=r.org,e[22]=h):h=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(V,{}),e[23]=z):z=e[23];let u;e[24]!==r.org||e[25]!==l.slug?(u={org:r.org,project:l.slug},e[24]=r.org,e[25]=l.slug,e[26]=u):u=e[26];let p;e[27]!==l.name||e[28]!==u?(p=t.jsx(w,{children:t.jsx(Q,{asChild:!0,children:t.jsx(q,{to:"/$org/$project",params:u,children:l.name})})}),e[27]=l.name,e[28]=u,e[29]=p):p=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(V,{}),e[30]=I):I=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(w,{children:t.jsx(se,{children:"Settings"})}),e[31]=L):L=e[31];let g;e[32]!==h||e[33]!==p?(g=t.jsx(d.Header,{children:t.jsx(d.Header.Left,{children:t.jsx(ee,{children:t.jsxs(te,{children:[h,z,p,I,L]})})})}),e[32]=h,e[33]=p,e[34]=g):g=e[34];const U=f?"hidden":"flex";let b;e[35]!==U?(b=X(U,"sm:flex flex-col w-full sm:w-auto"),e[35]=U,e[36]=b):b=e[36];let B;e[37]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ge,{onNavigate:()=>x(!0)}),e[37]=B):B=e[37];let S;e[38]!==b?(S=t.jsx("div",{className:b,children:B}),e[38]=b,e[39]=S):S=e[39];const Z=f?"flex":"hidden";let y;e[40]!==Z?(y=X(Z,"sm:flex flex-1 min-w-0 flex-col overflow-hidden"),e[40]=Z,e[41]=y):y=e[41];let E;e[42]===Symbol.for("react.memo_cache_sentinel")?(E=()=>x(!1),e[42]=E):E=e[42];let G;e[43]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs("button",{type:"button",onClick:E,className:"rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity",children:[t.jsx(je,{size:16}),t.jsx("span",{className:"sr-only",children:"Back"})]}),e[43]=G):G=e[43];let _;e[44]!==j?(_=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border sm:hidden",children:[G,t.jsx("span",{className:"text-sm font-semibold",children:j})]}),e[44]=j,e[45]=_):_=e[45];let O;e[46]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("div",{className:"flex-1 overflow-y-auto p-5 sm:p-8",children:t.jsx(Y.Suspense,{fallback:t.jsx(le,{}),children:t.jsx(me,{})})}),e[46]=O):O=e[46];let N;e[47]!==y||e[48]!==_?(N=t.jsxs("div",{className:y,children:[_,O]}),e[47]=y,e[48]=_,e[49]=N):N=e[49];let v;e[50]!==S||e[51]!==N?(v=t.jsxs(d.Content,{className:"flex",children:[S,N]}),e[50]=S,e[51]=N,e[52]=v):v=e[52];let P;e[53]!==g||e[54]!==v?(P=t.jsxs(d,{children:[g,v]}),e[53]=g,e[54]=v,e[55]=P):P=e[55];let R;return e[56]!==J||e[57]!==n||e[58]!==P?(R=t.jsx(de,{org:n,project:J,children:P}),e[56]=J,e[57]=n,e[58]=P,e[59]=R):R=e[59],R}function Oe(){const e=W.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Y.Suspense,{fallback:null,children:t.jsx(be,{})}),e[0]=s):s=e[0],s}export{Oe as default};
@@ -1 +1 @@
1
- import{y as Q,r as x,f as p,j as e,B as g,D as T,d as ne,S as W,N as ae,c as ie}from"./index-t6xY8FYJ.js";import{u as B}from"./useMutation-Bncnalv9.js";import{I}from"./input-qMconvxq.js";function oe({redirectUrl:s,callbackUrl:r="/"}){const{emailAndPassword:l,resetPassword:u,emailOtp:i,socialProviders:d}=Q(),[n,j]=x.useState(""),[y,D]=x.useState(""),[b,_]=x.useState(""),[C,O]=x.useState(""),[A,L]=x.useState(!1),[R,N]=x.useState(()=>!l.enabled&&i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=x.useState(""),[$,Y]=x.useState(!1),m=R==="signUp",f=R==="forgotPassword",w=R==="emailOtp",z=B({mutationFn:async({email:t,password:a,name:M})=>{try{if(m){const h=await p.signUp.email({email:t,password:a,name:M||""});if(h.error)throw new Error(h.error.message||"Sign up failed");return h}else{const h=await p.signIn.email({email:t,password:a});if(h.error)throw new Error(h.error.message||"Sign in failed");return h}}catch(h){throw h instanceof Error?h:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r}}),F=B({mutationFn:async({email:t})=>{const a=await p.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{Y(!0)}}),k=B({mutationFn:async({email:t})=>{const a=await p.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{L(!0)}}),E=B({mutationFn:async({email:t,otp:a})=>{const M=await p.signIn.emailOtp({email:t,otp:a});if(M.error)throw new Error(M.error.message||"Invalid code");return M},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r}}),q=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{n.trim()&&!q(n)&&S("Invalid email address")},X=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}z.mutate({email:n,password:y,name:b})},Z=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}F.mutate({email:n})},ee=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}k.mutate({email:n})},te=t=>{t.preventDefault(),E.mutate({email:n,otp:C})},P=t=>a=>{t(a.target.value),G&&z.reset(),H&&F.reset(),J&&(k.reset(),E.reset()),t===j&&c&&S("")},U=t=>{N(t),_(""),O(""),L(!1),S(""),Y(!1),z.reset(),F.reset(),k.reset(),E.reset()},o=z.isPending||F.isPending||k.isPending||E.isPending,G=z.error,H=F.error,J=k.error||E.error,v=m?n.trim()&&y.trim()&&b.trim():f?n.trim():w?A?C.trim():n.trim():n.trim()&&y.trim(),se=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=f?"Reset your password":w?A?"Enter verification code":"Sign in with email code":m?"Create your account":"Login or signup below";return e.jsxs("div",{className:"mx-auto w-full min-h-full md:min-h-0 md:min-w-[400px] max-w-md grid gap-6 content-center bg-card p-6 md:p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:re})}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:se(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!f&&d.enabled&&e.jsx("div",{className:"grid gap-3",children:d.providers.map(t=>e.jsxs(g,{type:"button",variant:"outline",size:"lg",className:"w-full font-medium",disabled:o,onClick:()=>{p.signIn.social({provider:t.name,callbackURL:s??r})},children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:"h-5 w-5","aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!f&&d.enabled&&(l.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),w&&i.enabled&&e.jsx(e.Fragment,{children:A?e.jsxs("form",{onSubmit:te,className:"grid gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-muted/50 p-3 text-sm text-muted-foreground text-center",children:["Code sent to ",n]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:C,onChange:P(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code"})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Verifying...":"Verify"}),e.jsx(g,{type:"button",variant:"ghost",onClick:()=>{L(!1),O(""),k.reset(),E.reset()},disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send code"})]})}),f&&l.enabled&&!$&&e.jsxs("form",{onSubmit:Z,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send reset link"})]}),!f&&!w&&l.enabled&&e.jsxs("form",{onSubmit:X,className:"grid gap-4",children:[e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",m?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:T("p-1",!m&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:b,onChange:P(_),required:!0,disabled:o||!m,"aria-hidden":!m})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!m&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>U("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:P(D),required:!0,disabled:o})]}),e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:T("p-1",!v&&"pointer-events-none"),children:e.jsx(g,{type:"submit",disabled:o||!v,className:T("w-full font-semibold"),size:"lg","aria-hidden":!v,children:o?m?"Creating account...":"Signing in...":"Continue"})})})]}),!f&&i.enabled&&l.enabled&&!w&&e.jsx("div",{className:"text-center",children:e.jsx(g,{type:"button",variant:"link",onClick:()=>U("emailOtp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with email code instead"})}),w&&l.enabled&&e.jsx("div",{className:"text-center",children:e.jsx(g,{type:"button",variant:"link",onClick:()=>U("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with password instead"})}),e.jsx("div",{className:"text-center",children:f?e.jsx(g,{type:"button",variant:"link",onClick:()=>U("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"}):!w&&l.enabled?e.jsx(g,{type:"button",variant:"link",onClick:()=>U(m?"signIn":"signUp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:m?"Already have an account? Sign in":"Don't have an account? Sign up"}):null}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function le({redirectTo:s}){const[r,l]=x.useState(null);return x.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let d=0;d<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));d++)await new Promise(n=>setTimeout(n,Math.min(1e3*2**d,1e4)));if(!i?.ok){const d=await i?.json().catch(()=>({}));throw new Error(d?.error||"Auto-login failed")}if(!u){const d=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=d}}catch(i){u||l(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),r?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",r]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function de(s){if(!s.client_id||s.response_type!=="code")return null;const r=new URLSearchParams;return s.client_id&&r.set("client_id",s.client_id),s.redirect_uri&&r.set("redirect_uri",s.redirect_uri),s.response_type&&r.set("response_type",s.response_type),s.state&&r.set("state",s.state),s.scope&&r.set("scope",s.scope),s.code_challenge&&r.set("code_challenge",s.code_challenge),s.code_challenge_method&&r.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${r.toString()}`}function ce(s){const r=ie.c(5),{callbackURL:l,providerId:u}=s;let i,d;r[0]!==l||r[1]!==u?(i=()=>{(async()=>await p.signIn.sso({providerId:u,callbackURL:l}))()},d=[u,l],r[0]=l,r[1]=u,r[2]=i,r[3]=d):(i=r[2],d=r[3]),x.useEffect(i,d);let n;return r[4]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(W,{}),r[4]=n):n=r[4],n}function he(){const s=p.useSession(),r=ne({from:"/login"}),{next:l="/",client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}=r,b=l.startsWith("/")&&!l.startsWith("//")?l:"/",{sso:_,emailAndPassword:C,magicLink:O,emailOtp:A,socialProviders:L,localMode:R}=Q(),N=de({client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}),c=N||b;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(ae,{to:b}):R?e.jsx(le,{redirectTo:c}):_.enabled?e.jsx(ce,{callbackURL:c,providerId:_.providerId}):C.enabled||O.enabled||A.enabled||L.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-stretch md:items-center justify-center bg-gradient-to-br from-brand to-brand/75 p-1 md:p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--brand-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10 w-full md:w-auto",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx(oe,{redirectUrl:N,callbackUrl:b})]})]}):e.jsx("div",{children:"No login options available"})}export{he as default};
1
+ import{y as Q,r as x,f as p,j as e,B as g,D as T,d as ne,S as W,N as ae,c as ie}from"./index-BjxqoU_w.js";import{u as B}from"./useMutation-oWI4nFQG.js";import{I}from"./input-Be0bLLQW.js";function oe({redirectUrl:s,callbackUrl:r="/"}){const{emailAndPassword:l,resetPassword:u,emailOtp:i,socialProviders:d}=Q(),[n,j]=x.useState(""),[y,D]=x.useState(""),[b,_]=x.useState(""),[C,O]=x.useState(""),[A,L]=x.useState(!1),[R,N]=x.useState(()=>!l.enabled&&i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=x.useState(""),[$,Y]=x.useState(!1),m=R==="signUp",f=R==="forgotPassword",w=R==="emailOtp",z=B({mutationFn:async({email:t,password:a,name:M})=>{try{if(m){const h=await p.signUp.email({email:t,password:a,name:M||""});if(h.error)throw new Error(h.error.message||"Sign up failed");return h}else{const h=await p.signIn.email({email:t,password:a});if(h.error)throw new Error(h.error.message||"Sign in failed");return h}}catch(h){throw h instanceof Error?h:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r}}),F=B({mutationFn:async({email:t})=>{const a=await p.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{Y(!0)}}),k=B({mutationFn:async({email:t})=>{const a=await p.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{L(!0)}}),E=B({mutationFn:async({email:t,otp:a})=>{const M=await p.signIn.emailOtp({email:t,otp:a});if(M.error)throw new Error(M.error.message||"Invalid code");return M},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r}}),q=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{n.trim()&&!q(n)&&S("Invalid email address")},X=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}z.mutate({email:n,password:y,name:b})},Z=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}F.mutate({email:n})},ee=t=>{if(t.preventDefault(),!q(n)){S("Invalid email address");return}k.mutate({email:n})},te=t=>{t.preventDefault(),E.mutate({email:n,otp:C})},P=t=>a=>{t(a.target.value),G&&z.reset(),H&&F.reset(),J&&(k.reset(),E.reset()),t===j&&c&&S("")},U=t=>{N(t),_(""),O(""),L(!1),S(""),Y(!1),z.reset(),F.reset(),k.reset(),E.reset()},o=z.isPending||F.isPending||k.isPending||E.isPending,G=z.error,H=F.error,J=k.error||E.error,v=m?n.trim()&&y.trim()&&b.trim():f?n.trim():w?A?C.trim():n.trim():n.trim()&&y.trim(),se=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=f?"Reset your password":w?A?"Enter verification code":"Sign in with email code":m?"Create your account":"Login or signup below";return e.jsxs("div",{className:"mx-auto w-full min-h-full md:min-h-0 md:min-w-[400px] max-w-md grid gap-6 content-center bg-card p-6 md:p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:re})}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:se(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!f&&d.enabled&&e.jsx("div",{className:"grid gap-3",children:d.providers.map(t=>e.jsxs(g,{type:"button",variant:"outline",size:"lg",className:"w-full font-medium",disabled:o,onClick:()=>{p.signIn.social({provider:t.name,callbackURL:s??r})},children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:"h-5 w-5","aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!f&&d.enabled&&(l.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),w&&i.enabled&&e.jsx(e.Fragment,{children:A?e.jsxs("form",{onSubmit:te,className:"grid gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-muted/50 p-3 text-sm text-muted-foreground text-center",children:["Code sent to ",n]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:C,onChange:P(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code"})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Verifying...":"Verify"}),e.jsx(g,{type:"button",variant:"ghost",onClick:()=>{L(!1),O(""),k.reset(),E.reset()},disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send code"})]})}),f&&l.enabled&&!$&&e.jsxs("form",{onSubmit:Z,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(g,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send reset link"})]}),!f&&!w&&l.enabled&&e.jsxs("form",{onSubmit:X,className:"grid gap-4",children:[e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",m?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:T("p-1",!m&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:b,onChange:P(_),required:!0,disabled:o||!m,"aria-hidden":!m})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:P(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!m&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>U("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:P(D),required:!0,disabled:o})]}),e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:T("p-1",!v&&"pointer-events-none"),children:e.jsx(g,{type:"submit",disabled:o||!v,className:T("w-full font-semibold"),size:"lg","aria-hidden":!v,children:o?m?"Creating account...":"Signing in...":"Continue"})})})]}),!f&&i.enabled&&l.enabled&&!w&&e.jsx("div",{className:"text-center",children:e.jsx(g,{type:"button",variant:"link",onClick:()=>U("emailOtp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with email code instead"})}),w&&l.enabled&&e.jsx("div",{className:"text-center",children:e.jsx(g,{type:"button",variant:"link",onClick:()=>U("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with password instead"})}),e.jsx("div",{className:"text-center",children:f?e.jsx(g,{type:"button",variant:"link",onClick:()=>U("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"}):!w&&l.enabled?e.jsx(g,{type:"button",variant:"link",onClick:()=>U(m?"signIn":"signUp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:m?"Already have an account? Sign in":"Don't have an account? Sign up"}):null}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function le({redirectTo:s}){const[r,l]=x.useState(null);return x.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let d=0;d<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));d++)await new Promise(n=>setTimeout(n,Math.min(1e3*2**d,1e4)));if(!i?.ok){const d=await i?.json().catch(()=>({}));throw new Error(d?.error||"Auto-login failed")}if(!u){const d=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=d}}catch(i){u||l(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),r?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",r]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function de(s){if(!s.client_id||s.response_type!=="code")return null;const r=new URLSearchParams;return s.client_id&&r.set("client_id",s.client_id),s.redirect_uri&&r.set("redirect_uri",s.redirect_uri),s.response_type&&r.set("response_type",s.response_type),s.state&&r.set("state",s.state),s.scope&&r.set("scope",s.scope),s.code_challenge&&r.set("code_challenge",s.code_challenge),s.code_challenge_method&&r.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${r.toString()}`}function ce(s){const r=ie.c(5),{callbackURL:l,providerId:u}=s;let i,d;r[0]!==l||r[1]!==u?(i=()=>{(async()=>await p.signIn.sso({providerId:u,callbackURL:l}))()},d=[u,l],r[0]=l,r[1]=u,r[2]=i,r[3]=d):(i=r[2],d=r[3]),x.useEffect(i,d);let n;return r[4]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(W,{}),r[4]=n):n=r[4],n}function he(){const s=p.useSession(),r=ne({from:"/login"}),{next:l="/",client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}=r,b=l.startsWith("/")&&!l.startsWith("//")?l:"/",{sso:_,emailAndPassword:C,magicLink:O,emailOtp:A,socialProviders:L,localMode:R}=Q(),N=de({client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}),c=N||b;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(ae,{to:b}):R?e.jsx(le,{redirectTo:c}):_.enabled?e.jsx(ce,{callbackURL:c,providerId:_.providerId}):C.enabled||O.enabled||A.enabled||L.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-stretch md:items-center justify-center bg-gradient-to-br from-brand to-brand/75 p-1 md:p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--brand-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10 w-full md:w-auto",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx(oe,{redirectUrl:N,callbackUrl:b})]})]}):e.jsx("div",{children:"No login options available"})}export{he as default};
@@ -1 +1 @@
1
- import{c as F,r as B,v as w,j as t,B as k}from"./index-t6xY8FYJ.js";import{i as E}from"./Upload01-B4UOm_Kf.js";import{i as S}from"./X-CVr_hKcl.js";function M(L){const e=F.c(28),{value:s,onChange:l,name:b,disabled:r}=L,a=B.useRef(null);let f;e[0]!==l?(f=y=>{const N=y.target.files?.[0];if(N){if(N.size>2097152){w.error("Image must be smaller than 2MB");return}const o=new FileReader;o.onerror=()=>{const C=o.error;console.error("FileReader error:",C),w.error(C?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},o.onloadend=()=>{o.readyState===FileReader.DONE&&o.result&&l(o.result),a.current&&(a.current.value="")},o.readAsDataURL(N)}},e[0]=l,e[1]=f):f=e[1];const v=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{a.current?.click()},e[2]=h):h=e[2];const R=h;let x;e[3]!==l?(x=y=>{y.stopPropagation(),l("")},e[3]=l,e[4]=x):x=e[4];const n=x;let i;e[5]!==r||e[6]!==v?(i=t.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:v,disabled:r}),e[5]=r,e[6]=v,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==n||e[10]!==b||e[11]!==s?(c=s?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:t.jsx("img",{src:s,alt:b||"Logo",className:"w-full h-full object-cover"})}),t.jsx("button",{type:"button",onClick:n,disabled:r,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:t.jsx(S,{className:"h-3 w-3"})})]}):t.jsxs("button",{type:"button",onClick:R,disabled:r,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[t.jsx(E,{className:"h-5 w-5"}),t.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=r,e[9]=n,e[10]=b,e[11]=s,e[12]=c):c=e[12];const j=s?"Change Logo":"Upload Logo";let d;e[13]!==r||e[14]!==j?(d=t.jsx(k,{type:"button",variant:"outline",size:"sm",onClick:R,disabled:r,className:"mb-2",children:j}),e[13]=r,e[14]=j,e[15]=d):d=e[15];let m;e[16]!==r||e[17]!==n||e[18]!==s?(m=s&&t.jsx(k,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:r,className:"ml-2",children:"Remove"}),e[16]=r,e[17]=n,e[18]=s,e[19]=m):m=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=p):p=e[20];let u;e[21]!==d||e[22]!==m?(u=t.jsxs("div",{className:"flex-1",children:[d,m,p]}),e[21]=d,e[22]=m,e[23]=u):u=e[23];let g;return e[24]!==u||e[25]!==i||e[26]!==c?(g=t.jsxs("div",{className:"flex items-start gap-4",children:[i,c,u]}),e[24]=u,e[25]=i,e[26]=c,e[27]=g):g=e[27],g}export{M as L};
1
+ import{c as F,r as B,v as w,j as t,B as k}from"./index-BjxqoU_w.js";import{i as E}from"./Upload01-Bn_9d04P.js";import{i as S}from"./X-DvXlEl9E.js";function M(L){const e=F.c(28),{value:s,onChange:l,name:b,disabled:r}=L,a=B.useRef(null);let f;e[0]!==l?(f=y=>{const N=y.target.files?.[0];if(N){if(N.size>2097152){w.error("Image must be smaller than 2MB");return}const o=new FileReader;o.onerror=()=>{const C=o.error;console.error("FileReader error:",C),w.error(C?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},o.onloadend=()=>{o.readyState===FileReader.DONE&&o.result&&l(o.result),a.current&&(a.current.value="")},o.readAsDataURL(N)}},e[0]=l,e[1]=f):f=e[1];const v=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{a.current?.click()},e[2]=h):h=e[2];const R=h;let x;e[3]!==l?(x=y=>{y.stopPropagation(),l("")},e[3]=l,e[4]=x):x=e[4];const n=x;let i;e[5]!==r||e[6]!==v?(i=t.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:v,disabled:r}),e[5]=r,e[6]=v,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==n||e[10]!==b||e[11]!==s?(c=s?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:t.jsx("img",{src:s,alt:b||"Logo",className:"w-full h-full object-cover"})}),t.jsx("button",{type:"button",onClick:n,disabled:r,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:t.jsx(S,{className:"h-3 w-3"})})]}):t.jsxs("button",{type:"button",onClick:R,disabled:r,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[t.jsx(E,{className:"h-5 w-5"}),t.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=r,e[9]=n,e[10]=b,e[11]=s,e[12]=c):c=e[12];const j=s?"Change Logo":"Upload Logo";let d;e[13]!==r||e[14]!==j?(d=t.jsx(k,{type:"button",variant:"outline",size:"sm",onClick:R,disabled:r,className:"mb-2",children:j}),e[13]=r,e[14]=j,e[15]=d):d=e[15];let m;e[16]!==r||e[17]!==n||e[18]!==s?(m=s&&t.jsx(k,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:r,className:"ml-2",children:"Remove"}),e[16]=r,e[17]=n,e[18]=s,e[19]=m):m=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=p):p=e[20];let u;e[21]!==d||e[22]!==m?(u=t.jsxs("div",{className:"flex-1",children:[d,m,p]}),e[21]=d,e[22]=m,e[23]=u):u=e[23];let g;return e[24]!==u||e[25]!==i||e[26]!==c?(g=t.jsxs("div",{className:"flex items-start gap-4",children:[i,c,u]}),e[24]=u,e[25]=i,e[26]=c,e[27]=g):g=e[27],g}export{M as L};
@@ -1,4 +1,4 @@
1
- import{r as O,c as Z,D as _,j as d}from"./index-t6xY8FYJ.js";import{u as V}from"./use-mcp-resources-BWxiCCmX.js";import{o as Q,N as q,A as K}from"./types-CEJbDNRj.js";const $=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Y(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${J(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,c=o.match(s);if(c){const i=(c.index??0)+c[0].length;return o.slice(0,i)+`
1
+ import{r as O,c as Z,D as _,j as d}from"./index-BjxqoU_w.js";import{u as V}from"./use-mcp-resources-B8ERGBbF.js";import{o as Q,N as q,A as K}from"./types-CdHbWvSx.js";const $=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Y(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${J(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,c=o.match(s);if(c){const i=(c.index??0)+c[0].length;return o.slice(0,i)+`
2
2
  `+n+o.slice(i)}const a=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,r=o.match(a);if(r){const i=(r.index??0)+r[0].length;return o.slice(0,i)+`
3
3
  <head>
4
4
  `+n+`
@@ -1 +1 @@
1
- import{c as V,D as L,j as n,B as J}from"./index-t6xY8FYJ.js";import{a as K,b as Q,T as W}from"./tooltip-CKRAIo8e.js";import{i as F}from"./XCircle-Dv-O5jd1.js";import{I as X,k as Y,i as Z,l as ee,s as te}from"./integration-icon-BlldxArX.js";import{s as se}from"./Plus-B_tfkXz3.js";import{C as le}from"./card-C_4nJrQs.js";import{g as ie}from"./registry-utils-q14xY1bA.js";function ne(l){if(!l.includes("/"))return l;const e=l.split("/"),i=e[0],s=e[1];if(!i||!s)return l;if(i.includes(".")){const a=i.split("."),r=a[a.length-1]||i,c=s.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!c||c.length<2?r:c}return s}function ae(l){const e=V.c(2),{protocol:i,className:s}=l;let a;return e[0]!==s?(a={http:n.jsx(te,{className:s}),sse:n.jsx(ee,{className:s}),stdio:n.jsx(Z,{className:s})},e[0]=s,e[1]=a):a=e[1],a[i]}function re(l){switch(l){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function ce(l){const e=V.c(9),{protocol:i}=l;let s;e[0]!==i?(s=L("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[i]),e[0]=i,e[1]=s):s=e[1];let a,r;e[2]!==i?(a=n.jsx(ae,{protocol:i,className:"w-3 h-3"}),r=re(i),e[2]=i,e[3]=a,e[4]=r):(a=e[3],r=e[4]);let c;return e[5]!==s||e[6]!==a||e[7]!==r?(c=n.jsxs("div",{className:s,children:[a,r]}),e[5]=s,e[6]=a,e[7]=r,e[8]=c):c=e[8],c}function oe(l){const e=V.c(73),{icon:i,displayName:s,description:a,onClick:r}=l,t=(l.variant??"store")==="server",m=t?l.hostname:null,f=t?l.protocol:null,x=t?l.isInstalling:!1,p=t?l.actionLabel:void 0,d=t?null:l.scopeName,o=t?!1:l.isVerified,u=t?!1:l.isOfficial,h=t?!0:l.canInstall,A=t?"p-4":"p-6";let g;e[0]!==A?(g=L("cursor-pointer hover:bg-muted/50 transition-colors",A),e[0]=A,e[1]=g):g=e[1];const G=t?"gap-3":"gap-4";let j;e[2]!==G?(j=L("flex flex-col h-full relative",G),e[2]=G,e[3]=j):j=e[3];const H=t?"sm":"md";let v;e[4]!==s||e[5]!==i||e[6]!==H?(v=n.jsx(X,{icon:i,name:s,size:H,className:"shadow-sm shrink-0"}),e[4]=s,e[5]=i,e[6]=H,e[7]=v):v=e[7];const U=t?"text-sm":"text-base";let N;e[8]!==U?(N=L("flex items-center gap-2 font-medium min-w-0",U),e[8]=U,e[9]=N):N=e[9];let b;e[10]!==s?(b=n.jsx("span",{className:"truncate",children:s}),e[10]=s,e[11]=b):b=e[11];let k;e[12]!==u||e[13]!==t?(k=!t&&u&&n.jsx(F,{size:16,className:"text-primary shrink-0"}),e[12]=u,e[13]=t,e[14]=k):k=e[14];let C;e[15]!==u||e[16]!==t||e[17]!==o?(C=!t&&!u&&o&&n.jsx(F,{size:16,className:"text-success shrink-0"}),e[15]=u,e[16]=t,e[17]=o,e[18]=C):C=e[18];let y;e[19]!==h||e[20]!==t?(y=!t&&!h&&n.jsx(Y,{size:16,className:"text-muted-foreground shrink-0"}),e[19]=h,e[20]=t,e[21]=y):y=e[21];let I;e[22]!==t||e[23]!==f?(I=t&&f&&n.jsx(ce,{protocol:f}),e[22]=t,e[23]=f,e[24]=I):I=e[24];let $;e[25]!==C||e[26]!==y||e[27]!==I||e[28]!==N||e[29]!==b||e[30]!==k?($=n.jsx(K,{asChild:!0,children:n.jsxs("div",{className:N,children:[b,k,C,y,I]})}),e[25]=C,e[26]=y,e[27]=I,e[28]=N,e[29]=b,e[30]=k,e[31]=$):$=e[31];let w;e[32]!==s?(w=n.jsx("p",{children:s}),e[32]=s,e[33]=w):w=e[33];let P;e[34]!==h||e[35]!==t?(P=!t&&!h&&n.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[34]=h,e[35]=t,e[36]=P):P=e[36];let S;e[37]!==w||e[38]!==P?(S=n.jsxs(Q,{children:[w,P]}),e[37]=w,e[38]=P,e[39]=S):S=e[39];let T;e[40]!==$||e[41]!==S?(T=n.jsxs(W,{children:[$,S]}),e[40]=$,e[41]=S,e[42]=T):T=e[42];let _;e[43]!==m||e[44]!==t||e[45]!==d?(_=(d||m)&&n.jsx("div",{className:L("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:d||m}),e[43]=m,e[44]=t,e[45]=d,e[46]=_):_=e[46];let D;e[47]!==T||e[48]!==_?(D=n.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:n.jsxs("div",{className:"min-w-0 flex-1",children:[T,_]})}),e[47]=T,e[48]=_,e[49]=D):D=e[49];let z;e[50]!==D||e[51]!==v?(z=n.jsxs("div",{className:"flex gap-3",children:[v,D]}),e[50]=D,e[51]=v,e[52]=z):z=e[52];let M;e[53]!==a?(M=a&&n.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:a}),e[53]=a,e[54]=M):M=e[54];let O;e[55]!==a||e[56]!==t?(O=!a&&!t&&n.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[55]=a,e[56]=t,e[57]=O):O=e[57];let B;e[58]!==p||e[59]!==x||e[60]!==t||e[61]!==r?(B=t&&n.jsxs(J,{variant:"outline",size:"sm",onClick:q=>{q.stopPropagation(),r()},disabled:x,className:"w-full mt-auto cursor-pointer",children:[n.jsx(se,{size:16}),x?"Connecting...":p||"Connect"]}),e[58]=p,e[59]=x,e[60]=t,e[61]=r,e[62]=B):B=e[62];let E;e[63]!==z||e[64]!==M||e[65]!==O||e[66]!==B||e[67]!==j?(E=n.jsxs("div",{className:j,children:[z,M,O,B]}),e[63]=z,e[64]=M,e[65]=O,e[66]=B,e[67]=j,e[68]=E):E=e[68];let R;return e[69]!==r||e[70]!==g||e[71]!==E?(R=n.jsx(le,{className:g,onClick:r,children:E}),e[69]=r,e[70]=g,e[71]=E,e[72]=R):R=e[72],R}function me(l){const e=l.server,i=l._meta?.["mcp.mesh"],s=i?.friendly_name||l.name||e?.title||l.title||l.id||"Unnamed Item",a=i?.short_description||i?.mesh_description||e?.description||l.description||null,r=e?.icons?.[0]?.src||ie(e?.repository)||null,c=i?.verified??!1,t=i?.official??!1,m=(e?.remotes?.length??0)>0,f=(e?.packages?.length??0)>0,x=m||f;let p=s,d=null;if(s.includes("/")){const o=s.split("/");o.length>=2&&(d=o[0]||null,p=ne(s))}if(!d){const o=i?.scopeName,u=i?.appName;o&&u?d=`${o}/${u}`:o&&(d=o)}return!d&&l.id?.includes("/")&&(d=l.id),i?.friendly_name&&(p=i.friendly_name),{icon:r,scopeName:d,displayName:p,description:a,isVerified:c,isOfficial:t,canInstall:x}}function ve(l){const e=V.c(19),{items:i,title:s,onItemClick:a}=l;let r,c,t,m,f;if(e[0]!==i||e[1]!==a||e[2]!==s){f=Symbol.for("react.early_return_sentinel");e:{const d=i.filter(de);if(d.length===0){f=null;break e}t="flex flex-col gap-4",e[8]!==s?(m=s&&n.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:n.jsx("h2",{className:"text-lg font-medium",children:s})}),e[8]=s,e[9]=m):m=e[9],r="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4";let o;e[10]!==a?(o=u=>{const h=me(u);return n.jsx(oe,{...h,onClick:()=>a(u)},u.id)},e[10]=a,e[11]=o):o=e[11],c=d.map(o)}e[0]=i,e[1]=a,e[2]=s,e[3]=r,e[4]=c,e[5]=t,e[6]=m,e[7]=f}else r=e[3],c=e[4],t=e[5],m=e[6],f=e[7];if(f!==Symbol.for("react.early_return_sentinel"))return f;let x;e[12]!==r||e[13]!==c?(x=n.jsx("div",{className:r,children:c}),e[12]=r,e[13]=c,e[14]=x):x=e[14];let p;return e[15]!==t||e[16]!==m||e[17]!==x?(p=n.jsxs("div",{className:t,children:[m,x]}),e[15]=t,e[16]=m,e[17]=x,e[18]=p):p=e[18],p}function de(l){return l!=null}export{ve as M,oe as a,ne as e};
1
+ import{c as V,D as L,j as n,B as J}from"./index-BjxqoU_w.js";import{a as K,b as Q,T as W}from"./tooltip-SqkLa6wk.js";import{i as F}from"./XCircle-DI9HiD4A.js";import{I as X,k as Y,i as Z,l as ee,s as te}from"./integration-icon-C9ac9VOj.js";import{s as se}from"./Plus-DcUxQQXw.js";import{C as le}from"./card-CoTaf7Bb.js";import{g as ie}from"./registry-utils-CVkiAvdy.js";function ne(l){if(!l.includes("/"))return l;const e=l.split("/"),i=e[0],s=e[1];if(!i||!s)return l;if(i.includes(".")){const a=i.split("."),r=a[a.length-1]||i,c=s.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!c||c.length<2?r:c}return s}function ae(l){const e=V.c(2),{protocol:i,className:s}=l;let a;return e[0]!==s?(a={http:n.jsx(te,{className:s}),sse:n.jsx(ee,{className:s}),stdio:n.jsx(Z,{className:s})},e[0]=s,e[1]=a):a=e[1],a[i]}function re(l){switch(l){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function ce(l){const e=V.c(9),{protocol:i}=l;let s;e[0]!==i?(s=L("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[i]),e[0]=i,e[1]=s):s=e[1];let a,r;e[2]!==i?(a=n.jsx(ae,{protocol:i,className:"w-3 h-3"}),r=re(i),e[2]=i,e[3]=a,e[4]=r):(a=e[3],r=e[4]);let c;return e[5]!==s||e[6]!==a||e[7]!==r?(c=n.jsxs("div",{className:s,children:[a,r]}),e[5]=s,e[6]=a,e[7]=r,e[8]=c):c=e[8],c}function oe(l){const e=V.c(73),{icon:i,displayName:s,description:a,onClick:r}=l,t=(l.variant??"store")==="server",m=t?l.hostname:null,f=t?l.protocol:null,x=t?l.isInstalling:!1,p=t?l.actionLabel:void 0,d=t?null:l.scopeName,o=t?!1:l.isVerified,u=t?!1:l.isOfficial,h=t?!0:l.canInstall,A=t?"p-4":"p-6";let g;e[0]!==A?(g=L("cursor-pointer hover:bg-muted/50 transition-colors",A),e[0]=A,e[1]=g):g=e[1];const G=t?"gap-3":"gap-4";let j;e[2]!==G?(j=L("flex flex-col h-full relative",G),e[2]=G,e[3]=j):j=e[3];const H=t?"sm":"md";let v;e[4]!==s||e[5]!==i||e[6]!==H?(v=n.jsx(X,{icon:i,name:s,size:H,className:"shadow-sm shrink-0"}),e[4]=s,e[5]=i,e[6]=H,e[7]=v):v=e[7];const U=t?"text-sm":"text-base";let N;e[8]!==U?(N=L("flex items-center gap-2 font-medium min-w-0",U),e[8]=U,e[9]=N):N=e[9];let b;e[10]!==s?(b=n.jsx("span",{className:"truncate",children:s}),e[10]=s,e[11]=b):b=e[11];let k;e[12]!==u||e[13]!==t?(k=!t&&u&&n.jsx(F,{size:16,className:"text-primary shrink-0"}),e[12]=u,e[13]=t,e[14]=k):k=e[14];let C;e[15]!==u||e[16]!==t||e[17]!==o?(C=!t&&!u&&o&&n.jsx(F,{size:16,className:"text-success shrink-0"}),e[15]=u,e[16]=t,e[17]=o,e[18]=C):C=e[18];let y;e[19]!==h||e[20]!==t?(y=!t&&!h&&n.jsx(Y,{size:16,className:"text-muted-foreground shrink-0"}),e[19]=h,e[20]=t,e[21]=y):y=e[21];let I;e[22]!==t||e[23]!==f?(I=t&&f&&n.jsx(ce,{protocol:f}),e[22]=t,e[23]=f,e[24]=I):I=e[24];let $;e[25]!==C||e[26]!==y||e[27]!==I||e[28]!==N||e[29]!==b||e[30]!==k?($=n.jsx(K,{asChild:!0,children:n.jsxs("div",{className:N,children:[b,k,C,y,I]})}),e[25]=C,e[26]=y,e[27]=I,e[28]=N,e[29]=b,e[30]=k,e[31]=$):$=e[31];let w;e[32]!==s?(w=n.jsx("p",{children:s}),e[32]=s,e[33]=w):w=e[33];let P;e[34]!==h||e[35]!==t?(P=!t&&!h&&n.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[34]=h,e[35]=t,e[36]=P):P=e[36];let S;e[37]!==w||e[38]!==P?(S=n.jsxs(Q,{children:[w,P]}),e[37]=w,e[38]=P,e[39]=S):S=e[39];let T;e[40]!==$||e[41]!==S?(T=n.jsxs(W,{children:[$,S]}),e[40]=$,e[41]=S,e[42]=T):T=e[42];let _;e[43]!==m||e[44]!==t||e[45]!==d?(_=(d||m)&&n.jsx("div",{className:L("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:d||m}),e[43]=m,e[44]=t,e[45]=d,e[46]=_):_=e[46];let D;e[47]!==T||e[48]!==_?(D=n.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:n.jsxs("div",{className:"min-w-0 flex-1",children:[T,_]})}),e[47]=T,e[48]=_,e[49]=D):D=e[49];let z;e[50]!==D||e[51]!==v?(z=n.jsxs("div",{className:"flex gap-3",children:[v,D]}),e[50]=D,e[51]=v,e[52]=z):z=e[52];let M;e[53]!==a?(M=a&&n.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:a}),e[53]=a,e[54]=M):M=e[54];let O;e[55]!==a||e[56]!==t?(O=!a&&!t&&n.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[55]=a,e[56]=t,e[57]=O):O=e[57];let B;e[58]!==p||e[59]!==x||e[60]!==t||e[61]!==r?(B=t&&n.jsxs(J,{variant:"outline",size:"sm",onClick:q=>{q.stopPropagation(),r()},disabled:x,className:"w-full mt-auto cursor-pointer",children:[n.jsx(se,{size:16}),x?"Connecting...":p||"Connect"]}),e[58]=p,e[59]=x,e[60]=t,e[61]=r,e[62]=B):B=e[62];let E;e[63]!==z||e[64]!==M||e[65]!==O||e[66]!==B||e[67]!==j?(E=n.jsxs("div",{className:j,children:[z,M,O,B]}),e[63]=z,e[64]=M,e[65]=O,e[66]=B,e[67]=j,e[68]=E):E=e[68];let R;return e[69]!==r||e[70]!==g||e[71]!==E?(R=n.jsx(le,{className:g,onClick:r,children:E}),e[69]=r,e[70]=g,e[71]=E,e[72]=R):R=e[72],R}function me(l){const e=l.server,i=l._meta?.["mcp.mesh"],s=i?.friendly_name||l.name||e?.title||l.title||l.id||"Unnamed Item",a=i?.short_description||i?.mesh_description||e?.description||l.description||null,r=e?.icons?.[0]?.src||ie(e?.repository)||null,c=i?.verified??!1,t=i?.official??!1,m=(e?.remotes?.length??0)>0,f=(e?.packages?.length??0)>0,x=m||f;let p=s,d=null;if(s.includes("/")){const o=s.split("/");o.length>=2&&(d=o[0]||null,p=ne(s))}if(!d){const o=i?.scopeName,u=i?.appName;o&&u?d=`${o}/${u}`:o&&(d=o)}return!d&&l.id?.includes("/")&&(d=l.id),i?.friendly_name&&(p=i.friendly_name),{icon:r,scopeName:d,displayName:p,description:a,isVerified:c,isOfficial:t,canInstall:x}}function ve(l){const e=V.c(19),{items:i,title:s,onItemClick:a}=l;let r,c,t,m,f;if(e[0]!==i||e[1]!==a||e[2]!==s){f=Symbol.for("react.early_return_sentinel");e:{const d=i.filter(de);if(d.length===0){f=null;break e}t="flex flex-col gap-4",e[8]!==s?(m=s&&n.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:n.jsx("h2",{className:"text-lg font-medium",children:s})}),e[8]=s,e[9]=m):m=e[9],r="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4";let o;e[10]!==a?(o=u=>{const h=me(u);return n.jsx(oe,{...h,onClick:()=>a(u)},u.id)},e[10]=a,e[11]=o):o=e[11],c=d.map(o)}e[0]=i,e[1]=a,e[2]=s,e[3]=r,e[4]=c,e[5]=t,e[6]=m,e[7]=f}else r=e[3],c=e[4],t=e[5],m=e[6],f=e[7];if(f!==Symbol.for("react.early_return_sentinel"))return f;let x;e[12]!==r||e[13]!==c?(x=n.jsx("div",{className:r,children:c}),e[12]=r,e[13]=c,e[14]=x):x=e[14];let p;return e[15]!==t||e[16]!==m||e[17]!==x?(p=n.jsxs("div",{className:t,children:[m,x]}),e[15]=t,e[16]=m,e[17]=x,e[18]=p):p=e[18],p}function de(l){return l!=null}export{ve as M,oe as a,ne as e};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-t6xY8FYJ.js","assets/index-j1ZaalMw.css","assets/index-D9tlV5w6.js","assets/use-collections-CLlnuJpl.js","assets/useMutation-Bncnalv9.js","assets/constants-C2NIYyeK.js","assets/use-connection-DSXGpH93.js","assets/use-mcp-tools-Ca8lRrYA.js","assets/useQuery-CIPIMOb2.js","assets/use-mcp-resources-BWxiCCmX.js","assets/use-mcp-prompts-DSysuR0s.js","assets/use-virtual-mcp-D5bKIffF.js","assets/decopilot-events-Brt4gAR6.js","assets/usage-BW6ztpN6.js"])))=>i.map(i=>d[i]);
2
- import{c as F,j as t,r as Z,B as ie,v as oe,D as Qe,K as ae,bT as xe,u as Me,e as Re,O as de,g as Ye,d as Je,z as Xe,w as Ze,f as et,G as tt,i as st,a as rt}from"./index-t6xY8FYJ.js";import{i as nt}from"./AlertCircle-CwQ-M1BH.js";import{i as ge}from"./Loading01-CKkwknOS.js";import{S as ot,I as Ee,i as it,l as at,s as lt,G as ct}from"./integration-icon-BlldxArX.js";import{P as he,u as dt}from"./index-1_kpvnU4.js";import{c as mt,T as ut,a as ft,b as pt}from"./tooltip-CKRAIo8e.js";import{i as ht}from"./Check-wCq9US95.js";import{c as xt}from"./Play-B44HkfJ8.js";import{c as gt,n as Ce}from"./XCircle-Dv-O5jd1.js";import{t as vt}from"./ChevronDown-C4UuUfvP.js";import{s as Se}from"./Plus-B_tfkXz3.js";import{a as bt,c as yt,b as jt,D as Nt}from"./dropdown-menu-5AX5yqCQ.js";import{E as wt}from"./empty-state-C_h_kfhM.js";import{u as me}from"./useQuery-CIPIMOb2.js";import{c as Ct}from"./VideoRecorder-b8m_Ituf.js";import{j as Ae,u as St,f as _t,k as _e,b as kt,l as It,g as Tt}from"./registry-utils-q14xY1bA.js";import{m as ke}from"./marked.esm-BaswSlok.js";import{a as Lt}from"./tools-list-BYjVtR4b.js";import{C as Pt}from"./collection-tabs-BZp_rh35.js";import{a as Mt,e as Rt}from"./mcp-server-card-CbbQ9zmv.js";import{B as Et,a as At,b as Ie,d as Dt,e as $t,c as Ut}from"./breadcrumb-BjaszutD.js";import{a as Vt,b as Bt,u as zt}from"./use-connection-DSXGpH93.js";import{u as Ft}from"./constants-C2NIYyeK.js";import{u as Ot}from"./use-mcp-tools-Ca8lRrYA.js";import{e as Ht}from"./extract-connection-data-BJKmDa-6.js";import{s as Gt}from"./slugify-CEUa2lfQ.js";import"./Container-OKF_GeCq.js";import"./ArrowUp-C8UJr_8S.js";import"./ArrowLeft-7hoUFjWA.js";import"./Type01-DmSAzri2.js";import"./ChevronRight-8vS2LfiE.js";import"./ChevronUp-eUIC7wig.js";import"./RefreshCcw01-Dd-MCL9x.js";import"./Dataflow03-CYOanaoD.js";import"./Download01-D6Ut3-TC.js";import"./List-Dm7hE_p7.js";import"./FolderClosed-DWPM1ogz.js";import"./Grid01-CFCqtKvs.js";import"./SearchMd-DwH-zFLD.js";import"./Settings01-Cc_jPdtk.js";import"./Trash01-DFCUs2vM.js";import"./Upload01-B4UOm_Kf.js";import"./User01-a2C2h2ws.js";import"./XClose-DXhO2ZT2.js";import"./X-CVr_hKcl.js";import"./Zap-D6ZQZPYh.js";import"./useMutation-Bncnalv9.js";import"./index-BKuN2Iot.js";import"./binder-1tH_sZqU.js";import"./collection-display-button-07J7hFqi.js";import"./badge-C9kSd2rC.js";import"./collection-search-C014T-nI.js";import"./input-qMconvxq.js";import"./collection-table-wrapper-1AJGYm4t.js";import"./table-CvLgTwxu.js";import"./card-C_4nJrQs.js";import"./types-CEJbDNRj.js";import"./layout-D0kNFrGz.js";import"./use-collections-CLlnuJpl.js";import"./generate-id-Dz9QYszT.js";function qt(r){return r.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function Kt(r){return r.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,s)=>{let n=e;return s.includes("target=")?n=n.replace(/target="[^"]*"/gi,'target="_blank"'):n=n.replace(/>/,' target="_blank">'),s.includes("rel=")?n=n.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):n=n.replace(/>/,' rel="noopener noreferrer">'),n})}function Wt(r){let e=qt(r);return e=Kt(e),e}async function Qt(r,e){try{const s=await fetch(`https://api.github.com/repos/${r}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!s.ok){if(s.status===404)return null;throw new Error(`Failed to fetch README: ${s.statusText}`)}const n=await s.text();return Wt(n)}catch(s){return console.error("Error fetching README:",s),null}}function Yt(r){const e=F.c(3),{message:s}=r,n=s===void 0?"Loading MCP Server details...":s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ge,{size:48,className:"animate-spin mb-4"}),e[0]=o):o=e[0];let a;return e[1]!==n?(a=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,t.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=a):a=e[2],a}function Jt(r){const e=F.c(9),{error:s,onBack:n}=r,o=s instanceof Error?s.message:s;let a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(nt,{size:48,className:"text-destructive mb-4"}),l=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=a,e[1]=l):(a=e[0],l=e[1]);let m;e[2]!==o?(m=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:o}),e[2]=o,e[3]=m):m=e[3];let c;e[4]!==n?(c=t.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=c):c=e[5];let d;return e[6]!==m||e[7]!==c?(d=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[a,l,m,c]}),e[6]=m,e[7]=c,e[8]=d):d=e[8],d}function Xt(r){const e=F.c(5),{onBack:s}=r;let n,o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ot,{size:48,className:"text-muted-foreground mb-4"}),o=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),a=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=n,e[1]=o,e[2]=a):(n=e[0],o=e[1],a=e[2]);let l;return e[3]!==s?(l=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,o,a,t.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=s,e[4]=l):l=e[4],l}function Zt(r){const e=F.c(11),{breadcrumb:s,shareUrl:n}=r,[o,a]=Z.useState(!1);let l;e[0]!==n?(l=async()=>{n&&(await navigator.clipboard.writeText(n),a(!0),oe.success("Share link copied to clipboard"),setTimeout(()=>a(!1),2e3))},e[0]=n,e[1]=l):l=e[1];const m=l;let c;e[2]!==s?(c=t.jsx(he.Header.Left,{children:s}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==o||e[5]!==m||e[6]!==n?(d=n&&t.jsx(he.Header.Right,{children:t.jsx(mt,{children:t.jsxs(ut,{children:[t.jsx(ft,{asChild:!0,children:t.jsxs(ie,{variant:"outline",size:"sm",onClick:m,className:"gap-1.5 cursor-pointer",children:[o?t.jsx(ht,{size:16,className:"text-green-600"}):t.jsx(xt,{size:16}),t.jsx("span",{children:o?"Copied!":"Share"})]})}),t.jsx(pt,{children:t.jsx("p",{children:"Copy a universal link anyone can use to find this MCP"})})]})})}),e[4]=o,e[5]=m,e[6]=n,e[7]=d):d=e[7];let v;return e[8]!==c||e[9]!==d?(v=t.jsxs(he.Header,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=v):v=e[10],v}function Te(r){const e=F.c(28),{versions:s,selectedIndex:n,onSelect:o,isInstalling:a,variant:l,showLabel:m}=r,c=a===void 0?!1:a,d=l===void 0?"default":l,v=m===void 0?!1:m,p=s[n],_=v?"sm":"default",f=d==="default"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let g;e[0]!==f?(g=Qe("shrink-0 cursor-pointer",f),e[0]=f,e[1]=g):g=e[1];let h;e[2]!==p?.server?.version||e[3]!==v?(h=v&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=v,e[4]=h):h=e[4];const b=v?14:20;let x;e[5]!==b?(x=t.jsx(vt,{size:b}),e[5]=b,e[6]=x):x=e[6];let u;e[7]!==c||e[8]!==_||e[9]!==g||e[10]!==h||e[11]!==x||e[12]!==d?(u=t.jsx(bt,{asChild:!0,children:t.jsxs(ie,{variant:d,disabled:c,size:_,className:g,children:[h,x]})}),e[7]=c,e[8]=_,e[9]=g,e[10]=h,e[11]=x,e[12]=d,e[13]=u):u=e[13];let j;if(e[14]!==c||e[15]!==o||e[16]!==n||e[17]!==s){let I;e[19]!==c||e[20]!==o||e[21]!==n?(I=(S,k)=>{const E=S._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(yt,{onClick:()=>o(k),disabled:c,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),E?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),k===n&&t.jsx(gt,{size:16,className:"text-muted-foreground shrink-0"})]})},k)},e[19]=c,e[20]=o,e[21]=n,e[22]=I):I=e[22],j=s.map(I),e[14]=c,e[15]=o,e[16]=n,e[17]=s,e[18]=j}else j=e[18];let N;e[23]!==j?(N=t.jsx(jt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:j}),e[23]=j,e[24]=N):N=e[24];let L;return e[25]!==u||e[26]!==N?(L=t.jsxs(Nt,{children:[u,N]}),e[25]=u,e[26]=N,e[27]=L):L=e[27],L}function es(r){const e=F.c(46),{data:s,itemVersions:n,onInstall:o,canInstall:a,isInstalling:l,hideInstallControls:m,selectedVersionIndex:c,onVersionChange:d}=r,v=a===void 0?!0:a,p=l===void 0?!1:l,_=m===void 0?!1:m,[f,g]=Z.useState(0),h=c??f;let b;e[0]!==d?(b=P=>{g(P),d?.(P)},e[0]=d,e[1]=b):b=e[1];const x=b,u=n[h]||n[0];let j;e[2]!==u?.server?.remotes?(j=u?.server?.remotes??[],e[2]=u?.server?.remotes,e[3]=j):j=e[3];const N=j;let L;e[4]!==u?.server?.packages?(L=u?.server?.packages??[],e[4]=u?.server?.packages,e[5]=L):L=e[5];const S=L.length>0,k=N.length>0,E=N.findIndex(ss),y=E>=0?E:0;let Y;e[6]!==y||e[7]!==S||e[8]!==k||e[9]!==o||e[10]!==h?(Y=()=>{k?o(h,y,void 0):S&&o(h,void 0,0)},e[6]=y,e[7]=S,e[8]=k,e[9]=o,e[10]=h,e[11]=Y):Y=e[11];const R=Y;let $;e[12]!==n||e[13]!==o||e[14]!==x?($=P=>{x(P);const H=n[P],W=H?.server?.remotes??[],q=H?.server?.packages??[];if(W.length>0){const se=W.findIndex(ts);o(P,se>=0?se:0,void 0)}else q.length>0&&o(P,void 0,0)},e[12]=n,e[13]=o,e[14]=x,e[15]=$):$=e[15];const J=$;let C;e[16]!==s.icon||e[17]!==s.name?(C=t.jsx(Ee,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=C):C=e[18];let A;e[19]!==s.name?(A=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=A):A=e[20];let U;e[21]!==s.verified?(U=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=U):U=e[22];let z;e[23]!==A||e[24]!==U?(z=t.jsxs("div",{className:"flex items-center gap-2",children:[A,U]}),e[23]=A,e[24]=U,e[25]=z):z=e[25];let O;e[26]!==s.shortDescription?(O=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=O):O=e[27];let V;e[28]!==z||e[29]!==O?(V=t.jsxs("div",{className:"flex-1 min-w-0",children:[z,O]}),e[28]=z,e[29]=O,e[30]=V):V=e[30];let T;e[31]!==v||e[32]!==R||e[33]!==J||e[34]!==_||e[35]!==p||e[36]!==n||e[37]!==h||e[38]!==x?(T=v&&!_?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:n.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(ie,{variant:"default",size:"sm",onClick:R,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(Se,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(Te,{versions:n,selectedIndex:h,onSelect:J,isInstalling:p,variant:"outline"})]}):t.jsxs(ie,{variant:"default",size:"sm",onClick:R,disabled:n.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(Se,{size:20}),p?"Connecting...":"Connect"]})}):_?n.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(Te,{versions:n,selectedIndex:h,onSelect:x,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=v,e[32]=R,e[33]=J,e[34]=_,e[35]=p,e[36]=n,e[37]=h,e[38]=x,e[39]=T):T=e[39];let w;e[40]!==V||e[41]!==T?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[V,T]}),e[40]=V,e[41]=T,e[42]=w):w=e[42];let B;return e[43]!==w||e[44]!==C?(B=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[C,w]}),e[43]=w,e[44]=C,e[45]=B):B=e[45],B}function ts(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function ss(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function rs(r){if(!r)return"—";try{const e=new Date(r);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ns(r){const e=F.c(47),{data:s,publisherInfo:n,selectedItem:o}=r;let a;e[0]!==s.description?(a=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=a):a=e[1];const l=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let m;e[2]!==n.logo||e[3]!==l?(m=t.jsx(Ee,{icon:n.logo,name:l,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=l,e[4]=m):m=e[4];let c;e[5]!==s.publisher?(c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=c):c=e[6];let d;e[7]!==c?(d=t.jsx("div",{className:"font-medium",children:c}),e[7]=c,e[8]=d):d=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=v):v=e[9];let p;e[10]!==d?(p=t.jsxs("div",{children:[d,v]}),e[10]=d,e[11]=p):p=e[11];let _;e[12]!==m||e[13]!==p?(_=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[m,p]})}),e[12]=m,e[13]=p,e[14]=_):_=e[14];let f;e[15]!==s.version?(f=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=f):f=e[16];let g;e[17]!==s.tags?(g=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(is)})]}),e[17]=s.tags,e[18]=g):g=e[18];let h;e[19]!==s.categories?(h=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(os)})]}),e[19]=s.categories,e[20]=h):h=e[20];let b;e[21]!==s.connectionType?(b=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=b):b=e[22];let x;e[23]!==s.schemaVersion?(x=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=x):x=e[24];let u;e[25]!==s.websiteUrl?(u=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(Ce,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=u):u=e[26];let j;e[27]!==s.repository?(j=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(Ce,{size:14})]})]}),e[27]=s.repository,e[28]=j):j=e[28];let N;e[29]!==g||e[30]!==h||e[31]!==b||e[32]!==x||e[33]!==u||e[34]!==j||e[35]!==f?(N=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[f,g,h,b,x,u,j]}),e[29]=g,e[30]=h,e[31]=b,e[32]=x,e[33]=u,e[34]=j,e[35]=f,e[36]=N):N=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=L):L=e[37];let I;e[38]!==o.updated_at?(I=rs(o.updated_at),e[38]=o.updated_at,e[39]=I):I=e[39];let S;e[40]!==I?(S=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[L,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:I})]}),e[40]=I,e[41]=S):S=e[41];let k;return e[42]!==a||e[43]!==N||e[44]!==S||e[45]!==_?(k=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[a,_,N,S]}),e[42]=a,e[43]=N,e[44]=S,e[45]=_,e[46]=k):k=e[46],k}function os(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function is(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function Le(r){const e=F.c(18),{repository:s,html:n,isLoading:o,queryKey:a}=r;let l,m,c,d;e[0]!==n||e[1]!==a||e[2]!==s?(l=s?Ae(s):null,m=!!l&&n===void 0,d=me,c=a??ae.githubReadme(l?.owner,l?.repo),e[0]=n,e[1]=a,e[2]=s,e[3]=l,e[4]=m,e[5]=c,e[6]=d):(l=e[3],m=e[4],c=e[5],d=e[6]);let v;e[7]!==l?(v=async()=>l?Qt(l.owner,l.repo):null,e[7]=l,e[8]=v):v=e[8];let p;e[9]!==m||e[10]!==c||e[11]!==v?(p={queryKey:c,queryFn:v,enabled:m,staleTime:36e5,gcTime:864e5},e[9]=m,e[10]=c,e[11]=v,e[12]=p):p=e[12];const{data:_,isLoading:f}=d(p),g=n??_;if(o??(m&&f)){let u;return e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=u):u=e[13],u}if(!g){let u;return e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(Ct,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=u):u=e[14],u}let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b={backgroundColor:"transparent"},e[15]=b):b=e[15];let x;return e[16]!==g?(x=t.jsx("div",{className:"p-5 markdown-body",style:b,dangerouslySetInnerHTML:{__html:g}}),e[16]=g,e[17]=x):x=e[17],x}const as=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],ls={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function cs(r){if(!r)return"Local";try{return new URL(r).hostname}catch{return r}}function ds(r){if(!r)return"local";try{const e=new URL(r).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function ms(r){const e=ls[r.toLowerCase()];return e||r.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function us(r){if(!r)return"http";const e=r.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function fs(r){return r.map((e,s)=>{const n=us(e.type),o=cs(e.url),a=ds(e.url),l=e.title||e.name||ms(a);return{index:s,protocol:n,url:e.url,hostname:o,serviceName:a,displayName:l,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function ps(r){const e=F.c(2),{protocol:s,className:n}=r;let o;return e[0]!==n?(o={http:t.jsx(lt,{className:n}),sse:t.jsx(at,{className:n}),stdio:t.jsx(it,{className:n})},e[0]=n,e[1]=o):o=e[1],o[s]}function hs(r){const e=F.c(10),{options:s,selected:n,onSelect:o}=r;if(s.length<=1)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=a):a=e[0];let l;if(e[1]!==o||e[2]!==s||e[3]!==n){let c;e[5]!==o||e[6]!==n?(c=d=>t.jsxs(ie,{variant:n===d.value?"default":"outline",size:"sm",onClick:()=>o(d.value),className:"cursor-pointer",children:[t.jsx(ps,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=o,e[6]=n,e[7]=c):c=e[7],l=s.map(c),e[1]=o,e[2]=s,e[3]=n,e[4]=l}else l=e[4];let m;return e[8]!==l?(m=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a,t.jsx("div",{className:"flex gap-1",children:l})]}),e[8]=l,e[9]=m):m=e[9],m}function xs(r){const e=F.c(11),{servers:s,onInstall:n,isInstalling:o,icon:a,mcpName:l,showStdio:m}=r,c=o===void 0?!1:o,d=m===void 0?!1:m,v=d?s:s.filter(ys),p=fs(v),_=p.length<13?"all":"http",[f,g]=Z.useState(_);let h;e:{if(f==="all"){h="all";break e}let y;if(e[0]!==f?(y=R=>R.protocol===f,e[0]=f,e[1]=y):y=e[1],p.some(y)){h=f;break e}if(p.length<13){h="all";break e}h=p[0]?.protocol??"http"}const b=h,x=b==="all"?p:p.filter(y=>y.protocol===b),u=new Set(p.map(bs));let j=as.filter(y=>y.value==="all"||u.has(y.value));d||(j=j.filter(vs));const N=u.size<=1?j.filter(gs):j,L="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let I;e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==n?(I=y=>t.jsx(Mt,{variant:"server",icon:a??null,displayName:y.displayName,description:y.description??null,hostname:y.hostname,protocol:y.protocol,isInstalling:c,onClick:()=>n({type:y.protocol,url:y.url,name:y.name,title:y.title,description:y.description,_type:y._type,_index:y._index})},`${y.hostname}-${y.protocol}-${y.index}`),e[2]=a,e[3]=c,e[4]=l,e[5]=n,e[6]=I):I=e[6];const S=x.map(I);let k;e[7]!==S?(k=t.jsx("div",{className:L,children:S}),e[7]=S,e[8]=k):k=e[8];let E;return e[9]!==x.length?(E=x.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=x.length,e[10]=E):E=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(hs,{options:N,selected:b,onSelect:g}),k,E]})}function gs(r){return r.value!=="all"}function vs(r){return r.value!=="stdio"}function bs(r){return r.protocol}function ys(r){return r.type?.toLowerCase()!=="stdio"}async function Pe(r){return(await xe(async()=>{const{default:s}=await import("./purify.es-CovBOfck.js");return{default:s}},[])).default.sanitize(r,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form"],FORBID_ATTR:["style"]})}function js(r){const e=F.c(53),{data:s,availableTabs:n,effectiveActiveTabId:o,effectiveTools:a,isLoadingTools:l,onTabChange:m,servers:c,onInstallServer:d,isInstalling:v,mcpIcon:p,mcpName:_,showStdio:f}=r,g=l===void 0?!1:l;let h;e[0]!==c?(h=c===void 0?[]:c,e[0]=c,e[1]=h):h=e[1];const b=h,x=v===void 0?!1:v,u=f===void 0?!1:f;let j;e[2]!==s.readmeMarkdown?(j=s.readmeMarkdown?.trim(),e[2]=s.readmeMarkdown,e[3]=j):j=e[3];const N=!!j;let L;e[4]!==s.readmeUrl?(L=s.readmeUrl?.trim(),e[4]=s.readmeUrl,e[5]=L):L=e[5];const I=!!L;let S;e[6]!==s.readmeMarkdown?(S=ae.storeReadmeUrl(`embedded:${s.readmeMarkdown}`),e[6]=s.readmeMarkdown,e[7]=S):S=e[7];let k;e[8]!==s.readmeMarkdown?(k=async()=>{const q=ke.parse(s.readmeMarkdown??"",{async:!1});return Pe(q)},e[8]=s.readmeMarkdown,e[9]=k):k=e[9];let E;e[10]!==N||e[11]!==S||e[12]!==k?(E={queryKey:S,queryFn:k,enabled:N,staleTime:1/0},e[10]=N,e[11]=S,e[12]=k,e[13]=E):E=e[13];const{data:y,isLoading:Y}=me(E);let R;e[14]!==s.readmeUrl?(R=ae.storeReadmeUrl(s.readmeUrl),e[14]=s.readmeUrl,e[15]=R):R=e[15];let $;e[16]!==s.readmeUrl?($=async()=>{if(!s.readmeUrl)return null;const q=await fetch(s.readmeUrl);if(!q.ok)throw new Error(`Failed to fetch README (${q.status})`);const te=await q.text();return Pe(ke.parse(te,{async:!1}))},e[16]=s.readmeUrl,e[17]=$):$=e[17];const J=I&&!N;let C;e[18]!==R||e[19]!==$||e[20]!==J?(C={queryKey:R,queryFn:$,enabled:J,staleTime:36e5,gcTime:864e5},e[18]=R,e[19]=$,e[20]=J,e[21]=C):C=e[21];const{data:A,isLoading:U}=me(C),z=y??A??null,O=N&&Y||!N&&U;let V;e[22]!==a?(V=a.map(Ns),e[22]=a,e[23]=V):V=e[23];const T=V;let w;e[24]!==n||e[25]!==o||e[26]!==m?(w=n.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(Pt,{tabs:n,activeTab:o,onTabChange:m})}),e[24]=n,e[25]=o,e[26]=m,e[27]=w):w=e[27];let B;e[28]!==o||e[29]!==x||e[30]!==p||e[31]!==_||e[32]!==d||e[33]!==b||e[34]!==u?(B=o==="servers"&&b.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(xs,{servers:b,onInstall:q=>d?.(q),isInstalling:x,icon:p,mcpName:_,showStdio:u})}),e[28]=o,e[29]=x,e[30]=p,e[31]=_,e[32]=d,e[33]=b,e[34]=u,e[35]=B):B=e[35];let P;e[36]!==o||e[37]!==a.length||e[38]!==g||e[39]!==T?(P=o==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:g?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ge,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):a.length>0?t.jsx(Lt,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(wt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[36]=o,e[37]=a.length,e[38]=g,e[39]=T,e[40]=P):P=e[40];let H;e[41]!==z||e[42]!==O||e[43]!==s.repository||e[44]!==o||e[45]!==N||e[46]!==I?(H=o==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:N||I?t.jsx(Le,{html:z,isLoading:O}):t.jsx(Le,{repository:s?.repository})}),e[41]=z,e[42]=O,e[43]=s.repository,e[44]=o,e[45]=N,e[46]=I,e[47]=H):H=e[47];let W;return e[48]!==w||e[49]!==B||e[50]!==P||e[51]!==H?(W=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[w,B,P,H]}),e[48]=w,e[49]=B,e[50]=P,e[51]=H,e[52]=W):W=e[52],W}function Ns(r){const e=r;return{name:e.name||"",description:e.description||void 0}}function ws(r,e){if(!r||!e)return;const s=e.toLowerCase();return r.find(n=>n.app_name?.toLowerCase()===s||n.app_id?.toLowerCase()===s||n.title.toLowerCase()===s)||r.find(n=>n.title.toLowerCase().includes(s))}function Cs(r,e,s,n,o){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:o??r.length};const a=e.toLowerCase(),l=r.filter(c=>(c._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":c.publisher||c._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===a);return{logo:s?.icon||l[0]?.publisher_logo||l[0]?.icon||void 0,count:l.length}}function Ss(r){const e=r._meta?.["mcp.mesh"],s=r._meta?.["io.modelcontextprotocol.registry/official"],n=r.server??{},o=kt(n?.remotes?.[0]?.type),a=It(n?.$schema),l=r.id?.includes("/")?r.id.split("/")[0]:void 0,m=s?"io.modelcontextprotocol.registry/official":r.publisher||e?.scopeName||l||"Unknown",c=Tt(n.repository),d=r.icon||r.image||r.logo||n.icons?.[0]?.src||c||null,v=r.name||r.title||r.server?.title||"Unnamed Item",p=Rt(v),_=e?.friendly_name||p,f=e?.mesh_description||r.description||r.summary||n?.description||"",g=e?.short_description||null,h=typeof e?.readme=="string"?e.readme:null,b=typeof e?.readme_url=="string"?e.readme_url:null,x=e?.tags||[],u=e?.categories||[];return{name:_,description:f,shortDescription:g,readmeMarkdown:h,readmeUrl:b,icon:d,verified:r.verified||e?.verified,publisher:m,version:n.version||null,websiteUrl:n.websiteUrl||null,repository:n.repository||null,schemaVersion:a??null,connectionType:o,connectionUrl:n?.remotes?.[0]?.url||null,remoteUrl:n?.remotes?.[0]?.url||null,tags:x,categories:u,tools:r.tools||n.tools||e?.tools||[],models:r.models||n.models||e?.models||[],emails:r.emails||n.emails||e?.emails||[],analytics:r.analytics||n.analytics||e?.analytics,cdn:r.cdn||n.cdn||e?.cdn}}class _s extends Z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(Jt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ks(){const{org:r}=Me(),e=Re(),{appName:s}=Ye({strict:!1}),{registryId:n,serverName:o,stdio:a}=Je({strict:!1}),[l,m]=dt(Xe.storeShowStdio(),()=>!1),c=a==="true"?!0:a==="false"?!1:l;a!==void 0&&a==="true"!==l&&m(a==="true");const[d,v]=Z.useState(null),[p,_]=Z.useState(null),[f,g]=Z.useState(null),[h,b]=Z.useState(!1),x=Ze(),u=Vt(),j=Bt(),{data:N}=et.useSession(),L=St(j),I=n||L[0]?.id||"",S=zt(I),k=_t(S?.tools),E=_e(S?.tools??null,"_VERSIONS"),y=_e(S?.tools??null,"_GET"),Y=!!o;let R="",$={};Y?(R=E||y,$={name:o}):(R=k,$={});const J=Ft({connectionId:I||null,orgId:r.id}),{data:C}=Ot({client:J,toolName:R,toolArguments:$,select:i=>i.structuredContent??i});let A=[],U=[],z=null;if(C){if(Array.isArray(C))A=C;else if(typeof C=="object"&&C!==null)if("totalCount"in C&&typeof C.totalCount=="number"&&(z=C.totalCount),"item"in C&&C.item){const i=C.item;A=[{id:i.id||"",title:i.title,server:i.server,_meta:i._meta}]}else{let i;"versions"in C&&Array.isArray(C.versions)?i="versions":"servers"in C&&Array.isArray(C.servers)?i="servers":i=Object.keys(C).find(M=>Array.isArray(C[M])),i&&(A=C[i],(i==="versions"||R?.includes("VERSIONS"))&&(U=A))}}const O=(()=>{const i=U.findIndex(M=>M._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return i>=0?i:0})(),V=p??O;let T=A.find(i=>{const M=i.name||i.title||i.server?.title||"";return Gt(M)===s});!T&&o&&(T=A.find(i=>i.id===o||i.server?.name===o||i.name===o||i.title===o));const w=T?Ss(T):null,B=(w?.tools?.length||0)>0,P=T?.server?.remotes?.[0]?.url||null,H=!B&&!!P,W=me({queryKey:ae.remoteMcpTools(P),queryFn:async()=>{if(!P)return[];const{Client:i}=await xe(async()=>{const{Client:X}=await import("./index-t6xY8FYJ.js").then(D=>D.cY);return{Client:X}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:M}=await xe(async()=>{const{StreamableHTTPClientTransport:X}=await import("./index-D9tlV5w6.js");return{StreamableHTTPClientTransport:X}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9,10,11,12,13])),G=new i({name:"mesh-store",version:"1.0.0"}),Q=new M(new URL(P),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await G.connect(Q),((await G.listTools()).tools||[]).map(D=>({name:D.name,description:D.description}))}finally{await G.close().catch(console.error)}},enabled:H}),q=H&&W.isLoading,te=W.data??[],se=B?w?.tools||[]:te,De=ws(j,w?.publisher),$e=w?Cs(A,w.publisher,De,S??null,z):{count:0},Ue=w?.repository?Ae(w.repository):null,Ve=T?.server?.remotes??[],Be=T?.server?.packages??[],ue=[...Ve.map((i,M)=>({...i,_type:"remote",_index:M})),...Be.map((i,M)=>({type:"stdio",url:void 0,name:i.name||i.identifier,title:i.name||i.identifier?.replace(/^@[^/]+\//,""),description:i.environmentVariables?.length?`Requires ${i.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:M}))],ve=c?ue:ue.filter(i=>i.type?.toLowerCase()!=="stdio"),be=ve.length>1,re=[{id:"servers",label:"Servers",count:ve.length,visible:be},{id:"readme",label:"README",visible:!!w?.readmeMarkdown||!!w?.readmeUrl||!!w?.repository&&!!Ue},{id:"tools",label:"Tools",count:se.length,visible:B||te.length>0||!!P}].filter(i=>i.visible),ze=re.find(i=>i.id==="servers")?.id||re.find(i=>i.id==="readme")?.id||re[0]?.id||"overview",Fe=d&&re.find(i=>i.id===d)?d:ze,fe=async(i,M,G,Q)=>{const X=U[i??0]||T;if(!X||!r||!N?.user?.id)return;b(!0);const D=Ht(X,r.id,N.user.id,{remoteIndex:G===void 0?M??0:void 0,packageIndex:G}),ne=D.connection_type==="STDIO",le=!!D.connection_url,We=ne&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!le&&!We){oe.error("This MCP Server cannot be connected: no connection method available");return}Q&&(D.title=Q);try{const{id:K}=await u.create.mutateAsync(D),je=new URL(`/mcp/${K}`,window.location.origin),Ne=await st({url:je.href,token:null});if(Ne.supportsOAuth&&!Ne.isAuthenticated){const{token:ce,tokenInfo:ee,error:we}=await rt({connectionId:K});if(we||!ce)oe.error(`Authentication failed: ${we}`);else{if(ee)try{(await fetch(`/api/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ee.accessToken,refreshToken:ee.refreshToken,expiresIn:ee.expiresIn,scope:ee.scope,clientId:ee.clientId,clientSecret:ee.clientSecret,tokenEndpoint:ee.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ce}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ce}})}else await u.update.mutateAsync({id:K,data:{connection_token:ce}});await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(je.href,null)}),oe.success("Authentication successful")}}e({to:"/$org/$project/mcps",params:{org:r.slug,project:de},search:{tab:"connected"}})}catch(K){oe.error(`Failed to connect MCP Server: ${K instanceof Error?K.message:String(K)}`),b(!1)}},pe=async(i,M,G)=>{const Q=U[i??0]||T;if(!Q)return;const X=Q.id??Q.title,D=j.filter(ne=>ne.app_name===X||ne.title===Q.title);if(D.length>0){const le=`${Q.title||"MCP Server"} (${D.length+1})`;g({step:"warning",existing:D,pendingArgs:[i,M,G],suggestedName:le,customName:le});return}fe(i,M,G)},Oe=()=>{e({to:"/$org/$project/mcps",params:{org:r.slug,project:de}})};if(!T)return t.jsx(Xt,{onBack:Oe});if(!w)return null;const He=(T?.server?.remotes?.length??0)>0,Ge=(T?.server?.packages?.length??0)>0,ye=He||Ge,qe=t.jsx(Et,{children:t.jsxs(At,{children:[t.jsx(Ie,{children:t.jsx(Dt,{asChild:!0,children:t.jsx(tt,{to:"/$org/$project/mcps",params:{org:r.slug,project:de},children:"Connections"})})}),t.jsx($t,{}),t.jsx(Ie,{children:t.jsx(Ut,{children:w.name})})]})}),Ke=(()=>{const i=new URL(`/store/${encodeURIComponent(s||"")}`,window.location.origin);return o&&i.searchParams.set("serverName",o),i.href})();return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>g(null),children:t.jsx("div",{className:"bg-background border rounded-lg shadow-lg p-6 max-w-md w-full mx-4",onClick:i=>i.stopPropagation(),children:f.step==="warning"?t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"MCP Already Installed"}),t.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["You already have"," ",t.jsx("strong",{children:f.existing.length})," instance",f.existing.length!==1?"s":""," of this MCP installed:"]}),t.jsx("ul",{className:"text-sm space-y-1 mb-4 max-h-32 overflow-auto",children:f.existing.map(i=>t.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:i.title}),t.jsxs("span",{className:"text-xs",children:["(",i.created_at?new Date(i.created_at).toLocaleDateString():"—",")"]})]},i.id))}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>g(null),children:"Cancel"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>g({...f,step:"rename"}),children:"Install Anyway"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Choose a name"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Give this instance a different name to distinguish it, or keep the suggested one."}),t.jsx("input",{type:"text",className:"w-full rounded-md border bg-transparent px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-primary",value:f.customName,onChange:i=>g({...f,customName:i.target.value}),onKeyDown:i=>{if(i.key==="Enter"){const M=f.customName.trim()||f.suggestedName,G=f.pendingArgs;g(null),fe(...G,M)}},autoFocus:!0}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>g({...f,step:"warning"}),children:"Back"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>{const i=f.customName.trim()||f.suggestedName,M=f.pendingArgs;g(null),fe(...M,i)},children:"Install"})]})]})})}),t.jsx(Zt,{breadcrumb:qe,shareUrl:Ke}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ye&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(ct,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(es,{data:w,itemVersions:U.length>0?U:[T],onInstall:pe,canInstall:ye,isInstalling:h,hideInstallControls:be,selectedVersionIndex:V,onVersionChange:_}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(ns,{data:w,publisherInfo:$e,selectedItem:T}),t.jsx(js,{data:w,availableTabs:re,effectiveActiveTabId:Fe,effectiveTools:se,isLoadingTools:q,onTabChange:v,servers:ue,onInstallServer:i=>{i._type==="remote"?pe(V,i._index,void 0):pe(V,void 0,i._index)},isInstalling:h,mcpIcon:w.icon,mcpName:w.name,showStdio:c})]})]})})})]})}function Ar(){const r=F.c(6),{org:e}=Me(),s=Re();let n;r[0]!==s||r[1]!==e.slug?(n=()=>{s({to:"/$org/$project/mcps",params:{org:e.slug,project:de}})},r[0]=s,r[1]=e.slug,r[2]=n):n=r[2];const o=n;let a;r[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Z.Suspense,{fallback:t.jsx(Yt,{}),children:t.jsx(ks,{})}),r[3]=a):a=r[3];let l;return r[4]!==o?(l=t.jsx(_s,{onBack:o,children:a}),r[4]=o,r[5]=l):l=r[5],l}export{Ar as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BjxqoU_w.js","assets/index-j1ZaalMw.css","assets/index-DxFKywdp.js","assets/use-collections-Zp8eOwPm.js","assets/useMutation-oWI4nFQG.js","assets/constants-C5g6K3-0.js","assets/use-connection-B-vgK3kN.js","assets/use-mcp-tools-DNLvgz5O.js","assets/useQuery-CmP1G4DA.js","assets/use-mcp-resources-B8ERGBbF.js","assets/use-mcp-prompts-qi4FHPHh.js","assets/use-virtual-mcp-BnUWdVw5.js","assets/decopilot-events-Brt4gAR6.js","assets/usage-BW6ztpN6.js"])))=>i.map(i=>d[i]);
2
+ import{c as F,j as t,r as Z,B as ie,v as oe,D as Qe,K as ae,bT as xe,u as Me,e as Re,O as de,g as Ye,d as Je,z as Xe,w as Ze,f as et,G as tt,i as st,a as rt}from"./index-BjxqoU_w.js";import{i as nt}from"./AlertCircle-Hpsw9_tf.js";import{i as ge}from"./Loading01-DDv5lfhX.js";import{S as ot,I as Ee,i as it,l as at,s as lt,G as ct}from"./integration-icon-C9ac9VOj.js";import{P as he,u as dt}from"./index-Be3yjubl.js";import{c as mt,T as ut,a as ft,b as pt}from"./tooltip-SqkLa6wk.js";import{i as ht}from"./Check-CVKUMJv3.js";import{c as xt}from"./Play-Q9uDVIa5.js";import{c as gt,n as Ce}from"./XCircle-DI9HiD4A.js";import{t as vt}from"./ChevronDown-Ds3IOx8p.js";import{s as Se}from"./Plus-DcUxQQXw.js";import{a as bt,c as yt,b as jt,D as Nt}from"./dropdown-menu-IA1w2fjK.js";import{E as wt}from"./empty-state-hwIP0sm6.js";import{u as me}from"./useQuery-CmP1G4DA.js";import{c as Ct}from"./VideoRecorder-0-qQusnp.js";import{j as Ae,u as St,f as _t,k as _e,b as kt,l as It,g as Tt}from"./registry-utils-CVkiAvdy.js";import{m as ke}from"./marked.esm-BaswSlok.js";import{a as Lt}from"./tools-list-BJKvrBYn.js";import{C as Pt}from"./collection-tabs-VEtVQj8e.js";import{a as Mt,e as Rt}from"./mcp-server-card-ksfI1Eyh.js";import{B as Et,a as At,b as Ie,d as Dt,e as $t,c as Ut}from"./breadcrumb-DNInqlES.js";import{a as Vt,b as Bt,u as zt}from"./use-connection-B-vgK3kN.js";import{u as Ft}from"./constants-C5g6K3-0.js";import{u as Ot}from"./use-mcp-tools-DNLvgz5O.js";import{e as Ht}from"./extract-connection-data-D13QyL30.js";import{s as Gt}from"./slugify-CEUa2lfQ.js";import"./Container-D4n2e11R.js";import"./ArrowUp-BrSLqvQo.js";import"./ArrowLeft-U7OUoBhv.js";import"./Type01-BwsSTKh1.js";import"./ChevronRight-CTHCKnjF.js";import"./ChevronUp-DJbt-mXd.js";import"./RefreshCcw01-nS96T2bf.js";import"./Dataflow03-q5kzWw4s.js";import"./Download01-BBRbjA11.js";import"./List-D35z7ORx.js";import"./FolderClosed-CgbAGtho.js";import"./Grid01-CbgVFQNg.js";import"./SearchMd-CTpXH6F3.js";import"./Settings01-BVY96Vsg.js";import"./Trash01-CzfVJZjl.js";import"./Upload01-Bn_9d04P.js";import"./User01-Dl4j8Eui.js";import"./XClose-Bw5018RM.js";import"./X-DvXlEl9E.js";import"./Zap-DGbTVlYq.js";import"./useMutation-oWI4nFQG.js";import"./index-VZp2CIbR.js";import"./binder-DaeU7_Yt.js";import"./collection-display-button-CIwF6qiP.js";import"./badge-BIY4HSu4.js";import"./collection-search-DmeA1lkM.js";import"./input-Be0bLLQW.js";import"./collection-table-wrapper-DZ9kkHHz.js";import"./table-C915-j5j.js";import"./card-CoTaf7Bb.js";import"./types-CdHbWvSx.js";import"./layout-CYi_63K3.js";import"./use-collections-Zp8eOwPm.js";import"./generate-id-0beDKMoR.js";function qt(r){return r.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function Kt(r){return r.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,s)=>{let n=e;return s.includes("target=")?n=n.replace(/target="[^"]*"/gi,'target="_blank"'):n=n.replace(/>/,' target="_blank">'),s.includes("rel=")?n=n.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):n=n.replace(/>/,' rel="noopener noreferrer">'),n})}function Wt(r){let e=qt(r);return e=Kt(e),e}async function Qt(r,e){try{const s=await fetch(`https://api.github.com/repos/${r}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!s.ok){if(s.status===404)return null;throw new Error(`Failed to fetch README: ${s.statusText}`)}const n=await s.text();return Wt(n)}catch(s){return console.error("Error fetching README:",s),null}}function Yt(r){const e=F.c(3),{message:s}=r,n=s===void 0?"Loading MCP Server details...":s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ge,{size:48,className:"animate-spin mb-4"}),e[0]=o):o=e[0];let a;return e[1]!==n?(a=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,t.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=a):a=e[2],a}function Jt(r){const e=F.c(9),{error:s,onBack:n}=r,o=s instanceof Error?s.message:s;let a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(nt,{size:48,className:"text-destructive mb-4"}),l=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=a,e[1]=l):(a=e[0],l=e[1]);let m;e[2]!==o?(m=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:o}),e[2]=o,e[3]=m):m=e[3];let c;e[4]!==n?(c=t.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=c):c=e[5];let d;return e[6]!==m||e[7]!==c?(d=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[a,l,m,c]}),e[6]=m,e[7]=c,e[8]=d):d=e[8],d}function Xt(r){const e=F.c(5),{onBack:s}=r;let n,o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ot,{size:48,className:"text-muted-foreground mb-4"}),o=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),a=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=n,e[1]=o,e[2]=a):(n=e[0],o=e[1],a=e[2]);let l;return e[3]!==s?(l=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,o,a,t.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=s,e[4]=l):l=e[4],l}function Zt(r){const e=F.c(11),{breadcrumb:s,shareUrl:n}=r,[o,a]=Z.useState(!1);let l;e[0]!==n?(l=async()=>{n&&(await navigator.clipboard.writeText(n),a(!0),oe.success("Share link copied to clipboard"),setTimeout(()=>a(!1),2e3))},e[0]=n,e[1]=l):l=e[1];const m=l;let c;e[2]!==s?(c=t.jsx(he.Header.Left,{children:s}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==o||e[5]!==m||e[6]!==n?(d=n&&t.jsx(he.Header.Right,{children:t.jsx(mt,{children:t.jsxs(ut,{children:[t.jsx(ft,{asChild:!0,children:t.jsxs(ie,{variant:"outline",size:"sm",onClick:m,className:"gap-1.5 cursor-pointer",children:[o?t.jsx(ht,{size:16,className:"text-green-600"}):t.jsx(xt,{size:16}),t.jsx("span",{children:o?"Copied!":"Share"})]})}),t.jsx(pt,{children:t.jsx("p",{children:"Copy a universal link anyone can use to find this MCP"})})]})})}),e[4]=o,e[5]=m,e[6]=n,e[7]=d):d=e[7];let v;return e[8]!==c||e[9]!==d?(v=t.jsxs(he.Header,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=v):v=e[10],v}function Te(r){const e=F.c(28),{versions:s,selectedIndex:n,onSelect:o,isInstalling:a,variant:l,showLabel:m}=r,c=a===void 0?!1:a,d=l===void 0?"default":l,v=m===void 0?!1:m,p=s[n],_=v?"sm":"default",f=d==="default"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let g;e[0]!==f?(g=Qe("shrink-0 cursor-pointer",f),e[0]=f,e[1]=g):g=e[1];let h;e[2]!==p?.server?.version||e[3]!==v?(h=v&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=v,e[4]=h):h=e[4];const b=v?14:20;let x;e[5]!==b?(x=t.jsx(vt,{size:b}),e[5]=b,e[6]=x):x=e[6];let u;e[7]!==c||e[8]!==_||e[9]!==g||e[10]!==h||e[11]!==x||e[12]!==d?(u=t.jsx(bt,{asChild:!0,children:t.jsxs(ie,{variant:d,disabled:c,size:_,className:g,children:[h,x]})}),e[7]=c,e[8]=_,e[9]=g,e[10]=h,e[11]=x,e[12]=d,e[13]=u):u=e[13];let j;if(e[14]!==c||e[15]!==o||e[16]!==n||e[17]!==s){let I;e[19]!==c||e[20]!==o||e[21]!==n?(I=(S,k)=>{const E=S._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(yt,{onClick:()=>o(k),disabled:c,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),E?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),k===n&&t.jsx(gt,{size:16,className:"text-muted-foreground shrink-0"})]})},k)},e[19]=c,e[20]=o,e[21]=n,e[22]=I):I=e[22],j=s.map(I),e[14]=c,e[15]=o,e[16]=n,e[17]=s,e[18]=j}else j=e[18];let N;e[23]!==j?(N=t.jsx(jt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:j}),e[23]=j,e[24]=N):N=e[24];let L;return e[25]!==u||e[26]!==N?(L=t.jsxs(Nt,{children:[u,N]}),e[25]=u,e[26]=N,e[27]=L):L=e[27],L}function es(r){const e=F.c(46),{data:s,itemVersions:n,onInstall:o,canInstall:a,isInstalling:l,hideInstallControls:m,selectedVersionIndex:c,onVersionChange:d}=r,v=a===void 0?!0:a,p=l===void 0?!1:l,_=m===void 0?!1:m,[f,g]=Z.useState(0),h=c??f;let b;e[0]!==d?(b=P=>{g(P),d?.(P)},e[0]=d,e[1]=b):b=e[1];const x=b,u=n[h]||n[0];let j;e[2]!==u?.server?.remotes?(j=u?.server?.remotes??[],e[2]=u?.server?.remotes,e[3]=j):j=e[3];const N=j;let L;e[4]!==u?.server?.packages?(L=u?.server?.packages??[],e[4]=u?.server?.packages,e[5]=L):L=e[5];const S=L.length>0,k=N.length>0,E=N.findIndex(ss),y=E>=0?E:0;let Y;e[6]!==y||e[7]!==S||e[8]!==k||e[9]!==o||e[10]!==h?(Y=()=>{k?o(h,y,void 0):S&&o(h,void 0,0)},e[6]=y,e[7]=S,e[8]=k,e[9]=o,e[10]=h,e[11]=Y):Y=e[11];const R=Y;let $;e[12]!==n||e[13]!==o||e[14]!==x?($=P=>{x(P);const H=n[P],W=H?.server?.remotes??[],q=H?.server?.packages??[];if(W.length>0){const se=W.findIndex(ts);o(P,se>=0?se:0,void 0)}else q.length>0&&o(P,void 0,0)},e[12]=n,e[13]=o,e[14]=x,e[15]=$):$=e[15];const J=$;let C;e[16]!==s.icon||e[17]!==s.name?(C=t.jsx(Ee,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=C):C=e[18];let A;e[19]!==s.name?(A=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=A):A=e[20];let U;e[21]!==s.verified?(U=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=U):U=e[22];let z;e[23]!==A||e[24]!==U?(z=t.jsxs("div",{className:"flex items-center gap-2",children:[A,U]}),e[23]=A,e[24]=U,e[25]=z):z=e[25];let O;e[26]!==s.shortDescription?(O=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=O):O=e[27];let V;e[28]!==z||e[29]!==O?(V=t.jsxs("div",{className:"flex-1 min-w-0",children:[z,O]}),e[28]=z,e[29]=O,e[30]=V):V=e[30];let T;e[31]!==v||e[32]!==R||e[33]!==J||e[34]!==_||e[35]!==p||e[36]!==n||e[37]!==h||e[38]!==x?(T=v&&!_?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:n.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(ie,{variant:"default",size:"sm",onClick:R,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(Se,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(Te,{versions:n,selectedIndex:h,onSelect:J,isInstalling:p,variant:"outline"})]}):t.jsxs(ie,{variant:"default",size:"sm",onClick:R,disabled:n.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(Se,{size:20}),p?"Connecting...":"Connect"]})}):_?n.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(Te,{versions:n,selectedIndex:h,onSelect:x,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=v,e[32]=R,e[33]=J,e[34]=_,e[35]=p,e[36]=n,e[37]=h,e[38]=x,e[39]=T):T=e[39];let w;e[40]!==V||e[41]!==T?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[V,T]}),e[40]=V,e[41]=T,e[42]=w):w=e[42];let B;return e[43]!==w||e[44]!==C?(B=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[C,w]}),e[43]=w,e[44]=C,e[45]=B):B=e[45],B}function ts(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function ss(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function rs(r){if(!r)return"—";try{const e=new Date(r);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ns(r){const e=F.c(47),{data:s,publisherInfo:n,selectedItem:o}=r;let a;e[0]!==s.description?(a=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=a):a=e[1];const l=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let m;e[2]!==n.logo||e[3]!==l?(m=t.jsx(Ee,{icon:n.logo,name:l,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=l,e[4]=m):m=e[4];let c;e[5]!==s.publisher?(c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=c):c=e[6];let d;e[7]!==c?(d=t.jsx("div",{className:"font-medium",children:c}),e[7]=c,e[8]=d):d=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=v):v=e[9];let p;e[10]!==d?(p=t.jsxs("div",{children:[d,v]}),e[10]=d,e[11]=p):p=e[11];let _;e[12]!==m||e[13]!==p?(_=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[m,p]})}),e[12]=m,e[13]=p,e[14]=_):_=e[14];let f;e[15]!==s.version?(f=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=f):f=e[16];let g;e[17]!==s.tags?(g=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(is)})]}),e[17]=s.tags,e[18]=g):g=e[18];let h;e[19]!==s.categories?(h=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(os)})]}),e[19]=s.categories,e[20]=h):h=e[20];let b;e[21]!==s.connectionType?(b=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=b):b=e[22];let x;e[23]!==s.schemaVersion?(x=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=x):x=e[24];let u;e[25]!==s.websiteUrl?(u=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(Ce,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=u):u=e[26];let j;e[27]!==s.repository?(j=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(Ce,{size:14})]})]}),e[27]=s.repository,e[28]=j):j=e[28];let N;e[29]!==g||e[30]!==h||e[31]!==b||e[32]!==x||e[33]!==u||e[34]!==j||e[35]!==f?(N=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[f,g,h,b,x,u,j]}),e[29]=g,e[30]=h,e[31]=b,e[32]=x,e[33]=u,e[34]=j,e[35]=f,e[36]=N):N=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=L):L=e[37];let I;e[38]!==o.updated_at?(I=rs(o.updated_at),e[38]=o.updated_at,e[39]=I):I=e[39];let S;e[40]!==I?(S=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[L,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:I})]}),e[40]=I,e[41]=S):S=e[41];let k;return e[42]!==a||e[43]!==N||e[44]!==S||e[45]!==_?(k=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[a,_,N,S]}),e[42]=a,e[43]=N,e[44]=S,e[45]=_,e[46]=k):k=e[46],k}function os(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function is(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function Le(r){const e=F.c(18),{repository:s,html:n,isLoading:o,queryKey:a}=r;let l,m,c,d;e[0]!==n||e[1]!==a||e[2]!==s?(l=s?Ae(s):null,m=!!l&&n===void 0,d=me,c=a??ae.githubReadme(l?.owner,l?.repo),e[0]=n,e[1]=a,e[2]=s,e[3]=l,e[4]=m,e[5]=c,e[6]=d):(l=e[3],m=e[4],c=e[5],d=e[6]);let v;e[7]!==l?(v=async()=>l?Qt(l.owner,l.repo):null,e[7]=l,e[8]=v):v=e[8];let p;e[9]!==m||e[10]!==c||e[11]!==v?(p={queryKey:c,queryFn:v,enabled:m,staleTime:36e5,gcTime:864e5},e[9]=m,e[10]=c,e[11]=v,e[12]=p):p=e[12];const{data:_,isLoading:f}=d(p),g=n??_;if(o??(m&&f)){let u;return e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=u):u=e[13],u}if(!g){let u;return e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(Ct,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=u):u=e[14],u}let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b={backgroundColor:"transparent"},e[15]=b):b=e[15];let x;return e[16]!==g?(x=t.jsx("div",{className:"p-5 markdown-body",style:b,dangerouslySetInnerHTML:{__html:g}}),e[16]=g,e[17]=x):x=e[17],x}const as=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],ls={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function cs(r){if(!r)return"Local";try{return new URL(r).hostname}catch{return r}}function ds(r){if(!r)return"local";try{const e=new URL(r).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function ms(r){const e=ls[r.toLowerCase()];return e||r.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function us(r){if(!r)return"http";const e=r.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function fs(r){return r.map((e,s)=>{const n=us(e.type),o=cs(e.url),a=ds(e.url),l=e.title||e.name||ms(a);return{index:s,protocol:n,url:e.url,hostname:o,serviceName:a,displayName:l,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function ps(r){const e=F.c(2),{protocol:s,className:n}=r;let o;return e[0]!==n?(o={http:t.jsx(lt,{className:n}),sse:t.jsx(at,{className:n}),stdio:t.jsx(it,{className:n})},e[0]=n,e[1]=o):o=e[1],o[s]}function hs(r){const e=F.c(10),{options:s,selected:n,onSelect:o}=r;if(s.length<=1)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=a):a=e[0];let l;if(e[1]!==o||e[2]!==s||e[3]!==n){let c;e[5]!==o||e[6]!==n?(c=d=>t.jsxs(ie,{variant:n===d.value?"default":"outline",size:"sm",onClick:()=>o(d.value),className:"cursor-pointer",children:[t.jsx(ps,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=o,e[6]=n,e[7]=c):c=e[7],l=s.map(c),e[1]=o,e[2]=s,e[3]=n,e[4]=l}else l=e[4];let m;return e[8]!==l?(m=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a,t.jsx("div",{className:"flex gap-1",children:l})]}),e[8]=l,e[9]=m):m=e[9],m}function xs(r){const e=F.c(11),{servers:s,onInstall:n,isInstalling:o,icon:a,mcpName:l,showStdio:m}=r,c=o===void 0?!1:o,d=m===void 0?!1:m,v=d?s:s.filter(ys),p=fs(v),_=p.length<13?"all":"http",[f,g]=Z.useState(_);let h;e:{if(f==="all"){h="all";break e}let y;if(e[0]!==f?(y=R=>R.protocol===f,e[0]=f,e[1]=y):y=e[1],p.some(y)){h=f;break e}if(p.length<13){h="all";break e}h=p[0]?.protocol??"http"}const b=h,x=b==="all"?p:p.filter(y=>y.protocol===b),u=new Set(p.map(bs));let j=as.filter(y=>y.value==="all"||u.has(y.value));d||(j=j.filter(vs));const N=u.size<=1?j.filter(gs):j,L="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let I;e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==n?(I=y=>t.jsx(Mt,{variant:"server",icon:a??null,displayName:y.displayName,description:y.description??null,hostname:y.hostname,protocol:y.protocol,isInstalling:c,onClick:()=>n({type:y.protocol,url:y.url,name:y.name,title:y.title,description:y.description,_type:y._type,_index:y._index})},`${y.hostname}-${y.protocol}-${y.index}`),e[2]=a,e[3]=c,e[4]=l,e[5]=n,e[6]=I):I=e[6];const S=x.map(I);let k;e[7]!==S?(k=t.jsx("div",{className:L,children:S}),e[7]=S,e[8]=k):k=e[8];let E;return e[9]!==x.length?(E=x.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=x.length,e[10]=E):E=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(hs,{options:N,selected:b,onSelect:g}),k,E]})}function gs(r){return r.value!=="all"}function vs(r){return r.value!=="stdio"}function bs(r){return r.protocol}function ys(r){return r.type?.toLowerCase()!=="stdio"}async function Pe(r){return(await xe(async()=>{const{default:s}=await import("./purify.es-CovBOfck.js");return{default:s}},[])).default.sanitize(r,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form"],FORBID_ATTR:["style"]})}function js(r){const e=F.c(53),{data:s,availableTabs:n,effectiveActiveTabId:o,effectiveTools:a,isLoadingTools:l,onTabChange:m,servers:c,onInstallServer:d,isInstalling:v,mcpIcon:p,mcpName:_,showStdio:f}=r,g=l===void 0?!1:l;let h;e[0]!==c?(h=c===void 0?[]:c,e[0]=c,e[1]=h):h=e[1];const b=h,x=v===void 0?!1:v,u=f===void 0?!1:f;let j;e[2]!==s.readmeMarkdown?(j=s.readmeMarkdown?.trim(),e[2]=s.readmeMarkdown,e[3]=j):j=e[3];const N=!!j;let L;e[4]!==s.readmeUrl?(L=s.readmeUrl?.trim(),e[4]=s.readmeUrl,e[5]=L):L=e[5];const I=!!L;let S;e[6]!==s.readmeMarkdown?(S=ae.storeReadmeUrl(`embedded:${s.readmeMarkdown}`),e[6]=s.readmeMarkdown,e[7]=S):S=e[7];let k;e[8]!==s.readmeMarkdown?(k=async()=>{const q=ke.parse(s.readmeMarkdown??"",{async:!1});return Pe(q)},e[8]=s.readmeMarkdown,e[9]=k):k=e[9];let E;e[10]!==N||e[11]!==S||e[12]!==k?(E={queryKey:S,queryFn:k,enabled:N,staleTime:1/0},e[10]=N,e[11]=S,e[12]=k,e[13]=E):E=e[13];const{data:y,isLoading:Y}=me(E);let R;e[14]!==s.readmeUrl?(R=ae.storeReadmeUrl(s.readmeUrl),e[14]=s.readmeUrl,e[15]=R):R=e[15];let $;e[16]!==s.readmeUrl?($=async()=>{if(!s.readmeUrl)return null;const q=await fetch(s.readmeUrl);if(!q.ok)throw new Error(`Failed to fetch README (${q.status})`);const te=await q.text();return Pe(ke.parse(te,{async:!1}))},e[16]=s.readmeUrl,e[17]=$):$=e[17];const J=I&&!N;let C;e[18]!==R||e[19]!==$||e[20]!==J?(C={queryKey:R,queryFn:$,enabled:J,staleTime:36e5,gcTime:864e5},e[18]=R,e[19]=$,e[20]=J,e[21]=C):C=e[21];const{data:A,isLoading:U}=me(C),z=y??A??null,O=N&&Y||!N&&U;let V;e[22]!==a?(V=a.map(Ns),e[22]=a,e[23]=V):V=e[23];const T=V;let w;e[24]!==n||e[25]!==o||e[26]!==m?(w=n.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(Pt,{tabs:n,activeTab:o,onTabChange:m})}),e[24]=n,e[25]=o,e[26]=m,e[27]=w):w=e[27];let B;e[28]!==o||e[29]!==x||e[30]!==p||e[31]!==_||e[32]!==d||e[33]!==b||e[34]!==u?(B=o==="servers"&&b.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(xs,{servers:b,onInstall:q=>d?.(q),isInstalling:x,icon:p,mcpName:_,showStdio:u})}),e[28]=o,e[29]=x,e[30]=p,e[31]=_,e[32]=d,e[33]=b,e[34]=u,e[35]=B):B=e[35];let P;e[36]!==o||e[37]!==a.length||e[38]!==g||e[39]!==T?(P=o==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:g?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ge,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):a.length>0?t.jsx(Lt,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(wt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[36]=o,e[37]=a.length,e[38]=g,e[39]=T,e[40]=P):P=e[40];let H;e[41]!==z||e[42]!==O||e[43]!==s.repository||e[44]!==o||e[45]!==N||e[46]!==I?(H=o==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:N||I?t.jsx(Le,{html:z,isLoading:O}):t.jsx(Le,{repository:s?.repository})}),e[41]=z,e[42]=O,e[43]=s.repository,e[44]=o,e[45]=N,e[46]=I,e[47]=H):H=e[47];let W;return e[48]!==w||e[49]!==B||e[50]!==P||e[51]!==H?(W=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[w,B,P,H]}),e[48]=w,e[49]=B,e[50]=P,e[51]=H,e[52]=W):W=e[52],W}function Ns(r){const e=r;return{name:e.name||"",description:e.description||void 0}}function ws(r,e){if(!r||!e)return;const s=e.toLowerCase();return r.find(n=>n.app_name?.toLowerCase()===s||n.app_id?.toLowerCase()===s||n.title.toLowerCase()===s)||r.find(n=>n.title.toLowerCase().includes(s))}function Cs(r,e,s,n,o){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:o??r.length};const a=e.toLowerCase(),l=r.filter(c=>(c._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":c.publisher||c._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===a);return{logo:s?.icon||l[0]?.publisher_logo||l[0]?.icon||void 0,count:l.length}}function Ss(r){const e=r._meta?.["mcp.mesh"],s=r._meta?.["io.modelcontextprotocol.registry/official"],n=r.server??{},o=kt(n?.remotes?.[0]?.type),a=It(n?.$schema),l=r.id?.includes("/")?r.id.split("/")[0]:void 0,m=s?"io.modelcontextprotocol.registry/official":r.publisher||e?.scopeName||l||"Unknown",c=Tt(n.repository),d=r.icon||r.image||r.logo||n.icons?.[0]?.src||c||null,v=r.name||r.title||r.server?.title||"Unnamed Item",p=Rt(v),_=e?.friendly_name||p,f=e?.mesh_description||r.description||r.summary||n?.description||"",g=e?.short_description||null,h=typeof e?.readme=="string"?e.readme:null,b=typeof e?.readme_url=="string"?e.readme_url:null,x=e?.tags||[],u=e?.categories||[];return{name:_,description:f,shortDescription:g,readmeMarkdown:h,readmeUrl:b,icon:d,verified:r.verified||e?.verified,publisher:m,version:n.version||null,websiteUrl:n.websiteUrl||null,repository:n.repository||null,schemaVersion:a??null,connectionType:o,connectionUrl:n?.remotes?.[0]?.url||null,remoteUrl:n?.remotes?.[0]?.url||null,tags:x,categories:u,tools:r.tools||n.tools||e?.tools||[],models:r.models||n.models||e?.models||[],emails:r.emails||n.emails||e?.emails||[],analytics:r.analytics||n.analytics||e?.analytics,cdn:r.cdn||n.cdn||e?.cdn}}class _s extends Z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(Jt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ks(){const{org:r}=Me(),e=Re(),{appName:s}=Ye({strict:!1}),{registryId:n,serverName:o,stdio:a}=Je({strict:!1}),[l,m]=dt(Xe.storeShowStdio(),()=>!1),c=a==="true"?!0:a==="false"?!1:l;a!==void 0&&a==="true"!==l&&m(a==="true");const[d,v]=Z.useState(null),[p,_]=Z.useState(null),[f,g]=Z.useState(null),[h,b]=Z.useState(!1),x=Ze(),u=Vt(),j=Bt(),{data:N}=et.useSession(),L=St(j),I=n||L[0]?.id||"",S=zt(I),k=_t(S?.tools),E=_e(S?.tools??null,"_VERSIONS"),y=_e(S?.tools??null,"_GET"),Y=!!o;let R="",$={};Y?(R=E||y,$={name:o}):(R=k,$={});const J=Ft({connectionId:I||null,orgId:r.id}),{data:C}=Ot({client:J,toolName:R,toolArguments:$,select:i=>i.structuredContent??i});let A=[],U=[],z=null;if(C){if(Array.isArray(C))A=C;else if(typeof C=="object"&&C!==null)if("totalCount"in C&&typeof C.totalCount=="number"&&(z=C.totalCount),"item"in C&&C.item){const i=C.item;A=[{id:i.id||"",title:i.title,server:i.server,_meta:i._meta}]}else{let i;"versions"in C&&Array.isArray(C.versions)?i="versions":"servers"in C&&Array.isArray(C.servers)?i="servers":i=Object.keys(C).find(M=>Array.isArray(C[M])),i&&(A=C[i],(i==="versions"||R?.includes("VERSIONS"))&&(U=A))}}const O=(()=>{const i=U.findIndex(M=>M._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return i>=0?i:0})(),V=p??O;let T=A.find(i=>{const M=i.name||i.title||i.server?.title||"";return Gt(M)===s});!T&&o&&(T=A.find(i=>i.id===o||i.server?.name===o||i.name===o||i.title===o));const w=T?Ss(T):null,B=(w?.tools?.length||0)>0,P=T?.server?.remotes?.[0]?.url||null,H=!B&&!!P,W=me({queryKey:ae.remoteMcpTools(P),queryFn:async()=>{if(!P)return[];const{Client:i}=await xe(async()=>{const{Client:X}=await import("./index-BjxqoU_w.js").then(D=>D.cY);return{Client:X}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:M}=await xe(async()=>{const{StreamableHTTPClientTransport:X}=await import("./index-DxFKywdp.js");return{StreamableHTTPClientTransport:X}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9,10,11,12,13])),G=new i({name:"mesh-store",version:"1.0.0"}),Q=new M(new URL(P),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await G.connect(Q),((await G.listTools()).tools||[]).map(D=>({name:D.name,description:D.description}))}finally{await G.close().catch(console.error)}},enabled:H}),q=H&&W.isLoading,te=W.data??[],se=B?w?.tools||[]:te,De=ws(j,w?.publisher),$e=w?Cs(A,w.publisher,De,S??null,z):{count:0},Ue=w?.repository?Ae(w.repository):null,Ve=T?.server?.remotes??[],Be=T?.server?.packages??[],ue=[...Ve.map((i,M)=>({...i,_type:"remote",_index:M})),...Be.map((i,M)=>({type:"stdio",url:void 0,name:i.name||i.identifier,title:i.name||i.identifier?.replace(/^@[^/]+\//,""),description:i.environmentVariables?.length?`Requires ${i.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:M}))],ve=c?ue:ue.filter(i=>i.type?.toLowerCase()!=="stdio"),be=ve.length>1,re=[{id:"servers",label:"Servers",count:ve.length,visible:be},{id:"readme",label:"README",visible:!!w?.readmeMarkdown||!!w?.readmeUrl||!!w?.repository&&!!Ue},{id:"tools",label:"Tools",count:se.length,visible:B||te.length>0||!!P}].filter(i=>i.visible),ze=re.find(i=>i.id==="servers")?.id||re.find(i=>i.id==="readme")?.id||re[0]?.id||"overview",Fe=d&&re.find(i=>i.id===d)?d:ze,fe=async(i,M,G,Q)=>{const X=U[i??0]||T;if(!X||!r||!N?.user?.id)return;b(!0);const D=Ht(X,r.id,N.user.id,{remoteIndex:G===void 0?M??0:void 0,packageIndex:G}),ne=D.connection_type==="STDIO",le=!!D.connection_url,We=ne&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!le&&!We){oe.error("This MCP Server cannot be connected: no connection method available");return}Q&&(D.title=Q);try{const{id:K}=await u.create.mutateAsync(D),je=new URL(`/mcp/${K}`,window.location.origin),Ne=await st({url:je.href,token:null});if(Ne.supportsOAuth&&!Ne.isAuthenticated){const{token:ce,tokenInfo:ee,error:we}=await rt({connectionId:K});if(we||!ce)oe.error(`Authentication failed: ${we}`);else{if(ee)try{(await fetch(`/api/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ee.accessToken,refreshToken:ee.refreshToken,expiresIn:ee.expiresIn,scope:ee.scope,clientId:ee.clientId,clientSecret:ee.clientSecret,tokenEndpoint:ee.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ce}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ce}})}else await u.update.mutateAsync({id:K,data:{connection_token:ce}});await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(je.href,null)}),oe.success("Authentication successful")}}e({to:"/$org/$project/mcps",params:{org:r.slug,project:de},search:{tab:"connected"}})}catch(K){oe.error(`Failed to connect MCP Server: ${K instanceof Error?K.message:String(K)}`),b(!1)}},pe=async(i,M,G)=>{const Q=U[i??0]||T;if(!Q)return;const X=Q.id??Q.title,D=j.filter(ne=>ne.app_name===X||ne.title===Q.title);if(D.length>0){const le=`${Q.title||"MCP Server"} (${D.length+1})`;g({step:"warning",existing:D,pendingArgs:[i,M,G],suggestedName:le,customName:le});return}fe(i,M,G)},Oe=()=>{e({to:"/$org/$project/mcps",params:{org:r.slug,project:de}})};if(!T)return t.jsx(Xt,{onBack:Oe});if(!w)return null;const He=(T?.server?.remotes?.length??0)>0,Ge=(T?.server?.packages?.length??0)>0,ye=He||Ge,qe=t.jsx(Et,{children:t.jsxs(At,{children:[t.jsx(Ie,{children:t.jsx(Dt,{asChild:!0,children:t.jsx(tt,{to:"/$org/$project/mcps",params:{org:r.slug,project:de},children:"Connections"})})}),t.jsx($t,{}),t.jsx(Ie,{children:t.jsx(Ut,{children:w.name})})]})}),Ke=(()=>{const i=new URL(`/store/${encodeURIComponent(s||"")}`,window.location.origin);return o&&i.searchParams.set("serverName",o),i.href})();return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>g(null),children:t.jsx("div",{className:"bg-background border rounded-lg shadow-lg p-6 max-w-md w-full mx-4",onClick:i=>i.stopPropagation(),children:f.step==="warning"?t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"MCP Already Installed"}),t.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["You already have"," ",t.jsx("strong",{children:f.existing.length})," instance",f.existing.length!==1?"s":""," of this MCP installed:"]}),t.jsx("ul",{className:"text-sm space-y-1 mb-4 max-h-32 overflow-auto",children:f.existing.map(i=>t.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:i.title}),t.jsxs("span",{className:"text-xs",children:["(",i.created_at?new Date(i.created_at).toLocaleDateString():"—",")"]})]},i.id))}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>g(null),children:"Cancel"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>g({...f,step:"rename"}),children:"Install Anyway"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Choose a name"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Give this instance a different name to distinguish it, or keep the suggested one."}),t.jsx("input",{type:"text",className:"w-full rounded-md border bg-transparent px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-primary",value:f.customName,onChange:i=>g({...f,customName:i.target.value}),onKeyDown:i=>{if(i.key==="Enter"){const M=f.customName.trim()||f.suggestedName,G=f.pendingArgs;g(null),fe(...G,M)}},autoFocus:!0}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>g({...f,step:"warning"}),children:"Back"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>{const i=f.customName.trim()||f.suggestedName,M=f.pendingArgs;g(null),fe(...M,i)},children:"Install"})]})]})})}),t.jsx(Zt,{breadcrumb:qe,shareUrl:Ke}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ye&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(ct,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(es,{data:w,itemVersions:U.length>0?U:[T],onInstall:pe,canInstall:ye,isInstalling:h,hideInstallControls:be,selectedVersionIndex:V,onVersionChange:_}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(ns,{data:w,publisherInfo:$e,selectedItem:T}),t.jsx(js,{data:w,availableTabs:re,effectiveActiveTabId:Fe,effectiveTools:se,isLoadingTools:q,onTabChange:v,servers:ue,onInstallServer:i=>{i._type==="remote"?pe(V,i._index,void 0):pe(V,void 0,i._index)},isInstalling:h,mcpIcon:w.icon,mcpName:w.name,showStdio:c})]})]})})})]})}function Ar(){const r=F.c(6),{org:e}=Me(),s=Re();let n;r[0]!==s||r[1]!==e.slug?(n=()=>{s({to:"/$org/$project/mcps",params:{org:e.slug,project:de}})},r[0]=s,r[1]=e.slug,r[2]=n):n=r[2];const o=n;let a;r[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Z.Suspense,{fallback:t.jsx(Yt,{}),children:t.jsx(ks,{})}),r[3]=a):a=r[3];let l;return r[4]!==o?(l=t.jsx(_s,{onBack:o,children:a}),r[4]=o,r[5]=l):l=r[5],l}export{Ar as default};