decocms 4.46.7 → 4.46.8
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-BkN6bE3e.js → AlertCircle-VSaI59FL.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-5g0rgyEC.js → ArrowUpRight-DED_AlzP.js} +1 -1
- package/dist/client/assets/{Check-DQ1PVQ4I.js → Check-Dtq_ZK03.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dn6Sq1Kz.js → CheckCircle-DcKw1-_d.js} +1 -1
- package/dist/client/assets/{ChevronDown-6kN8920z.js → ChevronDown-CnEhgNqF.js} +1 -1
- package/dist/client/assets/{ChevronRight-BJhJUvVR.js → ChevronRight-Cc9IhBGK.js} +1 -1
- package/dist/client/assets/{ChevronUp-C0n1GZuy.js → ChevronUp-C9RkPySz.js} +1 -1
- package/dist/client/assets/{Circle-BkYlSdzx.js → Circle-RKd9aEK_.js} +1 -1
- package/dist/client/assets/{Copy01-DGePmtkb.js → Copy01-9mW_fZgj.js} +1 -1
- package/dist/client/assets/{DotsVertical-i8KViG5B.js → DotsVertical-B6GdVw3E.js} +1 -1
- package/dist/client/assets/{Eye-CbLv7QbD.js → Eye-CEf8mFIt.js} +1 -1
- package/dist/client/assets/{FilterLines-C12Lixza.js → FilterLines-C6wHOLww.js} +1 -1
- package/dist/client/assets/{Globe01-AfsxpWEz.js → Globe01-Cbxk85ZZ.js} +1 -1
- package/dist/client/assets/{Globe04-Cmod1ST8.js → Globe04-BKfzvVP_.js} +1 -1
- package/dist/client/assets/{HardDrive-CgIps4Rp.js → HardDrive-vWjfYQGf.js} +1 -1
- package/dist/client/assets/{Key01-CZNLoYYa.js → Key01-CxxqcJgL.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Dso-Hp7h.js → LayoutLeft-BylnsmzZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D8IKDnEI.js → LinkExternal01-B7bA_SGH.js} +1 -1
- package/dist/client/assets/{List-CCdd_sXI.js → List-BQAXnC1p.js} +1 -1
- package/dist/client/assets/{Loading02-e50-q8az.js → Loading02-C9cshbgr.js} +1 -1
- package/dist/client/assets/{Monitor01-Ce2ZwMhu.js → Monitor01-CWod5JNa.js} +1 -1
- package/dist/client/assets/{Palette-Csw8BdBs.js → Palette-DE5FYpEZ.js} +1 -1
- package/dist/client/assets/{Play-B84Z2az-.js → Play-CPmbBTg4.js} +1 -1
- package/dist/client/assets/{Plus-CIsE5lsO.js → Plus-BxmFo7Ah.js} +1 -1
- package/dist/client/assets/{SearchLg-C4wZw8rZ.js → SearchLg-Co57QkX5.js} +1 -1
- package/dist/client/assets/{SearchMd-D1KbAB6R.js → SearchMd-afzoQhVg.js} +1 -1
- package/dist/client/assets/{Settings02-CRGRSAHu.js → Settings02-DJvoqnK4.js} +1 -1
- package/dist/client/assets/{Shield01-xemTf_mR.js → Shield01-Kx0eMb2U.js} +1 -1
- package/dist/client/assets/{Star01-DFi111dk.js → Star01-BMqZVOW6.js} +1 -1
- package/dist/client/assets/{Stars01-BFOsGjiZ.js → Stars01-uqdNKK0n.js} +1 -1
- package/dist/client/assets/{Stars02-FWKxJQ35.js → Stars02-AjKchkXo.js} +1 -1
- package/dist/client/assets/{Sun-CAUTRfSG.js → Sun-B8V2z0pg.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DK7ZWie5.js → SwitchHorizontal01-CAoKt4Ii.js} +1 -1
- package/dist/client/assets/{Tool01-DuWgaDgI.js → Tool01-HSI0YX2B.js} +1 -1
- package/dist/client/assets/{Trash01-dBMEpOnf.js → Trash01-D09UhMTX.js} +1 -1
- package/dist/client/assets/{Upload01-BPbaXMI5.js → Upload01-B89mYaQz.js} +1 -1
- package/dist/client/assets/{User01-CBqYlP53.js → User01-C8AziRP3.js} +1 -1
- package/dist/client/assets/{Users01-B3xL29oF.js → Users01-Dz_moui0.js} +1 -1
- package/dist/client/assets/{Users03-B1TvK375.js → Users03-CfkBBwwR.js} +1 -1
- package/dist/client/assets/{X-CGii91yx.js → X-e27bh2iX.js} +1 -1
- package/dist/client/assets/{XCircle-jcGfwCOY.js → XCircle-CL7eXIc7.js} +1 -1
- package/dist/client/assets/{XClose-CxY7CjR_.js → XClose-DlI5IzGh.js} +1 -1
- package/dist/client/assets/{Zap-De8VT9Ar.js → Zap-ZdxWAFQl.js} +1 -1
- package/dist/client/assets/{ZapSquare-3oy0R3OW.js → ZapSquare-D_oP0ssp.js} +1 -1
- package/dist/client/assets/{ZoomOut-XMF6Hmbx.js → ZoomOut-DYLixJql.js} +1 -1
- package/dist/client/assets/{access-gate-CjSIKANk.js → access-gate-DJJeWvMD.js} +1 -1
- package/dist/client/assets/{add-section-modal-sf440ajL.js → add-section-modal-DdGTIDL9.js} +1 -1
- package/dist/client/assets/{agent-capabilities-D2KQRe6c.js → agent-capabilities-Bmjqz6oG.js} +1 -1
- package/dist/client/assets/{agent-icon-BSXg66GV.js → agent-icon-Cby90nCh.js} +1 -1
- package/dist/client/assets/{agents-list-BbPOzcu4.js → agents-list-0VEdCQ4O.js} +1 -1
- package/dist/client/assets/{ai-providers-C0oU1yN1.js → ai-providers-C-eyfIr0.js} +1 -1
- package/dist/client/assets/{alert-CfydWAca.js → alert-AqMEH2G7.js} +1 -1
- package/dist/client/assets/{alert-dialog-C9Q0HiU1.js → alert-dialog-Qng6tGLP.js} +1 -1
- package/dist/client/assets/{app-editor-D3itx4qv.js → app-editor-DjSXFo9M.js} +1 -1
- package/dist/client/assets/{auth-D3vExR-4.js → auth-BHRTMZkH.js} +1 -1
- package/dist/client/assets/{auth-catchall-DO4gWY-n.js → auth-catchall-B_PFpb0I.js} +1 -1
- package/dist/client/assets/{auth-entry-DmT7eGhl.js → auth-entry-DkE5aI4W.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CmGDs7-k.js → auth-split-layout-RKSsnY7l.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BnOYverB.js → authenticate-and-persist-oauth-DyU8DyC8.js} +1 -1
- package/dist/client/assets/{automation-list-row-DlUBJrXZ.js → automation-list-row-DhtWkAOF.js} +1 -1
- package/dist/client/assets/{automation-runs-dWoZ5UNp.js → automation-runs-DhLlbgN8.js} +1 -1
- package/dist/client/assets/{automations-CmK7I1wb.js → automations-ChHRjO9L.js} +1 -1
- package/dist/client/assets/{autosend-CPOpRl9-.js → autosend-DDZN4BkT.js} +1 -1
- package/dist/client/assets/{avatar-7_Uhdx_X.js → avatar-B66RbKc-.js} +1 -1
- package/dist/client/assets/{badge-CFfdJXOJ.js → badge-DJ9EyIQY.js} +1 -1
- package/dist/client/assets/{block-document-6AV4Kx5E.js → block-document-B_WnSJmN.js} +1 -1
- package/dist/client/assets/{brand-context-K-4GQoA1.js → brand-context-BDGdKhnB.js} +1 -1
- package/dist/client/assets/{breadcrumb-VnuJ_lc-.js → breadcrumb-CAS0W611.js} +1 -1
- package/dist/client/assets/{buckets-CmYBvaqv.js → buckets-CYr6vJxW.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BWBMlLYO.js → bulk-category-panel-qR9uN0Bg.js} +1 -1
- package/dist/client/assets/{calendar-BcZaGxxO.js → calendar-D1FhikzH.js} +1 -1
- package/dist/client/assets/{capability-load-error-CKuMqx8V.js → capability-load-error-CQoXLTuy.js} +1 -1
- package/dist/client/assets/{card-C1FfzZgF.js → card-BIhB7wI7.js} +1 -1
- package/dist/client/assets/{category-editor-2Q32y_qK.js → category-editor-C1oiomvL.js} +1 -1
- package/dist/client/assets/{chat-context-B9Eq-E53.js → chat-context-Bj1iYPUe.js} +1 -1
- package/dist/client/assets/{checkbox-HZ6k6wMf.js → checkbox-B3chUOm-.js} +1 -1
- package/dist/client/assets/{cli-auth-success-nsKPsDfe.js → cli-auth-success-Bo_LUyJ1.js} +1 -1
- package/dist/client/assets/{collection-detail-9M5a4C-q.js → collection-detail-DyH5-dU3.js} +1 -1
- package/dist/client/assets/{collection-display-button-CI-niW8F.js → collection-display-button-DGCXpqUg.js} +1 -1
- package/dist/client/assets/{collection-search-DACuK1Wj.js → collection-search-BXrUEEhc.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-lDkvXo5F.js → collection-table-wrapper-DJ5-omn7.js} +1 -1
- package/dist/client/assets/{collection-tabs-CmMnJDoD.js → collection-tabs-BwJsnCrg.js} +1 -1
- package/dist/client/assets/{command-DNthJ8Gk.js → command-hFeZ4ZXg.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BnTYIO35.js → commerce-onboarding-EYFMq2Ge.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-l8Dhzxj_.js → connect-desktop-dialog-CVJN8gi3.js} +1 -1
- package/dist/client/assets/{connection-card-BPmzaDbT.js → connection-card-B7uE3W0c.js} +1 -1
- package/dist/client/assets/{connection-detail-wmN443n5.js → connection-detail-DE_CB9qI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CShUwEeG.js → connection-form-helpers-BeWWRlSK.js} +1 -1
- package/dist/client/assets/{connections-D2PLARAR.js → connections-BI6sV2R2.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DPcg5f2n.js → decopilot-sse-pool-CLa9Mjl1.js} +1 -1
- package/dist/client/assets/{dialog-BJif7vQZ.js → dialog-6c27Cavq.js} +1 -1
- package/dist/client/assets/{domain-settings-B1N2nw-n.js → domain-settings-Dw4fI7eB.js} +1 -1
- package/dist/client/assets/{drawer-Co8gs6Fc.js → drawer-B69kdloU.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B8aOkew-.js → dropdown-menu-R4TefnVN.js} +1 -1
- package/dist/client/assets/{empty-state-CsBjQn5k.js → empty-state-Btv_n9n0.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DaW8FJ6S.js → extract-connection-data-Dw8rQNAA.js} +1 -1
- package/dist/client/assets/{file-explorer-DCoQiet4.js → file-explorer-CLfka3OA.js} +1 -1
- package/dist/client/assets/{file-type-icon-BkvUXo-i.js → file-type-icon--Egm_X5V.js} +1 -1
- package/dist/client/assets/{files-BeNrFQfN.js → files-B1fe9iau.js} +1 -1
- package/dist/client/assets/{form-DYhr6dqh.js → form-CItZcoP-.js} +1 -1
- package/dist/client/assets/{general-DK7Xwh2i.js → general-BtGChiCS.js} +1 -1
- package/dist/client/assets/{github-repo-picker-fG5k3Yhb.js → github-repo-picker-FhzwcWiZ.js} +1 -1
- package/dist/client/assets/{hooks-CWibMmJS.js → hooks-DoEpIMJX.js} +1 -1
- package/dist/client/assets/{index-BYce458F.js → index-B5sA1KL1.js} +1 -1
- package/dist/client/assets/{index-BcghVrPi.js → index-B8jnFOA3.js} +1 -1
- package/dist/client/assets/index-BBkKOB5j.js +1 -0
- package/dist/client/assets/{index-DT_pxfPN.js → index-BF9UcDA9.js} +1 -1
- package/dist/client/assets/{index-CQi1-k1S.js → index-BLyWH1aN.js} +1 -1
- package/dist/client/assets/{index-Cl-_5nVB.js → index-BUuQpOtH.js} +1 -1
- package/dist/client/assets/{index-jaiQKsNa.js → index-CRwxywII.js} +1 -1
- package/dist/client/assets/{index-Bu90L3Vh.js → index-CcbYSALo.js} +1 -1
- package/dist/client/assets/{index-Da3PBRj2.js → index-CfGNqtFQ.js} +1 -1
- package/dist/client/assets/{index-gPYChI-l.js → index-DY5zl7AF.js} +1 -1
- package/dist/client/assets/{index-Dmlz6erX.js → index-Diaq5IJc.js} +1 -1
- package/dist/client/assets/{index-jZB422cK.js → index-Dji8gLZI.js} +1 -1
- package/dist/client/assets/{index-DZLSCiKJ.js → index-Dz0lMvjR.js} +6 -6
- package/dist/client/assets/{index-Bt44PnRe.js → index-XFpFdqPm.js} +3 -3
- package/dist/client/assets/{index-redirect-CVwOQlDA.js → index-redirect-BShc4_iO.js} +1 -1
- package/dist/client/assets/{input-ByCtzJjh.js → input-BJiUYbgO.js} +1 -1
- package/dist/client/assets/{integration-icon-BckRMEt9.js → integration-icon-CXzBwBk_.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-7Oyroqqw.js → invite-member-dialog-CmIWsjQw.js} +1 -1
- package/dist/client/assets/{label-D1Gl0tP_.js → label-D_8MbSWQ.js} +1 -1
- package/dist/client/assets/{login-DnJv5X8O.js → login-Dn67eUZl.js} +1 -1
- package/dist/client/assets/{mcp-oauth-lk6nxTI-.js → mcp-oauth-DKQ4y2A8.js} +1 -1
- package/dist/client/assets/{members-5ukxOUDi.js → members-Bo8aSQUj.js} +1 -1
- package/dist/client/assets/{monaco-editor-B-lzXDys.js → monaco-editor-DDxbCJLw.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bp5EHpya.js → monitoring-stats-row-CzBVTyxl.js} +1 -1
- package/dist/client/assets/{oauth-callback-B91jweYA.js → oauth-callback-6Eky1lb6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Ci0b7itJ.js → oauth-callback-ai-provider-D7-r9wzp.js} +1 -1
- package/dist/client/assets/{onboarding-C_xN7kQH.js → onboarding-D5RnIWBB.js} +1 -1
- package/dist/client/assets/{org-install-B4GQwwm9.js → org-install-CGNEXgn_.js} +1 -1
- package/dist/client/assets/{org-layout-DSutC410.js → org-layout-a68z9I18.js} +1 -1
- package/dist/client/assets/{organization-choice-CDU_bsAe.js → organization-choice-CDIKnzm8.js} +1 -1
- package/dist/client/assets/{page-seo-form-IJ-KUJOg.js → page-seo-form-D3w0ugsb.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CzRrKflK.js +1 -0
- package/dist/client/assets/{popover-B4nSkpzt.js → popover-Dy620z40.js} +1 -1
- package/dist/client/assets/{post-editor-vZ-b91JL.js → post-editor-Cjv5M1C7.js} +1 -1
- package/dist/client/assets/{primitives-CI-aWHVO.js → primitives-CeyL9O6f.js} +1 -1
- package/dist/client/assets/{profile-0oepSurL.js → profile-CGOURzWz.js} +1 -1
- package/dist/client/assets/project-app-view-Ci5ijbnV.js +1 -0
- package/dist/client/assets/record-editor-apfYIYgs.js +1 -0
- package/dist/client/assets/registry-B5NA5t0H.js +2 -0
- package/dist/client/assets/{registry-layout-DReKgtms.js → registry-layout-DjNXalG2.js} +1 -1
- package/dist/client/assets/{require-capability-D6oo1Dzt.js → require-capability-B6PmnQEM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClQSk_2h.js → required-auth-layout-BRFENn4a.js} +1 -1
- package/dist/client/assets/{reset-password-Djev-X9J.js → reset-password-C_o-V2nb.js} +1 -1
- package/dist/client/assets/reusable-new-chat-CouMjkYR.js +1 -0
- package/dist/client/assets/{roles-DJmS1sX8.js → roles-C7H4Vsu1.js} +1 -1
- package/dist/client/assets/{search-input-BcUgqmRv.js → search-input-BSYCWPNM.js} +1 -1
- package/dist/client/assets/{secrets-DjJNoSuK.js → secrets-Bu5uRCvj.js} +1 -1
- package/dist/client/assets/{sections-editor-y5shOjUS.js → sections-editor-D0XaSNqf.js} +1 -1
- package/dist/client/assets/{select-BaDLhQEb.js → select-CLWKK083.js} +1 -1
- package/dist/client/assets/{select-model-D81bS-lc.js → select-model-ooCvgBCZ.js} +1 -1
- package/dist/client/assets/{seo-editor-CB4eImIk.js → seo-editor-tkCAedBf.js} +1 -1
- package/dist/client/assets/{settings-layout-BMCssriD.js → settings-layout-L5ljgzDG.js} +1 -1
- package/dist/client/assets/{settings-section-DR46skS-.js → settings-section-DtKsdMbr.js} +1 -1
- package/dist/client/assets/{shell-controls-YIGQzT0a.js → shell-controls-C4y6WtIi.js} +1 -1
- package/dist/client/assets/{shell-layout-TCpSs9Y5.js → shell-layout-BTwKtdY6.js} +1 -1
- package/dist/client/assets/{sidebar-C7fO4D9V.js → sidebar-Hnh8N3re.js} +1 -1
- package/dist/client/assets/{skeleton-CAOi_ooy.js → skeleton-D9HeFy5y.js} +1 -1
- package/dist/client/assets/{sso-Bqaq13hL.js → sso-B_bMJCUf.js} +1 -1
- package/dist/client/assets/{store-DpxxH8c9.js → store-B6ej4cPH.js} +1 -1
- package/dist/client/assets/store-registry-pi561QxD.js +2 -0
- package/dist/client/assets/{studio-tools-CmV0NtDK.js → studio-tools-DjujKIbI.js} +1 -1
- package/dist/client/assets/{switch-BxtOWcSw.js → switch-8KYa_UCO.js} +1 -1
- package/dist/client/assets/{table-BaAliMla.js → table-BLviG5A8.js} +1 -1
- package/dist/client/assets/{tabs-BLlm8IN7.js → tabs-g8N_huHa.js} +1 -1
- package/dist/client/assets/{textarea-DEEY14-m.js → textarea-DIggujOn.js} +1 -1
- package/dist/client/assets/{toggle-group-DKPYPivS.js → toggle-group-BMwGEOdl.js} +1 -1
- package/dist/client/assets/{toolbar-CQ2bY7nM.js → toolbar-iOqL0-f2.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-9swcIBG7.js → toolbar-icon-button-Dte9-O7I.js} +1 -1
- package/dist/client/assets/{tools-list-CxOgvEfc.js → tools-list-DeW_BPJj.js} +1 -1
- package/dist/client/assets/{tooltip-Ij_YZpjV.js → tooltip-7rmO1SJZ.js} +1 -1
- package/dist/client/assets/{types-CaRmyJ3Z.js → types-ghw9uAH-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bqem_Ni_.js → use-ai-providers-6w5aSThu.js} +1 -1
- package/dist/client/assets/{use-automations-DVf2d8nP.js → use-automations-CI509LOE.js} +1 -1
- package/dist/client/assets/{use-capability--7X3HzgD.js → use-capability-DGE3n3uO.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C3-KXjpp.js → use-clock-tick-BHYCGZec.js} +1 -1
- package/dist/client/assets/{use-collections-bYiHwAqi.js → use-collections-2O33yZ5I.js} +1 -1
- package/dist/client/assets/{use-connection-DLRtO28-.js → use-connection-tRZABVkm.js} +1 -1
- package/dist/client/assets/{use-copy-2VAtQOSp.js → use-copy-CnVIG3kY.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-rNXP73Ma.js → use-create-virtual-mcp-D3wTOfH8.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DIOfYkAw.js → use-debounced-autosave-DKVQlG8O.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Cfi_71N_.js → use-debounced-value-CSkUxE31.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-m_rWgP7C.js → use-decopilot-events-CAGjAP4U.js} +1 -1
- package/dist/client/assets/{use-delete-connection-FVBCqDV7.js → use-delete-connection-DBle47UE.js} +1 -1
- package/dist/client/assets/{use-file-configs-J0oMJQlC.js → use-file-configs-UUpCoAm4.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B4pxQ5Tk.js → use-infinite-scroll-BhYs2tKd.js} +1 -1
- package/dist/client/assets/{use-join-requests-CJD9Ps9Z.js → use-join-requests-DogGjKtD.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D-s_Nhny.js → use-mcp-client-Dddhpl7X.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-geO6J90S.js → use-mcp-prompts-CG0WQleI.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-sYfgfpBn.js → use-mcp-tools-DX_iCMqy.js} +1 -1
- package/dist/client/assets/{use-members-DhLzuvVY.js → use-members-CzQ8EZOW.js} +1 -1
- package/dist/client/assets/{use-mobile-BiJrfTiq.js → use-mobile-MMdg-8wB.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-C4Hjb0ga.js +1 -0
- package/dist/client/assets/{use-org-auth-client-BVnR7Uir.js → use-org-auth-client-CQ4uE1fS.js} +1 -1
- package/dist/client/assets/{use-org-sso-C-5a4qfw.js → use-org-sso-CpGeqWGo.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BSoMMUdz.js → use-organization-roles--nACnhjQ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-giZK1-yg.js → use-organization-settings-CWQ95aRt.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DtPC-vSS.js → use-registry-connections-B1YqB7Y3.js} +1 -1
- package/dist/client/assets/{use-secrets-CJQAc8xS.js → use-secrets-CFCOirva.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BpNh-3yu.js → use-status-sounds-dzacqGpF.js} +1 -1
- package/dist/client/assets/{use-view-mode-CgEnx4Dc.js → use-view-mode-CL75ARYO.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DFI8SsBb.js → use-virtual-mcp-pSc-vIfR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B-y8W6RY.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CQwQOnoh.js +1 -0
- package/dist/client/assets/{variant-calendar-C3E0HybO.js → variant-calendar-BhQDKdMb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DmO0XgmS.js → view-mode-toggle-BwwMhG16.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-YLw6qoBI.js +0 -1
- package/dist/client/assets/page-seo-sheet-BfZLc13w.js +0 -1
- package/dist/client/assets/project-app-view-CIEcz0wk.js +0 -1
- package/dist/client/assets/record-editor-D7Vax0PE.js +0 -1
- package/dist/client/assets/registry-UQrAK3M_.js +0 -2
- package/dist/client/assets/reusable-new-chat-qqWu133U.js +0 -1
- package/dist/client/assets/store-registry-B8w1ByiH.js +0 -2
- package/dist/client/assets/use-navigate-to-agent-BVPCCdAb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-LwwhKGtM.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CYW966BK.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as oe,r as K,b as yt,$ as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,ag as rs,u as os,M as xt,P as ls}from"./index-
|
|
1
|
+
import{c as oe,r as K,b as yt,$ as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,ag as rs,u as os,M as xt,P as ls}from"./index-XFpFdqPm.js";import{S as as}from"./search-input-BSYCWPNM.js";import{P as De}from"./index-CcbYSALo.js";import{E as St}from"./empty-state-Btv_n9n0.js";import{R as ns}from"./require-capability-B6PmnQEM.js";import{N as Tt,A as is,Q as cs,U as Mt,V as Ze,W as Pt,X as ft,Y as ds,Z as _t,_ as At,L as ms,$ as us,a0 as xs,a1 as pt}from"./automation-runs-DhLlbgN8.js";import{u as vt}from"./use-connection-tRZABVkm.js";import{g as Vt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-DJ9EyIQY.js";import{P as ct,a as dt,b as mt}from"./popover-Dy620z40.js";import{T as et,a as tt,b as st}from"./tooltip-7rmO1SJZ.js";import{i as ht}from"./Check-Dtq_ZK03.js";import{a as Xe}from"./Copy01-9mW_fZgj.js";import{n as Dt}from"./Globe01-Cbxk85ZZ.js";import{i as Ut}from"./FilterLines-C6wHOLww.js";import{i as fs}from"./Key01-CxxqcJgL.js";import{i as ps}from"./Play-CPmbBTg4.js";import{at as hs,X as gs}from"./agent-icon-Cby90nCh.js";import{M as Lt}from"./monaco-editor-DDxbCJLw.js";import{u as js}from"./use-members-CzQ8EZOW.js";import{u as vs}from"./use-mcp-client-Dddhpl7X.js";import{a as Ns}from"./use-virtual-mcp-pSc-vIfR.js";import{S as bs,W as ys}from"./constants-B72Xmt_K.js";import{n as Ge}from"./XCircle-CL7eXIc7.js";import{c as ws}from"./SwitchHorizontal01-CAoKt4Ii.js";import{s as Ss}from"./Plus-BxmFo7Ah.js";import{s as Is}from"./Trash01-D09UhMTX.js";import{I as Qe}from"./input-BJiUYbgO.js";import{c as ot,d as lt,S as at,b as Re,a as nt}from"./select-CLWKK083.js";import{t as Kt}from"./ChevronDown-CnEhgNqF.js";import{s as Cs}from"./Stars02-AjKchkXo.js";import{C as ks}from"./calendar-D1FhikzH.js";import{a as Ts}from"./Loading02-C9cshbgr.js";import{T as Ms}from"./textarea-DIggujOn.js";import{C as qt}from"./collection-tabs-BwJsnCrg.js";import{S as _s}from"./switch-8KYa_UCO.js";import{L as Ds}from"./label-D_8MbSWQ.js";import{I as qe}from"./integration-icon-CXzBwBk_.js";import{A as Bt}from"./avatar-B66RbKc-.js";import{A as Ls,a as $s,b as Fs}from"./alert-AqMEH2G7.js";import{C as Ht}from"./card-BIhB7wI7.js";import{K as Me}from"./monitoring-stats-row-CzBVTyxl.js";import{u as Jt}from"./studio-tools-DjujKIbI.js";import{u as Rs}from"./useSuspenseInfiniteQuery-CQwQOnoh.js";import{o as zs,m as Os,p as Es,q as Ps}from"./sidebar-Hnh8N3re.js";import{T as $e,a as ut,b as Qt,c as Gt,d as Wt,e as ae}from"./table-BLviG5A8.js";import{n as As}from"./ChevronUp-C9RkPySz.js";import{u as Vs}from"./use-infinite-scroll-BhYs2tKd.js";import{c as Us,b as Ks}from"./use-automations-CI509LOE.js";import"./SearchMd-afzoQhVg.js";import"./use-capability-DGE3n3uO.js";import"./access-gate-DJJeWvMD.js";import"./capability-load-error-CQoXLTuy.js";import"./useInfiniteQuery-B-y8W6RY.js";import"./use-clock-tick-BHYCGZec.js";import"./AlertCircle-VSaI59FL.js";import"./CheckCircle-DcKw1-_d.js";import"./Circle-RKd9aEK_.js";import"./checkbox-B3chUOm-.js";import"./command-hFeZ4ZXg.js";import"./index-Dji8gLZI.js";import"./dialog-6c27Cavq.js";import"./X-e27bh2iX.js";import"./Stars01-uqdNKK0n.js";import"./ChevronRight-Cc9IhBGK.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CnVIG3kY.js";import"./file-type-icon--Egm_X5V.js";import"./ZoomOut-DYLixJql.js";import"./use-mobile-MMdg-8wB.js";import"./tab-id-DAJ8K7VA.js";import"./types-ghw9uAH-.js";import"./chat-context-Bj1iYPUe.js";import"./autosend-DDZN4BkT.js";import"./hooks-DoEpIMJX.js";import"./decopilot-sse-pool-CLa9Mjl1.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-6w5aSThu.js";import"./use-decopilot-events-CAGjAP4U.js";import"./use-organization-settings-CWQ95aRt.js";import"./Eye-CEf8mFIt.js";import"./Star01-BMqZVOW6.js";import"./XClose-DlI5IzGh.js";import"./ZapSquare-D_oP0ssp.js";import"./Tool01-HSI0YX2B.js";import"./Monitor01-CWod5JNa.js";import"./Upload01-B89mYaQz.js";import"./shell-layout-BTwKtdY6.js";import"./Users03-CfkBBwwR.js";import"./SearchLg-Co57QkX5.js";import"./Zap-ZdxWAFQl.js";import"./alert-dialog-Qng6tGLP.js";import"./required-auth-layout-BRFENn4a.js";import"./use-org-sso-CpGeqWGo.js";import"./LinkExternal01-B7bA_SGH.js";import"./ArrowUpRight-DED_AlzP.js";import"./Palette-DE5FYpEZ.js";import"./use-navigate-to-agent-C4Hjb0ga.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-CG0WQleI.js";import"./form-CItZcoP-.js";import"./use-collections-2O33yZ5I.js";import"./Settings02-DJvoqnK4.js";import"./DotsVertical-B6GdVw3E.js";import"./Globe04-BKfzvVP_.js";import"./HardDrive-vWjfYQGf.js";import"./LayoutLeft-BylnsmzZ.js";import"./List-BQAXnC1p.js";import"./Sun-B8V2z0pg.js";import"./Shield01-Kx0eMb2U.js";import"./User01-C8AziRP3.js";import"./Users01-Dz_moui0.js";import"./index-B5sA1KL1.js";import"./use-org-auth-client-CQ4uE1fS.js";import"./auth-BHRTMZkH.js";import"./index-B8jnFOA3.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Fe(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function $t(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...o]=e.split("=");return{key:r||"",operator:"eq",value:o.join("=")}}if(e.includes("~")){const[r,...o]=e.split("~");return{key:r||"",operator:"contains",value:o.join("~")}}if(e.includes("@")){const[r,...o]=e.split("@");return{key:r||"",operator:"in",value:o.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},o=[],a={};for(const l of s)if(l.key.trim())switch(l.operator){case"eq":l.value&&(e[l.key]=l.value);break;case"contains":l.value&&(r[l.key]=`%${l.value}%`);break;case"exists":o.push(l.key);break;case"in":l.value&&(a[l.key]=l.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:o.length>0?o:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Ft(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,j as s,Y as He,r as E,l as F,M as oe,Z as bs,_ as js,a as he,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-Bt44PnRe.js";import{u as pe,S as ot,a as at,b as ae,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-C7fO4D9V.js";import{u as ct}from"./use-mobile-BiJrfTiq.js";import{S as te}from"./skeleton-CAOi_ooy.js";import{i as Gt}from"./LayoutLeft-Dso-Hp7h.js";import{T as ve}from"./toolbar-icon-button-9swcIBG7.js";import{P as Ge,a as ze,b as Ue}from"./popover-B4nSkpzt.js";import{D as Ut,a as Wt,b as qt}from"./drawer-Co8gs6Fc.js";import{A as Le}from"./avatar-7_Uhdx_X.js";import{a as ce,b as de,c as et,T as me}from"./tooltip-Ij_YZpjV.js";import{a as gt}from"./Copy01-DGePmtkb.js";import{n as Gs,i as Us}from"./Globe01-AfsxpWEz.js";import{i as Ws}from"./ZoomOut-XMF6Hmbx.js";import{i as qs,a as Ks}from"./ZapSquare-3oy0R3OW.js";import{i as tt}from"./Monitor01-Ce2ZwMhu.js";import{n as Xs,a as Vs}from"./Sun-CAUTRfSG.js";import{a as dt}from"./Settings02-CRGRSAHu.js";import{i as Ys}from"./Shield01-xemTf_mR.js";import{a as Qs}from"./Users03-B1TvK375.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-BSXg66GV.js";import"./index-DT_pxfPN.js";import{I as nn}from"./invite-member-dialog-7Oyroqqw.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-D2KQRe6c.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-l8Dhzxj_.js";import{i as mn}from"./FilterLines-C12Lixza.js";import{T as un,a as fn}from"./toggle-group-DKPYPivS.js";import{u as hn}from"./use-mcp-client-D-s_Nhny.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-DFI8SsBb.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-CWibMmJS.js";import{u as ft,r as vn}from"./shell-layout-TCpSs9Y5.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-BJif7vQZ.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-DNthJ8Gk.js";import{u as Yt}from"./studio-tools-CmV0NtDK.js";import{i as Qt}from"./Zap-De8VT9Ar.js";import{S as Jt,M as $n}from"./shell-controls-YIGQzT0a.js";import{n as Tn}from"./Stars02-FWKxJQ35.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-C3-KXjpp.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-6kN8920z.js";import{i as Fn}from"./ChevronRight-BJhJUvVR.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-BVPCCdAb.js";import{S as Hn,C as Gn}from"./chat-context-B9Eq-E53.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-VnuJ_lc-.js";import{i as es}from"./Check-DQ1PVQ4I.js";import{s as $e}from"./Plus-CIsE5lsO.js";import{i as ts}from"./SearchMd-D1KbAB6R.js";import{s as qn}from"./XClose-CxY7CjR_.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-C9Q0HiU1.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-DYhr6dqh.js";import{I as oi}from"./input-ByCtzJjh.js";import{G as ai,a as ci}from"./github-repo-picker-fG5k3Yhb.js";import{f as di}from"./reusable-new-chat-qqWu133U.js";import{T as Q}from"./toolbar-CQ2bY7nM.js";import{u as mi}from"./use-organization-settings-giZK1-yg.js";import"./X-CGii91yx.js";import"./User01-CBqYlP53.js";import"./AlertCircle-BkN6bE3e.js";import"./Tool01-DuWgaDgI.js";import"./SwitchHorizontal01-DK7ZWie5.js";import"./XCircle-jcGfwCOY.js";import"./ArrowUpRight-5g0rgyEC.js";import"./Loading02-e50-q8az.js";import"./CheckCircle-Dn6Sq1Kz.js";import"./ChevronUp-C0n1GZuy.js";import"./Circle-BkYlSdzx.js";import"./DotsVertical-i8KViG5B.js";import"./Eye-CbLv7QbD.js";import"./Star01-DFi111dk.js";import"./Globe04-Cmod1ST8.js";import"./HardDrive-CgIps4Rp.js";import"./Key01-CZNLoYYa.js";import"./LinkExternal01-D8IKDnEI.js";import"./List-CCdd_sXI.js";import"./Palette-Csw8BdBs.js";import"./Play-B84Z2az-.js";import"./SearchLg-C4wZw8rZ.js";import"./Stars01-BFOsGjiZ.js";import"./Trash01-dBMEpOnf.js";import"./Upload01-BPbaXMI5.js";import"./Users01-B3xL29oF.js";import"./select-BaDLhQEb.js";import"./textarea-DEEY14-m.js";import"./use-org-auth-client-BVnR7Uir.js";import"./use-organization-roles-BSoMMUdz.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BPmzaDbT.js";import"./use-registry-connections-DtPC-vSS.js";import"./use-connection-DLRtO28-.js";import"./use-collections-bYiHwAqi.js";import"./useInfiniteQuery-LwwhKGtM.js";import"./use-infinite-scroll-B4pxQ5Tk.js";import"./extract-connection-data-DaW8FJ6S.js";import"./card-C1FfzZgF.js";import"./integration-icon-BckRMEt9.js";import"./collection-search-DACuK1Wj.js";import"./collection-tabs-CmMnJDoD.js";import"./badge-CFfdJXOJ.js";import"./connection-form-helpers-CShUwEeG.js";import"./authenticate-and-persist-oauth-BnOYverB.js";import"./mcp-oauth-lk6nxTI-.js";import"./auth-D3vExR-4.js";import"./useSuspenseInfiniteQuery-CYW966BK.js";import"./use-ai-providers-Bqem_Ni_.js";import"./decopilot-sse-pool-DPcg5f2n.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-ClQSk_2h.js";import"./autosend-CPOpRl9-.js";import"./tab-id-DAJ8K7VA.js";import"./use-org-sso-C-5a4qfw.js";import"./index-jZB422cK.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-m_rWgP7C.js";import"./label-D1Gl0tP_.js";import"./use-debounced-value-Cfi_71N_.js";import"./use-mcp-tools-sYfgfpBn.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=E.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const v of g)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ae,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=F(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ae,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=F("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=F("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=F(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ae,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(E.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const B=n?.name??"User";let Z;e[3]!==B?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:B}),e[3]=B,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let ue;e[7]!==Z||e[8]!==ee?(ue=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=ue):ue=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let fe;e[13]!==be?(fe=s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=fe):fe=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(de,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==fe?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(me,{children:[fe,je]})}),e[16]=fe,e[17]=T):T=e[17];let H;e[18]!==T||e[19]!==W||e[20]!==ue?(H=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,ue,T]}),e[18]=T,e[19]=W,e[20]=ue,e[21]=H):H=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=F("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.46.7"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==H||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[H,ie,Ie]}),e[59]=H,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(gt,{size:14}),e[75]=v):v=e[75];let y;e[76]!==b?(y=s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=b,e[77]=y):y=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(de,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==y?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(me,{children:[y,w]})}),e[79]=y,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:B,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:B})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===B?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},B)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const L=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let P;e[107]!==L?(P=F("size-7 rounded-md flex items-center justify-center transition-colors",L),e[107]=L,e[108]=P):P=e[108];let D;e[109]!==o.enableSounds?(D=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=D):D=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==P||e[114]!==D?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:P,children:D}),e[111]=I,e[112]=M,e[113]=P,e[114]=D,e[115]=O):O=e[115];let R;e[116]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.46.7"]}),e[116]=R):R=e[116];let G;e[117]!==O?(G=s.jsxs("div",{className:"flex items-center gap-2",children:[O,R]}),e[117]=O,e[118]=G):G=e[118];let Y;e[119]!==_||e[120]!==G?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,G]}),e[119]=_,e[120]=G,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=he.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=E.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(Ys,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,v,y,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const L=M;let P;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(P={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:L,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=P):P=t[27];const D=P;let O;return t[28]!==c||t[29]!==m||t[30]!==D||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...D})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...D})})]})}),t[28]=c,t[29]=m,t[30]=D,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),he.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=E.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const v=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:v.length>0?`Available: ${v.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let v,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=()=>a(!0),y=s.jsx(tt,{}),e[6]=v,e[7]=y):(v=e[6],y=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(ce,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:v,children:[y,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(de,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(me,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(ce,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(de,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(me,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i extends E.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=F(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ae,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=E.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ae,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ae,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ae,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ae,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=E.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=F("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=E.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=I=>{I||r(""),l(I)},e[14]=l,e[15]=v):v=e[15];const y=v;let w;e[16]!==y||e[17]!==o?(w=I=>{y(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=y,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==y||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",v=0;let y;e[2]!==i?(y=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),i())},e[2]=i,e[3]=y):y=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=F("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:F("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const L="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!d&&s.jsx("span",{className:F("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:F(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[27]!==r?(D=r&&s.jsxs(me,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:G=>{G.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ws,{size:14})})}),s.jsx(de,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=D):D=e[28];let O;e[29]!==P||e[30]!==D?(O=s.jsxs("div",{className:L,children:[P,D]}),e[29]=P,e[30]=D,e[31]=O):O=e[31];let R;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==y||e[36]!==N||e[37]!==S||e[38]!==n.id?(R=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:v,onClick:i,onKeyDown:y,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=y,e[36]=N,e[37]=S,e[38]=n.id,e[39]=R):R=e[39],R}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=E.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const v=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),L=new Set(f.map(Zi)),P=Qi(_,L,t,e,n),D=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let R;return M!==void 0?R=Tt(D+P,M):R=_.length===0||P===0?!1:I,Vi(S,R),{...O,isFetching:!1,serverHasMore:R}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},y=c.isFetching||c.isProbing,w=!d&&!y&&Ki(j,c.serverHasMore);let C;return i[2]!==y||i[3]!==v||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},i[2]=y,i[3]=v,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=E.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let v;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(v=y=>s.jsx(rs,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:o&&y.created_by===d.currentUserId?()=>a(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=v):v=e[12],x=l.map(v),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=x):x=e[7];let p;e[8]!==u?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=e[12];let v;e[13]!==c.label?(v=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=v):v=e[14];let y;e[15]!==l.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=y):y=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==v||e[22]!==y?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,v,y]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=v,e[22]=y,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=v=>s.jsx(tl,{status:v.status,threads:v.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},v.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=E.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=F(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(ce,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(de,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(me,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function ms({onNavigate:t}={}){const{data:e}=he.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,v=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,y=()=>{t?.()},w=[...u].sort((T,H)=>(H.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=E.useState("all"),[S,A]=E.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=E.useState(!1),[M,L]=E.useState(!1),P={type:C,member:"mine",currentUserId:n??null},D=T=>n?T.filter(H=>H.created_by===n):[],O=T=>C==="automation"?T.filter(H=>!!H.trigger_id):C==="manual"?T.filter(H=>!H.trigger_id):T,R=D(w),G=O(R),Y=O(w),X=k?Y:G,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const H=T.id===b;if(f(T.id),!H)return;const V=sl(X,T.id,n);y(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{y(),g(T.id,T.virtual_mcp_id)},B=async T=>{try{const H=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((H.structuredContent??H).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=v??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const H=R.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(H&&await B(H.id)){y(),g(H.id,T);return}y(),j(T)},{state:ge,isMobile:ee,toggleSidebar:ue}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),H=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?H.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ae,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ue,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,fe=s.jsxs(Ge,{children:[s.jsxs(me,{children:[s.jsx(ce,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(de,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Jt,{}),fe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),L(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:F("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(E.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(E.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let v;e[26]!==b||e[27]!==j?(v=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=h,e[33]=y):y=e[33];let w;e[34]!==r||e[35]!==y?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:y})]}),e[34]=r,e[35]=y,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await he.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=E.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=F(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=E.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await he.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=E.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let v;e[10]!==i?(v=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==p||e[13]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,v]}),e[12]=p,e[13]=v,e[14]=y):y=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==y?(z=s.jsxs(s.Fragment,{children:[y,k]}),e[26]=k,e[27]=y,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=E.useState(!1),[u,f]=E.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let v;e[13]!==c||e[14]!==h||e[15]!==b?(v=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(ul,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let w;return e[19]!==y||e[20]!==v?(w=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=w):w=e[21],w}function jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=F("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(ce,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(de,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(me,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=E.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=he.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(B=>!x.has(B.id)).filter(Al).filter(B=>!a||B.title.toLowerCase().includes(p)),v=b.filter(kl),y=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=B=>{if(l){l(B.id),n(),o("");return}Bn({orgId:m.id,userId:f},B.id,h),g(),n(),o(""),j(B.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),L=y.length>0&&s.jsx(Ft,{children:"Agents"}),P=y.map(B=>s.jsx(Qe,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id)),D=(v.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=v.map(B=>s.jsx(Qe,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id));let R;e[5]!==N||e[6]!==a||e[7]!==b.length?(R=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=R):R=e[8];let G;e[9]!==R||e[10]!==M||e[11]!==L||e[12]!==P||e[13]!==D||e[14]!==O?(G=s.jsxs("div",{className:I,children:[M,L,P,D,O,R]}),e[9]=R,e[10]=M,e[11]=L,e[12]=P,e[13]=D,e[14]=O,e[15]=G):G=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==G||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,G,U]}),e[23]=G,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=E.useState(!1),[g,j]=E.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),v=b?"border border-border":void 0;let y;e[2]!==b?(y=L=>b?s.jsx(Nl,{children:L}):L,e[2]=b,e[3]=y):y=e[3];const w=y;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(E.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==v||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:F(v),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:F(v),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:L=>{L&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(L)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:F(v),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:F(v),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=v,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(43),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{setTaskId:m,createNewTask:u}=ft(),f=hs().invitations.length>0,h=n==="collapsed"||l;let g;t[2]!==e.id?(g=Re(e.id),t[2]=e.id,t[3]=g):g=t[3];const j=g,x=j.id,p=a.taskId?d.virtualmcpid??x:x;let b;t[4]!==u||t[5]!==x||t[6]!==i||t[7]!==e.slug||t[8]!==m||t[9]!==c?(b=O=>{if(!O||O===x){i({to:"/$org",params:{org:e.slug}});return}const R=di(c,O);R?m(R.id,O):u(O)},t[4]=u,t[5]=x,t[6]=i,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=b):b=t[10];const v=b,y=f?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let w;t[11]!==e?(w=s.jsx(pt,{org:e,size:"sm"}),t[11]=e,t[12]=w):w=t[12];let C;t[13]!==f||t[14]!==h?(C=f&&s.jsx("span",{className:F("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",h?"-top-1":"top-1/2 -translate-y-1/2")}),t[13]=f,t[14]=h,t[15]=C):C=t[15];let N;t[16]!==w||t[17]!==C?(N=s.jsxs("span",{className:"relative inline-flex",children:[w,C]}),t[16]=w,t[17]=C,t[18]=N):N=t[18];let S;t[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[19]=S):S=t[19];let A;t[20]!==y||t[21]!==N?(A=s.jsx(ce,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":y,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[N,S]})}),t[20]=y,t[21]=N,t[22]=A):A=t[22];let k;t[23]!==e.slug||t[24]!==A?(k=s.jsx(bl,{orgParam:e.slug,trigger:A}),t[23]=e.slug,t[24]=A,t[25]=k):k=t[25];let z;t[26]!==e.name?(z=s.jsx(de,{side:"bottom",children:e.name}),t[26]=e.name,t[27]=z):z=t[27];let _;t[28]!==k||t[29]!==z?(_=s.jsx(St,{children:s.jsxs(me,{children:[k,z]})}),t[28]=k,t[29]=z,t[30]=_):_=t[30];let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[31]=I):I=t[31];const M=p===x?j:void 0;let L;t[32]!==p||t[33]!==v?(L=()=>v(p),t[32]=p,t[33]=v,t[34]=L):L=t[34];let P;t[35]!==p||t[36]!==v||t[37]!==M||t[38]!==L?(P=s.jsx(St,{children:s.jsx(E.Suspense,{fallback:I,children:s.jsx(Tl,{agentId:p,fallback:M,onOpenHome:L,onPick:v})})}),t[35]=p,t[36]=v,t[37]=M,t[38]=L,t[39]=P):P=t[39];let D;return t[40]!==_||t[41]!==P?(D=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[_,P]})}),t[40]=_,t[41]=P,t[42]=D):D=t[42],D}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(E.Suspense,{fallback:s.jsx(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let v;return t[23]!==i||t[24]!==l||t[25]!==b?(v=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=v):v=t[26],v}function Pl(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(dl,{onClose:e})})})}export{Ko as default};
|
|
1
|
+
import{c as $,j as s,Y as He,r as L,l as E,M as oe,Z as bs,_ as js,a as ae,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-XFpFdqPm.js";import{u as pe,S as ot,a as at,b as ce,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-Hnh8N3re.js";import{u as ct}from"./use-mobile-MMdg-8wB.js";import{S as te}from"./skeleton-D9HeFy5y.js";import{i as Gt}from"./LayoutLeft-BylnsmzZ.js";import{T as ve}from"./toolbar-icon-button-Dte9-O7I.js";import{P as Ge,a as ze,b as Ue}from"./popover-Dy620z40.js";import{D as Ut,a as Wt,b as qt}from"./drawer-B69kdloU.js";import{A as Le}from"./avatar-B66RbKc-.js";import{a as de,b as me,c as et,T as ue}from"./tooltip-7rmO1SJZ.js";import{a as gt}from"./Copy01-9mW_fZgj.js";import{n as Gs,i as Us}from"./Globe01-Cbxk85ZZ.js";import{i as Ws}from"./ZoomOut-DYLixJql.js";import{i as qs,a as Ks}from"./ZapSquare-D_oP0ssp.js";import{i as tt}from"./Monitor01-CWod5JNa.js";import{n as Xs,a as Vs}from"./Sun-B8V2z0pg.js";import{a as dt}from"./Settings02-DJvoqnK4.js";import{i as Ys}from"./Shield01-Kx0eMb2U.js";import{a as Qs}from"./Users03-CfkBBwwR.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-Cby90nCh.js";import"./index-BF9UcDA9.js";import{I as nn}from"./invite-member-dialog-CmIWsjQw.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-Bmjqz6oG.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-CVJN8gi3.js";import{i as mn}from"./FilterLines-C6wHOLww.js";import{T as un,a as fn}from"./toggle-group-BMwGEOdl.js";import{u as hn}from"./use-mcp-client-Dddhpl7X.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-pSc-vIfR.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-DoEpIMJX.js";import{u as ft,r as vn}from"./shell-layout-BTwKtdY6.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-6c27Cavq.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-hFeZ4ZXg.js";import{u as Yt}from"./studio-tools-DjujKIbI.js";import{i as Qt}from"./Zap-ZdxWAFQl.js";import{S as Jt,M as $n}from"./shell-controls-C4y6WtIi.js";import{n as Tn}from"./Stars02-AjKchkXo.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-BHYCGZec.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-CnEhgNqF.js";import{i as Fn}from"./ChevronRight-Cc9IhBGK.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-C4Hjb0ga.js";import{S as Hn,C as Gn}from"./chat-context-Bj1iYPUe.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-CAS0W611.js";import{i as es}from"./Check-Dtq_ZK03.js";import{s as $e}from"./Plus-BxmFo7Ah.js";import{i as ts}from"./SearchMd-afzoQhVg.js";import{s as qn}from"./XClose-DlI5IzGh.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-Qng6tGLP.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-CItZcoP-.js";import{I as oi}from"./input-BJiUYbgO.js";import{G as ai,a as ci}from"./github-repo-picker-FhzwcWiZ.js";import{f as di}from"./reusable-new-chat-CouMjkYR.js";import{T as Q}from"./toolbar-iOqL0-f2.js";import{u as mi}from"./use-organization-settings-CWQ95aRt.js";import"./X-e27bh2iX.js";import"./User01-C8AziRP3.js";import"./AlertCircle-VSaI59FL.js";import"./Tool01-HSI0YX2B.js";import"./SwitchHorizontal01-CAoKt4Ii.js";import"./XCircle-CL7eXIc7.js";import"./ArrowUpRight-DED_AlzP.js";import"./Loading02-C9cshbgr.js";import"./CheckCircle-DcKw1-_d.js";import"./ChevronUp-C9RkPySz.js";import"./Circle-RKd9aEK_.js";import"./DotsVertical-B6GdVw3E.js";import"./Eye-CEf8mFIt.js";import"./Star01-BMqZVOW6.js";import"./Globe04-BKfzvVP_.js";import"./HardDrive-vWjfYQGf.js";import"./Key01-CxxqcJgL.js";import"./LinkExternal01-B7bA_SGH.js";import"./List-BQAXnC1p.js";import"./Palette-DE5FYpEZ.js";import"./Play-CPmbBTg4.js";import"./SearchLg-Co57QkX5.js";import"./Stars01-uqdNKK0n.js";import"./Trash01-D09UhMTX.js";import"./Upload01-B89mYaQz.js";import"./Users01-Dz_moui0.js";import"./select-CLWKK083.js";import"./textarea-DIggujOn.js";import"./use-org-auth-client-CQ4uE1fS.js";import"./use-organization-roles--nACnhjQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B7uE3W0c.js";import"./use-registry-connections-B1YqB7Y3.js";import"./use-connection-tRZABVkm.js";import"./use-collections-2O33yZ5I.js";import"./useInfiniteQuery-B-y8W6RY.js";import"./use-infinite-scroll-BhYs2tKd.js";import"./extract-connection-data-Dw8rQNAA.js";import"./card-BIhB7wI7.js";import"./integration-icon-CXzBwBk_.js";import"./collection-search-BXrUEEhc.js";import"./collection-tabs-BwJsnCrg.js";import"./badge-DJ9EyIQY.js";import"./connection-form-helpers-BeWWRlSK.js";import"./authenticate-and-persist-oauth-DyU8DyC8.js";import"./mcp-oauth-DKQ4y2A8.js";import"./auth-BHRTMZkH.js";import"./useSuspenseInfiniteQuery-CQwQOnoh.js";import"./use-ai-providers-6w5aSThu.js";import"./decopilot-sse-pool-CLa9Mjl1.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-BRFENn4a.js";import"./autosend-DDZN4BkT.js";import"./tab-id-DAJ8K7VA.js";import"./use-org-sso-CpGeqWGo.js";import"./index-Dji8gLZI.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-CAGjAP4U.js";import"./label-D_8MbSWQ.js";import"./use-debounced-value-CSkUxE31.js";import"./use-mcp-tools-DX_iCMqy.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ce,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=E(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=E("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(L.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const R=n?.name??"User";let Z;e[3]!==R?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:R}),e[3]=R,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let fe;e[7]!==Z||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=fe):fe=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let he;e[13]!==be?(he=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=he):he=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==he?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[he,je]})}),e[16]=he,e[17]=T):T=e[17];let G;e[18]!==T||e[19]!==W||e[20]!==fe?(G=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,fe,T]}),e[18]=T,e[19]=W,e[20]=fe,e[21]=G):G=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=E("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.46.8"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==G||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,ie,Ie]}),e[59]=G,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:R,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:R})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===R?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},R)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const H=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[107]!==H?(D=E("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=D):D=e[108];let P;e[109]!==o.enableSounds?(P=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=P):P=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==D||e[114]!==P?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:D,children:P}),e[111]=I,e[112]=M,e[113]=D,e[114]=P,e[115]=O):O=e[115];let F;e[116]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.46.8"]}),e[116]=F):F=e[116];let B;e[117]!==O?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[O,F]}),e[117]=O,e[118]=B):B=e[118];let Y;e[119]!==_||e[120]!==B?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,B]}),e[119]=_,e[120]=B,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=ae.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=L.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(Ys,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let D;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(D={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:H,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=D):D=t[27];const P=D;let O;return t[28]!==c||t[29]!==m||t[30]!==P||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...P})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...P})})]})}),t[28]=c,t[29]=m,t[30]=P,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),ae.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=L.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(de,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(me,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(ue,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(me,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(ue,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=E(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ce,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ce,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ce,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ce,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ce,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=L.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=E("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",D=!d&&s.jsx("span",{className:E("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:E(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[27]!==r?(P=r&&s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:B=>{B.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ws,{size:14})})}),s.jsx(me,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=P):P=e[28];let O;e[29]!==D||e[30]!==P?(O=s.jsxs("div",{className:H,children:[D,P]}),e[29]=D,e[30]=P,e[31]=O):O=e[31];let F;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(F=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=F):F=e[39],F}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),H=new Set(f.map(Zi)),D=Qi(_,H,t,e,n),P=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let F;return M!==void 0?F=Tt(P+D,M):F=_.length===0||D===0?!1:I,Vi(S,F),{...O,isFetching:!1,serverHasMore:F}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&Ki(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=L.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],x=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=x):x=e[7];let p;e[8]!==u?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(tl,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=E(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(me,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(ue,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function ms({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,G)=>(G.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=L.useState(!1),[M,H]=L.useState(!1),D={type:C,member:"mine",currentUserId:n??null},P=T=>n?T.filter(G=>G.created_by===n):[],O=T=>C==="automation"?T.filter(G=>!!G.trigger_id):C==="manual"?T.filter(G=>!G.trigger_id):T,F=P(w),B=O(F),Y=O(w),X=k?Y:B,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const G=T.id===b;if(f(T.id),!G)return;const V=sl(X,T.id,n);v(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{v(),g(T.id,T.virtual_mcp_id)},R=async T=>{try{const G=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((G.structuredContent??G).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const G=F.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(G&&await R(G.id)){v(),g(G.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:fe}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),G=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?G.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ce,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fe,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,he=s.jsxs(Ge,{children:[s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(me,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:E("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Jt,{}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:E("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=h,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=L.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await ae.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(ul,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=E("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(de,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(me,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ue,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=L.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=ae.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(R=>!x.has(R.id)).filter(Al).filter(R=>!a||R.title.toLowerCase().includes(p)),y=b.filter(kl),v=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=R=>{if(l){l(R.id),n(),o("");return}Bn({orgId:m.id,userId:f},R.id,h),g(),n(),o(""),j(R.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),H=v.length>0&&s.jsx(Ft,{children:"Agents"}),D=v.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id)),P=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id));let F;e[5]!==N||e[6]!==a||e[7]!==b.length?(F=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=F):F=e[8];let B;e[9]!==F||e[10]!==M||e[11]!==H||e[12]!==D||e[13]!==P||e[14]!==O?(B=s.jsxs("div",{className:I,children:[M,H,D,P,O,F]}),e[9]=F,e[10]=M,e[11]=H,e[12]=D,e[13]=P,e[14]=O,e[15]=B):B=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==B||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,B,U]}),e[23]=B,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=L.useState(!1),[g,j]=L.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=H=>b?s.jsx(Nl,{children:H}):H,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:H=>{H&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(H)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(44),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{data:m}=ae.useSession(),{setTaskId:u,createNewTask:f}=ft(),h=hs().invitations.length>0,g=n==="collapsed"||l;let j;t[2]!==e.id?(j=Re(e.id),t[2]=e.id,t[3]=j):j=t[3];const x=j,p=x.id,b=a.taskId?d.virtualmcpid??p:p;let y;t[4]!==f||t[5]!==p||t[6]!==i||t[7]!==e.slug||t[8]!==m?.user?.id||t[9]!==u||t[10]!==c?(y=F=>{if(!F||F===p){i({to:"/$org",params:{org:e.slug}});return}const B=di(c,F,m?.user?.id);B?u(B.id,F):f(F)},t[4]=f,t[5]=p,t[6]=i,t[7]=e.slug,t[8]=m?.user?.id,t[9]=u,t[10]=c,t[11]=y):y=t[11];const v=y,w=h?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let C;t[12]!==e?(C=s.jsx(pt,{org:e,size:"sm"}),t[12]=e,t[13]=C):C=t[13];let N;t[14]!==h||t[15]!==g?(N=h&&s.jsx("span",{className:E("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",g?"-top-1":"top-1/2 -translate-y-1/2")}),t[14]=h,t[15]=g,t[16]=N):N=t[16];let S;t[17]!==C||t[18]!==N?(S=s.jsxs("span",{className:"relative inline-flex",children:[C,N]}),t[17]=C,t[18]=N,t[19]=S):S=t[19];let A;t[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[20]=A):A=t[20];let k;t[21]!==w||t[22]!==S?(k=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":w,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[S,A]})}),t[21]=w,t[22]=S,t[23]=k):k=t[23];let z;t[24]!==e.slug||t[25]!==k?(z=s.jsx(bl,{orgParam:e.slug,trigger:k}),t[24]=e.slug,t[25]=k,t[26]=z):z=t[26];let _;t[27]!==e.name?(_=s.jsx(me,{side:"bottom",children:e.name}),t[27]=e.name,t[28]=_):_=t[28];let I;t[29]!==z||t[30]!==_?(I=s.jsx(St,{children:s.jsxs(ue,{children:[z,_]})}),t[29]=z,t[30]=_,t[31]=I):I=t[31];let M;t[32]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[32]=M):M=t[32];const H=b===p?x:void 0;let D;t[33]!==b||t[34]!==v?(D=()=>v(b),t[33]=b,t[34]=v,t[35]=D):D=t[35];let P;t[36]!==b||t[37]!==v||t[38]!==H||t[39]!==D?(P=s.jsx(St,{children:s.jsx(L.Suspense,{fallback:M,children:s.jsx(Tl,{agentId:b,fallback:H,onOpenHome:D,onPick:v})})}),t[36]=b,t[37]=v,t[38]=H,t[39]=D,t[40]=P):P=t[40];let O;return t[41]!==I||t[42]!==P?(O=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[I,P]})}),t[41]=I,t[42]=P,t[43]=O):O=t[43],O}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let y;return t[23]!==i||t[24]!==l||t[25]!==b?(y=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=y):y=t[26],y}function Pl(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(dl,{onClose:e})})})}export{Ko as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,aT as q,cq as R,cr as Ee,cs as ke,ct as Se,bM as xe,cu as j}from"./index-Bt44PnRe.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,aT as q,cq as R,cr as Ee,cs as ke,ct as Se,bM as xe,cu as j}from"./index-XFpFdqPm.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|