decocms 3.30.1 → 3.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BQLR7I4E.js → AlertCircle-CNjNg2wb.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DSaWSvAP.js → ArrowUpRight-7-SM74wR.js} +1 -1
- package/dist/client/assets/{Check-DCDpfG7m.js → Check-CkY-NLLZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-BBK-3Pzt.js → CheckCircle-DYKqL__C.js} +1 -1
- package/dist/client/assets/{ChevronDown-BD0G-h2k.js → ChevronDown-B8XrNXeE.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DtP_Ayjz.js → ChevronLeft-B6gErU0k.js} +1 -1
- package/dist/client/assets/{ChevronRight-DUzhuedZ.js → ChevronRight-BJRYs8bt.js} +1 -1
- package/dist/client/assets/{ChevronUp-D5M0geM5.js → ChevronUp-CgxnjYlU.js} +1 -1
- package/dist/client/assets/{Container-Catp9d2q.js → Container-Dt-ev6Gi.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dok1GVxI.js → DotsVertical-BwZzHCbU.js} +1 -1
- package/dist/client/assets/{Eye-Dmik5hYP.js → Eye-Co-ItdFE.js} +1 -1
- package/dist/client/assets/{FilterLines-C37LaXJ1.js → FilterLines-DwPmuK2v.js} +1 -1
- package/dist/client/assets/{Globe01-D1c-3J9t.js → Globe01-BnLBFtky.js} +1 -1
- package/dist/client/assets/{HardDrive-C1vRZoAn.js → HardDrive-DmPQQU2w.js} +1 -1
- package/dist/client/assets/{Key01-CdveS1HN.js → Key01-BuFH2ztD.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bfxz6P9F.js → LayoutLeft-DOdRMzln.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CxEkPs1F.js → LinkExternal01-ZepkFy5p.js} +1 -1
- package/dist/client/assets/{Monitor01-Bkoa3Nbe.js → Monitor01-5IIvvy6H.js} +1 -1
- package/dist/client/assets/{Palette-C74Da44y.js → Palette-Cu3PTFf5.js} +1 -1
- package/dist/client/assets/{Play-BERjgeke.js → Play-4vubxqND.js} +1 -1
- package/dist/client/assets/{Plus-CdvauR8B.js → Plus-DrYyBDmj.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-4ELQWtuB.js → RefreshCcw01-eSV0Gr10.js} +1 -1
- package/dist/client/assets/{SearchMd-DvX2rzEB.js → SearchMd-Dq0euRWv.js} +1 -1
- package/dist/client/assets/{Settings02-Cqwfv4FN.js → Settings02-B_z2JeIq.js} +1 -1
- package/dist/client/assets/{Shield01-6id4oLiZ.js → Shield01-Dmf7TklI.js} +1 -1
- package/dist/client/assets/{Star01--MeVNqbA.js → Star01-ChWAyIjY.js} +1 -1
- package/dist/client/assets/{Stars01-C2BTpZeS.js → Stars01-DbI-YGmK.js} +1 -1
- package/dist/client/assets/{Stars02-D6zEAnUT.js → Stars02-WR3K9Daq.js} +1 -1
- package/dist/client/assets/{Sun-BGVsB7Cm.js → Sun-BIJajZBA.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DC97OO23.js → SwitchHorizontal01-BjyN-RbX.js} +1 -1
- package/dist/client/assets/{Tool01-DQ4cTbeu.js → Tool01-Nn7pl58k.js} +1 -1
- package/dist/client/assets/{Trash01-Biurgfq6.js → Trash01-BW2v6vxa.js} +1 -1
- package/dist/client/assets/{Upload01-B-0o1yeU.js → Upload01-CyW8Wv9e.js} +1 -1
- package/dist/client/assets/{User01-CZ5ejYDg.js → User01-BBVMvdD1.js} +1 -1
- package/dist/client/assets/{Users01-CKNLJr4G.js → Users01-3QXDJ7kM.js} +1 -1
- package/dist/client/assets/{Users03-CA9cu5qb.js → Users03-Dc2Q2YCx.js} +1 -1
- package/dist/client/assets/{X-DlMQL-XM.js → X-BUrHvnq3.js} +1 -1
- package/dist/client/assets/{XCircle-G0WrPq0g.js → XCircle-Bz32In76.js} +1 -1
- package/dist/client/assets/{XClose-LNW85JIs.js → XClose-D4SdKRIc.js} +1 -1
- package/dist/client/assets/{Zap-CbtV6Vvm.js → Zap-DAhQN3Qe.js} +1 -1
- package/dist/client/assets/{ZapSquare-C9LhFrIW.js → ZapSquare-DdYqdyu4.js} +1 -1
- package/dist/client/assets/{ZoomOut-CImzlj9g.js → ZoomOut-BP5vTMyD.js} +1 -1
- package/dist/client/assets/{access-gate-DR0BZ9Yv.js → access-gate-CGZv0aLQ.js} +1 -1
- package/dist/client/assets/{accordion-CiWkTYYE.js → accordion-CGxHoi6P.js} +1 -1
- package/dist/client/assets/add-section-modal-DLCZWYmt.js +1 -0
- package/dist/client/assets/agent-capabilities-BOt7wU7l.js +3 -0
- package/dist/client/assets/{agent-icon-CjlB-XbA.js → agent-icon-DbC1U9Lv.js} +1 -1
- package/dist/client/assets/{agent-icons-COjGtXRX.js → agent-icons-B273VQSG.js} +2 -2
- package/dist/client/assets/{agents-list-BbpQy40q.js → agents-list-Dpi-AAFb.js} +1 -1
- package/dist/client/assets/{ai-providers-YKtufrsd.js → ai-providers-DGbRuhig.js} +1 -1
- package/dist/client/assets/{alert-DUOzDLz2.js → alert-dB15ZxT2.js} +1 -1
- package/dist/client/assets/{alert-dialog-ZB1-0uWA.js → alert-dialog-CstddcEP.js} +2 -2
- package/dist/client/assets/app-editor-Cq82w23j.js +1 -0
- package/dist/client/assets/{auth-catchall-p-9cQrp4.js → auth-catchall-2_Uziri1.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DCQZj1x8.js → auth-split-layout-BBSUM3P9.js} +1 -1
- package/dist/client/assets/{automation-list-row-1QBzAyda.js → automation-list-row-DeSlvYhB.js} +1 -1
- package/dist/client/assets/{automation-runs-CbXniThO.js → automation-runs-D6XH4v3a.js} +1 -1
- package/dist/client/assets/{automations-DXbm14M-.js → automations-DouKICLt.js} +1 -1
- package/dist/client/assets/{avatar-DdrKHW7Q.js → avatar-Glcqg-C7.js} +1 -1
- package/dist/client/assets/{badge-GxV01_sa.js → badge-CjjK5Sr7.js} +1 -1
- package/dist/client/assets/{brand-context-CckU9jvo.js → brand-context-DdQVWL7M.js} +1 -1
- package/dist/client/assets/{buckets-BXxpFWbP.js → buckets-DVxXOURG.js} +1 -1
- package/dist/client/assets/{calendar-ndWEDvWe.js → calendar-D0KKVHnd.js} +1 -1
- package/dist/client/assets/{capability-load-error-C1lcmzPk.js → capability-load-error-B_GRCsfG.js} +1 -1
- package/dist/client/assets/{card-B7vNztnP.js → card-DeDg0Mpx.js} +1 -1
- package/dist/client/assets/{chat-context-Dr8mURNn.js → chat-context-Dd9y-6Y-.js} +1 -1
- package/dist/client/assets/{checkbox-CvlqSsv8.js → checkbox-D292XxeM.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DbBnzJkW.js → cli-auth-success-DF9o-evj.js} +1 -1
- package/dist/client/assets/{collection-detail-dh1JPTkf.js → collection-detail-ZNirTQKs.js} +1 -1
- package/dist/client/assets/{collection-display-button-ByiFEfVE.js → collection-display-button-BHNg4RzF.js} +1 -1
- package/dist/client/assets/{collection-search-B62hBYcH.js → collection-search-CFFTRK3x.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-p305Tve_.js → collection-table-wrapper-CJC6Vyfs.js} +1 -1
- package/dist/client/assets/{collection-tabs-BoWbncvo.js → collection-tabs-Da8fu2pB.js} +1 -1
- package/dist/client/assets/{collections-BU-b7Qnp.js → collections-CWnO7g9J.js} +1 -1
- package/dist/client/assets/{command-DeymMKPH.js → command-Dm1ALJPS.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-B6fCPmnk.js → connect-desktop-dialog-CNaHa2Dn.js} +1 -1
- package/dist/client/assets/{connection-card-BdHs3sI8.js → connection-card-J_g5yRQM.js} +1 -1
- package/dist/client/assets/{connection-detail-1bfT9skO.js → connection-detail-CtdPxsW2.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cl8WE-Wv.js → connection-form-helpers-0bmqzhLl.js} +1 -1
- package/dist/client/assets/connections-P_p0V_Q0.js +1 -0
- package/dist/client/assets/decopilot-sse-pool-BemyIcDl.js +1 -0
- package/dist/client/assets/{dialog-Bug5LYvY.js → dialog-B4Gk40Ec.js} +1 -1
- package/dist/client/assets/{domain-settings-CiVW_jUc.js → domain-settings-BDb8F-pn.js} +1 -1
- package/dist/client/assets/{drawer-Ckfnpw8I.js → drawer-C8AwBmXm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CggnBdjt.js → dropdown-menu-D2S2HMhI.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-yS0CT9hK.js → dynamic-plugin-layout-Dg3kd-lT.js} +1 -1
- package/dist/client/assets/{empty-state-C6yeON6c.js → empty-state-BEPxxZyq.js} +1 -1
- package/dist/client/assets/{empty-state-DtTBbW_W.js → empty-state-ZcLmoTrQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BR7VTC2M.js → extract-connection-data-Cdme2PYD.js} +1 -1
- package/dist/client/assets/{features-fQ1ChqbW.js → features-Dg5ySgax.js} +1 -1
- package/dist/client/assets/file-explorer-NmtOY4n0.js +2 -0
- package/dist/client/assets/{file-type-icon-Dg4vNCbL.js → file-type-icon-ByhQy2rW.js} +1 -1
- package/dist/client/assets/{files-C7GL35WM.js → files-CGUJegiW.js} +1 -1
- package/dist/client/assets/{form-Bkkvnz-_.js → form-DzqpARCW.js} +1 -1
- package/dist/client/assets/{general-T2AFh9Ye.js → general-BaZ3r2GW.js} +1 -1
- package/dist/client/assets/{generate-id-DfnWKozM.js → generate-id-DCN1LrlB.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BKJVsWG6.js → github-repo-picker-DifHpnDV.js} +1 -1
- package/dist/client/assets/{header-tab-button-CfuW1KOG.js → header-tab-button-CyQ_CUpS.js} +1 -1
- package/dist/client/assets/{hover-card-7wnR4X6J.js → hover-card-fQ5zGcbl.js} +1 -1
- package/dist/client/assets/{image-field-DsnvgvCV.js → image-field-_Av_lLAg.js} +1 -1
- package/dist/client/assets/{index-uM9cBeAz.js → index--VFF-Fa0.js} +1 -1
- package/dist/client/assets/{index-BL9vKovB.js → index-0pKQiQw5.js} +4 -4
- package/dist/client/assets/{index-CCldjkHi.js → index-Bkgvp8b5.js} +1 -1
- package/dist/client/assets/{index-CV7TX6uY.js → index-BlbwvYId.js} +1 -1
- package/dist/client/assets/{index-CvubZqsl.js → index-Brb5zXrs.js} +1 -1
- package/dist/client/assets/{index-BDwe75Ed.js → index-CDPDznJw.js} +1 -1
- package/dist/client/assets/{index-C_NDVGp1.js → index-CDa8r-Ay.js} +1 -1
- package/dist/client/assets/index-CXYYh-WP.js +1 -0
- package/dist/client/assets/{index-K-cFrJme.js → index-D3IoOs9k.js} +1 -1
- package/dist/client/assets/{index-M8U0QO9V.js → index-D7vPwljU.js} +1 -1
- package/dist/client/assets/index-D_v0xAjK.js +8 -0
- package/dist/client/assets/{index-BjoOIgbb.js → index-DjCrtoJM.js} +3 -3
- package/dist/client/assets/{index-C6AFi5aI.js → index-H-an7LFa.js} +1 -1
- package/dist/client/assets/{index-BD68Poau.js → index-grq1eXi6.js} +1 -1
- package/dist/client/assets/{index-redirect-CDKs11B5.js → index-redirect-DtYqdHDy.js} +1 -1
- package/dist/client/assets/index-snZrdd2U.js +1 -0
- package/dist/client/assets/{input-CAytkUdm.js → input-odGTsdHi.js} +1 -1
- package/dist/client/assets/{integration-icon-BxZqCPgY.js → integration-icon-CYVpZTf5.js} +1 -1
- package/dist/client/assets/{label-_bcDhrPn.js → label-CO8q2BMX.js} +1 -1
- package/dist/client/assets/{layout-D6JyUu-W.js → layout-mA5Rj_u2.js} +1 -1
- package/dist/client/assets/{login-D_Y894-5.js → login-BdTiL4Ph.js} +1 -1
- package/dist/client/assets/{members-BiZDHDwm.js → members-K2LSrSOy.js} +1 -1
- package/dist/client/assets/monaco-editor-DKpM33ac.js +9 -0
- package/dist/client/assets/{monitoring-stats-row-BH1n8Qao.js → monitoring-stats-row-C1HQhYEp.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bwrh5dBF.js → oauth-callback-RCth5FgJ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DnFWhV-5.js → oauth-callback-ai-provider-Bx_f4SNv.js} +1 -1
- package/dist/client/assets/{onboarding-0pY55b33.js → onboarding-Cw0yv-ax.js} +1 -1
- package/dist/client/assets/{org-install-CfS-9owX.js → org-install-C5oIAlaU.js} +1 -1
- package/dist/client/assets/{org-layout-WjhxFhVG.js → org-layout-AJN3IVEY.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CBd88Pps.js → org-plugin-layout-DeLJrvoA.js} +1 -1
- package/dist/client/assets/{page-seo-form-DA-M0CRU.js → page-seo-form-2v7yqwmW.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DEYwDlV3.js +1 -0
- package/dist/client/assets/{pair-rWOsLIRO.js → pair-C9I7jtDw.js} +6 -6
- package/dist/client/assets/{plugin-empty-state-BC-cPjsG.js → plugin-empty-state-BllJH9a8.js} +1 -1
- package/dist/client/assets/{plugin-header-CZ1sX2n9.js → plugin-header-pbmKrc1L.js} +1 -1
- package/dist/client/assets/{plugin-layout-egGFGy3C.js → plugin-layout-DRXLQokx.js} +1 -1
- package/dist/client/assets/{popover-H1IIsqsO.js → popover-ChUM3TFy.js} +1 -1
- package/dist/client/assets/{post-editor-D8Amc377.js → post-editor-DBJSrVd6.js} +2 -2
- package/dist/client/assets/{primitives-DXNs_riQ.js → primitives-CDySgipF.js} +1 -1
- package/dist/client/assets/{profile-jQNt2qst.js → profile-C7vJk0Kt.js} +1 -1
- package/dist/client/assets/project-app-view-iV-1n2vK.js +1 -0
- package/dist/client/assets/record-editor-bmEKAE4B.js +1 -0
- package/dist/client/assets/registry-CT2kzs1z.js +2 -0
- package/dist/client/assets/registry-layout-CBGi99kW.js +27 -0
- package/dist/client/assets/{require-capability-g-UPmpGK.js → require-capability-XeIce_Pd.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B5sViZsY.js → required-auth-layout-BBVKG7Ms.js} +1 -1
- package/dist/client/assets/{reset-password-BC3ZM7w0.js → reset-password-CZ2_k_ln.js} +1 -1
- package/dist/client/assets/{resizable-DaIe2JEk.js → resizable-DYZX4GYZ.js} +1 -1
- package/dist/client/assets/roles-eO3gNPsn.js +1 -0
- package/dist/client/assets/save-referenced-block-erNAPeZK.js +1 -0
- package/dist/client/assets/{save-status-DaG-SHKI.js → save-status-DGCu0Kou.js} +1 -1
- package/dist/client/assets/{schema-form-BBSGBJV6.js → schema-form-CnMZQoIC.js} +1 -1
- package/dist/client/assets/{scroll-area-7dB1B4gR.js → scroll-area-D-xuBg8S.js} +1 -1
- package/dist/client/assets/{search-input-DwwxFJsd.js → search-input-BOFnCDgB.js} +1 -1
- package/dist/client/assets/{secrets-BVqejBQE.js → secrets-BLYQN7Zp.js} +1 -1
- package/dist/client/assets/{sections-editor-B1P_XWwE.js → sections-editor-BFS_rZo4.js} +2 -2
- package/dist/client/assets/{select-Dn6Da_1F.js → select-B1gidrpT.js} +1 -1
- package/dist/client/assets/{select-model-W59Bilmt.js → select-model-CCz1D052.js} +1 -1
- package/dist/client/assets/seo-editor-ClvdYMyV.js +1 -0
- package/dist/client/assets/{settings-layout-DypT7z1u.js → settings-layout-ParxM_Ja.js} +1 -1
- package/dist/client/assets/{settings-section-BkgYqxH8.js → settings-section-DDBr5t6q.js} +1 -1
- package/dist/client/assets/{sheet-CxiAY8T5.js → sheet-BwcUAu7J.js} +1 -1
- package/dist/client/assets/{shell-controls-rZ6L5v7J.js → shell-controls-a5C7q3sv.js} +1 -1
- package/dist/client/assets/{shell-layout-B5B3hmRp.js → shell-layout-jPbG1TxD.js} +1 -1
- package/dist/client/assets/shell-route-loading-CrwP7Moq.js +1 -0
- package/dist/client/assets/{sidebar-CIJpOENy.js → sidebar-D0YkKw2Q.js} +1 -1
- package/dist/client/assets/{skeleton-B0e2OkSv.js → skeleton-BnLuwQl0.js} +1 -1
- package/dist/client/assets/{sortable.esm-B6-kJBUo.js → sortable.esm-DHNuKLSF.js} +1 -1
- package/dist/client/assets/{spinner-C2ljLkNd.js → spinner-C_dp5faG.js} +1 -1
- package/dist/client/assets/{sso-DutRn6kP.js → sso-Dv0vfQwF.js} +1 -1
- package/dist/client/assets/{store-CuKFTdG_.js → store-CzOlrmK7.js} +1 -1
- package/dist/client/assets/store-registry-BBiSNL3g.js +2 -0
- package/dist/client/assets/{studio-tools-DfxdEEgB.js → studio-tools-C1zamUp1.js} +1 -1
- package/dist/client/assets/{switch-DDGBJlE2.js → switch-Co2WNb8L.js} +1 -1
- package/dist/client/assets/{tab-id-TBSp1YxU.js → tab-id-Br9ttHTZ.js} +1 -1
- package/dist/client/assets/{table-GnXYzms9.js → table-DXm5sFe0.js} +1 -1
- package/dist/client/assets/{tabs-BajnAGhM.js → tabs-Bhgl3qMn.js} +1 -1
- package/dist/client/assets/{task-status-fWcsMePP.js → task-status-BYl9XRWC.js} +1 -1
- package/dist/client/assets/{textarea-JAS7Y9kw.js → textarea-DkHK4zFC.js} +1 -1
- package/dist/client/assets/{toggle-group-Bv21I6Mc.js → toggle-group-i9f6SFf7.js} +1 -1
- package/dist/client/assets/{toolbar-CkGflKXn.js → toolbar-CJqhxN0I.js} +1 -1
- package/dist/client/assets/{tools-list-DKrbt2O-.js → tools-list-C1LX0lcn.js} +1 -1
- package/dist/client/assets/{tooltip-CKtclZb-.js → tooltip-MvXJgTec.js} +1 -1
- package/dist/client/assets/{types-2N8PTdbg.js → types-B5hLLDbz.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CGLipwx3.js → use-ai-providers-BsaGHbRZ.js} +1 -1
- package/dist/client/assets/{use-automations-BChOAOA6.js → use-automations-CsEWrXaA.js} +1 -1
- package/dist/client/assets/{use-capability-czp9i90U.js → use-capability-COL6vTbP.js} +1 -1
- package/dist/client/assets/{use-clock-tick-_Fh5zTFQ.js → use-clock-tick-DOOx6g7A.js} +1 -1
- package/dist/client/assets/{use-collections-CrAY0KoX.js → use-collections-BTo2RzuF.js} +1 -1
- package/dist/client/assets/{use-connection-NiFefepq.js → use-connection-C7K5Qf-S.js} +1 -1
- package/dist/client/assets/{use-copy-CQfxrmWX.js → use-copy-CGrsfbTf.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DwKQGNi1.js → use-create-virtual-mcp-D9KVCrT1.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DCM6oAgZ.js → use-debounced-autosave-6YBhwe_F.js} +1 -1
- package/dist/client/assets/{use-delete-connection-bIYVec_d.js → use-delete-connection-BfZlr78w.js} +1 -1
- package/dist/client/assets/{use-file-configs-CqXWCLQv.js → use-file-configs-2cFOqoXA.js} +1 -1
- package/dist/client/assets/use-infinite-scroll-CHxQ8pHV.js +1 -0
- package/dist/client/assets/{use-list-state-DRxXstLB.js → use-list-state-ohTb0Oa4.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B46VYAN_.js → use-mcp-client-Wf5qUXFF.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BfYOND3X.js → use-mcp-prompts-C3LVS9Ph.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-wPegb5Xs.js → use-mcp-tools-CHOFkJhf.js} +1 -1
- package/dist/client/assets/{use-members-DTpTFucv.js → use-members-DPGvEZAM.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DL0_jMva.js → use-navigate-to-agent-Cyv38GW6.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DFhI1mXp.js → use-org-auth-client-DEFpPA_h.js} +1 -1
- package/dist/client/assets/{use-org-sso-B2JHlDcL.js → use-org-sso-DXk1g-4_.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Do917bwO.js → use-organization-roles-CgzLzx7m.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CGdaVuD7.js → use-organization-settings-DYscqYOA.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B7_YY-15.js → use-registry-connections-BWH6CWaF.js} +1 -1
- package/dist/client/assets/{use-secrets-qOLSEePj.js → use-secrets-C2K4Jrkd.js} +1 -1
- package/dist/client/assets/{use-status-sounds-EA9ENH60.js → use-status-sounds-CFQ4LNhs.js} +1 -1
- package/dist/client/assets/{use-view-mode-C2K6zcu8.js → use-view-mode-Dg3ZmYU0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DHileccV.js → use-virtual-mcp-3Wk6GVmY.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DiweShIv.js +1 -0
- package/dist/client/assets/{useRouterState-93R-QVdz.js → useRouterState-DyL85Esh.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BHYoMCUL.js +1 -0
- package/dist/client/assets/{user-T0gsPnBH.js → user-CNkzK1zV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BvPi1TV1.js → view-mode-toggle-Do2GCdol.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BSePGeIN.js → watch-sse-pool-WsArg2kN.js} +1 -1
- package/dist/client/assets/{workflow-aar8VltW.js → workflow-C2UTibro.js} +1 -1
- package/dist/client/assets/workflow-detail-B3lltIYe.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +418 -418
- package/dist/server/migrate.js +52 -52
- package/dist/server/server.js +292 -292
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-Dv2cxIh1.js +0 -1
- package/dist/client/assets/agent-capabilities-l_XcUqX-.js +0 -3
- package/dist/client/assets/app-editor-CFm4rW9v.js +0 -1
- package/dist/client/assets/connections-CQfywKkf.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-TF6jERkV.js +0 -1
- package/dist/client/assets/file-explorer-Bpe6MxXV.js +0 -2
- package/dist/client/assets/index-CoS-DNLH.js +0 -1
- package/dist/client/assets/index-DHXKcvHJ.js +0 -1
- package/dist/client/assets/index-Dow8MSuu.js +0 -8
- package/dist/client/assets/infiniteQueryObserver-DjRZQa58.js +0 -1
- package/dist/client/assets/monaco-editor-DR1buwuA.js +0 -9
- package/dist/client/assets/page-seo-sheet-BGJM5zp7.js +0 -1
- package/dist/client/assets/project-app-view-CByPW7cJ.js +0 -1
- package/dist/client/assets/record-editor-BoDJjFQA.js +0 -1
- package/dist/client/assets/registry-aermVrqm.js +0 -2
- package/dist/client/assets/registry-layout-CC29q8fz.js +0 -27
- package/dist/client/assets/roles-C5M6mJ4v.js +0 -1
- package/dist/client/assets/save-referenced-block-BLu5E_fA.js +0 -1
- package/dist/client/assets/seo-editor-CBSOqlcM.js +0 -1
- package/dist/client/assets/shell-route-loading-BURh1jIH.js +0 -1
- package/dist/client/assets/store-registry-CRmNQ4V9.js +0 -2
- package/dist/client/assets/use-infinite-scroll-CNFLUrB_.js +0 -1
- package/dist/client/assets/useInfiniteQuery-vMxng0_U.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-_hGeqDYv.js +0 -1
- package/dist/client/assets/workflow-detail-Cyps73VW.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as z,e as H,c as K,j as s,q as Se,K as re,bb as dt,n as Re,l as fe,B as ne,T as Pe,aH as Ie,W as se,aJ as De,aK as ke,G as $e,H as mt,I as ut,a as Fe,o as he,t as Oe,F as Ke,v as ft,E as ht,f as gt,d as xt}from"./index-BjoOIgbb.js";import{u as pt}from"./use-organization-roles-Do917bwO.js";import{u as je}from"./use-org-auth-client-DFhI1mXp.js";import{B as ge}from"./badge-GxV01_sa.js";import{A as Qe,a as He,b as qe,c as Ze,d as Xe,f as Je,e as We,g as et}from"./alert-dialog-ZB1-0uWA.js";import{D as bt,a as Et,b as Tt,c as _t}from"./dropdown-menu-CggnBdjt.js";import{i as It}from"./DotsVertical-Dok1GVxI.js";import{s as Ae}from"./Plus-CdvauR8B.js";import{s as St}from"./Trash01-Biurgfq6.js";import{C as Nt}from"./collection-table-wrapper-p305Tve_.js";import{P as te}from"./index-M8U0QO9V.js";import{E as Ge}from"./empty-state-DtTBbW_W.js";import{S as ve}from"./search-input-DwwxFJsd.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-BxZqCPgY.js";import{u as Ct}from"./use-infinite-scroll-CNFLUrB_.js";import{C as we}from"./checkbox-CvlqSsv8.js";import{i as At}from"./RefreshCcw01-4ELQWtuB.js";import{u as Rt}from"./useSuspenseInfiniteQuery-_hGeqDYv.js";import{u as Ot,a as jt}from"./use-mcp-client-B46VYAN_.js";import{C as vt}from"./collection-search-B62hBYcH.js";import{u as nt}from"./use-members-DTpTFucv.js";import{u as yt}from"./use-connection-NiFefepq.js";import{u as wt,d as Lt}from"./use-ai-providers-CGLipwx3.js";import{A as lt}from"./avatar-DdrKHW7Q.js";import{S as xe}from"./switch-DDGBJlE2.js";import{c as pe,b as be,T as Ee,a as Te}from"./tooltip-CKtclZb-.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-BkgYqxH8.js";import{t as Mt}from"./ChevronDown-BD0G-h2k.js";import{i as Pt}from"./ChevronRight-DUzhuedZ.js";import{i as ze}from"./X-DlMQL-XM.js";import{a as Dt}from"./use-capability-czp9i90U.js";import{A as kt}from"./access-gate-DR0BZ9Yv.js";import"./Check-DCDpfG7m.js";import"./table-GnXYzms9.js";import"./SwitchHorizontal01-DC97OO23.js";import"./sidebar-CIJpOENy.js";import"./LayoutLeft-Bfxz6P9F.js";import"./sheet-CxiAY8T5.js";import"./SearchMd-DvX2rzEB.js";import"./Container-Catp9d2q.js";import"./agent-icon-CjlB-XbA.js";import"./AlertCircle-BQLR7I4E.js";import"./Tool01-DQ4cTbeu.js";import"./XCircle-G0WrPq0g.js";import"./ArrowUpRight-DSaWSvAP.js";import"./ZapSquare-C9LhFrIW.js";import"./Users03-CA9cu5qb.js";import"./CheckCircle-BBK-3Pzt.js";import"./ChevronLeft-DtP_Ayjz.js";import"./ChevronUp-D5M0geM5.js";import"./Eye-Dmik5hYP.js";import"./ZoomOut-CImzlj9g.js";import"./Globe01-D1c-3J9t.js";import"./FilterLines-C37LaXJ1.js";import"./Star01--MeVNqbA.js";import"./Palette-C74Da44y.js";import"./HardDrive-C1vRZoAn.js";import"./Stars02-D6zEAnUT.js";import"./Key01-CdveS1HN.js";import"./LinkExternal01-CxEkPs1F.js";import"./Monitor01-Bkoa3Nbe.js";import"./Sun-BGVsB7Cm.js";import"./Play-BERjgeke.js";import"./Settings02-Cqwfv4FN.js";import"./Shield01-6id4oLiZ.js";import"./Stars01-C2BTpZeS.js";import"./Upload01-B-0o1yeU.js";import"./User01-CZ5ejYDg.js";import"./Users01-CKNLJr4G.js";import"./XClose-LNW85JIs.js";import"./Zap-CbtV6Vvm.js";import"./infiniteQueryObserver-DjRZQa58.js";import"./use-collections-CrAY0KoX.js";import"./card-B7vNztnP.js";import"./capability-load-error-C1lcmzPk.js";const Le="basic-usage",Me=[{id:Le,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_GET","ORGANIZATION_DOMAIN_SET","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_CLEAR"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH","REGISTRY_MONITOR_SCHEDULE_SET","REGISTRY_MONITOR_SCHEDULE_CANCEL"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"event-bus:use",label:"Use event bus",description:"Publish events and manage subscriptions",section:"Developer",tools:["EVENT_PUBLISH","EVENT_SUBSCRIBE","EVENT_UNSUBSCRIBE","EVENT_CANCEL","EVENT_ACK","EVENT_SUBSCRIPTION_LIST","EVENT_SYNC_SUBSCRIPTIONS"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===Le)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===Le)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const o=new Set(e);for(const r of t.tools)o.add(r);return Array.from(o)}const l=new Set(e);for(const o of t.tools)l.delete(o);return Array.from(l)}const zt=z.memo(function(e){const n=H.c(21),{connection:l,isSelected:o,hasToolsEnabled:r,activeToolsCount:c,totalToolsCount:f,onSelect:d,onToggle:h}=e,g=o?"bg-accent/50":"hover:bg-muted/50";let a;n[0]!==g?(a=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),n[0]=g,n[1]=a):a=n[1];let x;n[2]!==l.icon||n[3]!==l.title?(x=s.jsx(ye,{icon:l.icon,name:l.title,size:"xs"}),n[2]=l.icon,n[3]=l.title,n[4]=x):x=n[4];let i;n[5]!==l.title?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),n[5]=l.title,n[6]=i):i=n[6];let m;n[7]!==d||n[8]!==x||n[9]!==i?(m=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[x,i]}),n[7]=d,n[8]=x,n[9]=i,n[10]=m):m=n[10];let _;n[11]!==c||n[12]!==l.tools||n[13]!==r||n[14]!==h||n[15]!==f?(_=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[c,"/",f]}),s.jsx(we,{checked:r,onCheckedChange:h,onClick:Ft})]}),n[11]=c,n[12]=l.tools,n[13]=r,n[14]=h,n[15]=f,n[16]=_):_=n[16];let E;return n[17]!==a||n[18]!==m||n[19]!==_?(E=s.jsxs("div",{className:a,children:[m,_]}),n[17]=a,n[18]=m,n[19]=_,n[20]=E):E=n[20],E}),Yt=z.memo(function(e){const n=H.c(18),{connectionId:l,tool:o,isSelected:r,onToggle:c}=e,f=`tool-${l}-${o.name}`,d=r?"text-foreground":"text-muted-foreground";let h;n[0]!==d?(h=K("text-sm font-medium",d),n[0]=d,n[1]=h):h=n[1];let g;n[2]!==h||n[3]!==o.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:o.name})}),n[2]=h,n[3]=o.name,n[4]=g):g=n[4];let a;n[5]!==o.description?(a=o.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:o.description}),n[5]=o.description,n[6]=a):a=n[6];let x;n[7]!==g||n[8]!==a?(x=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,a]}),n[7]=g,n[8]=a,n[9]=x):x=n[9];const i=`tool-${l}-${o.name}`;let m;n[10]!==r||n[11]!==c||n[12]!==i?(m=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:i,checked:r,onCheckedChange:c,onClick:Kt})}),n[10]=r,n[11]=c,n[12]=i,n[13]=m):m=n[13];let _;return n[14]!==f||n[15]!==x||n[16]!==m?(_=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:f,children:[x,m]}),n[14]=f,n[15]=x,n[16]=m,n[17]=_):_=n[17],_});function $t({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[o,r]=z.useState(""),c=l!==void 0?l:o,f=z.useDeferredValue(c),[d,h]=z.useState("all"),[g,a]=z.useState(!1),x=z.useRef(new Set(Object.keys(t))),{org:i}=Se(),m=Ot({connectionId:jt,orgId:i.id,orgSlug:i.slug}),_=100,E=f.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,N=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,i.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:b,...N&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),S=I?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?S.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):S,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(d==="all")return!0;const D=U(b.id);return d==="selected"?D:d==="unselected"?!D:!0}),[L,Y]=z.useState(G[0]?.id??null),y=L?G.find(b=>b.id===L)??null:null,{data:M,isFetching:$}=Re({queryKey:re.collectionItem(m,i.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),F=M?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===L?F:[];if(!D.length)return;const Q=t[b]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=q,Y(b)),e(Z)},oe=b=>{Y(b),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",g&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:o,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>h("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>h("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>h("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(b=>{const D=L===b.id,Q=D?F.length:0,q=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",g?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:$?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):F.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:F.map(b=>s.jsx(Yt,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function Ft(t){return t.stopPropagation()}function Kt(t){return t.stopPropagation()}const Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ht(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const o=t.charCodeAt(l);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function qt(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=H.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:o,onPermissionsChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c;let h;e[0]!==f?(h=f.trim().toLowerCase(),e[0]=f,e[1]=h):h=e[1];const g=z.useDeferredValue(h);let a;if(e[2]!==n||e[3]!==g||e[4]!==o||e[5]!==r||e[6]!==d||e[7]!==f||e[8]!==l){const x=Ut(),i=(v,I)=>{if(!d){if(n&&I){const R=x.flatMap(es).flatMap(Wt);o(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!I))}};let m;e[10]!==g?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(p=>!g||p.label.toLowerCase().includes(g)||p.description.toLowerCase().includes(g))}},e[10]=g,e[11]=m):m=e[11];const _=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==o||e[14]!==r?(E=()=>{o(!n),r([])},e[12]=n,e[13]=o,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==d||e[18]!==E?(T=Ye(n,d,E),e[16]=n,e[17]=d,e[18]=E,e[19]=T):T=e[19];let N;e[20]!==n||e[21]!==o||e[22]!==r||e[23]!==d?(N=d?void 0:()=>{o(!n),r([])},e[20]=n,e[21]=o,e[22]=r,e[23]=d,e[24]=N):N=e[24];let C;e[25]!==T||e[26]!==N?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:N})})}),e[25]=T,e[26]=N,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,_.length===0&&g?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",f,"”"]}):_.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(Ue,{title:I,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,d,()=>i(p,O)),onClick:d?void 0:()=>i(p,O)},p.id)})})},I)})]})}),e[2]=n,e[3]=g,e[4]=o,e[5]=r,e[6]=d,e[7]=f,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=H.c(44),{connectionId:n,subProviderId:l,subProviderName:o,groupLogo:r,models:c,allConnectionModelIds:f,selectedModels:d,allowAllModels:h,allConnectionModelsSelected:g,onToggleModel:a,onExitAllowAll:x,readOnly:i,defaultExpanded:m}=t,[_,E]=z.useState(m),T=m||_,N=E,[C,v]=z.useState(rt);let I;e[0]!==g||e[1]!==h||e[2]!==d?(I=j=>h||g||d.includes("*")||d.includes(j),e[0]=g,e[1]=h,e[2]=d,e[3]=I):I=e[3];const R=I;let p;if(e[4]!==R||e[5]!==c){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=c.filter(j),e[4]=R,e[5]=c,e[6]=p}else p=e[6];const O=p.length;let S;if(e[9]!==f||e[10]!==h||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==c||e[17]!==x||e[18]!==a||e[19]!==i||e[20]!==l||e[21]!==o||e[22]!==C){const j=c.slice(0,C),u=c.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>N(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==o||e[26]!==A?(k=s.jsx(ye,{icon:A,name:o,size:"sm"}),e[25]=o,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==o?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:o}),e[28]=o,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==c.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",c.length," enabled"]}),e[33]=O,e[34]=c.length,e[35]=B):B=e[35];let L;e[36]!==T?(L=T?s.jsx(Mt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=L):L=e[37];let Y;e[38]!==L||e[39]!==B?(Y=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,L]}),e[38]=L,e[39]=B,e[40]=Y):Y=e[40];let y;e[41]!==Y||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:w,children:[U,Y]}),e[41]=Y,e[42]=U,e[43]=y):y=e[43],S=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(M=>{const $=R(M.id),F=()=>{if(!i){if(h){x(n,f,M.id);return}a(n,M.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!i&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:M.title})}),s.jsx("div",{onClick:as,children:i?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:$,disabled:!0,onCheckedChange:rs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:$,onCheckedChange:F})})]},M.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(is),children:["Show more (",c.length-C," remaining)"]})]})]}),e[9]=f,e[10]=h,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=c,e[17]=x,e[18]=a,e[19]=i,e[20]=l,e[21]=o,e[22]=C,e[23]=S}else S=e[23];return S}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=H.c(33),{connection:n,selectedModels:l,allowAllModels:o,onToggleModel:r,onExitAllowAll:c,allConnectionModelsSelected:f,searchQuery:d,readOnly:h}=t,g=Lt(n.id);let a,x,i,m,_;if(e[0]!==f||e[1]!==o||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==c||e[6]!==r||e[7]!==g||e[8]!==h||e[9]!==d||e[10]!==l){_=Symbol.for("react.early_return_sentinel");e:{let N;e[16]!==n.label?(N=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=N):N=e[17];const C=g.filter(hs).map(N),v=d.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){_=null;break e}const R=new Map;for(const A of I){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;i="flex flex-col gap-3";const S=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==S?(j=s.jsx("img",{src:S,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=S,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:o,allConnectionModelsSelected:f,onToggleModel:r,onExitAllowAll:c,readOnly:h,defaultExpanded:O},A.id))}e[0]=f,e[1]=o,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=c,e[6]=r,e[7]=g,e[8]=h,e[9]=d,e[10]=l,e[11]=a,e[12]=x,e[13]=i,e[14]=m,e[15]=_}else a=e[11],x=e[12],i=e[13],m=e[14],_=e[15];if(_!==Symbol.for("react.early_return_sentinel"))return _;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==i||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:i,children:[m,E]}),e[29]=i,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=H.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:o,onModelSetChange:r,readOnly:c,searchQuery:f}=t,d=c===void 0?!1:c,h=z.useDeferredValue(f),g=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const S=l[p]??[],j={...l};if(S.includes(O)){const u=S.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...S,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let i;e[3]!==l||e[4]!==o||e[5]!==r?(i=(p,O,S)=>{o(!1),r({...l,[p]:O.filter(j=>j!==S)})},e[3]=l,e[4]=o,e[5]=r,e[6]=i):i=e[6];const m=i,_=!d&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==_?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",_),e[7]=_,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==o||e[11]!==r||e[12]!==d?(T=()=>{if(d)return;const p=!n;o(p),p&&r({})},e[9]=n,e[10]=o,e[11]=r,e[12]=d,e[13]=T):T=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=N):N=e[14];let C;e[15]!==n||e[16]!==o||e[17]!==r||e[18]!==d?(C=s.jsx("div",{onClick:ps,children:d?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Te,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{o(p),p&&r({})}})}),e[15]=n,e[16]=o,e[17]=r,e[18]=d,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[N,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==g||e[25]!==n||e[26]!==h||e[27]!==m||e[28]!==l||e[29]!==d||e[30]!==x?(I=g.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):g.map(p=>s.jsx(z.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:h,readOnly:d})},p.id)),e[24]=g,e[25]=n,e[26]=h,e[27]=m,e[28]=l,e[29]=d,e[30]=x,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=H.c(52),{open:n,onOpenChange:l,selectedMemberIds:o,onAddMembers:r}=t,[c,f]=z.useState(""),d=z.useDeferredValue(c);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[g,a]=z.useState(h),{data:x}=nt();let i,m,_,E,T,N,C,v,I,R,p;if(e[1]!==x?.data?.members||e[2]!==d||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==g||e[7]!==c||e[8]!==o){const U=x?.data?.members??[];let B;e[20]!==d?(B=y=>{const M=d.toLowerCase();return y.user?.name?.toLowerCase().includes(M)||y.user?.email?.toLowerCase().includes(M)},e[20]=d,e[21]=B):B=e[21];const L=U.filter(B);let Y;e[22]!==r||e[23]!==l||e[24]!==g?(Y=()=>{r(g),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=g,e[25]=Y):Y=e[25],_=Y,m=Qe,R=n,p=l,i=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=I):I=e[26],N="flex flex-col h-80",e[27]!==c?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:c,onChange:f,placeholder:"Search members...",className:"w-full"})}),e[27]=c,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=L.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:L.map(y=>{const M=y.role!=="owner",$=o.includes(y.id),F=g.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!M||$?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||$,onCheckedChange:()=>{!M||$||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!M||$}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!M&&s.jsx(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),$&&M&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=d,e[3]=r,e[4]=l,e[5]=n,e[6]=g,e[7]=c,e[8]=o,e[9]=i,e[10]=m,e[11]=_,e[12]=E,e[13]=T,e[14]=N,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=p}else i=e[9],m=e[10],_=e[11],E=e[12],T=e[13],N=e[14],C=e[15],v=e[16],I=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let S;e[32]!==O||e[33]!==N||e[34]!==C?(S=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=S):S=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=g.length===0,w=g.length>0&&`(${g.length})`;let A;e[37]!==_||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:_,disabled:u,children:["Add ",w]})]}),e[37]=_,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==i||e[42]!==S||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(i,{className:v,children:[I,S,A]}),e[41]=i,e[42]=S,e[43]=A,e[44]=v,e[45]=I,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Es(t){const e=H.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:o,readOnlyMessage:r,searchQuery:c,addMemberDialogOpen:f,onAddMemberDialogOpenChange:d}=t,h=o===void 0?!1:o,g=r===void 0?"Owner membership cannot be changed":r,a=z.useDeferredValue(c),{data:x}=nt();let i,m,_;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==h||e[5]!==g||e[6]!==c){const v=x?.data?.members??[];let I;e[10]!==n?(I=S=>n.includes(S.id),e[10]=n,e[11]=I):I=e[11];const R=v.filter(I);let p;e[12]!==a?(p=S=>{const j=a.toLowerCase();return S.user?.name?.toLowerCase().includes(j)||S.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);_="flex flex-col h-full",i="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',c,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(S=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:S.user?.image??void 0,fallback:ot(S.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.user?.email})]}),h?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Te,{children:s.jsx("p",{children:g})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==S.id)),children:s.jsx(ze,{size:16})})]},S.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=h,e[5]=g,e[6]=c,e[7]=i,e[8]=m,e[9]=_}else i=e[7],m=e[8],_=e[9];let E;e[14]!==i||e[15]!==m?(E=s.jsx("div",{className:i,children:m}),e[14]=i,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let N;e[20]!==f||e[21]!==n||e[22]!==d||e[23]!==T?(N=s.jsx(bs,{open:f,onOpenChange:d,selectedMemberIds:n,onAddMembers:T}),e[20]=f,e[21]=n,e[22]=d,e[23]=T,e[24]=N):N=e[24];let C;return e[25]!==_||e[26]!==E||e[27]!==N?(C=s.jsxs("div",{className:_,children:[E,N]}),e[25]=_,e[26]=E,e[27]=N,e[28]=C):C=e[28],C}function Ts(t){const e=H.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx(z.Suspense,{fallback:n,children:s.jsx(Es,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const o=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:o,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ss(t,e,n){const l=t.permission||{},o=l.self||[],r=o.includes("*"),c=r?[]:o.filter(a=>a!=="*"),f={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const i of n)f[i.id]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x;else{const i=n.find(m=>m.id===a);i&&(f[a]=x.includes("*")?i.tools?.map(m=>m.name)??[]:x)}const d=l.models||[],h=d.length===0||d.includes("*:*"),g={};if(!h)for(const a of d){const x=a.indexOf(":");if(x===-1)continue;const i=a.slice(0,x),m=a.slice(x+1);g[i]||(g[i]=[]),g[i].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:c,toolSet:f,allowAllModels:h,modelSet:g,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ns(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,o]of Object.entries(t.toolSet))if(o.length>0){const c=e.find(f=>f.id===l)?.tools?.map(f=>f.name)??[];n[l]=c.length>0&&c.every(f=>o.includes(f))?["*"]:o}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[o,r]of Object.entries(t.modelSet))for(const c of r)l.push(`${o}:${c}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ss(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=H.c(6),{readOnly:n,readOnlyMessage:l,onOpen:o}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=d):d=e[0];let h;return e[1]!==r?(h=s.jsx(pe,{children:s.jsxs(be,{children:[d,s.jsx(Te,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=h):h=e[2],h}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ae,{size:16}),e[3]=c):c=e[3];let f;return e[4]!==o?(f=s.jsxs(ne,{variant:"outline",size:"sm",onClick:o,children:[c,"Add Member"]}),e[4]=o,e[5]=f):f=e[5],f}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),o=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==l?(c=()=>l.organization.listMembers(),e[2]=l,e[3]=c):c=e[3];let f;e[4]!==r||e[5]!==c?(f={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=f):f=e[6];const{data:d,isPending:h}=Re(f);if(h||!o){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=i):i=e[7],i}let g;e[8]!==d?.data?.members?(g=d?.data?.members??[],e[8]=d?.data?.members,e[9]=g):g=e[9];const a=g;let x;return e[10]!==o||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:o}),e[10]=o,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:o}){const{locator:r}=Se(),c=je(),f=$e(),d=t.kind==="builtin",h=t.kind==="builtin"&&t.role==="owner",g=t.kind==="new",[a,x]=z.useState(d?"org":"mcp"),i=mt({resolver:ut(Zt),defaultValues:Cs(t,l,o)}),m=i.formState.isValid,_=i.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ns(u,o),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const L=l.filter(M=>M.role===(B??U)).map(M=>M.id),Y=u.memberIds.filter(M=>!L.includes(M)),y=L.filter(M=>!u.memberIds.includes(M));for(const M of Y){const $=await c.organization.updateMemberRole({memberId:M,role:[U]});if($?.error)throw new Error($.error.message??"Something went wrong")}for(const M of y){const $=await c.organization.updateMemberRole({memberId:M,role:["user"]});if($?.error)throw new Error($.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,L=U!==B,Y=await c.organization.updateRole({roleId:u.role.id,data:{permission:w,...L?{roleName:U}:{}}});if(Y?.error)throw new Error(Y.error.message??"Something went wrong");return await G(L?U:B,L?B:void 0),L?{...u,role:{...u.role,slug:U}}:u}else{const U=await c.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const L=await c.organization.updateMemberRole({memberId:B,role:[A]});if(L?.error)throw new Error(L.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{f.invalidateQueries({queryKey:re.members(r)}),f.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),i.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=i.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),i.setFocus("role.label");return}E.mutate(u)}),N=!h,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...h?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=z.useState(""),[p,O]=z.useState(!1),S=u=>{x(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:N&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!_,children:E.isPending?"Saving...":g?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?qt(t.role):Ht(i.watch("role.label")))}),h&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),g||t.kind==="custom"?s.jsx("input",{...i.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:g}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>S(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ve,{value:I,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!h&&s.jsx($t,{toolSet:i.watch("toolSet"),onToolSetChange:u=>i.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:i.watch("allowAllStaticPermissions"),staticPermissions:i.watch("staticPermissions"),onAllowAllChange:u=>i.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>i.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="models"&&s.jsx(gs,{allowAllModels:i.watch("allowAllModels"),modelSet:i.watch("modelSet"),onAllowAllChange:u=>i.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>i.setValue("modelSet",u,{shouldDirty:!0}),readOnly:h,searchQuery:I}),a==="members"&&s.jsx(Ts,{memberIds:i.watch("memberIds"),onMemberIdsChange:u=>i.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:I,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=H.c(6),{area:n,children:l}=t,{isPrivileged:o,loading:r,error:c}=Dt();let f;return e[0]!==n||e[1]!==l||e[2]!==c||e[3]!==o||e[4]!==r?(f=s.jsx(kt,{granted:o,loading:r,error:c,area:n,children:l}),e[0]=n,e[1]=l,e[2]=c,e[3]=o,e[4]=r,e[5]=f):f=e[5],f}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const o=t.charCodeAt(l);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ls={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ms(t,e){return e?Ls[t]??"bg-neutral-400":ws(t)}function Ps(){const t=H.c(77),[e,n]=z.useState(""),[l,o]=z.useState(null),r=gt();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const{role:f}=xt(c),{locator:d}=Se(),h=je(),g=$e(),{customRoles:a,refetch:x}=pt();let i;t[1]!==r?(i=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=i):i=t[2];const m=i;let _;e:{if(!f){_=null;break e}if(f==="new"){_={kind:"new"};break e}if(f.startsWith("builtin-")){_={kind:"builtin",role:f.slice(8)};break e}let P;t[3]!==f?(P=ae=>ae.id===f,t[3]=f,t[4]=P):P=t[4];const V=a.find(P);_=V?{kind:"custom",role:V}:null}const E=_;let T;t[5]!==d?(T=re.members(d),t[5]=d,t[6]=T):T=t[6];let N;t[7]!==h?(N=()=>h.organization.listMembers(),t[7]=h,t[8]=N):N=t[8];let C;t[9]!==T||t[10]!==N?(C={queryKey:T,queryFn:N},t[9]=T,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let S;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const at=a.map(ae);if(S=[...V,...at],e){const ce=e.toLowerCase();S=S.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=S}else S=t[19];let j;t[24]!==h?(j=async P=>{const V=await h.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=h,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),g.invalidateQueries({queryKey:re.members(d)}),g.invalidateQueries({queryKey:re.organizationRoles(d)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(bt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(It,{size:16})})}),s.jsx(Tt,{align:"end",onClick:Ds,children:s.jsxs(_t,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&o({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let L;t[31]!==m?(L=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=L):L=t[32];const Y=L;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:E,onBack:P,onSaved:V},js(E))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let M;t[39]===Symbol.for("react.memo_cache_sentinel")?(M=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=M):M=t[39];let $;t[40]!==e?($=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=$):$=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==$||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[$,J]}),t[47]=$,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==S||t[53]!==B||t[54]!==Y||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:S,isLoading:!1,onRowClick:Y,emptyState:oe}),t[52]=S,t[53]=B,t[54]=Y,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&o(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ze,{children:"Delete Role"}),t[61]=q):q=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(qe,{children:[q,s.jsxs(Xe,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),o(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(He,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ms(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function Ys(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx(z.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ps,{})})}),t[1]=n):n=t[1],n}function fl(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{fl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as c}from"./header-tab-button-CfuW1KOG.js";function t(r){return(e,a)=>{c(e),r(e,a)}}export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as F,j as t,r as Q,B as je,l as Se}from"./index-BjoOIgbb.js";import{i as be}from"./ChevronRight-DUzhuedZ.js";import{F as fe}from"./agent-icon-CjlB-XbA.js";import{S as ue}from"./scroll-area-7dB1B4gR.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Fe,f as Te,P as Re,S as Ee}from"./page-seo-form-DA-M0CRU.js";import{m as ze}from"./index-BL9vKovB.js";import{a as ge}from"./Tool01-DQ4cTbeu.js";import{s as xe}from"./schema-form-BBSGBJV6.js";import"./AlertCircle-BQLR7I4E.js";import"./SwitchHorizontal01-DC97OO23.js";import"./RefreshCcw01-4ELQWtuB.js";import"./XCircle-G0WrPq0g.js";import"./ArrowUpRight-DSaWSvAP.js";import"./ZapSquare-C9LhFrIW.js";import"./Users03-CA9cu5qb.js";import"./CheckCircle-BBK-3Pzt.js";import"./Check-DCDpfG7m.js";import"./ChevronDown-BD0G-h2k.js";import"./ChevronLeft-DtP_Ayjz.js";import"./ChevronUp-D5M0geM5.js";import"./DotsVertical-Dok1GVxI.js";import"./Container-Catp9d2q.js";import"./Eye-Dmik5hYP.js";import"./ZoomOut-CImzlj9g.js";import"./Globe01-D1c-3J9t.js";import"./FilterLines-C37LaXJ1.js";import"./Star01--MeVNqbA.js";import"./Palette-C74Da44y.js";import"./HardDrive-C1vRZoAn.js";import"./Stars02-D6zEAnUT.js";import"./Key01-CdveS1HN.js";import"./LayoutLeft-Bfxz6P9F.js";import"./LinkExternal01-CxEkPs1F.js";import"./Monitor01-Bkoa3Nbe.js";import"./Sun-BGVsB7Cm.js";import"./Play-BERjgeke.js";import"./Plus-CdvauR8B.js";import"./SearchMd-DvX2rzEB.js";import"./Settings02-Cqwfv4FN.js";import"./Shield01-6id4oLiZ.js";import"./Stars01-C2BTpZeS.js";import"./Trash01-Biurgfq6.js";import"./Upload01-B-0o1yeU.js";import"./User01-CZ5ejYDg.js";import"./Users01-CKNLJr4G.js";import"./XClose-LNW85JIs.js";import"./X-DlMQL-XM.js";import"./Zap-CbtV6Vvm.js";import"./select-Dn6Da_1F.js";import"./tooltip-CKtclZb-.js";import"./label-_bcDhrPn.js";import"./switch-DDGBJlE2.js";import"./agent-capabilities-l_XcUqX-.js";import"./chat-context-Dr8mURNn.js";import"./tab-id-TBSp1YxU.js";import"./use-mcp-client-B46VYAN_.js";import"./watch-sse-pool-BSePGeIN.js";import"./decopilot-sse-pool-TF6jERkV.js";import"./studio-tools-DfxdEEgB.js";import"./use-virtual-mcp-DHileccV.js";import"./use-collections-CrAY0KoX.js";import"./use-ai-providers-CGLipwx3.js";import"./use-organization-settings-CGdaVuD7.js";import"./pair-rWOsLIRO.js";import"./use-clock-tick-_Fh5zTFQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CQfxrmWX.js";import"./file-type-icon-Dg4vNCbL.js";import"./dialog-Bug5LYvY.js";import"./content-blocks-o63cs2vh.js";import"./types-2N8PTdbg.js";import"./shell-layout-B5B3hmRp.js";import"./avatar-DdrKHW7Q.js";import"./required-auth-layout-B5sViZsY.js";import"./useRouterState-93R-QVdz.js";import"./use-org-sso-B2JHlDcL.js";import"./integration-icon-BxZqCPgY.js";import"./use-navigate-to-agent-DL0_jMva.js";import"./use-connection-NiFefepq.js";import"./use-mcp-prompts-BfYOND3X.js";import"./form-Bkkvnz-_.js";import"./input-CAytkUdm.js";import"./spinner-C2ljLkNd.js";import"./drawer-Ckfnpw8I.js";import"./collection-search-B62hBYcH.js";import"./tabs-BajnAGhM.js";import"./toggle-group-Bv21I6Mc.js";import"./connect-desktop-dialog-B6fCPmnk.js";import"./agent-icons-COjGtXRX.js";import"./checkbox-CvlqSsv8.js";import"./skeleton-B0e2OkSv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BkgYqxH8.js";import"./card-B7vNztnP.js";import"./popover-H1IIsqsO.js";import"./command-DeymMKPH.js";import"./index-CV7TX6uY.js";import"./useInfiniteQuery-vMxng0_U.js";import"./infiniteQueryObserver-DjRZQa58.js";import"./sortable.esm-B6-kJBUo.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BdHs3sI8.js";import"./use-registry-connections-B7_YY-15.js";import"./extract-connection-data-BR7VTC2M.js";import"./generate-id-DfnWKozM.js";import"./collections-BU-b7Qnp.js";import"./collection-tabs-BoWbncvo.js";import"./badge-GxV01_sa.js";import"./textarea-JAS7Y9kw.js";import"./connection-form-helpers-Cl8WE-Wv.js";import"./use-infinite-scroll-CNFLUrB_.js";import"./useSuspenseInfiniteQuery-_hGeqDYv.js";import"./index-K-cFrJme.js";import"./dropdown-menu-CggnBdjt.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BURh1jIH.js";import"./sidebar-CIJpOENy.js";import"./sheet-CxiAY8T5.js";import"./toolbar-CkGflKXn.js";import"./use-create-virtual-mcp-DwKQGNi1.js";import"./github-repo-picker-BKJVsWG6.js";import"./use-mcp-tools-wPegb5Xs.js";import"./alert-dialog-ZB1-0uWA.js";import"./index-CCldjkHi.js";import"./use-org-auth-client-DFhI1mXp.js";import"./hover-card-7wnR4X6J.js";import"./task-status-fWcsMePP.js";import"./use-status-sounds-EA9ENH60.js";import"./empty-state-DtTBbW_W.js";import"./resizable-DaIe2JEk.js";import"./use-capability-czp9i90U.js";import"./header-tab-button-CfuW1KOG.js";import"./index-C6AFi5aI.js";import"./user-T0gsPnBH.js";import"./tools-list-DKrbt2O-.js";import"./use-debounced-autosave-DCM6oAgZ.js";import"./index-M8U0QO9V.js";import"./search-input-DwwxFJsd.js";import"./use-secrets-qOLSEePj.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-CiWkTYYE.js";import"./view-mode-toggle-BvPi1TV1.js";import"./select-model-W59Bilmt.js";import"./use-automations-BChOAOA6.js";import"./monaco-editor-DR1buwuA.js";import"./automation-runs-CbXniThO.js";import"./table-GnXYzms9.js";import"./use-members-DTpTFucv.js";import"./automation-list-row-1QBzAyda.js";import"./calendar-ndWEDvWe.js";import"./image-field-DsnvgvCV.js";import"./use-file-configs-CqXWCLQv.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=F.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=F.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=F.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=F.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=F.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=F.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=F.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Di(n){const e=F.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},T=c?we(w,c):null,z=T&&(!K||Ce(B))?ze(T,s):null;let M;e[0]!==s?(M=Fe(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Te(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==T||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:T,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&T&&t.jsx(Ee,{schema:z,resolveType:T,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=T,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Di as SeoEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as N,c as K,j as s,l as Vt,r as T,t as Z,q as fe,b as Ce,X as Ss,K as Wt,n as qt,f as Oe,g as Ns,d as Dn,P as En,Y as Fn,Z as Gn,T as Bn,W as Ln,I as Hn,H as Un,a as Kn,B as $t,$ as Vn,a0 as Wn,o as Ae,a1 as qn,a2 as Yn,a3 as Xn,G as Qn,a4 as Zn,a5 as Jn,a6 as er,a7 as tr,a8 as xt,a9 as sr,aa as nr,ab as rr,ac as or,ad as ir,ae as lr,af as Cs,ag as ar,ah as cr,ai as dr,aj as ur,ak as mr,al as fr,am as xr,an as hr,ao as pr,ap as gr,aq as br,p as jr,E as ws}from"./index-BjoOIgbb.js";import{u as vr}from"./useRouterState-93R-QVdz.js";import{c as yr,i as _r,a as Sr}from"./ZoomOut-CImzlj9g.js";import{u as Xe,c as xe,d as ke,e as Pt,f as zt,g as $e,h as ks,i as Is,j as Nr,k as Cr,l as Lt}from"./sidebar-CIJpOENy.js";import{T as we}from"./toolbar-CkGflKXn.js";import{u as Ms,T as Ve,a as We,b as qe,c as ts}from"./tooltip-CKtclZb-.js";import{S as Se}from"./skeleton-B0e2OkSv.js";import{P as Rt,a as ut,b as Dt}from"./popover-H1IIsqsO.js";import{b as As,a as $s,D as Ts}from"./drawer-Ckfnpw8I.js";import{i as Os}from"./SearchMd-DvX2rzEB.js";import{s as wr}from"./Star01--MeVNqbA.js";import{s as Ne}from"./Plus-CdvauR8B.js";import{i as kr,a as Ps,u as zs,g as Ir}from"./use-mcp-client-B46VYAN_.js";import{a as Rs,u as ht,b as Mr}from"./use-virtual-mcp-DHileccV.js";import{u as Ar}from"./use-create-virtual-mcp-DwKQGNi1.js";import{I as $r,a as Tr,u as Or,W as Pr,H as zr,S as Rr,G as Dr}from"./github-repo-picker-BKJVsWG6.js";import{A as Te,W as ss,X as ns,Y as Ds,Z as Er,_ as Fr,$ as Gr}from"./agent-icon-CjlB-XbA.js";import{u as Es,d as Br,k as Fs}from"./tab-id-TBSp1YxU.js";import{r as Lr,a as Hr,R as Ur,b as Kr,u as Gs}from"./shell-layout-B5B3hmRp.js";import{u as Vr,a as Wr,b as qr,s as Yr,c as Xr,r as Qr,d as Zr,e as Jr,f as eo,p as to,T as Bs,g as so,h as no,i as ro,j as oo,k as io,l as lo,m as ao,n as co,S as rs,o as Ls}from"./use-navigate-to-agent-DL0_jMva.js";import{A as os}from"./avatar-DdrKHW7Q.js";import{i as Hs}from"./Check-DCDpfG7m.js";import{a as is}from"./Eye-Dmik5hYP.js";import{n as uo,i as mo}from"./Globe01-D1c-3J9t.js";import{i as fo,a as Us}from"./ZapSquare-C9LhFrIW.js";import{i as xo}from"./Monitor01-Bkoa3Nbe.js";import{n as ho,a as po}from"./Sun-BGVsB7Cm.js";import{a as pt}from"./Settings02-Cqwfv4FN.js";import{i as go}from"./Shield01-6id4oLiZ.js";import{a as bo}from"./Users03-CA9cu5qb.js";import{s as Ks}from"./XClose-LNW85JIs.js";import{f as jo,a as vo,b as yo,c as _o,d as So,e as No,A as Co}from"./alert-dialog-ZB1-0uWA.js";import{F as wo,a as ko,b as Io,c as Mo,d as Ao,e as $o,f as To}from"./form-Bkkvnz-_.js";import{I as Oo}from"./input-CAytkUdm.js";import{S as Po}from"./spinner-C2ljLkNd.js";import"./index-CCldjkHi.js";import{i as zo,a as Ro}from"./RefreshCcw01-4ELQWtuB.js";import{n as Yt}from"./Stars02-D6zEAnUT.js";import{A as Vs,g as Do,u as Eo,a as ls,K as Fo,P as Go,s as Bo,S as Lo,v as Ho,D as Uo,c as Ko,b as Vo,C as Wo}from"./sortable.esm-B6-kJBUo.js";import{i as Xt}from"./ChevronRight-DUzhuedZ.js";import{u as Ws}from"./use-mcp-tools-wPegb5Xs.js";import{u as qs}from"./use-ai-providers-CGLipwx3.js";import{i as qo}from"./FilterLines-C37LaXJ1.js";import{t as Yo}from"./Users01-CKNLJr4G.js";import{b as as,c as Ys,S as cs,a as ds,d as us}from"./select-Dn6Da_1F.js";import{b as Xo,c as Qo,e as Zo,a as Jo,D as ei}from"./dialog-Bug5LYvY.js";import{C as ti,e as si,c as ni,d as ri,b as oi}from"./command-DeymMKPH.js";import{u as Xs}from"./studio-tools-DfxdEEgB.js";import{i as Qs}from"./Zap-CbtV6Vvm.js";import{u as ii}from"./use-org-auth-client-DFhI1mXp.js";import{H as li,a as ai,b as ci}from"./hover-card-7wnR4X6J.js";import{g as di,S as ui}from"./task-status-fWcsMePP.js";import{u as mi,f as fi}from"./use-clock-tick-_Fh5zTFQ.js";import{t as Zs}from"./ChevronDown-BD0G-h2k.js";function xi(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=K("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a?(g=a?s.jsx(Vt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Os,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=g):g=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let h;e[14]!==f||e[15]!==g||e[16]!==x?(h=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=h):h=e[17];let b;return e[18]!==u||e[19]!==h?(b=s.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=b):b=e[20],b}const hi="Select an existing agent";function pi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Ve,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(We,{side:"right",sideOffset:8,children:hi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(qe,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function gi(){const t=N.c(5),{enableDecoImport:e}=Ss(),{data:n}=Ce.useSession();let r;t[0]!==n?.user?.email?(r=Wt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:bi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=qt(i);return l?.isDecoUser??!1}async function bi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function ji(t){const e=Oe(),{create:n}=Es(),{locator:r}=fe(),o=Ns({strict:!1}),i=Dn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?Lr(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function vi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Te,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function yi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=T.useState(""),a=Rs(),{org:c}=fe(),{data:d}=Ce.useSession(),u=d?.user?.id??"anon",m=a.filter(Ni).map(Si),f=Wr();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:p,isCreating:x}=Ar(g),{createFromTemplate:h,isCreating:b}=Or(),j=gi(),y=ji(c.slug),v=i.toLowerCase(),_=a.filter(_i).filter(le=>!i||le.title.toLowerCase().includes(v)),k=le=>{qr({orgId:c.id,userId:u},le.id,m),f(),n(),l(""),y(le.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let C;e[1]!==i?(C=s.jsx(xi,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=C):C=e[2];const I="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const z="grid grid-cols-3 gap-1";let $;e[4]!==p||e[5]!==n?($=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=$):$=e[6];let w,P;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ne,{size:16,className:"text-muted-foreground"})}),P=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=w,e[8]=P):(w=e[7],P=e[8]);let H;e[9]!==x||e[10]!==$?(H=s.jsxs("button",{type:"button",disabled:x,onClick:$,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[w,P]}),e[9]=x,e[10]=$,e[11]=H):H=e[11];let O;e[12]!==h||e[13]!==n?(O=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await h(Pr),n()},e[12]=h,e[13]=n,e[14]=O):O=e[14];let B,R;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(wr,{className:"size-5 text-muted-foreground"})}),R=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=B,e[16]=R):(B=e[15],R=e[16]);let L;e[17]!==b||e[18]!==O?(L=s.jsxs("button",{type:"button",disabled:b,onClick:O,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[B,R]}),e[17]=b,e[18]=O,e[19]=L):L=e[19];let D;e[20]!==h||e[21]!==n?(D=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await h(zr),n()},e[20]=h,e[21]=n,e[22]=D):D=e[22];let G,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Rr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=G,e[24]=F):(G=e[23],F=e[24]);let E;e[25]!==b||e[26]!==D?(E=s.jsxs("button",{type:"button",disabled:b,onClick:D,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[G,F]}),e[25]=b,e[26]=D,e[27]=E):E=e[27];let V;e[28]!==n||e[29]!==o?(V=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=V):V=e[30];let W,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Dr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=W,e[32]=X):(W=e[31],X=e[32]);let re;e[33]!==V?(re=s.jsxs("button",{type:"button",onClick:V,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[W,X]}),e[33]=V,e[34]=re):re=e[34];let Y;e[35]!==j||e[36]!==n||e[37]!==r?(Y=j&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=j,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=_.map(le=>s.jsx(vi,{agent:le,onClick:()=>k(le)},le.id));let q;e[39]!==H||e[40]!==L||e[41]!==E||e[42]!==re||e[43]!==Y||e[44]!==oe?(q=s.jsxs("div",{className:z,children:[H,L,E,re,Y,oe]}),e[39]=H,e[40]=L,e[41]=E,e[42]=re,e[43]=Y,e[44]=oe,e[45]=q):q=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==_.length?(J=_.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=x,e[47]=i,e[48]=_.length,e[49]=J):J=e[49];let Q;e[50]!==q||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:I,children:[A,q,J]}),e[50]=q,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(En,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==C||e[63]!==se?(ie=s.jsxs("div",{className:S,children:[C,Q,se]}),e[61]=Q,e[62]=C,e[63]=se,e[64]=ie):ie=e[64],ie}function _i(t){return!kr(t.id)}function Si(t){return t.id}function Ni(t){return t.pinned}function Js(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=T.useState(!1),[a,c]=T.useState(!1),[d,u]=T.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Vr(),p=g?"border border-border":void 0;let x;e[2]!==g?(x=I=>g?s.jsx(pi,{children:I}):I,e[2]=g,e[3]=x):x=e[3];const h=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(T.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Se,{className:"h-4 w-24"})}),children:s.jsx(yi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==h?(_=m?s.jsxs(s.Fragment,{children:[o?h(s.jsx(we,{"aria-label":"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ne,{className:"size-4"})})):s.jsx(xe,{children:h(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Ts,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Rt,{open:i,onOpenChange:I=>{I&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),l(I)},children:[o?h(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(p),children:s.jsx(Ne,{className:"size-4"})})})):s.jsx(xe,{children:h(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=g,e[13]=m,e[14]=i,e[15]=v,e[16]=h,e[17]=_):_=e[17];let k;e[18]!==a?(k=s.jsx($r,{open:a,onOpenChange:c}),e[18]=a,e[19]=k):k=e[19];let S;e[20]!==d?(S=s.jsx(Tr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let C;return e[22]!==_||e[23]!==k||e[24]!==S?(C=s.jsxs(s.Fragment,{children:[_,k,S]}),e[22]=_,e[23]=k,e[24]=S,e[25]=C):C=e[25],C}function en(){const t=N.c(24),{org:e}=fe(),n=Oe(),o=vr().location.pathname,i=e.slug,{state:l,isMobile:a}=Xe(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(yr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const g=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(_r,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let h;t[11]!==n||t[12]!==i?(h=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=h):h=t[13];let b;t[14]!==x||t[15]!==h?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:h},t[14]=x,t[15]=h,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==g?(y={type:"items",items:[g,j]},t[17]=j,t[18]=g,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Pt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(zt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Js,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Tt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(Fn,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function tn(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=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]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Pt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(zt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function sn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(xe,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Ci(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ks,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(ki),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(tn,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(wi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Pt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(zt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function wi(t){return s.jsx(sn,{item:t},t.key)}function ki(t){return s.jsx(sn,{item:t},t.key)}function Ii(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Mi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&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:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Is,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Nr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function Mi(t,e){return s.jsx(Ci,{section:t},e)}function nn(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ii,{...t}),e[0]=t,e[1]=n):n=e[1],n}nn.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(Se,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Ai(){const t=N.c(7),n=Ss().logo??Gn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let l;t[2]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=s.jsxs(Cr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,l]}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(xe,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function $i(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ks,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(tn,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(ms,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Pt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(zt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Ti(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(T.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(Ai,{})}),e[0]=l):l=e[0];let a;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx($i,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],a=n.map(m),e[1]=r,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==a||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function rn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Oi=Bn({name:Ln().min(2,"Organization name is required")});function Pi(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Hn(Oi),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Un(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ri,onSuccess:zi},e[1]=l):l=e[1];const a=Kn(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(yo,{children:[s.jsx(_o,{children:"Create a new organization"}),s.jsx(So,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=C=>a.mutateAsync(C),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:C}=S;return s.jsxs(Io,{children:[s.jsx(Mo,{children:"Organization Name"}),s.jsx(Ao,{children:s.jsx(Oo,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx($o,{children:"The name of your company or organization"}),C.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:"","/",rn(C.value)]})]}),s.jsx(To,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(wo,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(jo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const h=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Po,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==h||e[24]!==b?(j=s.jsx($t,{type:"submit",variant:"default",disabled:h,children:b}),e[23]=h,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(No,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(vo,{children:[d,s.jsx(ko,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(Co,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function zi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ri(t){const e=rn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ce.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Ht(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Di(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,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:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,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:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Xn();let l;e[0]!==n?(l=(w,P)=>w.slug===n?-1:P.slug===n?1:w.name.localeCompare(P.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=T.useState(!1),[u,m]=T.useState(""),f=u.toLowerCase(),g=f?a.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(Ei)},e[2]=c,e[3]=p):p=e[3];const x=p;let h;e[4]!==u||e[5]!==c||e[6]!==x?(h=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=h):h=e[7];let b;e[8]!==c?(b=c?s.jsx(Ks,{size:16}):s.jsx(Os,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,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]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let k;e[19]!==h||e[20]!==_?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[h,_]}),e[19]=h,e[20]=_,e[21]=k):k=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",C=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let I;e[22]!==r||e[23]!==n?(I=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Di,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(Hs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=I):I=e[24];const A=g.map(I);let z;e[25]!==C||e[26]!==A?(z=s.jsxs("div",{className:S,children:[C,A]}),e[25]=C,e[26]=A,e[27]=z):z=e[27];let $;return e[28]!==z||e[29]!==k?($=s.jsxs(s.Fragment,{children:[k,z]}),e[28]=z,e[29]=k,e[30]=$):$=e[30],$}function Ei(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:p}=t;if(g){const q=n?.name??"U";let J;e[0]!==q||e[1]!==r?(J=s.jsx(os,{url:r,fallback:q,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=q,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Li)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(is,{size:14}),e[12]=Ie):Ie=e[12];let Pe;e[13]!==le?(Pe=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=Pe):Pe=e[14];let ze;e[15]===Symbol.for("react.memo_cache_sentinel")?(ze=s.jsx(We,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ze):ze=e[15];let he;e[16]!==Pe?(he=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[Pe,ze]})}),e[16]=Pe,e[17]=he):he=e[17];let Re;e[18]!==he||e[19]!==J||e[20]!==ie?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Re):Re=e[21];const mt=String(p);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],Ee=o.map(de),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let de;e[45]!==a.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=a.theme,e[46]=c,e[47]=de):de=e[47],Ge=l.map(de),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=a.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Bi),e[50]=c,e[51]=be):be=e[51];const je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==a.enableSounds?(pe=a.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=a.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.30.1"]}),e[61]=Be):Be=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Be]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==ve?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,ve]}),e[67]=Re,e[68]=Fe,e[69]=ve,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let h;e[71]!==x||e[72]!==r?(h=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=h):h=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Gi)},e[81]=n,e[82]=k):k=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(is,{size:14}),e[83]=S):S=e[83];let C;e[84]!==k?(C=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=k,e[85]=C):C=e[85];let I;e[86]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(We,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=I):I=e[86];let A;e[87]!==C?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[C,I]})}),e[87]=C,e[88]=A):A=e[88];let z;e[89]!==A||e[90]!==h||e[91]!==_?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,_,A]}),e[89]=A,e[90]=h,e[91]=_,e[92]=z):z=e[92];let $;if(e[93]!==f||e[94]!==o){let q;e[96]!==f?(q=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=q):q=e[97],$=o.map(q),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let P;e[101]!==$||e[102]!==w?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,w]}),e[101]=$,e[102]=w,e[103]=P):P=e[103];let H;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let q;e[108]!==a.theme||e[109]!==c?(q=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=a.theme,e[109]=c,e[110]=q):q=e[110],H=l.map(q),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=H}else H=e[107];let O;e[111]!==H?(O=s.jsx("div",{className:"flex items-center gap-0.5",children:H}),e[111]=H,e[112]=O):O=e[112];const B=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Fi),e[113]=c,e[114]=R):R=e[114];const L=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==L?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",L),e[115]=L,e[116]=D):D=e[116];let G;e[117]!==a.enableSounds?(G=a.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=a.enableSounds,e[118]=G):G=e[118];let F;e[119]!==B||e[120]!==R||e[121]!==D||e[122]!==G?(F=s.jsx("button",{type:"button","aria-label":B,onClick:R,className:D,children:G}),e[119]=B,e[120]=R,e[121]=D,e[122]=G,e[123]=F):F=e[123];let E;e[124]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.30.1"]}),e[124]=E):E=e[124];let V;e[125]!==F?(V=s.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[125]=F,e[126]=V):V=e[126];let W;e[127]!==O||e[128]!==V?(W=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[O,V]}),e[127]=O,e[128]=V,e[129]=W):W=e[129];let X;e[130]!==z||e[131]!==P||e[132]!==W?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,P,W]}),e[130]=z,e[131]=P,e[132]=W,e[133]=X):X=e[133];const re=String(p);let Y;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},re)}),e[134]=m,e[135]=u,e[136]=d,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Fi(t){return{...t,enableSounds:!t.enableSounds}}function Gi(){Ae.success("User ID copied")}function Bi(t){return{...t,enableSounds:!t.enableSounds}}function Li(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=Ce.useSession(),{org:n}=fe(),r=Oe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=Vn(o)?.params.org,[a,c]=Wn(),d=Ms(),[u,m]=T.useState(!1),[f,g]=T.useState(!1),p=e?.user,x=p?.image;let h;t[1]!==r?(h=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=h):h=t[2];const b=h;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(pt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(uo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Sr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(go,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=C):C=t[12];let I;t[13]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(qn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=I):I=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(bo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let z;t[15]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:s.jsx(mo,{size:16}),href:"https://decocms.com",external:!0},t[15]=z):z=t[15];let $;t[16]!==_||t[17]!==k?($=[_,...k,S,C,I,A,z],t[16]=_,t[17]=k,t[18]=$):$=t[18];const w=$;let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P={key:"logout",label:"Sign out",icon:s.jsx(fo,{size:16}),onClick:Ui},t[19]=P):P=t[19];const H=P;let O;t[20]===Symbol.for("react.memo_cache_sentinel")?(O={value:"light",icon:s.jsx(ho,{size:14}),label:"Light theme"},t[20]=O):O=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B={value:"dark",icon:s.jsx(po,{size:14}),label:"Dark theme"},t[21]=B):B=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[O,B,{value:"system",icon:s.jsx(xo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const L=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let G;t[24]!==b||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(G={user:p,userImage:x,menuItems:w,signOutItem:H,themeOptions:L,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=w,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=G):G=t[33];const F=G;let E;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==F?(E=d?s.jsxs(As,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!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("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs($s,{className:"h-[80dvh] p-0",children:[s.jsx(Ts,{className:"sr-only",children:"Account"}),s.jsx(xs,{...F})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Hi,children:s.jsx(xs,{...F})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=F,t[38]=E):E=t[38];let V;t[39]!==f?(V=s.jsx(Pi,{open:f,onOpenChange:g}),t[39]=f,t[40]=V):V=t[40];let W;return t[41]!==E||t[42]!==V?(W=s.jsxs(s.Fragment,{children:[E,V]}),t[41]=E,t[42]=V,t[43]=W):W=t[43],W}function Hi(t){return t.preventDefault()}function Ui(){Z("signed_out",{source:"account_popover"}),Yn(),Ce.signOut()}function Ki({invitation:t}){const[e,n]=T.useState(!1),[r,o]=T.useState(!1),i=Qn(),l=async()=>{n(!0);try{const d=await Ce.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),Zn();let c;try{c=(await Ce.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Ce.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Hs,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Ks,{size:14})})]})]})}function Vi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Wi(){const t=T.useContext(Jn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function on(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Hr(),o=Wi();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Xi).map(Yi);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Ur].sort(qi).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const l=r+o.length;let a;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==l?(a={items:i,pendingInvitations:o,redDotCount:l,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=l,t[9]=a):a=t[9],a}function qi(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Yi(t){return{type:"invitation",invitation:t}}function Xi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class ln extends T.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 an(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Qi(){const t=N.c(25),e=Oe(),{org:n}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:Ps,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=zs(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==o?(l={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Zi},t[4]=o,t[5]=l):l=t[5];const{data:a,isPending:c,isError:d}=Ws(l),u=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==u||t[7]!==d||t[8]!==c?(m=c||d||u==null?"Credits":`Credits: $${u.toFixed(2)}`,t[6]=u,t[7]=d,t[8]=c,t[9]=m):m=t[9];const f=m;let g;t[10]!==u?(g=K(u!=null&&an(u)),t[10]=u,t[11]=g):g=t[11];let p;t[12]!==e||t[13]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=p):p=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ds,{}),t[15]=x):x=t[15];let h;t[16]!==u?(h=u!=null?`$${u.toFixed(2)}`:"Credits",t[16]=u,t[17]=h):h=t[17];let b;t[18]!==h?(b=s.jsx("span",{children:h}),t[18]=h,t[19]=b):b=t[19];let j;return t[20]!==g||t[21]!==p||t[22]!==b||t[23]!==f?(j=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:f,className:g,onClick:p,children:[x,b]})})}),t[20]=g,t[21]=p,t[22]=b,t[23]=f,t[24]=j):j=t[24],j}function Zi(t){return t.structuredContent}function Ji(){const t=N.c(1);if(!qs().some(el))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Qi,{}),t[0]=r):r=t[0],r}function el(t){return t.providerId==="deco"}function tl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ln,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(Ji,{})})}),t[0]=e):e=t[0],e}function sl(){const t=N.c(25),e=Oe(),{org:n}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:Ps,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=zs(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==o?(l={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:nl},t[4]=o,t[5]=l):l=t[5];const{data:a,isPending:c,isError:d}=Ws(l),u=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==u||t[7]!==d||t[8]!==c?(m=c||d||u==null?"Credits":`Credits: $${u.toFixed(2)}`,t[6]=u,t[7]=d,t[8]=c,t[9]=m):m=t[9];const f=m;let g;t[10]!==e||t[11]!==n.slug?(g=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[10]=e,t[11]=n.slug,t[12]=g):g=t[12];let p;t[13]!==u?(p=K(u!=null&&an(u)),t[13]=u,t[14]=p):p=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ds,{className:"size-4"}),t[15]=x):x=t[15];let h;t[16]!==g||t[17]!==p||t[18]!==f?(h=s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":f,onClick:g,className:p,children:x})}),t[16]=g,t[17]=p,t[18]=f,t[19]=h):h=t[19];let b;t[20]!==f?(b=s.jsx(We,{side:"top",children:f}),t[20]=f,t[21]=b):b=t[21];let j;return t[22]!==h||t[23]!==b?(j=s.jsxs(qe,{delayDuration:300,children:[h,b]}),t[22]=h,t[23]=b,t[24]=j):j=t[24],j}function nl(t){return t.structuredContent}function rl(){const t=N.c(1);if(!qs().some(ol))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(sl,{}),t[0]=r):r=t[0],r}function ol(t){return t.providerId==="deco"}function il(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ln,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(rl,{})})}),t[0]=e):e=t[0],e}function cn(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=on(),[i,l]=T.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=h=>h.type==="release"&&h.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(zo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Kr,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Yt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Ki,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Vi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=g):g=e[11];let p;return e[12]!==n||e[13]!==g?(p=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=p):p=e[14],p}function dn(){const{redDotCount:t}=on();return t>0}function ll(){const t=N.c(6),e=dn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(cn,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function al(){const t=N.c(8),e=dn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(ut,{asChild:!0,children:s.jsx(Ve,{asChild:!0,children:s.jsxs(we,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(We,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(cn,{children:s.jsxs(qe,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function cl(){const t=N.c(3),[e,n]=T.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Us,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Vs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function dl(){const t=N.c(3),[e,n]=T.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(qe,{delayDuration:300,children:[s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Us,{className:"size-4"})})}),s.jsx(We,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Vs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function ul(){const t=N.c(7),e=Oe(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function ml(){const t=N.c(9),e=Oe(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(We,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(qe,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function fl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(cl,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(ll,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(ul,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,l,a,s.jsx(xe,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),s.jsx(ml,{}),s.jsx(al,{}),s.jsx(dl,{}),s.jsx(il,{})]})}),t[5]=r):r=t[5],r}function xl(){const t=N.c(8),e=Oe(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(pt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function hl(t,e){return t.filter(n=>!(e.ownerUserId!==void 0&&n.created_by!==e.ownerUserId||e.hasTrigger!==void 0&&!!n.trigger_id!==e.hasTrigger||!!n.hidden!==e.hidden))}function pl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(gl,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&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(Qs,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function gl(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Te,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Te,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function bl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=T.useState(""),{org:l}=fe(),{setTaskId:a}=Gs(),c=Xs();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=qt,d=Wt.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==g?(p={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=p):p=e[11];const{data:x,isFetching:h}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=w=>{v(!1),a(w.id,w.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const k=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Xo,{className:"sr-only",children:[s.jsx(Qo,{children:"Search"}),s.jsx(Zo,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let C;e[20]!==o?(C=s.jsx(ni,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=C):C=e[21];let I;e[22]!==k||e[23]!==h||e[24]!==j||e[25]!==m?(I=m?h&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(ti,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(si,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(pl,{virtualMcpId:w.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:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=h,e[24]=j,e[25]=m,e[26]=I):I=e[26];let A;e[27]!==I?(A=s.jsx(ri,{children:I}),e[27]=I,e[28]=A):A=e[28];let z;e[29]!==C||e[30]!==A?(z=s.jsxs(Jo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(oi,{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:[C,A]})]}),e[29]=C,e[30]=A,e[31]=z):z=e[31];let $;return e[32]!==v||e[33]!==n||e[34]!==z?($=s.jsx(ei,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=$):$=e[35],$}function jl(t){return t==="owner"||t==="admin"}function vl(){const t=N.c(11),{locator:e}=fe(),n=ii(),{data:r}=Ce.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Wt.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=qt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=jl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[yl]=ar(Qt,[Cs]),ce=Cs(),[_l,un]=yl(Qt),mn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[l,a]=T.useState(!1),c=ce(e),d=ir(r),u=T.useCallback(m=>{a(m),d(m)},[d]);return s.jsx(_l,{scope:e,open:l,onOpenChange:u,modal:i,children:s.jsx(lr,{...c,dir:o,open:l,onOpenChange:u,modal:i,children:n})})};mn.displayName=Qt;var fn="ContextMenuTrigger",xn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=un(fn,n),l=ce(n),a=T.useRef({x:0,y:0}),c=T.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),d=T.useRef(0),u=T.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return T.useEffect(()=>u,[u]),T.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(er,{...l,virtualRef:c}),s.jsx(tr.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});xn.displayName=fn;var Sl="ContextMenuPortal",hn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(rr,{...r,...n})};hn.displayName=Sl;var pn="ContextMenuContent",gn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=un(pn,n),i=ce(n),l=T.useRef(!1);return s.jsx(or,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!o.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gn.displayName=pn;var Nl="ContextMenuGroup",Cl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});Cl.displayName=Nl;var wl="ContextMenuLabel",kl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});kl.displayName=wl;var Il="ContextMenuItem",bn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(sr,{...o,...r,ref:e})});bn.displayName=Il;var Ml="ContextMenuCheckboxItem",Al=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});Al.displayName=Ml;var $l="ContextMenuRadioGroup",Tl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Tl.displayName=$l;var Ol="ContextMenuRadioItem",Pl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});Pl.displayName=Ol;var zl="ContextMenuItemIndicator",Rl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e})});Rl.displayName=zl;var Dl="ContextMenuSeparator",jn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(nr,{...o,...r,ref:e})});jn.displayName=Dl;var El="ContextMenuArrow",Fl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(hr,{...o,...r,ref:e})});Fl.displayName=El;var Gl="ContextMenuSubTrigger",Bl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(pr,{...o,...r,ref:e})});Bl.displayName=Gl;var Ll="ContextMenuSubContent",Hl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(gr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Hl.displayName=Ll;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Ul=mn,Kl=xn,Vl=hn,Wl=gn,ql=bn,Yl=jn;function vn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Ul,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function yn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Kl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function _n(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Vl,{children:s.jsx(Wl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==n?(a=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==a||e[10]!==l?(c=s.jsx(ql,{"data-slot":"context-menu-item","data-inset":r,"data-variant":l,className:a,...o}),e[7]=r,e[8]=o,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Yl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function Sn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ne,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let p;e[10]!==f?(p=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>a(n,!r),children:[s.jsx(Er,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let h;e[17]!==r||e[18]!==c||e[19]!==n?(h=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(Ro,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=h):h=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==h?(b=s.jsxs(s.Fragment,{children:[m,p,x,h]}),e[21]=m,e[22]=p,e[23]=x,e[24]=h,e[25]=b):b=e[25],b}function Xl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c}=t,d=di(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=Do(f),e[0]=f,e[1]=g):g=e[1];const p=g;mi(6e4);const x=l||!!n.trigger_id,h=n.id,b="button",j=0;let y;e[2]!==o?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const v=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==v?(_=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",v),e[4]=v,e[5]=_):_=e[5];let k;e[6]!==m||e[7]!==a||e[8]!==f?.icon||e[9]!==f?.title?(k=a&&!m&&s.jsx(Te,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=a,e[8]=f?.icon,e[9]=f?.title,e[10]=k):k=e[10];let S;e[11]!==x?(S=x&&s.jsx(Qs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=S):S=e[12];const C=n.title||"Untitled task";let I;e[13]!==C?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=I):I=e[14];let A;e[15]!==I||e[16]!==S?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[S,I]}),e[15]=I,e[16]=S,e[17]=A):A=e[17];let z;e[18]!==p||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Xl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[p.owner,"/",p.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:fi(new Date(n.updated_at))})]}),e[18]=p,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=z):z=e[22];let $;e[23]!==A||e[24]!==z?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,z]}),e[23]=A,e[24]=z,e[25]=$):$=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let H;e[26]!==i?(H=F=>{F.stopPropagation(),i()},e[26]=i,e[27]=H):H=e[27];let O;e[28]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(br,{size:14}),e[28]=O):O=e[28];let B;e[29]!==H?(B=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H,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:O})}),e[29]=H,e[30]=B):B=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(We,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let L;e[32]!==B?(L=s.jsxs(qe,{children:[B,R]}),e[32]=B,e[33]=L):L=e[33];let D;e[34]!==P||e[35]!==L?(D=s.jsxs("div",{className:w,children:[P,L]}),e[34]=P,e[35]=L,e[36]=D):D=e[36];let G;return e[37]!==o||e[38]!==$||e[39]!==D||e[40]!==y||e[41]!==_||e[42]!==k||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":h,role:b,tabIndex:j,onClick:o,onKeyDown:y,className:_,children:[k,$,D]}),e[37]=o,e[38]=$,e[39]=D,e[40]=y,e[41]=_,e[42]=k,e[43]=n.id,e[44]=G):G=e[44],G}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","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]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Vt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const l=r?"Loading…":"Show more";let a;e[3]!==l?(a=s.jsx("span",{children:l}),e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==a?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,a]}),e[5]=r,e[6]=n,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function Ql(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Zl(t){return t.member==="mine"&&!t.currentUserId}const Nn=4;let At=0;const Kt=[];function Jl(){for(;At<Nn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function Cn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Jl()})};At<Nn?r():Kt.push(r)})}const Ft=10;function ps(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ea(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return ea(t,e,n,r)}function ta(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function sa(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function na(t,e){return e===!1?!1:e===!0?!0:t}function Jt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Ot=new Map,Mt=new Map;function ra(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Ot.get(t)}function oa(t,e){Ot.set(t,e)}function ia(t,e,n){const r=Ot.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=Cn(e).then(i=>(Ot.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function la(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Jt(l,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=fe(),l=Ql(i.id,t,e,n);let a;o[0]!==n?(a=Zl(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=T.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=Br(),{threads:f,hasMore:g}=Fs(),p=r??Bt(f,t,e,n),x=sa(p,g),h=ra(p,g),b=Xs();if(d.identity===l&&d.serverHasMore===null){const S=h??bs(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&h===null&&bs(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),ia(l,async()=>{const S=ps(t,e,0,n,1),C=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:I}=js(C),A=Bt(m.threads.get(),t,e,n);return I===void 0?!1:gs(A,I)},S=>{u(C=>C.identity!==l?C:{...C,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const C=l;u(I=>I.identity===C?{...I,isFetching:!0}:I);try{const I=Bt(f,t,e,n),A=ps(t,e,I,n,Ft),z=await Cn(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:w,totalCount:P}=js(z),H=new Set(f.map(aa)),O=la($,H,t,e,n),B=I;m.mergeThreads($),u(R=>{if(R.identity!==C)return R;let L;return P!==void 0?L=gs(B+O,P):L=$.length===0||O===0?!1:w,oa(C,L),{...R,isFetching:!1,serverHasMore:L}})}catch(I){const A=I,z=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${z}`),u($=>$.identity===C?{...$,isFetching:!1}:$)}},v=d.isFetching||d.isProbing,_=!c&&!v&&na(x,d.serverHasMore);let k;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function aa(t){return t.id}function wn(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:p,groupVisibleCount:x}=t,h=m===void 0?!1:m,b=f===void 0?!1:f,j=ht(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,k=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=q=>{p?.isDragging||q&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const C=!!(y&&o&&y.id===o),I=p?"Drag to reorder":void 0;let A;e[8]!==p?(A=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=A):A=e[9];const z=p&&"cursor-pointer active:cursor-grabbing touch-none",$=p?.isDragging&&"cursor-grabbing";let w;e[10]!==$||e[11]!==z?(w=K("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",z,$),e[10]=$,e[11]=z,e[12]=w):w=e[12];const P=j?.icon??null,H=j?.title??"?";let O;e[13]!==P||e[14]!==H?(O=s.jsx(Te,{icon:P,name:H,size:"sm+",className:"rounded-lg"}),e[13]=P,e[14]=H,e[15]=O):O=e[15];let B;e[16]!==_||e[17]!==w||e[18]!==O||e[19]!==C||e[20]!==I||e[21]!==A?(B=s.jsx(xe,{children:s.jsx(yn,{asChild:!0,children:s.jsx(li,{asChild:!0,children:s.jsx(ke,{onClick:_,isActive:C,title:I,...A,className:w,children:O})})})}),e[16]=_,e[17]=w,e[18]=O,e[19]=C,e[20]=I,e[21]=A,e[22]=B):B=e[22];const R=g??ca;let L;e[23]!==b||e[24]!==h||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(L=s.jsx(_n,{className:"w-56",children:s.jsx(Sn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=b,e[24]=h,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=L):L=e[30];let D;e[31]!==B||e[32]!==L?(D=s.jsxs(vn,{children:[B,L]}),e[31]=B,e[32]=L,e[33]=D):D=e[33];const G=j?.title??"Agent";let F;e[34]!==G?(F=s.jsx("span",{className:"truncate",children:G}),e[34]=G,e[35]=F):F=e[35];let E;e[36]!==c||e[37]!==n?(E=()=>c(n),e[36]=c,e[37]=n,e[38]=E):E=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ne,{size:14}),e[39]=V):V=e[39];let W;e[40]!==E?(W=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:V}),e[40]=E,e[41]=W):W=e[41];let X;e[42]!==F||e[43]!==W?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[F,W]}),e[42]=F,e[43]=W,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(re=s.jsx(da,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(ai,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==D||e[57]!==Y||e[58]!==k||e[59]!==S?(oe=s.jsxs(ci,{open:k,openDelay:120,closeDelay:150,onOpenChange:S,children:[D,Y]}),e[56]=D,e[57]=Y,e[58]=k,e[59]=S,e[60]=oe):oe=e[60],oe}function ca(){}function da(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=es("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Et,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ua(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Bo},a[1]=u):u=a[1];const m=Eo(ls(Go,d),ls(Fo,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=Yr(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const g=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==g||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!Xr(v,_,o))return;const k=Qr(g,v,_),S=Zr(e,n,o,k);e==="org"?Jr(n.orgId,S):eo(n,S),Z("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=g,a[12]=c,a[13]=p):p=a[13];const x=p;let h;return a[14]!==x||a[15]!==m||a[16]!==g?(h={sensors:m,sortableIds:g,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=g,a[17]=h):h=a[17],h}function ma(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function fa(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Vo(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const g={transform:Wo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:g,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:p}=ua(r,n,o,i,l,a,c);if(r.length===0)return null;const x=g;let h;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=v=>{const _=d(v);return g.includes(v.virtualMcpId)?s.jsx(fa,{id:v.virtualMcpId,children:k=>{const{setNodeRef:S,style:C,isDragging:I,attributes:A,listeners:z}=k;return s.jsx("div",{ref:S,style:C,className:K(I&&"opacity-50"),children:u(_,{attributes:A,listeners:z,isDragging:I})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],h=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=h}else h=e[5];let b;e[11]!==x||e[12]!==h?(b=s.jsx(Lo,{items:x,strategy:Ho,children:h}),e[11]=x,e[12]=h,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Uo,{sensors:f,collisionDetection:Ko,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function kn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:g,orgPinned:p,user:x,toolCallRuns:h}=to(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ma,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:p,...y}),v,s.jsx(vs,{section:"user",groups:x,...y}),h&&m(d(h))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function xa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(kn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:pa,renderSortable:ha}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ha(t,e){return s.jsx(wn,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function pa(t){return s.jsx(wn,{...t},t.virtualMcpId)}const ga="sidebar.group.expanded.";function In(t,e){const n=N.c(3),[r,o]=jr(`${ga}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Mn(t){const e=N.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:p,sortable:x}=t,h=u===void 0?!1:u,b=m===void 0?!1:m,[j,y]=In(n,!1),v=n===Bs,_=x?.isDragging??!1;let k;e[0]!==j||e[1]!==y?(k=function(){y(!j)},e[0]=j,e[1]=y,e[2]=k):k=e[2];const S=k;let C;e[3]!==v||e[4]!==x?(C=x&&!v?{...x.attributes,...x.listeners}:{},e[3]=v,e[4]=x,e[5]=C):C=e[5];let I;e[6]!==S?(I=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),S())},e[6]=S,e[7]=I):I=e[7];const A=x&&!v&&"touch-none active:cursor-grabbing",z=_&&"shadow-md bg-accent/40 cursor-grabbing";let $;e[8]!==A||e[9]!==z?($=K("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",A,z),e[8]=A,e[9]=z,e[10]=$):$=e[10];let w;e[11]!==v||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(ja,{virtualMcpId:n,isToolCallRuns:v})}),e[11]=v,e[12]=n,e[13]=w):w=e[13];let P;e[14]!==j?(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:j?s.jsx(Zs,{size:14}):s.jsx(Xt,{size:14})}),e[14]=j,e[15]=P):P=e[15];let H;e[16]!==P||e[17]!==w?(H=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,P]}),e[16]=P,e[17]=w,e[18]=H):H=e[18];let O;e[19]!==v||e[20]!==n?(O=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ya,{virtualMcpId:n,isToolCallRuns:v})}),e[19]=v,e[20]=n,e[21]=O):O=e[21];let B;e[22]!==v||e[23]!==a||e[24]!==n?(B=!v&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E=>{E.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ne,{size:14})}),e[22]=v,e[23]=a,e[24]=n,e[25]=B):B=e[25];let R;e[26]!==j||e[27]!==S||e[28]!==H||e[29]!==O||e[30]!==B||e[31]!==C||e[32]!==I||e[33]!==$?(R=s.jsxs("div",{...C,role:"button",tabIndex:0,"aria-expanded":j,onClick:S,onKeyDown:I,className:$,children:[H,O,B]}),e[26]=j,e[27]=S,e[28]=H,e[29]=O,e[30]=B,e[31]=C,e[32]=I,e[33]=$,e[34]=R):R=e[34];const L=R;let D;e[35]!==b||e[36]!==L||e[37]!==h||e[38]!==v||e[39]!==d||e[40]!==a||e[41]!==c||e[42]!==f||e[43]!==n?(D=v?L:s.jsxs(vn,{children:[s.jsx(yn,{asChild:!0,children:L}),s.jsx(_n,{className:"w-56",children:s.jsx(Sn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:b,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??ba,onHideGroup:d})})]}),e[35]=b,e[36]=L,e[37]=h,e[38]=v,e[39]=d,e[40]=a,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let G;e[45]!==o||e[46]!==j||e[47]!==g||e[48]!==p||e[49]!==v||e[50]!==l||e[51]!==a||e[52]!==i||e[53]!==r||e[54]!==n?(G=j&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:v?r.map(E=>s.jsx(Et,{task:E,isActive:o===E.id,onClick:()=>i(E),onArchive:()=>l(E),showAutomationBadge:!!E.trigger_id},E.id)):s.jsx(Sa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:g,groupVisibleCount:p})}),e[45]=o,e[46]=j,e[47]=g,e[48]=p,e[49]=v,e[50]=l,e[51]=a,e[52]=i,e[53]=r,e[54]=n,e[55]=G):G=e[55];let F;return e[56]!==D||e[57]!==G?(F=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,G]}),e[56]=D,e[57]=G,e[58]=F):F=e[58],F}function ba(){}function ja(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Te,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(va,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function va(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Te,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Te,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ya(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(_a,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function _a(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Sa(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:p}=u,[x,h]=T.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(h(!0),queueMicrotask(()=>{g()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==g||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ne,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id},y.id)),(b||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=g,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function Na(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,a),[g,p]=T.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let h;e[9]!==m||e[10]!==c||e[11]!==u?(h=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=h):h=e[12];let b;return e[13]!==x||e[14]!==h?(b=s.jsxs(s.Fragment,{children:[x,h]}),e[13]=x,e[14]=h,e[15]=b):b=e[15],b}function Ca(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=ui[n],d=c.icon,[u,m]=In(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const g=f;let p;e[3]!==g?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=p):p=e[4];let x;e[5]!==d||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(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let h;e[8]!==u?(h=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(Zs,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=h):h=e[9];let b;e[10]!==x||e[11]!==h?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,h]}),e[10]=x,e[11]=h,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.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:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==g||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:p,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,j,y]}),e[17]=u,e[18]=g,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Na,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==v||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=k):k=e[34],k}function wa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(kn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Ia,renderSortable:ka}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ka(t,e){return s.jsx(Mn,{...t,sortable:e},t.virtualMcpId)}function Ia(t){return s.jsx(Mn,{...t},t.virtualMcpId)}function Ma(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Aa(t,e,n,r,o){const i=N.c(5),l=Ma(t,e,r,o),[a,c]=T.useState("");a!==l&&(so(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=no(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const An={all:"All tasks",manual:"Chats",automation:"Automation"},$n={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function Tn(){const t=N.c(92),{data:e}=Ce.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Ir(o.id).id,a=Rs().filter(Ga).map(Fa),c=vl(),d=Mr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=T.useState(u),g=new Set(a),p={},x=[];let h;t[1]!==m?(h=Object.entries(m),t[1]=m,t[2]=h):h=t[2];for(const[M,U]of h)g.has(M)!==U?p[M]=U:x.push(M);x.length>0&&f(M=>{const U={...M};for(const ne of x)delete U[ne];return U});const b=new Set(a);for(const[M,U]of Object.entries(p))U?b.add(M):b.delete(M);const j=[...b],y=new Set(j),{threads:v}=Fs(),_=hl(v,{hidden:!1}),{hide:k}=Es(),S=Oe(),{setTaskId:C,createNewTask:I}=Gs();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const $=Ns(A).taskId??null,w=[..._].sort(Ea),[P,H]=T.useState("all"),[O,B]=T.useState("mine"),[R,L]=T.useState("agent"),[D,G]=T.useState(!1),[F,E]=T.useState(!1),[V,W]=T.useState(0),X=ro(),re=V+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,q={type:P,member:O,currentUserId:n??null},J=ta(w,"agent",q),Q=Aa(oe,oo(w,i),i,j,re);let ee;t[7]!==n||t[8]!==O?(ee=M=>O==="mine"&&n?M.filter(U=>U.created_by===n):M,t[7]=n,t[8]=O,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==P?(se=M=>P==="automation"?M.filter(Da):P==="manual"?M.filter(Ra):M,t[10]=P,t[11]=se):se=t[11];const ie=se,le=M=>{const U=M.id===$;if(k(M.id),!U)return;const ne=w.find(_e=>_e.id!==M.id&&_e.virtual_mcp_id===M.virtual_mcp_id);ne?C(ne.id,ne.virtual_mcp_id):S({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==I?(Ie=M=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:M}),I(M)},t[12]=I,t[13]=Ie):Ie=t[13];const Pe=Ie,ze=io();let he;t[14]!==ze?(he=M=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:M}),ze(M,{search:{main:"instructions"}})},t[14]=ze,t[15]=he):he=t[15];const Re=he,mt=M=>{if(y.has(M))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:M});const U=Q.find(ne=>ne.virtualMcpId===M);if(U)for(const ne of U.threads)k(ne.id);ao(oe,M,j),W(za)},De=async(M,U)=>{if(c&&p[M]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:U}),f(ne=>({...ne,[M]:U}));try{await d.update.mutateAsync({id:M,data:{pinned:U}})}catch{co(oe,M,!U),f(ne=>{const _e={...ne};return delete _e[M],_e})}}},Ee=M=>{const U=M===i||M===Bs;return{isOrgPinned:y.has(M),canManageOrgPin:U?!1:c,onToggleOrgPin:U?void 0:De}},Me=M=>{const U=ie(te(M.threads));return{virtualMcpId:M.virtualMcpId,threads:U,activeTaskId:$,filters:q,groupVisibleCount:J.get(M.virtualMcpId)??0,onSelectTask:ne=>C(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:Pe,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=P!=="all"||O!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=zn=>{const Rn=ie(te(zn.threads));return!(ae&&Rn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],M=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=M}else M=t[20];const U=M,ne=R==="agent"&&Q.length===0;let _e;t[25]!==ne?(_e=s.jsx(rs,{value:ne}),t[25]=ne,t[26]=_e):_e=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>W(Pa),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[_e,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(xa,{groups:U,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=R==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(rs,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==G?(ue=()=>{Z("tasks_panel_search_opened"),E(!0),G(!0)},t[30]=G,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Fr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Be=ys[R==="agent"?"status":"agent"];let ge;t[35]!==Be?(ge=Be.toLowerCase(),t[35]=Be,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Le=ys[R];let de;t[37]!==Le?(de=Le.toLowerCase(),t[37]=Le,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==R?(ye=()=>{const M=R==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:M}),L(M)},Ue=R==="agent"?s.jsx(Yo,{size:16}):s.jsx(Gr,{size:16}),t[39]=R,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(qo,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==O?(et=M=>{const U=M;U!==O&&Z("tasks_panel_member_filter_changed",{to_value:U}),B(U)},t[52]=O,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys($n),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(Oa)}),t[56]=jt):jt=t[56];let tt;t[57]!==O||t[58]!==et?(tt=s.jsx(_s,{label:"Members",children:s.jsxs(us,{value:O,onValueChange:et,children:[gt,jt]})}),t[57]=O,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==P?(st=M=>{const U=M;U!==P&&Z("tasks_panel_filter_changed",{to_value:U}),H(U)},t[60]=P,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(An),t[63]=yt):yt=t[63];let _t;t[64]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(as,{children:yt.map(Ta)}),t[64]=_t):_t=t[64];let nt;t[65]!==st||t[66]!==P?(nt=s.jsx(_s,{label:"Type",children:s.jsxs(us,{value:P,onValueChange:st,children:[vt,_t]})}),t[65]=st,t[66]=P,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let St;t[78]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(Js,{compact:!0}),t[78]=St):St=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,St]}),t[79]=it,t[80]=lt):lt=t[80];const Pn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:lo(ie(te(w))).map(M=>s.jsx(Ca,{status:M.status,threads:M.threads,activeTaskId:$,onSelectTask:U=>C(U.id,U.virtual_mcp_id),onArchiveTask:le,filters:q},M.status))}):s.jsx(wa,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:()=>W($a),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:Pn,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==F||t[84]!==D||t[85]!==G?(ct=F&&s.jsx(bl,{open:D,onOpenChange:G}),t[83]=F,t[84]=D,t[85]=G,t[86]=ct):ct=t[86];let Nt;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function $a(t){return t+1}function Ta(t){return s.jsx(Ys,{value:t,children:An[t]},t)}function Oa(t){return s.jsx(Ys,{value:t,children:$n[t]},t)}function Pa(t){return t+1}function za(t){return t+1}function Ra(t){return!t.trigger_id}function Da(t){return!!t.trigger_id}function Ea(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Fa(t){return t.id}function Ga(t){return t.pinned}function _s(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ba=5,La=[{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 On(){const t=N.c(3),{state:e}=Xe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ba}).map(Ka)}),t[0]=o):o=t[0],o}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(Se,{className:"size-6 rounded-md"}),s.jsx(Se,{className:"size-6 rounded-md"}),s.jsx(Se,{className:"size-6 rounded-md"})]}),s.jsx(Se,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=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:La.map(Ha)})]}),t[2]=r):r=t[2],r}function Ha(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(Se,{className:"size-5 rounded-full shrink-0"}),s.jsx(Se,{className:K("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(Ua)})]},e)}function Ua(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Se,{className:"h-3 flex-1 rounded-sm"})},e)}function Ka(t,e){return s.jsx(Se,{className:"size-10 rounded-lg mx-auto"},e)}function Vc(){const t=N.c(4),e=en();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(fl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs(T.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(On,{})]}),children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(Tn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Ls,{children:s.jsx(nn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Wc(t){const e=N.c(5),{onClose:n}=t,r=en();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(xl,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs(T.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(On,{})]}),children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(Tn,{})]})}),e[1]=i):i=e[1];let l;return e[2]!==n||e[3]!==r?(l=s.jsx(Ls,{children:s.jsx(Ti,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=l):l=e[4],l}function qc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Vt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{yn as C,Vc as S,Wc as a,qc as b,It as c,hs as d,_n as e,vn as f};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CC29q8fz.js","assets/index-BjoOIgbb.js","assets/index-DfYyH4IW.css","assets/XCircle-G0WrPq0g.js","assets/CheckCircle-BBK-3Pzt.js","assets/Container-Catp9d2q.js","assets/Settings02-Cqwfv4FN.js","assets/use-mcp-client-B46VYAN_.js","assets/useInfiniteQuery-vMxng0_U.js","assets/infiniteQueryObserver-DjRZQa58.js","assets/studio-tools-DfxdEEgB.js","assets/badge-GxV01_sa.js","assets/input-CAytkUdm.js","assets/dropdown-menu-CggnBdjt.js","assets/Check-DCDpfG7m.js","assets/ChevronRight-DUzhuedZ.js","assets/DotsVertical-Dok1GVxI.js","assets/table-GnXYzms9.js","assets/toggle-group-Bv21I6Mc.js","assets/use-view-mode-C2K6zcu8.js","assets/tooltip-CKtclZb-.js","assets/FilterLines-C37LaXJ1.js","assets/Globe01-D1c-3J9t.js","assets/SearchMd-DvX2rzEB.js","assets/dialog-Bug5LYvY.js","assets/X-DlMQL-XM.js","assets/AlertCircle-BQLR7I4E.js","assets/Upload01-B-0o1yeU.js","assets/alert-dialog-ZB1-0uWA.js","assets/card-B7vNztnP.js","assets/Trash01-Biurgfq6.js","assets/label-_bcDhrPn.js","assets/select-Dn6Da_1F.js","assets/ChevronDown-BD0G-h2k.js","assets/ChevronUp-D5M0geM5.js","assets/switch-DDGBJlE2.js","assets/textarea-JAS7Y9kw.js","assets/RefreshCcw01-4ELQWtuB.js","assets/checkbox-CvlqSsv8.js","assets/Eye-Dmik5hYP.js","assets/LinkExternal01-CxEkPs1F.js","assets/use-copy-CQfxrmWX.js","assets/Key01-CdveS1HN.js","assets/Plus-CdvauR8B.js","assets/Play-BERjgeke.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as m,f as n,g as c,j as t,l as f,r as l,_ as p}from"./index-BjoOIgbb.js";import{R as u}from"./require-capability-g-UPmpGK.js";import"./use-capability-czp9i90U.js";import"./access-gate-DR0BZ9Yv.js";import"./capability-load-error-C1lcmzPk.js";const g=l.lazy(()=>p(()=>import("./registry-layout-CC29q8fz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./index-BjoOIgbb.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-DjRZQa58.js";import{cG as i}from"./index-BjoOIgbb.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-DjRZQa58.js";import{cG as u,aF as n}from"./index-BjoOIgbb.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as s,g as l,j as o,l as a,E as n,r as c}from"./index-BjoOIgbb.js";import{a as f}from"./index-BDwe75Ed.js";import"./index-C_NDVGp1.js";import"./use-mcp-client-B46VYAN_.js";import"./collections-BU-b7Qnp.js";import"./index-CvubZqsl.js";import"./use-virtual-mcp-DHileccV.js";import"./use-collections-CrAY0KoX.js";import"./monaco-editor-DR1buwuA.js";import"./index-C6AFi5aI.js";import"./spinner-C2ljLkNd.js";import"./resizable-DaIe2JEk.js";import"./ZoomOut-CImzlj9g.js";import"./badge-GxV01_sa.js";import"./select-Dn6Da_1F.js";import"./tooltip-CKtclZb-.js";import"./Check-DCDpfG7m.js";import"./ChevronDown-BD0G-h2k.js";import"./ChevronUp-D5M0geM5.js";import"./view-mode-toggle-BvPi1TV1.js";import"./agent-icon-CjlB-XbA.js";import"./AlertCircle-BQLR7I4E.js";import"./Tool01-DQ4cTbeu.js";import"./SwitchHorizontal01-DC97OO23.js";import"./RefreshCcw01-4ELQWtuB.js";import"./XCircle-G0WrPq0g.js";import"./ArrowUpRight-DSaWSvAP.js";import"./ZapSquare-C9LhFrIW.js";import"./Users03-CA9cu5qb.js";import"./CheckCircle-BBK-3Pzt.js";import"./ChevronLeft-DtP_Ayjz.js";import"./ChevronRight-DUzhuedZ.js";import"./DotsVertical-Dok1GVxI.js";import"./Container-Catp9d2q.js";import"./Eye-Dmik5hYP.js";import"./Globe01-D1c-3J9t.js";import"./FilterLines-C37LaXJ1.js";import"./Star01--MeVNqbA.js";import"./Palette-C74Da44y.js";import"./HardDrive-C1vRZoAn.js";import"./Stars02-D6zEAnUT.js";import"./Key01-CdveS1HN.js";import"./LayoutLeft-Bfxz6P9F.js";import"./LinkExternal01-CxEkPs1F.js";import"./Monitor01-Bkoa3Nbe.js";import"./Sun-BGVsB7Cm.js";import"./Play-BERjgeke.js";import"./Plus-CdvauR8B.js";import"./SearchMd-DvX2rzEB.js";import"./Settings02-Cqwfv4FN.js";import"./Shield01-6id4oLiZ.js";import"./Stars01-C2BTpZeS.js";import"./Trash01-Biurgfq6.js";import"./Upload01-B-0o1yeU.js";import"./User01-CZ5ejYDg.js";import"./Users01-CKNLJr4G.js";import"./XClose-LNW85JIs.js";import"./X-DlMQL-XM.js";import"./Zap-CbtV6Vvm.js";import"./layout-D6JyUu-W.js";import"./index-M8U0QO9V.js";import"./sidebar-CIJpOENy.js";import"./sheet-CxiAY8T5.js";import"./use-connection-NiFefepq.js";import"./use-mcp-tools-wPegb5Xs.js";import"./dialog-Bug5LYvY.js";import"./scroll-area-7dB1B4gR.js";import"./index-K-cFrJme.js";import"./hover-card-7wnR4X6J.js";import"./dropdown-menu-CggnBdjt.js";import"./integration-icon-BxZqCPgY.js";import"./accordion-CiWkTYYE.js";import"./index-CCldjkHi.js";import"./empty-state-C6yeON6c.js";import"./watch-sse-pool-BSePGeIN.js";import"./input-CAytkUdm.js";function Bt(){const t=s.c(4);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/workflows/$itemId"},t[0]=r):r=t[0];const{itemId:e}=l(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(a,{size:32,className:"animate-spin text-muted-foreground"})}),t[1]=i):i=t[1];const p=decodeURIComponent(e);let m;return t[2]!==p?(m=o.jsx(n,{children:o.jsx(c.Suspense,{fallback:i,children:o.jsx(f,{itemId:p})})}),t[2]=p,t[3]=m):m=t[3],m}export{Bt as default};
|