decocms 4.319.8 → 4.319.9

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 (263) hide show
  1. package/dist/client/assets/{AlertCircle-f4nnpTTg.js → AlertCircle-Cbfze2vA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-8HavjRhs.js → AreaChart-ESWfdZrx.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DeVXQ_Zc.js → ArrowLeft-sTRXJKw4.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-HzO4dq_k.js → ArrowUp-Ck_S8UXb.js} +1 -1
  5. package/dist/client/assets/{Check-DzHuFHoL.js → Check-BSrzKRPt.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-tNccGo23.js → CheckCircle-DyLCcRg7.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-s4Re3J16.js → ChevronDown-DS4KDE95.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DtOnXnjv.js → ChevronRight-HiBK7iT4.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CwgLFWq0.js → ChevronSelectorVertical-CfYYUsnO.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Xpnsttw1.js → ChevronUp-DBNo7toe.js} +1 -1
  11. package/dist/client/assets/{Copy01-BRPiRRUQ.js → Copy01-cV8y7I27.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-D7nD4MoT.js → CreditCard01-D2p53cnj.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-BVchZPc_.js → DotsVertical-Cn-HQJLl.js} +1 -1
  14. package/dist/client/assets/{Download01-C8Yiywz6.js → Download01-DKxxD2lG.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-Bhb5Qpt4.js → ErrorBarContext-CjrL28Ly.js} +1 -1
  16. package/dist/client/assets/{Eye-WB67QJ1C.js → Eye-CFsMHhc3.js} +1 -1
  17. package/dist/client/assets/{FilterLines-pNRXDJ_z.js → FilterLines-CY-R2Pgs.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-ByUdctAW.js → GitBranch01-gzbYsobG.js} +1 -1
  19. package/dist/client/assets/{Globe01-DXAw5CTM.js → Globe01-wsmSifpz.js} +1 -1
  20. package/dist/client/assets/{Globe04-Cjk5Mw2y.js → Globe04-BbtNoerk.js} +1 -1
  21. package/dist/client/assets/{HardDrive-BTi8s38H.js → HardDrive-B2Kmw_-U.js} +1 -1
  22. package/dist/client/assets/{Image01-fT4xR6P_.js → Image01-4ZjVZeII.js} +1 -1
  23. package/dist/client/assets/{Key01-CHTC8hwE.js → Key01-BGSob3xF.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-kAtb5ILy.js → LinkExternal01-DgCDtWFz.js} +1 -1
  25. package/dist/client/assets/{LockUnlocked01-C4X5qfRd.js → LockUnlocked01-DPANpO_w.js} +1 -1
  26. package/dist/client/assets/{LogOut01-BkpjlgBP.js → LogOut01-y1fQHOm-.js} +1 -1
  27. package/dist/client/assets/{Monitor01-Dhk7PXVV.js → Monitor01-DZQMQTQG.js} +1 -1
  28. package/dist/client/assets/{Package-CHpW5VM0.js → Package-FFc5eynf.js} +1 -1
  29. package/dist/client/assets/{Palette-BYFK4FA5.js → Palette-_BVhH0qL.js} +1 -1
  30. package/dist/client/assets/{Play-CZP4IMzd.js → Play-mDAbVXyx.js} +1 -1
  31. package/dist/client/assets/{Plus-CYNImaOJ.js → Plus-DuwKEMqs.js} +1 -1
  32. package/dist/client/assets/{SearchLg-8uAbG9P4.js → SearchLg-BWCvW3vV.js} +1 -1
  33. package/dist/client/assets/{SearchMd-bD349BM3.js → SearchMd-BNMN35l9.js} +1 -1
  34. package/dist/client/assets/{Sector-tGY4Py8B.js → Sector-Ci4Ux-xI.js} +1 -1
  35. package/dist/client/assets/{Settings02-CfL_uUCf.js → Settings02-BdKfdvdO.js} +1 -1
  36. package/dist/client/assets/{Share07-CPaO5Jno.js → Share07-DgnKCkn5.js} +1 -1
  37. package/dist/client/assets/{Shield01-Y6gzbv7o.js → Shield01-CRyZWHgQ.js} +1 -1
  38. package/dist/client/assets/{Stars01-_AATW4G8.js → Stars01-CqIitG82.js} +1 -1
  39. package/dist/client/assets/{Stars02-CqIkzwRk.js → Stars02-C5vVPVXG.js} +1 -1
  40. package/dist/client/assets/{Sun-CwIE4PFj.js → Sun-B_wiAXGd.js} +1 -1
  41. package/dist/client/assets/{SwitchHorizontal01-BJLtWFX5.js → SwitchHorizontal01-BSS5u6hh.js} +1 -1
  42. package/dist/client/assets/{Tool01-hZtg6GbK.js → Tool01-kD_St_C1.js} +1 -1
  43. package/dist/client/assets/{Tool02-DiIiNPwu.js → Tool02-C4Mhmh2n.js} +1 -1
  44. package/dist/client/assets/{Trash01-Bji2bWWh.js → Trash01-BQ7TqJow.js} +1 -1
  45. package/dist/client/assets/{TrendUp01-Y6CIxEGk.js → TrendUp01-Dmxvc_8Y.js} +1 -1
  46. package/dist/client/assets/{Upload01-CYRB-7yG.js → Upload01-BUUJWF9q.js} +1 -1
  47. package/dist/client/assets/{User01-xX8OC8Hl.js → User01-6GEEYLNL.js} +1 -1
  48. package/dist/client/assets/{UserSquare-B8RaUikS.js → UserSquare-B1QhMNkc.js} +1 -1
  49. package/dist/client/assets/{Users01-x11CoUFz.js → Users01-D3492jop.js} +1 -1
  50. package/dist/client/assets/{Users03-Bg19q-V-.js → Users03-C-fPfgy4.js} +1 -1
  51. package/dist/client/assets/{XCircle-YqRo5mD9.js → XCircle-BR9peTMp.js} +1 -1
  52. package/dist/client/assets/{XClose-DyyJkORZ.js → XClose-CId8Q3oo.js} +1 -1
  53. package/dist/client/assets/{YAxis-DVHrIG29.js → YAxis-D1yzoPbg.js} +1 -1
  54. package/dist/client/assets/{Zap-DBnrIpUC.js → Zap-C81otJUu.js} +1 -1
  55. package/dist/client/assets/{ZapSquare-tVtrCpPj.js → ZapSquare-DafqFLME.js} +1 -1
  56. package/dist/client/assets/{ZoomOut-CVtN6QQg.js → ZoomOut-A4Edr_rF.js} +1 -1
  57. package/dist/client/assets/{access-gate-EoGcByM_.js → access-gate-b5TlHoe3.js} +1 -1
  58. package/dist/client/assets/{agent-icon-DXnqgUdn.js → agent-icon-patNN3F9.js} +1 -1
  59. package/dist/client/assets/agents-list-CYdT80sf.js +1 -0
  60. package/dist/client/assets/{ai-providers-B9LmqS60.js → ai-providers-BwuVzE7K.js} +1 -1
  61. package/dist/client/assets/{alert-B5gYqXvO.js → alert-BBHy--nB.js} +1 -1
  62. package/dist/client/assets/{alert-dialog-C1vr7a0B.js → alert-dialog-B0BRtAnp.js} +1 -1
  63. package/dist/client/assets/{analytics-tab-Dxb2aOcG.js → analytics-tab-ypQ97HlI.js} +1 -1
  64. package/dist/client/assets/{api-keys-BVShXcJP.js → api-keys-Cgz1SOLn.js} +1 -1
  65. package/dist/client/assets/app-editor-lRxxGwYD.js +1 -0
  66. package/dist/client/assets/{auth-DXJPvHb_.js → auth-Di--WQHJ.js} +1 -1
  67. package/dist/client/assets/{auth-catchall-By1cz0Yu.js → auth-catchall-Cxvoz1wY.js} +1 -1
  68. package/dist/client/assets/{auth-entry-B88UFhdg.js → auth-entry-JjGry1jW.js} +1 -1
  69. package/dist/client/assets/{auth-split-layout-Ub6OTBhx.js → auth-split-layout-D5KuCOy0.js} +1 -1
  70. package/dist/client/assets/{authenticate-and-persist-oauth-B322JeMG.js → authenticate-and-persist-oauth-CjESgZgI.js} +1 -1
  71. package/dist/client/assets/{automation-list-row-l6-XvZu6.js → automation-list-row-1Zs7zFIm.js} +1 -1
  72. package/dist/client/assets/{automation-runs-BwFV9_XZ.js → automation-runs-BnvqbNbI.js} +1 -1
  73. package/dist/client/assets/{automations-DBKn4Q8k.js → automations-BgsL-M5q.js} +1 -1
  74. package/dist/client/assets/{avatar-CpPlf24-.js → avatar-DpXC79Fw.js} +1 -1
  75. package/dist/client/assets/{badge-CFKeX0mn.js → badge-mutKhjD6.js} +1 -1
  76. package/dist/client/assets/{block-document-BL7oMI74.js → block-document-BNyDHxm6.js} +1 -1
  77. package/dist/client/assets/{breadcrumb-QKUdhBOY.js → breadcrumb-TFEAIiKj.js} +1 -1
  78. package/dist/client/assets/{buckets-DMVRQiOf.js → buckets-CJTbBrrA.js} +1 -1
  79. package/dist/client/assets/{bulk-category-panel-B1qs1Dmy.js → bulk-category-panel-B59puZE1.js} +1 -1
  80. package/dist/client/assets/{capability-load-error-RVzxs7io.js → capability-load-error-DW5RgyIb.js} +1 -1
  81. package/dist/client/assets/{cards-BKe88FKP.js → cards-B_0ClWxN.js} +1 -1
  82. package/dist/client/assets/category-editor-D_rSR82G.js +1 -0
  83. package/dist/client/assets/{cdn-tab-Cy5BeFj-.js → cdn-tab-DfZZi1_D.js} +1 -1
  84. package/dist/client/assets/{chart-aqo9QCpr.js → chart-DsuJR6l_.js} +1 -1
  85. package/dist/client/assets/{chat-context-CgRJgEvq.js → chat-context-DdSuZE3w.js} +1 -1
  86. package/dist/client/assets/{checkbox-BoivotQ-.js → checkbox-BlKIO9QJ.js} +1 -1
  87. package/dist/client/assets/{choose-editor-QTv7--m3.js → choose-editor-CyA_vGg2.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-DTyiOyJd.js → cli-auth-success-BCjskaVH.js} +1 -1
  89. package/dist/client/assets/collection-detail-D2PAk6Qd.js +1 -0
  90. package/dist/client/assets/{collection-display-button-IsQl2qfL.js → collection-display-button-uov2GUqF.js} +1 -1
  91. package/dist/client/assets/{collection-search-BLs0Fnfs.js → collection-search-DpMT1vYf.js} +1 -1
  92. package/dist/client/assets/{collection-table-wrapper-fvU83bN6.js → collection-table-wrapper-etwMAVIq.js} +1 -1
  93. package/dist/client/assets/{collection-tabs-Ir5Tsafl.js → collection-tabs-6TyH3ybi.js} +1 -1
  94. package/dist/client/assets/{command-B5mpvvDf.js → command-0A8TicqW.js} +1 -1
  95. package/dist/client/assets/commerce-onboarding-DlZzl8Qx.js +1 -0
  96. package/dist/client/assets/{config-lfQlN5yZ.js → config-FZs5m7aB.js} +1 -1
  97. package/dist/client/assets/{connect-BlZW6L0a.js → connect-D1Az22LS.js} +1 -1
  98. package/dist/client/assets/{connection-rpamShLy.js → connection-BOKd-Vhl.js} +1 -1
  99. package/dist/client/assets/{connection-card-R6-YJNhI.js → connection-card-C0r2lBXt.js} +1 -1
  100. package/dist/client/assets/connection-detail-DR0uEKCM.js +1 -0
  101. package/dist/client/assets/{connection-form-helpers-CObw_4nL.js → connection-form-helpers-Cx0hSG8H.js} +1 -1
  102. package/dist/client/assets/connections-50b_6B2i.js +1 -0
  103. package/dist/client/assets/{decopilot-sse-pool-POUs7TGl.js → decopilot-sse-pool-BGdXs4q_.js} +1 -1
  104. package/dist/client/assets/{dialog-pwZ4KzZ6.js → dialog-CefQc73v.js} +1 -1
  105. package/dist/client/assets/{domain-settings-NdGxfDzI.js → domain-settings-f40JEWNa.js} +1 -1
  106. package/dist/client/assets/{drawer-C-xsc5eG.js → drawer-BZ-PaoE1.js} +1 -1
  107. package/dist/client/assets/{dropdown-menu-C16L90Tz.js → dropdown-menu-Dmm7Trn3.js} +1 -1
  108. package/dist/client/assets/{e2e-tab-C2uDcahp.js → e2e-tab-CGSRbTy5.js} +1 -1
  109. package/dist/client/assets/{editor-BHb3kJQ5.js → editor-BxhxuLJa.js} +1 -1
  110. package/dist/client/assets/{empty-state-DvA7VyTt.js → empty-state-C54Q6sBj.js} +1 -1
  111. package/dist/client/assets/{empty-state-C64gXBQU.js → empty-state-mYORqltN.js} +1 -1
  112. package/dist/client/assets/extract-connection-data-DXnTgJE5.js +1 -0
  113. package/dist/client/assets/file-explorer-CEisRSg0.js +2 -0
  114. package/dist/client/assets/{file-type-icon-xQ7VVCet.js → file-type-icon-BFYTEN10.js} +1 -1
  115. package/dist/client/assets/{folder-icon-DpeG2vsd.js → folder-icon-DD3eiqXL.js} +1 -1
  116. package/dist/client/assets/{form-ENCNwobk.js → form-CAcKi06k.js} +1 -1
  117. package/dist/client/assets/{general-DOGR2kAx.js → general-ChXYwEto.js} +1 -1
  118. package/dist/client/assets/{github-repo-picker-BO3njSCf.js → github-repo-picker-C-0rHR-M.js} +1 -1
  119. package/dist/client/assets/{hooks-DamZm9Dl.js → hooks-DHadwCKp.js} +1 -1
  120. package/dist/client/assets/{hosting-tab-DHOJ7E0g.js → hosting-tab-yn6WUggV.js} +1 -1
  121. package/dist/client/assets/{index-TjmjDCyo.js → index-BCzXIVbP.js} +1 -1
  122. package/dist/client/assets/{index-CVEDX-YS.js → index-CIZG7m9-.js} +1 -1
  123. package/dist/client/assets/{index-DZLUP-bk.js → index-CyVZ5lgJ.js} +3 -3
  124. package/dist/client/assets/{index-DqZsb0Td.js → index-DEVfPJkj.js} +6 -6
  125. package/dist/client/assets/index-DFf6BmI8.js +1 -0
  126. package/dist/client/assets/{index-BHv8b4bS.js → index-DfY5ZnY2.js} +1 -1
  127. package/dist/client/assets/{index-BxeEwMkO.js → index-TfAJegqd.js} +1 -1
  128. package/dist/client/assets/{index-Dg38LHEr.js → index-WnatCyEy.js} +1 -1
  129. package/dist/client/assets/{index-CwiVxNC1.js → index-eiH1IWjN.js} +1 -1
  130. package/dist/client/assets/{index-redirect-CJJKpI9F.js → index-redirect-BJRrlGCr.js} +1 -1
  131. package/dist/client/assets/{infra-billing-DJPDSczQ.js → infra-billing-x14J2hwN.js} +1 -1
  132. package/dist/client/assets/{input-Cvmwm8KN.js → input-DJ33AwMQ.js} +1 -1
  133. package/dist/client/assets/{integration-icon-DwhAeNBu.js → integration-icon-Bp-AVupB.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-CgJgzzFp.js → invite-member-dialog-C1tLDFqS.js} +1 -1
  135. package/dist/client/assets/{label-DZWNE7Y7.js → label-C3nYoz5C.js} +1 -1
  136. package/dist/client/assets/{layout-SayPzP68.js → layout-CWV7yC9D.js} +1 -1
  137. package/dist/client/assets/{login-C_A381mF.js → login-B3u4sQZp.js} +1 -1
  138. package/dist/client/assets/{markdown-C1ZA9C8N.js → markdown-BkQsssiC.js} +1 -1
  139. package/dist/client/assets/{mcp-oauth-BfeN-QCK.js → mcp-oauth-1onT9Dwz.js} +1 -1
  140. package/dist/client/assets/{members-Dgq0PRrT.js → members-Dg4YsBhQ.js} +1 -1
  141. package/dist/client/assets/{monaco-editor-BJGC8gh7.js → monaco-editor-CekVK54D.js} +1 -1
  142. package/dist/client/assets/{monitoring-stats-row-DZOfJtdy.js → monitoring-stats-row-By6Kd2TD.js} +1 -1
  143. package/dist/client/assets/{multi-select-KLejsge1.js → multi-select-BtoaMUJz.js} +1 -1
  144. package/dist/client/assets/{oauth-callback-Czlma0i-.js → oauth-callback-6tEtW-LM.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-ai-provider-ZdrQnvUS.js → oauth-callback-ai-provider-MDX175zJ.js} +1 -1
  146. package/dist/client/assets/{onboarding-B5ZjDPzC.js → onboarding-4-7USRUz.js} +1 -1
  147. package/dist/client/assets/{org-layout-CdHLlafN.js → org-layout-BVuUNoCr.js} +1 -1
  148. package/dist/client/assets/{organization-choice-DOTxufBd.js → organization-choice-IjHgk-3p.js} +1 -1
  149. package/dist/client/assets/{orgs-Dge8GFI6.js → orgs-tZDlTKNv.js} +1 -1
  150. package/dist/client/assets/{page-seo-form-AxX8GGlf.js → page-seo-form-Cp6KSuC_.js} +1 -1
  151. package/dist/client/assets/{popover-CGQv5zzi.js → popover-D55EARay.js} +1 -1
  152. package/dist/client/assets/post-calendar-BFF6JP7b.js +1 -0
  153. package/dist/client/assets/post-editor-Bm1hF1x-.js +1 -0
  154. package/dist/client/assets/{primitives-CiTG7vqX.js → primitives-BrSMCaVk.js} +1 -1
  155. package/dist/client/assets/{profile-Beo16CzY.js → profile-Bhc2V-M8.js} +1 -1
  156. package/dist/client/assets/project-app-view-DrWz74Sr.js +1 -0
  157. package/dist/client/assets/{prompts-DkqB1QMP.js → prompts-_NVNULaa.js} +1 -1
  158. package/dist/client/assets/record-editor-rnVyvPSr.js +1 -0
  159. package/dist/client/assets/redirect-editor-CM_un7BL.js +1 -0
  160. package/dist/client/assets/registry-B7Kq3HQ7.js +2 -0
  161. package/dist/client/assets/{registry-layout-CzKQ-sVC.js → registry-layout-BrJe1W34.js} +1 -1
  162. package/dist/client/assets/{reports-CFFIWbjE.js → reports-CWdoeFlh.js} +1 -1
  163. package/dist/client/assets/{require-capability-CCEb5Sqs.js → require-capability-BwNGmU08.js} +1 -1
  164. package/dist/client/assets/{required-auth-layout-BmpA_-kW.js → required-auth-layout-rRB3j86p.js} +1 -1
  165. package/dist/client/assets/{reset-password-CnsdaXsq.js → reset-password-CxGtiwtI.js} +1 -1
  166. package/dist/client/assets/{review-settings-gifV-niU.js → review-settings-CWIQgB3U.js} +1 -1
  167. package/dist/client/assets/{roles-CcQAq0Yr.js → roles-DtbJAGmi.js} +1 -1
  168. package/dist/client/assets/{schema-B2Qlbge8.js → schema-CTX-wtUj.js} +1 -1
  169. package/dist/client/assets/{scroll-area-D1Ypr2e7.js → scroll-area-BhaZbee4.js} +1 -1
  170. package/dist/client/assets/{search-input-CXMFw9Ub.js → search-input-CVs6a7cw.js} +1 -1
  171. package/dist/client/assets/{secrets-BOs-6B5A.js → secrets-C3f__cCp.js} +1 -1
  172. package/dist/client/assets/{sections-editor-D7y_-PRI.js → sections-editor-BqhaMUe3.js} +2 -2
  173. package/dist/client/assets/{select-SMcDHH3S.js → select-C8VpiT9w.js} +1 -1
  174. package/dist/client/assets/{select-model-C4PjzdGN.js → select-model-D1dRIP_D.js} +1 -1
  175. package/dist/client/assets/{self-tool-result-DFm5BFLJ.js → self-tool-result-C8bZjo2U.js} +1 -1
  176. package/dist/client/assets/seo-editor-DPQFMo68.js +1 -0
  177. package/dist/client/assets/{settings-layout-DT1hD9Qc.js → settings-layout-DNHHSoYV.js} +1 -1
  178. package/dist/client/assets/{shell-controls-BtldDShr.js → shell-controls-BlgO97pY.js} +1 -1
  179. package/dist/client/assets/{shell-layout-OPAbVfwZ.js → shell-layout-DdASzo_y.js} +1 -1
  180. package/dist/client/assets/{skill-preview-CyY0OP_z.js → skill-preview-Cux1kH84.js} +1 -1
  181. package/dist/client/assets/{skills-DdosW6Bc.js → skills-ByWAAiCH.js} +1 -1
  182. package/dist/client/assets/{spinner-BJLy3OGx.js → spinner-BKgquf7Q.js} +1 -1
  183. package/dist/client/assets/{sso-D53JjpHs.js → sso-BuMyYnVO.js} +1 -1
  184. package/dist/client/assets/{store-lWrTp8UV.js → store-BvYy-wk5.js} +1 -1
  185. package/dist/client/assets/store-registry-DTeHXWro.js +2 -0
  186. package/dist/client/assets/{super-agent-icon-Bnh5ToBT.js → super-agent-icon-X7k4V5iD.js} +1 -1
  187. package/dist/client/assets/{switch-C2vAz9hZ.js → switch-ekFlz4BX.js} +1 -1
  188. package/dist/client/assets/synced-repos-pwl6TyIr.js +1 -0
  189. package/dist/client/assets/{table-C2U6VD6y.js → table-DxIpuuMu.js} +1 -1
  190. package/dist/client/assets/{tabs-B70ZS4po.js → tabs-Cb3eYxFR.js} +1 -1
  191. package/dist/client/assets/{task-board-DTv9gW69.js → task-board-BR_pi0j4.js} +1 -1
  192. package/dist/client/assets/{tasks-DaUPg9Cd.js → tasks-1DwMg88n.js} +1 -1
  193. package/dist/client/assets/{textarea-DsyQQY8o.js → textarea-DmjAO8WJ.js} +1 -1
  194. package/dist/client/assets/{thread-route-C79eC_qQ.js → thread-route-CvQsqsJY.js} +1 -1
  195. package/dist/client/assets/{toggle-group-CcQrFwsS.js → toggle-group-Buj7cwOI.js} +1 -1
  196. package/dist/client/assets/{toolbar-DVLlKODz.js → toolbar-T9fNZ5Dm.js} +1 -1
  197. package/dist/client/assets/{track-CmZ4JwHl.js → track-UqVBrAJT.js} +1 -1
  198. package/dist/client/assets/{types-GWf0mG7M.js → types-sWp7JVPE.js} +1 -1
  199. package/dist/client/assets/{use-ai-providers-Dj1Pomhd.js → use-ai-providers-QUqgpHAI.js} +1 -1
  200. package/dist/client/assets/{use-api-keys-v7JpdoOm.js → use-api-keys-CJDSbqKR.js} +1 -1
  201. package/dist/client/assets/{use-automations-CxTksTg3.js → use-automations-BFLuZmRd.js} +1 -1
  202. package/dist/client/assets/{use-autosave-BafK4Rjr.js → use-autosave-K_2e8huM.js} +1 -1
  203. package/dist/client/assets/{use-connection-BBRJTBMy.js → use-connection-CklhgwT-.js} +1 -1
  204. package/dist/client/assets/{use-copy-QEjXenkb.js → use-copy-DXvQhxzo.js} +1 -1
  205. package/dist/client/assets/{use-create-virtual-mcp-B0jM9fDO.js → use-create-virtual-mcp-Bir9un1y.js} +1 -1
  206. package/dist/client/assets/{use-debounced-autosave-CSzP1LMa.js → use-debounced-autosave-DDM-x_p4.js} +1 -1
  207. package/dist/client/assets/{use-debounced-value-0YLkJ58n.js → use-debounced-value-BX1Z2C1S.js} +1 -1
  208. package/dist/client/assets/{use-decopilot-events-DVLYFd8Z.js → use-decopilot-events-BCpugb4D.js} +1 -1
  209. package/dist/client/assets/{use-delete-connection-D3A1ZRW7.js → use-delete-connection-DXsyiE-F.js} +1 -1
  210. package/dist/client/assets/{use-deployment-admin-DzmvX_1c.js → use-deployment-admin-CpYjp9p_.js} +1 -1
  211. package/dist/client/assets/{use-destination-route-CgRHxPyq.js → use-destination-route-C4i1vP71.js} +1 -1
  212. package/dist/client/assets/{use-file-configs-BtJ9owXL.js → use-file-configs-C0TVz0AH.js} +1 -1
  213. package/dist/client/assets/{use-infinite-scroll-D9F23MOw.js → use-infinite-scroll-DHeyE3Gp.js} +1 -1
  214. package/dist/client/assets/{use-join-requests-CNUbcIoH.js → use-join-requests-2b4gCXfW.js} +1 -1
  215. package/dist/client/assets/{use-mcp-auth-status-yMNjE6Uo.js → use-mcp-auth-status-CWXW9vhJ.js} +1 -1
  216. package/dist/client/assets/{use-mcp-client-Qp-dz21o.js → use-mcp-client-BiMbFhZA.js} +1 -1
  217. package/dist/client/assets/{use-mcp-tools-C7FgaBkX.js → use-mcp-tools-D1SQ9VQp.js} +1 -1
  218. package/dist/client/assets/{use-members-BcS-quMh.js → use-members-KzBukpu-.js} +1 -1
  219. package/dist/client/assets/{use-navigate-to-agent-B8yDMTez.js → use-navigate-to-agent-DMGreR6U.js} +1 -1
  220. package/dist/client/assets/{use-org-auth-client-Dp0AX4Aj.js → use-org-auth-client-DXJoDvFV.js} +1 -1
  221. package/dist/client/assets/{use-org-repo-syncs-Brd5lrfI.js → use-org-repo-syncs-DABsYoTf.js} +1 -1
  222. package/dist/client/assets/{use-org-sso-wZB9SHX9.js → use-org-sso-DvDCIeZJ.js} +1 -1
  223. package/dist/client/assets/{use-organization-roles-C0_74J_y.js → use-organization-roles-CxZxpz25.js} +1 -1
  224. package/dist/client/assets/{use-organization-settings-DoHw0Vrb.js → use-organization-settings-DOmendGP.js} +1 -1
  225. package/dist/client/assets/{use-panel-navigate-C7_AOzBX.js → use-panel-navigate-5GuF3Xky.js} +1 -1
  226. package/dist/client/assets/{use-registry-connections-CB_vMkV_.js → use-registry-connections-D-9Urbos.js} +1 -1
  227. package/dist/client/assets/{use-secrets-DWR3VHSi.js → use-secrets-C_EMCwrS.js} +1 -1
  228. package/dist/client/assets/{use-section-preview-base-CWBthmZQ.js → use-section-preview-base-JJaaLUdY.js} +1 -1
  229. package/dist/client/assets/{use-status-sounds-B4wpz7Bv.js → use-status-sounds-BvVFIICB.js} +1 -1
  230. package/dist/client/assets/{use-tags-TtpBUHZv.js → use-tags-CnHiO94-.js} +1 -1
  231. package/dist/client/assets/{use-view-mode-CqPRLkgX.js → use-view-mode-BT0iEFTU.js} +1 -1
  232. package/dist/client/assets/{use-virtual-mcp-BcsPJqk4.js → use-virtual-mcp-CYMnefxf.js} +1 -1
  233. package/dist/client/assets/useInfiniteQuery-CULS4zh1.js +1 -0
  234. package/dist/client/assets/useSuspenseInfiniteQuery-DaZYFkir.js +1 -0
  235. package/dist/client/assets/{users-DR4kDqbe.js → users-BHgxlfhz.js} +1 -1
  236. package/dist/client/assets/variant-calendar-4jaTpdDv.js +1 -0
  237. package/dist/client/assets/{view-mode-toggle-uQZ5XhwA.js → view-mode-toggle-BgXxXgC3.js} +1 -1
  238. package/dist/client/index.html +1 -1
  239. package/dist/server/cli.js +416 -416
  240. package/dist/server/server.js +280 -280
  241. package/package.json +1 -1
  242. package/dist/client/assets/agents-list-CjROH5af.js +0 -1
  243. package/dist/client/assets/app-editor-DqQdEHcH.js +0 -1
  244. package/dist/client/assets/category-editor-CacTrWLl.js +0 -1
  245. package/dist/client/assets/collection-detail-NjFsNfcb.js +0 -1
  246. package/dist/client/assets/commerce-onboarding-CTAvWzNK.js +0 -1
  247. package/dist/client/assets/connection-detail-Bp_SrWC0.js +0 -1
  248. package/dist/client/assets/connections-BS5_DsBn.js +0 -1
  249. package/dist/client/assets/extract-connection-data-CqOTDUuA.js +0 -1
  250. package/dist/client/assets/file-explorer-CWrCpfsa.js +0 -2
  251. package/dist/client/assets/index-Nfz_WfAJ.js +0 -1
  252. package/dist/client/assets/post-calendar-BKq3211e.js +0 -1
  253. package/dist/client/assets/post-editor-pVnpiqgd.js +0 -1
  254. package/dist/client/assets/project-app-view-CCRiXSdc.js +0 -1
  255. package/dist/client/assets/record-editor-B4GimSNa.js +0 -1
  256. package/dist/client/assets/redirect-editor-DGmMBPF8.js +0 -1
  257. package/dist/client/assets/registry-BsOqDmeP.js +0 -2
  258. package/dist/client/assets/seo-editor-SQz-vDBx.js +0 -1
  259. package/dist/client/assets/store-registry-CbRGhfLY.js +0 -2
  260. package/dist/client/assets/synced-repos-BhphaVQf.js +0 -1
  261. package/dist/client/assets/useInfiniteQuery-Mj7WnppJ.js +0 -1
  262. package/dist/client/assets/useSuspenseInfiniteQuery-dJDa9vJh.js +0 -1
  263. package/dist/client/assets/variant-calendar-Bie9J8Up.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as N,b as Q,j as r,n as Me,q as ue,s as st,B as Ne,u as Xe,r as Y,a as Ae,v as nt,d as lt,w as at,e as Ze,x as Ee,y as Se,Q as ct,E as mt,K as Be,z as He,N as dt}from"./index-CyVZ5lgJ.js";import{L as ut,s as Te,S as We,C as qe,i as gt,n as Re,a as et,p as Le}from"./self-tool-result-C8bZjo2U.js";import{A as ft}from"./auth-entry-JjGry1jW.js";import{A as pt}from"./auth-split-layout-D5KuCOy0.js";import{O as Ve}from"./organization-choice-IjHgk-3p.js";import{r as ht}from"./track-UqVBrAJT.js";import{I as bt}from"./input-DJ33AwMQ.js";import{D as xt,a as Ke,b as yt,c as Ct}from"./dropdown-menu-Dmm7Trn3.js";import{u as jt}from"./use-mcp-client-BiMbFhZA.js";import{S as Ot,W as vt,g as St,a as _t}from"./constants-dLUUoWH7.js";import{i as wt}from"./XCircle-BR9peTMp.js";import{t as Qe}from"./site-error--i37Vnuw.js";import"./alert-dialog-B0BRtAnp.js";import"./form-CAcKi06k.js";import"./label-C3nYoz5C.js";import"./spinner-BKgquf7Q.js";import"./integration-icon-Bp-AVupB.js";import"./Tool02-C4Mhmh2n.js";import"./agent-icon-patNN3F9.js";import"./AlertCircle-Cbfze2vA.js";import"./UserSquare-B1QhMNkc.js";import"./Tool01-kD_St_C1.js";import"./ArrowUp-Ck_S8UXb.js";import"./ArrowLeft-sTRXJKw4.js";import"./TrendUp01-Dmxvc_8Y.js";import"./ZapSquare-DafqFLME.js";import"./ZoomOut-A4Edr_rF.js";import"./Users03-C-fPfgy4.js";import"./CheckCircle-DyLCcRg7.js";import"./Check-BSrzKRPt.js";import"./ChevronDown-DS4KDE95.js";import"./ChevronRight-HiBK7iT4.js";import"./ChevronSelectorVertical-CfYYUsnO.js";import"./ChevronUp-DBNo7toe.js";import"./DotsVertical-Cn-HQJLl.js";import"./Stars02-C5vVPVXG.js";import"./Copy01-cV8y7I27.js";import"./CreditCard01-D2p53cnj.js";import"./Download01-DKxxD2lG.js";import"./Settings02-BdKfdvdO.js";import"./Eye-CFsMHhc3.js";import"./FilterLines-CY-R2Pgs.js";import"./Share07-DgnKCkn5.js";import"./GitBranch01-gzbYsobG.js";import"./Globe01-wsmSifpz.js";import"./Globe04-BbtNoerk.js";import"./SwitchHorizontal01-BSS5u6hh.js";import"./HardDrive-B2Kmw_-U.js";import"./Image01-4ZjVZeII.js";import"./Key01-BGSob3xF.js";import"./LinkExternal01-DgCDtWFz.js";import"./LockUnlocked01-DPANpO_w.js";import"./LogOut01-y1fQHOm-.js";import"./Monitor01-DZQMQTQG.js";import"./Sun-B_wiAXGd.js";import"./Package-FFc5eynf.js";import"./Palette-_BVhH0qL.js";import"./Play-mDAbVXyx.js";import"./Plus-DuwKEMqs.js";import"./SearchLg-BWCvW3vV.js";import"./SearchMd-BNMN35l9.js";import"./Shield01-CRyZWHgQ.js";import"./Stars01-CqIitG82.js";import"./Trash01-BQ7TqJow.js";import"./Upload01-BUUJWF9q.js";import"./User01-6GEEYLNL.js";import"./Users01-D3492jop.js";import"./XClose-CId8Q3oo.js";import"./Zap-C81otJUu.js";import"./dialog-CefQc73v.js";import"./extract-connection-data-DXnTgJE5.js";import"./metadata-dUsYcpuu.js";import"./connection-BOKd-Vhl.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BX1Z2C1S.js";import"./authenticate-and-persist-oauth-CjESgZgI.js";import"./mcp-oauth-1onT9Dwz.js";import"./auth-Di--WQHJ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DpXC79Fw.js";const Ge={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ye=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],Nt="var(--brand-green-dark)";function De({siteUrl:t,email:e,locale:s}){const i=(s&&Ge[s])??Ge["pt-BR"]??"https://decocms.com/agendar",o=new URL(i);return t&&o.searchParams.set("siteUrl",t),e&&o.searchParams.set("email",e),o.toString()}function Et(t){const e=N.c(15),{href:s,size:i,className:o,orgId:l}=t,a=i===void 0?"lg":i,n=Q();let c;e[0]!==o?(c=Me("w-full",o),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==l?(m=()=>ue("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:l}),e[2]=l,e[3]=m):m=e[3];let d;e[4]!==n?(d=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=d):d=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(st,{size:16}),e[6]=u):u=e[6];let f;e[7]!==s||e[8]!==m||e[9]!==d?(f=r.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",onClick:m,children:[d,u]}),e[7]=s,e[8]=m,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==a||e[12]!==c||e[13]!==f?(p=r.jsx(Ne,{asChild:!0,variant:"outline",size:a,className:c,children:f}),e[11]=a,e[12]=c,e[13]=f,e[14]=p):p=e[14],p}function Ut(t){const e=N.c(13),{size:s}=t,i=s===void 0?72:s,o=Q();let l;e[0]!==o?(l=o("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=o,e[1]=l):l=e[1];const a=l;let n;e[2]!==i?(n=Math.round(i*.3),e[2]=i,e[3]=n):n=e[3];const c=n;let m;e[4]!==i?(m={height:i},e[4]=i,e[5]=m):m=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==i?(d=Ye.map((f,p)=>r.jsxs("div",{className:"relative shrink-0",style:{width:i,height:i,marginLeft:p===0?0:-c,zIndex:Ye.length-p},children:[r.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:r.jsx("img",{src:f,alt:a,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&r.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[r.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),r.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},f)),e[6]=a,e[7]=c,e[8]=i,e[9]=d):d=e[9];let u;return e[10]!==m||e[11]!==d?(u=r.jsx("div",{className:"flex items-end",style:m,children:d}),e[10]=m,e[11]=d,e[12]=u):u=e[12],u}function Fe(t){const e=N.c(19),{href:s,orgId:i}=t,o=Q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:"h-20",style:{backgroundColor:Nt}}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"-mt-9 mb-4",children:r.jsx(Ut,{})}),e[1]=a):a=e[1];let n;e[2]!==o?(n=o("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=o,e[3]=n):n=e[3];let c;e[4]!==n?(c=r.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==o?(m=o("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=o,e[7]=m):m=e[7];let d;e[8]!==m?(d=r.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=r.jsxs("div",{className:"grid gap-1.5",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let f;e[13]!==s||e[14]!==i?(f=r.jsx(Et,{href:s,size:"lg",className:"mt-6",orgId:i}),e[13]=s,e[14]=i,e[15]=f):f=e[15];let p;return e[16]!==u||e[17]!==f?(p=r.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:r.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[l,r.jsxs("div",{className:"px-8 pb-8",children:[a,u,f]})]})}),e[16]=u,e[17]=f,e[18]=p):p=e[18],p}function tt(t){const e=N.c(10),{host:s}=t,i=`https://www.google.com/s2/favicons?domain=${s}&sz=128`;let o,l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),l=r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),a=r.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=l,e[2]=a):(o=e[0],l=e[1],a=e[2]);let n;e[3]!==i?(n=r.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:r.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=n):n=e[4];let c;e[5]!==s?(c=r.jsx("span",{className:"text-lg font-medium text-foreground",children:s}),e[5]=s,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=r.jsxs("div",{className:"flex items-center gap-3",children:[o,l,a,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function $e(t){const e=N.c(5),{variant:s}=t,i=Q();let o;e[0]!==i||e[1]!==s?(o=i(s==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=i,e[1]=s,e[2]=o):o=e[2];const l=o;let a;return e[3]!==l?(a=r.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:r.jsx(ut,{label:l,className:"text-muted-foreground"})}),e[3]=l,e[4]=a):a=e[4],a}function xr(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Lt,{}),t[0]=e):e=t[0],e}const ot=Y.createContext(null),rt=()=>Y.useContext(ot);function It(){const t=N.c(22),[e,s]=Ee(),i=e.language==="pt-BR"?"PT-BR":"EN";let o;t[0]!==i?(o=r.jsx(xt,{asChild:!0,children:r.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:i})}),t[0]=i,t[1]=o):o=t[1];let l;t[2]!==s?(l=()=>{s(zt)},t[2]=s,t[3]=l):l=t[3];const a=e.language==="en"&&"bg-accent";let n;t[4]!==a?(n=Me(a),t[4]=a,t[5]=n):n=t[5];let c;t[6]!==l||t[7]!==n?(c=r.jsx(Ke,{onClick:l,className:n,children:"English"}),t[6]=l,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==s?(m=()=>{s(Pt)},t[9]=s,t[10]=m):m=t[10];const d=e.language==="pt-BR"&&"bg-accent";let u;t[11]!==d?(u=Me(d),t[11]=d,t[12]=u):u=t[12];let f;t[13]!==m||t[14]!==u?(f=r.jsx(Ke,{onClick:m,className:u,children:"Português (Brasil)"}),t[13]=m,t[14]=u,t[15]=f):f=t[15];let p;t[16]!==c||t[17]!==f?(p=r.jsxs(yt,{align:"end",children:[c,f]}),t[16]=c,t[17]=f,t[18]=p):p=t[18];let O;return t[19]!==o||t[20]!==p?(O=r.jsxs(Ct,{children:[o,p]}),t[19]=o,t[20]=p,t[21]=O):O=t[21],O}function Pt(t){return{...t,language:"pt-BR"}}function zt(t){return{...t,language:"en"}}function H(t){const e=N.c(17);let s,i,o;e[0]!==t?({visual:o,children:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/commerce-onboarding"},e[4]=l):l=e[4];const a=Xe(l),{data:n}=Ae.useSession(),[c]=Ee(),m=n?.user?.email;let d;e[5]!==c.language||e[6]!==a.siteUrl||e[7]!==m?(d=De({siteUrl:a.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=a.siteUrl,e[7]=m,e[8]=d):d=e[8];const u=d;let f;e[9]!==u||e[10]!==o?(f=o??r.jsx(Fe,{href:u}),e[9]=u,e[10]=o,e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsxs("div",{className:"flex justify-between items-start mb-8",children:[r.jsx("div",{}),r.jsx(It,{})]}),e[12]=p):p=e[12];let O;return e[13]!==s||e[14]!==i||e[15]!==f?(O=r.jsxs(pt,{...i,visual:f,children:[p,s]}),e[13]=s,e[14]=i,e[15]=f,e[16]=O):O=e[16],O}function Rt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}let Je=!1;function Lt(){const t=Xe({from:"/commerce-onboarding"}),{org:e,siteUrl:s}=t,i=Te(s);if(!Je&&nt()){Je=!0;const o=ht(window.location.search);ue("commerce_onboarding_viewed",{site_url:s,domain:i??void 0,...o,...i?{$set:{last_scanned_domain:i}}:{}})}return r.jsx(ot.Provider,{value:i,children:r.jsx(kt,{requestedOrgSlug:e,siteUrl:s})})}function kt(t){const e=N.c(14),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),{data:l,isPending:a}=Ae.useSession(),n=rt();if(a){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(H,{children:r.jsx($e,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!l){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==o?(d=o("routes.commerceOnboarding.unlockDiagnostic"),e[1]=o,e[2]=d):d=e[2];let u;e[3]!==n?(u=n?r.jsx(tt,{host:n}):void 0,e[3]=n,e[4]=u):u=e[4];let f;e[5]!==o?(f=Rt(o),e[5]=o,e[6]=f):f=e[6];let p;return e[7]!==d||e[8]!==u||e[9]!==f?(p=r.jsx(H,{children:r.jsx(ft,{callbackUrl:m,allowAutoLogin:!1,title:d,subtitle:null,brand:u,copy:f})}),e[7]=d,e[8]=u,e[9]=f,e[10]=p):p=e[10],p}let c;return e[11]!==s||e[12]!==i?(c=r.jsx(Mt,{requestedOrgSlug:s,siteUrl:i}),e[11]=s,e[12]=i,e[13]=c):c=e[13],c}function Mt(t){const e=N.c(121),{requestedOrgSlug:s,siteUrl:i}=t,o=Q(),l=lt(),a=at(),[n,c]=Y.useState(null),[m,d]=Y.useState(null),[u,f]=Y.useState(!1),p=a.data?.map(At)??[];let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O={mutationFn:Tt,retry:!1,onSuccess:g=>{d(g)}},e[0]=O):O=e[0];const v=Ze(O);if(a.isPending){let g;return e[1]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(H,{children:r.jsx($e,{variant:"workspace"})}),e[1]=g):g=e[1],g}if(a.error){let g;e[2]!==o?(g=o("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=o,e[3]=g):g=e[3];let h;e[4]!==o?(h=o("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=o,e[5]=h):h=e[5];let x;e[6]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=x):x=e[7];let b;e[8]!==a?(b=()=>a.refetch(),e[8]=a,e[9]=b):b=e[9];let _;return e[10]!==g||e[11]!==h||e[12]!==x||e[13]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[10]=g,e[11]=h,e[12]=x,e[13]=b,e[14]=_):_=e[14],_}const w=s?p.find(g=>g.slug===s):null;if(w){let g;return e[15]!==w||e[16]!==i?(g=r.jsx(ve,{org:w,initialSiteUrl:i}),e[15]=w,e[16]=i,e[17]=g):g=e[17],g}if(s){let g;e[18]!==o?(g=o("routes.commerceOnboarding.orgNotFound"),e[18]=o,e[19]=g):g=e[19];let h;e[20]!==o?(h=o("routes.commerceOnboarding.couldNotFindOrg"),e[20]=o,e[21]=h):h=e[21];let x;e[22]!==o?(x=o("routes.commerceOnboarding.retryAgain"),e[22]=o,e[23]=x):x=e[23];let b;e[24]!==a?(b=()=>a.refetch(),e[24]=a,e[25]=b):b=e[25];let _;return e[26]!==g||e[27]!==h||e[28]!==x||e[29]!==b?(_=r.jsx(_e,{title:g,description:h,actionLabel:x,onRetry:b}),e[26]=g,e[27]=h,e[28]=x,e[29]=b,e[30]=_):_=e[30],_}if(n){let g;return e[31]!==n||e[32]!==i?(g=r.jsx(ve,{org:n,initialSiteUrl:i}),e[31]=n,e[32]=i,e[33]=g):g=e[33],g}if(p.length===1&&p[0]){let g;return e[34]!==p[0]||e[35]!==i?(g=r.jsx(ve,{org:p[0],initialSiteUrl:i}),e[34]=p[0],e[35]=i,e[36]=g):g=e[36],g}if(p.length>1){let g;e[37]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[37]=o,e[38]=g):g=e[38];let h;e[39]!==o?(h=o("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=o,e[40]=h):h=e[40];let x;e[41]!==g||e[42]!==h?(x=r.jsx(J,{title:g,description:h}),e[41]=g,e[42]=h,e[43]=x):x=e[43];let b;e[44]!==o?(b=o("routes.commerceOnboarding.authCopy.continue"),e[44]=o,e[45]=b):b=e[45];let _;e[46]!==l||e[47]!==i?(_=j=>l({to:"/commerce-onboarding",search:{org:j.slug,siteUrl:i}}),e[46]=l,e[47]=i,e[48]=_):_=e[48];let M;e[49]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!0),e[49]=M):M=e[49];let R;e[50]!==o?(R=o("routes.commerceOnboarding.createNewOrg"),e[50]=o,e[51]=R):R=e[51];let z;e[52]!==p||e[53]!==b||e[54]!==_||e[55]!==R?(z=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(Ve,{organizations:p,selectLabel:b,onSelected:_,onCreateNew:M,createNewLabel:R})}),e[52]=p,e[53]=b,e[54]=_,e[55]=R,e[56]=z):z=e[56];let U;e[57]!==x||e[58]!==z?(U=r.jsxs("div",{className:"grid gap-10",children:[x,z]}),e[57]=x,e[58]=z,e[59]=U):U=e[59];let T;e[60]!==l||e[61]!==i?(T=j=>{Se(),l({to:"/commerce-onboarding",search:{org:j,siteUrl:i}})},e[60]=l,e[61]=i,e[62]=T):T=e[62];let I;e[63]!==u||e[64]!==T?(I=r.jsx(qe,{open:u,onOpenChange:f,onCreated:T}),e[63]=u,e[64]=T,e[65]=I):I=e[65];let L;return e[66]!==U||e[67]!==I?(L=r.jsxs(H,{children:[U,I]}),e[66]=U,e[67]=I,e[68]=L):L=e[68],L}if(!m){let g;e[69]!==v?(g=()=>{v.reset(),v.mutate()},e[69]=v,e[70]=g):g=e[70];let h;return e[71]!==v||e[72]!==g?(h=r.jsx(Dt,{mutation:v,onRetry:g}),e[71]=v,e[72]=g,e[73]=h):h=e[73],h}const C=m;if(C?.success&&(C.status==="created"||C.status==="joined"||C.status==="already_has_organization")&&C.organization){let g;return e[74]!==C.organization||e[75]!==i?(g=r.jsx(ve,{org:C.organization,initialSiteUrl:i}),e[74]=C.organization,e[75]=i,e[76]=g):g=e[76],g}if(C?.status==="ambiguous"&&C.organizations&&C.organizations.length>0){let g;e[77]!==o?(g=o("routes.commerceOnboarding.chooseOrg"),e[77]=o,e[78]=g):g=e[78];let h;e[79]!==o?(h=o("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[79]=o,e[80]=h):h=e[80];let x;e[81]!==g||e[82]!==h?(x=r.jsx(J,{title:g,description:h}),e[81]=g,e[82]=h,e[83]=x):x=e[83];const b=C.organizations,_=C.domain??void 0;let M;e[84]!==l||e[85]!==i?(M=(X,Z)=>{Se(),c({...X,slug:Z}),l({to:"/commerce-onboarding",search:{org:Z,siteUrl:i}})},e[84]=l,e[85]=i,e[86]=M):M=e[86];let R;e[87]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(!0),e[87]=R):R=e[87];let z;e[88]!==o?(z=o("routes.commerceOnboarding.createNewOrg"),e[88]=o,e[89]=z):z=e[89];let U;e[90]!==C.organizations||e[91]!==_||e[92]!==M||e[93]!==z?(U=r.jsx(We,{className:"-mx-1 -my-1 max-h-[60vh] overflow-y-auto px-1 py-1",children:r.jsx(Ve,{organizations:b,domain:_,onJoined:M,onCreateNew:R,createNewLabel:z})}),e[90]=C.organizations,e[91]=_,e[92]=M,e[93]=z,e[94]=U):U=e[94];let T;e[95]!==U||e[96]!==x?(T=r.jsxs("div",{className:"grid gap-10",children:[x,U]}),e[95]=U,e[96]=x,e[97]=T):T=e[97];let I;e[98]!==l||e[99]!==i?(I=X=>{Se(),l({to:"/commerce-onboarding",search:{org:X,siteUrl:i}})},e[98]=l,e[99]=i,e[100]=I):I=e[100];let L;e[101]!==u||e[102]!==I?(L=r.jsx(qe,{open:u,onOpenChange:f,onCreated:I}),e[101]=u,e[102]=I,e[103]=L):L=e[103];let j;return e[104]!==T||e[105]!==L?(j=r.jsxs(H,{children:[T,L]}),e[104]=T,e[105]=L,e[106]=j):j=e[106],j}let P;e[107]!==o?(P=o("routes.commerceOnboarding.onboardingNeedsSupport"),e[107]=o,e[108]=P):P=e[108];let E;e[109]!==C?.error||e[110]!==o?(E=C?.error??o("routes.commerceOnboarding.couldNotDetermineOrg"),e[109]=C?.error,e[110]=o,e[111]=E):E=e[111];let A;e[112]!==o?(A=o("routes.commerceOnboarding.retryAgain"),e[112]=o,e[113]=A):A=e[113];let W;e[114]!==v?(W=()=>{d(null),v.reset()},e[114]=v,e[115]=W):W=e[115];let q;return e[116]!==P||e[117]!==E||e[118]!==A||e[119]!==W?(q=r.jsx(_e,{title:P,description:E,actionLabel:A,onRetry:W}),e[116]=P,e[117]=E,e[118]=A,e[119]=W,e[120]=q):q=e[120],q}async function Tt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Se(),e}function At(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Dt(t){const e=N.c(16),{mutation:s,onRetry:i}=t,o=Q(),l=Y.useRef(!1);let a;e[0]!==s?(a=d=>{!d||l.current||(l.current=!0,s.mutate())},e[0]=s,e[1]=a):a=e[1];const n=a;if(s.error){let d;e[2]!==o?(d=o("routes.commerceOnboarding.onboardingUnavailable"),e[2]=o,e[3]=d):d=e[3];let u;e[4]!==o?(u=o("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=o,e[5]=u):u=e[5];let f;e[6]!==o?(f=o("routes.commerceOnboarding.retryAgain"),e[6]=o,e[7]=f):f=e[7];let p;return e[8]!==i||e[9]!==d||e[10]!==u||e[11]!==f?(p=r.jsx(_e,{title:d,description:u,actionLabel:f,onRetry:i}),e[8]=i,e[9]=d,e[10]=u,e[11]=f,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx($e,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=r.jsx(H,{children:r.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function J(t){const e=N.c(8),{title:s,description:i}=t,o=rt();let l;e[0]!==o?(l=o?r.jsx(tt,{host:o}):r.jsxs("div",{children:[r.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),r.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i||e[3]!==s?(a=(s||i)&&r.jsxs("div",{className:"space-y-2",children:[s&&r.jsx("h1",{className:"text-2xl font-medium leading-8",children:s}),i&&r.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=s,e[4]=a):a=e[4];let n;return e[5]!==l||e[6]!==a?(n=r.jsxs("div",{className:"grid gap-10",children:[l,a]}),e[5]=l,e[6]=a,e[7]=n):n=e[7],n}function _e(t){const e=N.c(9),{title:s,description:i,actionLabel:o,onRetry:l}=t;let a;e[0]!==i||e[1]!==s?(a=r.jsx(J,{title:s,description:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let n;e[3]!==o||e[4]!==l?(n=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:l,children:o}),e[3]=o,e[4]=l,e[5]=n):n=e[5];let c;return e[6]!==a||e[7]!==n?(c=r.jsx(H,{children:r.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=c):c=e[8],c}function ve(t){const e=N.c(13),{org:s,initialSiteUrl:i}=t,o=Q(),{data:l}=Ae.useSession(),[a]=Ee(),n=l?.user?.email;let c;e[0]!==i||e[1]!==a.language||e[2]!==n?(c=De({siteUrl:i,email:n,locale:a.language}),e[0]=i,e[1]=a.language,e[2]=n,e[3]=c):c=e[3];const m=c;let d;e[4]!==m||e[5]!==s.id?(d=r.jsx(Fe,{href:m,orgId:s.id}),e[4]=m,e[5]=s.id,e[6]=d):d=e[6];const u=d;let f;return e[7]!==i||e[8]!==u||e[9]!==s||e[10]!==l?.user?.email||e[11]!==o?(f=r.jsx(ct,{children:p=>{const{reset:O}=p;return r.jsx(mt,{fallback:v=>{const{error:w,resetError:C}=v;return r.jsx(H,{visual:u,children:r.jsx(Ft,{orgName:s.name,message:w instanceof Error?w.message:o("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{O(),C()}})})},children:r.jsx(Y.Suspense,{fallback:r.jsx(it,{visual:u}),children:r.jsx($t,{org:s,initialSiteUrl:i,sessionEmail:l?.user?.email},`${s.id}:${i??""}`)})})}}),e[7]=i,e[8]=u,e[9]=s,e[10]=l?.user?.email,e[11]=o,e[12]=f):f=e[12],f}function it(t){const e=N.c(3),{visual:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[r.jsx(J,{}),r.jsx(et,{})]}),e[0]=i):i=e[0];let o;return e[1]!==s?(o=r.jsx(H,{align:"fill",visual:s,children:i}),e[1]=s,e[2]=o):o=e[2],o}function Ft(t){const e=N.c(19),{orgName:s,message:i,onRetry:o}=t,l=Q();let a;e[0]!==l?(a=l("routes.commerceOnboarding.commerceDiagnostic"),e[0]=l,e[1]=a):a=e[1];let n;e[2]!==s||e[3]!==l?(n=l("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s}),e[2]=s,e[3]=l,e[4]=n):n=e[4];let c;e[5]!==a||e[6]!==n?(c=r.jsx(J,{title:a,description:n}),e[5]=a,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==i?(m=r.jsx(we,{message:i}),e[8]=i,e[9]=m):m=e[9];let d;e[10]!==l?(d=l("routes.commerceOnboarding.retryAgain"),e[10]=l,e[11]=d):d=e[11];let u;e[12]!==o||e[13]!==d?(u=r.jsx(Ne,{type:"button",size:"xl",className:"w-full",onClick:o,children:d}),e[12]=o,e[13]=d,e[14]=u):u=e[14];let f;return e[15]!==c||e[16]!==m||e[17]!==u?(f=r.jsxs("div",{className:"grid gap-10",children:[c,m,u]}),e[15]=c,e[16]=m,e[17]=u,e[18]=f):f=e[18],f}function $t(t){const e=N.c(135),{org:s,initialSiteUrl:i,sessionEmail:o}=t;let l;e[0]!==s.id||e[1]!==s.slug?(l={connectionId:Ot,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l):l=e[2];const a=jt(l),[n,c]=Y.useState(i??""),[m,d]=Y.useState(null),u=Y.useRef(!1),f=vt.COMMERCE_DISCOVERY(s.id),p=St(s.id),O=Be.commerceDiscoveryConnection(s.id,f);let v;e[3]!==f||e[4]!==a?(v=async()=>{const y=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return Le(y)},e[3]=f,e[4]=a,e[5]=v):v=e[5];let w;e[6]!==O||e[7]!==v?(w={queryKey:O,queryFn:v,retry:!1},e[6]=O,e[7]=v,e[8]=w):w=e[8];const C=He(w),P=Be.commerceDiscoveryVirtualMcp(s.id,p);let E;e[9]!==a||e[10]!==p?(E=async()=>{const y=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Le(y)},e[9]=a,e[10]=p,e[11]=E):E=e[11];let A;e[12]!==P||e[13]!==E?(A={queryKey:P,queryFn:E,retry:!1},e[12]=P,e[13]=E,e[14]=A):A=e[14];const W=He(A);let q;e[15]!==a?(q=async y=>{const S=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Le(S)},e[15]=a,e[16]=q):q=e[16];let g;e[17]!==C||e[18]!==s.id||e[19]!==W?(g=(y,S)=>{ue("commerce_onboarding_setup_succeeded",{domain:Te(S)??void 0,organization_id:s.id}),d(null),C.refetch(),W.refetch()},e[17]=C,e[18]=s.id,e[19]=W,e[20]=g):g=e[20];let h;e[21]!==s.id?(h=(y,S)=>{ue("commerce_onboarding_setup_failed",{domain:Te(S)??void 0,organization_id:s.id,error:y instanceof Error?y.message:String(y)}),d(y instanceof Error?y.message:"__configurationFailed")},e[21]=s.id,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==q||e[25]!==g?(x={mutationFn:q,retry:!1,onSuccess:g,onError:h},e[23]=h,e[24]=q,e[25]=g,e[26]=x):x=e[26];const b=Ze(x),_=!!C.data.item&&!!W.data.item,M=C.data.item,R=typeof M?.metadata?.siteUrl=="string"?M.metadata.siteUrl:void 0,z=i||n||"";let U;e[27]!==R||e[28]!==z?(U=gt(z,R),e[27]=R,e[28]=z,e[29]=U):U=e[29];const I=_&&U,L=i||n||R||"",j=Q(),[X]=Ee();let Z;e[30]!==L||e[31]!==X.language||e[32]!==o?(Z=De({siteUrl:L,email:o,locale:X.language}),e[30]=L,e[31]=X.language,e[32]=o,e[33]=Z):Z=e[33];const Ue=Z;let ge;e[34]!==Ue||e[35]!==s.id?(ge=r.jsx(Fe,{href:Ue,orgId:s.id}),e[34]=Ue,e[35]=s.id,e[36]=ge):ge=e[36];const $=ge;let fe;e[37]!==m||e[38]!==j?(fe=m?Qe(j,m):null,e[37]=m,e[38]=j,e[39]=fe):fe=e[39];const B=fe;let pe;e[40]!==b?(pe=y=>{const S=Re(y);if(!S.ok){d(S.error);return}d(null),b.mutate(S.value)},e[40]=b,e[41]=pe):pe=e[41];const ee=pe;let he;e[42]!==i||e[43]!==ee||e[44]!==I?(he=y=>{!y||u.current||I||!i||(u.current=!0,ee(i))},e[42]=i,e[43]=ee,e[44]=I,e[45]=he):he=e[45];const Ie=he;let be;e[46]!==s.id||e[47]!==ee||e[48]!==n?(be=y=>{y.preventDefault();const S=Re(n);S.ok&&ue("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:s.id}),ee(n)},e[46]=s.id,e[47]=ee,e[48]=n,e[49]=be):be=e[49];const V=be;if(I){const y=s.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let k;e[51]!==s.slug?(k={org:y,taskId:S},e[51]=s.slug,e[52]=k):k=e[52];let D;e[53]!==s.id?(D=_t(s.id),e[53]=s.id,e[54]=D):D=e[54];const G=L||void 0;let F;e[55]!==D.id||e[56]!==G?(F={virtualmcpid:D.id,connect:"1",siteUrl:G},e[55]=D.id,e[56]=G,e[57]=F):F=e[57];let K;return e[58]!==k||e[59]!==F?(K=r.jsx(dt,{to:"/$org/$taskId",params:k,search:F,replace:!0}),e[58]=k,e[59]=F,e[60]=K):K=e[60],K}if(b.isPending){let y;return e[61]!==$?(y=r.jsx(it,{visual:$}),e[61]=$,e[62]=y):y=e[62],y}if(i){let y,S,k,D,G,F,K,ne;if(e[63]!==$||e[64]!==V||e[65]!==i||e[66]!==s.name||e[67]!==b.isPending||e[68]!==n||e[69]!==j||e[70]!==B||e[71]!==Ie){ne=Symbol.for("react.early_return_sentinel");e:{const Pe=Re(i);if(!Pe.ok){let me;e[80]!==j?(me=j("routes.commerceOnboarding.commerceDiagnostic"),e[80]=j,e[81]=me):me=e[81];let de;e[82]!==s.name||e[83]!==j?(de=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[82]=s.name,e[83]=j,e[84]=de):de=e[84];let Ce;e[85]!==me||e[86]!==de?(Ce=r.jsx(J,{title:me,description:de}),e[85]=me,e[86]=de,e[87]=Ce):Ce=e[87];let je;e[88]!==V||e[89]!==b.isPending||e[90]!==n||e[91]!==B?(je=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[88]=V,e[89]=b.isPending,e[90]=n,e[91]=B,e[92]=je):je=e[92];const ze=r.jsxs("div",{className:"grid gap-10",children:[Ce,r.jsx(we,{message:Qe(j,Pe.error)}),je]});let Oe;e[93]!==$||e[94]!==ze?(Oe=r.jsx(H,{visual:$,children:ze}),e[93]=$,e[94]=ze,e[95]=Oe):Oe=e[95],ne=Oe;break e}S=H,K=$,G=Ie,F="grid gap-10",y=J,e[96]!==j?(k=j("routes.commerceOnboarding.commerceDiagnostic"),e[96]=j,e[97]=k):k=e[97],D=j("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Pe.value})}e[63]=$,e[64]=V,e[65]=i,e[66]=s.name,e[67]=b.isPending,e[68]=n,e[69]=j,e[70]=B,e[71]=Ie,e[72]=y,e[73]=S,e[74]=k,e[75]=D,e[76]=G,e[77]=F,e[78]=K,e[79]=ne}else y=e[72],S=e[73],k=e[74],D=e[75],G=e[76],F=e[77],K=e[78],ne=e[79];if(ne!==Symbol.for("react.early_return_sentinel"))return ne;let le;e[98]!==y||e[99]!==k||e[100]!==D?(le=r.jsx(y,{title:k,description:D}),e[98]=y,e[99]=k,e[100]=D,e[101]=le):le=e[101];let ae;e[102]!==V||e[103]!==b.isPending||e[104]!==n||e[105]!==B?(ae=B?r.jsxs(r.Fragment,{children:[r.jsx(we,{message:B}),r.jsx(ke,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V})]}):r.jsx(et,{}),e[102]=V,e[103]=b.isPending,e[104]=n,e[105]=B,e[106]=ae):ae=e[106];let ce;e[107]!==G||e[108]!==F||e[109]!==le||e[110]!==ae?(ce=r.jsxs("div",{ref:G,className:F,children:[le,ae]}),e[107]=G,e[108]=F,e[109]=le,e[110]=ae,e[111]=ce):ce=e[111];let ye;return e[112]!==S||e[113]!==K||e[114]!==ce?(ye=r.jsx(S,{visual:K,children:ce}),e[112]=S,e[113]=K,e[114]=ce,e[115]=ye):ye=e[115],ye}let te;e[116]!==j?(te=j("routes.commerceOnboarding.commerceDiagnostic"),e[116]=j,e[117]=te):te=e[117];let oe;e[118]!==s.name||e[119]!==j?(oe=j("routes.commerceOnboarding.configurationWillContinueIn",{orgName:s.name}),e[118]=s.name,e[119]=j,e[120]=oe):oe=e[120];let re;e[121]!==te||e[122]!==oe?(re=r.jsx(J,{title:te,description:oe}),e[121]=te,e[122]=oe,e[123]=re):re=e[123];let ie;e[124]!==V||e[125]!==b.isPending||e[126]!==n||e[127]!==B?(ie=r.jsx(ke,{siteUrl:n,error:B,isSubmitting:b.isPending,onSiteUrlChange:c,onSubmit:V}),e[124]=V,e[125]=b.isPending,e[126]=n,e[127]=B,e[128]=ie):ie=e[128];let se;e[129]!==re||e[130]!==ie?(se=r.jsxs("div",{className:"grid gap-10",children:[re,ie]}),e[129]=re,e[130]=ie,e[131]=se):se=e[131];let xe;return e[132]!==$||e[133]!==se?(xe=r.jsx(H,{visual:$,children:se}),e[132]=$,e[133]=se,e[134]=xe):xe=e[134],xe}function ke(t){const e=N.c(30),{siteUrl:s,error:i,isSubmitting:o,onSiteUrlChange:l,onSubmit:a}=t,n=Q();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=r.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let d;e[4]!==l?(d=A=>l(A.target.value),e[4]=l,e[5]=d):d=e[5];let u;e[6]!==n?(u=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=u):u=e[7];const f=!!i;let p;e[8]!==o||e[9]!==s||e[10]!==d||e[11]!==u||e[12]!==f?(p=r.jsx(bt,{id:"commerce-site-url",type:"text",inputMode:"url",value:s,onChange:d,placeholder:u,"aria-invalid":f,disabled:o}),e[8]=o,e[9]=s,e[10]=d,e[11]=u,e[12]=f,e[13]=p):p=e[13];let O;e[14]!==i?(O=i?r.jsx(we,{message:i}):null,e[14]=i,e[15]=O):O=e[15];let v;e[16]!==m||e[17]!==p||e[18]!==O?(v=r.jsxs("div",{className:"grid gap-2",children:[m,p,O]}),e[16]=m,e[17]=p,e[18]=O,e[19]=v):v=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(wt,{size:16}),e[22]=C):C=e[22];let P;e[23]!==o||e[24]!==w?(P=r.jsxs(Ne,{type:"submit",size:"xl",className:"w-full",disabled:o,children:[w,C]}),e[23]=o,e[24]=w,e[25]=P):P=e[25];let E;return e[26]!==a||e[27]!==P||e[28]!==v?(E=r.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[v,P]}),e[26]=a,e[27]=P,e[28]=v,e[29]=E):E=e[29],E}function we(t){const e=N.c(2),{message:s}=t;let i;return e[0]!==s?(i=r.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:s}),e[0]=s,e[1]=i):i=e[1],i}export{xr as default};
@@ -1 +1 @@
1
- import{fh as re,r as I,c as $,H as Q,ac as U,p as Z,o as W,K,b as oe,e as O,q as ie,t as Y,bp as le}from"./index-DZLUP-bk.js";import{c as ce,d as ue,e as de}from"./task-board-DTv9gW69.js";import{t as fe}from"./decopilot-sse-pool-POUs7TGl.js";import{u as me}from"./use-decopilot-events-DVLYFd8Z.js";import{i as ye}from"./AlertCircle-f4nnpTTg.js";import{f as ge,g as pe,h as z,n as ke,t as _e,l as Se,m as Te,i as he,k as Be,a as Ee,s as Ne}from"./UserSquare-B8RaUikS.js";import{i as be}from"./CheckCircle-tNccGo23.js";import{a as ee}from"./DotsVertical-BVchZPc_.js";import{s as Ae}from"./Eye-WB67QJ1C.js";import{i as De}from"./Shield01-Y6gzbv7o.js";const Ce=re("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),J=()=>0;function Ie(e){const{orgSlug:r,enabled:n=!0,onUpdate:a,onDelete:t,onResync:i}=e,o=I.useRef(a);o.current=a;const l=I.useRef(t);l.current=t;const d=I.useRef(i);d.current=i;const s=I.useRef(null),c=I.useRef(n),_=I.useRef(r);(!s.current||c.current!==n||_.current!==r)&&(c.current=n,_.current=r,s.current=T=>{if(!n||!r)return()=>{};const p=S=>{let y;try{y=JSON.parse(S.data)}catch{return}y.data&&(S.type===ce?l.current?.(y.data.id):o.current(y.data)),T()};return fe.subscribe(r,p,()=>d.current?.())}),I.useSyncExternalStore(s.current,J,J)}function We(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.sprints?(l=new Map((o?.sprints??[]).map(Ke)),e[7]=o?.sprints,e[8]=l):l=e[8],l}function Ke(e){return[e.id,e]}function ze(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.columns?(l=o?.columns??[],e[7]=o?.columns,e[8]=l):l=e[8],l}function Je(){const e=$.c(38),{org:r,locator:n}=Q(),a=U(),t=Z();let i;e[0]!==n?(i=K.taskBoardItems(n),e[0]=n,e[1]=i):i=e[1];const o=i;let l;e[2]!==a?(l=async()=>{const{items:m,sprints:f,columns:k}=await a.call("TASK_BOARD_ITEM_LIST",{});return{items:m,sprints:f,columns:k}},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d={queryKey:o,queryFn:l,refetchInterval:6e4},e[4]=o,e[5]=l,e[6]=d):d=e[6];const s=W(d);let c;e[7]!==n||e[8]!==t||e[9]!==o?(c=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.some(k=>k.id===m.id)?f.items.map(k=>k.id===m.id?m:k):[m,...f.items]}),t.invalidateQueries({queryKey:K.taskBoardActivity(n,m.id)})},e[7]=n,e[8]=t,e[9]=o,e[10]=c):c=e[10];let _,E;e[11]!==t||e[12]!==o?(_=()=>{t.invalidateQueries({queryKey:o})},E=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.filter(k=>k.id!==m)})},e[11]=t,e[12]=o,e[13]=_,e[14]=E):(_=e[13],E=e[14]);let T;e[15]!==r.slug||e[16]!==c||e[17]!==_||e[18]!==E?(T={orgSlug:r.slug,onUpdate:c,onResync:_,onDelete:E},e[15]=r.slug,e[16]=c,e[17]=_,e[18]=E,e[19]=T):T=e[19],Ie(T);let p;e[20]!==t||e[21]!==o?(p=m=>{const f=m.subject,k=m.data.status;t.cancelQueries({queryKey:o}),t.setQueryData(o,C=>C&&{...C,items:C.items.map(b=>b.threads.some(B=>B.threadId===f)?{...b,threads:b.threads.map(B=>B.threadId===f?{...B,status:k}:B)}:b)})},e[20]=t,e[21]=o,e[22]=p):p=e[22];let S;e[23]!==r.slug||e[24]!==p?(S={orgSlug:r.slug,onTaskStatus:p},e[23]=r.slug,e[24]=p,e[25]=S):S=e[25],me(S);let y;e[26]!==s.data?.items?(y=s.data?.items??[],e[26]=s.data?.items,e[27]=y):y=e[27];let h;e[28]!==s.data?.sprints?(h=s.data?.sprints??[],e[28]=s.data?.sprints,e[29]=h):h=e[29];let N;e[30]!==s.data?.columns?(N=s.data?.columns??[],e[30]=s.data?.columns,e[31]=N):N=e[31];let D;return e[32]!==s.error||e[33]!==s.isLoading||e[34]!==h||e[35]!==N||e[36]!==y?(D={items:y,sprints:h,columns:N,isLoading:s.isLoading,error:s.error},e[32]=s.error,e[33]=s.isLoading,e[34]=h,e[35]=N,e[36]=y,e[37]=D):D=e[37],D}function Xe(){const e=$.c(70),{org:r,locator:n}=Q(),a=U(),t=Z(),i=oe();let o;e[0]!==n?(o=K.taskBoardItems(n),e[0]=n,e[1]=o):o=e[1];const l=o;let d;e[2]!==t||e[3]!==l?(d=()=>t.invalidateQueries({queryKey:l}),e[2]=t,e[3]=l,e[4]=d):d=e[4];const s=d;let c;e[5]!==a?(c=u=>a.call("TASK_BOARD_ITEM_CREATE",u),e[5]=a,e[6]=c):c=e[6];let _;e[7]!==s||e[8]!==c?(_={mutationFn:c,onSuccess:s},e[7]=s,e[8]=c,e[9]=_):_=e[9];const E=O(_);let T;e[10]!==a?(T=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[10]=a,e[11]=T):T=e[11];let p;e[12]!==t||e[13]!==l?(p=async u=>{await t.cancelQueries({queryKey:l});const A=t.getQueryData(l);return t.setQueryData(l,g=>g&&{...g,items:g.items.map(j=>j.id===u.id?{...j,...u}:j)}),{previous:A}},e[12]=t,e[13]=l,e[14]=p):p=e[14];let S;e[15]!==r?(S=(u,A)=>{A.status==="done"&&ie("task_marked_done",{organization_id:r.id,task_board_item_id:A.id})},e[15]=r,e[16]=S):S=e[16];let y;e[17]!==t||e[18]!==l?(y=(u,A,g)=>{g?.previous&&t.setQueryData(l,g.previous)},e[17]=t,e[18]=l,e[19]=y):y=e[19];let h;e[20]!==s||e[21]!==n||e[22]!==t?(h=(u,A,g)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,g.id)})},e[20]=s,e[21]=n,e[22]=t,e[23]=h):h=e[23];let N;e[24]!==T||e[25]!==p||e[26]!==S||e[27]!==y||e[28]!==h?(N={mutationFn:T,onMutate:p,onSuccess:S,onError:y,onSettled:h},e[24]=T,e[25]=p,e[26]=S,e[27]=y,e[28]=h,e[29]=N):N=e[29];const D=O(N);let m;e[30]!==a?(m=u=>a.call("TASK_BOARD_ITEM_DELETE",{id:u}),e[30]=a,e[31]=m):m=e[31];let f;e[32]!==s||e[33]!==i?(f=u=>{Y.error(u instanceof Error&&u.message?u.message:i("taskBoard.taskBoard.deleteError")),s()},e[32]=s,e[33]=i,e[34]=f):f=e[34];let k;e[35]!==s||e[36]!==m||e[37]!==f?(k={mutationFn:m,onSuccess:s,onError:f},e[35]=s,e[36]=m,e[37]=f,e[38]=k):k=e[38];const C=O(k);let b;e[39]!==a?(b=async u=>{const A=await Promise.allSettled(u.map(g=>a.call("TASK_BOARD_ITEM_DELETE",{id:g})));return{total:u.length,failed:A.filter(Re).length}},e[39]=a,e[40]=b):b=e[40];let B,R;e[41]!==i?(B=u=>{const{total:A,failed:g}=u;g!==0&&Y.error(i("taskBoard.taskBoard.deleteBulkError",{failed:String(g),total:String(A)}))},R=()=>Y.error(i("taskBoard.taskBoard.deleteError")),e[41]=i,e[42]=B,e[43]=R):(B=e[42],R=e[43]);let L;e[44]!==s||e[45]!==b||e[46]!==B||e[47]!==R?(L={mutationFn:b,onSuccess:B,onError:R,onSettled:s},e[44]=s,e[45]=b,e[46]=B,e[47]=R,e[48]=L):L=e[48];const P=O(L);let x;e[49]!==a?(x=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[49]=a,e[50]=x):x=e[50];let M;e[51]!==s||e[52]!==x?(M={mutationFn:x,onSuccess:s},e[51]=s,e[52]=x,e[53]=M):M=e[53];const H=O(M);let v;e[54]!==a?(v=u=>a.call("TASK_BOARD_ITEM_RERUN",u),e[54]=a,e[55]=v):v=e[55];let w;e[56]!==s||e[57]!==n||e[58]!==t?(w=(u,A,g)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,g.id)})},e[56]=s,e[57]=n,e[58]=t,e[59]=w):w=e[59];let F;e[60]!==v||e[61]!==w?(F={mutationFn:v,onSettled:w},e[60]=v,e[61]=w,e[62]=F):F=e[62];const V=O(F);let q;return e[63]!==E||e[64]!==H||e[65]!==C||e[66]!==P||e[67]!==V||e[68]!==D?(q={create:E,update:D,remove:C,removeMany:P,link:H,rerun:V},e[63]=E,e[64]=H,e[65]=C,e[66]=P,e[67]=V,e[68]=D,e[69]=q):q=e[69],q}function Re(e){return e.status==="rejected"}const xe=["ended_after_delivery","superseded"];function ve(e){return!!e&&xe.includes(e)}function Ze(e){return!(e.action==="status_changed"&&typeof e.data?.retry=="number")}function et(e){return e.failureKind!=="superseded"}const we=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"});function tt(e){const r=t=>{if(!t)return null;const i=Date.parse(t);return Number.isNaN(i)?null:we.format(new Date(i))},n=r(e.startsAt),a=r(e.endsAt);return!n&&!a?null:n&&a?`${n} – ${a}`:n??a}function te(e){return e.threads.some(r=>r.status==="requires_action")}function st(e){return e.status==="in_review"&&!e.assigneeId}function at(e){return te(e)}function nt(e){return e.status==="in_progress"&&te(e)?"text-warning animate-pulse":ne(e.status).iconClassName}function rt(e){return e.threads.some(n=>n.status==="in_progress")?"running":e.threads.some(n=>n.status==="failed"&&!ve(n.failureKind))?"failed":null}function ot(e,r,n){const a=e.findIndex(c=>c.id===n),t=r===n?e[a+1]?.id??null:r,i=e.filter(c=>c.id!==n),o=t?i.findIndex(c=>c.id===t):-1,l=o===-1?i.length:o,d=i[l-1],s=i[l];return d&&s?(d.sortOrder+s.sortOrder)/2:d?d.sortOrder+1:s?s.sortOrder-1:0}function it(e,r){return Array.from({length:r},(n,a)=>e-(r-1-a)*1e-4)}const Oe=["archived"],se={triage:{labelKey:"taskBoard.config.statusBacklog",icon:ye,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ee,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:he,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Ae,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Te,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Se,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:_e,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:be,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:le,iconClassName:"text-muted-foreground"}},ae={icon:ee,iconClassName:"text-muted-foreground"},Le=se;function ne(e){return Le[e]??ae}function Me(e,r,n){const a=se[e];return a?r(a.labelKey):n}function lt(e,r,n){const a=n.find(t=>t.key===e);return a?{label:Me(e,r,a.title),visual:ne(e),offBoard:!1}:{label:e,visual:ae,offBoard:!0}}const ct=["bug","feature","chore","spike","security"],ut={bug:{labelKey:"taskBoard.config.typeBug",icon:Ce,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ne,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Ee,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Be,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:De,iconClassName:"text-purple-500"}};function G(e){return de.includes(e)}function dt(e,r){return e.map(n=>n.key).filter(n=>r||!G(n))}function ft({columns:e,deliveryEnabled:r,shownLanes:n,occupied:a}){const t=e.map(s=>s.key).filter(s=>r||!G(s)||a.includes(s)),i=t.filter(s=>Oe.includes(s)||!r&&G(s)),o=i.filter(s=>!n.includes(s)),l=new Set(t),d=[...new Set(a)].filter(s=>!l.has(s)).sort();return{lanes:[...t.filter(s=>!o.includes(s)),...d],hidden:o,hideable:i,unplaced:d}}const X="lane:";function mt({overId:e,columnKeys:r,statusOf:n}){if(e===void 0)return null;const a=String(e),t=a.startsWith(X)?a.slice(X.length):n(a);return t!==void 0&&r.has(t)?t:null}const yt=["none","low","medium","high","urgent"],gt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:z,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ke,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:z,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:pe,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:ge,iconClassName:"text-destructive"}};function pt(e,r=Date.now()){const n=new Date(e).getTime();return Number.isNaN(n)?null:n<r?"overdue":n-r<=Fe*864e5?"soon":null}const Fe=3;function kt(e){return`color-mix(in oklab, ${e??ue} var(--user-color-strength), transparent)`}export{Oe as H,X as L,gt as P,se as S,ut as T,yt as a,We as b,lt as c,ct as d,et as e,tt as f,ve as g,Je as h,Ze as i,Xe as j,ft as k,ne as l,dt as m,te as n,st as o,rt as p,at as q,it as r,nt as s,kt as t,ze as u,ot as v,mt as w,pt as x,G as y};
1
+ import{fh as re,r as I,c as $,H as Q,ac as U,p as Z,o as W,K,b as oe,e as O,q as ie,t as Y,bp as le}from"./index-CyVZ5lgJ.js";import{c as ce,d as ue,e as de}from"./task-board-BR_pi0j4.js";import{t as fe}from"./decopilot-sse-pool-BGdXs4q_.js";import{u as me}from"./use-decopilot-events-BCpugb4D.js";import{i as ye}from"./AlertCircle-Cbfze2vA.js";import{f as ge,g as pe,h as z,n as ke,t as _e,l as Se,m as Te,i as he,k as Be,a as Ee,s as Ne}from"./UserSquare-B1QhMNkc.js";import{i as be}from"./CheckCircle-DyLCcRg7.js";import{a as ee}from"./DotsVertical-Cn-HQJLl.js";import{s as Ae}from"./Eye-CFsMHhc3.js";import{i as De}from"./Shield01-CRyZWHgQ.js";const Ce=re("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]),J=()=>0;function Ie(e){const{orgSlug:r,enabled:n=!0,onUpdate:a,onDelete:t,onResync:i}=e,o=I.useRef(a);o.current=a;const l=I.useRef(t);l.current=t;const d=I.useRef(i);d.current=i;const s=I.useRef(null),c=I.useRef(n),_=I.useRef(r);(!s.current||c.current!==n||_.current!==r)&&(c.current=n,_.current=r,s.current=T=>{if(!n||!r)return()=>{};const p=S=>{let y;try{y=JSON.parse(S.data)}catch{return}y.data&&(S.type===ce?l.current?.(y.data.id):o.current(y.data)),T()};return fe.subscribe(r,p,()=>d.current?.())}),I.useSyncExternalStore(s.current,J,J)}function We(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.sprints?(l=new Map((o?.sprints??[]).map(Ke)),e[7]=o?.sprints,e[8]=l):l=e[8],l}function Ke(e){return[e.id,e]}function ze(){const e=$.c(9),{locator:r}=Q(),n=U();let a;e[0]!==r?(a=K.taskBoardItems(r),e[0]=r,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>{const{items:d,sprints:s,columns:c}=await n.call("TASK_BOARD_ITEM_LIST",{});return{items:d,sprints:s,columns:c}},e[2]=n,e[3]=t):t=e[3];let i;e[4]!==a||e[5]!==t?(i={queryKey:a,queryFn:t},e[4]=a,e[5]=t,e[6]=i):i=e[6];const{data:o}=W(i);let l;return e[7]!==o?.columns?(l=o?.columns??[],e[7]=o?.columns,e[8]=l):l=e[8],l}function Je(){const e=$.c(38),{org:r,locator:n}=Q(),a=U(),t=Z();let i;e[0]!==n?(i=K.taskBoardItems(n),e[0]=n,e[1]=i):i=e[1];const o=i;let l;e[2]!==a?(l=async()=>{const{items:m,sprints:f,columns:k}=await a.call("TASK_BOARD_ITEM_LIST",{});return{items:m,sprints:f,columns:k}},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d={queryKey:o,queryFn:l,refetchInterval:6e4},e[4]=o,e[5]=l,e[6]=d):d=e[6];const s=W(d);let c;e[7]!==n||e[8]!==t||e[9]!==o?(c=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.some(k=>k.id===m.id)?f.items.map(k=>k.id===m.id?m:k):[m,...f.items]}),t.invalidateQueries({queryKey:K.taskBoardActivity(n,m.id)})},e[7]=n,e[8]=t,e[9]=o,e[10]=c):c=e[10];let _,E;e[11]!==t||e[12]!==o?(_=()=>{t.invalidateQueries({queryKey:o})},E=m=>{t.cancelQueries({queryKey:o}),t.setQueryData(o,f=>f&&{...f,items:f.items.filter(k=>k.id!==m)})},e[11]=t,e[12]=o,e[13]=_,e[14]=E):(_=e[13],E=e[14]);let T;e[15]!==r.slug||e[16]!==c||e[17]!==_||e[18]!==E?(T={orgSlug:r.slug,onUpdate:c,onResync:_,onDelete:E},e[15]=r.slug,e[16]=c,e[17]=_,e[18]=E,e[19]=T):T=e[19],Ie(T);let p;e[20]!==t||e[21]!==o?(p=m=>{const f=m.subject,k=m.data.status;t.cancelQueries({queryKey:o}),t.setQueryData(o,C=>C&&{...C,items:C.items.map(b=>b.threads.some(B=>B.threadId===f)?{...b,threads:b.threads.map(B=>B.threadId===f?{...B,status:k}:B)}:b)})},e[20]=t,e[21]=o,e[22]=p):p=e[22];let S;e[23]!==r.slug||e[24]!==p?(S={orgSlug:r.slug,onTaskStatus:p},e[23]=r.slug,e[24]=p,e[25]=S):S=e[25],me(S);let y;e[26]!==s.data?.items?(y=s.data?.items??[],e[26]=s.data?.items,e[27]=y):y=e[27];let h;e[28]!==s.data?.sprints?(h=s.data?.sprints??[],e[28]=s.data?.sprints,e[29]=h):h=e[29];let N;e[30]!==s.data?.columns?(N=s.data?.columns??[],e[30]=s.data?.columns,e[31]=N):N=e[31];let D;return e[32]!==s.error||e[33]!==s.isLoading||e[34]!==h||e[35]!==N||e[36]!==y?(D={items:y,sprints:h,columns:N,isLoading:s.isLoading,error:s.error},e[32]=s.error,e[33]=s.isLoading,e[34]=h,e[35]=N,e[36]=y,e[37]=D):D=e[37],D}function Xe(){const e=$.c(70),{org:r,locator:n}=Q(),a=U(),t=Z(),i=oe();let o;e[0]!==n?(o=K.taskBoardItems(n),e[0]=n,e[1]=o):o=e[1];const l=o;let d;e[2]!==t||e[3]!==l?(d=()=>t.invalidateQueries({queryKey:l}),e[2]=t,e[3]=l,e[4]=d):d=e[4];const s=d;let c;e[5]!==a?(c=u=>a.call("TASK_BOARD_ITEM_CREATE",u),e[5]=a,e[6]=c):c=e[6];let _;e[7]!==s||e[8]!==c?(_={mutationFn:c,onSuccess:s},e[7]=s,e[8]=c,e[9]=_):_=e[9];const E=O(_);let T;e[10]!==a?(T=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[10]=a,e[11]=T):T=e[11];let p;e[12]!==t||e[13]!==l?(p=async u=>{await t.cancelQueries({queryKey:l});const A=t.getQueryData(l);return t.setQueryData(l,g=>g&&{...g,items:g.items.map(j=>j.id===u.id?{...j,...u}:j)}),{previous:A}},e[12]=t,e[13]=l,e[14]=p):p=e[14];let S;e[15]!==r?(S=(u,A)=>{A.status==="done"&&ie("task_marked_done",{organization_id:r.id,task_board_item_id:A.id})},e[15]=r,e[16]=S):S=e[16];let y;e[17]!==t||e[18]!==l?(y=(u,A,g)=>{g?.previous&&t.setQueryData(l,g.previous)},e[17]=t,e[18]=l,e[19]=y):y=e[19];let h;e[20]!==s||e[21]!==n||e[22]!==t?(h=(u,A,g)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,g.id)})},e[20]=s,e[21]=n,e[22]=t,e[23]=h):h=e[23];let N;e[24]!==T||e[25]!==p||e[26]!==S||e[27]!==y||e[28]!==h?(N={mutationFn:T,onMutate:p,onSuccess:S,onError:y,onSettled:h},e[24]=T,e[25]=p,e[26]=S,e[27]=y,e[28]=h,e[29]=N):N=e[29];const D=O(N);let m;e[30]!==a?(m=u=>a.call("TASK_BOARD_ITEM_DELETE",{id:u}),e[30]=a,e[31]=m):m=e[31];let f;e[32]!==s||e[33]!==i?(f=u=>{Y.error(u instanceof Error&&u.message?u.message:i("taskBoard.taskBoard.deleteError")),s()},e[32]=s,e[33]=i,e[34]=f):f=e[34];let k;e[35]!==s||e[36]!==m||e[37]!==f?(k={mutationFn:m,onSuccess:s,onError:f},e[35]=s,e[36]=m,e[37]=f,e[38]=k):k=e[38];const C=O(k);let b;e[39]!==a?(b=async u=>{const A=await Promise.allSettled(u.map(g=>a.call("TASK_BOARD_ITEM_DELETE",{id:g})));return{total:u.length,failed:A.filter(Re).length}},e[39]=a,e[40]=b):b=e[40];let B,R;e[41]!==i?(B=u=>{const{total:A,failed:g}=u;g!==0&&Y.error(i("taskBoard.taskBoard.deleteBulkError",{failed:String(g),total:String(A)}))},R=()=>Y.error(i("taskBoard.taskBoard.deleteError")),e[41]=i,e[42]=B,e[43]=R):(B=e[42],R=e[43]);let L;e[44]!==s||e[45]!==b||e[46]!==B||e[47]!==R?(L={mutationFn:b,onSuccess:B,onError:R,onSettled:s},e[44]=s,e[45]=b,e[46]=B,e[47]=R,e[48]=L):L=e[48];const P=O(L);let x;e[49]!==a?(x=u=>a.call("TASK_BOARD_ITEM_UPDATE",u),e[49]=a,e[50]=x):x=e[50];let M;e[51]!==s||e[52]!==x?(M={mutationFn:x,onSuccess:s},e[51]=s,e[52]=x,e[53]=M):M=e[53];const H=O(M);let v;e[54]!==a?(v=u=>a.call("TASK_BOARD_ITEM_RERUN",u),e[54]=a,e[55]=v):v=e[55];let w;e[56]!==s||e[57]!==n||e[58]!==t?(w=(u,A,g)=>{s(),t.invalidateQueries({queryKey:K.taskBoardActivity(n,g.id)})},e[56]=s,e[57]=n,e[58]=t,e[59]=w):w=e[59];let F;e[60]!==v||e[61]!==w?(F={mutationFn:v,onSettled:w},e[60]=v,e[61]=w,e[62]=F):F=e[62];const V=O(F);let q;return e[63]!==E||e[64]!==H||e[65]!==C||e[66]!==P||e[67]!==V||e[68]!==D?(q={create:E,update:D,remove:C,removeMany:P,link:H,rerun:V},e[63]=E,e[64]=H,e[65]=C,e[66]=P,e[67]=V,e[68]=D,e[69]=q):q=e[69],q}function Re(e){return e.status==="rejected"}const xe=["ended_after_delivery","superseded"];function ve(e){return!!e&&xe.includes(e)}function Ze(e){return!(e.action==="status_changed"&&typeof e.data?.retry=="number")}function et(e){return e.failureKind!=="superseded"}const we=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"});function tt(e){const r=t=>{if(!t)return null;const i=Date.parse(t);return Number.isNaN(i)?null:we.format(new Date(i))},n=r(e.startsAt),a=r(e.endsAt);return!n&&!a?null:n&&a?`${n} – ${a}`:n??a}function te(e){return e.threads.some(r=>r.status==="requires_action")}function st(e){return e.status==="in_review"&&!e.assigneeId}function at(e){return te(e)}function nt(e){return e.status==="in_progress"&&te(e)?"text-warning animate-pulse":ne(e.status).iconClassName}function rt(e){return e.threads.some(n=>n.status==="in_progress")?"running":e.threads.some(n=>n.status==="failed"&&!ve(n.failureKind))?"failed":null}function ot(e,r,n){const a=e.findIndex(c=>c.id===n),t=r===n?e[a+1]?.id??null:r,i=e.filter(c=>c.id!==n),o=t?i.findIndex(c=>c.id===t):-1,l=o===-1?i.length:o,d=i[l-1],s=i[l];return d&&s?(d.sortOrder+s.sortOrder)/2:d?d.sortOrder+1:s?s.sortOrder-1:0}function it(e,r){return Array.from({length:r},(n,a)=>e-(r-1-a)*1e-4)}const Oe=["archived"],se={triage:{labelKey:"taskBoard.config.statusBacklog",icon:ye,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ee,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:he,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Ae,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Te,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:Se,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:_e,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:be,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:le,iconClassName:"text-muted-foreground"}},ae={icon:ee,iconClassName:"text-muted-foreground"},Le=se;function ne(e){return Le[e]??ae}function Me(e,r,n){const a=se[e];return a?r(a.labelKey):n}function lt(e,r,n){const a=n.find(t=>t.key===e);return a?{label:Me(e,r,a.title),visual:ne(e),offBoard:!1}:{label:e,visual:ae,offBoard:!0}}const ct=["bug","feature","chore","spike","security"],ut={bug:{labelKey:"taskBoard.config.typeBug",icon:Ce,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ne,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Ee,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Be,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:De,iconClassName:"text-purple-500"}};function G(e){return de.includes(e)}function dt(e,r){return e.map(n=>n.key).filter(n=>r||!G(n))}function ft({columns:e,deliveryEnabled:r,shownLanes:n,occupied:a}){const t=e.map(s=>s.key).filter(s=>r||!G(s)||a.includes(s)),i=t.filter(s=>Oe.includes(s)||!r&&G(s)),o=i.filter(s=>!n.includes(s)),l=new Set(t),d=[...new Set(a)].filter(s=>!l.has(s)).sort();return{lanes:[...t.filter(s=>!o.includes(s)),...d],hidden:o,hideable:i,unplaced:d}}const X="lane:";function mt({overId:e,columnKeys:r,statusOf:n}){if(e===void 0)return null;const a=String(e),t=a.startsWith(X)?a.slice(X.length):n(a);return t!==void 0&&r.has(t)?t:null}const yt=["none","low","medium","high","urgent"],gt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:z,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ke,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:z,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:pe,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:ge,iconClassName:"text-destructive"}};function pt(e,r=Date.now()){const n=new Date(e).getTime();return Number.isNaN(n)?null:n<r?"overdue":n-r<=Fe*864e5?"soon":null}const Fe=3;function kt(e){return`color-mix(in oklab, ${e??ue} var(--user-color-strength), transparent)`}export{Oe as H,X as L,gt as P,se as S,ut as T,yt as a,We as b,lt as c,ct as d,et as e,tt as f,ve as g,Je as h,Ze as i,Xe as j,ft as k,ne as l,dt as m,te as n,st as o,rt as p,at as q,it as r,nt as s,kt as t,ze as u,ot as v,mt as w,pt as x,G as y};
@@ -1,4 +1,4 @@
1
- import{c as $,j as s,B,dy as le,b as F,H as re,r as ae,D as oe,t as U,b8 as ce}from"./index-DZLUP-bk.js";import{A as de,b as ue}from"./alert-B5gYqXvO.js";import{c as Q,T as V,b as Y,a as Z}from"./tabs-B70ZS4po.js";import{u as ee}from"./use-copy-QEjXenkb.js";import{i as te}from"./Check-DzHuFHoL.js";import{a as se}from"./Copy01-BRPiRRUQ.js";import{i as me}from"./Key01-CHTC8hwE.js";import{n as fe}from"./LinkExternal01-kAtb5ILy.js";import{s as xe}from"./Trash01-Bji2bWWh.js";import{u as pe,a as he,b as ge}from"./use-api-keys-v7JpdoOm.js";import"./use-mcp-client-Qp-dz21o.js";import"./constants-dLUUoWH7.js";import"./auth-DXJPvHb_.js";function je(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ye(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function be({client:e,mode:t,url:o,apiKey:u}){const a=u??"<paste-your-api-key>",c=je();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o} \\
1
+ import{c as $,j as s,B,dy as le,b as F,H as re,r as ae,D as oe,t as U,b8 as ce}from"./index-CyVZ5lgJ.js";import{A as de,b as ue}from"./alert-BBHy--nB.js";import{c as Q,T as V,b as Y,a as Z}from"./tabs-Cb3eYxFR.js";import{u as ee}from"./use-copy-DXvQhxzo.js";import{i as te}from"./Check-BSrzKRPt.js";import{a as se}from"./Copy01-cV8y7I27.js";import{i as me}from"./Key01-BGSob3xF.js";import{n as fe}from"./LinkExternal01-DgCDtWFz.js";import{s as xe}from"./Trash01-BQ7TqJow.js";import{u as pe,a as he,b as ge}from"./use-api-keys-CJDSbqKR.js";import"./use-mcp-client-BiMbFhZA.js";import"./constants-dLUUoWH7.js";import"./auth-Di--WQHJ.js";function je(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ye(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function be({client:e,mode:t,url:o,apiKey:u}){const a=u??"<paste-your-api-key>",c=je();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${c} ${o} \\
2
2
  --header "Authorization: Bearer ${a}"`};if(e==="cursor"){const l={url:o};return t==="api-key"&&(l.headers={Authorization:`Bearer ${a}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}if(e==="codex"){const l=[`[mcp_servers.${c}]`,`url = "${o}"`];return t==="api-key"&&l.push(`http_headers = { "Authorization" = "Bearer ${a}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:l.join(`
3
3
  `)}}if(e==="claude-desktop"){const l={type:"http",url:o};return t==="api-key"&&(l.headers={Authorization:`Bearer ${a}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[c]:l}},null,2)}}return t==="oauth"?{language:"text",code:`${o}
4
4
 
@@ -1 +1 @@
1
- import{ak as i,ao as r,al as t,an as e,ap as o,au as a,at as d,d9 as l,ci as u}from"./index-DZLUP-bk.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
1
+ import{ak as i,ao as r,al as t,an as e,ap as o,au as a,at as d,d9 as l,ci as u}from"./index-CyVZ5lgJ.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{p as O,f as i,g as p};
@@ -1 +1 @@
1
- import{c as S,H as K,c7 as Q,K as F,b as q,n as $,j as x,b8 as G}from"./index-DZLUP-bk.js";import{u as U}from"./use-registry-connections-CB_vMkV_.js";import{h as V}from"./use-organization-settings-DoHw0Vrb.js";import{S as k}from"./constants-dLUUoWH7.js";import{u as X}from"./useInfiniteQuery-Mj7WnppJ.js";import{c as Y}from"./use-mcp-client-Qp-dz21o.js";import{i as z,f as B}from"./extract-connection-data-CqOTDUuA.js";import{r as W,R as Z}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-DwhAeNBu.js";function ye(){const s=S.c(6),e=U(),t=V(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function H(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=X({queryKey:F.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=z(i.id,e);try{return await W(async()=>{let u=null;try{u=await Y({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=B(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof Z?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return H(s)}function ie(s){return!H(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(G,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
1
+ import{c as S,H as K,c7 as Q,K as F,b as q,n as $,j as x,b8 as G}from"./index-CyVZ5lgJ.js";import{u as U}from"./use-registry-connections-D-9Urbos.js";import{h as V}from"./use-organization-settings-DOmendGP.js";import{S as k}from"./constants-dLUUoWH7.js";import{u as X}from"./useInfiniteQuery-CULS4zh1.js";import{c as Y}from"./use-mcp-client-BiMbFhZA.js";import{i as z,f as B}from"./extract-connection-data-DXnTgJE5.js";import{r as W,R as Z}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-Bp-AVupB.js";function ye(){const s=S.c(6),e=U(),t=V(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function H(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=X({queryKey:F.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=z(i.id,e);try{return await W(async()=>{let u=null;try{u=await Y({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=B(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof Z?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:Q,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return H(s)}function ie(s){return!H(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(G,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
@@ -0,0 +1 @@
1
+ import{ak as be,ap as $e,au as De,an as me,al as Oe,c as R,b as L,j as t,k as ve,B as H,r as Z,n as Ne,H as te,ac as Me,z as ze,K as ae,d as se,b8 as Ee,ba as ue,G as Ue,E as Re,f as Ve,c8 as Fe,p as Le,ax as Be,ay as He,bi as Ge,bh as qe,bg as Ke,be as Qe,bf as Xe,t as Y}from"./index-CyVZ5lgJ.js";import{g as We}from"./extract-connection-data-DXnTgJE5.js";import{E as Se}from"./empty-state-C54Q6sBj.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-Cx0hSG8H.js";import{c as st,S as nt,V as it}from"./index-TfAJegqd.js";import{u as ye,T as ot}from"./use-mcp-auth-status-CWXW9vhJ.js";import{a as at}from"./use-members-KzBukpu-.js";import{A as lt}from"./avatar-DpXC79Fw.js";import{a as Ce,b as _e,u as rt}from"./use-connection-CklhgwT-.js";import{u as we}from"./use-mcp-client-BiMbFhZA.js";import{a as ct}from"./use-mcp-tools-D1SQ9VQp.js";import{b as dt,C as mt,a as ut,c as xt}from"./chart-DsuJR6l_.js";import{i as pt,a as ft}from"./mcp-oauth-1onT9Dwz.js";import{I as le}from"./integration-icon-Bp-AVupB.js";import{s as ht}from"./Plus-DuwKEMqs.js";import{M as gt,N as jt,l as bt,aJ as vt,s as ne}from"./agent-icon-patNN3F9.js";import{a as ke,s as Nt}from"./Settings02-BdKfdvdO.js";import{s as ce}from"./Trash01-BQ7TqJow.js";import{d as K,a as Q,e as X,b as B,c as W,f as St,F as yt}from"./form-CAcKi06k.js";import{I as J}from"./input-DJ33AwMQ.js";import{u as Ct,D as _t}from"./use-delete-connection-DXsyiE-F.js";import{c as wt,B as kt,a as It,C as Tt}from"./monitoring-stats-row-By6Kd2TD.js";import{u as At}from"./use-virtual-mcp-CYMnefxf.js";import{i as Ie}from"./ChevronRight-HiBK7iT4.js";import{a as Te}from"./Users03-C-fPfgy4.js";import{b as ie,c as Pt,T as oe,a as $t}from"./tabs-Cb3eYxFR.js";import{g as Ae}from"./connection-slug-CITJ0kGN.js";import{b as Dt}from"./Tool01-kD_St_C1.js";import{g as de,M as Ot}from"./types-sWp7JVPE.js";import{C as Mt}from"./collection-search-DpMT1vYf.js";import{B as zt}from"./badge-mutKhjD6.js";import{c as Et,D as Ut,b as Rt,a as xe}from"./dropdown-menu-Dmm7Trn3.js";import{S as pe,a as fe,b as he,c as ge,d as q}from"./select-C8VpiT9w.js";import{i as Vt}from"./CheckCircle-DyLCcRg7.js";import{t as Ft}from"./ChevronDown-DS4KDE95.js";import{n as Lt}from"./Tool02-C4Mhmh2n.js";import{e as Bt}from"./UserSquare-B1QhMNkc.js";import{s as Ht}from"./XClose-CId8Q3oo.js";import{p as Gt,i as qt}from"./connection-BOKd-Vhl.js";import"./metadata-dUsYcpuu.js";import"./constants-dLUUoWH7.js";import"./Key01-BGSob3xF.js";import"./auth-Di--WQHJ.js";import"./use-registry-connections-D-9Urbos.js";import"./use-organization-settings-DOmendGP.js";import"./schema-CTX-wtUj.js";import"./task-board-BR_pi0j4.js";import"./index-DfY5ZnY2.js";import"./index-eiH1IWjN.js";import"./index-BCzXIVbP.js";import"./popover-D55EARay.js";import"./Check-BSrzKRPt.js";import"./SearchMd-BNMN35l9.js";import"./use-create-virtual-mcp-Bir9un1y.js";import"./use-navigate-to-agent-DMGreR6U.js";import"./use-destination-route-C4i1vP71.js";import"./hooks-DHadwCKp.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BGdXs4q_.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BpKUwJal.js";import"./Eye-CFsMHhc3.js";import"./use-org-auth-client-DXJoDvFV.js";import"./User01-6GEEYLNL.js";import"./AreaChart-ESWfdZrx.js";import"./AlertCircle-Cbfze2vA.js";import"./ArrowUp-Ck_S8UXb.js";import"./ArrowLeft-sTRXJKw4.js";import"./XCircle-BR9peTMp.js";import"./TrendUp01-Dmxvc_8Y.js";import"./ZapSquare-DafqFLME.js";import"./ZoomOut-A4Edr_rF.js";import"./ChevronSelectorVertical-CfYYUsnO.js";import"./ChevronUp-DBNo7toe.js";import"./DotsVertical-Cn-HQJLl.js";import"./Stars02-C5vVPVXG.js";import"./Copy01-cV8y7I27.js";import"./CreditCard01-D2p53cnj.js";import"./Download01-DKxxD2lG.js";import"./FilterLines-CY-R2Pgs.js";import"./Share07-DgnKCkn5.js";import"./GitBranch01-gzbYsobG.js";import"./Globe01-wsmSifpz.js";import"./Globe04-BbtNoerk.js";import"./SwitchHorizontal01-BSS5u6hh.js";import"./HardDrive-B2Kmw_-U.js";import"./Image01-4ZjVZeII.js";import"./LinkExternal01-DgCDtWFz.js";import"./LockUnlocked01-DPANpO_w.js";import"./LogOut01-y1fQHOm-.js";import"./Monitor01-DZQMQTQG.js";import"./Sun-B_wiAXGd.js";import"./Package-FFc5eynf.js";import"./Palette-_BVhH0qL.js";import"./Play-mDAbVXyx.js";import"./SearchLg-BWCvW3vV.js";import"./Shield01-CRyZWHgQ.js";import"./Stars01-CqIitG82.js";import"./Upload01-BUUJWF9q.js";import"./Users01-D3492jop.js";import"./Zap-C81otJUu.js";import"./label-C3nYoz5C.js";import"./alert-dialog-B0BRtAnp.js";import"./YAxis-D1yzoPbg.js";import"./ErrorBarContext-CjrL28Ly.js";import"./Sector-Ci4Ux-xI.js";const Kt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Kt}];function Xt(s){const e=R.c(61),{instance:n,onConfigure:d,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),c=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=c||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==c||e[12]!==a?(S=c?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=c,e[12]=a,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==c||e[19]!==o||e[20]!==a?(y=c&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=c,e[19]=o,e[20]=a,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(P=f?t.jsxs(H,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(gt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(jt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==d?($=()=>d(n),e[27]=n,e[28]=d,e[29]=$):$=e[29];let _;e[30]!==a?(_=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=_):_=e[31];let M;e[32]!==a?(M=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==a?(v=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=v):v=e[43];let j;e[44]!==a?(j=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:d}=s,o=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==d?(a=()=>d(n),e[5]=n,e[6]=d,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let m;e[10]!==o?(m=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=m):m=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ke,{size:13}),e[12]=x):x=e[12];let c;e[13]!==a||e[14]!==r||e[15]!==m?(c=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:r,"aria-label":m,children:x})}),e[13]=a,e[14]=r,e[15]=m,e[16]=c):c=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==c?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,c]}),e[17]=i,e[18]=l,e[19]=c,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:d,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,m=L();if(n.length===0)return null;let x;e[0]!==n.length||e[1]!==m?(x=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=x):x=e[2];let c;e[3]!==x?(c=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:x}),e[3]=x,e[4]=c):c=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ht,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==u?(h=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,u]}),e[9]=r,e[10]=a,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==c||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[c,h]}),e[14]=c,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==o||e[19]!==d||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==d||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:d}),children:t.jsx(Xt,{instance:P,onConfigure:d,onAuthenticate:o,onDelete:i,onToggleStatus:l})},P.id),e[23]=o,e[24]=d,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=o,e[19]=d,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Yt(s,e=3){const n=new Map;for(const d of s){if(!d.isError)continue;const o=(d.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([d,o])=>({message:d,count:o})).sort((d,o)=>o.count-d.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:d,timeframe:o}=s,i=L(),l=Me(),a=es(o),{data:r}=ze({queryKey:ae.connectionActivity(n,o,d),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=wt(r?.logs??[],a,void 0,r?.total),x=m.data,c=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),c?t.jsxs("div",{children:[t.jsx(dt,{config:ts,className:"h-16 w-full",children:t.jsxs(kt,{data:x,barCategoryGap:"4%",children:[t.jsx(mt,{content:t.jsx(ut,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(It,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(Tt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=R.c(19),{connectionId:n}=s,d=L(),[o,i]=Z.useState("14d"),{org:l}=te();let a;e[0]!==d?(a=d("details.connectionActivity.activity"),e[0]=d,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let m;e[4]!==o?(m=Zt.map(g=>t.jsx("button",{type:"button","aria-pressed":o===g.value,onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=o,e[5]=m):m=e[5];let x;e[6]!==m?(x=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=x):x=e[7];let c;e[8]!==r||e[9]!==x?(c=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[8]=r,e[9]=x,e[10]=c):c=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==o?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:o})}),e[12]=n,e[13]=l.id,e[14]=o,e[15]=u):u=e[15];let h;return e[16]!==c||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,u]}),e[16]=c,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:d}=s,o=se();let i;e[0]!==o||e[1]!==d||e[2]!==n.id?(i=()=>{const c=crypto.randomUUID();o({to:"/$org/$taskId",params:{org:d,taskId:c},search:{virtualmcpid:n.id}})},e[0]=o,e[1]=d,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let x;return e[11]!==i||e[12]!==a||e[13]!==r?(x=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[a,r,m]}),e[11]=i,e[12]=a,e[13]=r,e[14]=x):x=e[14],x}function cs(s){const e=R.c(7),{virtualMcps:n,org:d}=s;let o;if(e[0]!==d||e[1]!==n){let l;e[3]!==d?(l=a=>t.jsx(rs,{virtualMcp:a,org:d},a.id),e[3]=d,e[4]=l):l=e[4],o=n.map(l),e[0]=d,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function ds(s){const e=R.c(13),{connection:n}=s,d=L(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=At(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==d?(r=d("details.connectionAgentsPanel.usedByAgents"),e[3]=d,e[4]=r):r=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==o.slug||e[8]!==l?(x=t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=x):x=e[9];let c;return e[10]!==m||e[11]!==x?(c=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,x]}),e[10]=m,e[11]=x,e[12]=c):c=e[12],c}function ms(s){const e=R.c(35),{tools:n,connectionId:d,org:o}=s,i=L(),l=se(),{org:a}=te();let r;e[0]!==d||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:d,orgId:a.id,orgSlug:a.slug},e[0]=d,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const m=we(r),x=Ce(d);let c;e[4]!==x||e[5]!==d?(c=x?Ae(x):d,e[4]=x,e[5]=d,e[6]=c):c=e[6];const f=c,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==o||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==o?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=o,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),d=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&d.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function re(s){const e=R.c(5),{label:n}=s,d=L();let o;e[0]!==n||e[1]!==d?(o=d("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=d,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:d,resources:o,connectionId:i,org:l}=s;let a;e[0]!==d?(a=d===void 0?[]:d,e[0]=d,e[1]=a):a=e[1];const r=a;let m;e[2]!==o?(m=o===void 0?[]:o,e[2]=o,e[3]=m):m=e[3];const x=m,c=L(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+x.length===0){let C;e[16]!==c?(C=c("details.connectionCapabilities.capabilities"),e[16]=c,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let G;e[20]!==c?(G=c("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=c,e[21]=G):G=e[21];let F;e[22]!==G?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:G}),e[22]=G,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==c||e[28]!==n.length?($=c("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=c,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==c?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:c("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=c,e[34]=M):M=e[34];let T;e[35]!==c?(T=c("details.connectionCapabilities.promptsTab"),e[35]=c,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==c?(I=c("details.connectionCapabilities.resourcesTab"),e[39]=c,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let p;e[62]!==x?(p=x.length>0?x.map(ps):t.jsx(re,{label:"resources"}),e[62]=x,e[63]=p):p=e[63];let w;e[64]!==p?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:p})}),e[64]=p,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs($t,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(bt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:d}=s,o=d??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(le,{icon:n.icon,name:o,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:o})}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:d,onRemoveOAuth:o}){const i=L(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof a!="string"||!a)return!1;try{const u=new URL(a);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),x=r||e.connection_type==="STDIO",c=e.connection_type==="VIRTUAL",f=c?Gt(e.connection_url):null;return c?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),x&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),x&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(B,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Ut,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Ft,{size:12})]})})}),t.jsxs(Rt,{align:"start",children:[t.jsxs(xe,{onClick:d,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(St,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&qt(s.connection_headers)){const d=s.connection_headers,o=Ze(d.envVars);if(bs(d)){const l=vs(d);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=Ns(d);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,d=null,o=null;return s.ui_type==="NPX"?(e="STDIO",n="",o=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",o=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",d=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...d&&{connection_token:d},...o&&{connection_headers:o},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:d,tools:o,prompts:i,resources:l,siblings:a}){const r=L(),m=se({from:"/$org/settings/connections/$appSlug"}),x=Le(),c=_e(),{org:f}=te(),u=Ct({onSuccess:()=>{a.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(p=>p.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:o},I=st(D,Qt),v=Be({resolver:He(Ye),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await c.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async p=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ft({connectionId:p,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await c.update.mutateAsync({id:p,data:{connection_token:O}});else try{await c.update.mutateAsync({id:p,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await c.update.mutateAsync({id:p,data:{connection_token:O}})}else await c.update.mutateAsync({id:p,data:{connection_token:O}});const G=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(G.href,null)}),await x.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const O=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(_t,{...u}),t.jsx(Ge,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(qe,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(Xe,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(yt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(K,{control:v.control,name:"title",render:({field:p})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(B,{children:t.jsx(J,{...p})}),t.jsx(W,{})]})}),t.jsx(K,{control:v.control,name:"description",render:({field:p})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(B,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:E,disabled:!j||d,className:"flex-1",children:r(d?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(H,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),u.requestDelete(p)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>k(p.id),onDelete:p=>u.requestDelete(p),onToggleStatus:async(p,w)=>{try{await c.update.mutateAsync({id:p.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const p=a[0]??s,w=p.title.replace(/\s*\(\d+\)\s*$/,""),O=a.length+1,C=`${w} (${O})`,V=We("conn");await c.create.mutateAsync({id:V,title:C,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const G=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await pt({url:G.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const d=se(n);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ve(o),{org:a}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const x=rt(m),c=x[0]??null,f=c?.id??"",u=f||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==u?(h={connectionId:u,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=ct(N);let b;if(s[10]!==c?.tools||s[11]!==f||s[12]!==x||s[13]!==S){const k=S?S.tools.map(As):(c?.tools??[]).map(Ts);e:{if(x.length<=1){b=k;break e}const A=new Set,U=[],p=ks;for(const w of x){const O=w.id===f?k:p(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=c?.tools,s[11]=f,s[12]=x,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=xt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!c){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==d||s[32]!==l?(U=()=>d({to:"/$org/settings/connections",params:{org:l}}),s[31]=d,s[32]=l,s[33]=U):U=s[33];let p;s[34]!==e?(p=e("details.connection.backButton"),s[34]=e,s[35]=p):p=s[35];let w;s[36]!==U||s[37]!==p?(w=t.jsx(H,{variant:"outline",onClick:U,children:p}),s[36]=U,s[37]=p,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==c||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==x?(z=t.jsx(ys,{org:l,connection:c,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:x}),s[43]=r.update.isPending,s[44]=y,s[45]=c,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=x,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function Di(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{Di as default};
@@ -1 +1 @@
1
- import{ak as R,ap as A,au as I,an as o,al as j,ao as z,c as L,j as u,B as C}from"./index-DZLUP-bk.js";import{I as H}from"./input-Cvmwm8KN.js";import{s as W}from"./Plus-CYNImaOJ.js";import{s as q}from"./Trash01-Bji2bWWh.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function U(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{ak as R,ap as A,au as I,an as o,al as j,ao as z,c as L,j as u,B as C}from"./index-CyVZ5lgJ.js";import{I as H}from"./input-DJ33AwMQ.js";import{s as W}from"./Plus-DuwKEMqs.js";import{s as q}from"./Trash01-BQ7TqJow.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function U(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{r as B,c as ae,b as de,j as t,B as G,k as pe,q as re,n as je,E as Ye,H as Ne,d as ke,u as Ze,a as Te,G as et,a5 as tt,c6 as Ce,R as nt,I as st,ax as ot,ay as it,P as fe,p as ct,ac as lt,t as Y,K as rt}from"./index-CyVZ5lgJ.js";import{a as Ae,b as at,g as dt,e as ut}from"./extract-connection-data-DXnTgJE5.js";import{C as mt}from"./collection-display-button-uov2GUqF.js";import{S as gt}from"./search-input-CVs6a7cw.js";import{C as pt}from"./collection-tabs-6TyH3ybi.js";import{C as ve,u as ft,a as we,g as ht}from"./connection-card-C0r2lBXt.js";import{E as xt}from"./empty-state-C54Q6sBj.js";import{u as jt,D as yt}from"./use-delete-connection-DXsyiE-F.js";import{u as St}from"./use-infinite-scroll-DHeyE3Gp.js";import{u as Ct}from"./use-view-mode-BT0iEFTU.js";import{g as xe}from"./connection-slug-CITJ0kGN.js";import{c as Ie,d as Pe,b as Le,f as Me,g as Oe,e as Fe,a as $e,A as Ue}from"./alert-dialog-B0BRtAnp.js";import{n as ye}from"./Tool02-C4Mhmh2n.js";import{g as vt}from"./metadata-dUsYcpuu.js";import{d as Ve,h as ze,c as Ee,e as Be,b as Ke,D as He}from"./dialog-CefQc73v.js";import{D as bt,a as _t,c as Dt,b as Nt,g as kt,e as Tt,f as At}from"./drawer-BZ-PaoE1.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-CAcKi06k.js";import{I as ue}from"./input-DJ33AwMQ.js";import{S as wt,a as It,b as Pt,c as Lt,d as ge}from"./select-C8VpiT9w.js";import{T as Mt}from"./textarea-DmjAO8WJ.js";import{b as Re,u as Ot}from"./use-connection-CklhgwT-.js";import{u as Ft}from"./use-virtual-mcp-CYMnefxf.js";import{aI as $t,N as Ut,M as Vt,s as Se}from"./agent-icon-patNN3F9.js";import{s as We}from"./Plus-DuwKEMqs.js";import{e as zt}from"./UserSquare-B1QhMNkc.js";import{s as Xe}from"./XClose-CId8Q3oo.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-Cx0hSG8H.js";import{a as Wt}from"./authenticate-and-persist-oauth-CjESgZgI.js";import{I as Xt}from"./integration-icon-Bp-AVupB.js";import{C as Ge}from"./checkbox-BlKIO9QJ.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-Dmm7Trn3.js";import{i as Jt}from"./DotsVertical-Cn-HQJLl.js";import{s as qe}from"./Eye-CFsMHhc3.js";import{s as Qe}from"./Trash01-BQ7TqJow.js";import"./use-mcp-client-BiMbFhZA.js";import"./constants-dLUUoWH7.js";import"./auth-Di--WQHJ.js";import"./connection-BOKd-Vhl.js";import"./ArrowUp-Ck_S8UXb.js";import"./Check-BSrzKRPt.js";import"./SwitchHorizontal01-BSS5u6hh.js";import"./view-mode-toggle-BgXxXgC3.js";import"./badge-mutKhjD6.js";import"./SearchMd-BNMN35l9.js";import"./use-registry-connections-D-9Urbos.js";import"./use-organization-settings-DOmendGP.js";import"./schema-CTX-wtUj.js";import"./task-board-BR_pi0j4.js";import"./useInfiniteQuery-CULS4zh1.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./slugify-CEUa2lfQ.js";import"./label-C3nYoz5C.js";import"./ChevronDown-DS4KDE95.js";import"./ChevronUp-DBNo7toe.js";import"./AlertCircle-Cbfze2vA.js";import"./Tool01-kD_St_C1.js";import"./ArrowLeft-sTRXJKw4.js";import"./XCircle-BR9peTMp.js";import"./TrendUp01-Dmxvc_8Y.js";import"./ZapSquare-DafqFLME.js";import"./ZoomOut-A4Edr_rF.js";import"./Users03-C-fPfgy4.js";import"./CheckCircle-DyLCcRg7.js";import"./ChevronRight-HiBK7iT4.js";import"./ChevronSelectorVertical-CfYYUsnO.js";import"./Stars02-C5vVPVXG.js";import"./Copy01-cV8y7I27.js";import"./CreditCard01-D2p53cnj.js";import"./Download01-DKxxD2lG.js";import"./Settings02-BdKfdvdO.js";import"./FilterLines-CY-R2Pgs.js";import"./Share07-DgnKCkn5.js";import"./GitBranch01-gzbYsobG.js";import"./Globe01-wsmSifpz.js";import"./Globe04-BbtNoerk.js";import"./HardDrive-B2Kmw_-U.js";import"./Image01-4ZjVZeII.js";import"./Key01-BGSob3xF.js";import"./LinkExternal01-DgCDtWFz.js";import"./LockUnlocked01-DPANpO_w.js";import"./LogOut01-y1fQHOm-.js";import"./Monitor01-DZQMQTQG.js";import"./Sun-B_wiAXGd.js";import"./Package-FFc5eynf.js";import"./Palette-_BVhH0qL.js";import"./Play-mDAbVXyx.js";import"./SearchLg-BWCvW3vV.js";import"./Shield01-CRyZWHgQ.js";import"./Stars01-CqIitG82.js";import"./Upload01-BUUJWF9q.js";import"./User01-6GEEYLNL.js";import"./Users01-D3492jop.js";import"./Zap-C81otJUu.js";import"./mcp-oauth-1onT9Dwz.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=M=>{y(M),globalThis.localStorage?.setItem(x,String(M))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=Ct(`studio-${p}-${n}`,l),{sortKey:L,sortDirection:O,handleSort:A}=Zt(o),K=L;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==O||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:O,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=O,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Le,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Me,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Oe,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=vt(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const L=T;let O;e[14]!==n?(O=nn(n),e[14]=n,e[15]=O):O=e[15];const A=O,K=u||p;let U,M;e[16]!==L||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=L[0];J&&l(J);return}M()},M=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=L,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=M):(U=e[22],M=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==M||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),M()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=M,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Le,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Me,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Oe,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let L;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(L=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=L):L=e[36];let O;e[37]!==p?(O=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=O):O=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==O||e[43]!==K?(U=t.jsxs(me,{onClick:O,children:[A,K]}),e[42]=O,e[43]=K,e[44]=U):U=e[44];let M;e[45]!==r||e[46]!==U?(M=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=M):M=e[47];let V;e[48]!==L||e[49]!==M?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[L,M]}),e[48]=L,e[49]=M,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let O;return e[41]!==p||e[42]!==n||e[43]!==L?(O=t.jsx(He,{open:n,onOpenChange:p,children:L}),e[41]=p,e[42]=n,e[43]=L,e[44]=O):O=e[44],O}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=ct(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Ot(s),v=jt(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,L]=B.useState(null),O=Ft(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=ht(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},M=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=St(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),L(m.id);try{const h=ut(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:rt.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{L(null)}}},C=lt(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),M()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),M()},ee=async m=>{const h=O.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),M()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:O,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(xt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:M})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=nt(st.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=ft(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=ot({resolver:it(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),O=i.watch("npx_package"),A=he({uiType:T,connectionUrl:L??"",npxPackage:O??""})??De({uiType:T,connectionUrl:L??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},M=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=dt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&M(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(wt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Mt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(bt,{open:H,onOpenChange:q,children:t.jsxs(_t,{className:"max-h-[90vh]",children:[t.jsx(Dt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:S}),t.jsx(kt,{className:"mt-1",children:w})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(mt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:g,onChange:S=>v(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:S=>_(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(pt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function no(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{no as default};
@@ -1 +1 @@
1
- import"./index-DZLUP-bk.js";import{T as C,c as _}from"./task-board-DTv9gW69.js";import{e as O}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},m=Object.values(k),w="notification.created",g=3e4,I=1e3;function M(a){const{buildUrl:u,eventTypes:d,name:i,crossTab:f=!1}=a,o=new Map,c=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(c&&!i)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const r of e.handlers)try{r(t)}catch{}}function T(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function h(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(T(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&D(e)};const r=n=>{e.channel?.postMessage({kind:"event",type:n.type,data:n.data}),l(e,n)};for(const n of d)t.addEventListener(n,r)}function D(e){if(e.refCount<=0||e.reconnectTimer)return;const t=O(g,I,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),h(e))},t)}function S(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,h(e)}function v(e){if(!c){S(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${i}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,S(e)})).catch(()=>{})}function y(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&T(e)}function N(e){const t=o.get(e);if(t)return t;const r={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,r),c){const n=new BroadcastChannel(`sse:${i}:${e}`);n.onmessage=s=>y(r,s.data),r.channel=n}return r}function b(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{dispose(){for(const e of[...o.values()])b(e)},subscribe(e,t,r){const n=!o.has(e),s=N(e);s.refCount++,s.handlers.add(t),r&&s.reconnectHandlers.add(r),n&&v(s);let A=!1;return()=>{A||(A=!0,s.handlers.delete(t),r&&s.reconnectHandlers.delete(r),s.refCount--,s.refCount<=0&&b(s))}}}}function p(a,u){const d=new Set(u);return{dispose:()=>a.dispose(),subscribe(i,f,o){const c=l=>{d.has(l.type)&&f(l)};return a.subscribe(i,c,o)}}}const L=[...m,C,_,w],H=L,P=L,E=M({name:"watch",buildUrl:a=>`/api/${encodeURIComponent(a)}/watch?types=${H.join(",")}`,eventTypes:P,crossTab:!0}),V=p(E,[...m]),U=p(E,[C,_]),Y=p(E,[w]),$=V;export{k as D,$ as d,Y as n,U as t};
1
+ import"./index-CyVZ5lgJ.js";import{T as C,c as _}from"./task-board-BR_pi0j4.js";import{e as O}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},m=Object.values(k),w="notification.created",g=3e4,I=1e3;function M(a){const{buildUrl:u,eventTypes:d,name:i,crossTab:f=!1}=a,o=new Map,c=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(c&&!i)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const r of e.handlers)try{r(t)}catch{}}function T(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function h(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(T(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&D(e)};const r=n=>{e.channel?.postMessage({kind:"event",type:n.type,data:n.data}),l(e,n)};for(const n of d)t.addEventListener(n,r)}function D(e){if(e.refCount<=0||e.reconnectTimer)return;const t=O(g,I,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),h(e))},t)}function S(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,h(e)}function v(e){if(!c){S(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${i}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,S(e)})).catch(()=>{})}function y(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&T(e)}function N(e){const t=o.get(e);if(t)return t;const r={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,r),c){const n=new BroadcastChannel(`sse:${i}:${e}`);n.onmessage=s=>y(r,s.data),r.channel=n}return r}function b(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{dispose(){for(const e of[...o.values()])b(e)},subscribe(e,t,r){const n=!o.has(e),s=N(e);s.refCount++,s.handlers.add(t),r&&s.reconnectHandlers.add(r),n&&v(s);let A=!1;return()=>{A||(A=!0,s.handlers.delete(t),r&&s.reconnectHandlers.delete(r),s.refCount--,s.refCount<=0&&b(s))}}}}function p(a,u){const d=new Set(u);return{dispose:()=>a.dispose(),subscribe(i,f,o){const c=l=>{d.has(l.type)&&f(l)};return a.subscribe(i,c,o)}}}const L=[...m,C,_,w],H=L,P=L,E=M({name:"watch",buildUrl:a=>`/api/${encodeURIComponent(a)}/watch?types=${H.join(",")}`,eventTypes:P,crossTab:!0}),V=p(E,[...m]),U=p(E,[C,_]),Y=p(E,[w]),$=V;export{k as D,$ as d,Y as n,U as t};
@@ -1 +1 @@
1
- import{c as n,j as i,e0 as u,n as c,J as m,e1 as x,e2 as j,e3 as N,e4 as b,e5 as D,av as h,e6 as p}from"./index-DZLUP-bk.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,z as a,w as b,T as c,B as d,R as e,y as f,v as g,E as h,k as i};
1
+ import{c as n,j as i,e0 as u,n as c,J as m,e1 as x,e2 as j,e3 as N,e4 as b,e5 as D,av as h,e6 as p}from"./index-CyVZ5lgJ.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,z as a,w as b,T as c,B as d,R as e,y as f,v as g,E as h,k as i};