decocms 3.34.4 → 3.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CzdD0HiL.js → AlertCircle-asB0zjf2.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BA7_QQtv.js → ArrowUpRight-DRnt_VKh.js} +1 -1
- package/dist/client/assets/{Check-DCL7RDuY.js → Check-CNRVH6xs.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cx2a6H3v.js → CheckCircle-B7v5_MG4.js} +1 -1
- package/dist/client/assets/{ChevronDown-D-NGqiSH.js → ChevronDown-BKkz3Gyp.js} +1 -1
- package/dist/client/assets/{ChevronLeft-D0v1a1VK.js → ChevronLeft-DkMFugke.js} +1 -1
- package/dist/client/assets/{ChevronRight-OSZ9UQBS.js → ChevronRight-DixPnH3V.js} +1 -1
- package/dist/client/assets/{ChevronUp-fyspqP-W.js → ChevronUp-BeDEmrn1.js} +1 -1
- package/dist/client/assets/{Container-Tw3rOSi3.js → Container-C41D-bwR.js} +1 -1
- package/dist/client/assets/{DotsVertical-C4-w4Qkz.js → DotsVertical-DimB1qZR.js} +1 -1
- package/dist/client/assets/{Eye-BmvVeOF9.js → Eye-CFpoJQMe.js} +1 -1
- package/dist/client/assets/{FilterLines-DdCr16DJ.js → FilterLines-htpqKUqo.js} +1 -1
- package/dist/client/assets/{Globe01-DoJKg1_O.js → Globe01-CxF-Z8O2.js} +1 -1
- package/dist/client/assets/{HardDrive-vKdqjrK9.js → HardDrive-TXw7C9gB.js} +1 -1
- package/dist/client/assets/{Key01-K6tD8Vdh.js → Key01-CDAkGspz.js} +1 -1
- package/dist/client/assets/{LayoutLeft-takDYV-t.js → LayoutLeft-BG08KNqc.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BCi_ShXX.js → LinkExternal01-AylVRyuU.js} +1 -1
- package/dist/client/assets/{Monitor01-DB396gYF.js → Monitor01-gdKmZQTW.js} +1 -1
- package/dist/client/assets/{Palette-COuqms6z.js → Palette-D9_6t0uI.js} +1 -1
- package/dist/client/assets/{Play-CjvHnycm.js → Play-aa6uUei5.js} +1 -1
- package/dist/client/assets/{Plus-CcEwOgtq.js → Plus-DcxLSicT.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CCfli9l6.js → RefreshCcw01-Dd5D2uNm.js} +1 -1
- package/dist/client/assets/{SearchMd-F8Lgigzr.js → SearchMd-2GibIebB.js} +1 -1
- package/dist/client/assets/{Settings02-BIGqwL7C.js → Settings02-D0kdZjJD.js} +1 -1
- package/dist/client/assets/{Shield01-B9Q_1Xk7.js → Shield01-CpxvRW7h.js} +1 -1
- package/dist/client/assets/{Star01-Dq4t2HLY.js → Star01-BVQUiqS1.js} +1 -1
- package/dist/client/assets/{Stars01-CiNgchIp.js → Stars01-B2PA7s4d.js} +1 -1
- package/dist/client/assets/{Stars02-CQVglhpL.js → Stars02-BFz8RQ16.js} +1 -1
- package/dist/client/assets/{Sun-Cr2yuAzo.js → Sun-DMcKqqHE.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-bU2GcEKE.js → SwitchHorizontal01-qUOmQUUG.js} +1 -1
- package/dist/client/assets/{Tool01-eIrbwcPJ.js → Tool01-DNz0OMpT.js} +1 -1
- package/dist/client/assets/{Trash01-D44a84s5.js → Trash01-rpak8qu1.js} +1 -1
- package/dist/client/assets/{Upload01-VXtvttgz.js → Upload01-d_Wyw7QT.js} +1 -1
- package/dist/client/assets/{User01-DTzTYshF.js → User01-BWllfXHj.js} +1 -1
- package/dist/client/assets/{Users01-CUSYtOwa.js → Users01-DG6YdAo1.js} +1 -1
- package/dist/client/assets/{Users03-D-uCbKBY.js → Users03-B9AqN8LK.js} +1 -1
- package/dist/client/assets/{X-BerS9SvA.js → X-DxE022Fo.js} +1 -1
- package/dist/client/assets/{XCircle-DKQ_LGK7.js → XCircle-B_UH_gQt.js} +1 -1
- package/dist/client/assets/{XClose-DLTON1f7.js → XClose-DOt_DYPz.js} +1 -1
- package/dist/client/assets/{Zap-312eTZCV.js → Zap-CyMJw7DY.js} +1 -1
- package/dist/client/assets/{ZapSquare-Ds8_u3m3.js → ZapSquare-Dz4Qok6x.js} +1 -1
- package/dist/client/assets/{ZoomOut-DJZYHdrq.js → ZoomOut-BkCtUzuC.js} +1 -1
- package/dist/client/assets/{access-gate-DDt7PCzj.js → access-gate-u6bqRJWi.js} +1 -1
- package/dist/client/assets/{accordion-C7tZu5zr.js → accordion-B7oL0ZOw.js} +1 -1
- package/dist/client/assets/{add-section-modal-CXTw4rr2.js → add-section-modal-DI1aX1UO.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DD75DzJc.js → agent-capabilities-BxQUOIVO.js} +1 -1
- package/dist/client/assets/{agent-icon-BbtDyEhK.js → agent-icon-BrUPk7cd.js} +1 -1
- package/dist/client/assets/{agent-icons-DW_aJ48l.js → agent-icons-oFY-K2bC.js} +1 -1
- package/dist/client/assets/{agents-list-DKuLM9YR.js → agents-list-BOxJitnX.js} +1 -1
- package/dist/client/assets/{ai-providers-szVBTcEx.js → ai-providers-DjvmZlJ5.js} +1 -1
- package/dist/client/assets/{alert-Bo_PTvcZ.js → alert-8WGQf_5q.js} +1 -1
- package/dist/client/assets/{alert-dialog-B-uaEzoe.js → alert-dialog-DUUnhBc6.js} +1 -1
- package/dist/client/assets/app-editor-8bhdvSJz.js +1 -0
- package/dist/client/assets/{auth-D_7i1Nyj.js → auth-DTxUlSLU.js} +1 -1
- package/dist/client/assets/{auth-catchall-D-qC5UN5.js → auth-catchall-_asaISim.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CLwX_trK.js → auth-split-layout-DU0bpIBM.js} +1 -1
- package/dist/client/assets/{automation-list-row-CFcpTyMb.js → automation-list-row-atv_xAlK.js} +1 -1
- package/dist/client/assets/{automation-runs-GuZPPaYO.js → automation-runs-8yvWAbAC.js} +1 -1
- package/dist/client/assets/{automations-DERQUV6U.js → automations-B1IxT7Wc.js} +1 -1
- package/dist/client/assets/{avatar-CzRJu4-e.js → avatar-BqYC23h9.js} +1 -1
- package/dist/client/assets/{badge-BH87JKvD.js → badge-CGZjMX2o.js} +1 -1
- package/dist/client/assets/{brand-context-DfIPHLDc.js → brand-context-Dki54pAn.js} +1 -1
- package/dist/client/assets/buckets-BgnqByrS.js +1 -0
- package/dist/client/assets/{calendar-D1EOyTY7.js → calendar-CaIJu6mx.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bg7D6wTq.js → capability-load-error-DWbE5k9a.js} +1 -1
- package/dist/client/assets/{card-vyZC9bmn.js → card-BlzflWCA.js} +1 -1
- package/dist/client/assets/{chat-context-fcMg1upF.js → chat-context-BUN4BStS.js} +1 -1
- package/dist/client/assets/{checkbox-D5U8M06N.js → checkbox-C1s8UE6Y.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bf19uQP9.js → cli-auth-success-DOMHymP7.js} +1 -1
- package/dist/client/assets/{collection-detail-CAOIohKi.js → collection-detail-Fe7fYzy1.js} +1 -1
- package/dist/client/assets/{collection-display-button-B92ml-o1.js → collection-display-button-CTi0VUGU.js} +1 -1
- package/dist/client/assets/{collection-search-B-w-HeXx.js → collection-search-CJ5Ov7mh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C9pQRlzR.js → collection-table-wrapper-BMZaf4HK.js} +1 -1
- package/dist/client/assets/{collection-tabs-Cf826YQE.js → collection-tabs-zuvlZo6K.js} +1 -1
- package/dist/client/assets/{collections-DHGMK7u4.js → collections-Dg2-DQoz.js} +1 -1
- package/dist/client/assets/{command-CbVJYcLx.js → command-ETJRln9I.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DeNV0iLp.js → connect-desktop-dialog-Ccy-ptqT.js} +1 -1
- package/dist/client/assets/{connection-card-Cod1I3T4.js → connection-card-BryVkZk7.js} +1 -1
- package/dist/client/assets/{connection-detail-Byr9G74f.js → connection-detail-KbHJGNLa.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D6w2eM0g.js → connection-form-helpers-C9SsVHwd.js} +1 -1
- package/dist/client/assets/{connections-CrrJ4Vi1.js → connections-C-B_pHNS.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-BYcZYovC.js +1 -0
- package/dist/client/assets/{dialog-DhPYQxKL.js → dialog-dItkri_7.js} +1 -1
- package/dist/client/assets/{domain-settings-6SYR51ts.js → domain-settings-Cwl6OKHc.js} +1 -1
- package/dist/client/assets/{drawer-Daco3mLi.js → drawer-CiKI2xvg.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DyHOWhHD.js → dropdown-menu-DA6--pO3.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BemEgHny.js → dynamic-plugin-layout-DvjE2kdj.js} +1 -1
- package/dist/client/assets/{empty-state-wKCfoaUn.js → empty-state-Wjey2haZ.js} +1 -1
- package/dist/client/assets/{empty-state-Bu9Ydz_D.js → empty-state-ubN3bG68.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CXfLD91m.js → extract-connection-data-BUZFKLkD.js} +1 -1
- package/dist/client/assets/{features-D1v6KDMk.js → features-wYfaVlaa.js} +1 -1
- package/dist/client/assets/{file-explorer-DClpTAL5.js → file-explorer-uNvjlPcF.js} +1 -1
- package/dist/client/assets/{file-type-icon-CJ-zSSSF.js → file-type-icon-BC52hPZD.js} +1 -1
- package/dist/client/assets/{files-CpnG1733.js → files-DCMyG2Qq.js} +1 -1
- package/dist/client/assets/{form-Bvy6rgyq.js → form-BvrZIBZy.js} +1 -1
- package/dist/client/assets/{general-D5o_SLmt.js → general-CVh1dm4M.js} +1 -1
- package/dist/client/assets/{generate-id-ChTWQ_R9.js → generate-id-BYzu1jEq.js} +1 -1
- package/dist/client/assets/{github-repo-picker-71D4tYUy.js → github-repo-picker-D-39cmmm.js} +1 -1
- package/dist/client/assets/{header-tab-button-0n75_bDq.js → header-tab-button-eoCiDxtu.js} +1 -1
- package/dist/client/assets/{hover-card-CWAzZxGp.js → hover-card-DuwXdrhz.js} +1 -1
- package/dist/client/assets/{image-field-93_1M6Cv.js → image-field-BctFTejU.js} +1 -1
- package/dist/client/assets/{index-GjxZu5D5.js → index-7TDtRiUY.js} +21 -21
- package/dist/client/assets/{index-CyFYd9U1.js → index-B6rgjRY6.js} +1 -1
- package/dist/client/assets/{index-CZrxu3V-.js → index-BMYBcbtc.js} +1 -1
- package/dist/client/assets/{index-CKlPSEz_.js → index-BN_h4BrS.js} +1 -1
- package/dist/client/assets/{index-C5isfxFM.js → index-BOvqwG23.js} +1 -1
- package/dist/client/assets/{index-CmQW0pRd.js → index-CQVYoK7e.js} +1 -1
- package/dist/client/assets/{index-CJzhadxV.js → index-CYZk0gv3.js} +1 -1
- package/dist/client/assets/{index-vPgvQXD8.js → index-CfhwhmtA.js} +1 -1
- package/dist/client/assets/{index-CAdWwovr.js → index-CyhU99S0.js} +1 -1
- package/dist/client/assets/{index-Chg_1h1Q.js → index-DFBJ_PWq.js} +1 -1
- package/dist/client/assets/{index-D9m-XNQG.js → index-Dilf6iGE.js} +1 -1
- package/dist/client/assets/{index-I0Hfa1ue.js → index-DkBXivRM.js} +1 -1
- package/dist/client/assets/{index-BaTRbm9d.js → index-DkJOKUiK.js} +1 -1
- package/dist/client/assets/{index-AYOhbOh-.js → index-Dv-yFpKM.js} +3 -3
- package/dist/client/assets/{index-BTwzTipj.js → index-cSwj9er3.js} +1 -1
- package/dist/client/assets/{index-redirect-BOWIqnKA.js → index-redirect-C0KSMoT0.js} +1 -1
- package/dist/client/assets/{input-DErmZhFg.js → input-B16LqKMQ.js} +1 -1
- package/dist/client/assets/{integration-icon-s9jj_05B.js → integration-icon-7cYHs9rV.js} +1 -1
- package/dist/client/assets/{label-Dr2eF6if.js → label-DfTmRnMe.js} +1 -1
- package/dist/client/assets/{layout-B9jMdIeQ.js → layout-BCfLVStg.js} +1 -1
- package/dist/client/assets/{login-wWsXDjg2.js → login-BQe_0Uvb.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BOnYmqmQ.js → mcp-oauth-BoL_9gDY.js} +1 -1
- package/dist/client/assets/{members-BG-EYVVx.js → members-DjEZG3vo.js} +1 -1
- package/dist/client/assets/{monaco-editor-UIKiC3DB.js → monaco-editor-CEYWUBYY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-62KT747u.js → monitoring-stats-row-Bn6k8FMZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai4Tc2VZ.js → oauth-callback-RkcrzPY9.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CySxin-u.js → oauth-callback-ai-provider-5c5f08wA.js} +1 -1
- package/dist/client/assets/{onboarding-mGbMpy90.js → onboarding-DgNS0nCK.js} +1 -1
- package/dist/client/assets/{org-install-DZIuKflZ.js → org-install-BAqLW3a2.js} +1 -1
- package/dist/client/assets/{org-layout-DTZl85nm.js → org-layout--7cqwMMu.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DMoqZL8g.js → org-plugin-layout-oYg4_27L.js} +1 -1
- package/dist/client/assets/{page-seo-form-Br2QpcIh.js → page-seo-form-BPPrLLbX.js} +1 -1
- package/dist/client/assets/page-seo-sheet-B3ue-ZRT.js +1 -0
- package/dist/client/assets/{pair-BKA_cCJy.js → pair-rD44zBRY.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BpXDhzPo.js → plugin-empty-state-BrE2fclx.js} +1 -1
- package/dist/client/assets/{plugin-header-DpAoB9Ca.js → plugin-header-K2albhDB.js} +1 -1
- package/dist/client/assets/{plugin-layout-BoMcJfNN.js → plugin-layout-QWYZgGti.js} +1 -1
- package/dist/client/assets/{popover-qA5W_aO0.js → popover-BneLTlXE.js} +1 -1
- package/dist/client/assets/{post-editor-B7EDLj8a.js → post-editor-DtVXF5Vi.js} +1 -1
- package/dist/client/assets/{primitives-BjZIjqQm.js → primitives-CGyfTuZM.js} +1 -1
- package/dist/client/assets/{profile-DefhUD1s.js → profile-DyIp4_Sh.js} +1 -1
- package/dist/client/assets/project-app-view-LYHB1B7I.js +1 -0
- package/dist/client/assets/record-editor-CoIz7HmY.js +1 -0
- package/dist/client/assets/registry-DusjF1MY.js +2 -0
- package/dist/client/assets/{registry-layout-DVCtktv7.js → registry-layout-D_1w2T32.js} +1 -1
- package/dist/client/assets/{require-capability-kzIBHw7I.js → require-capability-BYMVx09Z.js} +1 -1
- package/dist/client/assets/{required-auth-layout--gAqPx1o.js → required-auth-layout-cXbsWfNV.js} +1 -1
- package/dist/client/assets/{reset-password-zPPgPZZ-.js → reset-password-CUBQj13G.js} +1 -1
- package/dist/client/assets/{resizable-C5LjJwjN.js → resizable-DTSOtBpc.js} +1 -1
- package/dist/client/assets/{roles-C-Aul5X9.js → roles-CNJV2xc7.js} +1 -1
- package/dist/client/assets/save-referenced-block-R6f1-KeE.js +1 -0
- package/dist/client/assets/{save-status-BV3DYgWl.js → save-status-CFFENSy0.js} +1 -1
- package/dist/client/assets/{schema-form-SJrGXRlU.js → schema-form-EY1QOp8v.js} +1 -1
- package/dist/client/assets/{scroll-area-D-A0aCbX.js → scroll-area-CGmfUT4q.js} +1 -1
- package/dist/client/assets/{search-input-BGHqVG2v.js → search-input-nds5g8eq.js} +1 -1
- package/dist/client/assets/{secrets-DV4PS6bI.js → secrets-D9isT8UG.js} +1 -1
- package/dist/client/assets/{sections-editor-Zi700_G9.js → sections-editor-Bdjt3M_c.js} +1 -1
- package/dist/client/assets/{select-C-92em1q.js → select-CXfOBpVA.js} +1 -1
- package/dist/client/assets/{select-model-Dih5vchT.js → select-model-BLS2zNwN.js} +1 -1
- package/dist/client/assets/{seo-editor-D29FTKLv.js → seo-editor-COMkxwHv.js} +1 -1
- package/dist/client/assets/{settings-layout-NEtrChfG.js → settings-layout-B65ypXYb.js} +1 -1
- package/dist/client/assets/{settings-section-CJGTSnIh.js → settings-section-ysm1dXbe.js} +1 -1
- package/dist/client/assets/{sheet-BzobqfQ2.js → sheet-DwJxE17f.js} +1 -1
- package/dist/client/assets/{shell-controls-P01RjHPJ.js → shell-controls-CghaJ_r9.js} +1 -1
- package/dist/client/assets/{shell-layout-C_RGI19w.js → shell-layout-BI3SgcG0.js} +1 -1
- package/dist/client/assets/{shell-route-loading-Vpy9ggBQ.js → shell-route-loading-BQp4nxMc.js} +1 -1
- package/dist/client/assets/{sidebar-jPzKrErD.js → sidebar-nhuTSqFS.js} +1 -1
- package/dist/client/assets/{skeleton-BkBCJzvx.js → skeleton-DcZkQ-WQ.js} +1 -1
- package/dist/client/assets/{sortable.esm-BxJf-B3h.js → sortable.esm-BJmSIQN6.js} +1 -1
- package/dist/client/assets/{spinner-fzT44PtT.js → spinner-C76OMH7i.js} +1 -1
- package/dist/client/assets/{sso-BjNFVlpu.js → sso-Biwe8B2Y.js} +1 -1
- package/dist/client/assets/{store-CqP-ICoJ.js → store-DPy_WrJu.js} +1 -1
- package/dist/client/assets/store-registry-D7UNS3l2.js +2 -0
- package/dist/client/assets/{studio-tools-D1zmoCWz.js → studio-tools-DP4PwlLL.js} +1 -1
- package/dist/client/assets/{switch-DTsn6qak.js → switch-Dlc-euH4.js} +1 -1
- package/dist/client/assets/{tab-id-CqhjPWfe.js → tab-id-DrxIMKZC.js} +1 -1
- package/dist/client/assets/{table-DHXpvgyf.js → table-BY5hmAW9.js} +1 -1
- package/dist/client/assets/{tabs-Bk42DpLr.js → tabs-MktB_dq3.js} +1 -1
- package/dist/client/assets/{task-status-BJtFNCHO.js → task-status-Bkjp3y0Q.js} +1 -1
- package/dist/client/assets/{textarea-6a4-y1Su.js → textarea-Dc7UpW7V.js} +1 -1
- package/dist/client/assets/{toggle-group-DMQKr8tB.js → toggle-group-PAs-hpFv.js} +1 -1
- package/dist/client/assets/{toolbar-nvslJ6se.js → toolbar-CCipnjie.js} +1 -1
- package/dist/client/assets/{tools-list-BZ88ZOtB.js → tools-list-D8vEf5kn.js} +1 -1
- package/dist/client/assets/{tooltip-B_bAE461.js → tooltip-DyNW-AXf.js} +1 -1
- package/dist/client/assets/{types-yCFKjNKB.js → types-DYMMjWos.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B0XGed9T.js → use-ai-providers-C1UbdVdO.js} +1 -1
- package/dist/client/assets/{use-automations-BVmzaYqk.js → use-automations-DFVkTFjl.js} +1 -1
- package/dist/client/assets/{use-capability-BZHRv6lH.js → use-capability-Bw0k887i.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Cs4ksDbV.js → use-clock-tick-DMfzqE_6.js} +1 -1
- package/dist/client/assets/{use-collections-CpH8UnUb.js → use-collections-DGD5HYrs.js} +1 -1
- package/dist/client/assets/{use-connection-Dr4v30Rg.js → use-connection-XtO-eFJi.js} +1 -1
- package/dist/client/assets/{use-copy-DxwnRzEa.js → use-copy-fHv0q1pV.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DkNKlR70.js → use-create-virtual-mcp-DTGwia7F.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-XMghK7cg.js → use-debounced-autosave-nDLl3CCi.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BCuDZsFN.js → use-delete-connection-CWxG7WKN.js} +1 -1
- package/dist/client/assets/{use-file-configs-CdUbNW-T.js → use-file-configs-DhxZBYOT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BEtIsVE7.js → use-infinite-scroll-D4S3aGR5.js} +1 -1
- package/dist/client/assets/{use-list-state-DTPAi9kL.js → use-list-state-Cx82QFu_.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CY4k0WSm.js → use-mcp-client-C8ZwZB20.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D5BNmvrR.js → use-mcp-prompts-D2owAcPE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D_HyfNkD.js → use-mcp-tools-BW-64A4f.js} +1 -1
- package/dist/client/assets/{use-members-BLQ0hZRF.js → use-members-DPyxvdDj.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C3bIAWTD.js → use-navigate-to-agent-B9d6Q1VR.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DVEzJXpD.js → use-org-auth-client-BTTZUjKk.js} +1 -1
- package/dist/client/assets/{use-org-sso-D4Tlhwcs.js → use-org-sso-B1KJDg2R.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C-fo78Yw.js → use-organization-roles-zS-vWU34.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B_Bobbu2.js → use-organization-settings-CCLHoFg6.js} +1 -1
- package/dist/client/assets/{use-registry-connections-SPQVCkw4.js → use-registry-connections-CAyIHNjF.js} +1 -1
- package/dist/client/assets/{use-secrets-DMcF1I87.js → use-secrets-CtwUwXaf.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BGGoA40W.js → use-status-sounds-B27SY7cH.js} +1 -1
- package/dist/client/assets/{use-view-mode-r7LIRuse.js → use-view-mode-BRITAZ4S.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-XH9W6O_2.js → use-virtual-mcp-DLQJqd7d.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-G_6i7LOo.js +1 -0
- package/dist/client/assets/{useRouterState-DzqrXxOn.js → useRouterState-Y1aLUix_.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BhcYyKm_.js +1 -0
- package/dist/client/assets/{user-CaBRgHEo.js → user-CLXOG3Qm.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DjFtVOvp.js → view-mode-toggle-D_5X7-ae.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BayTAOpL.js → watch-sse-pool-rXavNycp.js} +1 -1
- package/dist/client/assets/{workflow-DIJr05qP.js → workflow-Bq61DMkg.js} +1 -1
- package/dist/client/assets/workflow-detail-BJvoV5gO.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +458 -458
- package/dist/server/migrate.js +95 -95
- package/dist/server/server.js +335 -335
- package/package.json +1 -1
- package/dist/client/assets/app-editor-C91DwP-X.js +0 -1
- package/dist/client/assets/buckets-Bx69Uuhs.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-CGrdlep9.js +0 -1
- package/dist/client/assets/page-seo-sheet-C7vZkIVX.js +0 -1
- package/dist/client/assets/project-app-view-JCtxsXyA.js +0 -1
- package/dist/client/assets/record-editor-CYAiRWSG.js +0 -1
- package/dist/client/assets/registry-CGWdwDoa.js +0 -2
- package/dist/client/assets/save-referenced-block-Cqd_M5sH.js +0 -1
- package/dist/client/assets/store-registry-DceSZztf.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BE7Sw7iZ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery--BKwSeAU.js +0 -1
- package/dist/client/assets/workflow-detail-BlQLBQHt.js +0 -1
package/dist/client/assets/{shell-route-loading-Vpy9ggBQ.js → shell-route-loading-BQp4nxMc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as N,c as K,j as s,l as Wt,r as O,t as Z,p as fe,b as Ce,T as _s,K as Vt,m as qt,f as Te,g as Ns,d as zn,I as Pn,U as Rn,W as Dn,P as En,R as Fn,H as Gn,G as Bn,a as Ln,B as $t,X as Hn,Y as Un,n as Ae,Z as Kn,$ as Wn,a0 as Vn,F as qn,a1 as Yn,a2 as Xn,a3 as Qn,a4 as Zn,a5 as xt,a6 as Jn,a7 as er,a8 as tr,a9 as sr,aa as nr,ab as rr,ac as Cs,ad as or,ae as ir,af as lr,ag as ar,ah as cr,ai as dr,aj as ur,ak as mr,al as fr,am as xr,an as hr,o as pr,E as ws}from"./index-AYOhbOh-.js";import{u as gr}from"./useRouterState-DzqrXxOn.js";import{c as br,i as jr,a as vr}from"./ZoomOut-DJZYHdrq.js";import{u as Xe,c as xe,d as ke,e as zt,f as Pt,g as $e,h as ks,i as Is,j as yr,k as Sr,l as Lt}from"./sidebar-jPzKrErD.js";import{T as we}from"./toolbar-nvslJ6se.js";import{u as Ms,T as We,a as Ve,b as qe,c as ts}from"./tooltip-B_bAE461.js";import{S as _e}from"./skeleton-BkBCJzvx.js";import{P as Rt,a as ut,b as Dt}from"./popover-qA5W_aO0.js";import{b as As,a as $s,D as Os}from"./drawer-Daco3mLi.js";import{i as Ts}from"./SearchMd-F8Lgigzr.js";import{s as _r}from"./Star01-Dq4t2HLY.js";import{s as Ne}from"./Plus-CcEwOgtq.js";import{i as Nr,g as Cr}from"./use-mcp-client-CY4k0WSm.js";import{a as zs,u as ht,b as wr}from"./use-virtual-mcp-XH9W6O_2.js";import{u as kr}from"./use-create-virtual-mcp-DkNKlR70.js";import{I as Ir,a as Mr,u as Ar,W as $r,H as Or,S as Tr,G as zr}from"./github-repo-picker-71D4tYUy.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Pr,_ as Rr,$ as Dr}from"./agent-icon-BbtDyEhK.js";import{u as Rs,d as Er,k as Ds}from"./tab-id-CqhjPWfe.js";import{r as Fr,a as Gr,R as Br,b as Lr,u as Es}from"./shell-layout-C_RGI19w.js";import{u as Hr,a as Ur,b as Kr,s as Wr,c as Vr,r as qr,d as Yr,e as Xr,f as Qr,p as Zr,T as Fs,g as Jr,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,S as rs,o as Gs}from"./use-navigate-to-agent-C3bIAWTD.js";import{A as os}from"./avatar-CzRJu4-e.js";import{i as Bs}from"./Check-DCL7RDuY.js";import{a as is}from"./Eye-BmvVeOF9.js";import{n as lo,i as ao}from"./Globe01-DoJKg1_O.js";import{i as co,a as Ls}from"./ZapSquare-Ds8_u3m3.js";import{i as uo}from"./Monitor01-DB396gYF.js";import{n as mo,a as fo}from"./Sun-Cr2yuAzo.js";import{a as pt}from"./Settings02-BIGqwL7C.js";import{i as xo}from"./Shield01-B9Q_1Xk7.js";import{a as ho}from"./Users03-D-uCbKBY.js";import{s as Hs}from"./XClose-DLTON1f7.js";import{f as po,a as go,b as bo,c as jo,d as vo,e as yo,A as So}from"./alert-dialog-B-uaEzoe.js";import{F as _o,a as No,b as Co,c as wo,d as ko,e as Io,f as Mo}from"./form-Bvy6rgyq.js";import{I as Ao}from"./input-DErmZhFg.js";import{S as $o}from"./spinner-fzT44PtT.js";import"./index-C5isfxFM.js";import{i as Oo,a as To}from"./RefreshCcw01-CCfli9l6.js";import{n as Yt}from"./Stars02-CQVglhpL.js";import{u as Us,A as Ks,g as zo,a as Po,b as ls,K as Ro,P as Do,s as Eo,S as Fo,v as Go,D as Bo,c as Lo,d as Ho,C as Uo}from"./sortable.esm-BxJf-B3h.js";import{i as Xt}from"./ChevronRight-OSZ9UQBS.js";import{i as Ko}from"./FilterLines-DdCr16DJ.js";import{t as Wo}from"./Users01-CUSYtOwa.js";import{b as as,c as Ws,S as cs,a as ds,d as us}from"./select-C-92em1q.js";import{b as Vo,c as qo,e as Yo,a as Xo,D as Qo}from"./dialog-DhPYQxKL.js";import{C as Zo,e as Jo,c as ei,d as ti,b as si}from"./command-CbVJYcLx.js";import{u as Vs}from"./studio-tools-D1zmoCWz.js";import{i as qs}from"./Zap-312eTZCV.js";import{u as ni}from"./use-org-auth-client-DVEzJXpD.js";import{H as ri,a as oi,b as ii}from"./hover-card-CWAzZxGp.js";import{g as li,S as ai}from"./task-status-BJtFNCHO.js";import{u as ci,f as di}from"./use-clock-tick-Cs4ksDbV.js";import{t as Ys}from"./ChevronDown-D-NGqiSH.js";function ui(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let h;e[14]!==f||e[15]!==g||e[16]!==x?(h=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=h):h=e[17];let v;return e[18]!==u||e[19]!==h?(v=s.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=v):v=e[20],v}const mi="Select an existing agent";function fi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{side:"right",sideOffset:8,children:mi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(qe,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function xi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=Ce.useSession();let r;t[0]!==n?.user?.email?(r=Vt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:hi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=qt(i);return a?.isDecoUser??!1}async function hi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function pi(t){const e=Te(),{create:n}=Rs(),{locator:r}=fe(),o=Ns({strict:!1}),i=zn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Fr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function gi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=a):a=e[8],a}function bi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=O.useState(""),l=zs(),{org:c}=fe(),{data:d}=Ce.useSession(),u=d?.user?.id??"anon",m=l.filter(yi).map(vi),f=Ur();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:p,isCreating:x}=kr(g),{createFromTemplate:h,isCreating:v}=Ar(),j=xi(),y=pi(c.slug),b=i.toLowerCase(),S=l.filter(ji).filter(le=>!i||le.title.toLowerCase().includes(b)),k=le=>{Kr({orgId:c.id,userId:u},le.id,m),f(),n(),a(""),y(le.id)},_="flex flex-col max-h-[min(640px,80dvh)]";let C;e[1]!==i?(C=s.jsx(ui,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=C):C=e[2];const I="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const P="grid grid-cols-3 gap-1";let $;e[4]!==p||e[5]!==n?($=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=$):$=e[6];let w,z;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ne,{size:16,className:"text-muted-foreground"})}),z=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=w,e[8]=z):(w=e[7],z=e[8]);let H;e[9]!==x||e[10]!==$?(H=s.jsxs("button",{type:"button",disabled:x,onClick:$,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[w,z]}),e[9]=x,e[10]=$,e[11]=H):H=e[11];let T;e[12]!==h||e[13]!==n?(T=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await h($r),n()},e[12]=h,e[13]=n,e[14]=T):T=e[14];let B,R;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(_r,{className:"size-5 text-muted-foreground"})}),R=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=B,e[16]=R):(B=e[15],R=e[16]);let L;e[17]!==v||e[18]!==T?(L=s.jsxs("button",{type:"button",disabled:v,onClick:T,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[B,R]}),e[17]=v,e[18]=T,e[19]=L):L=e[19];let D;e[20]!==h||e[21]!==n?(D=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await h(Or),n()},e[20]=h,e[21]=n,e[22]=D):D=e[22];let G,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Tr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=G,e[24]=F):(G=e[23],F=e[24]);let E;e[25]!==v||e[26]!==D?(E=s.jsxs("button",{type:"button",disabled:v,onClick:D,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[G,F]}),e[25]=v,e[26]=D,e[27]=E):E=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let V,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(zr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=V,e[32]=X):(V=e[31],X=e[32]);let re;e[33]!==W?(re=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[V,X]}),e[33]=W,e[34]=re):re=e[34];let Y;e[35]!==j||e[36]!==n||e[37]!==r?(Y=j&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=j,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=S.map(le=>s.jsx(gi,{agent:le,onClick:()=>k(le)},le.id));let q;e[39]!==H||e[40]!==L||e[41]!==E||e[42]!==re||e[43]!==Y||e[44]!==oe?(q=s.jsxs("div",{className:P,children:[H,L,E,re,Y,oe]}),e[39]=H,e[40]=L,e[41]=E,e[42]=re,e[43]=Y,e[44]=oe,e[45]=q):q=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==S.length?(J=S.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=x,e[47]=i,e[48]=S.length,e[49]=J):J=e[49];let Q;e[50]!==q||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:I,children:[A,q,J]}),e[50]=q,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Pn,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==C||e[63]!==se?(ie=s.jsxs("div",{className:_,children:[C,Q,se]}),e[61]=Q,e[62]=C,e[63]=se,e[64]=ie):ie=e[64],ie}function ji(t){return!Nr(t.id)}function vi(t){return t.id}function yi(t){return t.pinned}function Xs(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,a]=O.useState(!1),[l,c]=O.useState(!1),[d,u]=O.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Hr(),p=g?"border border-border":void 0;let x;e[2]!==g?(x=I=>g?s.jsx(fi,{children:I}):I,e[2]=g,e[3]=x):x=e[3];const h=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const j=v;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(_e,{className:"h-4 w-24"})}),children:s.jsx(bi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const b=y;let S;e[10]!==o||e[11]!==p||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==b||e[16]!==h?(S=m?s.jsxs(s.Fragment,{children:[o?h(s.jsx(we,{"aria-label":"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ne,{className:"size-4"})})):s.jsx(xe,{children:h(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),b]})})]}):s.jsxs(Rt,{open:i,onOpenChange:I=>{I&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),a(I)},children:[o?h(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(p),children:s.jsx(Ne,{className:"size-4"})})})):s.jsx(xe,{children:h(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:b})]}),e[10]=o,e[11]=p,e[12]=g,e[13]=m,e[14]=i,e[15]=b,e[16]=h,e[17]=S):S=e[17];let k;e[18]!==l?(k=s.jsx(Ir,{open:l,onOpenChange:c}),e[18]=l,e[19]=k):k=e[19];let _;e[20]!==d?(_=s.jsx(Mr,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let C;return e[22]!==S||e[23]!==k||e[24]!==_?(C=s.jsxs(s.Fragment,{children:[S,k,_]}),e[22]=S,e[23]=k,e[24]=_,e[25]=C):C=e[25],C}function Qs(){const t=N.c(24),{org:e}=fe(),n=Te(),o=gr().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(br,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const g=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(jr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let h;t[11]!==n||t[12]!==i?(h=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=h):h=t[13];let v;t[14]!==x||t[15]!==h?(v={key:"files",label:"Library",icon:p,isActive:x,onClick:h},t[14]=x,t[15]=h,t[16]=v):v=t[16];const j=v;let y;t[17]!==j||t[18]!==g?(y={type:"items",items:[g,j]},t[17]=j,t[18]=g,t[19]=y):y=t[19];let b;if(t[20]!==c||t[21]!==y){if(b=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Xs,{})})})})},t[23]=S):S=t[23],b.push(S)}t[20]=c,t[21]=y,t[22]=b}else b=t[22];return b}function Ot(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Rn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Zs(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Js(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(xe,{className:d,children:m},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Si(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ks,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ni),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Zs,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(_i),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function _i(t){return s.jsx(Js,{item:t},t.key)}function Ni(t){return s.jsx(Js,{item:t},t.key)}function Ci(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(wi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Is,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==l?(f=s.jsxs(yr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function wi(t,e){return s.jsx(Si,{section:t},e)}function en(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ci,{...t}),e[0]=t,e[1]=n):n=e[1],n}en.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(_e,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ki(){const t=N.c(7),n=_s().logo??Dn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(Sr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(xe,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function Ii(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ks,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let a;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Zs,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Mi(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(ki,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(Ii,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ai=En({name:Fn().min(2,"Organization name is required")});function $i(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Gn(Ai),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Bn(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Ti,onSuccess:Oi},e[1]=a):a=e[1];const l=Ln(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(bo,{children:[s.jsx(jo,{children:"Create a new organization"}),s.jsx(vo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=C=>l.mutateAsync(C),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:C}=_;return s.jsxs(Co,{children:[s.jsx(wo,{children:"Organization Name"}),s.jsx(ko,{children:s.jsx(Ao,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Io,{children:"The name of your company or organization"}),C.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",tn(C.value)]})]}),s.jsx(Mo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(_o,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let p;e[15]!==l||e[16]!==i?(p=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(po,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const h=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx($o,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let j;e[23]!==h||e[24]!==v?(j=s.jsx($t,{type:"submit",variant:"default",disabled:h,children:v}),e[23]=h,e[24]=v,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(yo,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let b;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(b=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=b):b=e[33];let S;e[34]!==i||e[35]!==b?(S=s.jsxs(go,{children:[d,s.jsx(No,{...i,children:b})]}),e[34]=i,e[35]=b,e[36]=S):S=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==S?(k=s.jsx(So,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=k):k=e[40],k}function Oi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ti(t){const e=tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ce.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Ht(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function zi(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Vn();let a;e[0]!==n?(a=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=O.useState(!1),[u,m]=O.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let p;e[2]!==c?(p=function(){c&&m(""),d(Pi)},e[2]=c,e[3]=p):p=e[3];const x=p;let h;e[4]!==u||e[5]!==c||e[6]!==x?(h=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=h):h=e[7];let v;e[8]!==c?(v=c?s.jsx(Hs,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let j;e[10]!==v||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:v}),e[10]=v,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{size:16}),e[13]=y):y=e[13];let b;e[14]!==o?(b=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=b):b=e[15];let S;e[16]!==j||e[17]!==b?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,b]}),e[16]=j,e[17]=b,e[18]=S):S=e[18];let k;e[19]!==h||e[20]!==S?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[h,S]}),e[19]=h,e[20]=S,e[21]=k):k=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",C=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let I;e[22]!==r||e[23]!==n?(I=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(zi,{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(Bs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=I):I=e[24];const A=g.map(I);let P;e[25]!==C||e[26]!==A?(P=s.jsxs("div",{className:_,children:[C,A]}),e[25]=C,e[26]=A,e[27]=P):P=e[27];let $;return e[28]!==P||e[29]!==k?($=s.jsxs(s.Fragment,{children:[k,P]}),e[28]=P,e[29]=k,e[30]=$):$=e[30],$}function Pi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:p}=t;if(g){const q=n?.name??"U";let J;e[0]!==q||e[1]!==r?(J=s.jsx(os,{url:r,fallback:q,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=q,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Fi)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(is,{size:14}),e[12]=Ie):Ie=e[12];let ze;e[13]!==le?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let he;e[16]!==ze?(he=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[ze,Pe]})}),e[16]=ze,e[17]=he):he=e[17];let Re;e[18]!==he||e[19]!==J||e[20]!==ie?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Re):Re=e[21];const mt=String(p);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],Ee=o.map(de),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let de;e[45]!==l.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=l.theme,e[46]=c,e[47]=de):de=e[47],Ge=a.map(de),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Ei),e[50]=c,e[51]=be):be=e[51];const je=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==l.enableSounds?(pe=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.4"]}),e[61]=Be):Be=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Be]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==ve?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,ve]}),e[67]=Re,e[68]=Fe,e[69]=ve,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let h;e[71]!==x||e[72]!==r?(h=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=h):h=e[73];const v=n?.name??"User";let j;e[74]!==v?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=j):j=e[75];const y=n?.email;let b;e[76]!==y?(b=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=b):b=e[77];let S;e[78]!==j||e[79]!==b?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,b]}),e[78]=j,e[79]=b,e[80]=S):S=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Di)},e[81]=n,e[82]=k):k=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let C;e[84]!==k?(C=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=k,e[85]=C):C=e[85];let I;e[86]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=I):I=e[86];let A;e[87]!==C?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[C,I]})}),e[87]=C,e[88]=A):A=e[88];let P;e[89]!==A||e[90]!==h||e[91]!==S?(P=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,S,A]}),e[89]=A,e[90]=h,e[91]=S,e[92]=P):P=e[92];let $;if(e[93]!==f||e[94]!==o){let q;e[96]!==f?(q=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=q):q=e[97],$=o.map(q),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let z;e[101]!==$||e[102]!==w?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,w]}),e[101]=$,e[102]=w,e[103]=z):z=e[103];let H;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let q;e[108]!==l.theme||e[109]!==c?(q=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=l.theme,e[109]=c,e[110]=q):q=e[110],H=a.map(q),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=H}else H=e[107];let T;e[111]!==H?(T=s.jsx("div",{className:"flex items-center gap-0.5",children:H}),e[111]=H,e[112]=T):T=e[112];const B=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ri),e[113]=c,e[114]=R):R=e[114];const L=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==L?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",L),e[115]=L,e[116]=D):D=e[116];let G;e[117]!==l.enableSounds?(G=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=G):G=e[118];let F;e[119]!==B||e[120]!==R||e[121]!==D||e[122]!==G?(F=s.jsx("button",{type:"button","aria-label":B,onClick:R,className:D,children:G}),e[119]=B,e[120]=R,e[121]=D,e[122]=G,e[123]=F):F=e[123];let E;e[124]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.4"]}),e[124]=E):E=e[124];let W;e[125]!==F?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[125]=F,e[126]=W):W=e[126];let V;e[127]!==T||e[128]!==W?(V=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[T,W]}),e[127]=T,e[128]=W,e[129]=V):V=e[129];let X;e[130]!==P||e[131]!==z||e[132]!==V?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[P,z,V]}),e[130]=P,e[131]=z,e[132]=V,e[133]=X):X=e[133];const re=String(p);let Y;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},re)}),e[134]=m,e[135]=u,e[136]=d,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Ri(t){return{...t,enableSounds:!t.enableSounds}}function Di(){Ae.success("User ID copied")}function Ei(t){return{...t,enableSounds:!t.enableSounds}}function Fi(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=Ce.useSession(),{org:n}=fe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Hn(o)?.params.org,[l,c]=Un(),d=Ms(),[u,m]=O.useState(!1),[f,g]=O.useState(!1),p=e?.user,x=p?.image;let h;t[1]!==r?(h=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=h):h=t[2];const v=h;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let b;t[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(pt,{size:16}),t[4]=b):b=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:b,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(lo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(vr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(xo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=C):C=t[12];let I;t[13]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(Kn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=I):I=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(ho,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P={key:"homepage",label:"Homepage",icon:s.jsx(ao,{size:16}),href:"https://decocms.com",external:!0},t[15]=P):P=t[15];let $;t[16]!==S||t[17]!==k?($=[S,...k,_,C,I,A,P],t[16]=S,t[17]=k,t[18]=$):$=t[18];const w=$;let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(co,{size:16}),onClick:Bi},t[19]=z):z=t[19];const H=z;let T;t[20]===Symbol.for("react.memo_cache_sentinel")?(T={value:"light",icon:s.jsx(mo,{size:14}),label:"Light theme"},t[20]=T):T=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B={value:"dark",icon:s.jsx(fo,{size:14}),label:"Dark theme"},t[21]=B):B=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[T,B,{value:"system",icon:s.jsx(uo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const L=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let G;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==p||t[32]!==x?(G={user:p,userImage:x,menuItems:w,signOutItem:H,themeOptions:L,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=p,t[32]=x,t[33]=G):G=t[33];const F=G;let E;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==F?(E=d?s.jsxs(As,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...F})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Gi,children:s.jsx(xs,{...F})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=F,t[38]=E):E=t[38];let W;t[39]!==f?(W=s.jsx($i,{open:f,onOpenChange:g}),t[39]=f,t[40]=W):W=t[40];let V;return t[41]!==E||t[42]!==W?(V=s.jsxs(s.Fragment,{children:[E,W]}),t[41]=E,t[42]=W,t[43]=V):V=t[43],V}function Gi(t){return t.preventDefault()}function Bi(){Z("signed_out",{source:"account_popover"}),Wn(),Ce.signOut()}function Li({invitation:t}){const[e,n]=O.useState(!1),[r,o]=O.useState(!1),i=qn(),a=async()=>{n(!0);try{const d=await Ce.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),Yn();let c;try{c=(await Ce.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Ce.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Bs,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Hs,{size:14})})]})]})}function Hi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Ui(){const t=O.useContext(Xn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function sn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Gr(),o=Ui();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Vi).map(Wi);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Br].sort(Ki).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ki(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Wi(t){return{type:"invitation",invitation:t}}function Vi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class nn extends O.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 rn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function qi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let a;t[2]!==o?(a=K(o!=null&&rn(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Yi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(qi,{})})}),t[0]=e):e=t[0],e}function Xi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&rn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(Ve,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(qe,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Qi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function on(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=sn(),[i,a]=O.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=h=>h.type==="release"&&h.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(Oo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Lr,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Yt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Li,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Hi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=g):g=e[11];let p;return e[12]!==n||e[13]!==g?(p=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=p):p=e[14],p}function ln(){const{redDotCount:t}=sn();return t>0}function Zi(){const t=N.c(6),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(on,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ji(){const t=N.c(8),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(we,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(on,{children:s.jsxs(qe,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function el(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Ls,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(qe,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Ls,{className:"size-4"})})}),s.jsx(Ve,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function sl(){const t=N.c(7),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function nl(){const t=N.c(9),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ve,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(qe,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function rl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Yi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(el,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(Zi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(sl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(xe,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),s.jsx(nl,{}),s.jsx(Ji,{}),s.jsx(tl,{}),s.jsx(Qi,{})]})}),t[5]=r):r=t[5],r}function ol(){const t=N.c(8),e=Te(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function il(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(ll,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(qs,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ll(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function al(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=O.useState(""),{org:a}=fe(),{setTaskId:l}=Es(),c=Vs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=qt,d=Vt.globalSearch(a.id,m),e[0]=a.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==g?(p={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=p):p=e[11];const{data:x,isFetching:h}=u(p);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const j=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const b=y;let S;e[16]!==b||e[17]!==l?(S=w=>{b(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=b,e[17]=l,e[18]=S):S=e[18];const k=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Vo,{className:"sr-only",children:[s.jsx(qo,{children:"Search"}),s.jsx(Yo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let C;e[20]!==o?(C=s.jsx(ei,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=C):C=e[21];let I;e[22]!==k||e[23]!==h||e[24]!==j||e[25]!==m?(I=m?h&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Zo,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(Jo,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(il,{virtualMcpId:w.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=h,e[24]=j,e[25]=m,e[26]=I):I=e[26];let A;e[27]!==I?(A=s.jsx(ti,{children:I}),e[27]=I,e[28]=A):A=e[28];let P;e[29]!==C||e[30]!==A?(P=s.jsxs(Xo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(si,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[C,A]})]}),e[29]=C,e[30]=A,e[31]=P):P=e[31];let $;return e[32]!==b||e[33]!==n||e[34]!==P?($=s.jsx(Qo,{open:n,onOpenChange:b,children:P}),e[32]=b,e[33]=n,e[34]=P,e[35]=$):$=e[35],$}function cl(t){return t==="owner"||t==="admin"}function dl(){const t=N.c(11),{locator:e}=fe(),n=ni(),{data:r}=Ce.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Vt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=qt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=cl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[ul]=or(Qt,[Cs]),ce=Cs(),[ml,an]=ul(Qt),cn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=O.useState(!1),c=ce(e),d=nr(r),u=O.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ml,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(rr,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};cn.displayName=Qt;var dn="ContextMenuTrigger",un=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=an(dn,n),a=ce(n),l=O.useRef({x:0,y:0}),c=O.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=O.useRef(0),u=O.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return O.useEffect(()=>u,[u]),O.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Qn,{...a,virtualRef:c}),s.jsx(Zn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});un.displayName=dn;var fl="ContextMenuPortal",mn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(tr,{...r,...n})};mn.displayName=fl;var fn="ContextMenuContent",xn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=an(fn,n),i=ce(n),a=O.useRef(!1);return s.jsx(sr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xn.displayName=fn;var xl="ContextMenuGroup",hl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ir,{...o,...r,ref:e})});hl.displayName=xl;var pl="ContextMenuLabel",gl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});gl.displayName=pl;var bl="ContextMenuItem",hn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(Jn,{...o,...r,ref:e})});hn.displayName=bl;var jl="ContextMenuCheckboxItem",vl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});vl.displayName=jl;var yl="ContextMenuRadioGroup",Sl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});Sl.displayName=yl;var _l="ContextMenuRadioItem",Nl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});Nl.displayName=_l;var Cl="ContextMenuItemIndicator",wl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});wl.displayName=Cl;var kl="ContextMenuSeparator",pn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=kl;var Il="ContextMenuArrow",Ml=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Ml.displayName=Il;var Al="ContextMenuSubTrigger",$l=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});$l.displayName=Al;var Ol="ContextMenuSubContent",Tl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Tl.displayName=Ol;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zl=cn,Pl=un,Rl=mn,Dl=xn,El=hn,Fl=pn;function gn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(zl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function bn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Pl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Rl,{children:s.jsx(Dl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(El,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Fl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ne,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let p;e[10]!==f?(p=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Pr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let h;e[17]!==r||e[18]!==c||e[19]!==n?(h=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(To,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=h):h=e[20];let v;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==h?(v=s.jsxs(s.Fragment,{children:[m,p,x,h]}),e[21]=m,e[22]=p,e[23]=x,e[24]=h,e[25]=v):v=e[25],v}function Gl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=li(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=zo(f),e[0]=f,e[1]=g):g=e[1];const p=g;ci(6e4);const x=a||!!n.trigger_id,h=n.id,v="button",j=0;let y;e[2]!==o?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const b=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==b?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",b),e[4]=b,e[5]=S):S=e[5];let k;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(k=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=k):k=e[10];let _;e[11]!==x?(_=x&&s.jsx(qs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const C=n.title||"Untitled task";let I;e[13]!==C?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=I):I=e[14];let A;e[15]!==I||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,I]}),e[15]=I,e[16]=_,e[17]=A):A=e[17];let P;e[18]!==p||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(P=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Gl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[p.owner,"/",p.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:di(new Date(n.updated_at))})]}),e[18]=p,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=P):P=e[22];let $;e[23]!==A||e[24]!==P?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,P]}),e[23]=A,e[24]=P,e[25]=$):$=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",z=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let H;e[26]!==i?(H=F=>{F.stopPropagation(),i()},e[26]=i,e[27]=H):H=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(hr,{size:14}),e[28]=T):T=e[28];let B;e[29]!==H?(B=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:T})}),e[29]=H,e[30]=B):B=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ve,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let L;e[32]!==B?(L=s.jsxs(qe,{children:[B,R]}),e[32]=B,e[33]=L):L=e[33];let D;e[34]!==z||e[35]!==L?(D=s.jsxs("div",{className:w,children:[z,L]}),e[34]=z,e[35]=L,e[36]=D):D=e[36];let G;return e[37]!==o||e[38]!==$||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==k||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":h,role:v,tabIndex:j,onClick:o,onKeyDown:y,className:S,children:[k,$,D]}),e[37]=o,e[38]=$,e[39]=D,e[40]=y,e[41]=S,e[42]=k,e[43]=n.id,e[44]=G):G=e[44],G}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const yn=4;let At=0;const Kt=[];function Hl(){for(;At<yn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function Sn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Hl()})};At<yn?r():Kt.push(r)})}const Ft=10;function ps(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Ul(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Ul(t,e,n,r)}function Kl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Wl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function Vl(t,e){return e===!1?!1:e===!0?!0:t}function Jt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Tt=new Map,Mt=new Map;function ql(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Yl(t,e){Tt.set(t,e)}function Xl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=Sn(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ql(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=fe(),a=Bl(i.id,t,e,n);let l;o[0]!==n?(l=Ll(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=O.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Er(),{threads:f,hasMore:g}=Ds(),p=r??Bt(f,t,e,n),x=Wl(p,g),h=ql(p,g),v=Vs();if(d.identity===a&&d.serverHasMore===null){const _=h??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&h===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Xl(a,async()=>{const _=ps(t,e,0,n,1),C=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:I}=js(C),A=Bt(m.threads.get(),t,e,n);return I===void 0?!1:gs(A,I)},_=>{u(C=>C.identity!==a?C:{...C,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const C=a;u(I=>I.identity===C?{...I,isFetching:!0}:I);try{const I=Bt(f,t,e,n),A=ps(t,e,I,n,Ft),P=await Sn(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:w,totalCount:z}=js(P),H=new Set(f.map(Zl)),T=Ql($,H,t,e,n),B=I;m.mergeThreads($),u(R=>{if(R.identity!==C)return R;let L;return z!==void 0?L=gs(B+T,z):L=$.length===0||T===0?!1:w,Yl(C,L),{...R,isFetching:!1,serverHasMore:L}})}catch(I){const A=I,P=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${P}`),u($=>$.identity===C?{...$,isFetching:!1}:$)}},b=d.isFetching||d.isProbing,S=!c&&!b&&Vl(x,d.serverHasMore);let k;return o[2]!==b||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:S,isFetching:b,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=b,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function Zl(t){return t.id}function _n(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:p,groupVisibleCount:x}=t,h=m===void 0?!1:m,v=f===void 0?!1:f,j=ht(n),y=r[0];let b;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(b=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=b):b=e[4];const S=b,k=p?.isDragging?!1:void 0;let _;e[5]!==p?.isDragging||e[6]!==n?(_=q=>{p?.isDragging||q&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=_):_=e[7];const C=!!(y&&o&&y.id===o),I=p?"Drag to reorder":void 0;let A;e[8]!==p?(A=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=A):A=e[9];const P=p&&"cursor-pointer active:cursor-grabbing touch-none",$=p?.isDragging&&"cursor-grabbing";let w;e[10]!==$||e[11]!==P?(w=K("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",P,$),e[10]=$,e[11]=P,e[12]=w):w=e[12];const z=j?.icon??null,H=j?.title??"?";let T;e[13]!==z||e[14]!==H?(T=s.jsx(Oe,{icon:z,name:H,size:"sm+",className:"rounded-lg"}),e[13]=z,e[14]=H,e[15]=T):T=e[15];let B;e[16]!==S||e[17]!==w||e[18]!==T||e[19]!==C||e[20]!==I||e[21]!==A?(B=s.jsx(xe,{children:s.jsx(bn,{asChild:!0,children:s.jsx(ri,{asChild:!0,children:s.jsx(ke,{onClick:S,isActive:C,title:I,...A,className:w,children:T})})})}),e[16]=S,e[17]=w,e[18]=T,e[19]=C,e[20]=I,e[21]=A,e[22]=B):B=e[22];const R=g??Jl;let L;e[23]!==v||e[24]!==h||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(L=s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=h,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=L):L=e[30];let D;e[31]!==B||e[32]!==L?(D=s.jsxs(gn,{children:[B,L]}),e[31]=B,e[32]=L,e[33]=D):D=e[33];const G=j?.title??"Agent";let F;e[34]!==G?(F=s.jsx("span",{className:"truncate",children:G}),e[34]=G,e[35]=F):F=e[35];let E;e[36]!==c||e[37]!==n?(E=()=>c(n),e[36]=c,e[37]=n,e[38]=E):E=e[38];let W;e[39]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:14}),e[39]=W):W=e[39];let V;e[40]!==E?(V=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:W}),e[40]=E,e[41]=V):V=e[41];let X;e[42]!==F||e[43]!==V?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[F,V]}),e[42]=F,e[43]=V,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(re=s.jsx(ea,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(oi,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==D||e[57]!==Y||e[58]!==k||e[59]!==_?(oe=s.jsxs(ii,{open:k,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,Y]}),e[56]=D,e[57]=Y,e[58]=k,e[59]=_,e[60]=oe):oe=e[60],oe}function Jl(){}function ea(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ta(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Eo},l[1]=u):u=l[1];const m=Po(ls(Do,d),ls(Ro,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=Wr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let p;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(p=v=>{const{active:j,over:y}=v;if(!y||j.id===y.id)return;const b=String(j.id),S=String(y.id);if(!Vr(b,S,o))return;const k=qr(g,b,S),_=Yr(e,n,o,k);e==="org"?Xr(n.orgId,_):Qr(n,_),Z("sidebar_group_reordered",{virtual_mcp_id:b,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=p):p=l[13];const x=p;let h;return l[14]!==x||l[15]!==m||l[16]!==g?(h={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=h):h=l[17],h}function sa(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function na(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Ho(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Uo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:p}=ta(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let h;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=b=>{const S=d(b);return g.includes(b.virtualMcpId)?s.jsx(na,{id:b.virtualMcpId,children:k=>{const{setNodeRef:_,style:C,isDragging:I,attributes:A,listeners:P}=k;return s.jsx("div",{ref:_,style:C,className:K(I&&"opacity-50"),children:u(S,{attributes:A,listeners:P,isDragging:I})})}},b.virtualMcpId):s.jsx("div",{children:m(S)},b.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],h=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=h}else h=e[5];let v;e[11]!==x||e[12]!==h?(v=s.jsx(Fo,{items:x,strategy:Go,children:h}),e[11]=x,e[12]=h,e[13]=v):v=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==v?(j=s.jsx(Bo,{sensors:f,collisionDetection:Lo,onDragEnd:p,children:v}),e[14]=p,e[15]=f,e[16]=v,e[17]=j):j=e[17],j}function Nn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:p,user:x,toolCallRuns:h}=Zr(n,o,i),v=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=j):j=e[19];const y=j;let b;e[20]!==c||e[21]!==v?(b=v&&s.jsx(sa,{collapsed:c}),e[20]=c,e[21]=v,e[22]=b):b=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:p,...y}),b,s.jsx(vs,{section:"user",groups:x,...y}),h&&m(d(h))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function ra(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:ia,renderSortable:oa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function oa(t,e){return s.jsx(_n,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function ia(t){return s.jsx(_n,{...t},t.virtualMcpId)}const la="sidebar.group.expanded.";function Cn(t,e){const n=N.c(3),[r,o]=pr(`${la}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function wn(t){const e=N.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:p,sortable:x}=t,h=u===void 0?!1:u,v=m===void 0?!1:m,[j,y]=Cn(n,!1),b=n===Fs,S=x?.isDragging??!1;let k;e[0]!==j||e[1]!==y?(k=function(){y(!j)},e[0]=j,e[1]=y,e[2]=k):k=e[2];const _=k;let C;e[3]!==b||e[4]!==x?(C=x&&!b?{...x.attributes,...x.listeners}:{},e[3]=b,e[4]=x,e[5]=C):C=e[5];let I;e[6]!==_?(I=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),_())},e[6]=_,e[7]=I):I=e[7];const A=x&&!b&&"touch-none active:cursor-grabbing",P=S&&"shadow-md bg-accent/40 cursor-grabbing";let $;e[8]!==A||e[9]!==P?($=K("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",A,P),e[8]=A,e[9]=P,e[10]=$):$=e[10];let w;e[11]!==b||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(ca,{virtualMcpId:n,isToolCallRuns:b})}),e[11]=b,e[12]=n,e[13]=w):w=e[13];let z;e[14]!==j?(z=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:j?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[14]=j,e[15]=z):z=e[15];let H;e[16]!==z||e[17]!==w?(H=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,z]}),e[16]=z,e[17]=w,e[18]=H):H=e[18];let T;e[19]!==b||e[20]!==n?(T=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ua,{virtualMcpId:n,isToolCallRuns:b})}),e[19]=b,e[20]=n,e[21]=T):T=e[21];let B;e[22]!==b||e[23]!==l||e[24]!==n?(B=!b&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E=>{E.stopPropagation(),l(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ne,{size:14})}),e[22]=b,e[23]=l,e[24]=n,e[25]=B):B=e[25];let R;e[26]!==j||e[27]!==_||e[28]!==H||e[29]!==T||e[30]!==B||e[31]!==C||e[32]!==I||e[33]!==$?(R=s.jsxs("div",{...C,role:"button",tabIndex:0,"aria-expanded":j,onClick:_,onKeyDown:I,className:$,children:[H,T,B]}),e[26]=j,e[27]=_,e[28]=H,e[29]=T,e[30]=B,e[31]=C,e[32]=I,e[33]=$,e[34]=R):R=e[34];const L=R;let D;e[35]!==v||e[36]!==L||e[37]!==h||e[38]!==b||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=b?L:s.jsxs(gn,{children:[s.jsx(bn,{asChild:!0,children:L}),s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??aa,onHideGroup:d})})]}),e[35]=v,e[36]=L,e[37]=h,e[38]=b,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let G;e[45]!==o||e[46]!==j||e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(G=j&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:b?r.map(E=>s.jsx(Et,{task:E,isActive:o===E.id,onClick:()=>i(E),onArchive:()=>a(E),showAutomationBadge:!!E.trigger_id},E.id)):s.jsx(fa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:p})}),e[45]=o,e[46]=j,e[47]=g,e[48]=p,e[49]=b,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=G):G=e[55];let F;return e[56]!==D||e[57]!==G?(F=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,G]}),e[56]=D,e[57]=G,e[58]=F):F=e[58],F}function aa(){}function ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(da,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function da(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ua(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ma,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ma(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function fa(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:p}=u,[x,h]=O.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(h(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let j;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ne,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function xa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,p]=O.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==a||e[7]!==i?(j=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let h;e[9]!==m||e[10]!==c||e[11]!==u?(h=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=h):h=e[12];let v;return e[13]!==x||e[14]!==h?(v=s.jsxs(s.Fragment,{children:[x,h]}),e[13]=x,e[14]=h,e[15]=v):v=e[15],v}function ha(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ai[n],d=c.icon,[u,m]=Cn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const g=f;let p;e[3]!==g?(p=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let h;e[8]!==u?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=h):h=e[9];let v;e[10]!==x||e[11]!==h?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,h]}),e[10]=x,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let b;e[17]!==u||e[18]!==g||e[19]!==p||e[20]!==v||e[21]!==j||e[22]!==y?(b=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,j,y]}),e[17]=u,e[18]=g,e[19]=p,e[20]=v,e[21]=j,e[22]=y,e[23]=b):b=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let k;return e[32]!==b||e[33]!==S?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b,S]}),e[32]=b,e[33]=S,e[34]=k):k=e[34],k}function pa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ba,renderSortable:ga}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ga(t,e){return s.jsx(wn,{...t,sortable:e},t.virtualMcpId)}function ba(t){return s.jsx(wn,{...t},t.virtualMcpId)}function ja(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function va(t,e,n,r,o){const i=N.c(5),a=ja(t,e,r,o),[l,c]=O.useState("");l!==a&&(Jr(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=eo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const kn={all:"All tasks",manual:"Chats",automation:"Automation"},In={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function Mn(){const t=N.c(92),{data:e}=Ce.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Cr(o.id).id,l=zs().filter($a).map(Aa),c=dl(),d=wr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=O.useState(u),g=new Set(l),p={},x=[];let h;t[1]!==m?(h=Object.entries(m),t[1]=m,t[2]=h):h=t[2];for(const[M,U]of h)g.has(M)!==U?p[M]=U:x.push(M);x.length>0&&f(M=>{const U={...M};for(const ne of x)delete U[ne];return U});const v=new Set(l);for(const[M,U]of Object.entries(p))U?v.add(M):v.delete(M);const j=[...v],y=new Set(j),{threads:b}=Ds(),S=b.filter(Ma),{hide:k}=Rs(),_=Te(),{setTaskId:C,createNewTask:I}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const $=Ns(A).taskId??null,w=[...S].sort(Ia),[z,H]=O.useState("all"),[T,B]=O.useState("mine"),[R,L]=O.useState("agent"),[D,G]=O.useState(!1),[F,E]=O.useState(!1),[W,V]=O.useState(0),X=to(),re=W+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,q={type:z,member:T,currentUserId:n??null},J=Kl(w,"agent",q),Q=va(oe,so(w,i),i,j,re);let ee;t[7]!==n||t[8]!==T?(ee=M=>T==="mine"&&n?M.filter(U=>U.created_by===n):M,t[7]=n,t[8]=T,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==z?(se=M=>z==="automation"?M.filter(ka):z==="manual"?M.filter(wa):M,t[10]=z,t[11]=se):se=t[11];const ie=se,le=M=>{const U=M.id===$;if(k(M.id),!U)return;const ne=w.find(Se=>Se.id!==M.id&&Se.virtual_mcp_id===M.virtual_mcp_id);ne?C(ne.id,ne.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==I?(Ie=M=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:M}),I(M)},t[12]=I,t[13]=Ie):Ie=t[13];const ze=Ie,Pe=no();let he;t[14]!==Pe?(he=M=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=he):he=t[15];const Re=he,mt=M=>{if(y.has(M))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:M});const U=Q.find(ne=>ne.virtualMcpId===M);if(U)for(const ne of U.threads)k(ne.id);oo(oe,M,j),V(Ca)},De=async(M,U)=>{if(c&&p[M]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:U}),f(ne=>({...ne,[M]:U}));try{await d.update.mutateAsync({id:M,data:{pinned:U}})}catch{io(oe,M,!U),f(ne=>{const Se={...ne};return delete Se[M],Se})}}},Ee=M=>{const U=M===i||M===Fs;return{isOrgPinned:y.has(M),canManageOrgPin:U?!1:c,onToggleOrgPin:U?void 0:De}},Me=M=>{const U=ie(te(M.threads));return{virtualMcpId:M.virtualMcpId,threads:U,activeTaskId:$,filters:q,groupVisibleCount:J.get(M.virtualMcpId)??0,onSelectTask:ne=>C(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=z!=="all"||T!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=On=>{const Tn=ie(te(On.threads));return!(ae&&Tn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],M=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=M}else M=t[20];const U=M,ne=R==="agent"&&Q.length===0;let Se;t[25]!==ne?(Se=s.jsx(rs,{value:ne}),t[25]=ne,t[26]=Se):Se=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>V(Na),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[Se,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ra,{groups:U,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=R==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(rs,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==G?(ue=()=>{Z("tasks_panel_search_opened"),E(!0),G(!0)},t[30]=G,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Rr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Be=ys[R==="agent"?"status":"agent"];let ge;t[35]!==Be?(ge=Be.toLowerCase(),t[35]=Be,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Le=ys[R];let de;t[37]!==Le?(de=Le.toLowerCase(),t[37]=Le,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==R?(ye=()=>{const M=R==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:M}),L(M)},Ue=R==="agent"?s.jsx(Wo,{size:16}):s.jsx(Dr,{size:16}),t[39]=R,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Ko,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==T?(et=M=>{const U=M;U!==T&&Z("tasks_panel_member_filter_changed",{to_value:U}),B(U)},t[52]=T,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(In),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(_a)}),t[56]=jt):jt=t[56];let tt;t[57]!==T||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:T,onValueChange:et,children:[gt,jt]})}),t[57]=T,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==z?(st=M=>{const U=M;U!==z&&Z("tasks_panel_filter_changed",{to_value:U}),H(U)},t[60]=z,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(kn),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(Sa)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==z?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:z,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=z,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Xs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const $n="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:ro(ie(te(w))).map(M=>s.jsx(ha,{status:M.status,threads:M.threads,activeTaskId:$,onSelectTask:U=>C(U.id,U.virtual_mcp_id),onArchiveTask:le,filters:q},M.status))}):s.jsx(pa,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:()=>V(ya),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:$n,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==F||t[84]!==D||t[85]!==G?(ct=F&&s.jsx(al,{open:D,onOpenChange:G}),t[83]=F,t[84]=D,t[85]=G,t[86]=ct):ct=t[86];let Nt;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function ya(t){return t+1}function Sa(t){return s.jsx(Ws,{value:t,children:kn[t]},t)}function _a(t){return s.jsx(Ws,{value:t,children:In[t]},t)}function Na(t){return t+1}function Ca(t){return t+1}function wa(t){return!t.trigger_id}function ka(t){return!!t.trigger_id}function Ia(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ma(t){return!t.hidden}function Aa(t){return t.id}function $a(t){return t.pinned}function Ss(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Oa=5,Ta=[{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 An(){const t=N.c(3),{state:e}=Xe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Oa}).map(Ra)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"})]}),s.jsx(_e,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Ta.map(za)})]}),t[2]=r):r=t[2],r}function za(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(_e,{className:"size-5 rounded-full shrink-0"}),s.jsx(_e,{className:K("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Pa)})]},e)}function Pa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(_e,{className:"h-3 flex-1 rounded-sm"})},e)}function Ra(t,e){return s.jsx(_e,{className:"size-10 rounded-lg mx-auto"},e)}function Pc(){const t=N.c(4),e=Qs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(rl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Gs,{children:s.jsx(en,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Rc(t){const e=N.c(5),{onClose:n}=t,r=Qs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ol,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Gs,{children:s.jsx(Mi,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function Dc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{bn as C,Pc as S,Rc as a,Dc as b,It as c,hs as d,jn as e,gn as f};
|
|
1
|
+
import{e as N,c as K,j as s,l as Wt,r as O,t as Z,p as fe,b as Ce,T as _s,K as Vt,m as qt,f as Te,g as Ns,d as zn,I as Pn,U as Rn,W as Dn,P as En,R as Fn,H as Gn,G as Bn,a as Ln,B as $t,X as Hn,Y as Un,n as Ae,Z as Kn,$ as Wn,a0 as Vn,F as qn,a1 as Yn,a2 as Xn,a3 as Qn,a4 as Zn,a5 as xt,a6 as Jn,a7 as er,a8 as tr,a9 as sr,aa as nr,ab as rr,ac as Cs,ad as or,ae as ir,af as lr,ag as ar,ah as cr,ai as dr,aj as ur,ak as mr,al as fr,am as xr,an as hr,o as pr,E as ws}from"./index-Dv-yFpKM.js";import{u as gr}from"./useRouterState-Y1aLUix_.js";import{c as br,i as jr,a as vr}from"./ZoomOut-BkCtUzuC.js";import{u as Xe,c as xe,d as ke,e as zt,f as Pt,g as $e,h as ks,i as Is,j as yr,k as Sr,l as Lt}from"./sidebar-nhuTSqFS.js";import{T as we}from"./toolbar-CCipnjie.js";import{u as Ms,T as We,a as Ve,b as qe,c as ts}from"./tooltip-DyNW-AXf.js";import{S as _e}from"./skeleton-DcZkQ-WQ.js";import{P as Rt,a as ut,b as Dt}from"./popover-BneLTlXE.js";import{b as As,a as $s,D as Os}from"./drawer-CiKI2xvg.js";import{i as Ts}from"./SearchMd-2GibIebB.js";import{s as _r}from"./Star01-BVQUiqS1.js";import{s as Ne}from"./Plus-DcxLSicT.js";import{i as Nr,g as Cr}from"./use-mcp-client-C8ZwZB20.js";import{a as zs,u as ht,b as wr}from"./use-virtual-mcp-DLQJqd7d.js";import{u as kr}from"./use-create-virtual-mcp-DTGwia7F.js";import{I as Ir,a as Mr,u as Ar,W as $r,H as Or,S as Tr,G as zr}from"./github-repo-picker-D-39cmmm.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Pr,_ as Rr,$ as Dr}from"./agent-icon-BrUPk7cd.js";import{u as Rs,d as Er,k as Ds}from"./tab-id-DrxIMKZC.js";import{r as Fr,a as Gr,R as Br,b as Lr,u as Es}from"./shell-layout-BI3SgcG0.js";import{u as Hr,a as Ur,b as Kr,s as Wr,c as Vr,r as qr,d as Yr,e as Xr,f as Qr,p as Zr,T as Fs,g as Jr,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,S as rs,o as Gs}from"./use-navigate-to-agent-B9d6Q1VR.js";import{A as os}from"./avatar-BqYC23h9.js";import{i as Bs}from"./Check-CNRVH6xs.js";import{a as is}from"./Eye-CFpoJQMe.js";import{n as lo,i as ao}from"./Globe01-CxF-Z8O2.js";import{i as co,a as Ls}from"./ZapSquare-Dz4Qok6x.js";import{i as uo}from"./Monitor01-gdKmZQTW.js";import{n as mo,a as fo}from"./Sun-DMcKqqHE.js";import{a as pt}from"./Settings02-D0kdZjJD.js";import{i as xo}from"./Shield01-CpxvRW7h.js";import{a as ho}from"./Users03-B9AqN8LK.js";import{s as Hs}from"./XClose-DOt_DYPz.js";import{f as po,a as go,b as bo,c as jo,d as vo,e as yo,A as So}from"./alert-dialog-DUUnhBc6.js";import{F as _o,a as No,b as Co,c as wo,d as ko,e as Io,f as Mo}from"./form-BvrZIBZy.js";import{I as Ao}from"./input-B16LqKMQ.js";import{S as $o}from"./spinner-C76OMH7i.js";import"./index-BOvqwG23.js";import{i as Oo,a as To}from"./RefreshCcw01-Dd5D2uNm.js";import{n as Yt}from"./Stars02-BFz8RQ16.js";import{u as Us,A as Ks,g as zo,a as Po,b as ls,K as Ro,P as Do,s as Eo,S as Fo,v as Go,D as Bo,c as Lo,d as Ho,C as Uo}from"./sortable.esm-BJmSIQN6.js";import{i as Xt}from"./ChevronRight-DixPnH3V.js";import{i as Ko}from"./FilterLines-htpqKUqo.js";import{t as Wo}from"./Users01-DG6YdAo1.js";import{b as as,c as Ws,S as cs,a as ds,d as us}from"./select-CXfOBpVA.js";import{b as Vo,c as qo,e as Yo,a as Xo,D as Qo}from"./dialog-dItkri_7.js";import{C as Zo,e as Jo,c as ei,d as ti,b as si}from"./command-ETJRln9I.js";import{u as Vs}from"./studio-tools-DP4PwlLL.js";import{i as qs}from"./Zap-CyMJw7DY.js";import{u as ni}from"./use-org-auth-client-BTTZUjKk.js";import{H as ri,a as oi,b as ii}from"./hover-card-DuwXdrhz.js";import{g as li,S as ai}from"./task-status-Bkjp3y0Q.js";import{u as ci,f as di}from"./use-clock-tick-DMfzqE_6.js";import{t as Ys}from"./ChevronDown-BKkz3Gyp.js";function ui(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let h;e[14]!==f||e[15]!==g||e[16]!==x?(h=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=h):h=e[17];let v;return e[18]!==u||e[19]!==h?(v=s.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=v):v=e[20],v}const mi="Select an existing agent";function fi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{side:"right",sideOffset:8,children:mi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(qe,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function xi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=Ce.useSession();let r;t[0]!==n?.user?.email?(r=Vt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:hi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=qt(i);return a?.isDecoUser??!1}async function hi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function pi(t){const e=Te(),{create:n}=Rs(),{locator:r}=fe(),o=Ns({strict:!1}),i=zn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Fr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function gi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=a):a=e[8],a}function bi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=O.useState(""),l=zs(),{org:c}=fe(),{data:d}=Ce.useSession(),u=d?.user?.id??"anon",m=l.filter(yi).map(vi),f=Ur();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:p,isCreating:x}=kr(g),{createFromTemplate:h,isCreating:v}=Ar(),j=xi(),y=pi(c.slug),b=i.toLowerCase(),S=l.filter(ji).filter(le=>!i||le.title.toLowerCase().includes(b)),k=le=>{Kr({orgId:c.id,userId:u},le.id,m),f(),n(),a(""),y(le.id)},_="flex flex-col max-h-[min(640px,80dvh)]";let C;e[1]!==i?(C=s.jsx(ui,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=C):C=e[2];const I="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const P="grid grid-cols-3 gap-1";let $;e[4]!==p||e[5]!==n?($=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=$):$=e[6];let w,z;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ne,{size:16,className:"text-muted-foreground"})}),z=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=w,e[8]=z):(w=e[7],z=e[8]);let H;e[9]!==x||e[10]!==$?(H=s.jsxs("button",{type:"button",disabled:x,onClick:$,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[w,z]}),e[9]=x,e[10]=$,e[11]=H):H=e[11];let T;e[12]!==h||e[13]!==n?(T=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await h($r),n()},e[12]=h,e[13]=n,e[14]=T):T=e[14];let B,R;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(_r,{className:"size-5 text-muted-foreground"})}),R=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=B,e[16]=R):(B=e[15],R=e[16]);let L;e[17]!==v||e[18]!==T?(L=s.jsxs("button",{type:"button",disabled:v,onClick:T,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[B,R]}),e[17]=v,e[18]=T,e[19]=L):L=e[19];let D;e[20]!==h||e[21]!==n?(D=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await h(Or),n()},e[20]=h,e[21]=n,e[22]=D):D=e[22];let G,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Tr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=G,e[24]=F):(G=e[23],F=e[24]);let E;e[25]!==v||e[26]!==D?(E=s.jsxs("button",{type:"button",disabled:v,onClick:D,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[G,F]}),e[25]=v,e[26]=D,e[27]=E):E=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let V,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(zr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=V,e[32]=X):(V=e[31],X=e[32]);let re;e[33]!==W?(re=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[V,X]}),e[33]=W,e[34]=re):re=e[34];let Y;e[35]!==j||e[36]!==n||e[37]!==r?(Y=j&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=j,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=S.map(le=>s.jsx(gi,{agent:le,onClick:()=>k(le)},le.id));let q;e[39]!==H||e[40]!==L||e[41]!==E||e[42]!==re||e[43]!==Y||e[44]!==oe?(q=s.jsxs("div",{className:P,children:[H,L,E,re,Y,oe]}),e[39]=H,e[40]=L,e[41]=E,e[42]=re,e[43]=Y,e[44]=oe,e[45]=q):q=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==S.length?(J=S.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=x,e[47]=i,e[48]=S.length,e[49]=J):J=e[49];let Q;e[50]!==q||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:I,children:[A,q,J]}),e[50]=q,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Pn,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==C||e[63]!==se?(ie=s.jsxs("div",{className:_,children:[C,Q,se]}),e[61]=Q,e[62]=C,e[63]=se,e[64]=ie):ie=e[64],ie}function ji(t){return!Nr(t.id)}function vi(t){return t.id}function yi(t){return t.pinned}function Xs(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,a]=O.useState(!1),[l,c]=O.useState(!1),[d,u]=O.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Hr(),p=g?"border border-border":void 0;let x;e[2]!==g?(x=I=>g?s.jsx(fi,{children:I}):I,e[2]=g,e[3]=x):x=e[3];const h=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const j=v;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(_e,{className:"h-4 w-24"})}),children:s.jsx(bi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const b=y;let S;e[10]!==o||e[11]!==p||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==b||e[16]!==h?(S=m?s.jsxs(s.Fragment,{children:[o?h(s.jsx(we,{"aria-label":"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ne,{className:"size-4"})})):s.jsx(xe,{children:h(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),b]})})]}):s.jsxs(Rt,{open:i,onOpenChange:I=>{I&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),a(I)},children:[o?h(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(p),children:s.jsx(Ne,{className:"size-4"})})})):s.jsx(xe,{children:h(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:b})]}),e[10]=o,e[11]=p,e[12]=g,e[13]=m,e[14]=i,e[15]=b,e[16]=h,e[17]=S):S=e[17];let k;e[18]!==l?(k=s.jsx(Ir,{open:l,onOpenChange:c}),e[18]=l,e[19]=k):k=e[19];let _;e[20]!==d?(_=s.jsx(Mr,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let C;return e[22]!==S||e[23]!==k||e[24]!==_?(C=s.jsxs(s.Fragment,{children:[S,k,_]}),e[22]=S,e[23]=k,e[24]=_,e[25]=C):C=e[25],C}function Qs(){const t=N.c(24),{org:e}=fe(),n=Te(),o=gr().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(br,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const g=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(jr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let h;t[11]!==n||t[12]!==i?(h=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=h):h=t[13];let v;t[14]!==x||t[15]!==h?(v={key:"files",label:"Library",icon:p,isActive:x,onClick:h},t[14]=x,t[15]=h,t[16]=v):v=t[16];const j=v;let y;t[17]!==j||t[18]!==g?(y={type:"items",items:[g,j]},t[17]=j,t[18]=g,t[19]=y):y=t[19];let b;if(t[20]!==c||t[21]!==y){if(b=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Xs,{})})})})},t[23]=S):S=t[23],b.push(S)}t[20]=c,t[21]=y,t[22]=b}else b=t[22];return b}function Ot(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Rn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Zs(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Js(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(xe,{className:d,children:m},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Si(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ks,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ni),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Zs,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(_i),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function _i(t){return s.jsx(Js,{item:t},t.key)}function Ni(t){return s.jsx(Js,{item:t},t.key)}function Ci(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(wi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Is,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==l?(f=s.jsxs(yr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function wi(t,e){return s.jsx(Si,{section:t},e)}function en(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ci,{...t}),e[0]=t,e[1]=n):n=e[1],n}en.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(_e,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ki(){const t=N.c(7),n=_s().logo??Dn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(Sr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(xe,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function Ii(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ks,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let a;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Zs,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Mi(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(ki,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(Ii,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ai=En({name:Fn().min(2,"Organization name is required")});function $i(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Gn(Ai),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Bn(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Ti,onSuccess:Oi},e[1]=a):a=e[1];const l=Ln(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(bo,{children:[s.jsx(jo,{children:"Create a new organization"}),s.jsx(vo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=C=>l.mutateAsync(C),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:C}=_;return s.jsxs(Co,{children:[s.jsx(wo,{children:"Organization Name"}),s.jsx(ko,{children:s.jsx(Ao,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Io,{children:"The name of your company or organization"}),C.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",tn(C.value)]})]}),s.jsx(Mo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(_o,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let p;e[15]!==l||e[16]!==i?(p=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(po,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const h=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx($o,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let j;e[23]!==h||e[24]!==v?(j=s.jsx($t,{type:"submit",variant:"default",disabled:h,children:v}),e[23]=h,e[24]=v,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(yo,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let b;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(b=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=b):b=e[33];let S;e[34]!==i||e[35]!==b?(S=s.jsxs(go,{children:[d,s.jsx(No,{...i,children:b})]}),e[34]=i,e[35]=b,e[36]=S):S=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==S?(k=s.jsx(So,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=k):k=e[40],k}function Oi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ti(t){const e=tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ce.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Ht(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function zi(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Vn();let a;e[0]!==n?(a=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=O.useState(!1),[u,m]=O.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let p;e[2]!==c?(p=function(){c&&m(""),d(Pi)},e[2]=c,e[3]=p):p=e[3];const x=p;let h;e[4]!==u||e[5]!==c||e[6]!==x?(h=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=h):h=e[7];let v;e[8]!==c?(v=c?s.jsx(Hs,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let j;e[10]!==v||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:v}),e[10]=v,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{size:16}),e[13]=y):y=e[13];let b;e[14]!==o?(b=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=b):b=e[15];let S;e[16]!==j||e[17]!==b?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,b]}),e[16]=j,e[17]=b,e[18]=S):S=e[18];let k;e[19]!==h||e[20]!==S?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[h,S]}),e[19]=h,e[20]=S,e[21]=k):k=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",C=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let I;e[22]!==r||e[23]!==n?(I=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(zi,{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(Bs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=I):I=e[24];const A=g.map(I);let P;e[25]!==C||e[26]!==A?(P=s.jsxs("div",{className:_,children:[C,A]}),e[25]=C,e[26]=A,e[27]=P):P=e[27];let $;return e[28]!==P||e[29]!==k?($=s.jsxs(s.Fragment,{children:[k,P]}),e[28]=P,e[29]=k,e[30]=$):$=e[30],$}function Pi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:p}=t;if(g){const q=n?.name??"U";let J;e[0]!==q||e[1]!==r?(J=s.jsx(os,{url:r,fallback:q,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=q,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Fi)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(is,{size:14}),e[12]=Ie):Ie=e[12];let ze;e[13]!==le?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let he;e[16]!==ze?(he=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[ze,Pe]})}),e[16]=ze,e[17]=he):he=e[17];let Re;e[18]!==he||e[19]!==J||e[20]!==ie?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Re):Re=e[21];const mt=String(p);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],Ee=o.map(de),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let de;e[45]!==l.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=l.theme,e[46]=c,e[47]=de):de=e[47],Ge=a.map(de),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Ei),e[50]=c,e[51]=be):be=e[51];const je=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==l.enableSounds?(pe=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.1"]}),e[61]=Be):Be=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Be]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==ve?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,ve]}),e[67]=Re,e[68]=Fe,e[69]=ve,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let h;e[71]!==x||e[72]!==r?(h=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=h):h=e[73];const v=n?.name??"User";let j;e[74]!==v?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=j):j=e[75];const y=n?.email;let b;e[76]!==y?(b=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=b):b=e[77];let S;e[78]!==j||e[79]!==b?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,b]}),e[78]=j,e[79]=b,e[80]=S):S=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Di)},e[81]=n,e[82]=k):k=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let C;e[84]!==k?(C=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=k,e[85]=C):C=e[85];let I;e[86]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=I):I=e[86];let A;e[87]!==C?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(qe,{children:[C,I]})}),e[87]=C,e[88]=A):A=e[88];let P;e[89]!==A||e[90]!==h||e[91]!==S?(P=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,S,A]}),e[89]=A,e[90]=h,e[91]=S,e[92]=P):P=e[92];let $;if(e[93]!==f||e[94]!==o){let q;e[96]!==f?(q=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=q):q=e[97],$=o.map(q),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let z;e[101]!==$||e[102]!==w?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,w]}),e[101]=$,e[102]=w,e[103]=z):z=e[103];let H;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let q;e[108]!==l.theme||e[109]!==c?(q=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=l.theme,e[109]=c,e[110]=q):q=e[110],H=a.map(q),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=H}else H=e[107];let T;e[111]!==H?(T=s.jsx("div",{className:"flex items-center gap-0.5",children:H}),e[111]=H,e[112]=T):T=e[112];const B=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ri),e[113]=c,e[114]=R):R=e[114];const L=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==L?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",L),e[115]=L,e[116]=D):D=e[116];let G;e[117]!==l.enableSounds?(G=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=G):G=e[118];let F;e[119]!==B||e[120]!==R||e[121]!==D||e[122]!==G?(F=s.jsx("button",{type:"button","aria-label":B,onClick:R,className:D,children:G}),e[119]=B,e[120]=R,e[121]=D,e[122]=G,e[123]=F):F=e[123];let E;e[124]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.1"]}),e[124]=E):E=e[124];let W;e[125]!==F?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[125]=F,e[126]=W):W=e[126];let V;e[127]!==T||e[128]!==W?(V=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[T,W]}),e[127]=T,e[128]=W,e[129]=V):V=e[129];let X;e[130]!==P||e[131]!==z||e[132]!==V?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[P,z,V]}),e[130]=P,e[131]=z,e[132]=V,e[133]=X):X=e[133];const re=String(p);let Y;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},re)}),e[134]=m,e[135]=u,e[136]=d,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Ri(t){return{...t,enableSounds:!t.enableSounds}}function Di(){Ae.success("User ID copied")}function Ei(t){return{...t,enableSounds:!t.enableSounds}}function Fi(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=Ce.useSession(),{org:n}=fe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Hn(o)?.params.org,[l,c]=Un(),d=Ms(),[u,m]=O.useState(!1),[f,g]=O.useState(!1),p=e?.user,x=p?.image;let h;t[1]!==r?(h=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=h):h=t[2];const v=h;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let b;t[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(pt,{size:16}),t[4]=b):b=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:b,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(lo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(vr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(xo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=C):C=t[12];let I;t[13]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(Kn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=I):I=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(ho,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P={key:"homepage",label:"Homepage",icon:s.jsx(ao,{size:16}),href:"https://decocms.com",external:!0},t[15]=P):P=t[15];let $;t[16]!==S||t[17]!==k?($=[S,...k,_,C,I,A,P],t[16]=S,t[17]=k,t[18]=$):$=t[18];const w=$;let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(co,{size:16}),onClick:Bi},t[19]=z):z=t[19];const H=z;let T;t[20]===Symbol.for("react.memo_cache_sentinel")?(T={value:"light",icon:s.jsx(mo,{size:14}),label:"Light theme"},t[20]=T):T=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B={value:"dark",icon:s.jsx(fo,{size:14}),label:"Dark theme"},t[21]=B):B=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[T,B,{value:"system",icon:s.jsx(uo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const L=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let G;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==p||t[32]!==x?(G={user:p,userImage:x,menuItems:w,signOutItem:H,themeOptions:L,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=p,t[32]=x,t[33]=G):G=t[33];const F=G;let E;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==F?(E=d?s.jsxs(As,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...F})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Gi,children:s.jsx(xs,{...F})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=F,t[38]=E):E=t[38];let W;t[39]!==f?(W=s.jsx($i,{open:f,onOpenChange:g}),t[39]=f,t[40]=W):W=t[40];let V;return t[41]!==E||t[42]!==W?(V=s.jsxs(s.Fragment,{children:[E,W]}),t[41]=E,t[42]=W,t[43]=V):V=t[43],V}function Gi(t){return t.preventDefault()}function Bi(){Z("signed_out",{source:"account_popover"}),Wn(),Ce.signOut()}function Li({invitation:t}){const[e,n]=O.useState(!1),[r,o]=O.useState(!1),i=qn(),a=async()=>{n(!0);try{const d=await Ce.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),Yn();let c;try{c=(await Ce.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Ce.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Bs,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Hs,{size:14})})]})]})}function Hi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Ui(){const t=O.useContext(Xn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function sn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Gr(),o=Ui();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Vi).map(Wi);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Br].sort(Ki).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ki(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Wi(t){return{type:"invitation",invitation:t}}function Vi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class nn extends O.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 rn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function qi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let a;t[2]!==o?(a=K(o!=null&&rn(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Yi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(qi,{})})}),t[0]=e):e=t[0],e}function Xi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&rn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(Ve,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(qe,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Qi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function on(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=sn(),[i,a]=O.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=h=>h.type==="release"&&h.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(Oo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Lr,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Yt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Li,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Hi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=g):g=e[11];let p;return e[12]!==n||e[13]!==g?(p=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=p):p=e[14],p}function ln(){const{redDotCount:t}=sn();return t>0}function Zi(){const t=N.c(6),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(on,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ji(){const t=N.c(8),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(we,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(on,{children:s.jsxs(qe,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function el(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Ls,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(qe,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Ls,{className:"size-4"})})}),s.jsx(Ve,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function sl(){const t=N.c(7),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function nl(){const t=N.c(9),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ve,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(qe,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function rl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Yi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(el,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(Zi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(sl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(xe,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),s.jsx(nl,{}),s.jsx(Ji,{}),s.jsx(tl,{}),s.jsx(Qi,{})]})}),t[5]=r):r=t[5],r}function ol(){const t=N.c(8),e=Te(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function il(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(ll,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(qs,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ll(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function al(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=O.useState(""),{org:a}=fe(),{setTaskId:l}=Es(),c=Vs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=qt,d=Vt.globalSearch(a.id,m),e[0]=a.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==g?(p={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=p):p=e[11];const{data:x,isFetching:h}=u(p);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const j=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const b=y;let S;e[16]!==b||e[17]!==l?(S=w=>{b(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=b,e[17]=l,e[18]=S):S=e[18];const k=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Vo,{className:"sr-only",children:[s.jsx(qo,{children:"Search"}),s.jsx(Yo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let C;e[20]!==o?(C=s.jsx(ei,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=C):C=e[21];let I;e[22]!==k||e[23]!==h||e[24]!==j||e[25]!==m?(I=m?h&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Zo,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(Jo,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(il,{virtualMcpId:w.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=h,e[24]=j,e[25]=m,e[26]=I):I=e[26];let A;e[27]!==I?(A=s.jsx(ti,{children:I}),e[27]=I,e[28]=A):A=e[28];let P;e[29]!==C||e[30]!==A?(P=s.jsxs(Xo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(si,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[C,A]})]}),e[29]=C,e[30]=A,e[31]=P):P=e[31];let $;return e[32]!==b||e[33]!==n||e[34]!==P?($=s.jsx(Qo,{open:n,onOpenChange:b,children:P}),e[32]=b,e[33]=n,e[34]=P,e[35]=$):$=e[35],$}function cl(t){return t==="owner"||t==="admin"}function dl(){const t=N.c(11),{locator:e}=fe(),n=ni(),{data:r}=Ce.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Vt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=qt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=cl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[ul]=or(Qt,[Cs]),ce=Cs(),[ml,an]=ul(Qt),cn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=O.useState(!1),c=ce(e),d=nr(r),u=O.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ml,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(rr,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};cn.displayName=Qt;var dn="ContextMenuTrigger",un=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=an(dn,n),a=ce(n),l=O.useRef({x:0,y:0}),c=O.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=O.useRef(0),u=O.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return O.useEffect(()=>u,[u]),O.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Qn,{...a,virtualRef:c}),s.jsx(Zn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});un.displayName=dn;var fl="ContextMenuPortal",mn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(tr,{...r,...n})};mn.displayName=fl;var fn="ContextMenuContent",xn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=an(fn,n),i=ce(n),a=O.useRef(!1);return s.jsx(sr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xn.displayName=fn;var xl="ContextMenuGroup",hl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ir,{...o,...r,ref:e})});hl.displayName=xl;var pl="ContextMenuLabel",gl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});gl.displayName=pl;var bl="ContextMenuItem",hn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(Jn,{...o,...r,ref:e})});hn.displayName=bl;var jl="ContextMenuCheckboxItem",vl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});vl.displayName=jl;var yl="ContextMenuRadioGroup",Sl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});Sl.displayName=yl;var _l="ContextMenuRadioItem",Nl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});Nl.displayName=_l;var Cl="ContextMenuItemIndicator",wl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});wl.displayName=Cl;var kl="ContextMenuSeparator",pn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=kl;var Il="ContextMenuArrow",Ml=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Ml.displayName=Il;var Al="ContextMenuSubTrigger",$l=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});$l.displayName=Al;var Ol="ContextMenuSubContent",Tl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Tl.displayName=Ol;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zl=cn,Pl=un,Rl=mn,Dl=xn,El=hn,Fl=pn;function gn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(zl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function bn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Pl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Rl,{children:s.jsx(Dl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(El,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Fl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ne,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let p;e[10]!==f?(p=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Pr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let h;e[17]!==r||e[18]!==c||e[19]!==n?(h=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(To,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=h):h=e[20];let v;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==h?(v=s.jsxs(s.Fragment,{children:[m,p,x,h]}),e[21]=m,e[22]=p,e[23]=x,e[24]=h,e[25]=v):v=e[25],v}function Gl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=li(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=zo(f),e[0]=f,e[1]=g):g=e[1];const p=g;ci(6e4);const x=a||!!n.trigger_id,h=n.id,v="button",j=0;let y;e[2]!==o?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const b=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==b?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",b),e[4]=b,e[5]=S):S=e[5];let k;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(k=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=k):k=e[10];let _;e[11]!==x?(_=x&&s.jsx(qs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const C=n.title||"Untitled task";let I;e[13]!==C?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=I):I=e[14];let A;e[15]!==I||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,I]}),e[15]=I,e[16]=_,e[17]=A):A=e[17];let P;e[18]!==p||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(P=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Gl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[p.owner,"/",p.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:di(new Date(n.updated_at))})]}),e[18]=p,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=P):P=e[22];let $;e[23]!==A||e[24]!==P?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,P]}),e[23]=A,e[24]=P,e[25]=$):$=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",z=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let H;e[26]!==i?(H=F=>{F.stopPropagation(),i()},e[26]=i,e[27]=H):H=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(hr,{size:14}),e[28]=T):T=e[28];let B;e[29]!==H?(B=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:T})}),e[29]=H,e[30]=B):B=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ve,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let L;e[32]!==B?(L=s.jsxs(qe,{children:[B,R]}),e[32]=B,e[33]=L):L=e[33];let D;e[34]!==z||e[35]!==L?(D=s.jsxs("div",{className:w,children:[z,L]}),e[34]=z,e[35]=L,e[36]=D):D=e[36];let G;return e[37]!==o||e[38]!==$||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==k||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":h,role:v,tabIndex:j,onClick:o,onKeyDown:y,className:S,children:[k,$,D]}),e[37]=o,e[38]=$,e[39]=D,e[40]=y,e[41]=S,e[42]=k,e[43]=n.id,e[44]=G):G=e[44],G}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const yn=4;let At=0;const Kt=[];function Hl(){for(;At<yn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function Sn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Hl()})};At<yn?r():Kt.push(r)})}const Ft=10;function ps(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Ul(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Ul(t,e,n,r)}function Kl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Wl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function Vl(t,e){return e===!1?!1:e===!0?!0:t}function Jt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Tt=new Map,Mt=new Map;function ql(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Yl(t,e){Tt.set(t,e)}function Xl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=Sn(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ql(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=fe(),a=Bl(i.id,t,e,n);let l;o[0]!==n?(l=Ll(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=O.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Er(),{threads:f,hasMore:g}=Ds(),p=r??Bt(f,t,e,n),x=Wl(p,g),h=ql(p,g),v=Vs();if(d.identity===a&&d.serverHasMore===null){const _=h??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&h===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Xl(a,async()=>{const _=ps(t,e,0,n,1),C=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:I}=js(C),A=Bt(m.threads.get(),t,e,n);return I===void 0?!1:gs(A,I)},_=>{u(C=>C.identity!==a?C:{...C,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const C=a;u(I=>I.identity===C?{...I,isFetching:!0}:I);try{const I=Bt(f,t,e,n),A=ps(t,e,I,n,Ft),P=await Sn(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:w,totalCount:z}=js(P),H=new Set(f.map(Zl)),T=Ql($,H,t,e,n),B=I;m.mergeThreads($),u(R=>{if(R.identity!==C)return R;let L;return z!==void 0?L=gs(B+T,z):L=$.length===0||T===0?!1:w,Yl(C,L),{...R,isFetching:!1,serverHasMore:L}})}catch(I){const A=I,P=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${P}`),u($=>$.identity===C?{...$,isFetching:!1}:$)}},b=d.isFetching||d.isProbing,S=!c&&!b&&Vl(x,d.serverHasMore);let k;return o[2]!==b||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:S,isFetching:b,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=b,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function Zl(t){return t.id}function _n(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:p,groupVisibleCount:x}=t,h=m===void 0?!1:m,v=f===void 0?!1:f,j=ht(n),y=r[0];let b;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(b=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=b):b=e[4];const S=b,k=p?.isDragging?!1:void 0;let _;e[5]!==p?.isDragging||e[6]!==n?(_=q=>{p?.isDragging||q&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=_):_=e[7];const C=!!(y&&o&&y.id===o),I=p?"Drag to reorder":void 0;let A;e[8]!==p?(A=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=A):A=e[9];const P=p&&"cursor-pointer active:cursor-grabbing touch-none",$=p?.isDragging&&"cursor-grabbing";let w;e[10]!==$||e[11]!==P?(w=K("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",P,$),e[10]=$,e[11]=P,e[12]=w):w=e[12];const z=j?.icon??null,H=j?.title??"?";let T;e[13]!==z||e[14]!==H?(T=s.jsx(Oe,{icon:z,name:H,size:"sm+",className:"rounded-lg"}),e[13]=z,e[14]=H,e[15]=T):T=e[15];let B;e[16]!==S||e[17]!==w||e[18]!==T||e[19]!==C||e[20]!==I||e[21]!==A?(B=s.jsx(xe,{children:s.jsx(bn,{asChild:!0,children:s.jsx(ri,{asChild:!0,children:s.jsx(ke,{onClick:S,isActive:C,title:I,...A,className:w,children:T})})})}),e[16]=S,e[17]=w,e[18]=T,e[19]=C,e[20]=I,e[21]=A,e[22]=B):B=e[22];const R=g??Jl;let L;e[23]!==v||e[24]!==h||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(L=s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=h,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=L):L=e[30];let D;e[31]!==B||e[32]!==L?(D=s.jsxs(gn,{children:[B,L]}),e[31]=B,e[32]=L,e[33]=D):D=e[33];const G=j?.title??"Agent";let F;e[34]!==G?(F=s.jsx("span",{className:"truncate",children:G}),e[34]=G,e[35]=F):F=e[35];let E;e[36]!==c||e[37]!==n?(E=()=>c(n),e[36]=c,e[37]=n,e[38]=E):E=e[38];let W;e[39]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:14}),e[39]=W):W=e[39];let V;e[40]!==E?(V=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:W}),e[40]=E,e[41]=V):V=e[41];let X;e[42]!==F||e[43]!==V?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[F,V]}),e[42]=F,e[43]=V,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(re=s.jsx(ea,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(oi,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==D||e[57]!==Y||e[58]!==k||e[59]!==_?(oe=s.jsxs(ii,{open:k,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,Y]}),e[56]=D,e[57]=Y,e[58]=k,e[59]=_,e[60]=oe):oe=e[60],oe}function Jl(){}function ea(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ta(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Eo},l[1]=u):u=l[1];const m=Po(ls(Do,d),ls(Ro,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=Wr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let p;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(p=v=>{const{active:j,over:y}=v;if(!y||j.id===y.id)return;const b=String(j.id),S=String(y.id);if(!Vr(b,S,o))return;const k=qr(g,b,S),_=Yr(e,n,o,k);e==="org"?Xr(n.orgId,_):Qr(n,_),Z("sidebar_group_reordered",{virtual_mcp_id:b,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=p):p=l[13];const x=p;let h;return l[14]!==x||l[15]!==m||l[16]!==g?(h={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=h):h=l[17],h}function sa(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function na(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Ho(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Uo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:p}=ta(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let h;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=b=>{const S=d(b);return g.includes(b.virtualMcpId)?s.jsx(na,{id:b.virtualMcpId,children:k=>{const{setNodeRef:_,style:C,isDragging:I,attributes:A,listeners:P}=k;return s.jsx("div",{ref:_,style:C,className:K(I&&"opacity-50"),children:u(S,{attributes:A,listeners:P,isDragging:I})})}},b.virtualMcpId):s.jsx("div",{children:m(S)},b.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],h=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=h}else h=e[5];let v;e[11]!==x||e[12]!==h?(v=s.jsx(Fo,{items:x,strategy:Go,children:h}),e[11]=x,e[12]=h,e[13]=v):v=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==v?(j=s.jsx(Bo,{sensors:f,collisionDetection:Lo,onDragEnd:p,children:v}),e[14]=p,e[15]=f,e[16]=v,e[17]=j):j=e[17],j}function Nn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:p,user:x,toolCallRuns:h}=Zr(n,o,i),v=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=j):j=e[19];const y=j;let b;e[20]!==c||e[21]!==v?(b=v&&s.jsx(sa,{collapsed:c}),e[20]=c,e[21]=v,e[22]=b):b=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:p,...y}),b,s.jsx(vs,{section:"user",groups:x,...y}),h&&m(d(h))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function ra(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:ia,renderSortable:oa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function oa(t,e){return s.jsx(_n,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function ia(t){return s.jsx(_n,{...t},t.virtualMcpId)}const la="sidebar.group.expanded.";function Cn(t,e){const n=N.c(3),[r,o]=pr(`${la}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function wn(t){const e=N.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:p,sortable:x}=t,h=u===void 0?!1:u,v=m===void 0?!1:m,[j,y]=Cn(n,!1),b=n===Fs,S=x?.isDragging??!1;let k;e[0]!==j||e[1]!==y?(k=function(){y(!j)},e[0]=j,e[1]=y,e[2]=k):k=e[2];const _=k;let C;e[3]!==b||e[4]!==x?(C=x&&!b?{...x.attributes,...x.listeners}:{},e[3]=b,e[4]=x,e[5]=C):C=e[5];let I;e[6]!==_?(I=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),_())},e[6]=_,e[7]=I):I=e[7];const A=x&&!b&&"touch-none active:cursor-grabbing",P=S&&"shadow-md bg-accent/40 cursor-grabbing";let $;e[8]!==A||e[9]!==P?($=K("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",A,P),e[8]=A,e[9]=P,e[10]=$):$=e[10];let w;e[11]!==b||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(ca,{virtualMcpId:n,isToolCallRuns:b})}),e[11]=b,e[12]=n,e[13]=w):w=e[13];let z;e[14]!==j?(z=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:j?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[14]=j,e[15]=z):z=e[15];let H;e[16]!==z||e[17]!==w?(H=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,z]}),e[16]=z,e[17]=w,e[18]=H):H=e[18];let T;e[19]!==b||e[20]!==n?(T=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ua,{virtualMcpId:n,isToolCallRuns:b})}),e[19]=b,e[20]=n,e[21]=T):T=e[21];let B;e[22]!==b||e[23]!==l||e[24]!==n?(B=!b&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E=>{E.stopPropagation(),l(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ne,{size:14})}),e[22]=b,e[23]=l,e[24]=n,e[25]=B):B=e[25];let R;e[26]!==j||e[27]!==_||e[28]!==H||e[29]!==T||e[30]!==B||e[31]!==C||e[32]!==I||e[33]!==$?(R=s.jsxs("div",{...C,role:"button",tabIndex:0,"aria-expanded":j,onClick:_,onKeyDown:I,className:$,children:[H,T,B]}),e[26]=j,e[27]=_,e[28]=H,e[29]=T,e[30]=B,e[31]=C,e[32]=I,e[33]=$,e[34]=R):R=e[34];const L=R;let D;e[35]!==v||e[36]!==L||e[37]!==h||e[38]!==b||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=b?L:s.jsxs(gn,{children:[s.jsx(bn,{asChild:!0,children:L}),s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??aa,onHideGroup:d})})]}),e[35]=v,e[36]=L,e[37]=h,e[38]=b,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let G;e[45]!==o||e[46]!==j||e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(G=j&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:b?r.map(E=>s.jsx(Et,{task:E,isActive:o===E.id,onClick:()=>i(E),onArchive:()=>a(E),showAutomationBadge:!!E.trigger_id},E.id)):s.jsx(fa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:p})}),e[45]=o,e[46]=j,e[47]=g,e[48]=p,e[49]=b,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=G):G=e[55];let F;return e[56]!==D||e[57]!==G?(F=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,G]}),e[56]=D,e[57]=G,e[58]=F):F=e[58],F}function aa(){}function ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(da,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function da(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ua(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ma,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ma(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function fa(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:p}=u,[x,h]=O.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(h(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let j;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ne,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function xa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,p]=O.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==a||e[7]!==i?(j=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let h;e[9]!==m||e[10]!==c||e[11]!==u?(h=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=h):h=e[12];let v;return e[13]!==x||e[14]!==h?(v=s.jsxs(s.Fragment,{children:[x,h]}),e[13]=x,e[14]=h,e[15]=v):v=e[15],v}function ha(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ai[n],d=c.icon,[u,m]=Cn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const g=f;let p;e[3]!==g?(p=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let h;e[8]!==u?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=h):h=e[9];let v;e[10]!==x||e[11]!==h?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,h]}),e[10]=x,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let b;e[17]!==u||e[18]!==g||e[19]!==p||e[20]!==v||e[21]!==j||e[22]!==y?(b=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,j,y]}),e[17]=u,e[18]=g,e[19]=p,e[20]=v,e[21]=j,e[22]=y,e[23]=b):b=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let k;return e[32]!==b||e[33]!==S?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b,S]}),e[32]=b,e[33]=S,e[34]=k):k=e[34],k}function pa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ba,renderSortable:ga}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ga(t,e){return s.jsx(wn,{...t,sortable:e},t.virtualMcpId)}function ba(t){return s.jsx(wn,{...t},t.virtualMcpId)}function ja(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function va(t,e,n,r,o){const i=N.c(5),a=ja(t,e,r,o),[l,c]=O.useState("");l!==a&&(Jr(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=eo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const kn={all:"All tasks",manual:"Chats",automation:"Automation"},In={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function Mn(){const t=N.c(92),{data:e}=Ce.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Cr(o.id).id,l=zs().filter($a).map(Aa),c=dl(),d=wr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=O.useState(u),g=new Set(l),p={},x=[];let h;t[1]!==m?(h=Object.entries(m),t[1]=m,t[2]=h):h=t[2];for(const[M,U]of h)g.has(M)!==U?p[M]=U:x.push(M);x.length>0&&f(M=>{const U={...M};for(const ne of x)delete U[ne];return U});const v=new Set(l);for(const[M,U]of Object.entries(p))U?v.add(M):v.delete(M);const j=[...v],y=new Set(j),{threads:b}=Ds(),S=b.filter(Ma),{hide:k}=Rs(),_=Te(),{setTaskId:C,createNewTask:I}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const $=Ns(A).taskId??null,w=[...S].sort(Ia),[z,H]=O.useState("all"),[T,B]=O.useState("mine"),[R,L]=O.useState("agent"),[D,G]=O.useState(!1),[F,E]=O.useState(!1),[W,V]=O.useState(0),X=to(),re=W+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,q={type:z,member:T,currentUserId:n??null},J=Kl(w,"agent",q),Q=va(oe,so(w,i),i,j,re);let ee;t[7]!==n||t[8]!==T?(ee=M=>T==="mine"&&n?M.filter(U=>U.created_by===n):M,t[7]=n,t[8]=T,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==z?(se=M=>z==="automation"?M.filter(ka):z==="manual"?M.filter(wa):M,t[10]=z,t[11]=se):se=t[11];const ie=se,le=M=>{const U=M.id===$;if(k(M.id),!U)return;const ne=w.find(Se=>Se.id!==M.id&&Se.virtual_mcp_id===M.virtual_mcp_id);ne?C(ne.id,ne.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==I?(Ie=M=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:M}),I(M)},t[12]=I,t[13]=Ie):Ie=t[13];const ze=Ie,Pe=no();let he;t[14]!==Pe?(he=M=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=he):he=t[15];const Re=he,mt=M=>{if(y.has(M))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:M});const U=Q.find(ne=>ne.virtualMcpId===M);if(U)for(const ne of U.threads)k(ne.id);oo(oe,M,j),V(Ca)},De=async(M,U)=>{if(c&&p[M]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:U}),f(ne=>({...ne,[M]:U}));try{await d.update.mutateAsync({id:M,data:{pinned:U}})}catch{io(oe,M,!U),f(ne=>{const Se={...ne};return delete Se[M],Se})}}},Ee=M=>{const U=M===i||M===Fs;return{isOrgPinned:y.has(M),canManageOrgPin:U?!1:c,onToggleOrgPin:U?void 0:De}},Me=M=>{const U=ie(te(M.threads));return{virtualMcpId:M.virtualMcpId,threads:U,activeTaskId:$,filters:q,groupVisibleCount:J.get(M.virtualMcpId)??0,onSelectTask:ne=>C(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=z!=="all"||T!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=On=>{const Tn=ie(te(On.threads));return!(ae&&Tn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],M=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=M}else M=t[20];const U=M,ne=R==="agent"&&Q.length===0;let Se;t[25]!==ne?(Se=s.jsx(rs,{value:ne}),t[25]=ne,t[26]=Se):Se=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>V(Na),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[Se,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ra,{groups:U,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=R==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(rs,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==G?(ue=()=>{Z("tasks_panel_search_opened"),E(!0),G(!0)},t[30]=G,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Rr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Be=ys[R==="agent"?"status":"agent"];let ge;t[35]!==Be?(ge=Be.toLowerCase(),t[35]=Be,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Le=ys[R];let de;t[37]!==Le?(de=Le.toLowerCase(),t[37]=Le,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==R?(ye=()=>{const M=R==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:M}),L(M)},Ue=R==="agent"?s.jsx(Wo,{size:16}):s.jsx(Dr,{size:16}),t[39]=R,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Ko,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==T?(et=M=>{const U=M;U!==T&&Z("tasks_panel_member_filter_changed",{to_value:U}),B(U)},t[52]=T,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(In),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(_a)}),t[56]=jt):jt=t[56];let tt;t[57]!==T||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:T,onValueChange:et,children:[gt,jt]})}),t[57]=T,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==z?(st=M=>{const U=M;U!==z&&Z("tasks_panel_filter_changed",{to_value:U}),H(U)},t[60]=z,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(kn),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(Sa)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==z?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:z,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=z,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Xs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const $n="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:ro(ie(te(w))).map(M=>s.jsx(ha,{status:M.status,threads:M.threads,activeTaskId:$,onSelectTask:U=>C(U.id,U.virtual_mcp_id),onArchiveTask:le,filters:q},M.status))}):s.jsx(pa,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:()=>V(ya),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:$n,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==F||t[84]!==D||t[85]!==G?(ct=F&&s.jsx(al,{open:D,onOpenChange:G}),t[83]=F,t[84]=D,t[85]=G,t[86]=ct):ct=t[86];let Nt;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function ya(t){return t+1}function Sa(t){return s.jsx(Ws,{value:t,children:kn[t]},t)}function _a(t){return s.jsx(Ws,{value:t,children:In[t]},t)}function Na(t){return t+1}function Ca(t){return t+1}function wa(t){return!t.trigger_id}function ka(t){return!!t.trigger_id}function Ia(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ma(t){return!t.hidden}function Aa(t){return t.id}function $a(t){return t.pinned}function Ss(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Oa=5,Ta=[{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 An(){const t=N.c(3),{state:e}=Xe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Oa}).map(Ra)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"})]}),s.jsx(_e,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Ta.map(za)})]}),t[2]=r):r=t[2],r}function za(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(_e,{className:"size-5 rounded-full shrink-0"}),s.jsx(_e,{className:K("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Pa)})]},e)}function Pa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(_e,{className:"h-3 flex-1 rounded-sm"})},e)}function Ra(t,e){return s.jsx(_e,{className:"size-10 rounded-lg mx-auto"},e)}function Pc(){const t=N.c(4),e=Qs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(rl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Gs,{children:s.jsx(en,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Rc(t){const e=N.c(5),{onClose:n}=t,r=Qs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ol,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Gs,{children:s.jsx(Mi,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function Dc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{bn as C,Pc as S,Rc as a,Dc as b,It as c,hs as d,jn as e,gn as f};
|