decocms 4.76.45 → 4.76.46
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-B947WyJr.js → AlertCircle-BbShH-mX.js} +1 -1
- package/dist/client/assets/{AreaChart-BfsmrOXE.js → AreaChart-BTQfN5_9.js} +1 -1
- package/dist/client/assets/{ArrowUp-Bs_6P4Iu.js → ArrowUp-TCW_LpqH.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BxZoQJWz.js → ArrowUpRight-B_xjfr4-.js} +1 -1
- package/dist/client/assets/{Check-CcnPQW8L.js → Check-BXsPMsW3.js} +1 -1
- package/dist/client/assets/{CheckCircle-BU0_-3Q5.js → CheckCircle-D-ON-tXU.js} +1 -1
- package/dist/client/assets/{ChevronDown-HIcxNu9L.js → ChevronDown-FK1i2cda.js} +1 -1
- package/dist/client/assets/{ChevronRight-C5hCj-BJ.js → ChevronRight-BxKb2X6d.js} +1 -1
- package/dist/client/assets/{ChevronUp-zg_HGLWR.js → ChevronUp-DTyu_jE1.js} +1 -1
- package/dist/client/assets/{Circle-Bsy8_p9X.js → Circle-D7nNX4K5.js} +1 -1
- package/dist/client/assets/{Copy01-CEOVwp8a.js → Copy01-2dybe4kl.js} +1 -1
- package/dist/client/assets/{DotsVertical-BlOzCsHI.js → DotsVertical-Db1xcJ5E.js} +1 -1
- package/dist/client/assets/{Eye-CDNr9lij.js → Eye-DwR7I4w3.js} +1 -1
- package/dist/client/assets/{FilterLines-CY9-eI6Z.js → FilterLines-BBDKngQj.js} +1 -1
- package/dist/client/assets/{Flag01-C5CmZtnc.js → Flag01-CN8uzrjo.js} +1 -1
- package/dist/client/assets/{Globe01-C0_GSmts.js → Globe01-CV3En2Ls.js} +1 -1
- package/dist/client/assets/{Globe04-blrjzALH.js → Globe04-2jfLT1ix.js} +1 -1
- package/dist/client/assets/{HardDrive-DDCNtQf8.js → HardDrive-DQUZ995D.js} +1 -1
- package/dist/client/assets/{Key01-DhaQwTr9.js → Key01-B9g2V4mx.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CDGSUvFB.js → LayoutLeft-DwC5oXY5.js} +1 -1
- package/dist/client/assets/{LinkExternal01-wH6B14C5.js → LinkExternal01-BKC76Dzs.js} +1 -1
- package/dist/client/assets/{List-CT_BXxlG.js → List-BPL4htEO.js} +1 -1
- package/dist/client/assets/{Monitor01-CGFN5sGg.js → Monitor01-BYOux0H1.js} +1 -1
- package/dist/client/assets/{Package-Dl0Lfmce.js → Package-PtO_PF68.js} +1 -1
- package/dist/client/assets/{Palette-B0Atethk.js → Palette-Cn6kTx3k.js} +1 -1
- package/dist/client/assets/{Play-Dz4heBw1.js → Play-C4HbyMxP.js} +1 -1
- package/dist/client/assets/{Plus-DkxBw62L.js → Plus-DNC7p-U2.js} +1 -1
- package/dist/client/assets/{SearchLg-BxBwkXRA.js → SearchLg-CpecLFUh.js} +1 -1
- package/dist/client/assets/{SearchMd-Ck8RI60i.js → SearchMd-Dk-rbKyG.js} +1 -1
- package/dist/client/assets/{Settings02-OSetn6ea.js → Settings02-4V30Z_Rc.js} +1 -1
- package/dist/client/assets/{Shield01-Dq-HMUMk.js → Shield01-BZrNopeX.js} +1 -1
- package/dist/client/assets/{Star01-BlQBW3oI.js → Star01-BtQO-sK-.js} +1 -1
- package/dist/client/assets/{Stars01-COr-0k43.js → Stars01-BBOKRt9A.js} +1 -1
- package/dist/client/assets/{Stars02-Uz2mjN30.js → Stars02-C2-XCx99.js} +1 -1
- package/dist/client/assets/{Sun-NMZSBMue.js → Sun-Bz_6qC2T.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-aHLJ4VFM.js → SwitchHorizontal01-CWpf3QaM.js} +1 -1
- package/dist/client/assets/{Tool01-DPdDFdYA.js → Tool01-BnKQYdvQ.js} +1 -1
- package/dist/client/assets/{Tool02-CIj3JzdV.js → Tool02-Cw7OTXRR.js} +1 -1
- package/dist/client/assets/{Trash01-ZIY4ACli.js → Trash01-MAA-0WrD.js} +1 -1
- package/dist/client/assets/{TrendUp01-DqQByDKq.js → TrendUp01-D1gYLQXN.js} +1 -1
- package/dist/client/assets/{Upload01-D1HGy3QV.js → Upload01-BRQNHgaC.js} +1 -1
- package/dist/client/assets/{User01-B2aITRRg.js → User01-BiYiS115.js} +1 -1
- package/dist/client/assets/{UserPlus01-CoO5zvRr.js → UserPlus01-BMGOb45G.js} +1 -1
- package/dist/client/assets/{Users01-HqZawgTe.js → Users01-6LcUxn7A.js} +1 -1
- package/dist/client/assets/{Users03-C7WKxyUR.js → Users03-DylWGm6J.js} +1 -1
- package/dist/client/assets/{X-Dmet8wMD.js → X-kenEAaZ9.js} +1 -1
- package/dist/client/assets/{XCircle-BKwKlF9U.js → XCircle-9dpOIFAc.js} +1 -1
- package/dist/client/assets/{XClose-iezakeMo.js → XClose-DoiZPoY5.js} +1 -1
- package/dist/client/assets/{Zap-CfXP7HDl.js → Zap-CeDPBsJ6.js} +1 -1
- package/dist/client/assets/{ZapSquare-ChZlLfh_.js → ZapSquare-MC8D7_xS.js} +1 -1
- package/dist/client/assets/{ZoomOut-9DZqfrOE.js → ZoomOut-B1jg4SEk.js} +1 -1
- package/dist/client/assets/{access-gate-w5g_NZJz.js → access-gate-Bln9BeuQ.js} +1 -1
- package/dist/client/assets/{add-section-modal-EZt3P0Xz.js → add-section-modal-DkiLZGEQ.js} +1 -1
- package/dist/client/assets/{agent-icon-3oSe4h7A.js → agent-icon-Dza5MsGA.js} +1 -1
- package/dist/client/assets/{agents-list--g3RXbon.js → agents-list-g0IUCCUo.js} +1 -1
- package/dist/client/assets/{ai-providers-xzs6ey-5.js → ai-providers-DuHN0bmh.js} +1 -1
- package/dist/client/assets/{alert-BYCTaSqx.js → alert-B-UWhstv.js} +1 -1
- package/dist/client/assets/{alert-dialog-DFA_nrL8.js → alert-dialog-BjTVg8xn.js} +1 -1
- package/dist/client/assets/{app-editor-C2t8oVQ9.js → app-editor-Bscg6MLt.js} +1 -1
- package/dist/client/assets/{auth-CYtv0_rL.js → auth-Cp5Nl1YE.js} +1 -1
- package/dist/client/assets/{auth-catchall-DYzFRFT-.js → auth-catchall-DwA_5hbC.js} +1 -1
- package/dist/client/assets/auth-entry-CTtPCGlY.js +1 -0
- package/dist/client/assets/{auth-split-layout-hlCmxHcd.js → auth-split-layout-CEkXnkBm.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CRs0CnsY.js → authenticate-and-persist-oauth-CDxWfL-T.js} +1 -1
- package/dist/client/assets/{automation-list-row-DjYgTsuk.js → automation-list-row-7kEmkB7q.js} +1 -1
- package/dist/client/assets/automation-runs-C0I8E70_.js +188 -0
- package/dist/client/assets/automations-npp4-wog.js +1 -0
- package/dist/client/assets/{autosend-DpuAJlz4.js → autosend-Dm4TPbtR.js} +1 -1
- package/dist/client/assets/{avatar-DGZ13TB0.js → avatar-CMoEgv7B.js} +1 -1
- package/dist/client/assets/{badge-BmdcYP2l.js → badge-CwPxytOX.js} +1 -1
- package/dist/client/assets/{block-document-gXgzA-JT.js → block-document-Bg92o2kB.js} +1 -1
- package/dist/client/assets/{brand-context-D5LAfjNE.js → brand-context-0YBrBmm2.js} +1 -1
- package/dist/client/assets/{buckets-BaIxp0Ei.js → buckets--uxzFU68.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Dku6xKUm.js → bulk-category-panel-BQ6atbz2.js} +1 -1
- package/dist/client/assets/{calendar-CpBuBa24.js → calendar-Dua-hLr7.js} +1 -1
- package/dist/client/assets/{capability-load-error-CKORpXPj.js → capability-load-error-_-AXIBNu.js} +1 -1
- package/dist/client/assets/{card-COkVnQnP.js → card-R9H6yV5R.js} +1 -1
- package/dist/client/assets/{category-editor-CkzYWT7p.js → category-editor-DUhtv1t8.js} +1 -1
- package/dist/client/assets/{chat-context-DVVCYt3e.js → chat-context-DgsCr8vG.js} +1 -1
- package/dist/client/assets/{checkbox-BCHArcau.js → checkbox-4jHm8Kl-.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CgPoi_vX.js → cli-auth-success-Plw7Ca04.js} +1 -1
- package/dist/client/assets/{collection-detail-DonuJ1ea.js → collection-detail-otD7V02n.js} +1 -1
- package/dist/client/assets/{collection-display-button-DX-E5s8i.js → collection-display-button-OKhH37ny.js} +1 -1
- package/dist/client/assets/{collection-search-BwRybpDA.js → collection-search-C1JdTb5c.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cm_vq1an.js → collection-table-wrapper-9iS-DtyJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-CGlZLNZG.js → collection-tabs-CdYYgrXQ.js} +1 -1
- package/dist/client/assets/{command-DYuWdmIc.js → command-Dsyt006B.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-oXX0RjMQ.js → commerce-onboarding-C-CK5zeh.js} +1 -1
- package/dist/client/assets/{companions-core-BN8wLX0q.js → companions-core-Ds2SlsrP.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-nlx1v20u.js → connect-desktop-dialog-D8ch3MEx.js} +1 -1
- package/dist/client/assets/{connection-card-B2p6WHp7.js → connection-card-BCEFn0dL.js} +1 -1
- package/dist/client/assets/{connection-detail-DNd225oV.js → connection-detail-NNVrmVmx.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CTe9zYBl.js → connection-form-helpers-B1D0Q0Zd.js} +1 -1
- package/dist/client/assets/{connections-B2k7UMz9.js → connections-oNhvnbq9.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-yvpwgZWV.js → decopilot-sse-pool--LPnPAkT.js} +1 -1
- package/dist/client/assets/{dialog-CvMUMR16.js → dialog-kxSQ9Z0G.js} +1 -1
- package/dist/client/assets/{domain-settings-rz9NZ9fx.js → domain-settings-CB0jXNY4.js} +1 -1
- package/dist/client/assets/{drawer-CQuJuOwU.js → drawer-CqByw-jx.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C_qDMDJc.js → dropdown-menu-CG_v90J8.js} +1 -1
- package/dist/client/assets/{empty-state-DFI2pRsv.js → empty-state-Dq384oJQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BFt9JrM6.js → extract-connection-data-CvoL7SnC.js} +1 -1
- package/dist/client/assets/file-explorer-kXrDqi0x.js +2 -0
- package/dist/client/assets/{file-type-icon-DSufmAQ5.js → file-type-icon-OYkohFDc.js} +1 -1
- package/dist/client/assets/{files-C_2xnvjf.js → files-O-jNlZiC.js} +1 -1
- package/dist/client/assets/{form-Bo-8Ln1U.js → form-BqeLZw8U.js} +1 -1
- package/dist/client/assets/{general-YPYBXJRf.js → general-DqDIaDnw.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DfirfuAT.js → github-repo-picker-DPH6oiQm.js} +1 -1
- package/dist/client/assets/{hooks-DOkARyS2.js → hooks-BjONhkvU.js} +1 -1
- package/dist/client/assets/{index-r5DmdNN7.js → index--fBes_wM.js} +1 -1
- package/dist/client/assets/{index-DwqZiRTX.js → index-7cmgkF_X.js} +28 -28
- package/dist/client/assets/{index-Oe3PDrxX.js → index-8vjYP3uS.js} +1 -1
- package/dist/client/assets/index-BGD06Ifk.js +8 -0
- package/dist/client/assets/{index-Ci3NpEBH.js → index-BLTu__Gg.js} +2 -2
- package/dist/client/assets/{index-CFF-0dHO.js → index-BM9m0MG6.js} +1 -1
- package/dist/client/assets/{index-YA1G0WAf.js → index-BZKz9MXL.js} +1 -1
- package/dist/client/assets/index-C1ZoeWCR.js +173 -0
- package/dist/client/assets/{index-BPVYWTbD.js → index-CqSXg_h8.js} +1 -1
- package/dist/client/assets/{index-CwVaTFWi.js → index-DCeG-s8Z.js} +1 -1
- package/dist/client/assets/{index-CS4EwFaR.js → index-DWnxopJb.js} +1 -1
- package/dist/client/assets/index-DcaN6oWP.js +1 -0
- package/dist/client/assets/{index-BALkJ2dx.js → index-DeV6aDLj.js} +1 -1
- package/dist/client/assets/{index-B5cMFR-y.js → index-DlsutDII.js} +3 -3
- package/dist/client/assets/{index-redirect-CIUk-Gax.js → index-redirect-DY5rWC9W.js} +1 -1
- package/dist/client/assets/{input-BsEx9qgh.js → input-Rw_ct7cN.js} +1 -1
- package/dist/client/assets/{integration-icon-BjKZxHyL.js → integration-icon-j5V6Rzm9.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DfAJpHso.js → invite-member-dialog-BDJqia7w.js} +1 -1
- package/dist/client/assets/{label-itDnpE7k.js → label-DDLNvJQY.js} +1 -1
- package/dist/client/assets/{layout-BeTn9gVm.js → layout-rb7oFUzG.js} +1 -1
- package/dist/client/assets/{login-BrNTuDDo.js → login-BE37marJ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DTAyDU2Q.js → mcp-oauth-DNjr4vj5.js} +1 -1
- package/dist/client/assets/{members-DyvIH1z_.js → members-CYB89vAT.js} +1 -1
- package/dist/client/assets/{monaco-editor-D_6PkZ4D.js → monaco-editor-DPbPbFFi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-qpSnjSHX.js → monitoring-stats-row-CfIvAiIb.js} +1 -1
- package/dist/client/assets/multi-select-CdSgWG0G.js +1 -0
- package/dist/client/assets/{oauth-callback-Bx2hE0re.js → oauth-callback-Clt2chuB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CxI3pM83.js → oauth-callback-ai-provider-kvy_Ve9Q.js} +1 -1
- package/dist/client/assets/onboarding-DJtX40eT.js +1 -0
- package/dist/client/assets/{org-install-B8UtLZNk.js → org-install-YdmA9pwU.js} +1 -1
- package/dist/client/assets/{org-layout-DLChqlHX.js → org-layout-Cfu3MGrn.js} +1 -1
- package/dist/client/assets/{organization-choice-BJmZA_ql.js → organization-choice-DZJIDjkJ.js} +1 -1
- package/dist/client/assets/{orgs-B_8qYm3m.js → orgs-CPjLJEw1.js} +1 -1
- package/dist/client/assets/{page-seo-form-ZcfqdJ3r.js → page-seo-form-DTJjOqOy.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Dh6-jskU.js +1 -0
- package/dist/client/assets/{popover-DktOaoCj.js → popover-vUXXfUBc.js} +1 -1
- package/dist/client/assets/post-editor-D-LBglk6.js +1 -0
- package/dist/client/assets/{primitives-B3tg18Ev.js → primitives-BmrXhyFZ.js} +1 -1
- package/dist/client/assets/{profile-Cm9T7Soa.js → profile-CbQV6Byw.js} +1 -1
- package/dist/client/assets/project-app-view-11N4RGfj.js +1 -0
- package/dist/client/assets/record-editor-D-PnxGFM.js +1 -0
- package/dist/client/assets/redirect-editor-DtcSfkYS.js +1 -0
- package/dist/client/assets/registry-CopB5Gj5.js +2 -0
- package/dist/client/assets/{registry-layout-IoatJ7vG.js → registry-layout-DOpccjDe.js} +1 -1
- package/dist/client/assets/{reports-_wvCcLC_.js → reports-CmHQ81Pn.js} +1 -1
- package/dist/client/assets/{require-capability-DQnQYS51.js → require-capability-Dgv4ZomJ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-PXLv9yf-.js → required-auth-layout-DEOqamE2.js} +1 -1
- package/dist/client/assets/{reset-password-DalzN_iF.js → reset-password-CWTfWC5h.js} +1 -1
- package/dist/client/assets/{roles-D6U_2d-V.js → roles-wkuYTB_S.js} +1 -1
- package/dist/client/assets/{search-input-DwylCsr-.js → search-input-Bjb6CtBl.js} +1 -1
- package/dist/client/assets/{secrets-YNk1kWRi.js → secrets-Di7mGwRX.js} +1 -1
- package/dist/client/assets/{sections-editor-DYDZI5jr.js → sections-editor-CxY-amhz.js} +1 -1
- package/dist/client/assets/{select-CkNw5vmE.js → select-ll87QfGd.js} +1 -1
- package/dist/client/assets/{select-model-DJy9oKx6.js → select-model-xsRbpwr8.js} +1 -1
- package/dist/client/assets/{self-tool-result-1X-Z7ZyX.js → self-tool-result-DPZt14Vy.js} +1 -1
- package/dist/client/assets/{seo-editor-Cn3g21qw.js → seo-editor-Bx_vZzjl.js} +1 -1
- package/dist/client/assets/settings-layout-BJWT8yEM.js +1 -0
- package/dist/client/assets/{settings-section-M1O3ge8Z.js → settings-section-BPXGeyMz.js} +1 -1
- package/dist/client/assets/{shell-controls-CVfU7qci.js → shell-controls-D-TopT5a.js} +1 -1
- package/dist/client/assets/{shell-layout-DoAVrerK.js → shell-layout-DWQz87Pa.js} +1 -1
- package/dist/client/assets/{sidebar-BQFslZSt.js → sidebar-Dju9sgvp.js} +1 -1
- package/dist/client/assets/{skeleton-CKbIkp-i.js → skeleton-CdoG2zLE.js} +1 -1
- package/dist/client/assets/{sso-Cw5YEeWo.js → sso-CmByVx0d.js} +1 -1
- package/dist/client/assets/{store-BtFkKlkI.js → store-BLa7VKhN.js} +1 -1
- package/dist/client/assets/store-registry-BMkGX-xs.js +2 -0
- package/dist/client/assets/{studio-tools-C0FSNSO6.js → studio-tools-D2YN6d8l.js} +1 -1
- package/dist/client/assets/{switch-BOKpfG2a.js → switch-xWUsjG4Q.js} +1 -1
- package/dist/client/assets/{table-B88p_wsC.js → table-DhhEQ0mO.js} +1 -1
- package/dist/client/assets/{tabs-DDA7IPHD.js → tabs-g6MtT8J3.js} +1 -1
- package/dist/client/assets/{textarea-D9ia054b.js → textarea-Bjk6bxvA.js} +1 -1
- package/dist/client/assets/{toggle-group-CisLBmfi.js → toggle-group-CnVszF4a.js} +1 -1
- package/dist/client/assets/{toolbar-lHwKVbcz.js → toolbar-Cu9Rhq6w.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BdhEbL8g.js → toolbar-icon-button-BbNgXfao.js} +1 -1
- package/dist/client/assets/{tooltip-Cm1Uo3tj.js → tooltip-vH0hT_S_.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BSTSxr9f.js → use-ai-providers-sqQoB_M0.js} +1 -1
- package/dist/client/assets/{use-automations-z-3-_HVg.js → use-automations-CGN75f-I.js} +1 -1
- package/dist/client/assets/{use-autosave-DOzBKdWx.js → use-autosave-CkPLD6B4.js} +1 -1
- package/dist/client/assets/{use-capability-H0m9y9gf.js → use-capability-_dbRY3q9.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DVjyQSN6.js → use-clock-tick-BWb_U2Xo.js} +1 -1
- package/dist/client/assets/{use-collections-IkbkyTPy.js → use-collections-B8ZAMyMV.js} +1 -1
- package/dist/client/assets/{use-connection-BjfpYHE7.js → use-connection-SJTKeTV8.js} +1 -1
- package/dist/client/assets/{use-copy-BhCEUwuV.js → use-copy-BLjfFW8C.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-N2ZbWygG.js → use-create-virtual-mcp-0lZOsba5.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DRL2Q2vw.js → use-debounced-autosave-CojpJ2Z2.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DYEvOfgl.js → use-debounced-value-Djv7lm81.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CAb1KNIs.js → use-deco-credits-C9en5xKK.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CssQ7XMz.js → use-decopilot-events-D7uiMNY1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CJ6X4D3N.js → use-delete-connection-L8_mYjFV.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DxlBCcMw.js → use-deployment-admin-kF9Z8x8H.js} +1 -1
- package/dist/client/assets/{use-file-configs-DniTn_7W.js → use-file-configs-Cf-WdLXO.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BzjM30U0.js → use-infinite-scroll-BcCvsdjd.js} +1 -1
- package/dist/client/assets/{use-join-requests-DH0ZVoBc.js → use-join-requests-CnwVYkrj.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B-vnUxNV.js → use-mcp-auth-status-DcCkteNo.js} +1 -1
- package/dist/client/assets/{use-mcp-client-lixd0gAV.js → use-mcp-client-C6JIQ2mv.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cv_rmBI5.js → use-mcp-tools-BtiniEuA.js} +1 -1
- package/dist/client/assets/{use-members-XsfnxDj6.js → use-members-C4v7iGly.js} +1 -1
- package/dist/client/assets/{use-mobile-BYgIZfXj.js → use-mobile-BrmE87Sd.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BAQepcY9.js → use-navigate-to-agent-Ily6aQHi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DNG8tLX7.js → use-org-auth-client-BS08LyYo.js} +1 -1
- package/dist/client/assets/{use-org-sso-CymoIsv4.js → use-org-sso-CWPP-CGh.js} +1 -1
- package/dist/client/assets/{use-organization-roles-pkqdjnMJ.js → use-organization-roles-C-1IxgQu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DxC5BT5e.js → use-organization-settings-DJM4Zmu-.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DzCHf8MS.js → use-registry-connections-BqqId9V-.js} +1 -1
- package/dist/client/assets/{use-secrets-j9NqCesQ.js → use-secrets-0cKpwB02.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C-YKbG5N.js → use-status-sounds-BQrsykBc.js} +1 -1
- package/dist/client/assets/{use-view-mode-C6YHDmgm.js → use-view-mode-t_ypwSCC.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DUjw2r9s.js → use-virtual-mcp-D06GSrBg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-uVPnN3Ll.js +1 -0
- package/dist/client/assets/{useRouterState-Cqq6ONsl.js → useRouterState-D-A1Ld7s.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DCwOcpeP.js +1 -0
- package/dist/client/assets/{users-BlkgmN4u.js → users-B1ypwcEd.js} +1 -1
- package/dist/client/assets/variant-calendar-D36Cj1MF.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CKsyyD3I.js → view-mode-toggle-BE2XSMM1.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/auth-entry-DA-DPJTf.js +0 -1
- package/dist/client/assets/automation-runs-Db6yr9QX.js +0 -188
- package/dist/client/assets/automations-DTXTPNDC.js +0 -1
- package/dist/client/assets/file-explorer-CSMp40V7.js +0 -2
- package/dist/client/assets/index-BBdtoWBk.js +0 -173
- package/dist/client/assets/index-C-wKLEZ2.js +0 -8
- package/dist/client/assets/index-CpDqKOXJ.js +0 -1
- package/dist/client/assets/onboarding-BX2PevDl.js +0 -1
- package/dist/client/assets/page-seo-sheet-DmyH2nwh.js +0 -1
- package/dist/client/assets/post-editor-Dy_-iCsZ.js +0 -1
- package/dist/client/assets/project-app-view-DHGMtUxb.js +0 -1
- package/dist/client/assets/record-editor-225seTN8.js +0 -1
- package/dist/client/assets/redirect-editor-BWUzCv5f.js +0 -1
- package/dist/client/assets/registry-3lo6s_j5.js +0 -2
- package/dist/client/assets/settings-layout-B2pZI8PO.js +0 -1
- package/dist/client/assets/store-registry-CRAi8gqB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Bx9w5_18.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DDY3jNH9.js +0 -1
- package/dist/client/assets/variant-calendar-DQDzXWUH.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as oe,r as K,b as yt,C as Be,j as t,B as Z,t as Se,l as de,K as it,m as wt,x as rs,u as os,p as xt,E as ls}from"./index-B5cMFR-y.js";import{S as as}from"./search-input-DwylCsr-.js";import{P as De}from"./index-BALkJ2dx.js";import{E as St}from"./empty-state-DFI2pRsv.js";import{R as ns}from"./require-capability-DQnQYS51.js";import{N as Tt,A as is,Q as cs,U as Mt,V as Ze,W as At,X as ft,Y as ds,Z as _t,_ as Pt,L as ms,$ as us,a0 as xs,a1 as pt}from"./automation-runs-Db6yr9QX.js";import{u as vt}from"./use-connection-BjfpYHE7.js";import{g as Ut}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-BmdcYP2l.js";import{b as ct,P as dt,a as mt}from"./popover-DktOaoCj.js";import{b as et,T as tt,a as st}from"./tooltip-Cm1Uo3tj.js";import{i as ht}from"./Check-CcnPQW8L.js";import{a as Xe}from"./Copy01-CEOVwp8a.js";import{n as Dt}from"./Globe01-C0_GSmts.js";import{i as Vt}from"./FilterLines-CY9-eI6Z.js";import{i as fs}from"./Key01-DhaQwTr9.js";import{i as ps}from"./Play-Dz4heBw1.js";import{ao as hs,U as gs}from"./agent-icon-3oSe4h7A.js";import{M as Lt}from"./monaco-editor-D_6PkZ4D.js";import{u as js}from"./use-members-XsfnxDj6.js";import{u as vs}from"./use-mcp-client-lixd0gAV.js";import{u as Ns}from"./use-virtual-mcp-DUjw2r9s.js";import{S as bs,W as ys}from"./constants-D_FQAPnt.js";import{n as Ge}from"./Tool02-CIj3JzdV.js";import{c as ws}from"./SwitchHorizontal01-aHLJ4VFM.js";import{s as Ss}from"./Plus-DkxBw62L.js";import{s as Is}from"./Trash01-ZIY4ACli.js";import{I as Qe}from"./input-BsEx9qgh.js";import{a as ot,b as lt,c as at,d as $e,S as nt}from"./select-CkNw5vmE.js";import{t as Kt}from"./ChevronDown-HIcxNu9L.js";import{s as Cs}from"./Stars02-Uz2mjN30.js";import{C as ks}from"./calendar-CpBuBa24.js";import{b as Ts}from"./UserPlus01-CoO5zvRr.js";import{T as Ms}from"./textarea-D9ia054b.js";import{C as qt}from"./collection-tabs-CGlZLNZG.js";import{S as _s}from"./switch-BOKpfG2a.js";import{L as Ds}from"./label-itDnpE7k.js";import{I as qe}from"./integration-icon-BjKZxHyL.js";import{A as Bt}from"./avatar-DGZ13TB0.js";import{A as Ls,a as Fs,b as Rs}from"./alert-BYCTaSqx.js";import{C as Ht}from"./card-COkVnQnP.js";import{K as Me}from"./monitoring-stats-row-qpSnjSHX.js";import{u as Jt}from"./studio-tools-C0FSNSO6.js";import{u as $s}from"./useSuspenseInfiniteQuery-DDY3jNH9.js";import{o as zs,m as Os,p as Es,q as As}from"./sidebar-BQFslZSt.js";import{T as Fe,a as ut,b as Qt,c as Gt,d as Wt,e as ae}from"./table-B88p_wsC.js";import{n as Ps}from"./ChevronUp-zg_HGLWR.js";import{u as Us}from"./use-infinite-scroll-BzjM30U0.js";import{c as Vs,b as Ks}from"./use-automations-z-3-_HVg.js";import"./SearchMd-Ck8RI60i.js";import"./use-capability-H0m9y9gf.js";import"./access-gate-w5g_NZJz.js";import"./capability-load-error-CKORpXPj.js";import"./useInfiniteQuery-Bx9w5_18.js";import"./use-clock-tick-DVjyQSN6.js";import"./AlertCircle-B947WyJr.js";import"./CheckCircle-BU0_-3Q5.js";import"./Circle-Bsy8_p9X.js";import"./XCircle-BKwKlF9U.js";import"./checkbox-BCHArcau.js";import"./command-DYuWdmIc.js";import"./index-CFF-0dHO.js";import"./dialog-CvMUMR16.js";import"./X-Dmet8wMD.js";import"./Stars01-COr-0k43.js";import"./ChevronRight-C5hCj-BJ.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhCEUwuV.js";import"./file-type-icon-DSufmAQ5.js";import"./ZoomOut-9DZqfrOE.js";import"./use-mobile-BYgIZfXj.js";import"./tab-id-BijBBRwE.js";import"./index-CS4EwFaR.js";import"./chat-context-DVVCYt3e.js";import"./autosend-DpuAJlz4.js";import"./hooks-DOkARyS2.js";import"./decopilot-sse-pool-yvpwgZWV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BSTSxr9f.js";import"./use-decopilot-events-CssQ7XMz.js";import"./use-organization-settings-DxC5BT5e.js";import"./Eye-CDNr9lij.js";import"./Star01-BlQBW3oI.js";import"./XClose-iezakeMo.js";import"./ZapSquare-ChZlLfh_.js";import"./Tool01-DPdDFdYA.js";import"./Monitor01-CGFN5sGg.js";import"./Upload01-D1HGy3QV.js";import"./shell-layout-DoAVrerK.js";import"./Users03-C7WKxyUR.js";import"./SearchLg-BxBwkXRA.js";import"./Zap-CfXP7HDl.js";import"./alert-dialog-DFA_nrL8.js";import"./required-auth-layout-PXLv9yf-.js";import"./use-org-sso-CymoIsv4.js";import"./LinkExternal01-wH6B14C5.js";import"./ArrowUpRight-BxZoQJWz.js";import"./Palette-B0Atethk.js";import"./use-navigate-to-agent-BAQepcY9.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BfsmrOXE.js";import"./form-Bo-8Ln1U.js";import"./use-collections-IkbkyTPy.js";import"./ArrowUp-Bs_6P4Iu.js";import"./Settings02-OSetn6ea.js";import"./TrendUp01-DqQByDKq.js";import"./DotsVertical-BlOzCsHI.js";import"./Flag01-C5CmZtnc.js";import"./Globe04-blrjzALH.js";import"./HardDrive-DDCNtQf8.js";import"./LayoutLeft-CDGSUvFB.js";import"./List-CT_BXxlG.js";import"./Sun-NMZSBMue.js";import"./Package-Dl0Lfmce.js";import"./Shield01-Dq-HMUMk.js";import"./User01-B2aITRRg.js";import"./Users01-HqZawgTe.js";import"./index-Oe3PDrxX.js";import"./use-org-auth-client-DNG8tLX7.js";import"./auth-CYtv0_rL.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
|
-
`)}function Ft(s){return s.trim()?s.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...o]=e.split("=");return{key:r||"",operator:"eq",value:o.join("=")}}if(e.includes("~")){const[r,...o]=e.split("~");return{key:r||"",operator:"contains",value:o.join("~")}}if(e.includes("@")){const[r,...o]=e.split("@");return{key:r||"",operator:"in",value:o.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},o=[],a={};for(const l of s)if(l.key.trim())switch(l.operator){case"eq":l.value&&(e[l.key]=l.value);break;case"contains":l.value&&(r[l.key]=`%${l.value}%`);break;case"exists":o.push(l.key);break;case"in":l.value&&(a[l.key]=l.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:o.length>0?o:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
|
|
4
|
-
|
|
5
|
-
... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Hs(s){const e=oe.c(117),{log:r}=s,[o,a]=K.useState(!1),[l,c]=K.useState(!1),i=yt(),{org:n}=Be(),d=vt(),f=Rt(r.input),p=Rt(r.output),v=Js;let b;e[0]!==r.input||e[1]!==r.output?(b=async se=>{const ee=v(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(ee),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Se.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=b):b=e[2];const u=b;let R;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(R=se=>{const ee=v(se==="input"?r.input:r.output),le=new Blob([ee],{type:"application/json"}),he=URL.createObjectURL(le),be=document.createElement("a");be.href=he,be.download=`${r.toolName}-${se}-${r.id}.json`,be.click(),URL.revokeObjectURL(he)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=R):R=e[7];const h=R;let j;e[8]!==d||e[9]!==r.connectionId||e[10]!==r.input||e[11]!==r.toolName||e[12]!==i||e[13]!==n?(j=()=>{const se=d.find(le=>le.id===r.connectionId);if(!se){Se.error("Could not find the connection for this tool call");return}const ee=crypto.randomUUID();sessionStorage.setItem(`replay-${ee}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:n.slug,appSlug:Ut(se),collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:ee}})},e[8]=d,e[9]=r.connectionId,e[10]=r.input,e[11]=r.toolName,e[12]=i,e[13]=n,e[14]=j):j=e[14];const m=j,[C,S]=K.useState(!1);let g;e[15]!==r.requestId?(g=async()=>{try{await navigator.clipboard.writeText(r.requestId),S(!0),setTimeout(()=>S(!1),2e3)}catch{Se.error("Failed to copy to clipboard")}},e[15]=r.requestId,e[16]=g):g=e[16];const _=g;let I;e[17]!==r.timestamp?(I=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[17]=r.timestamp,e[18]=I):I=e[18];const x=I,F="text-sm px-5 md:px-6 py-5 space-y-5";let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[19]=w):w=e[19];let D;e[20]!==x?(D=t.jsxs("div",{children:[w,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[20]=x,e[21]=D):D=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[22]=k):k=e[22];let O;e[23]!==r.durationMs?(O=t.jsxs("div",{children:[k,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[23]=r.durationMs,e[24]=O):O=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[25]=$):$=e[25];let J;e[26]!==r.userName?(J=t.jsxs("div",{children:[$,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[26]=r.userName,e[27]=J):J=e[27];let A;e[28]!==r.virtualMcpName?(A=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[28]=r.virtualMcpName,e[29]=A):A=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[30]=X):X=e[30];let y;e[31]!==r.requestId?(y=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[31]=r.requestId,e[32]=y):y=e[32];let T;e[33]!==C?(T=C?t.jsx(ht,{size:12}):t.jsx(Xe,{size:12}),e[33]=C,e[34]=T):T=e[34];let L;e[35]!==_||e[36]!==T?(L=t.jsx(Z,{size:"icon",variant:"ghost",onClick:_,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:T}),e[35]=_,e[36]=T,e[37]=L):L=e[37];let z;e[38]!==y||e[39]!==L?(z=t.jsxs("div",{children:[X,t.jsxs("div",{className:"flex items-center gap-1",children:[y,L]})]}),e[38]=y,e[39]=L,e[40]=z):z=e[40];let E;e[41]!==r.userAgent?(E=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[41]=r.userAgent,e[42]=E):E=e[42];let V;e[43]!==r.properties||e[44]!==i||e[45]!==n?(V=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[ee,le]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[ee,"=",le]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const he={key:ee,operator:"eq",value:le};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Re([he])}})},children:[t.jsx(Vt,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${ee}=${le}`),Se.success("Copied filter to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ee),Se.success("Copied key to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(fs,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(le),Se.success("Copied value to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(hs,{size:14,className:"mr-2"}),"Copy value"]})]})})]},ee)})})]}),e[43]=r.properties,e[44]=i,e[45]=n,e[46]=V):V=e[46];let q;e[47]!==O||e[48]!==J||e[49]!==A||e[50]!==z||e[51]!==E||e[52]!==V||e[53]!==D?(q=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[D,O,J,A,z,E,V]}),e[47]=O,e[48]=J,e[49]=A,e[50]=z,e[51]=E,e[52]=V,e[53]=D,e[54]=q):q=e[54];let U;e[55]!==r.errorMessage?(U=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[55]=r.errorMessage,e[56]=U):U=e[56];const Y="space-y-4";let B;e[57]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[57]=B):B=e[57];const Q=f.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(f.originalSize)," - truncated)"]});let P;e[58]!==Q?(P=t.jsxs("div",{className:"flex items-center gap-2",children:[B,Q]}),e[58]=Q,e[59]=P):P=e[59];let N;e[60]!==m||e[61]!==r.input?(N=r.input&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:m,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(ps,{size:14})})}),t.jsx(st,{children:"Replay tool call"})]}),e[60]=m,e[61]=r.input,e[62]=N):N=e[62];let M;e[63]!==h||e[64]!==f?(M=f.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full input"})]}),e[63]=h,e[64]=f,e[65]=M):M=e[65];let H;e[66]!==u?(H=()=>u("input"),e[66]=u,e[67]=H):H=e[67];let te;e[68]!==o?(te=o?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[68]=o,e[69]=te):te=e[69];let G;e[70]!==H||e[71]!==te?(G=t.jsx(Z,{size:"icon",variant:"ghost",onClick:H,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:te}),e[70]=H,e[71]=te,e[72]=G):G=e[72];let re;e[73]!==N||e[74]!==M||e[75]!==G?(re=t.jsxs("div",{className:"flex items-center gap-1",children:[N,M,G]}),e[73]=N,e[74]=M,e[75]=G,e[76]=re):re=e[76];let W;e[77]!==P||e[78]!==re?(W=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[P,re]}),e[77]=P,e[78]=re,e[79]=W):W=e[79];let ne;e[80]!==f?(ne=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:f.content,language:"json",height:"100%",readOnly:!0})}),e[80]=f,e[81]=ne):ne=e[81];let ce;e[82]!==W||e[83]!==ne?(ce=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[W,ne]})}),e[82]=W,e[83]=ne,e[84]=ce):ce=e[84];const ze="rounded-lg overflow-hidden border border-border",Ie="flex items-center justify-between p-1 pl-4 border-b border-border",Ce="flex items-center gap-2";let ie;e[85]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[85]=ie):ie=e[85];const Le=p.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(p.originalSize)," - truncated)"]});let ge;e[86]!==ie||e[87]!==Le?(ge=t.jsxs("div",{className:Ce,children:[ie,Le]}),e[86]=ie,e[87]=Le,e[88]=ge):ge=e[88];let je;e[89]!==h||e[90]!==p.isTruncated?(je=p.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full output"})]}),e[89]=h,e[90]=p.isTruncated,e[91]=je):je=e[91];let ve;e[92]!==u?(ve=()=>u("output"),e[92]=u,e[93]=ve):ve=e[93];let me;e[94]!==l?(me=l?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[94]=l,e[95]=me):me=e[95];let Ne;e[96]!==ve||e[97]!==me?(Ne=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:me}),e[96]=ve,e[97]=me,e[98]=Ne):Ne=e[98];let ue;e[99]!==je||e[100]!==Ne?(ue=t.jsxs("div",{className:"flex items-center gap-1",children:[je,Ne]}),e[99]=je,e[100]=Ne,e[101]=ue):ue=e[101];let xe;e[102]!==ge||e[103]!==ue?(xe=t.jsxs("div",{className:Ie,children:[ge,ue]}),e[102]=ge,e[103]=ue,e[104]=xe):xe=e[104];let fe;e[105]!==p.content?(fe=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:p.content,language:"json",height:"100%",readOnly:!0})}),e[105]=p.content,e[106]=fe):fe=e[106];let pe;e[107]!==xe||e[108]!==fe?(pe=t.jsx("div",{children:t.jsxs("div",{className:ze,children:[xe,fe]})}),e[107]=xe,e[108]=fe,e[109]=pe):pe=e[109];let ke;e[110]!==ce||e[111]!==pe?(ke=t.jsxs("div",{className:Y,children:[ce,pe]}),e[110]=ce,e[111]=pe,e[112]=ke):ke=e[112];let we;return e[113]!==q||e[114]!==U||e[115]!==ke?(we=t.jsxs("div",{className:F,children:[q,U,ke]}),e[113]=q,e[114]=U,e[115]=ke,e[116]=we):we=e[116],we}function Js(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Qs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const o=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:o,unit:a}}function ye(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const o=Yt(e);if(!o)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,l=new Date(a);if(o.offset===0||!o.unit)return{valid:!0,date:l};switch(o.unit){case"m":l.setMinutes(l.getMinutes()-o.offset);break;case"h":l.setHours(l.getHours()-o.offset);break;case"d":l.setDate(l.getDate()-o.offset);break;case"w":l.setDate(l.getDate()-o.offset*7);break;case"M":l.setMonth(l.getMonth()-o.offset);break}return{valid:!0,date:l}}function Gs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function $t(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const l=ye(e);return l.valid&&l.date?Gs(l.date):e}const o=Qs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${o}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=es.find(o=>o.from===s&&o.to===e);return r?r.label:`${$t(s)} to ${$t(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),o=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),l=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${o} ${a}:${l}:${c}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,o,a,l,c,i]=e,n=new Date(Number(r),Number(o)-1,Number(a),Number(l),Number(c),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=ye(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:o,disabled:a,error:l}){const[c,i]=K.useState(!1),[n,d]=K.useState(()=>gt(s)),[f,p]=K.useState(),[v,b]=K.useState(!1),u=K.useRef(s);u.current!==s&&(u.current=s,v||d(gt(s)));const R=x=>{const F=x.target.value;d(F),p(void 0)},h=()=>{b(!0)},j=()=>{b(!1);const x=n.trim();if(Zt(x)){p(void 0),e(x);return}const F=Xs(x);if(F){p(void 0),e(F.toISOString()),d(Je(F));return}const w=ye(x);if(w.valid&&w.date){p(void 0),e(x),d(Je(w.date));return}d(gt(s)),p(void 0)},m=x=>{if(x){const w=ye(s).date||new Date;x.setHours(w.getHours()),x.setMinutes(w.getMinutes()),x.setSeconds(0),x.setMilliseconds(0);const D=x.toISOString();d(Je(x)),e(D),p(void 0)}i(!1)},C=x=>{const[F,w]=x.target.value.split(":").map(Number),k=ye(s).date||new Date;k.setHours(F||0),k.setMinutes(w||0),k.setSeconds(0),k.setMilliseconds(0);const O=k.toISOString();d(Je(k)),e(O)},S=ye(s),g=S.valid?S.date:new Date,_=g?`${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`:"",I=l||f;return t.jsxs("div",{className:de("flex gap-1",o),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Qe,{value:n,onChange:R,onFocus:h,onBlur:j,placeholder:r,disabled:a,className:de("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(Ts,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ks,{mode:"single",selected:g||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Qe,{type:"time",value:_,onChange:C,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:o,quickRanges:a=es}){const[l,c]=K.useState(!1),[i,n]=K.useState(s.from),[d,f]=K.useState(s.to),[p,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),f(s.to));const u=m=>{b.current={from:m.from,to:m.to},n(m.from),f(m.to),c(!1),e({from:m.from,to:m.to})},R=()=>{const m=ye(i),C=ye(d);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!C.valid||!C.date){v("Invalid 'To' date");return}if(m.date>=C.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:d}),c(!1)},h=m=>s.from===m.from&&s.to===m.to,j=Ws(s.from,s.to);return t.jsxs(ct,{open:l,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:de("gap-1.5 min-w-[160px] justify-between",r),disabled:o,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Cs,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:j})]}),t.jsx(Kt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:l?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:d,onChange:f,placeholder:"now"})]}),p&&t.jsx("p",{className:"text-xs text-destructive",children:p}),t.jsx(Z,{onClick:R,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const C=h(m);return t.jsx("button",{type:"button",onClick:()=>u(m),className:de("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",C&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},c=wt,l=it.monitoringStatsToolCalls(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function er(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},c=wt,l=it.monitoringStatsLlm(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function _e(s){const e=oe.c(20),{title:r,value:o,action:a,children:l,className:c}=s;let i;e[0]!==c?(i=de("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let d;e[4]!==o?(d=t.jsx("span",{className:"text-4xl font-normal",children:o}),e[4]=o,e[5]=d):d=e[5];let f;e[6]!==n||e[7]!==d?(f=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,d]}),e[6]=n,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==a?(p=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=p):p=e[10];let v;e[11]!==f||e[12]!==p?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[f,p]}),e[11]=f,e[12]=p,e[13]=v):v=e[13];let b;e[14]!==l?(b=l&&t.jsx("div",{className:"flex flex-col gap-6",children:l}),e[14]=l,e[15]=b):b=e[15];let u;return e[16]!==i||e[17]!==v||e[18]!==b?(u=t.jsxs(Ht,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=u):u=e[19],u}function jt(s){const e=oe.c(14),{metrics:r,connections:o,mode:a,total:l}=s,{org:c}=Be(),i=yt();let n,d,f;if(e[0]!==o||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==l){f=Symbol.for("react.early_return_sentinel");e:{const v=o??[],b=new Map(r.map(sr));let u;e[9]!==a?(u=(h,j)=>{const m=_t(h.metric,a);return _t(j.metric,a)-m},e[9]=a,e[10]=u):u=e[10];const R=v.map(h=>({connection:h,metric:b.get(h.id)})).filter(tr).sort(u).slice(0,4);if(R.length===0){f=null;break e}n="flex flex-col",d=R.map((h,j)=>{const{connection:m,metric:C}=h,S=l>0?(C.calls/l*100).toFixed(1):"0.0",g=a==="errors"?`${C.errorRate.toFixed(1)}%`:`${S}%`,_=j===R.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!_&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Ut(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:g}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:ds(C,a)})]})]},m.id)})}e[0]=o,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=l,e[6]=n,e[7]=d,e[8]=f}else n=e[6],d=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;return e[11]!==n||e[12]!==d?(p=t.jsx("div",{className:n,children:d}),e[11]=n,e[12]=d,e[13]=p):p=e[13],p}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=oe.c(21),{models:r,mode:o}=s,a=o===void 0?"calls":o;if(r.length===0)return null;let l;e[0]!==a?(l=u=>a==="tokens"?(u.inputTokens??0)+(u.outputTokens??0):a==="cost"?u.costUsd??0:u.calls,e[0]=a,e[1]=l):l=e[1];const c=l;let i;e[2]!==a?(i=u=>a==="cost"?At(u):a==="tokens"?Ze(u):u.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let d;e[4]!==c?(d=(u,R)=>u+c(R),e[4]=c,e[5]=d):d=e[5];const f=r.reduce(d,0);let p,v;if(e[6]!==n||e[7]!==r||e[8]!==f||e[9]!==c){let u;e[12]!==c?(u=(j,m)=>c(m)-c(j),e[12]=c,e[13]=u):u=e[13];const R=[...r].sort(u).slice(0,4);p="flex flex-col";let h;e[14]!==n||e[15]!==f||e[16]!==c?(h=(j,m,C)=>{const S=c(j),g=f>0?(S/f*100).toFixed(1):"0.0",_=m===C.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3",!_&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(j.toolName)} 18%, transparent)`},children:t.jsx(Ge,{size:14,style:{color:Et(j.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:j.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[g,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},j.toolName)},e[14]=n,e[15]=f,e[16]=c,e[17]=h):h=e[17],v=R.map(h),e[6]=n,e[7]=r,e[8]=f,e[9]=c,e[10]=p,e[11]=v}else p=e[10],v=e[11];let b;return e[18]!==p||e[19]!==v?(b=t.jsx("div",{className:p,children:v}),e[18]=p,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=oe.c(48),{displayDateRange:r,connectionIds:o,excludeConnectionIds:a,toolName:l,status:c,connections:i,isStreaming:n,streamingRefetchInterval:d,llmUserIds:f}=s,p=cs(r),v=n?d:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:u,isError:R}=Zs({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:o.length>0?o:void 0,excludeConnectionIds:a,toolNames:l?[l]:void 0,status:c},b);let h;e[2]!==v?(h={refetchInterval:v},e[2]=v,e[3]=h):h=e[3];const{data:j,isError:m}=er({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:f?.length?f:void 0},h),C=R||m,S=u?{totalCalls:u.totalCalls,totalErrors:u.totalErrors,avgDurationMs:u.avgDurationMs,p95DurationMs:u.p95DurationMs,data:Mt(u.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},g=j?{totalCalls:j.totalCalls,totalErrors:j.totalErrors,avgDurationMs:j.avgDurationMs,p95DurationMs:j.p95DurationMs,data:Mt(j.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let _;e[4]!==j?.topTools?(_=j?.topTools??[],e[4]=j?.topTools,e[5]=_):_=e[5];const I=_,x=j?.totalInputTokens??0,F=j?.totalOutputTokens??0,w=j?.totalTokens??0,D=j?.totalCostUsd??0;let k;e[6]!==u?.connectionBreakdown?(k=u?.connectionBreakdown??[],e[6]=u?.connectionBreakdown,e[7]=k):k=e[7];const O=k,[$,J]=K.useState("avg");let A;e[8]!==C?(A=C&&t.jsxs(Ls,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Fs,{children:"Failed to load monitoring data"}),t.jsx(Rs,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=C,e[9]=A):A=e[9];let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=ce=>J(ce),e[10]=X):X=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ot,{className:"w-[120px]",children:t.jsx(lt,{})}),e[11]=y):y=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(at,{children:[t.jsx($e,{value:"avg",children:"Avg"}),t.jsx($e,{value:"p95",children:"P95"})]}),e[12]=T):T=e[12];let L;e[13]!==$?(L=t.jsxs(nt,{value:$,onValueChange:X,children:[y,T]}),e[13]=$,e[14]=L):L=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let E;e[16]!==I?(E=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=E):E=e[17];let V;e[18]!==w?(V=Ze(w),e[18]=w,e[19]=V):V=e[19];let q;e[20]!==x?(q=Ze(x),e[20]=x,e[21]=q):q=e[21];let U;e[22]!==F?(U=Ze(F),e[22]=F,e[23]=U):U=e[23];let Y;e[24]!==q||e[25]!==U?(Y=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",U," out"]}),e[24]=q,e[25]=U,e[26]=Y):Y=e[26];let B;e[27]!==I?(B=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=B):B=e[28];let Q;e[29]!==D?(Q=D>0?At(D):"—",e[29]=D,e[30]=Q):Q=e[30];let P;e[31]!==D?(P=D===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=D,e[32]=P):P=e[32];let N;e[33]!==I||e[34]!==D?(N=D>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=D,e[35]=N):N=e[35];let M;e[36]!==I?(M=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=M):M=e[37];const H=_e,te="AI Errors",G=g.totalErrors.toLocaleString();let re;e[38]!==g.data?(re=t.jsx(Me,{data:g.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=g.data,e[39]=re):re=e[39];let W;e[40]!==I||e[41]!==g.totalErrors?(W=g.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=g.totalErrors,e[42]=W):W=e[42];let ne;return e[43]!==H||e[44]!==G||e[45]!==re||e[46]!==W?(ne=t.jsxs(H,{title:te,value:G,children:[re,W]}),e[43]=H,e[44]=G,e[45]=re,e[46]=W,e[47]=ne):ne=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[A,t.jsxs(_e,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:O,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"Latency",value:ft($==="avg"?S.avgDurationMs:S.p95DurationMs),action:L,children:[t.jsx(Me,{data:S.data,dataKey:$,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:O,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(_e,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:O,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(_e,{title:"AI Calls",value:g.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:g.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),E]}),t.jsxs(_e,{title:"Tokens",value:V,action:Y,children:[t.jsx(Me,{data:g.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),B]}),t.jsxs(_e,{title:"Cost",value:Q,action:P,children:[t.jsx(Me,{data:g.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"AI Latency",value:ft(g.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",ft(g.p95DurationMs)]}),children:[t.jsx(Me,{data:g.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),M]}),ne]})]})}function Ke(s){const e=oe.c(8),{className:r}=s;let o;e[0]!==r?(o=de("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=l):l=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(or),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[l,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==o?(n=t.jsxs(Ht,{className:o,children:[a,i]}),e[6]=o,e[7]=n):n=e[7],n}function or(s,e){return t.jsxs("div",{className:de("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function lr(){const s=oe.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,o;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),o=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=o):(r=s[1],o=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=oe.c(46),{log:r,connection:o,virtualMcpName:a,virtualMcpIcon:l,onClick:c,lastLogRef:i}=s;let n,d;if(e[0]!==r.timestamp){const $=new Date(r.timestamp);n=$.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=$.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=d}else n=e[1],d=e[2];const f=d,p=o?.icon||null,v=o?.title??r.connectionId;let b;e[3]!==p||e[4]!==v?(b=t.jsx(Fe,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:p,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=p,e[4]=v,e[5]=b):b=e[5];let u;e[6]!==r.toolName?(u=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=u):u=e[7];const R=o?.title??r.connectionId;let h;e[8]!==R?(h=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:R}),e[8]=R,e[9]=h):h=e[9];let j;e[10]!==u||e[11]!==h?(j=t.jsxs(Fe,{className:"min-w-0 pr-2 md:pr-4",children:[u,h]}),e[10]=u,e[11]=h,e[12]=j):j=e[12];let m;e[13]!==l||e[14]!==a?(m=t.jsx(Fe,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:l,name:a,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=l,e[14]=a,e[15]=m):m=e[15];let C;e[16]!==r.userImage||e[17]!==r.userName?(C=t.jsx(Bt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=C):C=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let g;e[21]!==C||e[22]!==S?(g=t.jsx(Fe,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,S]})}),e[21]=C,e[22]=S,e[23]=g):g=e[23];let _;e[24]!==n?(_=t.jsx("div",{children:n}),e[24]=n,e[25]=_):_=e[25];let I;e[26]!==f?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:f}),e[26]=f,e[27]=I):I=e[27];let x;e[28]!==_||e[29]!==I?(x=t.jsxs(Fe,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[_,I]}),e[28]=_,e[29]=I,e[30]=x):x=e[30];let F;e[31]!==r.durationMs?(F=t.jsxs(Fe,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=F):F=e[32];const w=r.isError?"destructive":"success",D=r.isError?"Error":"OK";let k;e[33]!==w||e[34]!==D?(k=t.jsx(Fe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:w,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:D})})}),e[33]=w,e[34]=D,e[35]=k):k=e[35];let O;return e[36]!==i||e[37]!==c||e[38]!==g||e[39]!==x||e[40]!==F||e[41]!==k||e[42]!==b||e[43]!==j||e[44]!==m?(O=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,j,m,g,x,F,k]}),e[36]=i,e[37]=c,e[38]=g,e[39]=x,e[40]=F,e[41]=k,e[42]=b,e[43]=j,e[44]=m,e[45]=O):O=e[45],O}function nr(s){const e=oe.c(26),{connectionIds:r,virtualMcpIds:o,tool:a,status:l,search:c,logs:i,hasMore:n,onLoadMore:d,isLoadingMore:f,connections:p,virtualMcps:v,membersData:b,client:u}=s,R=p??[],h=v??[],[j,m]=K.useState(null),C=Us(d,n,f),S=Pt(b),g=new Map(S.map(mr)),_=new Map(h.map(dr));let x=i.map(N=>{const M=g.get(N.userId??""),H=N.virtualMcpId?_.get(N.virtualMcpId):null;return{...N,userName:M?.name??N.userId??"Unknown",userImage:M?.image??void 0,virtualMcpName:H?.title??null,virtualMcpIcon:H?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=M=>r.includes(M.connectionId),e[0]=r,e[1]=N):N=e[1],x=x.filter(N)}if(o.length>1){let N;e[2]!==o?(N=M=>M.virtualMcpId&&o.includes(M.virtualMcpId),e[2]=o,e[3]=N):N=e[3],x=x.filter(N)}const F=new Map(R.map(cr));if(c){const N=c.toLowerCase();x=x.filter(M=>M.toolName.toLowerCase().includes(N)||(F.get(M.connectionId)?.title??M.connectionId).toLowerCase().includes(N)||M.errorMessage?.toLowerCase().includes(N))}const w=j!==null?x[j]??null:null,D=wt({queryKey:it.monitoringLogDetail(w?.id??""),queryFn:async()=>{if(!u)throw new Error("MCP client is not available");const N=await u.callTool({name:"MONITORING_LOG_GET",arguments:{id:w.id}});return N.structuredContent??N},enabled:w!==null}),k=D.data?.log,O=w&&k?{...w,input:k.input,output:k.output}:w;if(x.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const M=c||r.length>0||o.length>0||a||l!=="all"?"No logs match your filters":"No logs found in this time range";let H;return e[5]!==M?(H=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(St,{image:N,title:"No logs found",description:M})}),e[5]=M,e[6]=H):H=e[6],H}const $="flex-1 flex flex-col min-w-0",J="flex-1 min-w-0 pt-1",A="min-w-[600px] md:min-w-0",X=Gt,y="w-full border-collapse";let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(ae,{className:"w-5"}),t.jsx(ae,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(ae,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(ae,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[7]=T):T=e[7];const L=Qt,z=x.map((N,M)=>t.jsx(ar,{log:N,connection:F.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(M),lastLogRef:M===x.length-1?C:void 0},N.id));let E;e[8]!==L||e[9]!==z?(E=t.jsx(L,{children:z}),e[8]=L,e[9]=z,e[10]=E):E=e[10];let V;e[11]!==X||e[12]!==T||e[13]!==E?(V=t.jsx("div",{className:J,children:t.jsx("div",{className:A,children:t.jsxs(X,{className:y,children:[T,E]})})}),e[11]=X,e[12]=T,e[13]=E,e[14]=V):V=e[14];const q=j!==null;let U;e[15]!==m?(U=N=>{N||m(null)},e[15]=m,e[16]=U):U=e[16];const Y=w&&j!==null&&t.jsxs(t.Fragment,{children:[t.jsx(zs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:F.get(w.connectionId)?.icon||null,name:F.get(w.connectionId)?.title??w.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:w.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:F.get(w.connectionId)?.title??w.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:j===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(Ps,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<x.length-1?N+1:N),disabled:j===x.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Kt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:D.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):D.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>D.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:O})})]});let B;e[17]!==Y?(B=t.jsx(Es,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Y}),e[17]=Y,e[18]=B):B=e[18];let Q;e[19]!==U||e[20]!==B||e[21]!==q?(Q=t.jsx(As,{open:q,onOpenChange:U,children:B}),e[19]=U,e[20]=B,e[21]=q,e[22]=Q):Q=e[22];let P;return e[23]!==Q||e[24]!==V?(P=t.jsxs("div",{className:$,children:[V,Q]}),e[23]=Q,e[24]=V,e[25]=P):P=e[25],P}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=oe.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ae,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ae,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ae,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=o):o=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ae,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let l;s[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=l):l=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,o,a,l,c,t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Gt,{className:"w-full border-collapse",children:[i,t.jsx(Qt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const bt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=oe.c(34),{client:r,locator:o,baseParams:a,pageSize:l,isStreaming:c,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:d,tool:f,status:p,searchQuery:v,allConnections:b,allVirtualMcps:u,membersData:R}=s;let h;e[0]!==a||e[1]!==o?(h=it.monitoringLogsInfinite(o,JSON.stringify(a)),e[0]=a,e[1]=o,e[2]=h):h=e[2];let j;e[3]!==a||e[4]!==r||e[5]!==l?(j=async J=>{const{pageParam:A}=J,X=A===void 0?0:A;if(!r)throw new Error("MCP client is not available");const y=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:l,offset:X}});return y.structuredContent??y},e[3]=a,e[4]=r,e[5]=l,e[6]=j):j=e[6];let m;e[7]!==l?(m=(J,A)=>{if(!((J?.logs?.length??0)<l))return A.length*l},e[7]=l,e[8]=m):m=e[8];const C=c?i:!1;let S;e[9]!==h||e[10]!==j||e[11]!==m||e[12]!==C?(S={queryKey:h,queryFn:j,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:C},e[9]=h,e[10]=j,e[11]=m,e[12]=C,e[13]=S):S=e[13];const{data:g,fetchNextPage:_,hasNextPage:I,isFetchingNextPage:x}=$s(S);let F;e[14]!==g.pages?(F=g.pages.flatMap(pr),e[14]=g.pages,e[15]=F):F=e[15];const w=F;let D;e[16]!==_||e[17]!==I||e[18]!==x?(D=()=>{I&&!x&&_()},e[16]=_,e[17]=I,e[18]=x,e[19]=D):D=e[19];const k=D,O=I??!1;let $;return e[20]!==b||e[21]!==u||e[22]!==r||e[23]!==n||e[24]!==k||e[25]!==x||e[26]!==R||e[27]!==w||e[28]!==v||e[29]!==p||e[30]!==O||e[31]!==f||e[32]!==d?($=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(bt,{connectionIds:n,virtualMcpIds:d,tool:f,status:p,search:v,logs:w,hasMore:O,onLoadMore:k,isLoadingMore:x,connections:b,virtualMcps:u,membersData:R,client:r})})})}),e[20]=b,e[21]=u,e[22]=r,e[23]=n,e[24]=k,e[25]=x,e[26]=R,e[27]=w,e[28]=v,e[29]=p,e[30]=O,e[31]=f,e[32]=d,e[33]=$):$=e[33],$}function pr(s){return s.logs??[]}function hr(s){const e=oe.c(15),{dateRange:r}=s,{data:o,isLoading:a}=Vs(void 0);let l;e[0]!==o?(l=o===void 0?[]:o,e[0]=o,e[1]=l):l=e[1];const c=l,[i,n]=K.useState(null),d=i??c[0]?.id??null,{data:f}=Ks(d??"");let p;e[2]!==r.startDate?(p=r.startDate.toISOString(),e[2]=r.startDate,e[3]=p):p=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==v?(b={startDate:p,endDate:v},e[6]=p,e[7]=v,e[8]=b):b=e[8];const u=b;let R;return e[9]!==f||e[10]!==c||e[11]!==d||e[12]!==a||e[13]!==u?(R=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(St,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:d??"",onValueChange:h=>n(h),children:[t.jsx(ot,{className:"w-72",children:t.jsx(lt,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(jr)})]})}),f?t.jsx(ms,{automationId:f.id,triggerIds:f.triggers.map(gr),range:u}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=f,e[10]=c,e[11]=d,e[12]=a,e[13]=u,e[14]=R):R=e[14],R}function gr(s){return s.id}function jr(s){return t.jsx($e,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:o,hideSystem:a,propertyFilters:l,connectionOptions:c,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:d,onConnectionSearchChange:f,memberOptions:p,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:u}){const[R,h]=K.useState(!1),[j,m]=K.useState("form"),[C,S]=K.useState(r),[g,_]=K.useState(l),[I,x]=K.useState(Ye(l)),F=K.useRef(r),w=K.useRef(Re(l));F.current!==r&&(F.current=r,C!==r&&S(r));const D=Re(l);w.current!==D&&(w.current=D,_(l),x(Ye(l)));const k=(y,T)=>{const L=[...g],z=L[y];z&&(L[y]={key:T.key??z.key,operator:T.operator??z.operator,value:T.value??z.value},_(L))},O=()=>{_([...g,{key:"",operator:"eq",value:""}])},$=y=>{const T=g.filter((L,z)=>z!==y);_(T),x(Ye(T)),d({propertyFilters:Re(T)})},J=()=>{d({propertyFilters:Re(g)})},A=()=>{const y=Ft(I);_(y),d({propertyFilters:Re(y)})},X=()=>{if(j==="raw"){const y=Ft(I);_(y),m("form")}else x(Ye(g)),m("raw")};return t.jsxs(ct,{open:R,onOpenChange:h,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Vt,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ds,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(_s,{id:"hide-system-calls",checked:a,onCheckedChange:y=>d({hideSystem:!!y})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(pt,{options:c,defaultValue:s,onValueChange:y=>d({connectionId:y}),onSearchChange:f,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(pt,{options:i,defaultValue:e,onValueChange:y=>d({virtualMcpId:y}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),u&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(pt,{options:p??[],defaultValue:v,onValueChange:y=>b?.(y),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Qe,{id:"filter-tool",placeholder:"Filter by tool...",value:C,onChange:y=>S(y.target.value),onBlur:()=>{C!==r&&d({tool:C})},onKeyDown:y=>{y.key==="Enter"&&C!==r&&d({tool:C})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:o,onValueChange:y=>d({status:y}),children:[t.jsx(ot,{className:"w-full",children:t.jsx(lt,{})}),t.jsxs(at,{children:[t.jsx($e,{value:"all",children:"All Status"}),t.jsx($e,{value:"success",children:"Success Only"}),t.jsx($e,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:X,children:j==="raw"?t.jsx(ws,{size:14}):t.jsx(gs,{size:14})})}),t.jsx(st,{children:j==="raw"?"Switch to form view":"Switch to raw text"})]})]}),j==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ms,{placeholder:`Paste property filters here:
|
|
6
|
-
thread_id=abc123
|
|
7
|
-
user~test
|
|
8
|
-
debug?`,value:I,onChange:y=>x(y.target.value),onBlur:A,onKeyDown:y=>{y.key==="Enter"&&y.metaKey&&A()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[g.map((y,T)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(Is,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Qe,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Re(z)}))},children:[t.jsx(ot,{className:"w-28",children:t.jsx(lt,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Qe,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(Ss,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=oe.c(113),{tab:r,dateRange:o,displayDateRange:a,connectionIds:l,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:R,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=Ns(),{data:_}=js(),[I,x]=K.useState(""),F=I||void 0;let w;e[0]!==F?(w={searchTerm:F},e[0]=F,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const A=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:bs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=vs(z);let V;e[11]!==R?(V=Bs(R),e[11]=R,e[12]=V):V=e[12];const q=V;let U;e[13]!==p||e[14]!==T.id?(U=p?[ys.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=U):U=e[15];const Y=U;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[Q,P]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[G,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(G.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Pt(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==o.startDate?(Ce=o.startDate.toISOString(),e[21]=o.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==o.endDate?(ie=o.endDate.toISOString(),e[23]=o.endDate,e[24]=ie):ie=e[24];const Le=l.length===1?l[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Chats"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let le;e[44]!==v||e[45]!==l||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==Q||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==R||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==A?(le=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-success animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:l,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:R,connectionOptions:$,virtualMcpOptions:A,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:Q,onLlmUserIdsChange:P,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=l,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=Q,e[51]=Ie,e[52]=m,e[53]=h,e[54]=R,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=A,e[60]=le):le=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==G||e[67]!==A?(he=r==="threads"&&t.jsx(us,{filterAgentIds:M,filterUserIds:G,filterStatus:W,virtualMcpOptions:A,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=G,e[67]=A,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==le||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[le,he,Oe]}),e[75]=le,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Ae;e[79]!==ee||e[80]!==Ee?(Ae=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Ae):Ae=e[81];let Pe;e[82]!==h||e[83]!==d||e[84]!==r?(Pe=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Pe):Pe=e[85];let Ue;e[86]!==Ae||e[87]!==Pe?(Ue=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Ae,Pe]})}),e[86]=Ae,e[87]=Pe,e[88]=Ue):Ue=e[88];let Ve;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==l||e[94]!==o||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==Q||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==G||e[107]!==i||e[108]!==c?(Ve=r==="automations"?t.jsx(hr,{dateRange:o}):r==="threads"?t.jsx(xs,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:o,searchQuery:d,filterAgentIds:M,filterUserIds:G,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:l,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:l,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:Q})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=l,e[94]=o,e[95]=a,e[96]=Y,e[97]=f,e[98]=Q,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=G,e[107]=i,e[108]=c,e[109]=Ve):Ve=e[109];let We;return e[110]!==Ue||e[111]!==Ve?(We=t.jsxs(t.Fragment,{children:[Ue,Ve]}),e[110]=Ue,e[111]=Ve,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:o=>{const{className:a}=o;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Super Agent";return{value:s.id??"",label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Ul(){const s=oe.c(83),{org:e}=Be(),r=yt();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/monitor"},s[0]=o):o=s[0];const a=os(o),{tab:l,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:R}=a,h=l===void 0?"overview":l;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=R===void 0?!1:R;let x,F,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let P;s[24]!==r||s[25]!==e.slug||s[26]!==a?(P=G=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...G}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=P):P=s[27],$=P;let N;s[28]!==$?(N=G=>{$({from:G.from,to:G.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const G=ye(c),re=ye(i);H=G.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],F=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=F,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],F=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let A;s[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=A):A=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[A,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Chats"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=P=>$({tab:P}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(lr,{})}),s[48]=h,s[49]=E):E=s[49];let V;s[50]!==z||s[51]!==E?(V=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=V):V=s[52];let q;s[53]!==D?(q=P=>{xt("monitoring_time_range_changed",{from:P.from,to:P.to}),D(P)},s[53]=D,s[54]=q):q=s[54];let U;s[55]!==g||s[56]!==$?(U=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=U):U=s[57];let Y;s[58]!==h||s[59]!==$?(Y=P=>{P!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:P}),$({tab:P})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==F||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==U||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:F,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:U,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=F,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=U,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let Q;return s[80]!==V||s[81]!==B?(Q=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(ls,{fallback:X,children:t.jsx(K.Suspense,{fallback:V,children:B})})})}),s[80]=V,s[81]=B,s[82]=Q):Q=s[82],Q}function Ir(s){return s.key.trim()}export{Ul as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,b as me,C as Z,D as Hs,j as s,B as We,r as R,F as Bs,E as St,a as le,v as Gs,K as es,d as gt,p as ne,G as et,l as P,H as Ws,I as qs,J as Vs,M as Ks,P as Ys,q as Xs,t as ce,s as Qs,i as ts,e as _t,u as tt,L as Js,R as Zs,U as en,V as tn,W as sn,m as nn,X as ln,O as rn,Y as on}from"./index-B5cMFR-y.js";import{u as be,S as Nt,a as Ct,b as ie,c as Q,d as V,e as ss,f as an,g as ns,h as cn,i as Le,j as dn,k as mn,l as un}from"./sidebar-BQFslZSt.js";import{u as wt}from"./use-mobile-BYgIZfXj.js";import{C as fn,p as ut,s as hn,b as xn,S as pn,d as gn,e as bn,c as jn,n as vn}from"./self-tool-result-1X-Z7ZyX.js";import{f as yn,a as is,e as ls,g as Sn,D as _n,h as Nn,d as Cn}from"./dialog-CvMUMR16.js";import{f as wn}from"./tab-id-BijBBRwE.js";import{u as rs}from"./use-mcp-client-lixd0gAV.js";import{C as kn,W as os,g as In,S as as,a as Qe,i as An,b as zn}from"./constants-D_FQAPnt.js";import{i as cs}from"./XCircle-BKwKlF9U.js";import{S as de}from"./skeleton-CKbIkp-i.js";import{i as ds}from"./LayoutLeft-CDGSUvFB.js";import{t as kt}from"./ChevronDown-HIcxNu9L.js";import{T as xe,a as pe,b as ge,c as bt}from"./tooltip-Cm1Uo3tj.js";import{u as ms,a as It}from"./use-virtual-mcp-DUjw2r9s.js";import{A as ve,a as Tt,i as Ot,t as $n,b as Tn,c as Mt,d as On,s as Mn,e as En}from"./agent-icon-3oSe4h7A.js";import{P as Fe,a as st,b as nt}from"./popover-DktOaoCj.js";import{i as us}from"./Check-CcnPQW8L.js";import{s as Ue}from"./Plus-DkxBw62L.js";import{i as fs}from"./SearchMd-Ck8RI60i.js";import{s as Dn}from"./XClose-iezakeMo.js";import{A as Pn,a as Fn,b as Rn,c as Ln,d as Un,e as Hn,f as Bn}from"./alert-dialog-DFA_nrL8.js";import{F as Gn,a as Wn,b as qn,c as Vn,d as Kn,e as Yn,f as Xn}from"./form-Bo-8Ln1U.js";import{I as Qn}from"./input-BsEx9qgh.js";import{S as Jn,u as Zn,C as ei}from"./chat-context-DVVCYt3e.js";import{T as ye}from"./toolbar-icon-button-BdhEbL8g.js";import{D as hs,a as xs,b as ps}from"./drawer-CQuJuOwU.js";import{G as ti,a as si}from"./github-repo-picker-DfirfuAT.js";import{u as gs,a as At,b as ni,T as ii}from"./hooks-DOkARyS2.js";import{r as li,u as zt,f as ri}from"./shell-layout-DoAVrerK.js";import{u as oi,g as ai,a as ci,b as di,S as bs}from"./use-navigate-to-agent-BAQepcY9.js";import{g as mi,a as js,u as ui,A as fi,b as hi}from"./use-deco-credits-CAb1KNIs.js";import{f as xi}from"./reusable-new-chat-CouMjkYR.js";import{A as Je}from"./avatar-DGZ13TB0.js";import{a as Et}from"./Copy01-CEOVwp8a.js";import{n as pi,i as gi}from"./Globe01-C0_GSmts.js";import{i as bi}from"./ZoomOut-9DZqfrOE.js";import{i as Dt,a as ji}from"./ZapSquare-ChZlLfh_.js";import{i as jt}from"./Monitor01-CGFN5sGg.js";import{n as vi,a as yi}from"./Sun-NMZSBMue.js";import{a as it}from"./Settings02-OSetn6ea.js";import{i as Si}from"./Shield01-Dq-HMUMk.js";import{a as _i}from"./Users03-C7WKxyUR.js";import{u as Ni}from"./use-deployment-admin-DxlBCcMw.js";import"./index-r5DmdNN7.js";import{t as vs}from"./UserPlus01-CoO5zvRr.js";import{I as ys}from"./invite-member-dialog-DfAJpHso.js";import{v as Ci,C as Pt}from"./connect-desktop-dialog-nlx1v20u.js";import{u as lt}from"./use-organization-settings-DxC5BT5e.js";import{i as wi}from"./FilterLines-CY9-eI6Z.js";import{T as ki,a as Ii}from"./toggle-group-CisLBmfi.js";import{C as Ai,a as zi,b as $i,c as Ti,d as Oi}from"./command-DYuWdmIc.js";import{u as Ss}from"./studio-tools-C0FSNSO6.js";import{i as _s}from"./Zap-CfXP7HDl.js";import{S as Ns,M as Mi}from"./shell-controls-CVfU7qci.js";import{n as Ei}from"./Stars02-Uz2mjN30.js";import{g as Di,u as Pi,S as Fi}from"./use-clock-tick-DVjyQSN6.js";import{a as Ri}from"./format-time-BnbuEtat.js";import{i as Li}from"./ChevronRight-C5hCj-BJ.js";import{T as se}from"./toolbar-lHwKVbcz.js";import"./X-Dmet8wMD.js";import"./integration-icon-BjKZxHyL.js";import"./Tool02-CIj3JzdV.js";import"./CheckCircle-BU0_-3Q5.js";import"./companions-core-BN8wLX0q.js";import"./extract-connection-data-BFt9JrM6.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./Eye-CDNr9lij.js";import"./use-debounced-value-DYEvOfgl.js";import"./authenticate-and-persist-oauth-CRs0CnsY.js";import"./mcp-oauth-DTAyDU2Q.js";import"./auth-CYtv0_rL.js";import"./ArrowUpRight-BxZoQJWz.js";import"./use-collections-IkbkyTPy.js";import"./AlertCircle-B947WyJr.js";import"./Tool01-DPdDFdYA.js";import"./ArrowUp-Bs_6P4Iu.js";import"./TrendUp01-DqQByDKq.js";import"./ChevronUp-zg_HGLWR.js";import"./Circle-Bsy8_p9X.js";import"./DotsVertical-BlOzCsHI.js";import"./Flag01-C5CmZtnc.js";import"./Star01-BlQBW3oI.js";import"./Globe04-blrjzALH.js";import"./SwitchHorizontal01-aHLJ4VFM.js";import"./HardDrive-DDCNtQf8.js";import"./Key01-DhaQwTr9.js";import"./LinkExternal01-wH6B14C5.js";import"./List-CT_BXxlG.js";import"./Package-Dl0Lfmce.js";import"./Palette-B0Atethk.js";import"./Play-Dz4heBw1.js";import"./SearchLg-BxBwkXRA.js";import"./Stars01-COr-0k43.js";import"./Trash01-ZIY4ACli.js";import"./Upload01-D1HGy3QV.js";import"./User01-B2aITRRg.js";import"./Users01-HqZawgTe.js";import"./label-itDnpE7k.js";import"./autosend-DpuAJlz4.js";import"./use-ai-providers-BSTSxr9f.js";import"./use-decopilot-events-CssQ7XMz.js";import"./decopilot-sse-pool-yvpwgZWV.js";import"./backoff-CrEUbyZT.js";import"./collection-search-BwRybpDA.js";import"./use-connection-BjfpYHE7.js";import"./use-mcp-tools-Cv_rmBI5.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-PXLv9yf-.js";import"./use-org-sso-CymoIsv4.js";import"./connection-card-B2p6WHp7.js";import"./use-registry-connections-DzCHf8MS.js";import"./useInfiniteQuery-Bx9w5_18.js";import"./use-infinite-scroll-BzjM30U0.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-COkVnQnP.js";import"./select-CkNw5vmE.js";import"./textarea-D9ia054b.js";import"./connection-form-helpers-CTe9zYBl.js";import"./collection-tabs-CGlZLNZG.js";import"./badge-BmdcYP2l.js";import"./useSuspenseInfiniteQuery-DDY3jNH9.js";import"./use-org-auth-client-DNG8tLX7.js";import"./use-organization-roles-pkqdjnMJ.js";import"./index-CFF-0dHO.js";import"./differenceInSeconds-NQ4PDo0z.js";function Ui(t){const e=A.c(15),{siteUrl:n}=t,l=me(),{org:i}=Z();let r;e[0]!==l||e[1]!==i.id||e[2]!==i.slug?(r=()=>{localStorage.setItem(Hs.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:In(i.id),main:wn(os.COMMERCE_DISCOVERY(i.id),kn),sidepanel:0}})},e[0]=l,e[1]=i.id,e[2]=i.slug,e[3]=r):r=e[3];const o=r;let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yn,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(is,{className:"sr-only",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),e[5]=m):m=e[5];let c;e[6]!==o?(c=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar as integrações. Você pode continuar e abrir o relatório mesmo assim."}),s.jsxs(We,{type:"button",size:"xl",className:"w-full",onClick:o,children:["Continuar",s.jsx(cs,{size:18})]})]}),e[6]=o,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(fn,{}),e[8]=d):d=e[8];let u;e[9]!==o||e[10]!==n?(u=s.jsx(R.Suspense,{fallback:d,children:s.jsx(Wi,{siteUrlFromUrl:n,onComplete:o})}),e[9]=o,e[10]=n,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=s.jsx(ls,{open:!0,children:s.jsxs(Sn,{children:[a,s.jsxs(Bs,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Gi,onPointerDownOutside:Bi,onInteractOutside:Hi,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,s.jsx(St,{fallback:c,children:u})]})]})}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function Hi(t){return t.preventDefault()}function Bi(t){return t.preventDefault()}function Gi(t){return t.preventDefault()}function Wi({siteUrlFromUrl:t,onComplete:e}){const{org:n}=Z(),{data:l}=le.useSession(),i=os.COMMERCE_DISCOVERY(n.id),r=rs({connectionId:as,orgId:n.id,orgSlug:n.slug}),a=Gs({queryKey:es.commerceDiscoveryConnection(n.id,i),queryFn:async()=>{const v=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ut(v)},retry:!1}).data.item,m=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||m,d=hn(c),[u,f]=R.useState(!0),[h,x]=R.useState(null),g=gt({mutationFn:async v=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),p=gt({mutationFn:async v=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),b=xn({siteUrl:c,email:l?.user?.email}),j=async()=>{x(null),ne("commerce_onboarding_open_report_clicked",{domain:d??void 0,organization_id:n.id});const v=c?vn(c):null;if(v?.ok)try{let y=await p.mutateAsync(v.value);if(y.triggered||(ne("commerce_onboarding_run_reclaim",{domain:d??void 0,organization_id:n.id,reason:y.reason??"not_upgraded"}),await g.mutateAsync(v.value),y=await p.mutateAsync(v.value)),!y.triggered){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y.reason??"not_triggered"}),x("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(y){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y instanceof Error?y.message:String(y)}),x("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[d?s.jsx(pn,{host:d}):null,s.jsx(gn,{org:n,cdConnectionId:i,siteUrl:c,onReadinessChange:f}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(bn,{href:b,orgId:n.id,className:"lg:hidden"}),h?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:h}):null,s.jsxs(We,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{j()},disabled:p.isPending||!u,children:[p.isPending?"Abrindo relatório...":u?"Ver relatório completo":"Conecte uma ferramenta para continuar",!p.isPending&&u?s.jsx(cs,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(jn,{href:b,orgId:n.id})})]})}function qi(t){const e=A.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=be();if(r||i==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=o,e[1]=a):(o=e[0],a=e[1]);let m;return e[2]!==l||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=m):m=e[4],m}const $t=240,Vi=400,Ki="sidebar.width";function He(t){return Math.max($t,Math.min(Vi,t))}function Yi(){const t=A.c(11),[e,n]=et(Ki,Xi),l=R.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,f=He(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=He(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=He(f+(b.clientX-u));n(j);for(const v of x)v.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let o;t[3]!==n?(o=()=>{n($t)},t[3]=n,t[4]=o):o=t[4];const a=o;let m;t[5]!==e?(m=He(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:l,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function Xi(t){return typeof t=="number"?He(t):$t}function Cs(){return[]}function ws(t){const e=A.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(Nt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(Ct,{children:s.jsx(ie,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function ks(t){const e=A.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=be();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{ne("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const o=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=P(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(Q,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(V,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Qi(t){const e=A.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ss,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Zi),e[2]=n.group.items,e[3]=r):r=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(o=s.jsx(ws,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(Ji),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ji(t){return s.jsx(ks,{item:t},t.key)}function Zi(t){return s.jsx(ks,{item:t},t.key)}function el(t){const e=A.c(17),{sections:n,footer:l,additionalContent:i,header:r,variant:o,contentClassName:a}=t,m=o===void 0?"sidebar":o;let c;e[0]!==r?(c=r&&s.jsx(an,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=P("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map(tl),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==i?(f=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[6]=i,e[7]=f):f=e[7];let h;e[8]!==d||e[9]!==u||e[10]!==f?(h=s.jsxs(ns,{className:d,children:[u,f]}),e[8]=d,e[9]=u,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==m?(x=s.jsxs(cn,{variant:m,children:[c,h,l]}),e[12]=l,e[13]=c,e[14]=h,e[15]=m,e[16]=x):x=e[16],x}function tl(t,e){return s.jsx(Qi,{section:t},e)}function Is(t){const e=A.c(2);let n;return e[0]!==t?(n=s.jsx(el,{...t}),e[0]=t,e[1]=n):n=e[1],n}Is.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(de,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function As(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sl=Ws({name:qs().min(2,"Organization name is required")});function nl(t){const e=A.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Vs(sl),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Ks(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:ll,onSuccess:il},e[1]=o):o=e[1];const a=gt(o),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Rn,{children:[s.jsx(Ln,{children:"Create a new organization"}),s.jsx(Un,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],d=r.handleSubmit(_),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(qn,{children:[s.jsx(Vn,{children:"Organization Name"}),s.jsx(Kn,{children:s.jsx(Qn,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(Yn,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",As(S.value)]})]}),s.jsx(Xn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(Gn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==m?(h=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(Pn,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Jn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(We,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==g?(v=s.jsxs(Hn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==d||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=d,e[31]=f,e[32]=h,e[33]=y):y=e[33];let N;e[34]!==r||e[35]!==y?(N=s.jsxs(Fn,{children:[c,s.jsx(Wn,{...r,children:y})]}),e[34]=r,e[35]=y,e[36]=N):N=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==N?(C=s.jsx(Bn,{open:n,onOpenChange:l,children:N}),e[37]=l,e[38]=n,e[39]=N,e[40]=C):C=e[40],C}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=As(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await le.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function zs(){const t=R.useContext(Ys),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function rl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function rt(t){const e=A.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",o=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=P(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:rl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:P("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function ol({invitation:t,onChanged:e}){const[n,l]=R.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const m=await le.organization.acceptInvitation({invitationId:t.id});if(m.error){ce.error(m.error.message),l(!1);return}}catch{ce.error("Failed to accept invitation"),l(!1);return}ce.success(`Joined ${i}`),Qs();let a;try{a=(await le.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},o=async()=>{l(!0);try{const a=await le.organization.rejectInvitation({invitationId:t.id});if(a.error){ce.error(a.error.message),l(!1);return}ce.success("Invitation declined"),l(!1),e()}catch{ce.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(rt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(We,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(We,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:o,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(Dn,{size:14})})]})]})}function al(t){const e=A.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Xs(),{invitations:o,refetch:a}=zs();let m;e[0]!==n?(m=(w,$)=>w.slug===n?-1:$.slug===n?1:w.name.localeCompare($.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=R.useState(""),f=d.toLowerCase(),h=f?c.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fs,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=w=>u(w.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=w=>w.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ue,{size:16}),e[9]=j):j=e[9];let v;e[10]!==i?(v=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==b||e[13]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,v]}),e[12]=b,e[13]=v,e[14]=y):y=e[14];const N="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==o||e[16]!==d||e[17]!==a?(C=!d&&o.map(w=>s.jsx(ol,{invitation:w,onChanged:a},w.id)),e[15]=o,e[16]=d,e[17]=a,e[18]=C):C=e[18];const _=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=w=>s.jsxs("button",{type:"button",onClick:()=>l(w.slug),className:P("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(rt,{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(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const k=h.map(S);let I;e[22]!==C||e[23]!==_||e[24]!==k?(I=s.jsxs("div",{className:N,children:[C,_,k]}),e[22]=C,e[23]=_,e[24]=k,e[25]=I):I=e[25];let z;return e[26]!==I||e[27]!==y?(z=s.jsxs(s.Fragment,{children:[y,I]}),e[26]=I,e[27]=y,e[28]=z):z=e[28],z}function $s(t){const e=A.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,o=i===void 0?"start":i,a=r===void 0?"bottom":r,m=me(),[c,d]=R.useState(!1),[u,f]=R.useState(!1);let h;e[0]!==n?(h=s.jsx(Fe,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const x=String(c);let g;e[2]!==m?(g=C=>{d(!1),m({to:"/$org",params:{org:C}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),f(!0)},e[4]=p):p=e[4];let b;e[5]!==l||e[6]!==x||e[7]!==g?(b=s.jsx(al,{orgParam:l,onSelectOrg:g,onCreateOrg:p},x),e[5]=l,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(st,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:dl,onCloseAutoFocus:cl,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==h||e[15]!==j?(v=s.jsxs(nt,{open:c,onOpenChange:d,children:[h,j]}),e[13]=c,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(nl,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let N;return e[19]!==y||e[20]!==v?(N=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=N):N=e[21],N}function cl(t){return t.preventDefault()}function dl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ml(t){const e=A.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==o?(d=P("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=P("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(ts,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(fs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==l?(x=j=>l(j.target.value),e[6]=l,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==f||e[15]!==h||e[16]!==g?(p=s.jsxs("label",{className:f,children:[h,g]}),e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const ul="Select an existing agent";function fl(t){const e=A.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(xe,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(pe,{side:"right",sideOffset:8,children:ul}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ge,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function hl(t){const e=me(),{create:n}=gs(),{locator:l}=Z(),i=_t({strict:!1}),r=tt({strict:!1});return async o=>{const a=crypto.randomUUID(),m=o===r.virtualmcpid?li(t,l,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function ft(t){const e=A.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==r?(o=P("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ve,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==l?(u=l&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==o||e[16]!==a||e[17]!==d||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:o,children:[a,d,u]}),e[14]=i,e[15]=o,e[16]=a,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=A.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function xl(t){const e=A.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[o,a]=R.useState(""),m=ms(),c=m??[],{org:d}=Z(),{data:u}=le.useSession(),f=u?.user?.id??"anon",h=ai(m),x=ci(),g=hl(d.slug),p=mi(m),b=o.toLowerCase(),j=c.filter(jl).filter(W=>!p.has(W.id)).filter(bl).filter(W=>!o||W.title.toLowerCase().includes(b)),v=j.filter(gl),y=j.filter(pl),N=Qe(d.id),C=!o||N.title.toLowerCase().includes(b),_=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const k=S,I=W=>{if(l){l(W.id),n(),a("");return}di({orgId:d.id,userId:f},W.id,h),x(),n(),a(""),g(W.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let w;e[3]!==o?(w=s.jsx(ml,{value:o,onChange:a,placeholder:"Search agents..."}),e[3]=o,e[4]=w):w=e[4];const $="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&N&&s.jsx(ft,{agent:N,selected:!i||i===N.id,onClick:k}),D=y.length>0&&s.jsx(Ft,{children:"Agents"}),U=y.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id)),F=(v.length>0||!o)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(si,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),E=v.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id));let O;e[5]!==_||e[6]!==o||e[7]!==j.length?(O=j.length===0&&!_&&o&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=_,e[6]=o,e[7]=j.length,e[8]=O):O=e[8];let L;e[9]!==O||e[10]!==M||e[11]!==D||e[12]!==U||e[13]!==F||e[14]!==E?(L=s.jsxs("div",{className:$,children:[M,D,U,F,E,O]}),e[9]=O,e[10]=M,e[11]=D,e[12]=U,e[13]=F,e[14]=E,e[15]=L):L=e[15];let H;e[16]!==d.slug?(H={org:d.slug},e[16]=d.slug,e[17]=H):H=e[17];let B;e[18]!==n?(B=()=>n(),e[18]=n,e[19]=B):B=e[19];let G;e[20]!==H||e[21]!==B?(G=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Js,{to:"/$org/settings/agents",params:H,onClick:B,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=H,e[21]=B,e[22]=G):G=e[22];let K;return e[23]!==L||e[24]!==G||e[25]!==w?(K=s.jsxs("div",{className:z,children:[w,L,G]}),e[23]=L,e[24]=G,e[25]=w,e[26]=K):K=e[26],K}function pl(t){return!js(t.metadata)}function gl(t){return js(t.metadata)}function bl(t){return!zn(t.id)}function jl(t){return!An(t.id)}function vl(t){const e=A.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:o,side:a,align:m}=n,c=l===void 0?!1:l,d=a===void 0?"right":a,u=m===void 0?"start":m,[f,h]=R.useState(!1),[x,g]=R.useState(!1),p=wt(),{setOpenMobile:b}=be(),j=oi(),v=j?"border border-border":void 0;let y;e[2]!==j?(y=D=>j?s.jsx(fl,{children:D}):D,e[2]=j,e[3]=y):y=e[3];const N=y;let C;e[4]!==p||e[5]!==b?(C=()=>{h(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=C):C=e[6];const _=C;let S;e[7]!==_?(S=()=>{_(),g(!0)},e[7]=_,e[8]=S):S=e[8];const k=S;let I;e[9]!==_||e[10]!==k||e[11]!==r||e[12]!==f||e[13]!==o?(I=f&&s.jsx(R.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(de,{className:"h-4 w-24"})}),children:s.jsx(xl,{onClose:_,onSelectAgent:r,selectedAgentId:o,onImportFromGithub:k})}),e[9]=_,e[10]=k,e[11]=r,e[12]=f,e[13]=o,e[14]=I):I=e[14];const z=I;let w;e[15]!==u||e[16]!==c||e[17]!==v||e[18]!==j||e[19]!==p||e[20]!==f||e[21]!==z||e[22]!==d||e[23]!==i||e[24]!==N?(w=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?N(s.jsx(ye,{"aria-label":"Browse agents",className:P(v),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Ue,{className:"size-4"})})):s.jsx(V,{children:N(s.jsxs(Q,{tooltip:j?void 0:"Browse agents",className:P(v),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Ue,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(hs,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(xs,{className:"max-h-[85dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(nt,{open:f,onOpenChange:D=>{D&&!f&&ne("agent_browser_opened",{surface:"desktop_popover"}),h(D)},children:[i?s.jsx(Fe,{asChild:!0,children:i}):c?N(s.jsx(Fe,{asChild:!0,children:s.jsx(ye,{"aria-label":"Browse agents",className:P(v),children:s.jsx(Ue,{className:"size-4"})})})):s.jsx(V,{children:N(s.jsx(Fe,{asChild:!0,children:s.jsxs(Q,{tooltip:j?void 0:"Browse agents",className:P(v),children:[s.jsx(Ue,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(st,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=v,e[18]=j,e[19]=p,e[20]=f,e[21]=z,e[22]=d,e[23]=i,e[24]=N,e[25]=w):w=e[25];let $;e[26]!==x?($=s.jsx(ti,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=$):$=e[27];let M;return e[28]!==$||e[29]!==w?(M=s.jsxs(s.Fragment,{children:[w,$]}),e[28]=$,e[29]=w,e[30]=M):M=e[30],M}const yl="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Sl(t){const e=A.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,o=It(n)??l??null,a=o?.title??"Super Agent",m=`Open ${a} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(ve,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:yl,children:[f,h]}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(vl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function vt(t){const e=A.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:i}=Z(),{state:r,isMobile:o}=be(),a=zs().invitations.length>0,m=r==="collapsed"||o,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx(rt,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:P("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=f):f=e[9];let h;e[10]!==i.name||e[11]!==l?(h=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=l,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==h?(g=s.jsx(xe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[f,h,x]})}),e[14]=c,e[15]=f,e[16]=h,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx($s,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(pe,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(ge,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function ot(t){const e=A.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:i}=Z(),r=me();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const a=_t(o);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=tt(m),{threads:d}=At(),{data:u}=le.useSession(),{setTaskId:f,createNewTask:h}=zt();let x;e[4]!==i.id?(x=Qe(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==h||e[7]!==p||e[8]!==r||e[9]!==l||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==d?(j=S=>{if(!S||S===p){r({to:"/$org",params:{org:i.slug}}),l?.();return}const k=xi(d,S,u?.user?.id);k?f(k.id,S):h(S),l?.()},e[6]=h,e[7]=p,e[8]=r,e[9]=l,e[10]=i.slug,e[11]=u?.user?.id,e[12]=f,e[13]=d,e[14]=j):j=e[14];const v=j;let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=y):y=e[15];const N=b===p?g:void 0;let C;e[16]!==b||e[17]!==v?(C=()=>v(b),e[16]=b,e[17]=v,e[18]=C):C=e[18];let _;return e[19]!==b||e[20]!==v||e[21]!==N||e[22]!==C?(_=s.jsx(R.Suspense,{fallback:y,children:s.jsx(Sl,{agentId:b,fallback:N,onOpenHome:C,onPick:v})}),e[19]=b,e[20]=v,e[21]=N,e[22]=C,e[23]=_):_=e[23],_}function Rt(t){const e=A.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=P(i),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=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 m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==m?(c=s.jsxs(Q,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(V,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function _l(t){const e=A.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ss,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let m;e[5]!==l?(m=c=>s.jsx(Rt,{item:c,onClose:l},c.key),e[5]=l,e[6]=m):m=e[6],o=n.group.items.map(m),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ws,{label:i,defaultExpanded:r,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(Rt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],i=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function Nl(t){const e=A.c(24),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(ot,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{size:16}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx(ye,{onClick:l,"aria-label":"Close sidebar",children:c}),e[5]=l,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[o,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;if(e[10]!==l||e[11]!==n){let p;e[13]!==l?(p=(b,j)=>s.jsx(_l,{section:b,onClose:l},j),e[13]=l,e[14]=p):p=e[14],f=n.map(p),e[10]=l,e[11]=n,e[12]=f}else f=e[12];let h;e[15]!==r?(h=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs(ns,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function Pe(t){const e=A.c(26),{item:n,onClose:l}=t;let i;e[0]!==n.className?(i=P("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",n.className),e[0]=n.className,e[1]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let h;e[4]!==n.label?(h=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=h):h=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==l||e[9]!==d||e[10]!==u||e[11]!==f||e[12]!==h?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:l,children:[f,h]}),e[6]=r,e[7]=n.href,e[8]=l,e[9]=d,e[10]=u,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}let o;e[14]!==n||e[15]!==l?(o=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=o):o=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==o||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m]}),e[21]=r,e[22]=o,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function Lt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:"Impersonating"}),t[0]=e):e=t[0],e}function Ut(t){const e=A.c(144),{user:n,userImage:l,menuItems:i,signOutItem:r,stopImpersonatingItem:o,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:f}=t;if(f){const X=n?.name??"U";let ee;e[0]!==X||e[1]!==l?(ee=s.jsx(Je,{url:l,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=l,e[2]=ee):ee=e[2];const oe=n?.name??"User";let ae;e[3]!==oe?(ae=s.jsx("p",{className:"text-sm font-medium truncate",children:oe}),e[3]=oe,e[4]=ae):ae=e[4];let ue;e[5]!==a?(ue=a&&s.jsx(Lt,{}),e[5]=a,e[6]=ue):ue=e[6];let te;e[7]!==ae||e[8]!==ue?(te=s.jsxs("div",{className:"flex items-center gap-2",children:[ae,ue]}),e[7]=ae,e[8]=ue,e[9]=te):te=e[9];const Re=n?.email;let fe;e[10]!==Re?(fe=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Re}),e[10]=Re,e[11]=fe):fe=e[11];let T;e[12]!==te||e[13]!==fe?(T=s.jsxs("div",{className:"flex-1 min-w-0",children:[te,fe]}),e[12]=te,e[13]=fe,e[14]=T):T=e[14];let q;e[15]!==n?(q=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Il)},e[15]=n,e[16]=q):q=e[16];let J;e[17]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Et,{size:14}),e[17]=J):J=e[17];let Y;e[18]!==q?(Y=s.jsx(xe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:q,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:J})}),e[18]=q,e[19]=Y):Y=e[19];let je;e[20]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(pe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[20]=je):je=e[20];let _e;e[21]!==Y?(_e=s.jsx(bt,{delayDuration:300,children:s.jsxs(ge,{children:[Y,je]})}),e[21]=Y,e[22]=_e):_e=e[22];let Ne;e[23]!==_e||e[24]!==ee||e[25]!==T?(Ne=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[ee,T,_e]}),e[23]=_e,e[24]=ee,e[25]=T,e[26]=Ne):Ne=e[26];let Ce;if(e[27]!==u||e[28]!==i){let he;e[30]!==u?(he=Ke=>s.jsx(Pe,{item:Ke,onClose:u},Ke.key),e[30]=u,e[31]=he):he=e[31],Ce=i.map(he),e[27]=u,e[28]=i,e[29]=Ce}else Ce=e[29];let we;e[32]!==u||e[33]!==o?(we=o&&s.jsx(Pe,{item:o,onClose:u}),e[32]=u,e[33]=o,e[34]=we):we=e[34];let ke;e[35]!==u||e[36]!==r?(ke=s.jsx(Pe,{item:r,onClose:u}),e[35]=u,e[36]=r,e[37]=ke):ke=e[37];let Ie;e[38]!==Ce||e[39]!==we||e[40]!==ke?(Ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ce,we,ke]})}),e[38]=Ce,e[39]=we,e[40]=ke,e[41]=Ie):Ie=e[41];let Ae;if(e[42]!==c.theme||e[43]!==d||e[44]!==m){let he;e[46]!==c.theme||e[47]!==d?(he=Ke=>{const{value:mt,icon:Rs,label:Ls}=Ke;return s.jsx("button",{type:"button","aria-label":Ls,onClick:()=>d(Us=>({...Us,theme:mt})),className:P("size-8 rounded-md flex items-center justify-center transition-colors",c.theme===mt?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Rs},mt)},e[46]=c.theme,e[47]=d,e[48]=he):he=e[48],Ae=m.map(he),e[42]=c.theme,e[43]=d,e[44]=m,e[45]=Ae}else Ae=e[45];let ze;e[49]!==Ae?(ze=s.jsx("div",{className:"flex items-center gap-0.5",children:Ae}),e[49]=Ae,e[50]=ze):ze=e[50];const ct=c.enableSounds?"Disable sounds":"Enable sounds";let $e;e[51]!==d?($e=()=>d(kl),e[51]=d,e[52]=$e):$e=e[52];const dt=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Te;e[53]!==dt?(Te=P("size-8 rounded-md flex items-center justify-center transition-colors",dt),e[53]=dt,e[54]=Te):Te=e[54];let Oe;e[55]!==c.enableSounds?(Oe=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[55]=c.enableSounds,e[56]=Oe):Oe=e[56];let Me;e[57]!==ct||e[58]!==$e||e[59]!==Te||e[60]!==Oe?(Me=s.jsx("button",{type:"button","aria-label":ct,onClick:$e,className:Te,children:Oe}),e[57]=ct,e[58]=$e,e[59]=Te,e[60]=Oe,e[61]=Me):Me=e[61];let qe;e[62]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.76.45"]}),e[62]=qe):qe=e[62];let Ee;e[63]!==Me?(Ee=s.jsxs("div",{className:"flex items-center gap-2",children:[Me,qe]}),e[63]=Me,e[64]=Ee):Ee=e[64];let De;e[65]!==ze||e[66]!==Ee?(De=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ze,Ee]}),e[65]=ze,e[66]=Ee,e[67]=De):De=e[67];let Ve;return e[68]!==Ne||e[69]!==Ie||e[70]!==De?(Ve=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Ne,Ie,De]}),e[68]=Ne,e[69]=Ie,e[70]=De,e[71]=Ve):Ve=e[71],Ve}const h=n?.name??"U";let x;e[72]!==h||e[73]!==l?(x=s.jsx(Je,{url:l,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[72]=h,e[73]=l,e[74]=x):x=e[74];const g=n?.name??"User";let p;e[75]!==g?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[75]=g,e[76]=p):p=e[76];let b;e[77]!==a?(b=a&&s.jsx(Lt,{}),e[77]=a,e[78]=b):b=e[78];let j;e[79]!==p||e[80]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[79]=p,e[80]=b,e[81]=j):j=e[81];const v=n?.email;let y;e[82]!==v?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:v}),e[82]=v,e[83]=y):y=e[83];let N;e[84]!==j||e[85]!==y?(N=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,y]}),e[84]=j,e[85]=y,e[86]=N):N=e[86];let C;e[87]!==n?(C=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wl)},e[87]=n,e[88]=C):C=e[88];let _;e[89]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Et,{size:14}),e[89]=_):_=e[89];let S;e[90]!==C?(S=s.jsx(xe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:C,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[90]=C,e[91]=S):S=e[91];let k;e[92]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(pe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[92]=k):k=e[92];let I;e[93]!==S?(I=s.jsx(bt,{delayDuration:300,children:s.jsxs(ge,{children:[S,k]})}),e[93]=S,e[94]=I):I=e[94];let z;e[95]!==I||e[96]!==x||e[97]!==N?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[x,N,I]}),e[95]=I,e[96]=x,e[97]=N,e[98]=z):z=e[98];let w;if(e[99]!==u||e[100]!==i){let X;e[102]!==u?(X=ee=>s.jsx(Pe,{item:ee,onClose:u},ee.key),e[102]=u,e[103]=X):X=e[103],w=i.map(X),e[99]=u,e[100]=i,e[101]=w}else w=e[101];let $;e[104]!==u||e[105]!==o?($=o&&s.jsx(Pe,{item:o,onClose:u}),e[104]=u,e[105]=o,e[106]=$):$=e[106];let M;e[107]!==u||e[108]!==r?(M=s.jsx(Pe,{item:r,onClose:u}),e[107]=u,e[108]=r,e[109]=M):M=e[109];let D;e[110]!==w||e[111]!==$||e[112]!==M?(D=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[w,$,M]}),e[110]=w,e[111]=$,e[112]=M,e[113]=D):D=e[113];let U;if(e[114]!==c.theme||e[115]!==d||e[116]!==m){let X;e[118]!==c.theme||e[119]!==d?(X=ee=>{const{value:oe,icon:ae,label:ue}=ee;return s.jsx("button",{type:"button","aria-label":ue,onClick:()=>d(te=>({...te,theme:oe})),className:P("size-7 rounded-md flex items-center justify-center transition-colors",c.theme===oe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ae},oe)},e[118]=c.theme,e[119]=d,e[120]=X):X=e[120],U=m.map(X),e[114]=c.theme,e[115]=d,e[116]=m,e[117]=U}else U=e[117];let F;e[121]!==U?(F=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[121]=U,e[122]=F):F=e[122];const E=c.enableSounds?"Disable sounds":"Enable sounds";let O;e[123]!==d?(O=()=>d(Cl),e[123]=d,e[124]=O):O=e[124];const L=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[125]!==L?(H=P("size-7 rounded-md flex items-center justify-center transition-colors",L),e[125]=L,e[126]=H):H=e[126];let B;e[127]!==c.enableSounds?(B=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[127]=c.enableSounds,e[128]=B):B=e[128];let G;e[129]!==E||e[130]!==O||e[131]!==H||e[132]!==B?(G=s.jsx("button",{type:"button","aria-label":E,onClick:O,className:H,children:B}),e[129]=E,e[130]=O,e[131]=H,e[132]=B,e[133]=G):G=e[133];let K;e[134]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.76.45"]}),e[134]=K):K=e[134];let W;e[135]!==G?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[G,K]}),e[135]=G,e[136]=W):W=e[136];let re;e[137]!==F||e[138]!==W?(re=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[F,W]}),e[137]=F,e[138]=W,e[139]=re):re=e[139];let Se;return e[140]!==z||e[141]!==D||e[142]!==re?(Se=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[z,D,re]})}),e[140]=z,e[141]=D,e[142]=re,e[143]=Se):Se=e[143],Se}function Cl(t){return{...t,enableSounds:!t.enableSounds}}function wl(){ce.success("User ID copied")}function kl(t){return{...t,enableSounds:!t.enableSounds}}function Il(){ce.success("User ID copied")}function Be(){const t=A.c(43),{data:e}=le.useSession(),{org:n}=Z(),l=me();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const o=Zs(i)?.params.org,[a,m]=en(),c=wt(),{isAdmin:d}=Ni(),[u,f]=R.useState(!1),h=e?.user,x=h?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>f(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(it,{size:16}),t[2]=j):j=t[2];let v;t[3]!==l||t[4]!==o?(v={key:"preferences",label:"Preferences",icon:j,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=v):v=t[5];let y;t[6]!==n||t[7]!==l?(y=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(pi,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=y):y=t[8];let N;t[9]===Symbol.for("react.memo_cache_sentinel")?(N={key:"terms",label:"Terms of Use",icon:s.jsx(bi,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=N):N=t[9];let C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(Si,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=C):C=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(tn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S={key:"community",label:"Community",icon:s.jsx(_i,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=S):S=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k={key:"homepage",label:"Homepage",icon:s.jsx(gi,{size:16}),href:"https://decocms.com",external:!0},t[13]=k):k=t[13];let I;t[14]!==d||t[15]!==l?(I=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx($n,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-warning"}]:[],t[14]=d,t[15]=l,t[16]=I):I=t[16];let z;t[17]!==I||t[18]!==v||t[19]!==y?(z=[v,...y,N,C,_,S,k,...I],t[17]=I,t[18]=v,t[19]=y,t[20]=z):z=t[20];const w=z;let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($={key:"logout",label:"Sign out",icon:s.jsx(Dt,{size:16}),onClick:$l},t[21]=$):$=t[21];const M=$;let D;t[22]!==g?(D=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(Dt,{size:16}),onClick:zl,className:"text-warning"}:null,t[22]=g,t[23]=D):D=t[23];const U=D;let F;t[24]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:s.jsx(vi,{size:14}),label:"Light theme"},t[24]=F):F=t[24];let E;t[25]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(yi,{size:14}),label:"Dark theme"},t[25]=E):E=t[25];let O;t[26]===Symbol.for("react.memo_cache_sentinel")?(O=[F,E,{value:"system",icon:s.jsx(jt,{size:14}),label:"System theme"}],t[26]=O):O=t[26];const L=O;let H;t[27]!==g||t[28]!==c||t[29]!==w||t[30]!==a||t[31]!==m||t[32]!==U||t[33]!==h||t[34]!==x?(H={user:h,userImage:x,menuItems:w,signOutItem:M,stopImpersonatingItem:U,isImpersonating:g,themeOptions:L,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=w,t[30]=a,t[31]=m,t[32]=U,t[33]=h,t[34]=x,t[35]=H):H=t[35];const B=H;let G;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==B||t[40]!==h?.name||t[41]!==x?(G=s.jsx(s.Fragment,{children:c?s.jsxs(hs,{open:u,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:P("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",g&&"border-2 border-dashed border-warning"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(xs,{className:"h-[80dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Account"}),s.jsx(Ut,{...B})]})]}):s.jsxs(nt,{open:u,onOpenChange:f,children:[s.jsx(Fe,{asChild:!0,children:s.jsxs(Q,{tooltip:h?.name??"Account",className:P("rounded-md",g&&"border-2 border-dashed border-warning"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]})}),s.jsx(st,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Al,children:s.jsx(Ut,{...B})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=B,t[40]=h?.name,t[41]=x,t[42]=G):G=t[42],G}function Al(t){return t.preventDefault()}async function zl(){const{error:t}=await le.admin.stopImpersonating();if(t){ce.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function $l(){ne("signed_out",{source:"account_popover"}),sn(),le.signOut()}function Ge(t){const e=A.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=Zn(),[r,o]=R.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const v=Ci(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:v.length>0?`Available: ${v.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(l==="full"){let v,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=()=>o(!0),y=s.jsx(jt,{}),e[6]=v,e[7]=y):(v=e[6],y=e[7]);let N;e[8]!==a?(N=s.jsx("span",{children:a}),e[8]=a,e[9]=N):N=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let _;e[12]!==a||e[13]!==N||e[14]!==C?(_=s.jsx(xe,{asChild:!0,children:s.jsxs(Q,{tooltip:a,onClick:v,children:[y,N,C]})}),e[12]=a,e[13]=N,e[14]=C,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(pe,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let k;e[18]!==_||e[19]!==S?(k=s.jsxs(ge,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=k):k=e[20];let I;e[21]!==r?(I=s.jsx(Pt,{open:r,onOpenChange:o}),e[21]=r,e[22]=I):I=e[22];let z;return e[23]!==I||e[24]!==k?(z=s.jsxs(s.Fragment,{children:[k,I]}),e[23]=I,e[24]=k,e[25]=z):z=e[25],z}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(jt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let x;e[30]!==u||e[31]!==h?(x=s.jsx(xe,{asChild:!0,children:s.jsxs(ye,{onClick:d,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(pe,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(ge,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(Pt,{open:r,onOpenChange:o}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class Tl extends R.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 Ol(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ml(){const t=A.c(17),e=me(),{org:n}=Z(),{hasDecoKey:l,balanceDollars:i}=ui();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let o;t[2]!==i?(o=P(i!=null&&Ol(i)),t[2]=i,t[3]=o):o=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Tn,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==o||t[14]!==a||t[15]!==d?(u=s.jsx(ie,{children:s.jsx(V,{children:s.jsxs(Q,{tooltip:r,className:o,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=o,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function Ht(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Tl,{children:s.jsx(R.Suspense,{fallback:null,children:s.jsx(Ml,{})})}),t[0]=e):e=t[0],e}function ht(){const t=A.c(7),e=me(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let o;return t[5]!==l?(o=s.jsxs(Q,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=o):o=t[6],o}function El(){const t=A.c(6),e=me(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==l?(r=s.jsx("button",{type:"button","aria-label":"Settings",onClick:l,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:i}),t[4]=l,t[5]=r):r=t[5],r}function Bt(){const t=A.c(4),[e,n]=R.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(Q,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ie,{className:"gap-0.5",children:[l,s.jsx(V,{children:s.jsxs(Q,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(ji,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(fi,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Gt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"gap-0.5",children:s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(Q,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function Dl(){const t=A.c(17),{state:e}=be(),n=e==="collapsed";if(lt()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{}),t[0]=f):f=t[0];let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ge,{})})}),t[1]=h):h=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(V,{children:s.jsx(ht,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Le,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(ie,{children:[h,x,s.jsx(V,{children:s.jsx(Be,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Gt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(V,{children:s.jsx(Ge,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Le,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(ie,{className:"gap-0.5",children:[d,s.jsx(V,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Be,{})}),s.jsx(El,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Bt,{}),d=s.jsx(Ht,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ge,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(V,{children:s.jsx(ht,{})}),t[10]=f):f=t[10];let h;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(Le,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(ie,{children:[u,f,s.jsx(V,{children:s.jsx(Be,{})})]})]}),t[11]=h):h=t[11],h}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{}),r=s.jsx(Ht,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(V,{children:s.jsx(Ge,{variant:"full"})}),t[14]=o):o=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(V,{children:s.jsx(ht,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(Le,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ie,{className:"gap-0.5",children:[o,a,s.jsx(V,{children:s.jsx(Be,{})})]})]}),t[16]=m):m=t[16],m}function Pl(){const t=A.c(8),e=me(),{org:n}=Z(),{setOpenMobile:l}=be();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ie,{children:s.jsx(V,{children:s.jsx(Be,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(it,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==r?(a=s.jsx(Le,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ye,{"aria-label":"Settings",onClick:r,children:o})]})}),t[6]=r,t[7]=a):a=t[7],a}function Wt(t){const e=A.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,o]=R.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==l?(u=P("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let x;e[7]!==h?(x=P("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==g?(p=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=p):p=e[14],p}function Fl(t){const e=A.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let o;e[0]!==r||e[1]!==n?(o=n?s.jsx(Rl,{virtualMcpId:n,size:r}):s.jsx(ve,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(_s,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=m):m=e[7],m}function Rl(t){const e=A.c(6),{virtualMcpId:n,size:l}=t,i=It(n);if(!i){let a;return e[0]!==l?(a=s.jsx(ve,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const r=i.icon??null;let o;return e[2]!==i.title||e[3]!==l||e[4]!==r?(o=s.jsx(ve,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=o):o=e[5],o}function qt(t){const e=A.c(36),{open:n,onOpenChange:l}=t,[i,r]=R.useState(""),{org:o}=Z(),{setTaskId:a}=zt(),m=Ss();let c,d,u;e[0]!==o.id||e[1]!==i?(u=i.trim(),d=nn,c=es.globalSearch(o.id,u),e[0]=o.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==m||e[6]!==u?(h=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==h?(x={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==l?(v=$=>{$||r(""),l($)},e[14]=l,e[15]=v):v=e[15];const y=v;let N;e[16]!==y||e[17]!==a?(N=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=N):N=e[18];const C=N;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(_n,{className:"sr-only",children:[s.jsx(is,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==i?(S=s.jsx($i,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let k;e[22]!==C||e[23]!==p||e[24]!==j||e[25]!==u?(k=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ai,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(zi,{value:`thread:${$.id}:${$.title}`,onSelect:()=>C($),className:"gap-2.5",children:[s.jsx(Fl,{virtualMcpId:$.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:$.title||"Untitled chat"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=j,e[25]=u,e[26]=k):k=e[26];let I;e[27]!==k?(I=s.jsx(Ti,{children:k}),e[27]=k,e[28]=I):I=e[28];let z;e[29]!==S||e[30]!==I?(z=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,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:[S,I]})]}),e[29]=S,e[30]=I,e[31]=z):z=e[31];let w;return e[32]!==y||e[33]!==n||e[34]!==z?(w=s.jsx(ls,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=w):w=e[35],w}function Ll(t){return t==="ephemeral"||t.startsWith("thread:")}function Ts(t){const e=A.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:o,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=Di(n.status),u=d.icon,f=n.metadata?.kind==="tool_call_run",h=It(f?void 0:n.virtual_mcp_id);let x;e[0]!==h?(x=hi(h),e[0]=h,e[1]=x):x=e[1];const g=x;Pi(6e4);const p=o||!!n.trigger_id,b=n.id,j="button",v=0;let y;e[2]!==i?(y=L=>{L.target===L.currentTarget&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),i())},e[2]=i,e[3]=y):y=e[3];const N=c?"-ml-4 pl-6":"pl-[7px]",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==N||e[5]!==C?(_=P("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",N,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=N,e[5]=C,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(S=a&&!f&&s.jsx(ve,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let k;e[12]!==p?(k=p&&s.jsx(_s,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=k):k=e[13];const I=n.title||"Untitled task";let z;e[14]!==I?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[14]=I,e[15]=z):z=e[15];let w;e[16]!==k||e[17]!==z?(w=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,z]}),e[16]=k,e[17]=z,e[18]=w):w=e[18];let $;e[19]!==g||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?($=n.updated_at&&s.jsxs("div",{className:P("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ll(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Ri(new Date(n.updated_at))})]}),e[19]=g,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=$):$=e[23];let M;e[24]!==w||e[25]!==$?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[w,$]}),e[24]=w,e[25]=$,e[26]=M):M=e[26];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!m&&s.jsx("span",{className:P("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:P(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let F;e[27]!==r?(F=r&&s.jsxs(ge,{children:[s.jsx(xe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:L=>{L.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ln,{size:14})})}),s.jsx(pe,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=F):F=e[28];let E;e[29]!==U||e[30]!==F?(E=s.jsxs("div",{className:D,children:[U,F]}),e[29]=U,e[30]=F,e[31]=E):E=e[31];let O;return e[32]!==i||e[33]!==M||e[34]!==E||e[35]!==y||e[36]!==_||e[37]!==S||e[38]!==n.id?(O=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:v,onClick:i,onKeyDown:y,className:_,children:[S,M,E]}),e[32]=i,e[33]=M,e[34]=E,e[35]=y,e[36]=_,e[37]=S,e[38]=n.id,e[39]=O):O=e[39],O}const Vt=["requires_action","in_progress","failed","expired","completed"];function Ul(t){const e=new Map(Vt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Vt.map(n=>({status:n,threads:e.get(n)}))}const Hl="sidebar.group.expanded.";function Bl(t,e){const n=A.c(3),[l,i]=et(`${Hl}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function Os(t){const e=A.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==r?(o=P("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(ts,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const m=l?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Gl(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Wl(t){return t.member==="mine"&&!t.currentUserId}const Ms=4;let Xe=0;const yt=[];function ql(){for(;Xe<Ms&&yt.length>0;){const t=yt.shift();t&&t()}}function Es(t){return new Promise((e,n)=>{const l=()=>{Xe++,t().then(e,n).finally(()=>{Xe--,ql()})};Xe<Ms?l():yt.push(l)})}const at=10;function Kt(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const o={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Vl(t,e,n,l){let i=0;for(const r of t)Ds(r,e,n,l)&&i++;return i}function xt(t,e,n,l){return Vl(t,e,n,l)}function Kl(t,e){return!!(t>=at||t===0&&e)}function Yt(t,e){return t<e}function Yl(t,e){return e===!1?!1:e===!0?!0:t}function Ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Ze=new Map,Ye=new Map;function Xl(t,e){return e?t>=at?!0:null:!1}function Xt(t){return Ze.get(t)}function Ql(t,e){Ze.set(t,e)}function Jl(t,e,n){const l=Ze.get(t);if(l!==void 0){n(l);return}let i=Ye.get(t);i||(i=Es(e).then(r=>(Ze.set(t,r),Ye.delete(t),r)).catch(()=>(Ye.delete(t),Promise.reject(new Error("group probe failed")))),Ye.set(t,i)),i.then(n,()=>n(!1))}function Qt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===at,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Zl(t,e,n,l,i){let r=0;for(const o of t)e.has(o.id)||Ds(o,n,l,i)&&r++;return r}function er(t,e,n,l){const i=A.c(8),{org:r}=Z(),o=Gl(r.id,t,e,n);let a;i[0]!==n?(a=Wl(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=R.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=ni(),{threads:f,hasMore:h}=At(),x=xt(f,t,e,n),g=Kl(x,h),p=Xl(x,h),b=Ss();if(c.identity===o&&c.serverHasMore===null){const _=p??Xt(o);_!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!m&&c.identity===o&&c.serverHasMore===null&&p===null&&Xt(o)===void 0&&c.probeSubscribedIdentity!==o&&(d(_=>_.identity===o?{..._,isProbing:!0,probeSubscribedIdentity:o}:_),Jl(o,async()=>{const _=Kt(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:k}=Qt(S),I=xt(u.threads.get(),t,e,n);return k===void 0?!1:Yt(I,k)},_=>{d(S=>S.identity!==o?S:{...S,isProbing:!1,serverHasMore:_})}));const v=async function(){if(c.isFetching||c.isProbing||m)return;const S=o;d(k=>k.identity===S?{...k,isFetching:!0}:k);try{const k=xt(f,t,e,n),I=Kt(t,e,k,n,at),z=await Es(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:w,hasMore:$,totalCount:M}=Qt(z),D=new Set(f.map(tr)),U=Zl(w,D,t,e,n),F=k;u.mergeThreads(w),d(E=>{if(E.identity!==S)return E;let O;return M!==void 0?O=Yt(F+U,M):O=w.length===0||U===0?!1:$,Ql(S,O),{...E,isFetching:!1,serverHasMore:O}})}catch(k){const I=k,z=I instanceof Error?I.message:String(I);ce.error(`Could not load more tasks: ${z}`),d(w=>w.identity===S?{...w,isFetching:!1}:w)}},y=c.isFetching||c.isProbing,N=!m&&!y&&Yl(g,c.serverHasMore);let C;return i[2]!==y||i[3]!==v||i[4]!==N||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:N,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},i[2]=y,i[3]=v,i[4]=N,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function tr(t){return t.id}function sr(t){const e=A.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:f,serverHasMore:h}=er("status",n,m),[x,g]=R.useState(!1);!x&&l.length===0&&h===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==o||e[4]!==r||e[5]!==l){let v;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==o||e[11]!==r?(v=y=>s.jsx(Ts,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:a&&y.created_by===m.currentUserId?()=>o(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=a,e[9]=m,e[10]=o,e[11]=r,e[12]=v):v=e[12],p=l.map(v),e[0]=i,e[1]=a,e[2]=m,e[3]=o,e[4]=r,e[5]=l,e[6]=p}else p=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(Os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function nr(t){const e=A.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,c=Fi[n],d=c.icon,[u,f]=Bl(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const x=h;let g;e[3]!==x?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=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]=p):p=e[7];let b;e[8]!==u?(b=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(kt,{size:14}):s.jsx(Li,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c.label?(v=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=v):v=e[14];let y;e[15]!==l.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=y):y=e[16];let N;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==v||e[22]!==y?(N=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,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:[j,v,y]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=v,e[22]=y,e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==o||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(sr,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=o,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let _;return e[33]!==N||e[34]!==C?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,C]}),e[33]=N,e[34]=C,e[35]=_):_=e[35],_}function Jt(t){const e=A.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ei,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||m;if(l==="status"){let p;if(e[3]!==i||e[4]!==f||e[5]!==a||e[6]!==o||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==f||e[12]!==a||e[13]!==o||e[14]!==r?(j=v=>s.jsx(nr,{status:v.status,threads:v.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:f,filters:a},v.status),e[10]=i,e[11]=f,e[12]=a,e[13]=o,e[14]=r,e[15]=j):j=e[15],p=Ul(n).map(j),e[3]=i,e[4]=f,e[5]=a,e[6]=o,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let h;if(e[18]!==i||e[19]!==f||e[20]!==a||e[21]!==o||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==f||e[27]!==a||e[28]!==o||e[29]!==r?(p=b=>s.jsx(Ts,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:f&&b.created_by===a.currentUserId?()=>o(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=f,e[27]=a,e[28]=o,e[29]=r,e[30]=p):p=e[30],h=n.map(p),e[18]=i,e[19]=f,e[20]=a,e[21]=o,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(Os,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==h||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[h,x]}),e[35]=h,e[36]=x,e[37]=g):g=e[37],g}function ir(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Zt(t){const e=A.c(17),{label:n,onClick:l,active:i,children:r}=t,[o,a]=R.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=P("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=h):h=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(x=s.jsx(xe,{asChild:!0,children:s.jsx(ye,{"aria-label":n,onClick:l,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(pe,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==o||e[14]!==x||e[15]!==g?(p=s.jsxs(ge,{open:o,children:[x,g]}),e[13]=o,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function pt(t){const e=A.c(13),{label:n,value:l,onChange:i,options: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 a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(lr),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==l?(c=s.jsx(Ii,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=l,e[9]=c):c=e[9];let d;return e[10]!==o||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=d):d=e[12],d}function lr(t){return s.jsxs(ki,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function Ps({onNavigate:t}={}){const{data:e}=le.useSession(),n=e?.user?.id,{org:l}=Z(),i=rs({connectionId:as,orgId:l.id,orgSlug:l.slug}),r=Qe(l.id).id,o=ms(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=At(),u=a.filter(T=>!T.hidden),{hide:f,setScope:h}=gs(),x=me(),{setTaskId:g,createNewTask:p}=zt(),b=_t({strict:!1}),j=tt({strict:!1}),v=b.taskId??null,y=j.virtualmcpid??a.find(T=>T.id===v)?.virtual_mcp_id??null,N=()=>{t?.()},C=[...u].sort((T,q)=>(q.updated_at??"").localeCompare(T.updated_at??"")),[_,S]=R.useState("all"),[k,I]=R.useState("flat"),[z,w]=et("sidebar-threads-scope-all",!1),[$,M]=R.useState(!1),[D,U]=R.useState(!1),F={type:_,member:"mine",currentUserId:n??null},E={};z||(E.created_by="me"),h(E);const O=T=>n?T.filter(q=>q.created_by===n):[],L=T=>_==="automation"?T.filter(q=>!!q.trigger_id):_==="manual"?T.filter(q=>!q.trigger_id):T,H=O(C),B=L(H),G=L(C),K=z?G:B,W=T=>{if(n&&T.created_by&&T.created_by!==n)return;const q=T.id===v;if(f(T.id),ri(T.id),!q)return;const J=ir(K,T.id,n);N(),J?g(J.id,J.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},re=T=>{N(),g(T.id,T.virtual_mcp_id)},Se=async T=>{try{const q=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((q.structuredContent??q).items?.length??0)===0}catch{return!1}},X=async()=>{const T=y??r;ne("sidebar_new_thread_clicked",{virtual_mcp_id:T});const q=H.find(J=>J.virtual_mcp_id===T&&J.title==="New chat");if(q&&await Se(q.id)){N(),g(q.id,T);return}N(),p(T)},{state:ee,isMobile:oe,toggleSidebar:ae}=be();if(ee==="collapsed"&&!oe){const T=Qe(l.id),q=new Map((o??[]).map(Y=>[Y.id,Y])),J=Y=>(Y?q.get(Y):void 0)??(Y===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx($s,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(Q,{tooltip:l.name,children:s.jsx(rt,{org:l,size:"sm"})})})}),s.jsxs(ie,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(V,{children:s.jsx(Q,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ae,children:s.jsx(ds,{size:16})})}),s.jsx(V,{children:s.jsx(Q,{tooltip:"New chat",onClick:()=>{X()},children:s.jsx(Mt,{size:16})})}),K.map(Y=>{const je=J(Y.virtual_mcp_id);return s.jsx(V,{children:s.jsx(Q,{tooltip:Y.title||"New chat",isActive:Y.id===v,onClick:()=>re(Y),children:s.jsx(ve,{icon:je?.icon??null,name:je?.title??"Agent",size:"xs"})})},Y.id)})]})]})}const te=k!=="flat"||_!=="all"||z===!0,Re=s.jsxs(nt,{children:[s.jsxs(ge,{children:[s.jsx(xe,{asChild:!0,children:s.jsx(Fe,{asChild:!0,children:s.jsxs(ye,{"aria-label":"Filter chats",active:te,className:"md:size-[34px] rounded-lg",children:[s.jsx(wi,{size:16}),te&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(pe,{side:"bottom",children:"Filter chats"})]}),s.jsxs(st,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(pt,{label:"View",value:k,onChange:T=>{ne("tasks_panel_group_by_changed",{to_value:T}),I(T)},options:[{value:"flat",label:"List",icon:s.jsx(Mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(En,{size:13})}]}),s.jsx(pt,{label:"Type",value:_,onChange:T=>{ne("tasks_panel_filter_changed",{to_value:T}),S(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(pt,{label:"Scope",value:z?"team":"mine",onChange:T=>w(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),fe=T=>s.jsx(bt,{delayDuration:300,children:s.jsxs("div",{className:P("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Ns,{className:"md:size-[34px] rounded-lg"}),Re]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Zt,{label:"Search chats",onClick:()=>{ne("tasks_panel_search_opened"),U(!0),M(!0)},children:s.jsx(On,{size:16})}),s.jsx(Zt,{label:"New chat",onClick:()=>{X()},children:s.jsx(Mt,{size:16})})]})]})});return oe?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[fe(!0),s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Jt,{threads:K,groupBy:k,activeTaskId:v,onSelectTask:re,onArchiveTask:W,filters:F,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})}),D&&s.jsx(qt,{open:$,onOpenChange:M})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[fe(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Jt,{threads:K,groupBy:k,activeTaskId:v,onSelectTask:re,onArchiveTask:W,filters:F,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})})}),D&&s.jsx(qt,{open:$,onOpenChange:M})]})}const rr=5,or=[{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 Fs(){const t=A.c(3),{state:e}=be();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:rr}).map(dr)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(de,{className:"size-6 rounded-md"}),s.jsx(de,{className:"size-6 rounded-md"}),s.jsx(de,{className:"size-6 rounded-md"})]}),s.jsx(de,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:or.map(ar)})]}),t[2]=l):l=t[2],l}function ar(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(de,{className:"size-5 rounded-full shrink-0"}),s.jsx(de,{className:P("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(cr)})]},e)}function cr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(de,{className:"h-3 flex-1 rounded-sm"})},e)}function dr(t,e){return s.jsx(de,{className:"size-10 rounded-lg mx-auto"},e)}function mr(){const t=A.c(2);if(lt()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(vt,{}),s.jsx(ot,{})]}),t[1]=n):n=t[1],n}function ur(){const t=A.c(5),e=Cs();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),l=s.jsx(mr,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(St,{children:s.jsx(R.Suspense,{fallback:s.jsx(Fs,{}),children:s.jsx(Ps,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(bs,{children:s.jsx(Is,{sections:e,footer:n,header:l,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function fr(t){const e=A.c(8),{onClose:n}=t,l=Cs();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pl,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Fs,{}),e[1]=r):r=e[1];let o;e[2]!==n?(o=s.jsx(St,{children:s.jsx(R.Suspense,{fallback:r,children:s.jsx(Ps,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(bs,{children:s.jsx(Nl,{sections:l,onClose:n,footer:i,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}const hr="sidebar.open";function xr(){const t=A.c(1),{state:e}=be(),n=lt();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ot,{}),t[0]=l):l=t[0],l}function pr(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(on,{}),t[0]=e):e=t[0],e}function Pa(){const t=A.c(43),e=wt(),n=lt();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{connect:i,siteUrl:r}=tt(l),o=i==="1",[a,m]=et(hr,!1),{width:c,wrapperRef:d,onStartResize:u,resetWidth:f}=Yi(),h=!e;let x,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(se.LeftColumn,{children:[s.jsx(xr,{}),s.jsx(se.TogglesSlot,{})]}),g=s.jsx(se.CenterSlot,{}),t[1]=x,t[2]=g):(x=t[1],g=t[2]);let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(se.Header,{children:[x,g,s.jsxs(se.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(se.TabsSlot,{})}),s.jsx(se.RightSlot,{})]})]}),t[3]=p):p=t[3];const b=p;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ns,{}),t[4]=j):j=t[4];let v;t[5]!==n?(v=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(ot,{})}),t[5]=n,t[6]=v):v=t[6];let y,N,C,_,S;t[7]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ge,{}),C=s.jsx(se.TogglesSlot,{}),_=s.jsx(se.TabsSlot,{className:"shrink-0"}),S=s.jsx(se.CenterSlot,{}),y=s.jsx(se.RightSlot,{}),t[7]=y,t[8]=N,t[9]=C,t[10]=_,t[11]=S):(y=t[7],N=t[8],C=t[9],_=t[10],S=t[11]);let k;t[12]!==v?(k=s.jsx(se.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,v,N,C,_,S,y]})}),t[12]=v,t[13]=k):k=t[13];const I=k;let z;t[14]===Symbol.for("react.memo_cache_sentinel")?(z={background:"transparent",containerType:"inline-size"},t[14]=z):z=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(dn,{className:"flex flex-col min-h-0",style:z,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(R.Suspense,{fallback:s.jsx(pr,{}),children:s.jsx(rn,{})})})})}),t[15]=w):w=t[15];const $=w,M=!h&&(e?I:b),D=`${c}px`;let U;t[16]!==D?(U={"--sidebar-width":D,"--sidebar-width-icon":"3.125rem"},t[16]=D,t[17]=U):U=t[17];const F=U;let E;t[18]!==e||t[19]!==u||t[20]!==f?(E=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ur,{}),s.jsx(qi,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=E):E=t[21];let O;t[22]!==h?(O=h?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,$]}):$,t[22]=h,t[23]=O):O=t[23];let L;t[24]!==F||t[25]!==E||t[26]!==O||t[27]!==d?(L=s.jsxs(mn,{ref:d,className:"flex-1 bg-sidebar relative min-h-0",style:F,children:[E,O]}),t[24]=F,t[25]=E,t[26]=O,t[27]=d,t[28]=L):L=t[28];let H;t[29]!==e?(H=e&&s.jsx(Mi,{renderSidebar:gr}),t[29]=e,t[30]=H):H=t[30];let B;t[31]!==r||t[32]!==o?(B=o&&s.jsx(Ui,{siteUrl:r}),t[31]=r,t[32]=o,t[33]=B):B=t[33];let G;t[34]!==M||t[35]!==L||t[36]!==H||t[37]!==B?(G=s.jsx(ei,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[M,L,H,B]})}),t[34]=M,t[35]=L,t[36]=H,t[37]=B,t[38]=G):G=t[38];let K;return t[39]!==m||t[40]!==a||t[41]!==G?(K=s.jsx(ii,{children:s.jsx(se.Provider,{children:s.jsx(un,{open:a,onOpenChange:m,children:G})})}),t[39]=m,t[40]=a,t[41]=G,t[42]=K):K=t[42],K}function gr(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(fr,{onClose:e})})})}export{Pa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as I,j as t,a as re,i as X,r as O,m as ge,K as pe,d as oe,B as he,l as K,t as ce}from"./index-B5cMFR-y.js";import{R as xe}from"./required-auth-layout-PXLv9yf-.js";import{A as G}from"./auth-split-layout-hlCmxHcd.js";import{O as be}from"./organization-choice-BJmZA_ql.js";import{A as me}from"./avatar-DGZ13TB0.js";import{I as je}from"./input-BsEx9qgh.js";import{L as ye}from"./label-itDnpE7k.js";import{S as ve}from"./switch-BOKpfG2a.js";import{t as Ne,a as Se}from"./Users03-C7WKxyUR.js";import{i as we}from"./CheckCircle-BU0_-3Q5.js";import{t as ze}from"./Globe04-blrjzALH.js";import{a as _e}from"./Palette-B0Atethk.js";import{i as Ce}from"./Upload01-D1HGy3QV.js";import"./User01-B2aITRRg.js";const ke=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function se(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Xe(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(Oe,{})}),i[0]=e):e=i[0],e}function ie(i){const e=I.c(13),{title:g,description:r,logoUrl:m,logoFallback:o}=i;let a;e[0]!==o||e[1]!==m?(a=t.jsx("div",{children:m?t.jsx(me,{url:m,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=m,e[2]=a):a=e[2];let l;e[3]!==g?(l=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=l):l=e[4];let n;e[5]!==r?(n=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:r}),e[5]=r,e[6]=n):n=e[6];let f;e[7]!==l||e[8]!==n?(f=t.jsxs("div",{className:"space-y-2",children:[l,n]}),e[7]=l,e[8]=n,e[9]=f):f=e[9];let s;return e[10]!==a||e[11]!==f?(s=t.jsxs("div",{className:"grid gap-10",children:[a,f]}),e[10]=a,e[11]=f,e[12]=s):s=e[12],s}function Oe(){const i=I.c(4),{data:e,isPending:g}=re.useSession();if(g){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"})})}),i[0]=a):a=i[0],a}const r=e?.user?.email??"",m=e?.user?.name;let o;return i[1]!==m||i[2]!==r?(o=t.jsx(Ee,{email:r,userName:m}),i[1]=m,i[2]=r,i[3]=o):o=i[3],o}function Ee(i){const e=I.c(47),{email:g,userName:r}=i;let m,o,a,l,n,f;if(e[0]!==g||e[1]!==r){a=g.split("@")[1]?.toLowerCase()??"",l=!!a&&!ke.has(a);const d=a.split(".")[0]??"";o=d.charAt(0).toUpperCase()+d.slice(1);let u;e[8]!==o||e[9]!==l||e[10]!==r?(u=l?o:r?.split(" ")[0]??"",e[8]=o,e[9]=l,e[10]=r,e[11]=u):u=e[11],m=u,f=ge,n=pe.domainLookup(a),e[0]=g,e[1]=r,e[2]=m,e[3]=o,e[4]=a,e[5]=l,e[6]=n,e[7]=f}else m=e[2],o=e[3],a=e[4],l=e[5],n=e[6],f=e[7];let s;e[12]!==l||e[13]!==n?(s={queryKey:n,queryFn:Re,enabled:l},e[12]=l,e[13]=n,e[14]=s):s=e[14];const{data:y,isLoading:c}=f(s);let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[15]=v):v=e[15];const[p,B]=O.useState(v),[E,z]=O.useState(!1);if(c){let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=d):d=e[16];let u;return e[17]!==a?(u=t.jsx(G,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[d,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=u):u=e[18],u}let j,S;e[19]!==y?.organizations?(j=(y?.organizations??[]).flatMap(Pe),S=j.some(Ae),e[19]=y?.organizations,e[20]=j,e[21]=S):(j=e[20],S=e[21]);const L=S;if(E){let d;e[22]!==r?(d=r?.split(" ")[0]??"",e[22]=r,e[23]=d):d=e[23];let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>z(!1),e[24]=u):u=e[24];let h;return e[25]!==o||e[26]!==a||e[27]!==l||e[28]!==d?(h=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:d,allowDomainClaim:!1,onBack:u}),e[25]=o,e[26]=a,e[27]=l,e[28]=d,e[29]=h):h=e[29],h}if(j.length>0){const d=L?j.length===1?"You have access to an organization":"You have access to multiple organizations":"Request access to an organization",u=L?"Your email domain matches an existing organization.":"Your email domain matches an organization that requires admin approval to join.";let h;e[30]!==d||e[31]!==u?(h=t.jsx(ie,{title:d,description:u}),e[30]=d,e[31]=u,e[32]=h):h=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=Y=>B(A=>new Set(A).add(Y)),e[33]=C):C=e[33];let w;e[34]!==j||e[35]!==a||e[36]!==p?(w=t.jsx(be,{organizations:j,domain:a,requestedSlugs:p,onRequestedSlug:C,onJoined:Le}),e[34]=j,e[35]=a,e[36]=p,e[37]=w):w=e[37];let _;e[38]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>z(!0),children:"Create a new organization instead"}),e[38]=_):_=e[38];let k;return e[39]!==w||e[40]!==h?(k=t.jsx(G,{children:t.jsxs("div",{className:"grid gap-10",children:[h,w,_]})}),e[39]=w,e[40]=h,e[41]=k):k=e[41],k}let b;return e[42]!==m||e[43]!==o||e[44]!==a||e[45]!==l?(b=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:m}),e[42]=m,e[43]=o,e[44]=a,e[45]=l,e[46]=b):b=e[46],b}function Le(i,e){window.location.href=`/${e}`}function Ae(i){return i.joinMode==="auto"}function Pe(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Re(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function ne(i){const e=I.c(70),{isCorporateEmail:g,emailDomain:r,domainLabel:m,defaultName:o,allowDomainClaim:a,onBack:l}=i,n=a===void 0?!0:a,f=g&&n?`https://www.google.com/s2/favicons?domain=${r}&sz=128`:null,[s,y]=O.useState(o),[c,v]=O.useState(f),[p,B]=O.useState(!0),[E,z]=O.useState(null);let j;e[0]!==p||e[1]!==c||e[2]!==s?(j=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()||void 0,logo:c??void 0,claimDomain:p})}),N=await x.json();if(!x.ok||!N.success)throw new Error(N.error||"Failed to set up organization");return N},e[0]=p,e[1]=c,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==p?(S=x=>{if(!x.slug)return;const N=de.filter(fe=>p||!fe.claimOnly).length,J=ue*(N-1)+800;z(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},J)},e[4]=p,e[5]=S):S=e[5];let L;e[6]!==j||e[7]!==S?(L={mutationFn:j,onSuccess:S},e[6]=j,e[7]=S,e[8]=L):L=e[8];const b=oe(L);let d;e[9]!==c||e[10]!==s?(d={mutationFn:async()=>{const x=s.trim(),N=se(x);if(!N)throw new Error("Invalid organization name");const J=await re.organization.create({name:x,slug:N,...c?{logo:c}:{}});if(J?.error)throw new Error(J.error.message||"Failed to create organization");window.location.href=`/${J?.data?.slug??N}`}},e[9]=c,e[10]=s,e[11]=d):d=e[11];const u=oe(d);if(b.isPending||E){let x;e[12]!==m||e[13]!==s?(x=s.trim()||m,e[12]=m,e[13]=s,e[14]=x):x=e[14];let N;return e[15]!==p||e[16]!==r||e[17]!==c||e[18]!==x?(N=t.jsx(G,{children:t.jsx(Fe,{orgName:x,domain:r,claimDomain:p,logoUrl:c})}),e[15]=p,e[16]=r,e[17]=c,e[18]=x,e[19]=N):N=e[19],N}const h=u.isPending;let C;e[20]!==s?(C=se(s.trim()),e[20]=s,e[21]=C):C=e[21];const w=!!C,_=b.error||u.error||null;let k;e[22]!==n||e[23]!==w||e[24]!==u||e[25]!==b||e[26]!==g?(k=x=>{x.preventDefault(),w&&(g&&n?b.mutate():u.mutate())},e[22]=n,e[23]=w,e[24]=u,e[25]=b,e[26]=g,e[27]=k):k=e[27];const Y=k;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ie,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=A):A=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=W):W=e[29];let P;e[30]!==o||e[31]!==s?(P=(s.trim()||o||"?").charAt(0).toUpperCase(),e[30]=o,e[31]=s,e[32]=P):P=e[32];const Z=h||b.isPending;let R;e[33]!==c||e[34]!==P||e[35]!==Z?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[W,t.jsx($e,{value:c,fallback:P,onChange:v,disabled:Z})]}),e[33]=c,e[34]=P,e[35]=Z,e[36]=R):R=e[36];let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(ye,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=H):H=e[37];let Q;e[38]===Symbol.for("react.memo_cache_sentinel")?(Q=x=>y(x.target.value),e[38]=Q):Q=e[38];const ee=o||"My Organization",te=h||b.isPending;let $;e[39]!==s||e[40]!==ee||e[41]!==te?($=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[H,t.jsx(je,{id:"org-name",value:s,onChange:Q,placeholder:ee,disabled:te,className:"h-10 max-w-[220px]"})]}),e[39]=s,e[40]=ee,e[41]=te,e[42]=$):$=e[42];let D;e[43]!==n||e[44]!==p||e[45]!==b.isPending||e[46]!==r||e[47]!==g||e[48]!==h?(D=g&&n&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",r," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",r," email can join this org"]})]}),t.jsx(ve,{checked:p,onCheckedChange:B,disabled:h||b.isPending})]}),e[43]=n,e[44]=p,e[45]=b.isPending,e[46]=r,e[47]=g,e[48]=h,e[49]=D):D=e[49];let F;e[50]!==R||e[51]!==$||e[52]!==D?(F=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,$,D]}),e[50]=R,e[51]=$,e[52]=D,e[53]=F):F=e[53];let M;e[54]!==_?(M=_&&t.jsx("p",{className:"text-xs text-destructive",children:_ instanceof Error?_.message:"Failed to create organization"}),e[54]=_,e[55]=M):M=e[55];const ae=!w||h||b.isPending;let q;e[56]!==b.isPending||e[57]!==h?(q=h||b.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(X,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=b.isPending,e[57]=h,e[58]=q):q=e[58];let U;e[59]!==ae||e[60]!==q?(U=t.jsx(he,{type:"submit",size:"xl",className:"w-full",disabled:ae,children:q}),e[59]=ae,e[60]=q,e[61]=U):U=e[61];let T;e[62]!==l?(T=l&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:l,children:"See available organizations"}),e[62]=l,e[63]=T):T=e[63];let V;return e[64]!==Y||e[65]!==F||e[66]!==M||e[67]!==U||e[68]!==T?(V=t.jsx(G,{children:t.jsxs("form",{onSubmit:Y,className:"grid gap-10",children:[A,F,M,U,T]})}),e[64]=Y,e[65]=F,e[66]=M,e[67]=U,e[68]=T,e[69]=V):V=e[69],V}function $e(i){const e=I.c(14),{value:g,fallback:r,onChange:m,disabled:o}=i,a=O.useRef(null);let l;e[0]!==m?(l=B=>{const E=B.target.files?.[0];if(!E)return;if(E.size>2097152){ce.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const z=new FileReader;z.onerror=De,z.onloadend=()=>{z.result&&m(z.result),a.current&&(a.current.value="")},z.readAsDataURL(E)},e[0]=m,e[1]=l):l=e[1];const n=l;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a.current?.click(),e[2]=f):f=e[2];let s;e[3]!==o||e[4]!==n?(s=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];const y=g??void 0;let c;e[6]!==r||e[7]!==y?(c=t.jsx(me,{url:y,fallback:r,shape:"square",size:"base"}),e[6]=r,e[7]=y,e[8]=c):c=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Ce,{size:14,className:"text-white"})}),e[9]=v):v=e[9];let p;return e[10]!==o||e[11]!==s||e[12]!==c?(p=t.jsxs("button",{type:"button",onClick:f,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[s,c,v]}),e[10]=o,e[11]=s,e[12]=c,e[13]=p):p=e[13],p}function De(){return ce.error("Failed to read image")}const de=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:ze,label:"Claiming email domain",claimOnly:!0},{icon:Se,label:"Enabling auto-join for your team",claimOnly:!0},{icon:_e,label:"Extracting brand context",claimOnly:!1}],ue=1500,le=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:i,domain:e,claimDomain:g,logoUrl:r}){const m=de.filter(n=>g||!n.claimOnly),[o,a]=O.useState(0),l=O.useRef(!1);if(!l.current){l.current=!0;for(let n=1;n<m.length;n++)setTimeout(()=>a(n),ue*n)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(ie,{title:`Setting up ${i}`,description:`Getting everything ready from ${e}`,logoUrl:r??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:m.map((n,f)=>{const s=n.icon,y=f===o,c=f<o,v=le[f%le.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:c||y?1:.4},children:[t.jsxs("span",{className:K("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!c&&(y?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:c?{backgroundColor:v.bg,color:v.fg}:void 0,children:[t.jsx(we,{size:16,className:K("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",c?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(X,{size:16,className:K("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",y?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(s,{size:16,className:K("absolute motion-safe:transition-opacity motion-safe:duration-200",!c&&!y?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:K("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",y||c?"text-foreground":"text-muted-foreground"),children:n.label})]},n.label)})})]})}export{Xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-B5cMFR-y.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-BQFslZSt.js";import{A as nt}from"./automation-runs-Db6yr9QX.js";import{r as lt,u as ct,a as dt,b as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-ZcfqdJ3r.js";import{r as xt}from"./index-DwqZiRTX.js";import"./LayoutLeft-CDGSUvFB.js";import"./use-mobile-BYgIZfXj.js";import"./X-Dmet8wMD.js";import"./tooltip-Cm1Uo3tj.js";import"./select-CkNw5vmE.js";import"./Check-CcnPQW8L.js";import"./ChevronDown-HIcxNu9L.js";import"./ChevronUp-zg_HGLWR.js";import"./useInfiniteQuery-Bx9w5_18.js";import"./use-infinite-scroll-BzjM30U0.js";import"./use-connection-BjfpYHE7.js";import"./use-collections-IkbkyTPy.js";import"./use-mcp-client-lixd0gAV.js";import"./constants-D_FQAPnt.js";import"./auth-CYtv0_rL.js";import"./use-virtual-mcp-DUjw2r9s.js";import"./card-COkVnQnP.js";import"./table-B88p_wsC.js";import"./empty-state-DFI2pRsv.js";import"./use-members-XsfnxDj6.js";import"./use-org-auth-client-DNG8tLX7.js";import"./use-clock-tick-DVjyQSN6.js";import"./AlertCircle-B947WyJr.js";import"./CheckCircle-BU0_-3Q5.js";import"./Circle-Bsy8_p9X.js";import"./agent-icon-3oSe4h7A.js";import"./UserPlus01-CoO5zvRr.js";import"./Tool01-DPdDFdYA.js";import"./ArrowUp-Bs_6P4Iu.js";import"./Settings02-OSetn6ea.js";import"./Tool02-CIj3JzdV.js";import"./XCircle-BKwKlF9U.js";import"./ArrowUpRight-BxZoQJWz.js";import"./TrendUp01-DqQByDKq.js";import"./ZapSquare-ChZlLfh_.js";import"./Users03-C7WKxyUR.js";import"./ChevronRight-C5hCj-BJ.js";import"./Stars02-Uz2mjN30.js";import"./Copy01-CEOVwp8a.js";import"./ZoomOut-9DZqfrOE.js";import"./DotsVertical-BlOzCsHI.js";import"./Globe01-C0_GSmts.js";import"./Eye-CDNr9lij.js";import"./FilterLines-CY9-eI6Z.js";import"./Flag01-C5CmZtnc.js";import"./Star01-BlQBW3oI.js";import"./Globe04-blrjzALH.js";import"./SwitchHorizontal01-aHLJ4VFM.js";import"./HardDrive-DDCNtQf8.js";import"./Key01-DhaQwTr9.js";import"./LinkExternal01-wH6B14C5.js";import"./List-CT_BXxlG.js";import"./Monitor01-CGFN5sGg.js";import"./Sun-NMZSBMue.js";import"./Package-Dl0Lfmce.js";import"./Palette-B0Atethk.js";import"./Play-Dz4heBw1.js";import"./Plus-DkxBw62L.js";import"./SearchLg-BxBwkXRA.js";import"./SearchMd-Ck8RI60i.js";import"./Shield01-Dq-HMUMk.js";import"./Stars01-COr-0k43.js";import"./Trash01-ZIY4ACli.js";import"./Upload01-D1HGy3QV.js";import"./User01-B2aITRRg.js";import"./Users01-HqZawgTe.js";import"./XClose-iezakeMo.js";import"./Zap-CfXP7HDl.js";import"./use-automations-z-3-_HVg.js";import"./studio-tools-C0FSNSO6.js";import"./useSuspenseInfiniteQuery-DDY3jNH9.js";import"./badge-BmdcYP2l.js";import"./checkbox-BCHArcau.js";import"./command-DYuWdmIc.js";import"./index-CFF-0dHO.js";import"./dialog-CvMUMR16.js";import"./popover-DktOaoCj.js";import"./avatar-DGZ13TB0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhCEUwuV.js";import"./file-type-icon-DSufmAQ5.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-D_6PkZ4D.js";import"./index-Oe3PDrxX.js";import"./chat-context-DVVCYt3e.js";import"./autosend-DpuAJlz4.js";import"./hooks-DOkARyS2.js";import"./decopilot-sse-pool-yvpwgZWV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BSTSxr9f.js";import"./use-decopilot-events-CssQ7XMz.js";import"./use-organization-settings-DxC5BT5e.js";import"./index-CS4EwFaR.js";import"./shell-layout-DoAVrerK.js";import"./alert-dialog-DFA_nrL8.js";import"./required-auth-layout-PXLv9yf-.js";import"./use-org-sso-CymoIsv4.js";import"./integration-icon-BjKZxHyL.js";import"./use-navigate-to-agent-BAQepcY9.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BfsmrOXE.js";import"./form-Bo-8Ln1U.js";import"./label-itDnpE7k.js";import"./input-BsEx9qgh.js";import"./switch-BOKpfG2a.js";import"./drawer-CQuJuOwU.js";import"./collection-search-BwRybpDA.js";import"./tabs-DDA7IPHD.js";import"./toggle-group-CisLBmfi.js";import"./use-deco-credits-CAb1KNIs.js";import"./extract-connection-data-BFt9JrM6.js";import"./connection-card-B2p6WHp7.js";import"./use-registry-connections-DzCHf8MS.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-D9ia054b.js";import"./connection-form-helpers-CTe9zYBl.js";import"./authenticate-and-persist-oauth-CRs0CnsY.js";import"./mcp-oauth-DTAyDU2Q.js";import"./collection-tabs-CGlZLNZG.js";import"./connect-desktop-dialog-nlx1v20u.js";import"./select-model-DJy9oKx6.js";import"./skeleton-CKbIkp-i.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-M1O3ge8Z.js";import"./dropdown-menu-C_qDMDJc.js";import"./index-BBdtoWBk.js";import"./toolbar-lHwKVbcz.js";import"./use-debounced-value-DYEvOfgl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C-YKbG5N.js";import"./use-mcp-tools-Cv_rmBI5.js";import"./use-capability-H0m9y9gf.js";import"./use-debounced-autosave-DRL2Q2vw.js";import"./index-BALkJ2dx.js";import"./search-input-DwylCsr-.js";import"./use-mcp-auth-status-B-vnUxNV.js";import"./github-repo-picker-DfirfuAT.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-j9NqCesQ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-BN8wLX0q.js";import"./index-Ci3NpEBH.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CpBuBa24.js";import"./toolbar-icon-button-BdhEbL8g.js";import"./use-file-configs-DniTn_7W.js";import"./automation-list-row-DjYgTsuk.js";function vi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const A=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const M=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const V=F,q=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,z=m.kind==="site"&&o&&n,B=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==q?(l=e.jsx(mt,{className:"text-sm font-semibold",children:q}),t[13]=q,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==$||t[22]!==H||t[23]!==A||t[24]!==v||t[25]!==h||t[26]!==B||t[27]!==x||t[28]!==M||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==z||t[37]!==_?(S=!o||!T&&!z?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:B}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:A,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:M})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=A,t[24]=v,t[25]=h,t[26]=B,t[27]=x,t[28]=M,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=z,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==V||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:V,children:f}),t[42]=V,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{vi as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as H,j as t,B as Z}from"./index-B5cMFR-y.js";import{n as ee}from"./LinkExternal01-wH6B14C5.js";import{aC as te,g as ie}from"./agent-icon-3oSe4h7A.js";import{I as J}from"./input-BsEx9qgh.js";import{L as G}from"./label-itDnpE7k.js";import{a1 as oe}from"./automation-runs-Db6yr9QX.js";import{b as Q,c as se,T as W,a as re}from"./tabs-DDA7IPHD.js";import{T as le}from"./textarea-D9ia054b.js";import{v as ae,w as me,o as pe,x as ne,y as ce,I as de,z as fe,A as ue,B as xe}from"./index-DwqZiRTX.js";import{b as he,a as ge,B as ve}from"./block-document-gXgzA-JT.js";import{u as je}from"./use-autosave-DOzBKdWx.js";import{s as E,E as be,R as ye,A as Ce}from"./primitives-B3tg18Ev.js";import"./AlertCircle-B947WyJr.js";import"./UserPlus01-CoO5zvRr.js";import"./Tool01-DPdDFdYA.js";import"./ArrowUp-Bs_6P4Iu.js";import"./Settings02-OSetn6ea.js";import"./Tool02-CIj3JzdV.js";import"./XCircle-BKwKlF9U.js";import"./ArrowUpRight-BxZoQJWz.js";import"./TrendUp01-DqQByDKq.js";import"./ZapSquare-ChZlLfh_.js";import"./Users03-C7WKxyUR.js";import"./CheckCircle-BU0_-3Q5.js";import"./Check-CcnPQW8L.js";import"./ChevronDown-HIcxNu9L.js";import"./ChevronRight-C5hCj-BJ.js";import"./ChevronUp-zg_HGLWR.js";import"./Circle-Bsy8_p9X.js";import"./Stars02-Uz2mjN30.js";import"./Copy01-CEOVwp8a.js";import"./ZoomOut-9DZqfrOE.js";import"./DotsVertical-BlOzCsHI.js";import"./Globe01-C0_GSmts.js";import"./Eye-CDNr9lij.js";import"./FilterLines-CY9-eI6Z.js";import"./Flag01-C5CmZtnc.js";import"./Star01-BlQBW3oI.js";import"./Globe04-blrjzALH.js";import"./SwitchHorizontal01-aHLJ4VFM.js";import"./HardDrive-DDCNtQf8.js";import"./Key01-DhaQwTr9.js";import"./LayoutLeft-CDGSUvFB.js";import"./List-CT_BXxlG.js";import"./Monitor01-CGFN5sGg.js";import"./Sun-NMZSBMue.js";import"./Package-Dl0Lfmce.js";import"./Palette-B0Atethk.js";import"./Play-Dz4heBw1.js";import"./Plus-DkxBw62L.js";import"./SearchLg-BxBwkXRA.js";import"./SearchMd-Ck8RI60i.js";import"./Shield01-Dq-HMUMk.js";import"./Stars01-COr-0k43.js";import"./Trash01-ZIY4ACli.js";import"./Upload01-D1HGy3QV.js";import"./User01-B2aITRRg.js";import"./Users01-HqZawgTe.js";import"./XClose-iezakeMo.js";import"./X-Dmet8wMD.js";import"./Zap-CfXP7HDl.js";import"./select-CkNw5vmE.js";import"./tooltip-Cm1Uo3tj.js";import"./useInfiniteQuery-Bx9w5_18.js";import"./use-infinite-scroll-BzjM30U0.js";import"./use-connection-BjfpYHE7.js";import"./use-collections-IkbkyTPy.js";import"./use-mcp-client-lixd0gAV.js";import"./constants-D_FQAPnt.js";import"./auth-CYtv0_rL.js";import"./use-virtual-mcp-DUjw2r9s.js";import"./card-COkVnQnP.js";import"./sidebar-BQFslZSt.js";import"./use-mobile-BYgIZfXj.js";import"./table-B88p_wsC.js";import"./empty-state-DFI2pRsv.js";import"./use-members-XsfnxDj6.js";import"./use-org-auth-client-DNG8tLX7.js";import"./use-clock-tick-DVjyQSN6.js";import"./use-automations-z-3-_HVg.js";import"./studio-tools-C0FSNSO6.js";import"./useSuspenseInfiniteQuery-DDY3jNH9.js";import"./badge-BmdcYP2l.js";import"./checkbox-BCHArcau.js";import"./command-DYuWdmIc.js";import"./index-CFF-0dHO.js";import"./dialog-CvMUMR16.js";import"./popover-DktOaoCj.js";import"./avatar-DGZ13TB0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhCEUwuV.js";import"./file-type-icon-DSufmAQ5.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-D_6PkZ4D.js";import"./index-Oe3PDrxX.js";import"./chat-context-DVVCYt3e.js";import"./autosend-DpuAJlz4.js";import"./hooks-DOkARyS2.js";import"./decopilot-sse-pool-yvpwgZWV.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BSTSxr9f.js";import"./use-decopilot-events-CssQ7XMz.js";import"./use-organization-settings-DxC5BT5e.js";import"./index-CS4EwFaR.js";import"./shell-layout-DoAVrerK.js";import"./alert-dialog-DFA_nrL8.js";import"./required-auth-layout-PXLv9yf-.js";import"./use-org-sso-CymoIsv4.js";import"./integration-icon-BjKZxHyL.js";import"./use-navigate-to-agent-BAQepcY9.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BfsmrOXE.js";import"./form-Bo-8Ln1U.js";import"./drawer-CQuJuOwU.js";import"./collection-search-BwRybpDA.js";import"./toggle-group-CisLBmfi.js";import"./use-deco-credits-CAb1KNIs.js";import"./extract-connection-data-BFt9JrM6.js";import"./connection-card-B2p6WHp7.js";import"./use-registry-connections-DzCHf8MS.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-form-helpers-CTe9zYBl.js";import"./authenticate-and-persist-oauth-CRs0CnsY.js";import"./mcp-oauth-DTAyDU2Q.js";import"./collection-tabs-CGlZLNZG.js";import"./connect-desktop-dialog-nlx1v20u.js";import"./select-model-DJy9oKx6.js";import"./skeleton-CKbIkp-i.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-M1O3ge8Z.js";import"./dropdown-menu-C_qDMDJc.js";import"./index-BBdtoWBk.js";import"./toolbar-lHwKVbcz.js";import"./use-debounced-value-DYEvOfgl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C-YKbG5N.js";import"./use-mcp-tools-Cv_rmBI5.js";import"./use-capability-H0m9y9gf.js";import"./switch-BOKpfG2a.js";import"./use-debounced-autosave-DRL2Q2vw.js";import"./index-BALkJ2dx.js";import"./search-input-DwylCsr-.js";import"./use-mcp-auth-status-B-vnUxNV.js";import"./github-repo-picker-DfirfuAT.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-j9NqCesQ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-BN8wLX0q.js";import"./index-Ci3NpEBH.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CpBuBa24.js";import"./toolbar-icon-button-BdhEbL8g.js";import"./use-file-configs-DniTn_7W.js";import"./automation-list-row-DjYgTsuk.js";function ke(g){return Array.isArray(g)?g.map(e=>({key:E(e?.key),value:E(e?.value)})):[]}function No(g){const e=H.c(66),{orgSlug:o,virtualMcpId:m,branch:i,blockKey:f,block:a,decofile:l,meta:c,previewBaseUrl:h}=g;let x;e[0]!==i||e[1]!==o||e[2]!==m?(x={orgSlug:o,virtualMcpId:m,branch:i},e[0]=i,e[1]=o,e[2]=m,e[3]=x):x=e[3];const r=ae(x);let p;e[4]!==a?(p=me(a,"posts"),e[4]=a,e[5]=p):p=e[5];const d=p;let n;e[6]!==f||e[7]!==r?(n=F=>{r.mutate({blockKey:f,data:ne(f,"posts",ce(F))})},e[6]=f,e[7]=r,e[8]=n):n=e[8];const[s,N]=je(d,n);let S;e[9]!==s||e[10]!==N?(S=(F,Y)=>N({...s,[F]:Y}),e[9]=s,e[10]=N,e[11]=S):S=e[11];const v=S;let w;e[12]!==l||e[13]!==s||e[14]!==h?(w=he({decofile:l,post:s,previewBaseUrl:h}),e[12]=l,e[13]=s,e[14]=h,e[15]=w):w=e[15];const j=w;let b;e[16]!==s.title?(b=E(s.title)||"Untitled post",e[16]=s.title,e[17]=b):b=e[17];let y;e[18]!==b?(y=t.jsx("span",{className:"truncate text-sm font-medium",children:b}),e[18]=b,e[19]=y):y=e[19];let C;e[20]!==r.isError||e[21]!==r.isPending?(C=t.jsx(pe,{isPending:r.isPending,isError:r.isError}),e[20]=r.isError,e[21]=r.isPending,e[22]=C):C=e[22];const P=!j,_=j?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let k;e[23]!==j?(k=()=>{j&&window.open(j,"_blank","noopener,noreferrer")},e[23]=j,e[24]=k):k=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let u;e[26]!==_||e[27]!==k||e[28]!==P?(u=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:P,title:_,onClick:k,children:[B,"See preview"]}),e[26]=_,e[27]=k,e[28]=P,e[29]=u):u=e[29];let T;e[30]!==u||e[31]!==C?(T=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[C,u]}),e[30]=u,e[31]=C,e[32]=T):T=e[32];let R;e[33]!==T||e[34]!==y?(R=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[y,T]}),e[33]=T,e[34]=y,e[35]=R):R=e[35];let A;e[36]!==s.title?(A=E(s.title),e[36]=s.title,e[37]=A):A=e[37];let L;e[38]!==v?(L=F=>v("title",F),e[38]=v,e[39]=L):L=e[39];let I;e[40]!==A||e[41]!==L?(I=t.jsx(be,{value:A,onChange:L,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=A,e[41]=L,e[42]=I):I=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=K):K=e[43];let O;e[44]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(se,{children:[K,t.jsxs(Q,{value:"settings",children:[t.jsx(ie,{}),"Settings"]})]}),e[44]=O):O=e[44];let U;e[45]!==s.sections?(U=ge(s.sections),e[45]=s.sections,e[46]=U):U=e[46];let V;e[47]!==v?(V=F=>v("sections",F),e[47]=v,e[48]=V):V=e[48];let $;e[49]!==c||e[50]!==U||e[51]!==V?($=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(ve,{value:U,onChange:V,meta:c,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=c,e[50]=U,e[51]=V,e[52]=$):$=e[52];let M;e[53]!==l||e[54]!==s||e[55]!==v?(M=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ne,{post:s,decofile:l,onChange:v})})}),e[53]=l,e[54]=s,e[55]=v,e[56]=M):M=e[56];let z;e[57]!==$||e[58]!==M?(z=t.jsxs(re,{defaultValue:"content",className:"mt-6 gap-4",children:[O,$,M]}),e[57]=$,e[58]=M,e[59]=z):z=e[59];let D;e[60]!==I||e[61]!==z?(D=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[I,z]})}),e[60]=I,e[61]=z,e[62]=D):D=e[62];let q;return e[63]!==R||e[64]!==D?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[R,D]}),e[63]=R,e[64]=D,e[65]=q):q=e[65],q}function Ne(g){const e=H.c(57),{post:o,decofile:m,onChange:i}=g;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=f):f=e[0];let a;e[1]!==o.excerpt?(a=E(o.excerpt),e[1]=o.excerpt,e[2]=a):a=e[2];let l;e[3]!==i?(l=u=>i("excerpt",u.target.value),e[3]=i,e[4]=l):l=e[4];let c;e[5]!==a||e[6]!==l?(c=t.jsxs("div",{className:"space-y-2",children:[f,t.jsx(le,{id:"post-excerpt",value:a,onChange:l,rows:2})]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=h):h=e[8];let x;e[9]!==o.slug?(x=E(o.slug),e[9]=o.slug,e[10]=x):x=e[10];let r;e[11]!==i?(r=u=>i("slug",u.target.value),e[11]=i,e[12]=r):r=e[12];let p;e[13]!==x||e[14]!==r?(p=t.jsxs("div",{className:"space-y-2",children:[h,t.jsx(J,{id:"post-slug",value:x,onChange:r,placeholder:"my-post",className:"h-10"})]}),e[13]=x,e[14]=r,e[15]=p):p=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d={type:"string",format:"date",title:"Date"},e[16]=d):d=e[16];let n;e[17]!==o.date?(n=E(o.date),e[17]=o.date,e[18]=n):n=e[18];let s;e[19]!==i?(s=u=>i("date",u),e[19]=i,e[20]=s):s=e[20];let N;e[21]!==n||e[22]!==s?(N=t.jsx(xe,{schema:d,value:n,onChange:s,path:"post-date",label:"Date"}),e[21]=n,e[22]=s,e[23]=N):N=e[23];let S;e[24]!==N||e[25]!==p?(S=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p,N]}),e[24]=N,e[25]=p,e[26]=S):S=e[26];let v;e[27]===Symbol.for("react.memo_cache_sentinel")?(v={type:"string",format:"image-uri",title:"Cover image"},e[27]=v):v=e[27];let w;e[28]!==i?(w=u=>i("image",u),e[28]=i,e[29]=w):w=e[29];let j;e[30]!==o.image||e[31]!==w?(j=t.jsx(de,{schema:v,value:o.image,onChange:w,path:"post-image",label:"Cover image"}),e[30]=o.image,e[31]=w,e[32]=j):j=e[32];let b;e[33]!==i?(b=u=>i("authors",u),e[33]=i,e[34]=b):b=e[34];let y;e[35]!==m||e[36]!==o.authors||e[37]!==b?(y=t.jsx(X,{label:"Authors",decofile:m,kind:"authors",valueField:"email",toRef:we,selected:o.authors,onChange:b}),e[35]=m,e[36]=o.authors,e[37]=b,e[38]=y):y=e[38];let C;e[39]!==i?(C=u=>i("categories",u),e[39]=i,e[40]=C):C=e[40];let P;e[41]!==m||e[42]!==o.categories||e[43]!==C?(P=t.jsx(X,{label:"Categories",decofile:m,kind:"categories",valueField:"slug",toRef:Se,selected:o.categories,onChange:C}),e[41]=m,e[42]=o.categories,e[43]=C,e[44]=P):P=e[44];let _;e[45]!==i?(_=u=>i("extraProps",u),e[45]=i,e[46]=_):_=e[46];let k;e[47]!==o.extraProps||e[48]!==_?(k=t.jsx(Pe,{value:o.extraProps,onChange:_}),e[47]=o.extraProps,e[48]=_,e[49]=k):k=e[49];let B;return e[50]!==S||e[51]!==j||e[52]!==y||e[53]!==P||e[54]!==k||e[55]!==c?(B=t.jsxs("div",{className:"space-y-5",children:[c,S,j,y,P,k]}),e[50]=S,e[51]=j,e[52]=y,e[53]=P,e[54]=k,e[55]=c,e[56]=B):B=e[56],B}function Se(g){return{name:E(g.name),slug:E(g.slug)}}function we(g){return{...g}}function Pe(g){const e=H.c(15),{value:o,onChange:m}=g;let i,f,a,l;if(e[0]!==m||e[1]!==o){i=ke(o);const x=(r,p)=>m(i.map((d,n)=>n===r?{...d,...p}:d));f="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:"Extra props"}),e[6]=a):a=e[6],l=i.length>0&&t.jsx("ul",{className:"space-y-2",children:i.map((r,p)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:r.key,onChange:d=>x(p,{key:d.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:r.value,onChange:d=>x(p,{value:d.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>m(i.filter((d,n)=>n!==p))})]},p))}),e[0]=m,e[1]=o,e[2]=i,e[3]=f,e[4]=a,e[5]=l}else i=e[2],f=e[3],a=e[4],l=e[5];let c;e[7]!==i||e[8]!==m?(c=t.jsx(Ce,{label:"Add prop",onClick:()=>m([...i,{key:"",value:""}])}),e[7]=i,e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==f||e[11]!==a||e[12]!==l||e[13]!==c?(h=t.jsxs("div",{className:f,children:[a,l,c]}),e[10]=f,e[11]=a,e[12]=l,e[13]=c,e[14]=h):h=e[14],h}function X(g){const e=H.c(17),{label:o,decofile:m,kind:i,valueField:f,toRef:a,selected:l,onChange:c}=g;let h;e[0]!==m||e[1]!==i||e[2]!==l||e[3]!==a||e[4]!==f?(h=fe({records:ue(m,i),selected:l,valueField:f,toRef:a}),e[0]=m,e[1]=i,e[2]=l,e[3]=a,e[4]=f,e[5]=h):h=e[5];const{options:x,selectedValues:r,refsForValues:p}=h;let d;e[6]!==o?(d=t.jsx(G,{children:o}),e[6]=o,e[7]=d):d=e[7];let n;e[8]!==o||e[9]!==c||e[10]!==x||e[11]!==p||e[12]!==r?(n=x.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",o.toLowerCase()," yet — create some in the"," ",o.toLowerCase()," collection."]}):t.jsx(oe,{options:x,defaultValue:r,onValueChange:N=>c(p(N)),placeholder:`Select ${o.toLowerCase()}`,maxCount:4}),e[8]=o,e[9]=c,e[10]=x,e[11]=p,e[12]=r,e[13]=n):n=e[13];let s;return e[14]!==d||e[15]!==n?(s=t.jsxs("div",{className:"space-y-2",children:[d,n]}),e[14]=d,e[15]=n,e[16]=s):s=e[16],s}export{No as PostEditor};
|