decocms 3.79.2 → 3.80.0
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-Diz6uT7Y.js → AlertCircle-CzPpSV3W.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bo4YThIl.js → ArrowUpRight-BefNTATY.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSFt0_RZ.js → CheckCircle-BRNW9lmT.js} +1 -1
- package/dist/client/assets/{ChevronDown-C_njLrOU.js → ChevronDown-Di-ZHzN-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByQFERqp.js → ChevronLeft-ByolOLbh.js} +1 -1
- package/dist/client/assets/{ChevronRight-D1duQehP.js → ChevronRight-CmB8MBzZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-_gM_dQkt.js → ChevronUp-BurUkCqE.js} +1 -1
- package/dist/client/assets/{DotsVertical-BJnhQ8u0.js → DotsVertical-Dsznav3Y.js} +1 -1
- package/dist/client/assets/{Eye-SUXNGsVY.js → Eye-B8NUm9Br.js} +1 -1
- package/dist/client/assets/{FilterLines-CxIQYlMz.js → FilterLines-DMbodALc.js} +1 -1
- package/dist/client/assets/{Globe01-CNw0uMhK.js → Globe01-BG9Wm5DJ.js} +1 -1
- package/dist/client/assets/{Globe04-B24hCYmg.js → Globe04-Fg_TSPLj.js} +1 -1
- package/dist/client/assets/{HardDrive-IPJJMMij.js → HardDrive-BLr46_IN.js} +1 -1
- package/dist/client/assets/{Key01-CES8n-fG.js → Key01-Dc0MTS9j.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3mZzNi0.js → LayoutLeft-nNhAa0Dy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B8zRpPza.js → LinkExternal01-D0OVTAOa.js} +1 -1
- package/dist/client/assets/{Monitor01-Uh-3HvZI.js → Monitor01-D_VMj6ZB.js} +1 -1
- package/dist/client/assets/{Palette-Du66341h.js → Palette-BmXFbt3l.js} +1 -1
- package/dist/client/assets/{Play-CVoFjR5I.js → Play-CAiQqhjZ.js} +1 -1
- package/dist/client/assets/{Plus-DoMNANl8.js → Plus-DHDiWYHk.js} +1 -1
- package/dist/client/assets/{SearchMd-B-bL1wjq.js → SearchMd-DaWHy1GV.js} +1 -1
- package/dist/client/assets/{Settings02-BvivcyYL.js → Settings02-B7jENSJZ.js} +1 -1
- package/dist/client/assets/{Shield01-BewRt7sw.js → Shield01-YoAzrA51.js} +1 -1
- package/dist/client/assets/{Star01-Ds91SJzA.js → Star01-CaB7lNB9.js} +1 -1
- package/dist/client/assets/{Stars01-PS518Jif.js → Stars01-a6WqibZn.js} +1 -1
- package/dist/client/assets/{Stars02-CVb_b-OZ.js → Stars02-D2Vky1vN.js} +1 -1
- package/dist/client/assets/{Sun-tLN4vA6M.js → Sun-vyxrPcie.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-vo5MpXEz.js → SwitchHorizontal01-C3K-vKiU.js} +1 -1
- package/dist/client/assets/{Tool01-BgzvuPeY.js → Tool01-CTw8qR4v.js} +1 -1
- package/dist/client/assets/{Trash01-D84eyfFz.js → Trash01-BzTEx-hS.js} +1 -1
- package/dist/client/assets/{Upload01-BA5iKtAl.js → Upload01-DwgHgRix.js} +1 -1
- package/dist/client/assets/{User01-CeCQHgwg.js → User01-BtO-AoKy.js} +1 -1
- package/dist/client/assets/{Users01-DtmLcsFN.js → Users01-BRTza8nY.js} +1 -1
- package/dist/client/assets/{Users03-ClWrctLP.js → Users03-9LUo_raC.js} +1 -1
- package/dist/client/assets/{X-2HGWB7Oo.js → X-1BuEzBGR.js} +1 -1
- package/dist/client/assets/{XCircle-B88UxHjD.js → XCircle-DtHr5hnB.js} +1 -1
- package/dist/client/assets/{XClose-DcfEQwVh.js → XClose-qpXD94Yo.js} +1 -1
- package/dist/client/assets/{Zap-BeB31T8Y.js → Zap-DluXKGP1.js} +1 -1
- package/dist/client/assets/{ZapSquare-BfSTQonf.js → ZapSquare-C2q_71C5.js} +1 -1
- package/dist/client/assets/{ZoomOut-Csc4IU4b.js → ZoomOut-DHX-bR9F.js} +1 -1
- package/dist/client/assets/{access-gate-BI-B2IAv.js → access-gate-CGKEhEok.js} +1 -1
- package/dist/client/assets/add-section-modal-SzJO4niJ.js +1 -0
- package/dist/client/assets/{agent-icon-BMQHBhP6.js → agent-icon-B8qJNw4_.js} +1 -1
- package/dist/client/assets/{agents-list-XJ_b0Boo.js → agents-list-BCVql_rD.js} +1 -1
- package/dist/client/assets/{ai-providers-BT9tXzcJ.js → ai-providers-DfbrzvnV.js} +1 -1
- package/dist/client/assets/{alert-BFF74cGy.js → alert-BdFRtqYC.js} +1 -1
- package/dist/client/assets/{alert-dialog-0uOi3HqZ.js → alert-dialog-CSRFWtbt.js} +3 -3
- package/dist/client/assets/app-editor-CSxGjHmN.js +1 -0
- package/dist/client/assets/{auth-CCI_mhgC.js → auth-DOooeHhC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFuEeSui.js → auth-catchall-esDJNOF7.js} +1 -1
- package/dist/client/assets/{auth-entry-BE0f6I0U.js → auth-entry-CJkDGWB9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DTKSSrMT.js → auth-split-layout-BHOeLJSB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-eSHjAd3t.js → authenticate-and-persist-oauth-CAo_oHNJ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ct9jaHYX.js → automation-list-row-CBS-1Qac.js} +1 -1
- package/dist/client/assets/automation-runs-BhCrA9zN.js +1 -0
- package/dist/client/assets/{automations-DAlCMK2H.js → automations-DgOam79q.js} +1 -1
- package/dist/client/assets/{avatar-CtVVLapD.js → avatar-BnBqk-2k.js} +1 -1
- package/dist/client/assets/{badge-BFvLiE20.js → badge-CpxlbcB7.js} +1 -1
- package/dist/client/assets/{block-document-CZwjF0EN.js → block-document-DJ0g8qfo.js} +2 -2
- package/dist/client/assets/{brand-context-Dc4UEvfb.js → brand-context-COIa0n8O.js} +1 -1
- package/dist/client/assets/{buckets-CY1G8BoT.js → buckets-BINQS-Su.js} +1 -1
- package/dist/client/assets/{capability-load-error-CNUOCvDx.js → capability-load-error-HdFgr5IE.js} +1 -1
- package/dist/client/assets/{card-DZtTT5Es.js → card-DQnbTJFb.js} +1 -1
- package/dist/client/assets/category-editor-vCwJctBK.js +1 -0
- package/dist/client/assets/{chat-context-Dqu5Dj_J.js → chat-context-CmZjYRTw.js} +1 -1
- package/dist/client/assets/{checkbox-CHXOcnVE.js → checkbox-DokO2DXd.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BSe4zAji.js → cli-auth-success-NPtl5xjH.js} +1 -1
- package/dist/client/assets/collection-detail-DgzIzvmX.js +1 -0
- package/dist/client/assets/{collection-display-button-Dn_LJLmj.js → collection-display-button-hKaFuGbc.js} +1 -1
- package/dist/client/assets/{collection-search-D6nD206z.js → collection-search-9oxtR-cY.js} +1 -1
- package/dist/client/assets/{collection-tabs-cs02GObx.js → collection-tabs-CvHGsfW_.js} +1 -1
- package/dist/client/assets/{command-DhLgZpjn.js → command-Bw5g6PzP.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CTTgJmu9.js → commerce-onboarding-QQ9bqrwx.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DNAK4U2K.js → connect-desktop-dialog-BktLGd3J.js} +1 -1
- package/dist/client/assets/{connection-card-BwnCXxRf.js → connection-card-BZz5WDR5.js} +1 -1
- package/dist/client/assets/connection-detail-DNAdeiIH.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Csy5hutj.js → connection-form-helpers-CltinQul.js} +1 -1
- package/dist/client/assets/connections-BSiahnsQ.js +1 -0
- package/dist/client/assets/context-menu-ByPsUX7u.js +1 -0
- package/dist/client/assets/{decopilot-CLVJpS6M.js → decopilot-DjAEZRNX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-_mJQvJZ7.js → decopilot-sse-pool-R-AtQW2s.js} +1 -1
- package/dist/client/assets/{dialog-AE8ChAe3.js → dialog-L9SFsS1U.js} +1 -1
- package/dist/client/assets/{domain-settings-Dika0U17.js → domain-settings-BDbjH98X.js} +1 -1
- package/dist/client/assets/{drawer-Di9WrlRG.js → drawer-D-LP9Hh8.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ecBYljKf.js → dropdown-menu-ByaGrYAQ.js} +1 -1
- package/dist/client/assets/{empty-state-CegPWPc0.js → empty-state-BoeIt5Fh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BumzxLvt.js → extract-connection-data-Rczvmr_Y.js} +1 -1
- package/dist/client/assets/file-explorer-QNJW4EAt.js +2 -0
- package/dist/client/assets/{file-type-icon-BOraV8Gq.js → file-type-icon-C96ES1WD.js} +1 -1
- package/dist/client/assets/{files-7E0LjJ-5.js → files-CK2ZpMSb.js} +1 -1
- package/dist/client/assets/{form-teSq_9QK.js → form-Ci3Mfx5E.js} +1 -1
- package/dist/client/assets/{general-DCnSVDK9.js → general-Dt135lsN.js} +1 -1
- package/dist/client/assets/{github-repo-picker-LA1Jld2f.js → github-repo-picker-CLrsrBV_.js} +1 -1
- package/dist/client/assets/{hooks-DwlYXenh.js → hooks-BBwQx9Hj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-D3BPX6JW.js → import-from-deco-dialog-D3nDDNau.js} +1 -1
- package/dist/client/assets/{index-CKtGWWKI.js → index-28ylgXoe.js} +2 -2
- package/dist/client/assets/{index-DnokqHCE.js → index-B-wtw2cV.js} +3 -3
- package/dist/client/assets/{index-3BvM9m2F.js → index-BRqNUInJ.js} +1 -1
- package/dist/client/assets/{index-DJiEBchG.js → index-BYWWr4r7.js} +1 -1
- package/dist/client/assets/index-Bh2oT8fz.css +1 -0
- package/dist/client/assets/index-CuZWA4Jo.js +1 -0
- package/dist/client/assets/index-D4eNxtKO.js +503 -0
- package/dist/client/assets/{index-DR6YHYZo.js → index-DF_aAsrE.js} +1 -1
- package/dist/client/assets/{index-dCmm-GRp.js → index-DM3CipuA.js} +1 -1
- package/dist/client/assets/{index-C4YdUUl9.js → index-DUXTdmoE.js} +1 -1
- package/dist/client/assets/{index-UyzF2Wxm.js → index-DrM3Gy-E.js} +3 -3
- package/dist/client/assets/{index-DnjeTCJ0.js → index-Dtsr5F6p.js} +1 -1
- package/dist/client/assets/{index-BonkSf20.js → index-JnEot5Hj.js} +1 -1
- package/dist/client/assets/index-Y9nbouYw.js +1 -0
- package/dist/client/assets/{index-DnCrG3F_.js → index-_BBnqQdQ.js} +1 -1
- package/dist/client/assets/{index-redirect-CiKtg2BH.js → index-redirect-DmPoZnz_.js} +1 -1
- package/dist/client/assets/{input-CTZybS4f.js → input-BiM4A7Ep.js} +1 -1
- package/dist/client/assets/{integration-icon-CslqVkci.js → integration-icon-g_GK3RAr.js} +1 -1
- package/dist/client/assets/{label-Djcog1jo.js → label-CjJncELr.js} +1 -1
- package/dist/client/assets/{login-E5h2Z5UF.js → login-BOHERlR0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BcPuGj2k.js → mcp-oauth-CEKI9gHX.js} +1 -1
- package/dist/client/assets/{members-w9nno9lo.js → members-BRt8WHan.js} +1 -1
- package/dist/client/assets/{monaco-editor-DnGtg8Ra.js → monaco-editor-BiUexVQ3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BqgDsRP3.js → monitoring-stats-row-CwoDwl1p.js} +1 -1
- package/dist/client/assets/{oauth-callback-azsKM8N9.js → oauth-callback-BuVPnEYV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DUI7fLPI.js → oauth-callback-ai-provider-YJv6IQM9.js} +1 -1
- package/dist/client/assets/{onboarding-DQTGvP19.js → onboarding-CYpSkBDm.js} +1 -1
- package/dist/client/assets/{org-install-BIHuRdOB.js → org-install-DCy7wocy.js} +1 -1
- package/dist/client/assets/{org-layout-enkFWMsq.js → org-layout-RT_U7zH8.js} +1 -1
- package/dist/client/assets/{organization-choice-CqCgStKm.js → organization-choice-bTsrQb1b.js} +1 -1
- package/dist/client/assets/page-seo-form-oftq8ir_.js +1 -0
- package/dist/client/assets/page-seo-sheet-CAgRh54V.js +1 -0
- package/dist/client/assets/{popover-DG0h5msu.js → popover-CdhOYhn4.js} +1 -1
- package/dist/client/assets/post-editor-B3gQokNp.js +1 -0
- package/dist/client/assets/{preview-dialog-Bnu3vr0P.js → preview-dialog-vDgojfWg.js} +2 -2
- package/dist/client/assets/{primitives-BVa9_bXR.js → primitives-CPVg2JCk.js} +1 -1
- package/dist/client/assets/{profile-Dp5DSYPN.js → profile-C8hjNf5c.js} +1 -1
- package/dist/client/assets/project-app-view-CVZVC5T9.js +1 -0
- package/dist/client/assets/record-editor-BZDypwa5.js +1 -0
- package/dist/client/assets/registry-BSMljcPA.js +2 -0
- package/dist/client/assets/{registry-layout-DSIR5CP1.js → registry-layout-BuJ69l8z.js} +1 -1
- package/dist/client/assets/{require-capability-Cj0iYy81.js → require-capability-7xlqOMAl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-clm6boiC.js → required-auth-layout-DMkbzFqw.js} +1 -1
- package/dist/client/assets/{reset-password-B-IQNmbh.js → reset-password-CANGclZQ.js} +1 -1
- package/dist/client/assets/{roles-Cba1TfDM.js → roles-BsbFpQdA.js} +1 -1
- package/dist/client/assets/{save-status-CDIs_R_V.js → save-status-BZrjQZNL.js} +1 -1
- package/dist/client/assets/{scroll-area-BBReqUns.js → scroll-area-DaDHqFsI.js} +2 -2
- package/dist/client/assets/{search-input-D9asghaf.js → search-input-CA0juGKQ.js} +1 -1
- package/dist/client/assets/{secrets-CN8bUJoZ.js → secrets-2KI9BQIB.js} +1 -1
- package/dist/client/assets/sections-editor-DAz_riff.js +2 -0
- package/dist/client/assets/{select-CYFnhI-Q.js → select-lfhjFS6i.js} +1 -1
- package/dist/client/assets/{select-model-35S1fWTq.js → select-model-DhPTkTLZ.js} +1 -1
- package/dist/client/assets/seo-editor-qYixYUVP.js +1 -0
- package/dist/client/assets/{settings-layout-BBO5MmT3.js → settings-layout-D8_yU3Dv.js} +1 -1
- package/dist/client/assets/{settings-section-DOlV_atx.js → settings-section-uGwPOE8T.js} +1 -1
- package/dist/client/assets/{sheet-DALs-qBg.js → sheet-nKeubIDJ.js} +1 -1
- package/dist/client/assets/{shell-controls-B6QkcDFu.js → shell-controls-Nhg6txWq.js} +1 -1
- package/dist/client/assets/{shell-layout-Ch8BfEKU.js → shell-layout-DJP1UAvL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-RsrwOcS1.js → shell-route-loading-BQkX9uZV.js} +1 -1
- package/dist/client/assets/{sidebar-hZIrovG4.js → sidebar-BDxhgXc-.js} +1 -1
- package/dist/client/assets/{skeleton-BqZgigOh.js → skeleton-CQjs3VsL.js} +1 -1
- package/dist/client/assets/sortable.esm-DaR8hxU_.js +5 -0
- package/dist/client/assets/{sso-BXwKoXqN.js → sso-hQT21VNe.js} +1 -1
- package/dist/client/assets/{store-CRZGNrMb.js → store-BEmqzV80.js} +1 -1
- package/dist/client/assets/store-registry-BoeF7jFP.js +2 -0
- package/dist/client/assets/{studio-tools-C1AZbzwg.js → studio-tools-CAUx-JUt.js} +1 -1
- package/dist/client/assets/{switch-DRDIUTD7.js → switch-Vf_P6Fjw.js} +1 -1
- package/dist/client/assets/{table-tYYVDDAQ.js → table-Df43OI16.js} +1 -1
- package/dist/client/assets/{tabs-D__sk4iN.js → tabs-B7LOh75O.js} +1 -1
- package/dist/client/assets/{task-status-CftQiZKN.js → task-status-CNl7XTqg.js} +1 -1
- package/dist/client/assets/{textarea-DmmCVjU6.js → textarea-CoSni5ST.js} +1 -1
- package/dist/client/assets/{toggle-group-5CInie8P.js → toggle-group-Dpya1ElG.js} +1 -1
- package/dist/client/assets/{toolbar-Bm-rdLjh.js → toolbar-C-FtiPvy.js} +1 -1
- package/dist/client/assets/{tooltip-C7L4o0rn.js → tooltip-Cs_BNuMF.js} +1 -1
- package/dist/client/assets/{types-CppGS_VJ.js → types-GBPItn3L.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Deso-Vyj.js → use-ai-providers-Cyy4e6Er.js} +1 -1
- package/dist/client/assets/{use-automations-DdPVJNl5.js → use-automations-jx__re2k.js} +1 -1
- package/dist/client/assets/{use-capability-CGVlaZtI.js → use-capability-_e3uVe_7.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bp0qVbdD.js → use-clock-tick-g2v6P087.js} +1 -1
- package/dist/client/assets/{use-collections-CXeEMOwb.js → use-collections-B_GMLsdD.js} +1 -1
- package/dist/client/assets/{use-connection-DqvYiUe3.js → use-connection-DKt0DY8s.js} +1 -1
- package/dist/client/assets/{use-copy-H4KuRxx2.js → use-copy-CgtuLhVL.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp--tV5feR-.js → use-create-virtual-mcp-3Gcq1gem.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Ct9kek4B.js → use-debounced-autosave-EPMbx34N.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B2XplI5F.js → use-delete-connection-CWY-Tuh_.js} +1 -1
- package/dist/client/assets/{use-file-configs-CJ5VKJt7.js → use-file-configs-Ci1h3IZS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BpnVw1p2.js → use-infinite-scroll-Dt6SxdrG.js} +1 -1
- package/dist/client/assets/{use-join-requests-rgaNUN9B.js → use-join-requests-Dtt8rzJS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cv0jyhEU.js → use-mcp-client-lyJJArps.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CPZOOi8c.js → use-mcp-prompts-82Xtua4M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-z50pjVux.js → use-mcp-tools-CdHM3tvY.js} +1 -1
- package/dist/client/assets/{use-members-jM6HOjam.js → use-members-CR5Y6qBg.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CytgRfBH.js → use-navigate-to-agent-DKc1WVEH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjPrRX3t.js → use-org-auth-client-DyCA15LL.js} +1 -1
- package/dist/client/assets/{use-org-sso-QBVELOwd.js → use-org-sso-DzO_wPSE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DHxcYiQL.js → use-organization-roles-CfNQzskd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DPqJ7ETy.js → use-organization-settings-DmFrFel5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DQ1fpeHW.js → use-registry-connections-grv_p5nm.js} +1 -1
- package/dist/client/assets/{use-secrets-C3RMGjE2.js → use-secrets-DzWb-lJi.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BaJ0EN3G.js → use-status-sounds-CeAiKW9f.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMk0VP0I.js → use-view-mode-PWJQxDpL.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-iRRxKkRN.js → use-virtual-mcp-Bglvu7_H.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v9qNAGwf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Bu3QWDEr.js +1 -0
- package/dist/client/assets/{variant-calendar-Cn9DL04u.js → variant-calendar-BwPeBwqf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DnLJJSFI.js → view-mode-toggle-B_Gx2-J_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BBef0kzW.js +0 -1
- package/dist/client/assets/app-editor-DB3LZKk9.js +0 -1
- package/dist/client/assets/automation-runs-CNqGFhXQ.js +0 -1
- package/dist/client/assets/calendar-Cof0eQRR.js +0 -1
- package/dist/client/assets/category-editor-CqVdn-A-.js +0 -1
- package/dist/client/assets/collection-detail-CGFO7Nxa.js +0 -1
- package/dist/client/assets/connection-detail-jhV3T5Vf.js +0 -1
- package/dist/client/assets/connections-RSAnGIGn.js +0 -1
- package/dist/client/assets/context-menu-CwmbYH1X.js +0 -1
- package/dist/client/assets/file-explorer-pkuer-wd.js +0 -2
- package/dist/client/assets/image-field-ycul5miD.js +0 -1
- package/dist/client/assets/index-BB0hMJf7.js +0 -1
- package/dist/client/assets/index-Bcj3iVpr.js +0 -1
- package/dist/client/assets/index-CqVkj8du.js +0 -502
- package/dist/client/assets/index-wICsQ-2V.css +0 -1
- package/dist/client/assets/page-seo-form-CLI6M5cV.js +0 -1
- package/dist/client/assets/page-seo-sheet-ClPikk0g.js +0 -1
- package/dist/client/assets/post-editor-BVwj0umw.js +0 -1
- package/dist/client/assets/project-app-view-r7Nmocf7.js +0 -1
- package/dist/client/assets/record-editor-DoT_RQtf.js +0 -1
- package/dist/client/assets/registry-Do0X3IQW.js +0 -2
- package/dist/client/assets/save-referenced-block-BJospazn.js +0 -1
- package/dist/client/assets/schema-form-B6Wg-hy1.js +0 -2
- package/dist/client/assets/sections-editor-BojFR4GO.js +0 -2
- package/dist/client/assets/seo-editor-DBNUZ0fG.js +0 -1
- package/dist/client/assets/sortable.esm-BtnRUgUU.js +0 -5
- package/dist/client/assets/store-registry-C5xb_cZe.js +0 -2
- package/dist/client/assets/use-deco-credits-rzfxapgg.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DVN2QYOz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKCXXvPp.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as E,c as oe,j as t,a2 as Ye,i as ce,v as be,b as _e,u as Ze,a as Ne,p as et,s as tt,L as nt,E as st,C as ot,B as U,q as te,m as it,l as de,t as W,K as rt}from"./index-DrM3Gy-E.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-Rczvmr_Y.js";import{C as dt}from"./collection-display-button-hKaFuGbc.js";import{S as mt}from"./search-input-CA0juGKQ.js";import{C as ut}from"./collection-tabs-CvHGsfW_.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-BZz5WDR5.js";import{E as gt}from"./empty-state-BoeIt5Fh.js";import{I as xt}from"./integration-icon-g_GK3RAr.js";import{P as ue}from"./index-BYWWr4r7.js";import{u as ft,D as jt}from"./use-delete-connection-CWY-Tuh_.js";import{u as ye}from"./use-capability-_e3uVe_7.js";import{u as yt}from"./use-infinite-scroll-Dt6SxdrG.js";import{u as Ct}from"./use-view-mode-PWJQxDpL.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-CSRFWtbt.js";import{C as Fe}from"./checkbox-DokO2DXd.js";import{d as Me,c as ze,D as Ve,a as Ee,b as Be,e as Ke}from"./dialog-L9SFsS1U.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-D-LP9Hh8.js";import{u as At}from"./tooltip-Cs_BNuMF.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-ByaGrYAQ.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-Ci3Mfx5E.js";import{I as ie}from"./input-BiM4A7Ep.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-lfhjFS6i.js";import{T as $t}from"./textarea-CoSni5ST.js";import{b as We,u as Lt}from"./use-connection-DKt0DY8s.js";import{u as Ot}from"./use-virtual-mcp-Bglvu7_H.js";import{u as Ft}from"./studio-tools-CAUx-JUt.js";import{a4 as Mt,ae as zt,C as Vt,z as Et}from"./agent-icon-B8qJNw4_.js";import{n as ge}from"./XCircle-DtHr5hnB.js";import{a as Xe}from"./DotsVertical-Dsznav3Y.js";import{s as qe}from"./Eye-B8NUm9Br.js";import{s as je}from"./Star01-CaB7lNB9.js";import{s as Ge}from"./Plus-DHDiWYHk.js";import{s as Qe}from"./Trash01-BzTEx-hS.js";import{s as Je}from"./XClose-qpXD94Yo.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-CltinQul.js";import{a as Wt}from"./authenticate-and-persist-oauth-CAo_oHNJ.js";import"./use-mcp-client-lyJJArps.js";import"./auth-DOooeHhC.js";import"./SwitchHorizontal01-C3K-vKiU.js";import"./ChevronUp-BurUkCqE.js";import"./view-mode-toggle-B_Gx2-J_.js";import"./badge-CpxlbcB7.js";import"./SearchMd-DaWHy1GV.js";import"./use-registry-connections-grv_p5nm.js";import"./use-organization-settings-DmFrFel5.js";import"./useInfiniteQuery-v9qNAGwf.js";import"./card-DQnbTJFb.js";import"./sidebar-BDxhgXc-.js";import"./LayoutLeft-nNhAa0Dy.js";import"./sheet-nKeubIDJ.js";import"./X-1BuEzBGR.js";import"./ChevronRight-CmB8MBzZ.js";import"./label-CjJncELr.js";import"./ChevronDown-Di-ZHzN-.js";import"./use-collections-B_GMLsdD.js";import"./AlertCircle-CzPpSV3W.js";import"./Tool01-CTw8qR4v.js";import"./Settings02-B7jENSJZ.js";import"./ArrowUpRight-BefNTATY.js";import"./ZapSquare-C2q_71C5.js";import"./Users03-9LUo_raC.js";import"./CheckCircle-BRNW9lmT.js";import"./ChevronLeft-ByolOLbh.js";import"./Stars02-D2Vky1vN.js";import"./ZoomOut-DHX-bR9F.js";import"./Globe01-BG9Wm5DJ.js";import"./FilterLines-DMbodALc.js";import"./Globe04-Fg_TSPLj.js";import"./HardDrive-BLr46_IN.js";import"./Key01-Dc0MTS9j.js";import"./LinkExternal01-D0OVTAOa.js";import"./Monitor01-D_VMj6ZB.js";import"./Sun-vyxrPcie.js";import"./Palette-BmXFbt3l.js";import"./Play-CAiQqhjZ.js";import"./Shield01-YoAzrA51.js";import"./Stars01-a6WqibZn.js";import"./Upload01-DwgHgRix.js";import"./User01-BtO-AoKy.js";import"./Users01-BRTza8nY.js";import"./Zap-DluXKGP1.js";import"./mcp-oauth-CEKI9gHX.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:c=>b(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Fs(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Fs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as a,dF as y,P as T,Q as v,dG as O,dH as j,dI as G,dJ as $,bQ as k,dK as U,dL as _,U as D,dM as L,dN as z,dO as B,dP as F,dQ as H,dR as Q,dS as X,dT as K,dU as W,c as C,l as g}from"./index-DrM3Gy-E.js";var h="ContextMenu",[J]=D(h,[_]),u=_(),[Y,R]=J(h),N=n=>{const{__scopeContextMenu:e,children:o,onOpenChange:t,dir:r,modal:s=!0}=n,[d,c]=i.useState(!1),x=u(e),m=k(t),l=i.useCallback(f=>{c(f),m(f)},[m]);return a.jsx(Y,{scope:e,open:d,onOpenChange:l,modal:s,children:a.jsx(U,{...x,dir:r,open:d,onOpenChange:l,modal:s,children:o})})};N.displayName=h;var P="ContextMenuTrigger",b=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,disabled:t=!1,...r}=n,s=R(P,o),d=u(o),c=i.useRef({x:0,y:0}),x=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),m=i.useRef(0),l=i.useCallback(()=>window.clearTimeout(m.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return i.useEffect(()=>l,[l]),i.useEffect(()=>{t&&l()},[t,l]),a.jsxs(a.Fragment,{children:[a.jsx(y,{...d,virtualRef:x}),a.jsx(T.span,{"data-state":s.open?"open":"closed","data-disabled":t?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:t?n.onContextMenu:v(n.onContextMenu,p=>{l(),f(p),p.preventDefault()}),onPointerDown:t?n.onPointerDown:v(n.onPointerDown,M(p=>{l(),m.current=window.setTimeout(()=>f(p),700)})),onPointerMove:t?n.onPointerMove:v(n.onPointerMove,M(l)),onPointerCancel:t?n.onPointerCancel:v(n.onPointerCancel,M(l)),onPointerUp:t?n.onPointerUp:v(n.onPointerUp,M(l))})]})});b.displayName=P;var q="ContextMenuPortal",w=n=>{const{__scopeContextMenu:e,...o}=n,t=u(e);return a.jsx(G,{...t,...o})};w.displayName=q;var I="ContextMenuContent",S=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=R(I,o),s=u(o),d=i.useRef(!1);return a.jsx($,{...s,...t,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&d.current&&c.preventDefault(),d.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(d.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});S.displayName=I;var V="ContextMenuGroup",Z=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(L,{...r,...t,ref:e})});Z.displayName=V;var ee="ContextMenuLabel",te=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(z,{...r,...t,ref:e})});te.displayName=ee;var ne="ContextMenuItem",E=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(O,{...r,...t,ref:e})});E.displayName=ne;var oe="ContextMenuCheckboxItem",re=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(B,{...r,...t,ref:e})});re.displayName=oe;var ae="ContextMenuRadioGroup",se=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(F,{...r,...t,ref:e})});se.displayName=ae;var ie="ContextMenuRadioItem",ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(H,{...r,...t,ref:e})});ce.displayName=ie;var ue="ContextMenuItemIndicator",de=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(Q,{...r,...t,ref:e})});de.displayName=ue;var le="ContextMenuSeparator",A=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(j,{...r,...t,ref:e})});A.displayName=le;var xe="ContextMenuArrow",pe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(X,{...r,...t,ref:e})});pe.displayName=xe;var me="ContextMenuSubTrigger",fe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(K,{...r,...t,ref:e})});fe.displayName=me;var ve="ContextMenuSubContent",Ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(W,{...r,...t,ref:e,style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ce.displayName=ve;function M(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var Me=N,ge=b,he=w,_e=S,Re=E,Ne=A;function be(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(Me,{"data-slot":"context-menu",...o}),e[2]=o,e[3]=t):t=e[3],t}function we(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(ge,{"data-slot":"context-menu-trigger",...o}),e[2]=o,e[3]=t):t=e[3],t}function Ie(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(he,{children:a.jsx(_e,{"data-slot":"context-menu-content",className:r,...t})}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}function Se(n){const e=C.c(12);let o,t,r,s;e[0]!==n?({className:o,inset:t,variant:s,...r}=n,e[0]=n,e[1]=o,e[2]=t,e[3]=r,e[4]=s):(o=e[1],t=e[2],r=e[3],s=e[4]);const d=s===void 0?"default":s;let c;e[5]!==o?(c=g("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=c):c=e[6];let x;return e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==d?(x=a.jsx(Re,{"data-slot":"context-menu-item","data-inset":t,"data-variant":d,className:c,...r}),e[7]=t,e[8]=r,e[9]=c,e[10]=d,e[11]=x):x=e[11],x}function Ee(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-border -mx-1 my-1 h-px",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(Ne,{"data-slot":"context-menu-separator",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Se as C,Ee as a,we as b,Ie as c,be as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as L,aO as Ye,c as V,j as s,y as Oe,z as re,v as le,m as me,C as Ae,E as Te,d as ce,K as ee,t as J,B as Z,q as Q,p as Xe,l as de,k as Qe,b as Je,a2 as Ze,a6 as et}from"./index-
|
|
1
|
+
import{r as L,aO as Ye,c as V,j as s,y as Oe,z as re,v as le,m as me,C as Ae,E as Te,d as ce,K as ee,t as J,B as Z,q as Q,p as Xe,l as de,k as Qe,b as Je,a2 as Ze,a6 as et}from"./index-DrM3Gy-E.js";import{C as tt}from"./checkbox-DokO2DXd.js";import{I as ne}from"./input-BiM4A7Ep.js";import{d as st,b as it,c as nt,S as lt,a as ot}from"./select-lfhjFS6i.js";import{S as H}from"./skeleton-CQjs3VsL.js";import{b as ze,i as Re,c as rt,a as at,s as ct}from"./Settings02-B7jENSJZ.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-CTw8qR4v.js";import{i as ft}from"./Key01-Dc0MTS9j.js";import{i as Pe}from"./SearchMd-DaWHy1GV.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-Cyy4e6Er.js";import{S as ge,b as gt}from"./chat-context-CmZjYRTw.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-D_VMj6ZB.js";import{i as bt}from"./AlertCircle-CzPpSV3W.js";import{e as Le,d as yt,c as jt,D as St,a as Nt,b as kt}from"./dialog-L9SFsS1U.js";import{u as ue}from"./studio-tools-CAUx-JUt.js";import{i as wt}from"./ChevronRight-CmB8MBzZ.js";import{A as _t}from"./avatar-BnBqk-2k.js";import{S as ve,a as be,b as $e}from"./settings-section-uGwPOE8T.js";import{s as Fe}from"./Eye-B8NUm9Br.js";import{u as Ct,C as It}from"./connect-desktop-dialog-BktLGd3J.js";import{t as ye}from"./ChevronDown-Di-ZHzN-.js";import{t as Et}from"./Stars01-a6WqibZn.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function je(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Mt=(i,e)=>Math.abs(i-e)<1.01,Ot=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Se=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},At=i=>i,Tt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},zt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(Se(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Se(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Ne={passive:!0},ke=typeof window>"u"?!0:"onscrollend"in window,Rt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&ke?()=>{}:Ot(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=d=>()=>{const{horizontal:f,isRtl:p}=i.options;l=f?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(l,d)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,Ne);const u=i.options.useScrollendEvent&&ke;return u&&t.addEventListener("scrollend",c,Ne),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",c)}},Pt=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Lt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class $t{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:At,rangeExtractor:Tt,onChange:()=>{},measureElement:Pt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},u)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let m=0;m<d;m++){const b=f[m];b&&(p[b.lane]=m)}for(let m=d;m<t;m++){const b=o(m),g=this.laneAssignments.get(m);let y,j;const _=c==="estimate"||u.has(b);if(g!==void 0&&this.options.lanes>1){y=g;const v=p[y],k=v!==void 0?f[v]:void 0;j=k?k.end+this.options.gap:n+l}else{const v=this.options.lanes===1?f[m-1]:this.getFurthestMeasurement(f,m);j=v?v.end+this.options.gap:n+l,y=v?v.lane:m%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(m,y)}const N=u.get(b),I=typeof N=="number"?N:this.options.estimateSize(m),E=j+I;f[m]={index:m,start:j,size:I,end:E,key:b,lane:y},p[y]=m}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ft({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return je(n[Ke(0,n.length-1,l=>je(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Mt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ke=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ft({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ke(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(d=>d<t+e);){const d=i[a];c[d.lane]=d.end,a++}const u=Array(n).fill(t+e);for(;r>=0&&u.some(d=>d>=t);){const d=i[r];u[d.lane]=d.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const we=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Kt({useFlushSync:i=!0,...e}){const t=L.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Ye.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=L.useState(()=>new $t(n));return l.setOptions(n),we(()=>l._didMount(),[]),we(()=>l._willUpdate()),l}function Dt(i){return Kt({observeElementRect:zt,observeElementOffset:Rt,scrollToFn:Lt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function _e(i){if(i)return ae.find(e=>e.id===i)}const Ce=4;function oe(i){const e=V.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx($e,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function De(i){const e=V.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Ht),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,anthropic:1,google:2},e[2]=a):a=e[2];const c=a;let u;if(e[3]!==n||e[4]!==t){let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=(x,O)=>{const A=c[x.id]??Number.MAX_SAFE_INTEGER,z=c[O.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=N):N=e[6];const I=t.filter(Vt).sort(N);let E;e[7]!==t?(E=t.find(Wt),e[7]=t,e[8]=E):E=e[8];const v=E;let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=ae.find(Bt),e[9]=k):k=e[9];const C=k;let w;e[10]!==n?(w=x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"provider",provider:x})},x.id),e[10]=n,e[11]=w):w=e[11];let h,S;e[12]!==n||e[13]!==v?(h=v&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:C})},C.id)]:[],S=v?[...ae.filter(Ut).map(x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:x})},x.id)),s.jsx(oe,{logo:v.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:v,preset:null})},"custom")]:[],e[12]=n,e[13]=v,e[14]=h,e[15]=S):(h=e[14],S=e[15]),u=[...I.map(w),...h,...S],e[3]=n,e[4]=t,e[5]=u}else u=e[5];const d=u,f=d.length-Ce,p=!!l&&f>0;let m;e[16]!==d||e[17]!==p?(m=p?d.slice(0,Ce):d,e[16]=d,e[17]=p,e[18]=m):m=e[18];const b=m;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ve,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(be,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let y;e[22]!==f||e[23]!==l||e[24]!==p?(y=p&&s.jsx($e,{onClick:l,title:`${f} more provider${f===1?"":"s"}`,action:s.jsx(wt,{size:16,className:"text-muted-foreground"})}),e[22]=f,e[23]=l,e[24]=p,e[25]=y):y=e[25];let j;e[26]!==y||e[27]!==b?(j=s.jsx(ve,{children:s.jsxs(be,{children:[b,y]})}),e[26]=y,e[27]=b,e[28]=j):j=e[28];let _;return e[29]!==g||e[30]!==j?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=_):_=e[31],_}function Ut(i){return i.id!=="openai"}function Bt(i){return i.id==="openai"}function Wt(i){return i.id==="openai-compatible"}function Vt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Ht(i){return i.id==="deco"}const qt=Oe({label:re().optional(),apiKey:re().min(1,"API key is required")});function Gt(i){const e=V.c(59),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={resolver:Ae(qt),defaultValues:{label:"",apiKey:""}},e[0]=d):d=e[0];const{register:f,handleSubmit:p,formState:m}=Te(d),{errors:b}=m;let g;e[1]!==t||e[2]!==r?(g=async M=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:M.label||"Personal key",apiKey:M.apiKey})},e[1]=t,e[2]=r,e[3]=g):g=e[3];let y;e[4]!==l||e[5]!==o||e[6]!==a?(y=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Key saved successfully"),l()},e[4]=l,e[5]=o,e[6]=a,e[7]=y):y=e[7];let j;e[8]!==g||e[9]!==y?(j={mutationFn:g,onSuccess:y,onError:Yt},e[8]=g,e[9]=y,e[10]=j):j=e[10];const{mutate:_,isPending:N,error:I}=ce(j);let E;e[11]!==_?(E=M=>_(M),e[11]=_,e[12]=E):E=e[12];let v;e[13]!==p||e[14]!==E?(v=p(E),e[13]=p,e[14]=E,e[15]=v):v=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=k):k=e[16];let C;e[17]!==f?(C=f("label"),e[17]=f,e[18]=C):C=e[18];let w;e[19]!==C?(w=s.jsxs("div",{className:"space-y-1",children:[k,s.jsx(ne,{placeholder:"e.g. Personal key",...C,className:"h-8 text-sm"})]}),e[19]=C,e[20]=w):w=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const S=c?"text":"password";let x;e[22]!==f?(x=f("apiKey"),e[22]=f,e[23]=x):x=e[23];let O;e[24]!==S||e[25]!==x?(O=s.jsx(ne,{type:S,placeholder:"sk-...",...x,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=S,e[25]=x,e[26]=O):O=e[26];let A;e[27]!==c?(A=()=>u(!c),e[27]=c,e[28]=A):A=e[28];let z;e[29]!==c?(z=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[29]=c,e[30]=z):z=e[30];let T;e[31]!==A||e[32]!==z?(T=s.jsx("button",{type:"button",onClick:A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[31]=A,e[32]=z,e[33]=T):T=e[33];let U;e[34]!==O||e[35]!==T?(U=s.jsxs("div",{className:"relative",children:[O,T]}),e[34]=O,e[35]=T,e[36]=U):U=e[36];let $;e[37]!==b.apiKey?($=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[37]=b.apiKey,e[38]=$):$=e[38];let R;e[39]!==U||e[40]!==$?(R=s.jsxs("div",{className:"space-y-1",children:[h,U,$]}),e[39]=U,e[40]=$,e[41]=R):R=e[41];let K;e[42]!==I?(K=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=K):K=e[43];let F;e[44]!==N||e[45]!==n?(F=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:"Cancel"}),e[44]=N,e[45]=n,e[46]=F):F=e[46];const B=N?"Saving...":"Save Key";let D;e[47]!==N||e[48]!==B?(D=s.jsx(Z,{type:"submit",size:"sm",disabled:N,children:B}),e[47]=N,e[48]=B,e[49]=D):D=e[49];let P;e[50]!==F||e[51]!==D?(P=s.jsxs(Le,{children:[F,D]}),e[50]=F,e[51]=D,e[52]=P):P=e[52];let W;return e[53]!==w||e[54]!==R||e[55]!==K||e[56]!==P||e[57]!==v?(W=s.jsxs("form",{onSubmit:v,className:"space-y-3",children:[w,R,K,P]}),e[53]=w,e[54]=R,e[55]=K,e[56]=P,e[57]=v,e[58]=W):W=e[58],W}function Yt(i){J.error(`Failed to save key: ${i.message}`)}const Xt=Oe({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function Qt(i){const e=V.c(70),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=Ae(Xt),e[0]=d):d=e[0];const f=t?.defaultBaseUrl??"";let p;e[1]!==f?(p={resolver:d,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[1]=f,e[2]=p):p=e[2];const{register:m,handleSubmit:b,formState:g}=Te(p),{errors:y}=g;let j;e[3]!==t||e[4]!==r?(j=async se=>{const Ge=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Ge,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let _;e[6]!==l||e[7]!==o||e[8]!==a?(_=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Connection saved successfully"),l()},e[6]=l,e[7]=o,e[8]=a,e[9]=_):_=e[9];let N;e[10]!==j||e[11]!==_?(N={mutationFn:j,onSuccess:_,onError:Jt},e[10]=j,e[11]=_,e[12]=N):N=e[12];const{mutate:I,isPending:E,error:v}=ce(N),k=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",C=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let w;e[13]!==I?(w=se=>I(se),e[13]=I,e[14]=w):w=e[14];let h;e[15]!==b||e[16]!==w?(h=b(w),e[15]=b,e[16]=w,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=S):S=e[18];let x;e[19]!==m?(x=m("label"),e[19]=m,e[20]=x):x=e[20];let O;e[21]!==k||e[22]!==x?(O=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(ne,{placeholder:k,...x,className:"h-8 text-sm"})]}),e[21]=k,e[22]=x,e[23]=O):O=e[23];let A;e[24]!==C||e[25]!==y||e[26]!==t?.defaultBaseUrl||e[27]!==m?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...m("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:C,...m("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[24]=C,e[25]=y,e[26]=t?.defaultBaseUrl,e[27]=m,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let T;e[29]!==z?(T=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=T):T=e[30];const U=c?"text":"password";let $;e[31]!==m?($=m("apiKey"),e[31]=m,e[32]=$):$=e[32];let R;e[33]!==U||e[34]!==$?(R=s.jsx(ne,{type:U,placeholder:"sk-...",...$,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=U,e[34]=$,e[35]=R):R=e[35];let K;e[36]!==c?(K=()=>u(!c),e[36]=c,e[37]=K):K=e[37];let F;e[38]!==c?(F=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[38]=c,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F?(B=s.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=K,e[41]=F,e[42]=B):B=e[42];let D;e[43]!==R||e[44]!==B?(D=s.jsxs("div",{className:"relative",children:[R,B]}),e[43]=R,e[44]=B,e[45]=D):D=e[45];let P;e[46]!==T||e[47]!==D?(P=s.jsxs("div",{className:"space-y-1",children:[T,D]}),e[46]=T,e[47]=D,e[48]=P):P=e[48];let W;e[49]!==t?(W=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=W):W=e[50];let M;e[51]!==v?(M=v&&s.jsx("p",{className:"text-xs text-destructive",children:v.message}),e[51]=v,e[52]=M):M=e[52];let q;e[53]!==E||e[54]!==n?(q=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:E,children:"Cancel"}),e[53]=E,e[54]=n,e[55]=q):q=e[55];const X=E?"Saving...":"Save Connection";let Y;e[56]!==E||e[57]!==X?(Y=s.jsx(Z,{type:"submit",size:"sm",disabled:E,children:X}),e[56]=E,e[57]=X,e[58]=Y):Y=e[58];let G;e[59]!==q||e[60]!==Y?(G=s.jsxs(Le,{children:[q,Y]}),e[59]=q,e[60]=Y,e[61]=G):G=e[61];let te;return e[62]!==O||e[63]!==A||e[64]!==P||e[65]!==W||e[66]!==M||e[67]!==G||e[68]!==h?(te=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,A,P,W,M,G]}),e[62]=O,e[63]=A,e[64]=P,e[65]=W,e[66]=M,e[67]=G,e[68]=h,e[69]=te):te=e[69],te}function Jt(i){J.error(`Failed to save connection: ${i.message}`)}const Zt={kind:"closed"};function es(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ts(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ss({open:i,onOpenChange:e,initialProvider:t}){const l=he()?.providers??[],{org:o}=le(),r=ue(),a=me(),[c,u]=L.useReducer(es,Zt),d=L.useRef(!1);L.useEffect(()=>{i&&c.kind==="closed"?u({type:"open"}):!i&&c.kind!=="closed"&&u({type:"close"})},[i,c.kind]);const f=()=>{d.current=!1,u({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)})},{mutate:m}=ce({mutationFn:async({providerId:h,code:S,stateToken:x,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:S,stateToken:x,label:O}),h),onSuccess:h=>{Q("ai_provider_oauth_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_oauth_failed",{provider_id:S.providerId,error:h.message}),J.error(`OAuth connection failed: ${h.message}`),u({type:"oauth-failed"})}}),{mutate:b}=ce({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{Q("ai_provider_provision_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_provision_failed",{provider_id:S,error:h.message}),u({type:"provision-error",error:h.message})}}),g=async h=>{const{provider:S}=h,x=h.kind==="openai-compatible"?h.preset?.id??null:null,O=S.supportedMethods.includes("oauth-pkce"),A=S.supportedMethods.includes("api-key");if(S.supportsProvision===!0){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"provision"}),u({type:"select-provision",providerId:S.id}),b(S.id);return}if(O){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"oauth-pkce"});try{const T=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:S.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!T?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");u({type:"select-oauth",providerId:S.id,stateToken:T.stateToken}),window.open(T.url,"AiProviderOAuth","width=600,height=700")}catch(T){J.error(`Failed to start OAuth: ${T instanceof Error?T.message:String(T)}`)}return}A&&(Q("ai_provider_connect_clicked",{provider_id:S.id,...x!==null?{preset_id:x}:{},method:"api-key"}),u({type:"select-form",providerId:S.id,presetId:x}))},y=L.useRef(g);y.current=g;const j=L.useRef(t);j.current=t,L.useEffect(()=>{!j.current||c.kind!=="grid"||d.current||(d.current=!0,y.current(j.current))},[c.kind]);const _=c.kind==="oauth-pending"?c.stateToken:null,N=c.kind==="oauth-pending"?c.providerId:null;L.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const S=c.stateToken,x=c.providerId,O=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:T,stateToken:U}=z.data;if(U!==S){J.error("Security check failed: State token mismatch"),u({type:"oauth-failed"});return}h=!0;const $=l.find(R=>R.id===x);m({providerId:x,code:T,stateToken:S,label:$?.name??x})};window.addEventListener("message",O);const A=setTimeout(()=>{h||(Q("ai_provider_oauth_timeout",{provider_id:x}),u({type:"oauth-failed"}),J.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(A)}},[c.kind,_,N,m]);const I=ts(c),E=I?l.find(h=>h.id===I):null,k=(c.kind==="form"&&c.presetId?ae.find(h=>h.id===c.presetId):null)?.name??E?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",w=()=>{t?f():u({type:"back"})};return s.jsx(yt,{open:c.kind!=="closed",onOpenChange:h=>!h&&f(),children:s.jsxs(jt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(St,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(Re,{size:16})}),s.jsx(Nt,{children:k})]}),c.kind==="grid"&&!t&&s.jsx(kt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(De,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(Qt,{preset:c.presetId?ae.find(h=>h.id===c.presetId):void 0,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}}):s.jsx(Gt,{providerId:c.providerId,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(bt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{variant:"outline",size:"sm",onClick:()=>u({type:"back"}),children:"Back"}),s.jsx(Z,{size:"sm",onClick:()=>{u({type:"retry-provision"}),b(c.providerId)},children:"Retry"})]})]})]})})}function is(){const i=V.c(7),{org:e}=le(),t=ue();let n;i[0]!==e.id?(n=ee.defaultBrand(e.id),i[0]=e.id,i[1]=n):n=i[1];let l;i[2]!==t?(l=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(ns)??null},i[2]=t,i[3]=l):l=i[3];let o;i[4]!==n||i[5]!==l?(o={queryKey:n,queryFn:l},i[4]=n,i[5]=l,i[6]=o):o=i[6];const{data:r}=Qe(o);return r??null}function ns(i){return i.isDefault&&!i.archivedAt}function ls(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function os(i){const e=V.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Xe(),a=is(),c=Ct(),[u,d]=L.useState(null),[f,p]=L.useState(!1),[m,b]=L.useState(!1),g=he();let y;e[2]!==g?.providers?(y=g?.providers??[],e[2]=g?.providers,e[3]=y):y=e[3];const j=y,_=o.name;let N;e[4]!==a?(N=a?ls(a):null,e[4]=a,e[5]=N):N=e[5];const I=N,E=a?.favicon??a?.logo??null,v=n??(_?`${_} is ready for agents`:"Your agents are almost ready"),k=l??(r?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(E||I);let w;e[6]!==I?(w=I?{backgroundColor:`${I}18`,borderColor:`${I}30`}:void 0,e[6]=I,e[7]=w):w=e[7];const h=w,S=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let x;e[8]!==S||e[9]!==h||e[10]!==E||e[11]!==c||e[12]!==I?(x=E?s.jsx("div",{className:S,style:h,children:s.jsx("img",{src:E,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>b(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:de(S,"cursor-pointer transition-colors hover:bg-accent"),style:h,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(vt,{size:24,style:I?{color:I}:void 0,className:de(!I&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=S,e[9]=h,e[10]=E,e[11]=c,e[12]=I,e[13]=x):x=e[13];let O;e[14]!==v?(O=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:v}),e[14]=v,e[15]=O):O=e[15];let A;e[16]!==k?(A=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:k}),e[16]=k,e[17]=A):A=e[17];let z;e[18]!==O||e[19]!==A?(z=s.jsxs("div",{className:"space-y-2",children:[O,A]}),e[18]=O,e[19]=A,e[20]=z):z=e[20];let T;e[21]!==x||e[22]!==z?(T=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[x,z]}),e[21]=x,e[22]=z,e[23]=T):T=e[23];let U,$;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=M=>d(M),$=()=>p(!0),e[24]=U,e[25]=$):(U=e[24],$=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(De,{providers:j,onSelect:U,onShowAll:$})}),e[26]=j,e[27]=R):R=e[27];const K=u!==null||f;let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=M=>{M||(d(null),p(!1))},e[28]=F):F=e[28];const B=u??void 0;let D;e[29]!==K||e[30]!==B?(D=s.jsx(ss,{open:K,onOpenChange:F,initialProvider:B}),e[29]=K,e[30]=B,e[31]=D):D=e[31];let P;e[32]!==m?(P=s.jsx(It,{open:m,onOpenChange:b}),e[32]=m,e[33]=P):P=e[33];let W;return e[34]!==R||e[35]!==D||e[36]!==P||e[37]!==T?(W=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[T,R,D,P]}),e[34]=R,e[35]=D,e[36]=P,e[37]=T,e[38]=W):W=e[38],W}function pe(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function rs(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const as=["bg-destructive","bg-warning","bg-success","bg-success"],cs=["text-success","text-warning","text-warning","text-destructive"];function ds(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function us(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ms={text:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(rt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(dt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(Pe,{className:"size-3.5"}),label:"Web search"}};function hs(i){const e=V.c(5),{capability:t}=i;let n;e[0]!==t?(n=ms[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function fs(i){const e=V.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=v):v=e[0],v}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=pe(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:u}=a;if(l){let v;e[3]!==t.limits?(v=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=v):v=e[4];let k;e[5]!==o?(k=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=k):k=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let w;e[9]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=w):w=e[10];let h;return e[11]!==v||e[12]!==k||e[13]!==C||e[14]!==w?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[v,k,C,w]}),e[11]=v,e[12]=k,e[13]=C,e[14]=w,e[15]=h):h=e[15],h}let d;e[16]!==c?(d=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=d):d=e[17];let f;e[18]!==t.logo||e[19]!==t.title?(f=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=f):f=e[20];let p;e[21]!==u?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:u}),e[21]=u,e[22]=p):p=e[22];let m;e[23]!==f||e[24]!==p?(m=s.jsxs("div",{className:"flex items-center gap-2.5",children:[f,p]}),e[23]=f,e[24]=p,e[25]=m):m=e[25];let b;e[26]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=b):b=e[27];let g;e[28]!==d||e[29]!==m||e[30]!==b?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[d,m,b]}),e[28]=d,e[29]=m,e[30]=b,e[31]=g):g=e[31];let y;e[32]!==t.capabilities?(y=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(ps)}),e[32]=t.capabilities,e[33]=y):y=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:v,label:k,description:C}=rs(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(w=>s.jsx("div",{className:de("w-2 h-2 rounded-full",w<=v?as[v-1]:"bg-muted")},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let _;e[36]!==t.limits?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ds(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=_):_=e[37];let N;e[38]!==o||e[39]!==r?(N=(o!=null||r!=null)&&(()=>{const{level:v,label:k}=o!=null?us(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:de("text-sm font-bold leading-none",C<=v?cs[v-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==_||e[43]!==N?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,N]}),e[41]=j,e[42]=_,e[43]=N,e[44]=I):I=e[44];let E;return e[45]!==I||e[46]!==g||e[47]!==y?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,y,I]}),e[45]=I,e[46]=g,e[47]=y,e[48]=E):E=e[48],E}function ps(i){return s.jsx(hs,{capability:i},i)}function ai(i){const e=V.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(H,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(H,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=y):y=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=pe(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let u;e[8]!==t?(u=fe(t),e[8]=t,e[9]=u):u=e[9];const d=u;let f;e[10]!==t.title||e[11]!==d?(f=s.jsx("img",{src:d,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=d,e[12]=f):f=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=m):m=e[15];let b;return e[16]!==f||e[17]!==p?(b=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,p,m]}),e[16]=f,e[17]=p,e[18]=b):b=e[18],b}const xs=["vision","image","file","audio","video"],Ue=["image/png","image/jpeg","image/gif","image/webp"],Be=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function xe(i){const e=i?.capabilities;return e?xs.some(t=>e.includes(t)):!1}function ci(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&Ue.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||xe(e)&&Be.includes(i))}function di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ue),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),xe(i)&&t.push(...Be),t.join(",")}function ui(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),xe(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const We=["smarter","faster","cheaper"],Ve={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},gs=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],vs=gs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),bs="google/gemini-2.5-pro",Ie=new Map;function ys(i){const e=Ie.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:n,prefix:l}of vs)if(i.startsWith(l)){if(l===bs&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue}t=n;break}return Ie.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=ys(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const He="mesh:model-shortlist:",js=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ss(i){try{const e=localStorage.getItem(He+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ns(i,e){localStorage.setItem(He+i,JSON.stringify([...e]))}function ks(i){const e=V.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=pe(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=fe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let u;e[4]!==t||e[5]!==n?(u=()=>n(t),e[4]=t,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==t.title||e[8]!==c?(d=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o?(f=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=f):f=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let b;return e[17]!==u||e[18]!==d||e[19]!==m?(b=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[d,m]}),e[17]=u,e[18]=d,e[19]=m,e[20]=b):b=e[20],b}function ws(i){const e=V.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(et,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ct,{className:"size-3.5"}),e[4]=c):c=e[4];let u;e[5]!==n?(u=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(Z,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==u?(d=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,u]}),e[7]=a,e[8]=u,e[9]=d):d=e[9],d}function _s(){const i=V.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Cs)}),i[0]=e):e=i[0],e}function Cs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(i){const e=V.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let u;e[6]!==o||e[7]!==l?(u=d=>s.jsx("div",{onClick:()=>l(d),className:"cursor-pointer",children:s.jsx(ks,{model:d,onHover:o})},d.modelId),e[6]=o,e[7]=l,e[8]=u):u=e[8],a=n.map(u),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Is(i){const e=V.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=L.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=fe(t),e[0]=t,e[1]=c):c=e[1];const u=c;let d;e[2]!==t||e[3]!==o?(d=()=>o(t),e[2]=t,e[3]=o,e[4]=d):d=e[4];let f;e[5]!==t.modelId||e[6]!==l?(f=()=>{a(Es),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=f):f=e[7];let p;e[8]!==r||e[9]!==f?(p=s.jsx(tt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=p):p=e[10];let m;e[11]!==u||e[12]!==t.title?(m=s.jsx("img",{src:u,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=u,e[12]=t.title,e[13]=m):m=e[13];let b;e[14]!==t.title?(b=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=b):b=e[15];let g;return e[16]!==d||e[17]!==p||e[18]!==m||e[19]!==b?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[p,m,b]}),e[16]=d,e[17]=p,e[18]=m,e[19]=b,e[20]=g):g=e[20],g}function Es(i){return!i}function Ms(i){const e=[];for(const t of We)if(i[t].length>0){e.push({type:"header",label:Ve[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Os({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=L.useRef(null),o=Dt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Is,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function As(i){const e=V.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:u}=xt(t),d=c?u.filter(c):u.filter(Ts);let f;e[0]!==t?(f=()=>(t?Ss(t):null)??js,e[0]=t,e[1]=f):f=e[1];const[p,m]=L.useState(f),[,b]=L.useTransition();let g;e[2]!==t||e[3]!==b?(g=h=>{t&&b(()=>{m(S=>{const x=new Set(S);return x.has(h)?x.delete(h):x.add(h),Ns(t,x),x})})},e[2]=t,e[3]=b,e[4]=g):g=e[4];const y=g,j=n.toLowerCase().trim(),_=h=>j?h.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):h;if(r){const h=Ee(_(d)),S=Ms(h);let x;e[5]!==p?(x=T=>p.has(T.modelId),e[5]=p,e[6]=x):x=e[6];const O=d.filter(x).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Re,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,"Back"]}),e[8]=a,e[9]=z):z=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Os,{items:S,shortlistSet:p,onToggle:y,onHover:l})]})}let N;e[10]!==p?(N=h=>p.has(h.modelId),e[10]=p,e[11]=N):N=e[11];const I=d.filter(N),E=I.length>0?I:d,v=Ee(_(E));let k;e[12]!==v||e[13]!==l||e[14]!==o?(k=We.map(h=>s.jsx(Me,{label:Ve[h],models:v[h],onSelect:o,onHover:l},h)),e[12]=v,e[13]=l,e[14]=o,e[15]=k):k=e[15];let C;e[16]!==v.other||e[17]!==l||e[18]!==o?(C=s.jsx(Me,{label:"Other",models:v.other,onSelect:o,onHover:l}),e[16]=v.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let w;return e[20]!==k||e[21]!==C?(w=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,C]}),e[20]=k,e[21]=C,e[22]=w):w=e[22],w}function Ts(i){return i.asyncResearch!==!0}function mi(){const i=V.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(H,{className:"size-4 shrink-0"}),s.jsx(H,{className:"flex-1 h-6"}),s.jsx(H,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(zs)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(H,{className:"size-6 shrink-0"}),s.jsx(H,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{className:"h-6 w-20 rounded-md"}),s.jsx(H,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-24"}),s.jsx(H,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-16"}),s.jsx(H,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function zs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function qe(i){const e=V.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,u]=L.useState(null),[d,f]=L.useState(""),[p,m]=L.useState(!1),b=L.useRef(null),g=he(),y=pt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ls)),e[0]=g?.providers,e[1]=j):j=e[1];const _=j,N=Je(),{org:I}=le();let E;e[2]!==l?(E=M=>{l(M),u(null)},e[2]=l,e[3]=E):E=e[3];const v=E;let k;e[4]!==n||e[5]!==t||e[6]!==r?(k=M=>{n&&(r(M),f(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=k):k=e[7];const C=k;if(y.length===0){let M;return e[8]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(os,{})}),e[8]=M):M=e[8],M}let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=w):w=e[9];const h=p?"Search all models...":"Search for a model...";let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=M=>f(M.target.value),e[10]=S):S=e[10];let x;e[11]!==d||e[12]!==h?(x=s.jsx(ne,{ref:b,type:"text",placeholder:h,value:d,onChange:S,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=d,e[12]=h,e[13]=x):x=e[13];let O;e[14]!==n||e[15]!==v||e[16]!==y||e[17]!==_?(O=y.length>0&&s.jsxs(st,{value:n??"",onValueChange:v,children:[s.jsxs(it,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ps,children:[s.jsx(nt,{placeholder:"Key",children:(()=>{const M=y.find(te=>te.id===n),q=M?_[M.providerId]:void 0,X=_e(M?.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(ht,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(lt,{children:y.map(M=>{const q=_[M.providerId],X=_e(M.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M.providerId;return s.jsx(ot,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",M.label]})]})},M.id)})})]}),e[14]=n,e[15]=v,e[16]=y,e[17]=_,e[18]=O):O=e[18];let A;e[19]!==x||e[20]!==O?(A=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[w,x,O]})}),e[19]=x,e[20]=O,e[21]=A):A=e[21];let z;e[22]!==n?(z=M=>{const{error:q,resetError:X}=M;return s.jsx(ws,{error:q,onRetry:X,credentialId:n??void 0})},e[22]=n,e[23]=z):z=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(_s,{}),e[24]=T):T=e[24];const U=n??void 0;let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=()=>m(Rs),e[25]=$):$=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==p||e[29]!==d||e[30]!==U?(R=s.jsx(L.Suspense,{fallback:T,children:s.jsx(As,{keyId:U,searchTerm:d,onHover:u,onModelSelect:C,managing:p,onToggleManage:$,filterModels:a})}),e[26]=a,e[27]=C,e[28]=p,e[29]=d,e[30]=U,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==z||e[34]!==R?(K=s.jsx(Ze,{fallback:z,children:R},n),e[32]=n,e[33]=z,e[34]=R,e[35]=K):K=e[35];let F;e[36]!==p||e[37]!==N||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>L.startTransition(()=>m(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(at,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>N({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(ft,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=N,e[38]=I,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F||e[42]!==A?(B=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[A,K,F]}),e[40]=K,e[41]=F,e[42]=A,e[43]=B):B=e[43];const D=c??o??null;let P;e[44]!==D?(P=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(fs,{model:D})}),e[44]=D,e[45]=P):P=e[45];let W;return e[46]!==B||e[47]!==P?(W=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,P]}),e[46]=B,e[47]=P,e[48]=W):W=e[48],W}function Rs(i){return!i}function Ps(i){return i.stopPropagation()}function Ls(i){return[i.id,i]}function $s(i){const e=V.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=gt();let a;e[0]!==l?(a=d=>{Q("chat_credential_changed",{credential_id:d}),l(d)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=d=>{n&&(Q("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:d.modelId,to_model_provider:d.providerId??null,credential_id:n}),r({...d,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let u;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(u=s.jsx(qe,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}function hi(i){const e=V.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx($s,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function fi(i){const e=V.c(2);let t;return e[0]!==i?(t=s.jsx(qe,{...i}),e[0]=i,e[1]=t):t=e[1],t}export{ss as C,fi as D,mi as M,os as N,ae as O,De as P,ai as S,di as a,hi as b,ui as g,ci as i,xe as m};
|
package/dist/client/assets/{decopilot-sse-pool-_mJQvJZ7.js → decopilot-sse-pool-R-AtQW2s.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DrM3Gy-E.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,
|
|
1
|
+
import{c as n,j as i,cB as u,l as c,bS as m,dq as x,dr as j,cC as N,cD as b,ds as g,dt as D}from"./index-DrM3Gy-E.js";import{i as h}from"./X-1BuEzBGR.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function S(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,S as a,E as b,T as c,z as d,R as e,w as f,v as g,y as h,k as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as X,v as H,m as U,r as W,K as J,k as ee,d as Z,q as te,t as p,j as i,B as $}from"./index-
|
|
1
|
+
import{c as X,v as H,m as U,r as W,K as J,k as ee,d as Z,q as te,t as p,j as i,B as $}from"./index-DrM3Gy-E.js";import{u as ie}from"./studio-tools-CAUx-JUt.js";import{b as se,S as ne,a as oe}from"./settings-section-uGwPOE8T.js";import{B as Q}from"./badge-CpxlbcB7.js";import{I as ae}from"./input-BiM4A7Ep.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select-lfhjFS6i.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let V;e[29]!==_||e[30]!==A?(V={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=V):V=e[31];const D=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==D){let o;e[46]!==E||e[47]!==F||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let k;e[59]!==T||e[60]!==C||e[61]!==L?(k=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=k):k=e[62];let w;e[63]!==M||e[64]!==k?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,k]}),e[63]=M,e[64]=k,e[65]=w):w=e[65];let G;return e[66]!==O||e[67]!==w?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as s,
|
|
1
|
+
import{c as d,j as s,ct as i,l as c}from"./index-DrM3Gy-E.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as d,dX as f,dY as m,l as u,dZ as g,d_ as x,d$ as v,e0 as b,e1 as h,e2 as w,e3 as j,e4 as N,e5 as z,e6 as _,e7 as y,e8 as p}from"./index-
|
|
1
|
+
import{c,j as d,dX as f,dY as m,l as u,dZ as g,d_ as x,d$ as v,e0 as b,e1 as h,e2 as w,e3 as j,e4 as N,e5 as z,e6 as _,e7 as y,e8 as p}from"./index-DrM3Gy-E.js";import{i as $}from"./ChevronUp-BurUkCqE.js";import{i as D}from"./ChevronRight-CmB8MBzZ.js";import{i as M}from"./DotsVertical-Dsznav3Y.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function X(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Y(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function Z(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function A(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,Z as d,q as e,A as f,Y as g,P as h,X as i,O as j,L as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as N,j as t}from"./index-
|
|
1
|
+
import{c as v,l as N,j as t}from"./index-DrM3Gy-E.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DrM3Gy-E.js";import{W as T,e as O}from"./use-mcp-client-lyJJArps.js";function x(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return x(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const U={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function H(e){return e?U[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function L(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function Y(e){const t=L(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||Y(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=H(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,Q as c,J as d,X as e,B as f,Y as g,q as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-DrM3Gy-E.js";import{F as mt,l as pt}from"./index-DF_aAsrE.js";import{e as ht,at as xt,au as gt,av as ae,aw as yt,U as $e}from"./agent-icon-B8qJNw4_.js";import{a as wt}from"./Tool01-CTw8qR4v.js";import{s as jt}from"./XClose-qpXD94Yo.js";import{S as bt}from"./scroll-area-DaDHqFsI.js";import{b as Oe,T as Re,a as ze}from"./tooltip-Cs_BNuMF.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-CSRFWtbt.js";import{u as Et}from"./chat-context-CmZjYRTw.js";import{b as Pt}from"./shell-layout-DJP1UAvL.js";import{ak as le,al as Ae,am as Tt}from"./index-D4eNxtKO.js";import{a as $t,b as Ot,D as Rt,e as zt,c as At,d as Wt}from"./dialog-L9SFsS1U.js";import{I as We}from"./input-BiM4A7Ep.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-ByPsUX7u.js";import{t as Vt}from"./ChevronDown-Di-ZHzN-.js";import{i as Bt}from"./ChevronRight-CmB8MBzZ.js";import{a as Gt}from"./ZoomOut-DHX-bR9F.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-vDgojfWg.js";import"./AlertCircle-CzPpSV3W.js";import"./SwitchHorizontal01-C3K-vKiU.js";import"./Settings02-B7jENSJZ.js";import"./XCircle-DtHr5hnB.js";import"./ArrowUpRight-BefNTATY.js";import"./ZapSquare-C2q_71C5.js";import"./Users03-9LUo_raC.js";import"./CheckCircle-BRNW9lmT.js";import"./ChevronUp-BurUkCqE.js";import"./ChevronLeft-ByolOLbh.js";import"./DotsVertical-Dsznav3Y.js";import"./Stars02-D2Vky1vN.js";import"./Eye-B8NUm9Br.js";import"./Globe01-BG9Wm5DJ.js";import"./FilterLines-DMbodALc.js";import"./Star01-CaB7lNB9.js";import"./Globe04-Fg_TSPLj.js";import"./HardDrive-BLr46_IN.js";import"./Key01-Dc0MTS9j.js";import"./LayoutLeft-nNhAa0Dy.js";import"./LinkExternal01-D0OVTAOa.js";import"./Monitor01-D_VMj6ZB.js";import"./Sun-vyxrPcie.js";import"./Palette-BmXFbt3l.js";import"./Play-CAiQqhjZ.js";import"./Plus-DHDiWYHk.js";import"./SearchMd-DaWHy1GV.js";import"./Shield01-YoAzrA51.js";import"./Stars01-a6WqibZn.js";import"./Trash01-BzTEx-hS.js";import"./Upload01-DwgHgRix.js";import"./User01-BtO-AoKy.js";import"./Users01-BRTza8nY.js";import"./X-1BuEzBGR.js";import"./Zap-DluXKGP1.js";import"./use-clock-tick-g2v6P087.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CgtuLhVL.js";import"./file-type-icon-C96ES1WD.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-GBPItn3L.js";import"./use-mcp-client-lyJJArps.js";import"./auth-DOooeHhC.js";import"./hooks-BBwQx9Hj.js";import"./decopilot-sse-pool-R-AtQW2s.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-CAUx-JUt.js";import"./sheet-nKeubIDJ.js";import"./integration-icon-g_GK3RAr.js";import"./use-virtual-mcp-Bglvu7_H.js";import"./use-collections-B_GMLsdD.js";import"./use-navigate-to-agent-DKc1WVEH.js";import"./use-connection-DKt0DY8s.js";import"./use-mcp-prompts-82Xtua4M.js";import"./form-Ci3Mfx5E.js";import"./label-CjJncELr.js";import"./select-lfhjFS6i.js";import"./use-ai-providers-Cyy4e6Er.js";import"./use-organization-settings-DmFrFel5.js";import"./avatar-BnBqk-2k.js";import"./required-auth-layout-DMkbzFqw.js";import"./use-org-sso-DzO_wPSE.js";import"./index-28ylgXoe.js";import"./drawer-D-LP9Hh8.js";import"./collection-search-9oxtR-cY.js";import"./tabs-B7LOh75O.js";import"./toggle-group-Dpya1ElG.js";import"./sortable.esm-DaR8hxU_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BZz5WDR5.js";import"./use-registry-connections-grv_p5nm.js";import"./useInfiniteQuery-v9qNAGwf.js";import"./use-infinite-scroll-Dt6SxdrG.js";import"./extract-connection-data-Rczvmr_Y.js";import"./card-DQnbTJFb.js";import"./collection-tabs-CvHGsfW_.js";import"./badge-CpxlbcB7.js";import"./textarea-CoSni5ST.js";import"./connection-form-helpers-CltinQul.js";import"./authenticate-and-persist-oauth-CAo_oHNJ.js";import"./mcp-oauth-CEKI9gHX.js";import"./useSuspenseInfiniteQuery-Bu3QWDEr.js";import"./connect-desktop-dialog-BktLGd3J.js";import"./decopilot-DjAEZRNX.js";import"./checkbox-DokO2DXd.js";import"./skeleton-CQjs3VsL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-uGwPOE8T.js";import"./popover-CdhOYhn4.js";import"./command-Bw5g6PzP.js";import"./index-_BBnqQdQ.js";import"./dropdown-menu-ByaGrYAQ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CeAiKW9f.js";import"./empty-state-BoeIt5Fh.js";import"./toolbar-C-FtiPvy.js";import"./use-mcp-tools-CdHM3tvY.js";import"./use-capability-_e3uVe_7.js";import"./shell-route-loading-BQkX9uZV.js";import"./index-DUXTdmoE.js";import"./switch-Vf_P6Fjw.js";import"./use-debounced-autosave-EPMbx34N.js";import"./index-BYWWr4r7.js";import"./sidebar-BDxhgXc-.js";import"./search-input-CA0juGKQ.js";import"./github-repo-picker-CLrsrBV_.js";import"./use-secrets-DzWb-lJi.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-B_Gx2-J_.js";import"./automation-runs-BhCrA9zN.js";import"./table-Df43OI16.js";import"./use-members-CR5Y6qBg.js";import"./use-org-auth-client-DyCA15LL.js";import"./task-status-CNl7XTqg.js";import"./use-automations-jx__re2k.js";import"./use-file-configs-Ci1h3IZS.js";import"./monaco-editor-BiUexVQ3.js";import"./select-model-DhPTkTLZ.js";import"./automation-list-row-CBS-1Qac.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Wi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
|
|
2
|
+
`)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Wi as FileExplorer};
|