decocms 2.167.0 → 2.167.1
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.
- package/dist/client/assets/{AlertCircle-48gOoEWA.js → AlertCircle-CRefRGB6.js} +1 -1
- package/dist/client/assets/{AlignLeft-CKoC1cMY.js → AlignLeft-DCeZyfUv.js} +1 -1
- package/dist/client/assets/{ArrowDown-_L7cw1A8.js → ArrowDown-Ddd2bFCq.js} +1 -1
- package/dist/client/assets/{ArrowLeft-jV1c6x3k.js → ArrowLeft-COkllC0A.js} +1 -1
- package/dist/client/assets/{ArrowUp-DKc3SUsQ.js → ArrowUp-D8-wpLhK.js} +1 -1
- package/dist/client/assets/{Check-BWCeXHN7.js → Check-DFFtcHrw.js} +1 -1
- package/dist/client/assets/{CheckCircle-DZcEBbaZ.js → CheckCircle-DFbYHiLE.js} +1 -1
- package/dist/client/assets/{CheckDone01-CsC_Ltj-.js → CheckDone01-JzYSoDE1.js} +1 -1
- package/dist/client/assets/{CheckVerified02-UCZI60jf.js → CheckVerified02-DfPGhpKJ.js} +1 -1
- package/dist/client/assets/{ChevronDown-B15SC8MA.js → ChevronDown-DkB2aRG4.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BjnPH80Y.js → ChevronLeft-BGM38xu6.js} +1 -1
- package/dist/client/assets/{ChevronRight-DNq10e3Z.js → ChevronRight-ACRFNNEg.js} +1 -1
- package/dist/client/assets/{ChevronUp-Be0WocGY.js → ChevronUp-Bs9Ot1hj.js} +1 -1
- package/dist/client/assets/{Clock-CbBdVVok.js → Clock-VRCh834Q.js} +1 -1
- package/dist/client/assets/{Code01-BDvBTEm7.js → Code01-C8PssGbH.js} +1 -1
- package/dist/client/assets/{Coins01-CGSgNFIJ.js → Coins01-TB9HLbQn.js} +1 -1
- package/dist/client/assets/{Container-C4I-ZzWI.js → Container-B7oSS_-y.js} +1 -1
- package/dist/client/assets/{Copy01-BJVPuQbm.js → Copy01-CgUyGO9-.js} +1 -1
- package/dist/client/assets/{Dataflow03-CdPLEX-g.js → Dataflow03-8QP7Bqkf.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-zwvwj18G.js → DotsHorizontal-DP-ax0xe.js} +1 -1
- package/dist/client/assets/{DotsVertical-DUf6cEvO.js → DotsVertical-D0oq2fjv.js} +1 -1
- package/dist/client/assets/{Download01-BwJBKvsx.js → Download01-DfOkRvOp.js} +1 -1
- package/dist/client/assets/{Edit01-BM5GDmTx.js → Edit01-odlMa8iv.js} +1 -1
- package/dist/client/assets/{Edit05-FVXfLA6i.js → Edit05-BbP5Wuhr.js} +1 -1
- package/dist/client/assets/{Eye-DkD5as17.js → Eye-DvVdD51j.js} +1 -1
- package/dist/client/assets/{EyeOff-BeKLPveV.js → EyeOff-CuPz9L1S.js} +1 -1
- package/dist/client/assets/{File02-C6fFP8wJ.js → File02-Cj1i35zl.js} +1 -1
- package/dist/client/assets/{File06-NiquJK6U.js → File06-DT_blB7L.js} +1 -1
- package/dist/client/assets/{FilterLines-Cn-l4hcD.js → FilterLines-DIdq4C3O.js} +1 -1
- package/dist/client/assets/{Globe01-oM7Jrrrb.js → Globe01-De8m2Ley.js} +1 -1
- package/dist/client/assets/{Globe02-BtYVEi0C.js → Globe02-C_VB-hTP.js} +1 -1
- package/dist/client/assets/{Grid01-Cj17P1tC.js → Grid01-Sp0biDxT.js} +1 -1
- package/dist/client/assets/{Hash02-BdiI1XxB.js → Hash02-DVmJlk2n.js} +1 -1
- package/dist/client/assets/{Home02-BGdlx1AT.js → Home02-C6yMcBVZ.js} +1 -1
- package/dist/client/assets/{Image01-CHkBHANF.js → Image01-DqXOaj2A.js} +1 -1
- package/dist/client/assets/{Inbox01-BxbPwF62.js → Inbox01-BtrVazQu.js} +1 -1
- package/dist/client/assets/{InfoCircle-BqEmSE9k.js → InfoCircle-t2WPl417.js} +1 -1
- package/dist/client/assets/{Key01-Be9_ogDx.js → Key01-FZzH7KSv.js} +1 -1
- package/dist/client/assets/{LayersTwo01-CqPgQoaH.js → LayersTwo01-DpY-ll-F.js} +1 -1
- package/dist/client/assets/{LayoutLeft-z9_XAaYG.js → LayoutLeft-Bt0zvSW4.js} +1 -1
- package/dist/client/assets/{Link01-DXpyb1VQ.js → Link01-emFpE4io.js} +1 -1
- package/dist/client/assets/{LinkExternal01--09S5N5q.js → LinkExternal01-BDorTcHT.js} +1 -1
- package/dist/client/assets/{List-c0L2g9Qy.js → List-ClxAjgXZ.js} +1 -1
- package/dist/client/assets/{Loading01-BUlApwyE.js → Loading01-CmbgGBJZ.js} +1 -1
- package/dist/client/assets/{Lock01-D2mdnqp4.js → Lock01-Xr17_tjV.js} +1 -1
- package/dist/client/assets/{Play-a4a9k_A2.js → Play-DJ6yCSJw.js} +1 -1
- package/dist/client/assets/{Plus-CiuqWk7L.js → Plus-BYkvGXiG.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CpK4UKE8.js → RefreshCcw01-CS4ZawZZ.js} +1 -1
- package/dist/client/assets/{Save01-CGK6rW3l.js → Save01-egVkGifz.js} +1 -1
- package/dist/client/assets/{SearchMd-D_8XQU19.js → SearchMd-JEgBfhSx.js} +1 -1
- package/dist/client/assets/{Settings01-BXea0IX5.js → Settings01-D4taEXIn.js} +1 -1
- package/dist/client/assets/{Shield01-xSYnh-yR.js → Shield01-Dd_1pv5e.js} +1 -1
- package/dist/client/assets/{Terminal-CJ1WAC7b.js → Terminal-LTVNn-ZQ.js} +1 -1
- package/dist/client/assets/{Trash01-CHv5mU8b.js → Trash01-Cw6VFCl2.js} +1 -1
- package/dist/client/assets/{Upload01-CquOr5qE.js → Upload01-CN7lXpcp.js} +1 -1
- package/dist/client/assets/{Users03-DBQP_ao_.js → Users03-B92JA0ax.js} +1 -1
- package/dist/client/assets/{X-CC0aD5R8.js → X-Coju733X.js} +1 -1
- package/dist/client/assets/{XCircle-CuIPHDkx.js → XCircle-BwKPKfX4.js} +1 -1
- package/dist/client/assets/{XClose-B-kxIP35.js → XClose-B27D0Pes.js} +1 -1
- package/dist/client/assets/{Zap-w2d1hiBo.js → Zap-Bt5a3_xw.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-dUyrsdf1.js → agent-connections-preview-BAKS5gJJ.js} +1 -1
- package/dist/client/assets/agent-detail-h81X2k4_.js +2 -0
- package/dist/client/assets/{agents-NISG8LkE.js → agents-C2VjCuoK.js} +1 -1
- package/dist/client/assets/{alert-dialog-CpiIzpaw.js → alert-dialog-BP-z4Ogy.js} +2 -2
- package/dist/client/assets/{auth-catchall-Dmbx7J6q.js → auth-catchall-D7kGH0lg.js} +1 -1
- package/dist/client/assets/automation-detail-BDUvniQC.js +1 -0
- package/dist/client/assets/{automations-CQIWjBPD.js → automations-CChtinnU.js} +1 -1
- package/dist/client/assets/{avatar-CbDE9O_w.js → avatar-BCqIRh9w.js} +1 -1
- package/dist/client/assets/{badge-BiElTurh.js → badge-CDP8kbvH.js} +1 -1
- package/dist/client/assets/{binder-DAywY5NR.js → binder-DCIUHgMq.js} +1 -1
- package/dist/client/assets/{breadcrumb-U9pZLesK.js → breadcrumb-jhLLcaSq.js} +1 -1
- package/dist/client/assets/{card-DXYG1PJt.js → card-Bby2NP30.js} +1 -1
- package/dist/client/assets/{chart-BbEOfgV-.js → chart-DSgLCPFS.js} +1 -1
- package/dist/client/assets/{checkbox-7ZiSm3FO.js → checkbox-CXNIiG-w.js} +1 -1
- package/dist/client/assets/{circle-alert-DJViAw6g.js → circle-alert-CK8igi7e.js} +1 -1
- package/dist/client/assets/{collapsible-B9yZLN6Y.js → collapsible-C7W88NZ4.js} +1 -1
- package/dist/client/assets/{collection-detail-Clb7680a.js → collection-detail-uSo4M9af.js} +2 -2
- package/dist/client/assets/{collection-display-button-BKC7veh8.js → collection-display-button-771l7C-D.js} +1 -1
- package/dist/client/assets/{collection-search-DwGryXKM.js → collection-search-BcxXiwnM.js} +1 -1
- package/dist/client/assets/{collection-tab-Bo-9KEsf.js → collection-tab-Ca4vJhb7.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CLdf4mbp.js → collection-table-wrapper-DRSC2j3q.js} +1 -1
- package/dist/client/assets/{collection-tabs-CPmBQ0Ih.js → collection-tabs-VNdwgO9D.js} +1 -1
- package/dist/client/assets/{command-BvPYgT3U.js → command-Ce4RvYhe.js} +1 -1
- package/dist/client/assets/{connect-DfhSkdZH.js → connect-BK7xH19m.js} +1 -1
- package/dist/client/assets/{connection-card-C48yZP0o.js → connection-card-8C6CCQg8.js} +1 -1
- package/dist/client/assets/{connection-detail-UUX3N3PI.js → connection-detail-DCm0Gf7T.js} +1 -1
- package/dist/client/assets/{connection-status-EaZNPeGi.js → connection-status-D82b0hJj.js} +1 -1
- package/dist/client/assets/{connections-DuZzWjnz.js → connections-eH8HE_fN.js} +1 -1
- package/dist/client/assets/{constants-BtZ3fAEQ.js → constants-CzDvwmSY.js} +1 -1
- package/dist/client/assets/constants-o-H0wcv5.js +1 -0
- package/dist/client/assets/context-DWa5-aY3.js +21 -0
- package/dist/client/assets/{create-organization-dialog-CUI7nss-.js → create-organization-dialog-D8Pt61pM.js} +1 -1
- package/dist/client/assets/{create-project-dialog-DI59mOlr.js → create-project-dialog-KRfVbR_V.js} +1 -1
- package/dist/client/assets/{danger-CgyY9J87.js → danger-lBuPJ9ow.js} +1 -1
- package/dist/client/assets/{danger-zone-CDTRHqoC.js → danger-zone-DwgtnkJb.js} +1 -1
- package/dist/client/assets/decopilot-events-Brt4gAR6.js +1 -0
- package/dist/client/assets/{dependencies-C-LUznBo.js → dependencies-ByapbBJ1.js} +1 -1
- package/dist/client/assets/dialog-DVrvUtp4.js +1 -0
- package/dist/client/assets/{dropdown-menu-W_lhWsM7.js → dropdown-menu-_sgnI8Sd.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CLOgUYdt.js → dynamic-plugin-layout-EARuow4v.js} +1 -1
- package/dist/client/assets/{editable-task-title-DPm5hTsj.js → editable-task-title-DhgWYKTG.js} +1 -1
- package/dist/client/assets/{empty-state-DgczK1zq.js → empty-state-Cm3pZKVF.js} +1 -1
- package/dist/client/assets/{empty-state-Dz90tIjg.js → empty-state-VXOPlUbP.js} +1 -1
- package/dist/client/assets/{env-vars-editor-_us1Wsrd.js → env-vars-editor-CP22lwO9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-4B_VINLV.js → extract-connection-data-DtmJqtHf.js} +1 -1
- package/dist/client/assets/{file-browser-07_p2xwc.js → file-browser-DhXVJnGT.js} +2 -2
- package/dist/client/assets/{form-BcVHSZnK.js → form-CRKVnCMR.js} +1 -1
- package/dist/client/assets/{general-ByH8NK66.js → general-RoGak9EH.js} +1 -1
- package/dist/client/assets/{grid-view-G5Ljiye5.js → grid-view-DeQZC1Ad.js} +1 -1
- package/dist/client/assets/{home-CdGGIEZY.js → home-DDWI0l_A.js} +1 -1
- package/dist/client/assets/{icon-picker-BR9TG3fC.js → icon-picker-C7pK4XCN.js} +1 -1
- package/dist/client/assets/{index-DbAOnuVY.js → index-B8JTf3bb.js} +1 -1
- package/dist/client/assets/{index-C4stU7_X.js → index-BE_3KD3M.js} +1 -1
- package/dist/client/assets/{index-EJhirEgi.js → index-BwxEZIQr.js} +32 -32
- package/dist/client/assets/{index-DJJzspJA.js → index-CO5ACses.js} +1 -1
- package/dist/client/assets/{index-BLjdA58H.js → index-D4QMenD_.js} +1 -1
- package/dist/client/assets/{index-6R2fscZr.js → index-DBuq81UB.js} +1 -1
- package/dist/client/assets/index-DIpn2laL.js +1 -0
- package/dist/client/assets/{index-D9aD7jmG.js → index-DRz1LsGS.js} +1 -1
- package/dist/client/assets/{index-Dv4huKa6.js → index-DzqmGhb3.js} +1 -1
- package/dist/client/assets/index-mgXzNPbR.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver--lmuu5bR.js → infiniteQueryObserver-CZi5HeDN.js} +1 -1
- package/dist/client/assets/{input-23yd6VmI.js → input-Fhdajp_c.js} +1 -1
- package/dist/client/assets/{integration-icon-DnuBmEuk.js → integration-icon-TkiXAcCx.js} +1 -1
- package/dist/client/assets/{label-t2hx_05l.js → label-BLns8yFo.js} +1 -1
- package/dist/client/assets/{layout-Bw9dlo1E.js → layout-DQ81Lcct.js} +1 -1
- package/dist/client/assets/{layout-PA5WM8-4.js → layout-DeyJpCSu.js} +1 -1
- package/dist/client/assets/{login-n1KLhNbG.js → login-0CbZQiT4.js} +1 -1
- package/dist/client/assets/{logo-upload-B8w0TwVt.js → logo-upload-DUpx1K3j.js} +1 -1
- package/dist/client/assets/{markdown-D-1lsMgV.js → markdown-nhoc672y.js} +8 -8
- package/dist/client/assets/{mcp-app-renderer-YYUTU_-w.js → mcp-app-renderer-Czr8i4GK.js} +1 -1
- package/dist/client/assets/{mcp-server-card-d9n08Fh_.js → mcp-server-card-CWmebPs2.js} +1 -1
- package/dist/client/assets/mcp-server-detail-CbDJjQnJ.js +2 -0
- package/dist/client/assets/{members-1p11_2SS.js → members-EshNMuE5.js} +1 -1
- package/dist/client/assets/{monaco-editor-u58hRDQ4.js → monaco-editor-B6P_dgEC.js} +1 -1
- package/dist/client/assets/{monitoring-BB5FmWMv.js → monitoring-Dp7ndAsk.js} +11 -11
- package/dist/client/assets/{monitoring-dashboard-edit--q5QEX5i.js → monitoring-dashboard-edit-ClBenkfK.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-UsQjkLki.js → monitoring-dashboard-view-DS6l3WrT.js} +1 -1
- package/dist/client/assets/{oauth-callback-BL_sqHVU.js → oauth-callback-C1BG3W1h.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Cx3DblLQ.js → oauth-callback-ai-provider-DZLVWOw_.js} +1 -1
- package/dist/client/assets/org-ai-providers-DyjPbDPw.js +1 -0
- package/dist/client/assets/page-Dm5wW5_4.js +1 -0
- package/dist/client/assets/page-R2MxmNee.js +1 -0
- package/dist/client/assets/{plugin-empty-state-DgqJPRi5.js → plugin-empty-state-DILviBJd.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CJh4Lqbf.js → plugin-empty-state-DOItggu9.js} +1 -1
- package/dist/client/assets/{plugin-header-KT2ilJzM.js → plugin-header-BPoTqcJO.js} +1 -1
- package/dist/client/assets/{plugin-header-DDT-qUkq.js → plugin-header-CmM0hhfH.js} +1 -1
- package/dist/client/assets/plugins-Cp4R69Ly.js +1 -0
- package/dist/client/assets/{popover-Cmt-BFZN.js → popover-PQM18UlA.js} +1 -1
- package/dist/client/assets/project-app-view-CO-ltixT.js +1 -0
- package/dist/client/assets/project-layout-CRYoVp6K.js +1 -0
- package/dist/client/assets/{project-plugins-Caet_L4_.js → project-plugins-_fYzNgni.js} +1 -1
- package/dist/client/assets/{projects-list-DWFSv3Ix.js → projects-list-BPNPhjeN.js} +1 -1
- package/dist/client/assets/{readme-viewer-Xgb_lJQx.js → readme-viewer-Bxl1dElh.js} +1 -1
- package/dist/client/assets/{registry-layout-M9XW6rhp.js → registry-layout-zDOn9GUq.js} +1 -1
- package/dist/client/assets/{registry-utils-Bc7JySBD.js → registry-utils-BSSbBnO1.js} +1 -1
- package/dist/client/assets/{reports-layout-DiGXJ7eO.js → reports-layout-D4qhgPNX.js} +1 -1
- package/dist/client/assets/{reset-password-CwVXb38O.js → reset-password-fmyW6U2y.js} +1 -1
- package/dist/client/assets/{resizable-ghy0Xufz.js → resizable-Cm6dp-B2.js} +1 -1
- package/dist/client/assets/{save-actions-DvQBIk-t.js → save-actions-DuKbd0Td.js} +1 -1
- package/dist/client/assets/{scroll-area-DzWnDQB-.js → scroll-area-B-Ee7B_j.js} +1 -1
- package/dist/client/assets/{select-B2Bho1QQ.js → select-1RddZ4CO.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-Tk-m3Fu9.js → select-virtual-mcp-DGdxHoQi.js} +1 -1
- package/dist/client/assets/shell-layout-Ca0m0ZLh.js +3 -0
- package/dist/client/assets/{sidebar-settings-BTY81fOZ.js → sidebar-settings-De4sr2dR.js} +1 -1
- package/dist/client/assets/{skeleton-BDMxlKkg.js → skeleton-DJF7tug6.js} +1 -1
- package/dist/client/assets/{spinner-DcYxwnHl.js → spinner-BnxbYYlb.js} +1 -1
- package/dist/client/assets/{store-invite-CDA2bein.js → store-invite-oCuf7I6o.js} +1 -1
- package/dist/client/assets/{switch-DRgBKNMz.js → switch-Bq8IUh07.js} +1 -1
- package/dist/client/assets/{table-Bs6V2h_N.js → table-BqV5DzoG.js} +1 -1
- package/dist/client/assets/{tabs-Cbvel-f6.js → tabs-C5hfwptf.js} +1 -1
- package/dist/client/assets/{task-status-B95CCzhX.js → task-status-Bl9QTmtn.js} +30 -22
- package/dist/client/assets/tasks-0Eg7ZyIZ.js +1 -0
- package/dist/client/assets/{tasks-panel-BGarv8W1.js → tasks-panel-OJ8S6gUG.js} +1 -1
- package/dist/client/assets/{textarea--Uagmopx.js → textarea-Bz-C9pBX.js} +1 -1
- package/dist/client/assets/{time-range-picker-Vb_Ca2x7.js → time-range-picker-BTo-nySJ.js} +1 -1
- package/dist/client/assets/{toggle-group-CnbQDoAl.js → toggle-group-P3u85xuW.js} +1 -1
- package/dist/client/assets/{tools-list-Cd5xU46X.js → tools-list-CAH2xsXw.js} +1 -1
- package/dist/client/assets/{tooltip-BXI94UP3.js → tooltip-aT8SYWF_.js} +1 -1
- package/dist/client/assets/{topbar-portal-BgYtwYtw.js → topbar-portal-C-sDPeUg.js} +1 -1
- package/dist/client/assets/{types-CdefEA9e.js → types-Dpvg5M06.js} +1 -1
- package/dist/client/assets/usage-t6qWPVZ4.js +1 -0
- package/dist/client/assets/{use-automations-3lm8AX10.js → use-automations-qsid-9wy.js} +1 -1
- package/dist/client/assets/{use-binding-THgLcp9C.js → use-binding-BmEXmDTS.js} +1 -1
- package/dist/client/assets/{use-collections-B4b2cHqe.js → use-collections-L9vgkwE-.js} +1 -1
- package/dist/client/assets/{use-connection-DrhtnyBi.js → use-connection-DneEev9a.js} +1 -1
- package/dist/client/assets/{use-copy-BAQklmkz.js → use-copy-D_A8LaGR.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DLy6t37V.js → use-create-virtual-mcp-CWD_gaUu.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-EOOhwh-F.js → use-install-from-registry--Cp53uqX.js} +1 -1
- package/dist/client/assets/{use-list-state-BXqBxE3W.js → use-list-state-CcAjjCVm.js} +1 -1
- package/dist/client/assets/{use-llm-B0ZUgM3D.js → use-llm-uI2ZLalw.js} +1 -1
- package/dist/client/assets/use-local-storage-CI_WEqce.js +1 -0
- package/dist/client/assets/{use-mcp-prompts-LuO7HYtE.js → use-mcp-prompts-CpqNoP0o.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-Dk6zV1FV.js → use-mcp-resources-BsCeSR2x.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CKkWOyR2.js → use-mcp-tools-DNu930_U.js} +1 -1
- package/dist/client/assets/{use-members-DQi2Ov4F.js → use-members-DpuzXMS1.js} +1 -1
- package/dist/client/assets/{use-mobile-DwOvFQ5A.js → use-mobile-DFD6SQiI.js} +1 -1
- package/dist/client/assets/{use-project-UxeKn7lk.js → use-project-BAPzM4i4.js} +1 -1
- package/dist/client/assets/{use-view-mode-CkJMVXNZ.js → use-view-mode-2oXrhkvB.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D_iE9Cdz.js → use-virtual-mcp-CvmGsLOT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D9IG6LkB.js +1 -0
- package/dist/client/assets/{useMutation-ClueFvpj.js → useMutation-xr8MgEC0.js} +1 -1
- package/dist/client/assets/useQuery-BMWtXZn8.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DIDJd1Uk.js +1 -0
- package/dist/client/assets/{user-CmrAywRT.js → user-Ye6g7e7k.js} +1 -1
- package/dist/client/assets/{workflow-DUiHQumC.js → workflow-ckfsqQYq.js} +1 -1
- package/dist/client/index.html +11 -2
- package/dist/client/og-image.png +0 -0
- package/dist/server/cli.js +219 -219
- package/dist/server/migrate.js +1 -1
- package/dist/server/server.js +134 -134
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-gWgaUo37.js +0 -2
- package/dist/client/assets/automation-detail-pgXQ6r-z.js +0 -1
- package/dist/client/assets/constants-DCSMrWwu.js +0 -1
- package/dist/client/assets/context-228p0Ol2.js +0 -29
- package/dist/client/assets/default-model-D8jxKXJs.js +0 -1
- package/dist/client/assets/dialog-DD3DgOo2.js +0 -1
- package/dist/client/assets/index-BL4eeGnH.js +0 -1
- package/dist/client/assets/index-wbJeckpV.js +0 -1
- package/dist/client/assets/localstorage-keys-CyCsfmz2.js +0 -1
- package/dist/client/assets/mcp-server-detail-CK4-sRdM.js +0 -2
- package/dist/client/assets/org-ai-providers-DEZEBxef.js +0 -1
- package/dist/client/assets/page-4As1cwNm.js +0 -1
- package/dist/client/assets/page-bNXst3ko.js +0 -1
- package/dist/client/assets/plugins-s9Jf7v31.js +0 -1
- package/dist/client/assets/project-app-view-DhZEpR7h.js +0 -1
- package/dist/client/assets/project-layout-7FJbf_iM.js +0 -1
- package/dist/client/assets/shell-layout-ChsgawOS.js +0 -3
- package/dist/client/assets/tasks-C8R0uxcK.js +0 -1
- package/dist/client/assets/usage-B8eRkRZY.js +0 -1
- package/dist/client/assets/use-preferences-D5crHwiP.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Dg54E7EH.js +0 -1
- package/dist/client/assets/useQuery-mGiR1oLn.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DUeEwu4s.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-EJhirEgi.js","assets/index-nyzBJx9G.css","assets/index-BL4eeGnH.js","assets/use-collections-B4b2cHqe.js","assets/useMutation-ClueFvpj.js","assets/constants-BtZ3fAEQ.js","assets/use-connection-DrhtnyBi.js","assets/use-mcp-tools-CKkWOyR2.js","assets/useQuery-mGiR1oLn.js","assets/use-mcp-resources-Dk6zV1FV.js","assets/use-mcp-prompts-LuO7HYtE.js","assets/use-virtual-mcp-D_iE9Cdz.js","assets/default-model-D8jxKXJs.js","assets/usage-B8eRkRZY.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as Y,c as G,j as t,B as se,w as me,z as ze,K as ue,c0 as fe,u as _e,e as Ie,O as ie,g as Fe,d as Oe,f as He,at as Ge}from"./index-EJhirEgi.js";import{i as qe}from"./AlertCircle-48gOoEWA.js";import{i as ke}from"./Loading01-BUlApwyE.js";import{P as de}from"./index-wbJeckpV.js";import{b as Ke,c as We,a as Qe,T as Ye}from"./tooltip-BXI94UP3.js";import{i as Je}from"./Check-BWCeXHN7.js";import{a as Xe}from"./Copy01-BJVPuQbm.js";import{I as Te}from"./integration-icon-DnuBmEuk.js";import{i as Ze}from"./CheckCircle-DZcEBbaZ.js";import{t as et}from"./ChevronDown-B15SC8MA.js";import{s as ve}from"./Plus-CiuqWk7L.js";import{a as tt,c as st,b as rt,D as ot}from"./dropdown-menu-W_lhWsM7.js";import{n as be}from"./LinkExternal01--09S5N5q.js";import{E as nt}from"./empty-state-Dz90tIjg.js";import{R as ye}from"./readme-viewer-Xgb_lJQx.js";import{u as pe}from"./useQuery-mGiR1oLn.js";import{m as je}from"./marked.esm-BaswSlok.js";import{a as it}from"./tools-list-Cd5xU46X.js";import{C as lt}from"./collection-tabs-CPmBQ0Ih.js";import{s as at}from"./Globe02-BtYVEi0C.js";import{a as ct,b as dt,e as mt}from"./mcp-server-card-d9n08Fh_.js";import{i as ut}from"./Terminal-CJ1WAC7b.js";import{B as ft,a as pt,b as Ne,d as xt,e as ht,c as gt}from"./breadcrumb-U9pZLesK.js";import{u as vt}from"./use-binding-THgLcp9C.js";import{a as bt,b as yt,u as jt}from"./use-connection-DrhtnyBi.js";import{u as Nt}from"./constants-BtZ3fAEQ.js";import{u as wt}from"./use-mcp-tools-CKkWOyR2.js";import{u as Ct,L as St}from"./localstorage-keys-CyCsfmz2.js";import{e as _t}from"./extract-connection-data-4B_VINLV.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{f as Lt,d as we,g as Pt,h as Mt}from"./registry-utils-Bc7JySBD.js";import{i as Rt}from"./InfoCircle-BqEmSE9k.js";import"./index-Dv4huKa6.js";import"./Container-C4I-ZzWI.js";import"./ChevronRight-DNq10e3Z.js";import"./File06-NiquJK6U.js";import"./collection-display-button-BKC7veh8.js";import"./ArrowDown-_L7cw1A8.js";import"./ArrowUp-DKc3SUsQ.js";import"./Grid01-Cj17P1tC.js";import"./List-c0L2g9Qy.js";import"./badge-BiElTurh.js";import"./collection-search-DwGryXKM.js";import"./SearchMd-D_8XQU19.js";import"./input-23yd6VmI.js";import"./collection-table-wrapper-CLdf4mbp.js";import"./table-Bs6V2h_N.js";import"./card-DXYG1PJt.js";import"./types-CdefEA9e.js";import"./Eye-DkD5as17.js";import"./LayersTwo01-CqPgQoaH.js";import"./layout-PA5WM8-4.js";import"./CheckVerified02-UCZI60jf.js";import"./Lock01-D2mdnqp4.js";import"./binder-DAywY5NR.js";import"./use-collections-B4b2cHqe.js";import"./useMutation-ClueFvpj.js";import"./constants-DCSMrWwu.js";import"./generate-id-Dyweu44Y.js";const Le=({size:r=24,color:e="currentColor",...s})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},Y.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Le.displayName="SearchLg";function Dt(r){const e=G.c(3),{message:s}=r,o=s===void 0?"Loading MCP Server details...":s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ke,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let l;return e[1]!==o?(l=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,t.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),e[1]=o,e[2]=l):l=e[2],l}function Et(r){const e=G.c(9),{error:s,onBack:o}=r,n=s instanceof Error?s.message:s;let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(qe,{size:48,className:"text-destructive mb-4"}),c=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let m;e[2]!==n?(m=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=m):m=e[3];let a;e[4]!==o?(a=t.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==m||e[7]!==a?(d=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[l,c,m,a]}),e[6]=m,e[7]=a,e[8]=d):d=e[8],d}function Ut(r){const e=G.c(5),{onBack:s}=r;let o,n,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Le,{size:48,className:"text-muted-foreground mb-4"}),n=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),l=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=o,e[1]=n,e[2]=l):(o=e[0],n=e[1],l=e[2]);let c;return e[3]!==s?(c=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,n,l,t.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=s,e[4]=c):c=e[4],c}function $t(r){const e=G.c(11),{breadcrumb:s,shareUrl:o}=r,[n,l]=Y.useState(!1);let c;e[0]!==o?(c=async()=>{o&&(await navigator.clipboard.writeText(o),l(!0),me.success("Share link copied to clipboard"),setTimeout(()=>l(!1),2e3))},e[0]=o,e[1]=c):c=e[1];const m=c;let a;e[2]!==s?(a=t.jsx(de.Header.Left,{children:s}),e[2]=s,e[3]=a):a=e[3];let d;e[4]!==n||e[5]!==m||e[6]!==o?(d=o&&t.jsx(de.Header.Right,{children:t.jsx(Ke,{children:t.jsxs(We,{children:[t.jsx(Qe,{asChild:!0,children:t.jsxs(se,{variant:"outline",size:"sm",onClick:m,className:"gap-1.5 cursor-pointer",children:[n?t.jsx(Je,{size:16,className:"text-green-600"}):t.jsx(Xe,{size:16}),t.jsx("span",{children:n?"Copied!":"Share"})]})}),t.jsx(Ye,{children:t.jsx("p",{children:"Copy a universal link anyone can use to find this MCP"})})]})})}),e[4]=n,e[5]=m,e[6]=o,e[7]=d):d=e[7];let w;return e[8]!==a||e[9]!==d?(w=t.jsxs(de.Header,{children:[a,d]}),e[8]=a,e[9]=d,e[10]=w):w=e[10],w}function Ce(r){const e=G.c(28),{versions:s,selectedIndex:o,onSelect:n,isInstalling:l,variant:c,showLabel:m}=r,a=l===void 0?!1:l,d=c===void 0?"default":c,w=m===void 0?!1:m,p=s[o],I=w?"sm":"default",f=d==="default"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let v;e[0]!==f?(v=ze("shrink-0 cursor-pointer",f),e[0]=f,e[1]=v):v=e[1];let u;e[2]!==p?.server?.version||e[3]!==w?(u=w&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=w,e[4]=u):u=e[4];const N=w?14:20;let h;e[5]!==N?(h=t.jsx(et,{size:N}),e[5]=N,e[6]=h):h=e[6];let y;e[7]!==a||e[8]!==I||e[9]!==v||e[10]!==u||e[11]!==h||e[12]!==d?(y=t.jsx(tt,{asChild:!0,children:t.jsxs(se,{variant:d,disabled:a,size:I,className:v,children:[u,h]})}),e[7]=a,e[8]=I,e[9]=v,e[10]=u,e[11]=h,e[12]=d,e[13]=y):y=e[13];let j;if(e[14]!==a||e[15]!==n||e[16]!==o||e[17]!==s){let T;e[19]!==a||e[20]!==n||e[21]!==o?(T=(S,_)=>{const M=S._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(st,{onClick:()=>n(_),disabled:a,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),M?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),_===o&&t.jsx(Ze,{size:16,className:"text-muted-foreground shrink-0"})]})},_)},e[19]=a,e[20]=n,e[21]=o,e[22]=T):T=e[22],j=s.map(T),e[14]=a,e[15]=n,e[16]=o,e[17]=s,e[18]=j}else j=e[18];let g;e[23]!==j?(g=t.jsx(rt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:j}),e[23]=j,e[24]=g):g=e[24];let L;return e[25]!==y||e[26]!==g?(L=t.jsxs(ot,{children:[y,g]}),e[25]=y,e[26]=g,e[27]=L):L=e[27],L}function Vt(r){const e=G.c(46),{data:s,itemVersions:o,onInstall:n,canInstall:l,isInstalling:c,hideInstallControls:m,selectedVersionIndex:a,onVersionChange:d}=r,w=l===void 0?!0:l,p=c===void 0?!1:c,I=m===void 0?!1:m,[f,v]=Y.useState(0),u=a??f;let N;e[0]!==d?(N=U=>{v(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const h=N,y=o[u]||o[0];let j;e[2]!==y?.server?.remotes?(j=y?.server?.remotes??[],e[2]=y?.server?.remotes,e[3]=j):j=e[3];const g=j;let L;e[4]!==y?.server?.packages?(L=y?.server?.packages??[],e[4]=y?.server?.packages,e[5]=L):L=e[5];const S=L.length>0,_=g.length>0,M=g.findIndex(Bt),x=M>=0?M:0;let J;e[6]!==x||e[7]!==S||e[8]!==_||e[9]!==n||e[10]!==u?(J=()=>{_?n(u,x,void 0):S&&n(u,void 0,0)},e[6]=x,e[7]=S,e[8]=_,e[9]=n,e[10]=u,e[11]=J):J=e[11];const b=J;let R;e[12]!==o||e[13]!==n||e[14]!==h?(R=U=>{h(U);const O=o[U],W=O?.server?.remotes??[],q=O?.server?.packages??[];if(W.length>0){const oe=W.findIndex(At);n(U,oe>=0?oe:0,void 0)}else q.length>0&&n(U,void 0,0)},e[12]=o,e[13]=n,e[14]=h,e[15]=R):R=e[15];const A=R;let B;e[16]!==s.icon||e[17]!==s.name?(B=t.jsx(Te,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=B):B=e[18];let K;e[19]!==s.name?(K=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=K):K=e[20];let F;e[21]!==s.verified?(F=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=F):F=e[22];let k;e[23]!==K||e[24]!==F?(k=t.jsxs("div",{className:"flex items-center gap-2",children:[K,F]}),e[23]=K,e[24]=F,e[25]=k):k=e[25];let C;e[26]!==s.shortDescription?(C=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=C):C=e[27];let V;e[28]!==k||e[29]!==C?(V=t.jsxs("div",{className:"flex-1 min-w-0",children:[k,C]}),e[28]=k,e[29]=C,e[30]=V):V=e[30];let D;e[31]!==w||e[32]!==b||e[33]!==A||e[34]!==I||e[35]!==p||e[36]!==o||e[37]!==u||e[38]!==h?(D=w&&!I?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:o.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(se,{variant:"default",size:"sm",onClick:b,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(ve,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(Ce,{versions:o,selectedIndex:u,onSelect:A,isInstalling:p,variant:"outline"})]}):t.jsxs(se,{variant:"default",size:"sm",onClick:b,disabled:o.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(ve,{size:20}),p?"Connecting...":"Connect"]})}):I?o.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(Ce,{versions:o,selectedIndex:u,onSelect:h,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=b,e[33]=A,e[34]=I,e[35]=p,e[36]=o,e[37]=u,e[38]=h,e[39]=D):D=e[39];let E;e[40]!==V||e[41]!==D?(E=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[V,D]}),e[40]=V,e[41]=D,e[42]=E):E=e[42];let z;return e[43]!==E||e[44]!==B?(z=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[B,E]}),e[43]=E,e[44]=B,e[45]=z):z=e[45],z}function At(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function Bt(r){return r.type?.toLowerCase()==="http"||r.type?.toLowerCase()==="streamable-http"}function zt(r){if(!r)return"—";try{const e=new Date(r);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Ft(r){const e=G.c(47),{data:s,publisherInfo:o,selectedItem:n}=r;let l;e[0]!==s.description?(l=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=l):l=e[1];const c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let m;e[2]!==o.logo||e[3]!==c?(m=t.jsx(Te,{icon:o.logo,name:c,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=o.logo,e[3]=c,e[4]=m):m=e[4];let a;e[5]!==s.publisher?(a=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=a):a=e[6];let d;e[7]!==a?(d=t.jsx("div",{className:"font-medium",children:a}),e[7]=a,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let p;e[10]!==d?(p=t.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=p):p=e[11];let I;e[12]!==m||e[13]!==p?(I=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[m,p]})}),e[12]=m,e[13]=p,e[14]=I):I=e[14];let f;e[15]!==s.version?(f=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=f):f=e[16];let v;e[17]!==s.tags?(v=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(Ht)})]}),e[17]=s.tags,e[18]=v):v=e[18];let u;e[19]!==s.categories?(u=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(Ot)})]}),e[19]=s.categories,e[20]=u):u=e[20];let N;e[21]!==s.connectionType?(N=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=N):N=e[22];let h;e[23]!==s.schemaVersion?(h=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=h):h=e[24];let y;e[25]!==s.websiteUrl?(y=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(be,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=y):y=e[26];let j;e[27]!==s.repository?(j=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(be,{size:14})]})]}),e[27]=s.repository,e[28]=j):j=e[28];let g;e[29]!==v||e[30]!==u||e[31]!==N||e[32]!==h||e[33]!==y||e[34]!==j||e[35]!==f?(g=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[f,v,u,N,h,y,j]}),e[29]=v,e[30]=u,e[31]=N,e[32]=h,e[33]=y,e[34]=j,e[35]=f,e[36]=g):g=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=L):L=e[37];let T;e[38]!==n.updated_at?(T=zt(n.updated_at),e[38]=n.updated_at,e[39]=T):T=e[39];let S;e[40]!==T?(S=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[L,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:T})]}),e[40]=T,e[41]=S):S=e[41];let _;return e[42]!==l||e[43]!==g||e[44]!==S||e[45]!==I?(_=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[l,I,g,S]}),e[42]=l,e[43]=g,e[44]=S,e[45]=I,e[46]=_):_=e[46],_}function Ot(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}function Ht(r){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:r},r)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],qt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Kt(r){if(!r)return"Local";try{return new URL(r).hostname}catch{return r}}function Wt(r){if(!r)return"local";try{const e=new URL(r).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Qt(r){const e=qt[r.toLowerCase()];return e||r.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function Yt(r){if(!r)return"http";const e=r.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Jt(r){return r.map((e,s)=>{const o=Yt(e.type),n=Kt(e.url),l=Wt(e.url),c=e.title||e.name||Qt(l);return{index:s,protocol:o,url:e.url,hostname:n,serviceName:l,displayName:c,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(r){const e=G.c(2),{protocol:s,className:o}=r;let n;return e[0]!==o?(n={http:t.jsx(at,{className:o}),sse:t.jsx(dt,{className:o}),stdio:t.jsx(ut,{className:o})},e[0]=o,e[1]=n):n=e[1],n[s]}function Zt(r){const e=G.c(10),{options:s,selected:o,onSelect:n}=r;if(s.length<=1)return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=l):l=e[0];let c;if(e[1]!==n||e[2]!==s||e[3]!==o){let a;e[5]!==n||e[6]!==o?(a=d=>t.jsxs(se,{variant:o===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[t.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=o,e[7]=a):a=e[7],c=s.map(a),e[1]=n,e[2]=s,e[3]=o,e[4]=c}else c=e[4];let m;return e[8]!==c?(m=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l,t.jsx("div",{className:"flex gap-1",children:c})]}),e[8]=c,e[9]=m):m=e[9],m}function es(r){const e=G.c(11),{servers:s,onInstall:o,isInstalling:n,icon:l,mcpName:c,showStdio:m}=r,a=n===void 0?!1:n,d=m===void 0?!1:m,w=d?s:s.filter(os),p=Jt(w),I=p.length<13?"all":"http",[f,v]=Y.useState(I);let u;e:{if(f==="all"){u="all";break e}let x;if(e[0]!==f?(x=b=>b.protocol===f,e[0]=f,e[1]=x):x=e[1],p.some(x)){u=f;break e}if(p.length<13){u="all";break e}u=p[0]?.protocol??"http"}const N=u,h=N==="all"?p:p.filter(x=>x.protocol===N),y=new Set(p.map(rs));let j=Gt.filter(x=>x.value==="all"||y.has(x.value));d||(j=j.filter(ss));const g=y.size<=1?j.filter(ts):j,L="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let T;e[2]!==l||e[3]!==a||e[4]!==c||e[5]!==o?(T=x=>t.jsx(ct,{variant:"server",icon:l??null,displayName:x.displayName,description:x.description??null,hostname:x.hostname,protocol:x.protocol,isInstalling:a,onClick:()=>o({type:x.protocol,url:x.url,name:x.name,title:x.title,description:x.description,_type:x._type,_index:x._index})},`${x.hostname}-${x.protocol}-${x.index}`),e[2]=l,e[3]=a,e[4]=c,e[5]=o,e[6]=T):T=e[6];const S=h.map(T);let _;e[7]!==S?(_=t.jsx("div",{className:L,children:S}),e[7]=S,e[8]=_):_=e[8];let M;return e[9]!==h.length?(M=h.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=h.length,e[10]=M):M=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(Zt,{options:g,selected:N,onSelect:v}),_,M]})}function ts(r){return r.value!=="all"}function ss(r){return r.value!=="stdio"}function rs(r){return r.protocol}function os(r){return r.type?.toLowerCase()!=="stdio"}async function Se(r){return(await fe(async()=>{const{default:s}=await import("./purify.es-CovBOfck.js");return{default:s}},[])).default.sanitize(r,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form"],FORBID_ATTR:["style"]})}function ns(r){const e=G.c(53),{data:s,availableTabs:o,effectiveActiveTabId:n,effectiveTools:l,isLoadingTools:c,onTabChange:m,servers:a,onInstallServer:d,isInstalling:w,mcpIcon:p,mcpName:I,showStdio:f}=r,v=c===void 0?!1:c;let u;e[0]!==a?(u=a===void 0?[]:a,e[0]=a,e[1]=u):u=e[1];const N=u,h=w===void 0?!1:w,y=f===void 0?!1:f;let j;e[2]!==s.readmeMarkdown?(j=s.readmeMarkdown?.trim(),e[2]=s.readmeMarkdown,e[3]=j):j=e[3];const g=!!j;let L;e[4]!==s.readmeUrl?(L=s.readmeUrl?.trim(),e[4]=s.readmeUrl,e[5]=L):L=e[5];const T=!!L;let S;e[6]!==s.readmeMarkdown?(S=ue.storeReadmeUrl(`embedded:${s.readmeMarkdown}`),e[6]=s.readmeMarkdown,e[7]=S):S=e[7];let _;e[8]!==s.readmeMarkdown?(_=async()=>{const q=je.parse(s.readmeMarkdown??"",{async:!1});return Se(q)},e[8]=s.readmeMarkdown,e[9]=_):_=e[9];let M;e[10]!==g||e[11]!==S||e[12]!==_?(M={queryKey:S,queryFn:_,enabled:g,staleTime:1/0},e[10]=g,e[11]=S,e[12]=_,e[13]=M):M=e[13];const{data:x,isLoading:J}=pe(M);let b;e[14]!==s.readmeUrl?(b=ue.storeReadmeUrl(s.readmeUrl),e[14]=s.readmeUrl,e[15]=b):b=e[15];let R;e[16]!==s.readmeUrl?(R=async()=>{if(!s.readmeUrl)return null;const q=await fetch(s.readmeUrl);if(!q.ok)throw new Error(`Failed to fetch README (${q.status})`);const re=await q.text();return Se(je.parse(re,{async:!1}))},e[16]=s.readmeUrl,e[17]=R):R=e[17];const A=T&&!g;let B;e[18]!==b||e[19]!==R||e[20]!==A?(B={queryKey:b,queryFn:R,enabled:A,staleTime:36e5,gcTime:864e5},e[18]=b,e[19]=R,e[20]=A,e[21]=B):B=e[21];const{data:K,isLoading:F}=pe(B),k=x??K??null,C=g&&J||!g&&F;let V;e[22]!==l?(V=l.map(is),e[22]=l,e[23]=V):V=e[23];const D=V;let E;e[24]!==o||e[25]!==n||e[26]!==m?(E=o.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(lt,{tabs:o,activeTab:n,onTabChange:m})}),e[24]=o,e[25]=n,e[26]=m,e[27]=E):E=e[27];let z;e[28]!==n||e[29]!==h||e[30]!==p||e[31]!==I||e[32]!==d||e[33]!==N||e[34]!==y?(z=n==="servers"&&N.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(es,{servers:N,onInstall:q=>d?.(q),isInstalling:h,icon:p,mcpName:I,showStdio:y})}),e[28]=n,e[29]=h,e[30]=p,e[31]=I,e[32]=d,e[33]=N,e[34]=y,e[35]=z):z=e[35];let U;e[36]!==n||e[37]!==l.length||e[38]!==v||e[39]!==D?(U=n==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:v?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ke,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):l.length>0?t.jsx(it,{tools:D,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(nt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[36]=n,e[37]=l.length,e[38]=v,e[39]=D,e[40]=U):U=e[40];let O;e[41]!==k||e[42]!==C||e[43]!==s.repository||e[44]!==n||e[45]!==g||e[46]!==T?(O=n==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:g||T?t.jsx(ye,{html:k,isLoading:C}):t.jsx(ye,{repository:s?.repository})}),e[41]=k,e[42]=C,e[43]=s.repository,e[44]=n,e[45]=g,e[46]=T,e[47]=O):O=e[47];let W;return e[48]!==E||e[49]!==z||e[50]!==U||e[51]!==O?(W=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[E,z,U,O]}),e[48]=E,e[49]=z,e[50]=U,e[51]=O,e[52]=W):W=e[52],W}function is(r){const e=r;return{name:e.name||"",description:e.description||void 0}}function ls(r,e){if(!r||!e)return;const s=e.toLowerCase();return r.find(o=>o.app_name?.toLowerCase()===s||o.app_id?.toLowerCase()===s||o.title.toLowerCase()===s)||r.find(o=>o.title.toLowerCase().includes(s))}function as(r,e,s,o,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:o?.icon||void 0,count:n??r.length};const l=e.toLowerCase(),c=r.filter(a=>(a._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":a.publisher||a._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===l);return{logo:s?.icon||c[0]?.publisher_logo||c[0]?.icon||void 0,count:c.length}}function cs(r){const e=r._meta?.["mcp.mesh"],s=r._meta?.["io.modelcontextprotocol.registry/official"],o=r.server??{},n=Pt(o?.remotes?.[0]?.type),l=Mt(o?.$schema),c=r.id?.includes("/")?r.id.split("/")[0]:void 0,m=s?"io.modelcontextprotocol.registry/official":r.publisher||e?.scopeName||c||"Unknown",a=Tt(o.repository),d=r.icon||r.image||r.logo||o.icons?.[0]?.src||a||null,w=r.name||r.title||r.server?.title||"Unnamed Item",p=mt(w),I=e?.friendly_name||p,f=e?.mesh_description||r.description||r.summary||o?.description||"",v=e?.short_description||null,u=typeof e?.readme=="string"?e.readme:null,N=typeof e?.readme_url=="string"?e.readme_url:null,h=e?.tags||[],y=e?.categories||[];return{name:I,description:f,shortDescription:v,readmeMarkdown:u,readmeUrl:N,icon:d,verified:r.verified||e?.verified,publisher:m,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:l??null,connectionType:n,connectionUrl:o?.remotes?.[0]?.url||null,remoteUrl:o?.remotes?.[0]?.url||null,tags:h,categories:y,tools:r.tools||o.tools||e?.tools||[],models:r.models||o.models||e?.models||[],emails:r.emails||o.emails||e?.emails||[],analytics:r.analytics||o.analytics||e?.analytics,cdn:r.cdn||o.cdn||e?.cdn}}class ds extends Y.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(Et,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ms(){const{org:r}=_e(),e=Ie(),{appName:s}=Fe({strict:!1}),{registryId:o,serverName:n,stdio:l}=Oe({strict:!1}),[c,m]=Ct(St.storeShowStdio(),()=>!1),a=l==="true"?!0:l==="false"?!1:c;l!==void 0&&l==="true"!==c&&m(l==="true");const[d,w]=Y.useState(null),[p,I]=Y.useState(null),[f,v]=Y.useState(null),u=bt(),N=yt(),{data:h}=He.useSession(),y=vt(N),j=o||y[0]?.id||"",g=jt(j),L=Lt(g?.tools),T=we(g?.tools??null,"_VERSIONS"),S=we(g?.tools??null,"_GET"),_=!!n;let M="",x={};_?(M=T||S,x={name:n}):(M=L,x={});const J=Nt({connectionId:j||null,orgId:r.id}),{data:b}=wt({client:J,toolName:M,toolArguments:x,select:i=>i.structuredContent??i});let R=[],A=[],B=null;if(b){if(Array.isArray(b))R=b;else if(typeof b=="object"&&b!==null)if("totalCount"in b&&typeof b.totalCount=="number"&&(B=b.totalCount),"item"in b&&b.item){const i=b.item;R=[{id:i.id||"",title:i.title,server:i.server,_meta:i._meta}]}else{let i;"versions"in b&&Array.isArray(b.versions)?i="versions":"servers"in b&&Array.isArray(b.servers)?i="servers":i=Object.keys(b).find(P=>Array.isArray(b[P])),i&&(R=b[i],(i==="versions"||M?.includes("VERSIONS"))&&(A=R))}}const K=(()=>{const i=A.findIndex(P=>P._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return i>=0?i:0})(),F=p??K;let k=R.find(i=>{const P=i.name||i.title||i.server?.title||"";return It(P)===s});!k&&n&&(k=R.find(i=>i.id===n||i.server?.name===n||i.name===n||i.title===n));const C=k?cs(k):null,V=(C?.tools?.length||0)>0,D=k?.server?.remotes?.[0]?.url||null,E=!V&&!!D,z=pe({queryKey:ue.remoteMcpTools(D),queryFn:async()=>{if(!D)return[];const{Client:i}=await fe(async()=>{const{Client:X}=await import("./index-EJhirEgi.js").then($=>$.c_);return{Client:X}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:P}=await fe(async()=>{const{StreamableHTTPClientTransport:X}=await import("./index-BL4eeGnH.js");return{StreamableHTTPClientTransport:X}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9,10,11,12,13])),H=new i({name:"mesh-store",version:"1.0.0"}),Q=new P(new URL(D),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await H.connect(Q),((await H.listTools()).tools||[]).map($=>({name:$.name,description:$.description}))}finally{await H.close().catch(console.error)}},enabled:E}),U=E&&z.isLoading,O=z.data??[],W=V?C?.tools||[]:O,q=ls(N,C?.publisher),re=C?as(R,C.publisher,q,g??null,B):{count:0},oe=C?.repository?kt(C.repository):null,Pe=k?.server?.remotes??[],Me=k?.server?.packages??[],le=[...Pe.map((i,P)=>({...i,_type:"remote",_index:P})),...Me.map((i,P)=>({type:"stdio",url:void 0,name:i.name||i.identifier,title:i.name||i.identifier?.replace(/^@[^/]+\//,""),description:i.environmentVariables?.length?`Requires ${i.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:P}))],xe=a?le:le.filter(i=>i.type?.toLowerCase()!=="stdio"),he=xe.length>1,Z=[{id:"servers",label:"Servers",count:xe.length,visible:he},{id:"readme",label:"README",visible:!!C?.readmeMarkdown||!!C?.readmeUrl||!!C?.repository&&!!oe},{id:"tools",label:"Tools",count:W.length,visible:V||O.length>0||!!D}].filter(i=>i.visible),Re=Z.find(i=>i.id==="servers")?.id||Z.find(i=>i.id==="readme")?.id||Z[0]?.id||"overview",De=d&&Z.find(i=>i.id===d)?d:Re,ae=async(i,P,H,Q)=>{const X=A[i??0]||k;if(!X||!r||!h?.user?.id)return;const $=_t(X,r.id,h.user.id,{remoteIndex:H===void 0?P??0:void 0,packageIndex:H}),ee=$.connection_type==="STDIO",ne=!!$.connection_url,Be=ee&&$.connection_headers&&typeof $.connection_headers=="object"&&"command"in $.connection_headers;if(!ne&&!Be){me.error("This MCP Server cannot be connected: no connection method available");return}Q&&($.title=Q);try{const{id:te}=await u.create.mutateAsync($);e({to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:ie,connectionId:te}})}catch(te){me.error(`Failed to connect MCP Server: ${te instanceof Error?te.message:String(te)}`)}},ce=async(i,P,H)=>{const Q=A[i??0]||k;if(!Q)return;const X=Q.id??Q.title,$=N.filter(ee=>ee.app_name===X||ee.title===Q.title);if($.length>0){const ne=`${Q.title||"MCP Server"} (${$.length+1})`;v({step:"warning",existing:$,pendingArgs:[i,P,H],suggestedName:ne,customName:ne});return}ae(i,P,H)},Ee=()=>{e({to:"/$org/$project/store",params:{org:r.slug,project:ie}})};if(!k)return t.jsx(Ut,{onBack:Ee});if(!C)return null;const Ue=(k?.server?.remotes?.length??0)>0,$e=(k?.server?.packages?.length??0)>0,ge=Ue||$e,Ve=t.jsx(ft,{children:t.jsxs(pt,{children:[t.jsx(Ne,{children:t.jsx(xt,{asChild:!0,children:t.jsx(Ge,{to:"/$org/$project/store",params:{org:r.slug,project:ie},children:"Store"})})}),t.jsx(ht,{}),t.jsx(Ne,{children:t.jsx(gt,{children:C.name})})]})}),Ae=(()=>{const i=new URL(`/store/${encodeURIComponent(s||"")}`,window.location.origin);return n&&i.searchParams.set("serverName",n),i.href})();return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[f&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>v(null),children:t.jsx("div",{className:"bg-background border rounded-lg shadow-lg p-6 max-w-md w-full mx-4",onClick:i=>i.stopPropagation(),children:f.step==="warning"?t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"MCP Already Installed"}),t.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["You already have"," ",t.jsx("strong",{children:f.existing.length})," instance",f.existing.length!==1?"s":""," of this MCP installed:"]}),t.jsx("ul",{className:"text-sm space-y-1 mb-4 max-h-32 overflow-auto",children:f.existing.map(i=>t.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:i.title}),t.jsxs("span",{className:"text-xs",children:["(",i.created_at?new Date(i.created_at).toLocaleDateString():"—",")"]})]},i.id))}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>v(null),children:"Cancel"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>v({...f,step:"rename"}),children:"Install Anyway"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Choose a name"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Give this instance a different name to distinguish it, or keep the suggested one."}),t.jsx("input",{type:"text",className:"w-full rounded-md border bg-transparent px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-primary",value:f.customName,onChange:i=>v({...f,customName:i.target.value}),onKeyDown:i=>{if(i.key==="Enter"){const P=f.customName.trim()||f.suggestedName,H=f.pendingArgs;v(null),ae(...H,P)}},autoFocus:!0}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md border hover:bg-muted/50 transition-colors",onClick:()=>v({...f,step:"warning"}),children:"Back"}),t.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",onClick:()=>{const i=f.customName.trim()||f.suggestedName,P=f.pendingArgs;v(null),ae(...P,i)},children:"Install"})]})]})})}),t.jsx($t,{breadcrumb:Ve,shareUrl:Ae}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ge&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(Rt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(Vt,{data:C,itemVersions:A.length>0?A:[k],onInstall:ce,canInstall:ge,isInstalling:u.create.isPending,hideInstallControls:he,selectedVersionIndex:F,onVersionChange:I}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(Ft,{data:C,publisherInfo:re,selectedItem:k}),t.jsx(ns,{data:C,availableTabs:Z,effectiveActiveTabId:De,effectiveTools:W,isLoadingTools:U,onTabChange:w,servers:le,onInstallServer:i=>{i._type==="remote"?ce(F,i._index,void 0):ce(F,void 0,i._index)},isInstalling:u.create.isPending,mcpIcon:C.icon,mcpName:C.name,showStdio:a})]})]})})})]})}function vr(){const r=G.c(6),{org:e}=_e(),s=Ie();let o;r[0]!==s||r[1]!==e.slug?(o=()=>{s({to:"/$org/$project/store",params:{org:e.slug,project:ie}})},r[0]=s,r[1]=e.slug,r[2]=o):o=r[2];const n=o;let l;r[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Y.Suspense,{fallback:t.jsx(Dt,{}),children:t.jsx(ms,{})}),r[3]=l):l=r[3];let c;return r[4]!==n?(c=t.jsx(ds,{onBack:n,children:l}),r[4]=n,r[5]=c):c=r[5],c}export{vr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as L,e as re,d as ae,g as ie,u as G,x as W,w as C,K as b,j as s,z as ne,B as V,E as oe}from"./index-EJhirEgi.js";import{u as Y}from"./useMutation-ClueFvpj.js";import{i as le}from"./AlertCircle-48gOoEWA.js";import{i as ce}from"./EyeOff-BeKLPveV.js";import{s as de}from"./Eye-DkD5as17.js";import{i as me}from"./Key01-Be9_ogDx.js";import{s as ue}from"./Trash01-CHv5mU8b.js";import{C as fe}from"./card-DXYG1PJt.js";import{I as Z}from"./input-23yd6VmI.js";import{S as he}from"./skeleton-BDMxlKkg.js";import{A as xe}from"./avatar-CbDE9O_w.js";import{b as X,P as J,a as ee}from"./popover-Cmt-BFZN.js";import{a as ge,b as pe}from"./use-llm-B0ZUgM3D.js";import{u as te,a as se}from"./constants-BtZ3fAEQ.js";import{f as ve}from"./formatDistanceToNow-Cb2QZZJn.js";const je=({size:t=24,color:e="currentColor",...n})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},v.createElement("path",{d:"M9 2v2m6-2v2M9 20v2m6-2v2m5-13h2m-2 5h2M2 9h2m-2 5h2m4.8 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 17.72 20 16.88 20 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 4 16.88 4 15.2 4H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 6.28 4 7.12 4 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 20 7.12 20 8.8 20Zm1.8-5h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 14.24 15 13.96 15 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 9 13.96 9 13.4 9h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 9.76 9 10.04 9 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 15 10.04 15 10.6 15Z"}));je.displayName="CpuChip01";const ye=new Set(["account.profile","account.preferences","org.general","org.plugins","org.ai-providers","org.billing"]);function Ce(t){return t?ye.has(t):!1}function Ue(){const t=L.c(17),e=re();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const o=ae(n);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const{org:a,project:l}=ie(r);let c;t[2]!==o.settings?(c=Ce(o.settings)?o.settings:void 0,t[2]=o.settings,t[3]=c):c=t[3];const d=c,u=!!d;let f;t[4]!==e||t[5]!==a||t[6]!==l?(f=p=>{!a||!l||e({to:"/$org/$project",params:{org:a,project:l},search:{settings:p}})},t[4]=e,t[5]=a,t[6]=l,t[7]=f):f=t[7];const x=f;let m;t[8]!==e||t[9]!==a||t[10]!==l?(m=()=>{!a||!l||e({to:"/$org/$project",params:{org:a,project:l},search:{}})},t[8]=e,t[9]=a,t[10]=l,t[11]=m):m=t[11];const S=m,h=d??"account.preferences";let j;return t[12]!==S||t[13]!==u||t[14]!==x||t[15]!==h?(j={isOpen:u,activeSection:h,open:x,close:S},t[12]=S,t[13]=u,t[14]=x,t[15]=h,t[16]=j):j=t[16],j}function _e(t){const e=L.c(3),{error:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{size:16}),e[0]=o):o=e[0];let r;return e[1]!==n.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",n.message]})]}),e[1]=n.message,e[2]=r):r=e[2],r}function Ae(t){const e=L.c(9),{keys:n,onDelete:o,isDeleting:r}=t;let a;if(e[0]!==r||e[1]!==n||e[2]!==o){let c;e[4]!==r||e[5]!==o?(c=d=>s.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted/50 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[s.jsx(me,{size:14,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"font-medium truncate",children:d.label}),s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["added ",ve(new Date(d.createdAt))," ago"]})]}),s.jsx("div",{onClick:Ne,children:s.jsxs(X,{children:[s.jsx(J,{asChild:!0,children:s.jsx(V,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",disabled:r,children:s.jsx(ue,{size:14})})}),s.jsx(ee,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Delete this key?"}),s.jsx("div",{className:"flex gap-2",children:s.jsx(V,{variant:"destructive",size:"xs",onClick:()=>o(d.id),disabled:r,children:"Delete"})})]})})]})})]},d.id),e[4]=r,e[5]=o,e[6]=c):c=e[6],a=n.map(c),e[0]=r,e[1]=n,e[2]=o,e[3]=a}else a=e[3];let l;return e[7]!==a?(l=s.jsx("div",{className:"flex flex-col gap-2 mt-4",children:a}),e[7]=a,e[8]=l):l=e[8],l}function Ne(t){return t.stopPropagation()}function Se(t){const e=L.c(52),{providerId:n,onCancel:o,onSuccess:r}=t,{locator:a,org:l}=G();let c;e[0]!==l.id?(c={connectionId:se,orgId:l.id},e[0]=l.id,e[1]=c):c=e[1];const d=te(c),u=W(),[f,x]=v.useState(""),[m,S]=v.useState(""),[h,j]=v.useState(!1);let p;e[2]!==m||e[3]!==d||e[4]!==f||e[5]!==n?(p=async()=>{await d.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:n,label:f||"Personal key",apiKey:m}})},e[2]=m,e[3]=d,e[4]=f,e[5]=n,e[6]=p):p=e[6];let _;e[7]!==a||e[8]!==r||e[9]!==u?(_=()=>{u.invalidateQueries({queryKey:b.aiProviderKeys(a)}),u.invalidateQueries({queryKey:b.aiProviders(a)}),C.success("Key saved successfully"),r()},e[7]=a,e[8]=r,e[9]=u,e[10]=_):_=e[10];let P;e[11]!==p||e[12]!==_?(P={mutationFn:p,onSuccess:_,onError:be},e[11]=p,e[12]=_,e[13]=P):P=e[13];const{mutate:z,isPending:i,error:A}=Y(P);let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[14]=g):g=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=B=>x(B.target.value),e[15]=N):N=e[15];let y;e[16]!==f?(y=s.jsxs("div",{className:"space-y-1",children:[g,s.jsx(Z,{placeholder:"e.g. Personal key",value:f,onChange:N,className:"h-8 text-sm"})]}),e[16]=f,e[17]=y):y=e[17];let F;e[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[18]=F):F=e[18];const Q=h?"text":"password";let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=B=>S(B.target.value),e[19]=M):M=e[19];let w;e[20]!==m||e[21]!==Q?(w=s.jsx(Z,{type:Q,placeholder:"sk-...",value:m,onChange:M,className:"h-8 text-sm pr-8"}),e[20]=m,e[21]=Q,e[22]=w):w=e[22];let E;e[23]!==h?(E=()=>j(!h),e[23]=h,e[24]=E):E=e[24];let I;e[25]!==h?(I=h?s.jsx(ce,{size:14}):s.jsx(de,{size:14}),e[25]=h,e[26]=I):I=e[26];let k;e[27]!==E||e[28]!==I?(k=s.jsx("button",{type:"button",onClick:E,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:I}),e[27]=E,e[28]=I,e[29]=k):k=e[29];let K;e[30]!==w||e[31]!==k?(K=s.jsxs("div",{className:"space-y-1",children:[F,s.jsxs("div",{className:"relative",children:[w,k]})]}),e[30]=w,e[31]=k,e[32]=K):K=e[32];let O;e[33]!==A?(O=A&&s.jsx("p",{className:"text-xs text-destructive",children:A.message}),e[33]=A,e[34]=O):O=e[34];let T;e[35]!==i||e[36]!==o?(T=s.jsx(V,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:"Cancel"}),e[35]=i,e[36]=o,e[37]=T):T=e[37];let $;e[38]!==z?($=()=>z(),e[38]=z,e[39]=$):$=e[39];const U=!m||i,H=i?"Saving...":"Save Key";let D;e[40]!==$||e[41]!==U||e[42]!==H?(D=s.jsx(V,{size:"sm",onClick:$,disabled:U,children:H}),e[40]=$,e[41]=U,e[42]=H,e[43]=D):D=e[43];let R;e[44]!==T||e[45]!==D?(R=s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[T,D]}),e[44]=T,e[45]=D,e[46]=R):R=e[46];let q;return e[47]!==K||e[48]!==O||e[49]!==R||e[50]!==y?(q=s.jsxs("div",{className:"space-y-3",children:[y,K,O,R]}),e[47]=K,e[48]=O,e[49]=R,e[50]=y,e[51]=q):q=e[51],q}function be(t){C.error(`Failed to save key: ${t.message}`)}function Pe({provider:t,keys:e}){const{locator:n,org:o}=G(),r=te({connectionId:se,orgId:o.id}),a=W(),[l,c]=v.useState(!1),[d,u]=v.useState(!1),[f,x]=v.useState(null),m=e.length>0,{mutate:S,isPending:h}=Y({mutationFn:async i=>(await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i}}),i),onSuccess:i=>{a.invalidateQueries({queryKey:b.aiProviderKeys(n)}),a.invalidateQueries({queryKey:b.aiProviders(n)}),a.invalidateQueries({queryKey:b.aiProviderModels(n,i)}),C.success("Key deleted")},onError:i=>{C.error(`Failed to delete key: ${i.message}`)}}),{mutate:j}=Y({mutationFn:async({code:i,stateToken:A})=>{const g=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:t.id,code:i,stateToken:A,label:"Connected via OAuth"}});if(g?.isError){const N=g.content?.[0]?.text??"OAuth exchange failed";throw new Error(N)}},onSuccess:()=>{a.invalidateQueries({queryKey:b.aiProviderKeys(n)}),a.invalidateQueries({queryKey:b.aiProviders(n)}),C.success(`${t.name} connected successfully`),u(!1),x(null)},onError:i=>{C.error(`OAuth connection failed: ${i.message}`),u(!1),x(null)}});v.useEffect(()=>{if(!d||!f)return;const i=g=>{if(g.origin===window.location.origin&&g.data?.type==="AI_PROVIDER_OAUTH_CALLBACK"){const{code:N,stateToken:y}=g.data;y===f?j({code:N,stateToken:y}):(console.error("State token mismatch"),C.error("Security check failed: State token mismatch"),u(!1),x(null))}};window.addEventListener("message",i);const A=setTimeout(()=>{d&&(u(!1),x(null),C.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",i),clearTimeout(A)}},[d,f,j]);const p=t.supportedMethods.includes("oauth-pkce"),_=t.supportedMethods.includes("api-key"),P=()=>{l||d||(p?z():_&&c(!0))},z=async()=>{try{u(!0);const i=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:t.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(i.structuredContent)x(i.structuredContent.stateToken),window.open(i.structuredContent.url,"AiProviderOAuth","width=600,height=700");else throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL")}catch(i){u(!1),C.error(`Failed to start OAuth: ${i instanceof Error?i.message:String(i)}`)}};return s.jsxs(X,{open:l,onOpenChange:i=>{i||c(!1)},children:[s.jsx(J,{asChild:!0,children:s.jsxs(fe,{className:ne("p-4 flex flex-col gap-3 transition-colors relative",m&&"border-primary/20",!d&&"cursor-pointer hover:bg-muted/30",d&&"cursor-wait"),onClick:P,children:[m&&s.jsx("div",{className:"absolute top-4 right-4 w-2 h-2 rounded-full bg-green-500"}),s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[t.logo?s.jsx("img",{src:t.logo,alt:t.name,className:"size-8 rounded-md object-contain"}):s.jsx(xe,{fallback:t.name.charAt(0),className:"size-8 bg-primary/10 text-primary"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-base",children:t.name}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1",children:d?"Authorizing...":t.description})]})]})}),m&&s.jsxs("div",{className:"mt-1",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:[e.length," key",e.length!==1?"s":""," configured"]}),s.jsx(Ae,{keys:e,onDelete:S,isDeleting:h})]})]})}),s.jsx(ee,{className:"w-72 p-4",align:"start",onInteractOutside:()=>c(!1),children:s.jsx(Se,{providerId:t.id,onCancel:()=>c(!1),onSuccess:()=>c(!1)})})]})}function we(){const t=L.c(6),e=ge(),n=pe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-medium",children:"AI Providers"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up AI model providers. Keys are stored encrypted in the vault."})]}),t[0]=o):o=t[0];let r;t[1]!==e?.providers||t[2]!==n?(r=e?.providers?.map(l=>s.jsx(Pe,{provider:l,keys:n.filter(c=>c.providerId===l.id)},l.id)),t[1]=e?.providers,t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==r?(a=s.jsxs("div",{className:"space-y-6",children:[o,s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 [&>*:first-child]:lg:col-span-2",children:r})]}),t[4]=r,t[5]=a):a=t[5],a}function He(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(oe,{fallback:Ee,children:s.jsx(v.Suspense,{fallback:s.jsx(he,{className:"h-64 w-full"}),children:s.jsx(we,{})})}),t[0]=e):e=t[0],e}function Ee(t){const{error:e}=t;return s.jsx(_e,{error:e??new Error("Failed to load AI providers")})}export{He as O,Pe as P,je as i,Ue as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as X,r as H,u as ne,K as me,c3 as ke,j as s,z as de,B as te,e as xe,ae as ge,af as pe,O as he,f as ze,as as $e,c4 as ae,E as Le,au as Fe}from"./index-EJhirEgi.js";import{P as se}from"./index-wbJeckpV.js";import{B as Ee,a as Oe,b as _e,c as Ke}from"./breadcrumb-U9pZLesK.js";import{i as je}from"./FilterLines-Cn-l4hcD.js";import{n as ye}from"./Inbox01-BxbPwF62.js";import{i as le}from"./Loading01-BUlApwyE.js";import{i as ve}from"./SearchMd-D_8XQU19.js";import{u as be}from"./useQuery-mGiR1oLn.js";import{u as Ae}from"./useInfiniteQuery-Dg54E7EH.js";import{a as Me,f as Be,b as De}from"./registry-utils-Bc7JySBD.js";import{u as Ne,W as Ge,a as We,e as Ve,b as qe}from"./constants-BtZ3fAEQ.js";import{u as Ue,a as Ce,b as He}from"./use-connection-DrhtnyBi.js";import{s as Je}from"./slugify-CEUa2lfQ.js";import{C as Qe}from"./collection-search-DwGryXKM.js";import{M as ce}from"./mcp-server-card-d9n08Fh_.js";import{I as Ye}from"./input-23yd6VmI.js";import{b as Se,P as we,a as Ie}from"./popover-Cmt-BFZN.js";import{i as Te}from"./Check-BWCeXHN7.js";import{t as Re}from"./ChevronDown-B15SC8MA.js";import{s as re}from"./XClose-B-kxIP35.js";import{s as Ze}from"./Plus-CiuqWk7L.js";import{E as Xe}from"./empty-state-Dz90tIjg.js";import{u as et}from"./use-binding-THgLcp9C.js";import{L as tt,u as st}from"./localstorage-keys-CyCsfmz2.js";import"./tooltip-BXI94UP3.js";import"./index-Dv4huKa6.js";import"./ChevronRight-DNq10e3Z.js";import"./infiniteQueryObserver--lmuu5bR.js";import"./use-collections-B4b2cHqe.js";import"./useMutation-ClueFvpj.js";import"./CheckVerified02-UCZI60jf.js";import"./Globe02-BtYVEi0C.js";import"./Lock01-D2mdnqp4.js";import"./Terminal-CJ1WAC7b.js";import"./card-DXYG1PJt.js";import"./integration-icon-DnuBmEuk.js";import"./Container-C4I-ZzWI.js";import"./github-icon-Dp3wHhYE.js";import"./binder-DAywY5NR.js";function rt(t,e){const r=X.c(4),[l,d]=H.useState(t),n=H.useRef(null),i=H.useRef(!0);let c,m;return r[0]!==e||r[1]!==t?(c=()=>{if(i.current){i.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{d(t)},e),()=>{n.current&&clearTimeout(n.current)}},m=[t,e],r[0]=e,r[1]=t,r[2]=c,r[3]=m):(c=r[2],m=r[3]),H.useEffect(c,m),l}function lt(t){const e=X.c(14),r=H.useRef(null),l=`scroll-position:${t}`,d=H.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const i=n;let c;e[2]!==l?(c=()=>{if(d.current===l)return;const x=sessionStorage.getItem(l);if(x&&r.current){const $=Number.parseInt(x,10);r.current.scrollTop=$}d.current=l},e[2]=l,e[3]=c):c=e[3];const m=c;let f;e[4]!==m||e[5]!==l?(f=()=>{d.current!==l&&m()},e[4]=m,e[5]=l,e[6]=f):f=e[6];const T=f;let o;e[7]!==m||e[8]!==l?(o=x=>{r.current=x,x&&d.current!==l&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=l,e[9]=o):o=e[9];const p=o;let a;return e[10]!==T||e[11]!==i||e[12]!==p?(a={scrollRef:p,saveScrollPosition:i,handleScroll:T},e[10]=T,e[11]=i,e[12]=p,e[13]=a):a=e[13],a}const nt=24;function it(t){const e=X.c(54),{registryId:r,listToolName:l,filtersToolName:d,search:n}=t,{org:i}=ne();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[m,f]=H.useState(c);let T;e[1]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[1]=T):T=e[1];const[o,p]=H.useState(T),a=r||null;let x;e[2]!==i.id||e[3]!==a?(x={connectionId:a,orgId:i.id},e[2]=i.id,e[3]=a,e[4]=x):x=e[4];const $=Ne(x),R=!!d;let C;e[5]!==d||e[6]!==r?(C=me.toolCall(r,d||"no-filters","{}"),e[5]=d,e[6]=r,e[7]=C):C=e[7];let y;e[8]!==$||e[9]!==d?(y=async()=>{if(!d)return{tags:[],categories:[]};const O=await $.callTool({name:d,arguments:{}});return O.structuredContent??O},e[8]=$,e[9]=d,e[10]=y):y=e[10];let L;e[11]!==C||e[12]!==y?(L={queryKey:C,queryFn:y,staleTime:36e5,retry:2},e[11]=C,e[12]=y,e[13]=L):L=e[13];const{data:S}=be(L);let h,v,z;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==o||e[18]!==m){const O=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:nt,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...O&&{where:O}},z=Ae,v=me.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=o,e[18]=m,e[19]=h,e[20]=v,e[21]=z}else h=e[19],v=e[20],z=e[21];let P;e[22]!==$||e[23]!==h||e[24]!==l?(P=async O=>{const{pageParam:U}=O,K=U?{...h,cursor:U}:h,u=await $.callTool({name:l,arguments:K});return u.structuredContent??u},e[22]=$,e[23]=h,e[24]=l,e[25]=P):P=e[25];let k;e[26]!==P||e[27]!==v?(k={queryKey:v,queryFn:P,initialPageParam:void 0,getNextPageParam:ot,staleTime:36e5,placeholderData:ke,retry:2},e[26]=P,e[27]=v,e[28]=k):k=e[28];const{data:b,fetchNextPage:w,hasNextPage:g,isFetchingNextPage:N,isFetching:j,isLoading:F,error:I}=z(k);let E;e:{if(!b?.pages||b.pages.length===0){E=null;break e}const O=b.pages[0];if(typeof O=="object"&&O!==null&&"totalCount"in O&&typeof O.totalCount=="number"){E=O.totalCount;break e}E=null}const A=E,_=b?.pages;let G;e[29]!==_?(G=Me(_),e[29]=_,e[30]=G):G=e[30];const W=G;let J;e[31]!==n||e[32]!==o.length||e[33]!==m.length?(J=m.length>0||o.length>0||!!n?.trim(),e[31]=n,e[32]=o.length,e[33]=m.length,e[34]=J):J=e[34];const Y=J,Z=j&&!N&&!F&&Y;let V;e[35]!==w||e[36]!==g||e[37]!==N?(V=()=>{g&&!N&&w()},e[35]=w,e[36]=g,e[37]=N,e[38]=V):V=e[38];const Q=V,q=g??!1,M=R?S?.tags:void 0,B=R?S?.categories:void 0;let D;return e[39]!==Y||e[40]!==j||e[41]!==N||e[42]!==Z||e[43]!==F||e[44]!==W||e[45]!==I||e[46]!==Q||e[47]!==o||e[48]!==m||e[49]!==q||e[50]!==M||e[51]!==B||e[52]!==A?(D={items:W,totalCount:A,hasMore:q,isLoadingMore:N,isFiltering:Z,isInitialLoading:F,isFetching:j,error:I,loadMore:Q,availableTags:M,availableCategories:B,selectedTags:m,selectedCategories:o,setSelectedTags:f,setSelectedCategories:p,hasActiveFilters:Y},e[39]=Y,e[40]=j,e[41]=N,e[42]=Z,e[43]=F,e[44]=W,e[45]=I,e[46]=Q,e[47]=o,e[48]=m,e[49]=q,e[50]=M,e[51]=B,e[52]=A,e[53]=D):D=e[53],D}function ot(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function at(t,e){return[...t].sort((r,l)=>l.count-r.count).slice(0,e)}function ue(t){const e=X.c(52),{label:r,items:l,selectedItems:d,onToggle:n,onClear:i}=t,[c,m]=H.useState(""),[f,T]=H.useState(!1);let o,p,a,x,$,R,C,y,L,S,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==f||e[4]!==c||e[5]!==d){const w=[...c?l.filter(_=>_.value.toLowerCase().includes(c.toLowerCase())):l].sort(ct);a=d.length,p=Se,L=f,S=T;let g;e[17]!==r?(g=s.jsx("span",{children:r}),e[17]=r,e[18]=g):g=e[18];let N;e[19]!==a?(N=a>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:a}),e[19]=a,e[20]=N):N=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Re,{size:14,className:"opacity-50"}),e[21]=j):j=e[21],e[22]!==N||e[23]!==g?(h=s.jsx(we,{asChild:!0,children:s.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[g,N,j]})}),e[22]=N,e[23]=g,e[24]=h):h=e[24],o=Ie,R="w-64 p-0",C="start";let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(ve,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=F):F=e[25];let I;e[26]!==r?(I=r.toLowerCase(),e[26]=r,e[27]=I):I=e[27];const E=`Search ${I}...`;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=_=>m(_.target.value),e[28]=A):A=e[28],e[29]!==c||e[30]!==E?(y=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[F,s.jsx(Ye,{type:"text",placeholder:E,value:c,onChange:A,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=E,e[31]=y):y=e[31],x="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",$=w.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):w.map(_=>{const G=d.includes(_.value);return s.jsxs("button",{onClick:()=>n(_.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&s.jsx(Te,{size:16,className:"text-muted-foreground shrink-0"}),_.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:_.count})]},_.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=f,e[4]=c,e[5]=d,e[6]=o,e[7]=p,e[8]=a,e[9]=x,e[10]=$,e[11]=R,e[12]=C,e[13]=y,e[14]=L,e[15]=S,e[16]=h}else o=e[6],p=e[7],a=e[8],x=e[9],$=e[10],R=e[11],C=e[12],y=e[13],L=e[14],S=e[15],h=e[16];let v;e[32]!==x||e[33]!==$?(v=s.jsx("div",{className:x,children:$}),e[32]=x,e[33]=$,e[34]=v):v=e[34];let z;e[35]!==r||e[36]!==i||e[37]!==a?(z=a>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(te,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=i,e[37]=a,e[38]=z):z=e[38];let P;e[39]!==o||e[40]!==z||e[41]!==R||e[42]!==C||e[43]!==y||e[44]!==v?(P=s.jsxs(o,{className:R,align:C,children:[y,v,z]}),e[39]=o,e[40]=z,e[41]=R,e[42]=C,e[43]=y,e[44]=v,e[45]=P):P=e[45];let k;return e[46]!==p||e[47]!==P||e[48]!==L||e[49]!==S||e[50]!==h?(k=s.jsxs(p,{open:L,onOpenChange:S,children:[h,P]}),e[46]=p,e[47]=P,e[48]=L,e[49]=S,e[50]=h,e[51]=k):k=e[51],k}function ct(t,e){return e.count-t.count}function mt(t){const e=X.c(67),{availableTags:r,availableCategories:l,selectedTags:d,selectedCategories:n,onTagChange:i,onCategoryChange:c}=t,m=r&&r.length>0||l&&l.length>0,f=d.length>0||n.length>0;if(!m)return null;let T;e[0]!==i||e[1]!==d?(T=g=>{d.includes(g)?i(d.filter(N=>N!==g)):i([...d,g])},e[0]=i,e[1]=d,e[2]=T):T=e[2];const o=T;let p;e[3]!==c||e[4]!==n?(p=g=>{n.includes(g)?c(n.filter(N=>N!==g)):c([...n,g])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const a=p;let x;e[6]!==c||e[7]!==i?(x=()=>{i([]),c([])},e[6]=c,e[7]=i,e[8]=x):x=e[8];const $=x;let R,C,y,L,S,h,v;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==a||e[16]!==o){const g=l?at(l,6):[];R=n,C=d,v=new Set(g.map(dt)),S="flex items-center border-b border-border";let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(je,{size:16})}),e[24]=N):N=e[24];let j;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==a?(j=l&&l.length>0&&s.jsx(ue,{label:"Categories",items:l,selectedItems:n,onToggle:a,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=a,e[29]=j):j=e[29];let F;e[30]!==r||e[31]!==i||e[32]!==d||e[33]!==o?(F=r&&r.length>0&&s.jsx(ue,{label:"Tags",items:r,selectedItems:d,onToggle:o,onClear:()=>i([])}),e[30]=r,e[31]=i,e[32]=d,e[33]=o,e[34]=F):F=e[34],e[35]!==F||e[36]!==j?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[N,j,F]}),e[35]=F,e[36]=j,e[37]=h):h=e[37],y="flex items-center gap-3 flex-wrap px-5 py-3";let I;e[38]!==n||e[39]!==a?(I=E=>{const A=n.includes(E.value);return s.jsxs("div",{onClick:()=>a(E.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",A?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:E.value}),A&&s.jsx("span",{onClick:_=>{_.stopPropagation(),a(E.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},E.value)},e[38]=n,e[39]=a,e[40]=I):I=e[40],L=g.map(I),e[9]=l,e[10]=r,e[11]=c,e[12]=i,e[13]=n,e[14]=d,e[15]=a,e[16]=o,e[17]=R,e[18]=C,e[19]=y,e[20]=L,e[21]=S,e[22]=h,e[23]=v}else R=e[17],C=e[18],y=e[19],L=e[20],S=e[21],h=e[22],v=e[23];let z;if(e[41]!==R||e[42]!==a||e[43]!==v){let g;e[45]!==v?(g=j=>!v.has(j),e[45]=v,e[46]=g):g=e[46];let N;e[47]!==a?(N=j=>s.jsxs("div",{onClick:()=>a(j),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:j}),s.jsx("span",{onClick:F=>{F.stopPropagation(),a(j)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},`cat-${j}`),e[47]=a,e[48]=N):N=e[48],z=R.filter(g).map(N),e[41]=R,e[42]=a,e[43]=v,e[44]=z}else z=e[44];let P;if(e[49]!==C||e[50]!==o){let g;e[52]!==o?(g=N=>s.jsxs("div",{onClick:()=>o(N),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:N}),s.jsx("span",{onClick:j=>{j.stopPropagation(),o(N)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},`tag-${N}`),e[52]=o,e[53]=g):g=e[53],P=C.map(g),e[49]=C,e[50]=o,e[51]=P}else P=e[51];let k;e[54]!==$||e[55]!==f?(k=f&&s.jsxs(te,{variant:"ghost",size:"sm",onClick:$,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(re,{size:14}),"Clear all"]}),e[54]=$,e[55]=f,e[56]=k):k=e[56];let b;e[57]!==k||e[58]!==y||e[59]!==L||e[60]!==z||e[61]!==P?(b=s.jsxs("div",{className:y,children:[L,z,P,k]}),e[57]=k,e[58]=y,e[59]=L,e[60]=z,e[61]=P,e[62]=b):b=e[62];let w;return e[63]!==b||e[64]!==S||e[65]!==h?(w=s.jsxs("div",{className:S,children:[h,b]}),e[63]=b,e[64]=S,e[65]=h,e[66]=w):w=e[66],w}function dt(t){return t.value}function ft(t,e){if(!e)return t;const r=e.toLowerCase();return t.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function Pe(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function fe(t){return t._meta?.["mcp.mesh"]?.official===!0}function ut(t){const e=X.c(58),{registryId:r,listToolName:l,filtersToolName:d,storePrivateOnly:n}=t,[i,c]=H.useState(""),m=rt(i,300),f=xe(),{org:T}=ne(),{scrollRef:o,saveScrollPosition:p,handleScroll:a}=lt(`store-discovery:${r}`);let x;e[0]!==m||e[1]!==d||e[2]!==l||e[3]!==r?(x={registryId:r,listToolName:l,filtersToolName:d,search:m},e[0]=m,e[1]=d,e[2]=l,e[3]=r,e[4]=x):x=e[4];const{items:$,hasMore:R,isLoadingMore:C,isInitialLoading:y,isFetching:L,error:S,loadMore:h,availableTags:v,availableCategories:z,selectedTags:P,selectedCategories:k,setSelectedTags:b,setSelectedCategories:w,hasActiveFilters:g}=it(x);let N;e[5]!==$||e[6]!==i?(N=i?ft($,i):$,e[5]=$,e[6]=i,e[7]=N):N=e[7];const j=N;let F;e[8]!==j||e[9]!==n?(F=n?j.filter(ht):j,e[8]=j,e[9]=n,e[10]=F):F=e[10];const I=F,E=(i!==m||L)&&!y&&!!i;let A;e[11]!==I?(A=I.filter(fe),e[11]=I,e[12]=A):A=e[12];const _=A;let G;e[13]!==I?(G=I.filter(pt),e[13]=I,e[14]=G):G=e[14];const W=G;let J;e[15]!==I?(J=I.filter(gt),e[15]=I,e[16]=J):J=e[16];const Y=J;let Z;e[17]!==f||e[18]!==T.slug||e[19]!==r||e[20]!==p?(Z=K=>{p();const u=Je(K.name||K.title||K.server?.title||""),ee=typeof K.id=="string"&&K.id.includes("/"),ie=typeof K.server?.name=="string"&&K.server.name.includes("/"),oe=ee&&!ie?K.id:K.server?.name||K.id||"";f({to:"/$org/$project/store/$appName",params:{org:T.slug,project:he,appName:u},search:{registryId:r,serverName:oe}})},e[17]=f,e[18]=T.slug,e[19]=r,e[20]=p,e[21]=Z):Z=e[21];const V=Z;let Q;e[22]!==a||e[23]!==R||e[24]!==C||e[25]!==h?(Q=K=>{if(a(),!R||C)return;const u=K.currentTarget;u.scrollHeight-u.scrollTop-u.clientHeight<200&&h()},e[22]=a,e[23]=R,e[24]=C,e[25]=h,e[26]=Q):Q=e[26];const q=Q;let M;e[27]!==E||e[28]!==i?(M=s.jsx(Qe,{value:i,onChange:c,placeholder:"Search for an MCP Server...",isSearching:E}),e[27]=E,e[28]=i,e[29]=M):M=e[29];let B;e[30]!==z||e[31]!==v||e[32]!==k||e[33]!==P||e[34]!==w||e[35]!==b?(B=s.jsx(mt,{availableTags:v,availableCategories:z,selectedTags:P,selectedCategories:k,onTagChange:b,onCategoryChange:w}),e[30]=z,e[31]=v,e[32]=k,e[33]=P,e[34]=w,e[35]=b,e[36]=B):B=e[36];let D;e[37]!==Y||e[38]!==S||e[39]!==V||e[40]!==g||e[41]!==R||e[42]!==y||e[43]!==C||e[44]!==E||e[45]!==_||e[46]!==i||e[47]!==W||e[48]!==I.length?(D=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:S&&!y?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:s.jsx(ge,{className:"size-8 text-destructive"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),S.message&&s.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:S.message})]}),s.jsxs(te,{variant:"outline",size:"sm",onClick:xt,children:[s.jsx(pe,{className:"size-4"}),"Try again"]})]}):y?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):I.length===0&&!g?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ye,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):I.length===0&&g&&!i?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(je,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):i&&I.length===0&&!E?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ve,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[E&&I.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),_.length>0&&s.jsx(ce,{items:_,title:"Official",onItemClick:V}),W.length>0&&s.jsx(ce,{items:W,title:"Verified",onItemClick:V}),Y.length>0&&s.jsx(ce,{items:Y,title:_.length>0||W.length>0?"All":"",onItemClick:V}),R&&C&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(le,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[37]=Y,e[38]=S,e[39]=V,e[40]=g,e[41]=R,e[42]=y,e[43]=C,e[44]=E,e[45]=_,e[46]=i,e[47]=W,e[48]=I.length,e[49]=D):D=e[49];let O;e[50]!==q||e[51]!==o||e[52]!==D?(O=s.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",onScroll:q,children:D}),e[50]=q,e[51]=o,e[52]=D,e[53]=O):O=e[53];let U;return e[54]!==B||e[55]!==O||e[56]!==M?(U=s.jsxs("div",{className:"flex flex-col h-full",children:[M,B,O]}),e[54]=B,e[55]=O,e[56]=M,e[57]=U):U=e[57],U}function xt(){return window.location.reload()}function gt(t){return!Pe(t)&&!fe(t)}function pt(t){return Pe(t)&&!fe(t)}function ht(t){return t.is_public!==!0}function jt(t){const e=X.c(11),{registryId:r,storePrivateOnly:l}=t,d=Ue(r),n=d?.tools;let i;e[0]!==n?(i=Be(n),e[0]=n,e[1]=i):i=e[1];const c=i;if(!c){let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"bg-muted p-3 rounded-full",children:s.jsx(ye,{className:"size-8 text-muted-foreground"})}),e[2]=a):a=e[2];let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[a,s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=x):x=e[3],x}const m=d?.tools;let f;e[4]!==m?(f=De(m),e[4]=m,e[5]=f):f=e[5];const o=f||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==o?(p=s.jsx(ut,{registryId:r,listToolName:c,filtersToolName:o,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=o,e[10]=p):p=e[10],p}function yt(t){const e=X.c(43),{registries:r,value:l,onValueChange:d,onAddWellKnown:n,wellKnownRegistries:i,placeholder:c}=t,m=c===void 0?"Select a registry...":c,[f,T]=H.useState(!1);let o,p,a,x,$,R,C,y;if(e[0]!==f||e[1]!==m||e[2]!==r||e[3]!==l){let b;e[12]!==l?(b=g=>g.id===l,e[12]=l,e[13]=b):b=e[13];const w=r.find(b);p=Se,C=f,y=T,o=we,R=!0,a="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(x=de("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=x):x=e[14],$=w?s.jsxs("span",{className:"flex items-center gap-2",children:[w.icon?s.jsx("img",{src:w.icon,alt:w.name,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:w.name})]}):s.jsx("span",{className:"text-muted-foreground",children:m}),e[0]=f,e[1]=m,e[2]=r,e[3]=l,e[4]=o,e[5]=p,e[6]=a,e[7]=x,e[8]=$,e[9]=R,e[10]=C,e[11]=y}else o=e[4],p=e[5],a=e[6],x=e[7],$=e[8],R=e[9],C=e[10],y=e[11];let L;e[15]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Re,{className:"size-4 opacity-50"}),e[15]=L):L=e[15];let S;e[16]!==a||e[17]!==x||e[18]!==$?(S=s.jsxs("button",{type:a,className:x,children:[$,L]}),e[16]=a,e[17]=x,e[18]=$,e[19]=S):S=e[19];let h;e[20]!==o||e[21]!==R||e[22]!==S?(h=s.jsx(o,{asChild:R,children:S}),e[20]=o,e[21]=R,e[22]=S,e[23]=h):h=e[23];let v;if(e[24]!==d||e[25]!==r||e[26]!==l){let b;e[28]!==d||e[29]!==l?(b=w=>s.jsxs("button",{type:"button",onClick:()=>{d(w.id??w.name),T(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?s.jsx("img",{src:w.icon,alt:w.name,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:w.name})]}),l===(w.id??w.name)&&s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(Te,{className:"size-4"})})]},w.id??w.name),e[28]=d,e[29]=l,e[30]=b):b=e[30],v=r.map(b),e[24]=d,e[25]=r,e[26]=l,e[27]=v}else v=e[27];let z;e[31]!==n||e[32]!==i?(z=i.length>0&&s.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(b=>s.jsxs("button",{type:"button",onClick:()=>{n(b),T(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[b.icon?s.jsx("img",{src:b.icon,alt:b.title,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:b.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:b.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Ze,{size:16})})]},b.id??b.title))]}),e[31]=n,e[32]=i,e[33]=z):z=e[33];let P;e[34]!==v||e[35]!==z?(P=s.jsxs(Ie,{align:"end",className:"w-auto min-w-[200px] p-1",children:[v,z]}),e[34]=v,e[35]=z,e[36]=P):P=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==P||e[40]!==C||e[41]!==y?(k=s.jsxs(p,{open:C,onOpenChange:y,children:[h,P]}),e[37]=p,e[38]=h,e[39]=P,e[40]=C,e[41]=y,e[42]=k):k=e[42],k}function vt({registries:t,onConnected:e}){const r=Ce(),{org:{slug:l}}=ne(),{data:d}=ze.useSession(),n=xe(),[i,c]=H.useState(!1),m=t[0],f=async()=>{if(!(!m||!d?.user?.id)){c(!0);try{const o=await r.create.mutateAsync(m);e?.(o.id)}finally{c(!1)}}},T=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:he},search:{action:"create"}})};return s.jsx(Xe,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(te,{variant:"outline",onClick:f,disabled:i||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),s.jsx(te,{variant:"outline",onClick:T,children:"Custom Connection"})]})})}function bt(t){const e=X.c(15),{error:r,onRetry:l,registryName:d}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:s.jsx(ge,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=i):i=e[1];let c;e[2]!==d?(c=s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",s.jsx("strong",{children:d})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=d,e[3]=c):c=e[3];let m;e[4]!==r?(m=r?.message&&s.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==c||e[7]!==m?(f=s.jsxs("div",{className:"space-y-2",children:[i,c,m]}),e[6]=c,e[7]=m,e[8]=f):f=e[8];let T;e[9]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(pe,{className:"size-4"}),e[9]=T):T=e[9];let o;e[10]!==l?(o=s.jsxs(te,{variant:"outline",size:"sm",onClick:l,children:[T,"Try again"]}),e[10]=l,e[11]=o):o=e[11];let p;return e[12]!==f||e[13]!==o?(p=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,f,o]}),e[12]=f,e[13]=o,e[14]=p):p=e[14],p}function cs(){const t=X.c(53),{org:e,project:r}=ne(),l=He(),d=Ce(),n=$e(),i=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=et(l);let m;t[0]!==e.id?(m=Ge.SELF(e.id),t[0]=e.id,t[1]=m):m=t[1];const f=m,T=r.enabledPlugins,o=T==null||T.includes(ae);let p;t[2]!==f?(p=(u,ee)=>u.id===f?1:ee.id===f?-1:0,t[2]=f,t[3]=p):p=t[3];const a=c.filter(u=>u.id!==f?!0:o).sort(p);let x;t[4]!==f?(x=u=>u.id===f,t[4]=f,t[5]=x):x=t[5];const $=a.some(x);let R;t[6]!==e.id?(R={connectionId:We,orgId:e.id},t[6]=e.id,t[7]=R):R=t[7];const C=Ne(R);let y;t[8]!==r.id||t[9]!==C?(y=async()=>{const u=await C.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ae}});return u.structuredContent??u},t[8]=r.id,t[9]=C,t[10]=y):y=t[10];const{data:L}=be({queryKey:me.projectPluginConfig(r.id??"",ae),queryFn:y,enabled:$&&!!r.id,staleTime:6e4}),S=L?.config?.settings;let h;t[11]!==S||t[12]!==f?(h=u=>u.id===f&&S?{id:u.id,name:S.registryName||u.title,icon:S.registryIcon||u.icon||void 0}:{id:u.id,name:u.title,icon:u.icon||void 0},t[11]=S,t[12]=f,t[13]=h):h=t[13];const v=a.map(h);let z;t[14]!==e.slug?(z=tt.selectedRegistry(e.slug),t[14]=e.slug,t[15]=z):z=t[15];const[P,k]=st(z,Ct);let b;t[16]!==P?(b=u=>u.id===P,t[16]=P,t[17]=b):b=t[17];const w=a.find(b);let g;t[18]!==f?(g=u=>u.id!==f,t[18]=f,t[19]=g):g=t[19];const N=a.find(g),j=w?.id||N?.id||a[0]?.id||"",F=j===f&&S?.storePrivateOnly===!0;let I;t[20]!==e.id?(I=Ve(e.id),t[20]=e.id,t[21]=I):I=t[21];let E;t[22]!==I?(E=[I],t[22]=I,t[23]=E):E=t[23];const A=E;let _;t[24]===Symbol.for("react.memo_cache_sentinel")?(_=[qe()],t[24]=_):_=t[24];const G=_;let W;t[25]!==d.create||t[26]!==k?(W=async u=>{const ee=await d.create.mutateAsync(u);k(ee.id)},t[25]=d.create,t[26]=k,t[27]=W):W=t[27];const J=W,Y=new Set(a.map(Nt)),Z=A.filter(u=>u.id&&!Y.has(u.id)),V=G.filter(u=>u.id&&!Y.has(u.id));if(i){let u;return t[28]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Fe,{}),t[28]=u):u=t[28],u}let Q;t[29]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(se.Header.Left,{children:s.jsx(Ee,{children:s.jsx(Oe,{children:s.jsx(_e,{children:s.jsx(Ke,{children:"Store"})})})})}),t[29]=Q):Q=t[29];let q;t[30]!==J?(q=async u=>J(u),t[30]=J,t[31]=q):q=t[31];let M;t[32]!==Z||t[33]!==j||t[34]!==v||t[35]!==k||t[36]!==q?(M=s.jsxs(se.Header,{children:[Q,s.jsx(se.Header.Right,{children:s.jsx(yt,{wellKnownRegistries:Z,registries:v,value:j,onValueChange:k,onAddWellKnown:q,placeholder:"Select store..."})})]}),t[32]=Z,t[33]=j,t[34]=v,t[35]=k,t[36]=q,t[37]=M):M=t[37];let B;t[38]!==j||t[39]!==v?(B=u=>{const{error:ee,resetError:ie}=u;return s.jsx(bt,{error:ee,onRetry:ie,registryName:v.find(oe=>oe.id===j)?.name??"registry"})},t[38]=j,t[39]=v,t[40]=B):B=t[40];let D;t[41]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[41]=D):D=t[41];let O;t[42]!==V||t[43]!==j||t[44]!==k||t[45]!==F?(O=s.jsx(H.Suspense,{fallback:D,children:j?s.jsx(jt,{registryId:j,storePrivateOnly:F}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(vt,{registries:V,onConnected:u=>{k(u)}})})}),t[42]=V,t[43]=j,t[44]=k,t[45]=F,t[46]=O):O=t[46];let U;t[47]!==B||t[48]!==O?(U=s.jsx(se.Content,{children:s.jsx(Le,{fallback:B,children:O})}),t[47]=B,t[48]=O,t[49]=U):U=t[49];let K;return t[50]!==M||t[51]!==U?(K=s.jsxs(se,{children:[M,U]}),t[50]=M,t[51]=U,t[52]=K):K=t[52],K}function Nt(t){return t.id}function Ct(t){return t??""}export{cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as g,c as b,j as s,z as L,E as Z,u as G,f as K,B as U}from"./index-EJhirEgi.js";import{C as h}from"./task-status-B95CCzhX.js";import{E as J,C as Q}from"./editable-task-title-DPm5hTsj.js";import{a as X}from"./tasks-panel-BGarv8W1.js";import{u as B,a as Y}from"./context-228p0Ol2.js";import{a as ee}from"./select-virtual-mcp-Tk-m3Fu9.js";import{I as O}from"./integration-icon-DnuBmEuk.js";import{P as te,a as se,b as ie}from"./popover-Cmt-BFZN.js";import{S as H}from"./skeleton-BDMxlKkg.js";import{i as re,d as le}from"./constants-BtZ3fAEQ.js";import{b as oe}from"./use-virtual-mcp-D_iE9Cdz.js";import{i as ne}from"./ChevronRight-DNq10e3Z.js";import{t as F}from"./Users03-DBQP_ao_.js";import{P}from"./index-wbJeckpV.js";import{R as A,a as T,b as ae}from"./resizable-ghy0Xufz.js";import"./spinner-DcYxwnHl.js";import"./tooltip-BXI94UP3.js";import"./index-Dv4huKa6.js";import"./use-mcp-prompts-LuO7HYtE.js";import"./useQuery-mGiR1oLn.js";import"./dialog-DD3DgOo2.js";import"./X-CC0aD5R8.js";import"./form-BcVHSZnK.js";import"./label-t2hx_05l.js";import"./input-23yd6VmI.js";import"./index-DJJzspJA.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-DKc3SUsQ.js";import"./ChevronDown-B15SC8MA.js";import"./Edit01-BM5GDmTx.js";import"./Lock01-D2mdnqp4.js";import"./XCircle-CuIPHDkx.js";import"./AlertCircle-48gOoEWA.js";import"./select-B2Bho1QQ.js";import"./ChevronUp-Be0WocGY.js";import"./Check-BWCeXHN7.js";import"./use-preferences-D5crHwiP.js";import"./localstorage-keys-CyCsfmz2.js";import"./useMutation-ClueFvpj.js";import"./ArrowLeft-jV1c6x3k.js";import"./use-copy-BAQklmkz.js";import"./tabs-Cbvel-f6.js";import"./badge-BiElTurh.js";import"./collapsible-B9yZLN6Y.js";import"./index-DbAOnuVY.js";import"./Code01-BDvBTEm7.js";import"./checkbox-7ZiSm3FO.js";import"./AlignLeft-CKoC1cMY.js";import"./Image01-CHkBHANF.js";import"./Key01-Be9_ogDx.js";import"./RefreshCcw01-CpK4UKE8.js";import"./SearchMd-D_8XQU19.js";import"./Settings01-BXea0IX5.js";import"./use-llm-B0ZUgM3D.js";import"./ai-providers-logos-W57Qm-EN.js";import"./org-ai-providers-DEZEBxef.js";import"./EyeOff-BeKLPveV.js";import"./Eye-DkD5as17.js";import"./Trash01-CHv5mU8b.js";import"./card-DXYG1PJt.js";import"./avatar-CbDE9O_w.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-resources-Dk6zV1FV.js";import"./Copy01-BJVPuQbm.js";import"./marked.esm-BaswSlok.js";import"./markdown-D-1lsMgV.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-YYUTU_-w.js";import"./types-CdefEA9e.js";import"./Globe02-BtYVEi0C.js";import"./LayersTwo01-CqPgQoaH.js";import"./XClose-B-kxIP35.js";import"./Clock-CbBdVVok.js";import"./CheckCircle-DZcEBbaZ.js";import"./Loading01-BUlApwyE.js";import"./ChevronLeft-BjnPH80Y.js";import"./collection-search-DwGryXKM.js";import"./user-CmrAywRT.js";import"./format-time-CMKyl-GC.js";import"./Plus-CiuqWk7L.js";import"./dropdown-menu-W_lhWsM7.js";import"./default-model-D8jxKXJs.js";import"./use-collections-B4b2cHqe.js";import"./useSuspenseInfiniteQuery-DUeEwu4s.js";import"./infiniteQueryObserver--lmuu5bR.js";import"./use-create-virtual-mcp-DLy6t37V.js";import"./Container-C4I-ZzWI.js";const W=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));W.displayName="LayoutRight";const q=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));q.displayName="MessageChatSquare";function ce(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:u}=B();let c;t[0]!==i.id||t[1]!==u?(c=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=c):c=t[2];const l=c;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const p=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:20}),t[4]=o):o=t[4];let n;t[5]!==i.icon||t[6]!==i.title?(n=s.jsx(O,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=n):n=t[7];let r;t[8]!==i.title?(r=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=r):r=t[9];let a;return t[10]!==l||t[11]!==p||t[12]!==n||t[13]!==r?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":p,children:[n,r]}),t[10]=l,t[11]=p,t[12]=n,t[13]=r,t[14]=a):a=t[14],a}function me(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:c}=e,[l,m]=g.useState(!1),p=g.useRef(null);let o,n;t[0]!==l?(o=()=>{l&&setTimeout(()=>{p.current?.focus()},0)},n=[l],t[0]=l,t[1]=o,t[2]=n):(o=t[1],n=t[2]),g.useEffect(o,n);let r;t[3]!==c?(r=N=>{c(N),m(!1)},t[3]=c,t[4]=r):r=t[4];const a=r;let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=d):d=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(te,{asChild:!0,children:s.jsxs("button",{type:"button",className:d,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ne,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=f):f=t[6];let x;t[7]!==a||t[8]!==u||t[9]!==i?(x=s.jsx(se,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ee,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:p})}),t[7]=a,t[8]=u,t[9]=i,t[10]=x):x=t[10];let V;return t[11]!==l||t[12]!==x?(V=s.jsxs(ie,{open:l,onOpenChange:m,children:[f,x]}),t[11]=l,t[12]=x,t[13]=V):V=t[13],V}function de(){const e=b.c(20),t=oe(),{selectedVirtualMcp:i,setVirtualMcpId:u}=B();let c,l,m,p,o,n;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const x=t.filter(ue).slice(0,6);if(x.length===0){o=null;break e}n=t.map(fe),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=p):p=e[7],c="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=x.map(pe)}e[0]=t,e[1]=c,e[2]=l,e[3]=m,e[4]=p,e[5]=o,e[6]=n}else c=e[1],l=e[2],m=e[3],p=e[4],o=e[5],n=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const r=i?.id??null;let a;e[8]!==u||e[9]!==r||e[10]!==n?(a=s.jsx(me,{virtualMcps:n,selectedVirtualMcpId:r,onVirtualMcpChange:u}),e[8]=u,e[9]=r,e[10]=n,e[11]=a):a=e[11];let d;e[12]!==c||e[13]!==l||e[14]!==a?(d=s.jsxs("div",{className:c,children:[l,a]}),e[12]=c,e[13]=l,e[14]=a,e[15]=d):d=e[15];let f;return e[16]!==m||e[17]!==p||e[18]!==d?(f=s.jsxs("div",{className:m,children:[p,d]}),e[16]=m,e[17]=p,e[18]=d,e[19]=f):f=e[19],f}function pe(e){return s.jsx(ce,{agent:e},e.id??"default")}function fe(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ue(e){return e.id!==null&&!re(e.id)}function xe(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(H,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(he)})]}),e[1]=i):i=e[1],i}function he(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(H,{className:"size-6 rounded-md shrink-0"}),s.jsx(H,{className:"h-4 w-full"})]},t)}function ge(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(g.Suspense,{fallback:s.jsx(xe,{}),children:s.jsx(de,{})}),e[0]=t):t=e[0],t}function je(){const e=b.c(39),{org:t}=G(),{data:i}=K.useSession(),{allModelsConnections:u,isChatEmpty:c,activeTaskId:l,tasks:m,selectedVirtualMcp:p}=Y();let o;if(e[0]!==l||e[1]!==m){let j;e[3]!==l?(j=D=>D.id===l,e[3]=l,e[4]=j):j=e[4],o=m.find(j),e[0]=l,e[1]=m,e[2]=o}else o=e[2];const n=o,[r,a]=g.useState(!1);let d;e[5]!==i?.user?.name?(d=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=d):d=e[6];const f=d;let x;e[7]!==t.id?(x=le(t.id),e[7]=t.id,e[8]=x):x=e[8];const N=p??x;if(u.length===0){let j;return e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"flex flex-col h-full bg-background items-center justify-center",children:s.jsx(h.NoLlmBindingEmptyState,{})}),e[9]=j):j=e[9],j}let E,I;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(A,{defaultSize:20,minSize:10,id:"tasks",order:1,children:s.jsx(X,{})}),I=s.jsx(T,{className:"bg-border/30"}),e[10]=E,e[11]=I):(E=e[10],I=e[11]);const $=r?50:80;let C;e[12]!==n?(C=n?.title&&s.jsx(J,{taskId:n.id,text:n.title,className:"text-sm font-medium text-foreground"}),e[12]=n,e[13]=C):C=e[13];let v;e[14]!==C?(v=s.jsx(P.Header.Left,{className:"gap-2",children:C}),e[14]=C,e[15]=v):v=e[15];let y;e[16]!==c||e[17]!==r?(y=!c&&s.jsx("button",{type:"button",onClick:()=>a(be),className:L("flex size-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors",r&&"bg-accent"),title:"Toggle context panel",children:s.jsx(W,{size:14,className:"text-muted-foreground"})}),e[16]=c,e[17]=r,e[18]=y):y=e[18];let S;e[19]!==y?(S=s.jsx(P.Header.Right,{className:"gap-1",children:y}),e[19]=y,e[20]=S):S=e[20];let k;e[21]!==v||e[22]!==S?(k=s.jsxs(P.Header,{className:"flex-none z-10 bg-background",children:[v,S]}),e[21]=v,e[22]=S,e[23]=k):k=e[23];let _;e[24]!==N||e[25]!==c||e[26]!==f?(_=c?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(O,{icon:N.icon,name:N.title,size:"md",fallbackIcon:s.jsx(F,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsx("div",{className:"text-center mb-8",children:s.jsxs("p",{className:"text-xl font-medium text-foreground",children:["What's on your mind, ",f,"?"]})}),s.jsx("div",{className:"w-full",children:s.jsx(h.Input,{})}),s.jsx(h.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(ge,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(h.Main,{children:s.jsx(h.Messages,{})}),s.jsx(h.Footer,{children:s.jsx(h.Input,{onOpenContextPanel:()=>a(!0)})})]}),e[24]=N,e[25]=c,e[26]=f,e[27]=_):_=e[27];let w;e[28]!==k||e[29]!==_?(w=s.jsxs(h,{className:"h-full bg-background",children:[k,_]}),e[28]=k,e[29]=_,e[30]=w):w=e[30];let z;e[31]!==w||e[32]!==$?(z=s.jsx(A,{defaultSize:$,minSize:30,id:"main",order:2,children:w}),e[31]=w,e[32]=$,e[33]=z):z=e[33];let M;e[34]!==r?(M=r&&s.jsxs(s.Fragment,{children:[s.jsx(T,{className:"bg-border/30"}),s.jsx(A,{defaultSize:30,minSize:15,id:"context",order:3,children:s.jsx(Q,{onClose:()=>a(!1)})})]}),e[34]=r,e[35]=M):M=e[35];let R;return e[36]!==z||e[37]!==M?(R=s.jsxs(ae,{direction:"horizontal",className:"size-full",children:[E,I,z,M]}),e[36]=z,e[37]=M,e[38]=R):R=e[38],R}function be(e){return!e}function Ne(e){const t=b.c(14),{error:i,onRetry:u}=e,c=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(P.Header,{className:"flex-none",children:[s.jsx(P.Header.Left,{className:"gap-2"}),s.jsx(P.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(q,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const p=c?"Unable to load models":"Something went wrong";let o;t[2]!==p?(o=s.jsx("h3",{className:"text-lg font-medium",children:p}),t[2]=p,t[3]=o):o=t[3];const n=c?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let r;t[4]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[4]=n,t[5]=r):r=t[5];let a;t[6]!==o||t[7]!==r?(a=s.jsxs("div",{className:"space-y-2",children:[o,r]}),t[6]=o,t[7]=r,t[8]=a):a=t[8];let d;t[9]!==u?(d=s.jsx(U,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=d):d=t[10];let f;return t[11]!==a||t[12]!==d?(f=s.jsxs(h,{children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,d]})})]}),t[11]=a,t[12]=d,t[13]=f):f=t[13],f}function ss(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Z,{fallback:Ce,children:s.jsx(g.Suspense,{fallback:s.jsx(h.Skeleton,{}),children:s.jsx(je,{})})}),e[0]=t):t=e[0],t}function Ce(e){const{error:t,resetError:i}=e;return s.jsx(Ne,{error:t,onRetry:i})}export{ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r,j as i}from"./index-EJhirEgi.js";import{P as m}from"./project-plugins-Caet_L4_.js";import"./useQuery-mGiR1oLn.js";import"./useMutation-ClueFvpj.js";import"./constants-BtZ3fAEQ.js";import"./switch-DRgBKNMz.js";import"./label-t2hx_05l.js";import"./Container-C4I-ZzWI.js";import"./use-connection-DrhtnyBi.js";import"./use-collections-B4b2cHqe.js";import"./use-binding-THgLcp9C.js";import"./binder-DAywY5NR.js";import"./use-install-from-registry-EOOhwh-F.js";import"./extract-connection-data-4B_VINLV.js";import"./constants-DCSMrWwu.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Bc7JySBD.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BUlApwyE.js";import"./Plus-CiuqWk7L.js";import"./select-B2Bho1QQ.js";import"./ChevronUp-Be0WocGY.js";import"./index-Dv4huKa6.js";import"./Check-BWCeXHN7.js";import"./ChevronDown-B15SC8MA.js";function w(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as P,g as A,j as l,E as y,r as R,u as T}from"./index-EJhirEgi.js";import{u as S}from"./use-connection-DrhtnyBi.js";import{u as U}from"./constants-BtZ3fAEQ.js";import{u as v}from"./use-mcp-tools-CKkWOyR2.js";import{c as E}from"./content-blocks-o63cs2vh.js";import{M as H}from"./mcp-app-renderer-YYUTU_-w.js";import{g as O,M as $}from"./types-CdefEA9e.js";import{u as D}from"./context-228p0Ol2.js";import{P as _,u as k}from"./index-wbJeckpV.js";import"./use-collections-B4b2cHqe.js";import"./useMutation-ClueFvpj.js";import"./useQuery-mGiR1oLn.js";import"./use-mcp-resources-Dk6zV1FV.js";import"./use-virtual-mcp-D_iE9Cdz.js";import"./default-model-D8jxKXJs.js";import"./use-llm-B0ZUgM3D.js";import"./localstorage-keys-CyCsfmz2.js";import"./use-preferences-D5crHwiP.js";import"./useSuspenseInfiniteQuery-DUeEwu4s.js";import"./infiniteQueryObserver--lmuu5bR.js";import"./tooltip-BXI94UP3.js";import"./index-Dv4huKa6.js";const b={};function w(t){const e=P.c(22),{client:o,resourceURI:m,tool:i,connectionId:f}=t,{sendMessage:a,setAppContext:c,clearAppContext:n}=D(),[,p]=k(),r=`${f}:${i.name}`;let d;e[0]!==o||e[1]!==i.name?(d={client:o,toolName:i.name,toolArguments:b},e[0]=o,e[1]=i.name,e[2]=d):d=e[2];const{data:u}=v(d);let s;e[3]!==a||e[4]!==p?(s=N=>{const M=E(N.content);M.content.length>0&&(p(!0),a(M))},e[3]=a,e[4]=p,e[5]=s):s=e[5];const g=s,I=i;let x;e[6]!==I?(x={tool:I},e[6]=I,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==r?(h=N=>c(r,N),e[8]=c,e[9]=r,e[10]=h):h=e[10];let j;e[11]!==n||e[12]!==r?(j=()=>n(r),e[11]=n,e[12]=r,e[13]=j):j=e[13];let C;return e[14]!==o||e[15]!==g||e[16]!==m||e[17]!==x||e[18]!==h||e[19]!==j||e[20]!==u?(C=l.jsx(H,{resourceURI:m,toolInfo:x,toolInput:b,toolResult:u,displayMode:"fullscreen",minHeight:$.fullscreen.minHeight,maxHeight:$.fullscreen.maxHeight,client:o,onMessage:g,onUpdateModelContext:h,onTeardown:j,className:"h-full"}),e[14]=o,e[15]=g,e[16]=m,e[17]=x,e[18]=h,e[19]=j,e[20]=u,e[21]=C):C=e[21],C}function L(t){const e=P.c(17),{connectionId:o,toolName:m}=t,{org:i}=T();let f;e[0]!==o||e[1]!==i.id?(f={connectionId:o,orgId:i.id},e[0]=o,e[1]=i.id,e[2]=f):f=e[2];const a=U(f),c=S(o),n=decodeURIComponent(m);let p,r;if(e[3]!==c?.tools||e[4]!==n){let s;e[7]!==n?(s=g=>g.name===n,e[7]=n,e[8]=s):s=e[8],r=(c?.tools??[]).find(s),p=r?._meta?O(r._meta):void 0,e[3]=c?.tools,e[4]=n,e[5]=p,e[6]=r}else p=e[5],r=e[6];const d=p;if(!c){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=s):s=e[9],s}if(!r||!d){let s;return e[10]!==n?(s=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',n,'" not found or has no UI']})}),e[10]=n,e[11]=s):s=e[11],s}let u;return e[12]!==a||e[13]!==o||e[14]!==d||e[15]!==r?(u=l.jsx(w,{client:a,resourceURI:d,tool:r,connectionId:o}),e[12]=a,e[13]=o,e[14]=d,e[15]=r,e[16]=u):u=e[16],u}function ae(){const t=P.c(9);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:m}=A(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(_.Header,{}),t[1]=i):i=t[1];const f=`${o}:${m}`;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),l.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[2]=a):a=t[2];let c;t[3]!==o||t[4]!==m?(c=l.jsx(R.Suspense,{fallback:a,children:l.jsx(L,{connectionId:o,toolName:m})}),t[3]=o,t[4]=m,t[5]=c):c=t[5];let n;return t[6]!==f||t[7]!==c?(n=l.jsxs(_,{children:[i,l.jsx(_.Content,{children:l.jsx(y,{fallback:void 0,children:c},f)})]}),t[6]=f,t[7]=c,t[8]=n):n=t[8],n}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as O,f as st,j as s,z as ue,w as Je,o as ms,n as Ge,e as at,u as me,x as _t,t as fs,q as ps,K as mt,B as de,c9 as Pt,O as Ie,P as It,S as Ze,g as xs,au as hs}from"./index-EJhirEgi.js";import{u as Et}from"./use-project-UxeKn7lk.js";import{c as Ot,d as gs,b as vs,a as Dt,D as Lt}from"./dialog-DD3DgOo2.js";import{i as ys}from"./X-CC0aD5R8.js";import{S as ne}from"./skeleton-BDMxlKkg.js";import{i as bs,u as js,O as Ns}from"./org-ai-providers-DEZEBxef.js";import{A as Tt}from"./avatar-CbDE9O_w.js";import{t as Ss,i as rt}from"./Coins01-CGSgNFIJ.js";import{t as ws}from"./Settings01-BXea0IX5.js";import{i as Cs}from"./Zap-w2d1hiBo.js";import{a as As,T as ks,b as _s,c as Ps}from"./tooltip-BXI94UP3.js";import{i as Is}from"./Check-BWCeXHN7.js";import{a as Es}from"./Copy01-BJVPuQbm.js";import{S as De}from"./switch-DRgBKNMz.js";import{S as Os,a as Ds,d as We,c as Ls}from"./select-B2Bho1QQ.js";import{i as Ts}from"./Code01-BDvBTEm7.js";import{s as zt}from"./RefreshCcw01-CpK4UKE8.js";import{i as zs}from"./Shield01-xSYnh-yR.js";import{u as $s}from"./use-preferences-D5crHwiP.js";import{u as Ms}from"./useMutation-ClueFvpj.js";import{a as Bs,F as Fe,b as Re,c as Ue,d as Ke,f as Ve,e as Gs}from"./form-BcVHSZnK.js";import{I as Pe}from"./input-23yd6VmI.js";import{L as Ws}from"./logo-upload-B8w0TwVt.js";import{P as Fs}from"./project-plugins-Caet_L4_.js";import{u as Rs,a as Us,b as Ks,i as ie,r as lt,D as $t,c as Me,d as fe,s as ft,e as pt,Z as Mt,g as Bt,f as Gt,h as Wt,j as ke,k as nt,l as Be,m as it,n as Vs,o as Ys,p as Ft,q as ot,t as ct,v as Rt,w as Hs,x as Ut,y as xt,z as qs,A as Qs,B as Xs,R as Js,S as Zs,C as ea,E as ta,F as Kt,G as sa,H as aa,I as ra,J as la,K as na,L as ia,M as oa,N as ca,O as Le,P as da,Q as ht,T as gt,U as vt,V as ua,W as Vt,X as ma,Y as Ne,_ as fa,$ as pa,a0 as xa,a1 as ha,a2 as ga,a3 as Ye,a4 as va,a5 as Te,a6 as ya,a7 as J,a8 as Yt,a9 as ba,aa as ja,ab as Na,ac as Sa,ad as wa,ae as Ca,af as Aa,ag as ka,ah as _a,ai as Pa,aj as Ia,ak as Ea,al as Oa,am as Da,an as La,ao as Ta,ap as za,aq as $a}from"./chart-BbEOfgV-.js";import{L as _e}from"./label-t2hx_05l.js";import{B as Ma}from"./badge-BiElTurh.js";import{a as Ba,T as He,b as qe,c as Ga}from"./tabs-Cbvel-f6.js";import{i as Wa}from"./AlertCircle-48gOoEWA.js";import{s as Ht}from"./Plus-CiuqWk7L.js";import{u as Ae,a as dt,K as Fa}from"./constants-BtZ3fAEQ.js";import{b as Ra}from"./use-connection-DrhtnyBi.js";import{b as oe,a as qt}from"./use-mcp-tools-CKkWOyR2.js";import{u as Ua}from"./use-members-DQi2Ov4F.js";import{c as Ka,A as Va}from"./use-binding-THgLcp9C.js";import"./useQuery-mGiR1oLn.js";import"./EyeOff-BeKLPveV.js";import"./Eye-DkD5as17.js";import"./Key01-Be9_ogDx.js";import"./Trash01-CHv5mU8b.js";import"./card-DXYG1PJt.js";import"./popover-Cmt-BFZN.js";import"./use-llm-B0ZUgM3D.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./index-Dv4huKa6.js";import"./ChevronUp-Be0WocGY.js";import"./ChevronDown-B15SC8MA.js";import"./localstorage-keys-CyCsfmz2.js";import"./Upload01-CquOr5qE.js";import"./Container-C4I-ZzWI.js";import"./use-install-from-registry-EOOhwh-F.js";import"./extract-connection-data-4B_VINLV.js";import"./constants-DCSMrWwu.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Bc7JySBD.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BUlApwyE.js";import"./index-6R2fscZr.js";import"./use-collections-B4b2cHqe.js";import"./binder-DAywY5NR.js";const Qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Qt.displayName="Bell01";function Ya(t){const e=O.c(26),{activeSection:r,onNavigate:a}=t,{data:l}=st.useSession(),n=l?.user,i=n?.image,o=n?.name??"Profile",d=n?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(ws,{size:14})},e[6]=u):u=e[6];let f;e[7]!==c?(f=[c,u],e[7]=c,e[8]=f):f=e[8];const h=f;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={key:"org.general",label:"General",icon:s.jsx(Ss,{size:14})},e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.plugins",label:"Features",icon:s.jsx(Cs,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.ai-providers",label:"AI Providers",icon:s.jsx(bs,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[x,p,g,{key:"org.billing",label:"Billing",icon:s.jsx(rt,{size:14})}],e[12]=y):y=e[12];const w=y;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=j):j=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,h.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=S):S=e[18];let N;e[19]!==r||e[20]!==a?(N=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[S,w.map(C=>s.jsxs("button",{type:"button",onClick:()=>a(C.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===C.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:C.icon}),s.jsx("span",{className:"truncate",children:C.label})]},C.key))]}),e[19]=r,e[20]=a,e[21]=N):N=e[21];let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.167.0"]})}),e[22]=A):A=e[22];let k;return e[23]!==b||e[24]!==N?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,N,A]}),e[23]=b,e[24]=N,e[25]=k):k=e[25],k}function Ha(){const t=O.c(32),{data:e}=st.useSession(),[r,a]=v.useState(!1),l=e?.user,n=l?.image;let i;t[0]!==l?(i=()=>{l?.id&&navigator.clipboard.writeText(l.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=l,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=l?.name??"U";let c;t[3]!==m||t[4]!==n?(c=s.jsx(Tt,{url:n,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=n,t[5]=c):c=t[5];const u=l?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const h=l?.email;let x;t[8]!==h?(x=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),t[8]=h,t[9]=x):x=t[9];let p;t[10]!==f||t[11]!==x?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,x]}),t[10]=f,t[11]=x,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const j=l?.id;let b;t[18]!==j?(b=s.jsx("span",{className:"font-mono text-sm",children:j}),t[18]=j,t[19]=b):b=t[19];let S;t[20]!==r?(S=r?s.jsx(Is,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Es,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=S):S=t[21];let N;t[22]!==o||t[23]!==b||t[24]!==S?(N=s.jsx(As,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,S]})}),t[22]=o,t[23]=b,t[24]=S,t[25]=N):N=t[25];let A;t[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ks,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=A):A=t[26];let k;t[27]!==N?(k=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,s.jsx(_s,{children:s.jsxs(Ps,{children:[N,A]})})]})]}),t[27]=N,t[28]=k):k=t[28];let C;return t[29]!==k||t[30]!==g?(C=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,k]}),t[29]=k,t[30]=g,t[31]=C):C=t[31],C}function Oe(t){const e=O.c(27),{icon:r,label:a,description:l,control:n,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let h;e[3]!==f?(h={cursor:f},e[3]=f,e[4]=h):h=e[4];let x;e[5]!==r?(x=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=x):x=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==l?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[9]=l,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let w;e[14]!==y||e[15]!==x?(w=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[x,y]}),e[14]=y,e[15]=x,e[16]=w):w=e[16];let j;e[17]!==n?(j=s.jsx("div",{onClick:qa,className:"shrink-0",children:n}),e[17]=n,e[18]=j):j=e[18];let b;return e[19]!==d||e[20]!==w||e[21]!==j||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:h,children:[w,j]}),e[19]=d,e[20]=w,e[21]=j,e[22]=m,e[23]=c,e[24]=u,e[25]=h,e[26]=b):b=e[26],b}function qa(t){return t.stopPropagation()}function yt(){const t=O.c(47),[e,r]=$s();let a;t[0]!==r?(a=async _=>{if(_&&await Notification.requestPermission()!=="granted"){Je.error("Notifications denied. Please enable them in your browser settings."),r(Ja);return}r(E=>({...E,enableNotifications:_}))},t[0]=r,t[1]=a):a=t[1];const l=a;let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=n):n=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ts,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Xa),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=_=>r(E=>({...E,devMode:_})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(De,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(Oe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==l||t[16]!==e.enableNotifications?(f=s.jsx(Oe,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>l(!e.enableNotifications),control:s.jsx(De,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:l})}),t[15]=l,t[16]=e.enableNotifications,t[17]=f):f=t[17];let h;t[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(zt,{size:16}),t[18]=h):h=t[18];let x;t[19]!==r?(x=()=>r(Qa),t[19]=r,t[20]=x):x=t[20];let p;t[21]!==r?(p=_=>r(E=>({...E,experimentalAutomations:_})),t[21]=r,t[22]=p):p=t[22];let g;t[23]!==e.experimentalAutomations||t[24]!==p?(g=s.jsx(De,{checked:e.experimentalAutomations,onCheckedChange:p}),t[23]=e.experimentalAutomations,t[24]=p,t[25]=g):g=t[25];let y;t[26]!==x||t[27]!==g?(y=s.jsx(Oe,{icon:h,label:"Experimental: Automations",description:"Enable the Automations feature in the sidebar. This is an experimental feature under active development.",onClick:x,control:g}),t[26]=x,t[27]=g,t[28]=y):y=t[28];let w;t[29]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(zs,{size:16}),t[29]=w):w=t[29];let j;t[30]!==r?(j=_=>r(E=>({...E,toolApprovalLevel:_})),t[30]=r,t[31]=j):j=t[31];let b;t[32]===Symbol.for("react.memo_cache_sentinel")?(b={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[32]=b):b=t[32];const S=b[e.toolApprovalLevel];let N;t[33]!==S?(N=s.jsx(Ds,{className:"w-36",children:s.jsx("span",{children:S})}),t[33]=S,t[34]=N):N=t[34];let A;t[35]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[35]=A):A=t[35];let k;t[36]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[36]=k):k=t[36];let C;t[37]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs(Ls,{children:[A,k,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[37]=C):C=t[37];let P;t[38]!==e.toolApprovalLevel||t[39]!==j||t[40]!==N?(P=s.jsx(Oe,{icon:w,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Os,{value:e.toolApprovalLevel,onValueChange:j,children:[N,C]})}),t[38]=e.toolApprovalLevel,t[39]=j,t[40]=N,t[41]=P):P=t[41];let D;return t[42]!==y||t[43]!==P||t[44]!==c||t[45]!==f?(D=s.jsxs("div",{className:"flex flex-col gap-6",children:[n,s.jsxs("div",{className:"flex flex-col",children:[c,f,y,P]})]}),t[42]=y,t[43]=P,t[44]=c,t[45]=f,t[46]=D):D=t[46],D}function Qa(t){return{...t,experimentalAutomations:!t.experimentalAutomations}}function Xa(t){return{...t,devMode:!t.devMode}}function Ja(t){return{...t,enableNotifications:!1}}const Za=ms({name:Ge().min(1,"Name is required").max(255,"Name is too long"),slug:Ge().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Ge().optional()});function er(){const t=at(),{org:e,project:r}=me(),a=_t(),[l,n]=v.useState(!1),i=fs({resolver:ps(Za),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Ms({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await st.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Je.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Je.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{n(!1)}}),d=c=>{n(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(Bs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:i.control,name:"name",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"My Organization",...c,disabled:l})}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Organization Slug"}),s.jsx(Ke,{children:s.jsx(Pe,{placeholder:"my-organization",...c,disabled:l,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Gs,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ve,{})]})}),s.jsx(Fe,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(Re,{children:[s.jsx(Ue,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(Ws,{value:c.value,onChange:c.onChange,name:i.watch("name"),disabled:l})}),s.jsx(Ve,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(de,{type:"submit",disabled:!m||l,className:"min-w-24",children:l?"Saving...":"Save Changes"}),m&&s.jsx(de,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:l,children:"Cancel"})]})]})})}function tr(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(er,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>l[i++]))}},sr=["x1","y1","x2","y2","key"],ar=["offset"],rr=["xAxisId","yAxisId"],lr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){nr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function nr(t,e,r){return(e=ir(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ir(t){var e=or(t,"string");return typeof e=="symbol"?e:e+""}function or(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,l=cr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function cr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var dr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:l,width:n,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:l,ry:o,width:n,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Xt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var l,{x1:n,y1:i,x2:o,y2:d,key:m}=r,c=ze(r,sr),u=(l=nt(c))!==null&&l!==void 0?l:{},{offset:f}=u,h=ze(u,ar);a=v.createElement("line",pe({},h,{x1:n,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function ur(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=ze(t,rr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Xt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function mr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:l}=t;if(!a||!l||!l.length)return null;var{xAxisId:n,yAxisId:i}=t,o=ze(t,lr),d=l.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Xt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function fr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:l,width:n,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],x=h==null,p=x?l+i-u:h-u;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:p,width:n,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function pr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:l,y:n,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+l-l)).sort((u,f)=>u-f);l!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var h=m[f+1],x=h==null,p=x?l+i-u:h-u;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:n,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var xr=(t,e)=>{var{xAxis:r,width:a,height:l,offset:n}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Wt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.left,n.left+n.width,e)},hr=(t,e)=>{var{yAxis:r,width:a,height:l,offset:n}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Wt(r),viewBox:{x:0,y:0,width:a,height:l}})),n.top,n.top+n.height,e)},gr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Jt(t){var e=Rs(),r=Us(),a=Ks(),l=Z(Z({},lt(t,gr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:n,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:h}=l,x=Me(),p=fe(C=>ft(C,"xAxis",n,x)),g=fe(C=>ft(C,"yAxis",i,x));if(!pt(m)||!pt(c)||!ie(o)||!ie(d))return null;var y=l.verticalCoordinatesGenerator||xr,w=l.horizontalCoordinatesGenerator||hr,{horizontalPoints:j,verticalPoints:b}=l;if((!j||!j.length)&&typeof w=="function"){var S=f&&f.length,N=w({yAxis:g?Z(Z({},g),{},{ticks:S?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},S?!0:u);bt(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}if((!b||!b.length)&&typeof y=="function"){var A=h&&h.length,k=y({xAxis:p?Z(Z({},p),{},{ticks:A?h:p.ticks}):void 0,width:e??m,height:r??c,offset:a},A?!0:u);bt(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(b=k)}return v.createElement(Mt,{zIndex:l.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(dr,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),v.createElement(fr,pe({},l,{horizontalPoints:j})),v.createElement(pr,pe({},l,{verticalPoints:b})),v.createElement(ur,pe({},l,{offset:a,horizontalPoints:j,xAxis:p,yAxis:g})),v.createElement(mr,pe({},l,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Jt.displayName="CartesianGrid";var Zt=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),es=(t,e,r)=>Rt(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),ss=(t,e,r)=>Rt(t,"yAxis",ct(t,e),r),vr=Be([it,Zt,ts,es,ss],(t,e,r,a,l)=>Ut(t,"xAxis")?xt(e,a,!1):xt(r,l,!1)),yr=(t,e)=>e,as=Be([qs,yr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),rs=t=>{var e=it(t),r=Ut(e,"xAxis");return r?"yAxis":"xAxis"},br=(t,e)=>{var r=rs(t);return r==="yAxis"?ct(t,e):ot(t,e)},jr=(t,e,r)=>Qs(t,rs(t),br(t,e),r),Nr=Be([as,jr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,l=Hs(t);if(!(a==null||l==null)){var n=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=n?.find(o=>o.key===l);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Sr=Be([it,Zt,ts,es,ss,Nr,Vs,vr,as,Ys],(t,e,r,a,l,n,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||l==null||a.length===0||l.length===0||o==null)){var{data:h}=d,x;if(h&&h.length>0?x=h:x=c?.slice(u,f+1),x!=null)return Rr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataStartIndex:u,areaSettings:d,stackedData:n,displayedData:x,chartBaseValue:m,bandSize:o})}}),wr=["id"],Cr=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ls(t,e){if(t==null)return{};var r,a,l=Ar(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Ar(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){kr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function kr(t,e,r){return(e=_r(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _r(t){var e=Pr(t,"string");return typeof e=="symbol"?e:e+""}function Pr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Ir=t=>{var{dataKey:e,name:r,stroke:a,fill:l,legendType:n,hide:i}=t;return[{inactive:i,dataKey:e,type:n,color:$e(a,l),value:Kt(r,e),payload:t}]},Er=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:n,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:aa,settings:{stroke:a,strokeWidth:l,fill:n,dataKey:e,nameKey:void 0,name:Kt(i,e),hide:o,type:m,color:$e(a,n),unit:d,graphicalItemId:c}};return v.createElement(sa,{tooltipEntrySettings:u})});function Or(t){var{clipPathId:e,points:r,props:a}=t,{needClip:l,dot:n,dataKey:i}=a,o=nt(a);return v.createElement(va,{points:r,dot:n,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:l,clipPathId:e})}function Dr(t){var{showLabels:e,children:r,points:a}=t,l=a.map(n=>{var i,o,d={x:(i=n.x)!==null&&i!==void 0?i:0,y:(o=n.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:n.value,payload:n.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(ha,{value:e?l:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:l,props:n}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=n,{id:u}=n,f=ls(n,wr),h=nt(f),x=ga(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(Le,{clipPath:a?"url(#clipPath-".concat(l,")"):void 0},v.createElement(Ye,xe({},x,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&Array.isArray(r)&&v.createElement(Ye,xe({},h,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement(Or,{points:e,props:f,clipPathId:l}))}function Lr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.y,d=(r=n[n.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.x||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Tr(t){var e,r,{alpha:a,baseLine:l,points:n,strokeWidth:i}=t,o=(e=n[0])===null||e===void 0?void 0:e.x,d=(r=n[n.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...n.map(u=>u.y||0));return ie(l)?c=Math.max(l,c):l&&Array.isArray(l)&&l.length&&(c=Math.max(...l.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function zr(t){var{alpha:e,layout:r,points:a,baseLine:l,strokeWidth:n}=t;return r==="vertical"?v.createElement(Lr,{alpha:e,points:a,baseLine:l,strokeWidth:n}):v.createElement(Tr,{alpha:e,points:a,baseLine:l,strokeWidth:n})}function $r(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:h}=a,x=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),p=ua(x,"recharts-area-"),g=Vt(),[y,w]=v.useState(!1),j=!y,b=v.useCallback(()=>{typeof h=="function"&&h(),w(!1)},[h]),S=v.useCallback(()=>{typeof f=="function"&&f(),w(!0)},[f]);if(g==null)return null;var N=l.current,A=n.current;return v.createElement(Dr,{showLabels:j,points:i},a.children,v.createElement(ma,{animationId:p,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:S,key:p},k=>{if(N){var C=N.length/i.length,P=k===1?i:i.map((_,E)=>{var T=Math.floor(E*C);if(N[T]){var L=N[T];return Se(Se({},_),{},{x:Ne(L.x,_.x,k),y:Ne(L.y,_.y,k)})}return _}),D;return ie(o)?D=Ne(A,o,k):fa(o)||pa(o)?D=Ne(A,0,k):D=o.map((_,E)=>{var T=Math.floor(E*C);if(Array.isArray(A)&&A[T]){var L=A[T];return Se(Se({},_),{},{x:Ne(L.x,_.x,k),y:Ne(L.y,_.y,k)})}return _}),k>0&&(l.current=P,n.current=D),v.createElement(St,{points:P,baseLine:D,needClip:e,clipPathId:r,props:a})}return k>0&&(l.current=i,n.current=o),v.createElement(Le,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(zr,{alpha:k,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(Le,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(xa,{label:a.label}))}function Mr(t){var{needClip:e,clipPathId:r,props:a}=t,l=v.useRef(null),n=v.useRef();return v.createElement($r,{needClip:e,clipPathId:r,props:a,previousPointsRef:l,previousBaselineRef:n})}class Br extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:l,top:n,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:h,zIndex:x}=this.props;if(e)return null;var p=Pt("recharts-area",l),g=f,{r:y,strokeWidth:w}=oa(r),j=ca(r),b=y*2+w,S=o?"url(#clipPath-".concat(j?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:x},v.createElement(Le,{className:p},o&&v.createElement("defs",null,v.createElement(da,{clipPathId:g,xAxisId:d,yAxisId:m}),!j&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:n-b/2,width:c+b,height:u+b}))),v.createElement(Mr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(h)&&v.createElement(ht,{points:h,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}}var Gr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Wr(t){var e,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,connectNulls:i,dot:o,fill:d,fillOpacity:m,hide:c,isAnimationActive:u,legendType:f,stroke:h,xAxisId:x,yAxisId:p}=t,g=ls(t,Cr),y=ra(),w=la(),{needClip:j}=na(x,p),b=Me(),{points:S,isRange:N,baseLine:A}=(e=fe(E=>Sr(E,t.id,b)))!==null&&e!==void 0?e:{},k=ia();if(y!=="horizontal"&&y!=="vertical"||k==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:C,width:P,x:D,y:_}=k;return!S||!S.length?null:v.createElement(Br,xe({},g,{activeDot:r,animationBegin:a,animationDuration:l,animationEasing:n,baseLine:A,connectNulls:i,dot:o,fill:d,fillOpacity:m,height:C,hide:c,layout:y,isAnimationActive:u,isRange:N,legendType:f,needClip:j,points:S,stroke:h,width:P,left:D,top:_,xAxisId:x,yAxisId:p}))}var Fr=(t,e,r,a,l)=>{var n=r??e;if(ie(n))return n;var i=t==="horizontal"?l:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return n==="dataMin"?m:n==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return n==="dataMin"?o[0]:n==="dataMax"?o[1]:o[0]};function Rr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:l,layout:n,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:h}=t,x=l&&l.length,p=Fr(n,i,r,o,d),g=n==="horizontal",y=!1,w=m.map((b,S)=>{var N,A,k,C;if(x)C=l[c+S];else{var P=gt(b,a);Array.isArray(P)?(C=P,y=!0):C=[p,P]}var D=(N=(A=C)===null||A===void 0?void 0:A[1])!==null&&N!==void 0?N:null,_=D==null||x&&!e&>(b,a)==null;if(g){var E;return{x:vt({axis:o,ticks:u,bandSize:h,entry:b,index:S}),y:_?null:(E=d.scale.map(D))!==null&&E!==void 0?E:null,value:C,payload:b}}return{x:_?null:(k=o.scale.map(D))!==null&&k!==void 0?k:null,y:vt({axis:d,ticks:f,bandSize:h,entry:b,index:S}),value:C,payload:b}}),j;return x||y?j=w.map(b=>{var S,N=Array.isArray(b.value)?b.value[0]:null;if(g){var A;return{x:b.x,y:N!=null&&b.y!=null&&(A=d.scale.map(N))!==null&&A!==void 0?A:null,payload:b.payload}}return{x:N!=null&&(S=o.scale.map(N))!==null&&S!==void 0?S:null,y:b.y,payload:b.payload}}):j=g?d.scale.map(p):o.scale.map(p),{points:w,baseLine:j??0,isRange:y}}function Ur(t){var e=lt(t,Gr),r=Me();return v.createElement(Js,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(Zs,{legendPayload:Ir(e)}),v.createElement(Er,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(ea,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:ta(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Wr,xe({},e,{id:a}))))}var ns=v.memo(Ur,Xs);ns.displayName="Area";var Kr=["type"],Vr=["dangerouslySetInnerHTML","ticks","scale"],Yr=["id","scale"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},et.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Hr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Hr(t,e,r){return(e=qr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qr(t){var e=Qr(t,"string");return typeof e=="symbol"?e:e+""}function Qr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t,e){if(t==null)return{};var r,a,l=Xr(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(a=0;a<n.length;a++)r=n[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Xr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Jr(t){var e=Yt(),r=v.useRef(null),a=Vt(),{type:l}=t,n=tt(t,Kr),i=Ea(a,"yAxis",l),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},n),{},{type:i})},[i,n]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ba(o)):r.current!==o&&e(ja({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(Na(r.current)),r.current=null)},[e]),null}function Zr(t){var{yAxisId:e,className:r,width:a,label:l}=t,n=v.useRef(null),i=v.useRef(null),o=fe(Sa),d=Me(),m=Yt(),c="yAxis",u=fe(N=>wa(N,e)),f=fe(N=>Ca(N,e)),h=fe(N=>Aa(N,c,e,d)),x=fe(N=>ka(N,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||_a(l)||v.isValidElement(l)||x==null)){var N=n.current;if(N){var A=N.getCalculatedWidth();Math.round(u.width)!==Math.round(A)&&m(Pa({id:e,width:A}))}}},[h,u,m,l,e,a,x]),u==null||f==null||x==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,w=tt(t,Vr),{id:j,scale:b}=x,S=tt(x,Yr);return v.createElement(Ia,et({},w,S,{ref:n,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:h,axisType:c,axisId:e}))}var el={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,niceTicks:J.niceTicks,width:J.width,yAxisId:0},tl=t=>{var e=lt(t,el);return v.createElement(v.Fragment,null,v.createElement(Jr,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter,niceTicks:e.niceTicks}),v.createElement(Zr,e))},is=v.memo(tl,ya);is.displayName="YAxis";var sl=["axis"],al=v.forwardRef((t,e)=>v.createElement(Oa,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sl,tooltipPayloadSearcher:Da,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const l=new Date(r),n=t==="7d"?7:t==="30d"?30:90;return l.setDate(l.getDate()-n),{startDate:l.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function K(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const os="gateway-chip-period";function rl(){try{const t=localStorage.getItem(os);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function ll(t){try{localStorage.setItem(os,t)}catch{}}const nl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},il={daily:"daily",weekly:"weekly",monthly:"monthly"},ol=[5,10,25,50,100],cl=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function dl(t){const e=O.c(51),{open:r,onOpenChange:a,connectionId:l,currentLimitUsd:n,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[h,x]=v.useState(null),[p,g]=v.useState(null),[y,w]=v.useState(o??"none");let j;e[0]!==l||e[1]!==d.id?(j={connectionId:l,orgId:d.id},e[0]=l,e[1]=d.id,e[2]=j):j=e[2];const b=Ae(j);let S;e[3]!==b?(S={client:b},e[3]=b,e[4]=S):S=e[4];const{mutate:N,isPending:A}=qt(S),k=_t(),C=i==="postpaid";let P;e[5]!==u?(P=u?Number.parseFloat(u):null,e[5]=u,e[6]=P):P=e[6];const _=m??P,E=y==="none"?null:y,T=C&&_!=null&&_===n&&E===o;let L;e[7]!==b?(L=Fa.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=L):L=e[8];const G=L;let V;e[9]!==G||e[10]!==k?(V=async()=>{await k.invalidateQueries({queryKey:G,exact:!0}),await k.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=k,e[11]=V):V=e[11];const R=V;let z,$;e[12]!==i||e[13]!==o||e[14]!==n||e[15]!==_||e[16]!==C||e[17]!==y||e[18]!==N||e[19]!==a||e[20]!==R?($=()=>{if(!_||_<=0)return;const B=C?_:n+_;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};C&&(ae.limit_period=y),N({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await R(),te?.checkout_url?x(te.checkout_url):z()},onError:re=>{g(re.message??"Failed to update limit.")}})},z=()=>{c(null),f(""),x(null),g(null),w(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=n,e[15]=_,e[16]=C,e[17]=y,e[18]=N,e[19]=a,e[20]=R,e[21]=z,e[22]=$):(z=e[21],$=e[22]);const Y=C?"Configure Spending Limit":"Add Credit",H=C?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=C?"New limit":"Select amount",U=C?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(Ot,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(gs,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let W;e[27]!==q||e[28]!==ee?(W=s.jsxs(vs,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=W):W=e[29];let F;e[30]!==M||e[31]!==h||e[32]!==U||e[33]!==n||e[34]!==u||e[35]!==_||e[36]!==p||e[37]!==$||e[38]!==A||e[39]!==C||e[40]!==T||e[41]!==y||e[42]!==m?(F=h?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(de,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:h,children:[s.jsx(rt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:ol.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:C?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Pe,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),C&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(_e,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:cl.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>w(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:C?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:n>0?K(n):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:K(n)})]})}),s.jsx(de,{onClick:$,disabled:A||!_||_<=0||T,className:"gap-2",children:A?"Updating...":U})]})]}),e[30]=M,e[31]=h,e[32]=U,e[33]=n,e[34]=u,e[35]=_,e[36]=p,e[37]=$,e[38]=A,e[39]=C,e[40]=T,e[41]=y,e[42]=m,e[43]=F):F=e[43];let Q;e[44]!==W||e[45]!==F?(Q=s.jsxs(Dt,{className:"sm:max-w-md",children:[W,F]}),e[44]=W,e[45]=F,e[46]=Q):Q=e[46];let se;return e[47]!==z||e[48]!==r||e[49]!==Q?(se=s.jsx(Lt,{open:r,onOpenChange:z,children:Q}),e[47]=z,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function ul(t){const e=O.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:l,avgDailySpend:n}=r;if(a==null)return null;let i;e[0]!==l?(i=l?new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=l,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==n?(f=K(n),e[8]=n,e[9]=f):f=e[9];let h;e[10]!==f?(h=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==r.resetsBeforeDepletion?(x=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=x):x=e[13];const p=nl[r.confidence];let g;e[14]!==p?(g=s.jsx(Ma,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==h||e[20]!==x?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,h,x,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=h,e[20]=x,e[21]=y):y=e[21],y}function ml(t){const e=O.c(37),{usage:r,limit:a,limitPeriod:l,onConfigureLimit:n,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=K(r.total),e[5]=r.total,e[6]=f):f=e[6];let h;e[7]!==f?(h=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=h):h=e[8];let x;e[9]!==d||e[10]!==a.total||e[11]!==l?(x=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a.total)," limit",l&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(zt,{size:10}),il[l]]})]}),e[9]=d,e[10]=a.total,e[11]=l,e[12]=x):x=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==h||e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,h,x,p]}),e[15]=h,e[16]=x,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ht,{size:16}),e[19]=y):y=e[19];const w=d?"Configure Limit":"Set Limit";let j;e[20]!==n||e[21]!==w?(j=s.jsxs(de,{onClick:n,variant:"outline",className:"gap-2",children:[y,w]}),e[20]=n,e[21]=w,e[22]=j):j=e[22];let b;e[23]!==j||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25];let S;e[26]!==d||e[27]!==a.reset||e[28]!==c?(S=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=S):S=e[29];let N;e[30]!==o||e[31]!==i?(N=s.jsx(cs,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=N):N=e[32];let A;return e[33]!==b||e[34]!==S||e[35]!==N?(A=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,S,N]}),e[33]=b,e[34]=S,e[35]=N,e[36]=A):A=e[36],A}function fl(t){const e=O.c(30),{available:r,total:a,estimation:l,onAddCredit:n,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=K(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",K(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let h;e[7]!==u||e[8]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ht,{size:16}),e[10]=x):x=e[10];let p;e[11]!==n?(p=s.jsxs(de,{onClick:n,className:"gap-2 px-5",children:[x,"Add Credit"]}),e[11]=n,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[h,p]}),e[13]=h,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[K(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let w;e[20]!==l?(w=s.jsx(ul,{estimation:l}),e[20]=l,e[21]=w):w=e[21];let j;e[22]!==o||e[23]!==i?(j=s.jsx(cs,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=j):j=e[24];let b;return e[25]!==w||e[26]!==j||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,w,j]}),e[25]=w,e[26]=j,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function cs(t){const e=O.c(78),{connectionId:r,alert:a,billingMode:l}=t,{org:n}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,h]=v.useState(a.email??""),[x,p]=v.useState(!1),[g,y]=v.useState(null);let w;e[0]!==r||e[1]!==n.id?(w={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=w):w=e[2];const j=Ae(w);let b;e[3]!==j?(b={client:j},e[3]=j,e[4]=b):b=e[4];const{mutate:S,isPending:N}=qt(b),A=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let k;e[5]!==f||e[6]!==d||e[7]!==S||e[8]!==c?(k=()=>{y(null),p(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}S({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=S,e[8]=c,e[9]=k):k=e[9];const C=k,P=l==="postpaid"?"Usage Alert":"Low-Balance Alert",D=l==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Wa,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==P?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:P}),e[12]=P,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==l?(ve=a.enabled?l==="postpaid"?`Enabled · Alert at ${K(a.threshold_usd)}`:`Enabled · Alert below ${K(a.threshold_usd)}`:l==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=l,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Ee;return e[25]!==je||e[26]!==be?(Ee=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Ee):Ee=e[27],Ee}let _;e[28]!==P?(_=s.jsx("p",{className:"text-xs font-medium text-foreground",children:P}),e[28]=P,e[29]=_):_=e[29];let E;e[30]!==D?(E=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:D}),e[30]=D,e[31]=E):E=e[31];let T;e[32]!==_||e[33]!==E?(T=s.jsxs("div",{children:[_,E]}),e[32]=_,e[33]=E,e[34]=T):T=e[34];let L;e[35]!==d?(L=s.jsx(De,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=L):L=e[36];let G;e[37]!==T||e[38]!==L?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[T,L]}),e[37]=T,e[38]=L,e[39]=G):G=e[39];const V=!d&&"opacity-50 pointer-events-none";let R;e[40]!==V?(R=ue("flex flex-col gap-3 transition-opacity",V),e[40]=V,e[41]=R):R=e[41];const z=l==="postpaid"?"Notify at":"Notify below";let $;e[42]!==z?($=s.jsx(_e,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:z}),e[42]=z,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Pe,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(_e,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>h(X.target.value),e[52]=ee):ee=e[52];let W;e[53]!==f?(W=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Pe,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=W):W=e[54];let F;e[55]!==U||e[56]!==W?(F=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,W]}),e[55]=U,e[56]=W,e[57]=F):F=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==R||e[61]!==F||e[62]!==Q?(se=s.jsxs("div",{className:R,children:[F,Q]}),e[60]=R,e[61]=F,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==x?(B=x&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=x,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(de,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=N||!A,te=N?"Saving...":"Save Alert";let le;e[67]!==C||e[68]!==re||e[69]!==te?(le=s.jsx(de,{size:"sm",className:"h-7 text-xs",onClick:C,disabled:re,children:te}),e[67]=C,e[68]=re,e[69]=te,e[70]=le):le=e[70];let ce;e[71]!==B||e[72]!==le?(ce=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=ce):ce=e[73];let I;return e[74]!==se||e[75]!==ce||e[76]!==G?(I=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,ce]}),e[74]=se,e[75]=ce,e[76]=G,e[77]=I):I=e[77],I}const pl={cost:{label:"Cost",color:"var(--chart-1)"}};function xl(){const t=O.c(54),{org:e}=me(),[r,a]=v.useState("7d");let l;t[0]!==r?(l=ut(r),t[0]=r,t[1]=l):l=t[1];const n=l;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=Ae(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==n?(m={widget:d,timeRange:n,skipCount:!0},t[5]=n,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let h;t[11]!==n?(h={widget:f,timeRange:n,skipCount:!0},t[11]=n,t[12]=h):h=t[12];let x;t[13]!==o||t[14]!==h?(x={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:h,staleTime:6e4,select:Ce},t[13]=o,t[14]=h,t[15]=x):x=t[15];const{data:p}=oe(x);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title",limit:10}},t[16]=g):g=t[16];let y;t[17]!==n?(y={widget:g,timeRange:n,skipCount:!0},t[17]=n,t[18]=y):y=t[18];let w;t[19]!==o||t[20]!==y?(w={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=w):w=t[21];const{data:j}=oe(w);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let S;t[24]!==b?(S=b.map(jl),t[24]=b,t[25]=S):S=t[25];const N=S;let A;if(t[26]!==p?.value||t[27]!==N||t[28]!==j?.groups||t[29]!==u?.timeseries||t[30]!==r){const k=(u?.timeseries??[]).reduce(bl,0),C=p?.value??0,P=(j?.groups??[]).filter(yl).sort(vl).slice(0,5),D=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let _;t[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=_):_=t[32];const E=K(k);let T;t[33]!==E?(T=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:E}),t[33]=E,t[34]=T):T=t[34];let L;t[35]!==D?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:D}),t[35]=D,t[36]=L):L=t[36];let G;t[37]!==T||t[38]!==L?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[T,L]}),t[37]=T,t[38]=L,t[39]=G):G=t[39];let V;t[40]!==C?(V=C.toLocaleString(),t[40]=C,t[41]=V):V=t[41];let R;t[42]!==V?(R=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[V," tool calls"]}),t[42]=V,t[43]=R):R=t[43];let z;t[44]!==G||t[45]!==R?(z=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,G,R]}),t[44]=G,t[45]=R,t[46]=z):z=t[46];let $;t[47]!==r?($=s.jsx(ds,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==z||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[z,$]}),t[49]=z,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==N?(H=N.length>0?s.jsx(La,{config:pl,className:"h-[200px] w-full",children:s.jsxs(al,{data:N,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Jt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ta,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(is,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:gl}),s.jsx(za,{content:s.jsx($a,{formatter:hl})}),s.jsx(ns,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=N,t[53]=H):H=t[53],A=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,P.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:P.map((M,U)=>{const q=k>0?Math.min(M.value/k*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:K(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=N,t[28]=j?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=A}else A=t[31];return A}function hl(t){return K(t)}function gl(t){return`$${t}`}function vl(t,e){return e.value-t.value}function yl(t){return t.value>0}function bl(t,e){return t+e.value}function jl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function Nl(){const t=O.c(6),[e,r]=v.useState(rl);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),ll(m)},t[0]=a):a=t[0];const l=a;let n,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=n,t[2]=i):(n=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[n,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>l(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function Qe(t){const e=O.c(20),{label:r,value:a,subValue:l,maxValue:n,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=n>0?Math.min(m/n*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const h=`${c}%`;let x;e[6]!==h?(x={width:h},e[6]=h,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==x?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:x})}),e[8]=f,e[9]=x,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==l?(y=l&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:l}),e[13]=l,e[14]=y):y=e[14];let w;return e[15]!==u||e[16]!==p||e[17]!==g||e[18]!==y?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[u,p,g,y]}),e[15]=u,e[16]=p,e[17]=g,e[18]=y,e[19]=w):w=e[19],w}function Xe(t){const e=O.c(8),{title:r,children:a,empty:l}=t;let n;e[0]!==r?(n=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=n):n=e[1];let i;e[2]!==a||e[3]!==l?(i=l?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==n||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7],o}const At={"7d":"7 days","30d":"30 days","90d":"90 days"};function ds(t){const e=O.c(4),{period:r,onPeriodChange:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Object.keys(At),e[0]=l):l=e[0];let n;return e[1]!==a||e[2]!==r?(n=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:l.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:At[i]},i))}),e[1]=a,e[2]=r,e[3]=n):n=e[3],n}function kt(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,l)=>l.cost-a.cost)}function Sl(){const t=O.c(27),{org:e}=me(),[r,a]=v.useState("7d"),l=ut(r),{data:n}=Ua(),i=n?.data?.members??[],o=new Map(i.map(Pl));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=Ae(d),c=I=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:I.fn,...I.groupByColumn&&{groupByColumn:I.groupByColumn},...I.limit&&{limit:I.limit}}},timeRange:l,skipCount:!0},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title",limit:20})),{data:h,isLoading:x}=oe(c({fn:"count_all",groupByColumn:"connection_title",limit:20})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id",limit:20})),{data:y,isLoading:w}=oe(c({fn:"count_all",groupByColumn:"user_id",limit:20})),{data:j,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name",limit:20}));let S;t[2]===Symbol.for("react.memo_cache_sentinel")?(S={fn:"count_all",groupByColumn:"tool_name",limit:20},t[2]=S):S=t[2];const{data:N,isLoading:A}=oe(c(S));if(f||x||g||w||b||A){let I;t[3]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ne,{className:"h-8 w-48"}),t[3]=I):I=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[I,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(_l)})]}),t[4]=X):X=t[4],X}const C=kt(u?.groups??[],h?.groups??[]),P=kt(p?.groups??[],y?.groups??[]).map(I=>({...I,key:o.get(I.key)??I.key})),D=N?.groups??[],_=new Map((j?.groups??[]).map(kl)),E=D.map(I=>({name:I.key,calls:I.value,cost:_.get(I.key)??0})).sort(Al).slice(0,20),T=C.reduce(Cl,0),L=C.reduce(wl,0),G=C[0]?.cost??1,V=P[0]?.cost??1,R=E[0]?.calls??1;let z;t[5]!==r?(z=s.jsx(ds,{period:r,onPeriodChange:a}),t[5]=r,t[6]=z):z=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=C.length===0,H=C.slice(0,8).map(I=>s.jsx(Qe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},I.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Xe,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=P.length===0,ee=P.slice(0,8).map(I=>s.jsx(Qe,{label:I.key,value:K(I.cost),subValue:`${I.calls.toLocaleString()} calls`,maxValue:V,color:"bg-chart-4"},I.key));let W;t[12]!==ee?(W=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=W):W=t[13];let F;t[14]!==W||t[15]!==q?(F=s.jsx(Xe,{title:"Cost by User",empty:q,children:W}),t[14]=W,t[15]=q,t[16]=F):F=t[16];const Q=Xe,se="Top Tools",B=E.length===0,ae="space-y-2.5",re=E.slice(0,8).map(I=>s.jsx(Qe,{label:I.name,value:I.calls.toLocaleString(),subValue:I.cost>0?K(I.cost):void 0,maxValue:R,color:"bg-chart-3"},I.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let ce;return t[23]!==F||t[24]!==le||t[25]!==U?(ce=s.jsxs("div",{className:$,children:[U,F,le]}),t[23]=F,t[24]=le,t[25]=U,t[26]=ce):ce=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:K(T)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:L.toLocaleString()})]})]}),z]}),ce]})}function wl(t,e){return t+e.calls}function Cl(t,e){return t+e.cost}function Al(t,e){return e.calls-t.calls}function kl(t){return[t.key,t.value]}function _l(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Pl(t){return[t.userId,t.user.name??t.user.email]}function Il(t,e){const r=new Map;for(const a of t){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const n=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(n)??{cost:0,calls:0};r.set(n,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,l])=>({month:a,...l})).reverse()}function El(){const t=O.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let l;t[1]!==e.id?(l={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=l):l=t[2];const n=Ae(l);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a,skipCount:!0},t[3]=i):i=t[3];let o;t[4]!==n?(o={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=n,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a,skipCount:!0},t[6]=c):c=t[6];let u;t[7]!==n?(u={client:n,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=n,t[8]=u):u=t[8];const{data:f,isLoading:h}=oe(u);if(m||h){let S;return t[9]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=S):S=t[9],S}let x,p,g,y,w;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const S=Il(d?.timeseries??[],f?.timeseries??[]);w="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=x):x=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=S.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:S.map(Ol)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=x,t[13]=p,t[14]=g,t[15]=y,t[16]=w}else x=t[12],p=t[13],g=t[14],y=t[15],w=t[16];let j;t[19]!==p||t[20]!==g||t[21]!==y?(j=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=j):j=t[22];let b;return t[23]!==x||t[24]!==j||t[25]!==w?(b=s.jsxs("div",{className:w,children:[x,j]}),t[23]=x,t[24]=j,t[25]=w,t[26]=b):b=t[26],b}function Ol(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:K(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Dl(t){const e=O.c(31),{connectionId:r}=t,{org:a}=me(),[l,n]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=Ae(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ll},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let P;return e[6]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=P):P=e[6],P}if(!c)return null;const f=c.limit.remaining??0,h=c.limit.total??0,x=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let w;e[7]!==c.alert?(w=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=w):w=e[8];const j=w,b=c.limit,S=p==="postpaid"&&(h==null||h===0);let N;e[9]!==j||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==h||e[17]!==x?(N=p==="postpaid"?s.jsx(ml,{usage:x,limit:b,limitPeriod:g,onConfigureLimit:()=>n(!0),connectionId:r,alert:j}):s.jsx(fl,{available:f,total:h,estimation:y,onAddCredit:()=>n(!0),connectionId:r,alert:j}),e[9]=j,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=h,e[17]=x,e[18]=N):N=e[18];let A;e[19]!==S?(A=S&&s.jsx(Nl,{}),e[19]=S,e[20]=A):A=e[20];let k;e[21]!==p||e[22]!==r||e[23]!==l||e[24]!==g||e[25]!==h?(k=s.jsx(dl,{open:l,onOpenChange:n,connectionId:r,currentLimitUsd:h,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=l,e[24]=g,e[25]=h,e[26]=k):k=e[26];let C;return e[27]!==N||e[28]!==A||e[29]!==k?(C=s.jsxs(s.Fragment,{children:[N,A,k]}),e[27]=N,e[28]=A,e[29]=k,e[30]=C):C=e[30],C}function Ll(t){return t.structuredContent}function Tl(t){const e=O.c(20),{gatewayConnectionId:r}=t,[a,l]=v.useState("summary");let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Ba,{variant:"underline",children:[s.jsx(He,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(He,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(He,{value:"history",variant:"underline",children:"History"})]}),e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&s.jsx(Dl,{connectionId:r}),e[2]=r,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(xl,{}),e[4]=d):d=e[4];let m;e[5]!==o?(m=s.jsxs(qe,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[o,d]}),e[5]=o,e[6]=m):m=e[6];let c;e[7]!==a?(c=a==="breakdown"&&s.jsx(Sl,{}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==c?(u=s.jsx(qe,{value:"breakdown",className:"pt-2",children:c}),e[9]=c,e[10]=u):u=e[10];let f;e[11]!==a?(f=a==="history"&&s.jsx(El,{}),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(qe,{value:"history",className:"pt-2",children:f}),e[13]=f,e[14]=h):h=e[14];let x;return e[15]!==a||e[16]!==m||e[17]!==u||e[18]!==h?(x=s.jsxs(s.Fragment,{children:[n,s.jsxs(Ga,{value:a,onValueChange:l,variant:"underline",children:[i,m,u,h]})]}),e[15]=a,e[16]=m,e[17]=u,e[18]=h,e[19]=x):x=e[19],x}function zl(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function $l(){const t=O.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Ml extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx($l,{}):this.props.children}}function Bl(){const t=O.c(4),e=Ra();let r;t[0]!==e?(r=e.find(Gl),t[0]=e,t[1]=r):r=t[1];const l=r?.id??null;let n;return t[2]!==l?(n=s.jsx(Tl,{gatewayConnectionId:l}),t[2]=l,t[3]=n):n=t[3],n}function Gl(t){return Ka(t,Va)}function Wl(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Ml,{children:s.jsx(v.Suspense,{fallback:s.jsx(zl,{}),children:s.jsx(Bl,{})})})}),t[0]=e):e=t[0],e}function us(){const t=O.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Fl(t){const e=O.c(14),{projectSlug:r,children:a}=t,{org:l}=me(),{data:n,isLoading:i}=Et(l.id,r);if(i||!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(us,{}),e[0]=u):u=e[0],u}const o=r===Ie;let d;e[1]!==n.description||e[2]!==n.enabledPlugins||e[3]!==n.id||e[4]!==n.name||e[5]!==n.organizationId||e[6]!==n.slug||e[7]!==n.ui||e[8]!==o?(d={id:n.id,organizationId:n.organizationId,slug:n.slug,name:n.name,description:n.description,enabledPlugins:n.enabledPlugins,ui:n.ui,isOrgAdmin:o},e[1]=n.description,e[2]=n.enabledPlugins,e[3]=n.id,e[4]=n.name,e[5]=n.organizationId,e[6]=n.slug,e[7]=n.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==l?(c=s.jsx(It,{org:l,project:m,children:a}),e[10]=a,e[11]=m,e[12]=l,e[13]=c):c=e[13],c}function Rl(t){const e=O.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ha,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"org.general":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(tr,{}),e[2]=a):a=e[2],a}case"org.plugins":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fl,{projectSlug:Ie,children:s.jsx(Fs,{})}),e[3]=a):a=e[3],a}case"org.ai-providers":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ns,{}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Wl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function Ul(){const t=O.c(24),{isOpen:e,activeSection:r,open:a,close:l}=js();let n;t[0]!==l?(n=y=>!y&&l(),t[0]=l,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ot,{className:"sr-only",children:"Settings"}),t[2]=i):i=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[3]=o):o=t[3];let d;t[4]!==r||t[5]!==a?(d=s.jsx(v.Suspense,{fallback:o,children:s.jsx(Ya,{activeSection:r,onNavigate:a})}),t[4]=r,t[5]=a,t[6]=d):d=t[6];let m,c;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ys,{size:16}),c=s.jsx("span",{className:"sr-only",children:"Close"}),t[7]=m,t[8]=c):(m=t[7],c=t[8]);let u;t[9]!==l?(u=s.jsxs("button",{type:"button",onClick:l,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[m,c]}),t[9]=l,t[10]=u):u=t[10];let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(us,{}),t[11]=f):f=t[11];let h;t[12]!==r?(h=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:f,children:s.jsx(Rl,{section:r})})}),t[12]=r,t[13]=h):h=t[13];let x;t[14]!==u||t[15]!==h?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[u,h]}),t[14]=u,t[15]=h,t[16]=x):x=t[16];let p;t[17]!==d||t[18]!==x?(p=s.jsxs(Dt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:[i,s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[d,x]})]}),t[17]=d,t[18]=x,t[19]=p):p=t[19];let g;return t[20]!==e||t[21]!==n||t[22]!==p?(g=s.jsx(Lt,{open:e,onOpenChange:n,children:p}),t[20]=e,t[21]=n,t[22]=p,t[23]=g):g=t[23],g}function Kl(t){const e=O.c(12),{projectSlug:r,orgSlug:a,error:l}=t,n=at();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==l.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:l.message}),e[3]=l.message,e[4]=d):d=e[4];let m;e[5]!==n||e[6]!==a?(m=s.jsx(de,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[5]=n,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Vl(t){const e=O.c(9),{projectSlug:r,orgSlug:a}=t,l=at();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=n):n=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==l||e[4]!==a?(o=s.jsx(de,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ie}}),children:"Go to organization home"}),e[3]=l,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[n,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Yl(){const t=O.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=xs(e),{org:a}=me(),l=r.org,n=r.project,{data:i,isLoading:o,error:d}=Et(a.id,n);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ze,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==l||t[4]!==n?(p=s.jsx(Kl,{projectSlug:n,orgSlug:l,error:d}),t[2]=d,t[3]=l,t[4]=n,t[5]=p):p=t[5],p}if(!i){let p;return t[6]!==l||t[7]!==n?(p=s.jsx(Vl,{projectSlug:n,orgSlug:l}),t[6]=l,t[7]=n,t[8]=p):p=t[8],p}const m=i.slug===Ie;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,h;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(hs,{})}),h=s.jsx(Ul,{}),t[18]=f,t[19]=h):(f=t[18],h=t[19]);let x;return t[20]!==u||t[21]!==a?(x=s.jsxs(It,{org:a,project:u,children:[f,h]}),t[20]=u,t[21]=a,t[22]=x):x=t[22],x}function si(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(Ze,{}),children:s.jsx(Yl,{})}),t[0]=e):e=t[0],e}export{si as default};
|