@decocms/mesh 2.132.0 → 2.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Dvy3oHwl.js → AlertCircle-DtdVhcv9.js} +1 -1
- package/dist/client/assets/{AlignLeft-C1Pd8crU.js → AlignLeft-CRHzRLnb.js} +1 -1
- package/dist/client/assets/{ArrowDown-B0XF9QfR.js → ArrowDown-CD9f6dVF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Ddv8Es1G.js → ArrowLeft-Dse_UWo5.js} +1 -1
- package/dist/client/assets/{ArrowUp-CjPyEOxC.js → ArrowUp-C5pU0t20.js} +1 -1
- package/dist/client/assets/{Check-BGWNBpXb.js → Check-llxZXJNk.js} +1 -1
- package/dist/client/assets/{CheckCircle-CDdaecse.js → CheckCircle-naMxBwcc.js} +1 -1
- package/dist/client/assets/{CheckDone01-DgNkGXSd.js → CheckDone01-DArNoCeR.js} +1 -1
- package/dist/client/assets/{CheckVerified02-yC2IepeU.js → CheckVerified02-B5N8FkZi.js} +1 -1
- package/dist/client/assets/{ChevronDown-CxLgy5uI.js → ChevronDown-BPvdqfh0.js} +1 -1
- package/dist/client/assets/ChevronLeft-BmfUl3Br.js +1 -0
- package/dist/client/assets/{ChevronRight-B-dZm0Fo.js → ChevronRight-bI92hTEK.js} +1 -1
- package/dist/client/assets/{Clock-DjTfMWYb.js → Clock-DCqyBdVg.js} +1 -1
- package/dist/client/assets/{Code01-C4dpeKsY.js → Code01-Cw3aSJX_.js} +1 -1
- package/dist/client/assets/{Container-CH2V2ATa.js → Container-BcN3rU1W.js} +1 -1
- package/dist/client/assets/{Copy01-Ba42JLNP.js → Copy01-DOsfcAr7.js} +1 -1
- package/dist/client/assets/{Dataflow03-Dbafm5jn.js → Dataflow03-BzHLq4N3.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DF0XToJT.js → DotsHorizontal-jg8p8szZ.js} +1 -1
- package/dist/client/assets/{DotsVertical-D-x0DTAA.js → DotsVertical-D7GBR06C.js} +1 -1
- package/dist/client/assets/{Download01-x2RmdAQh.js → Download01-Dqv2OtJR.js} +1 -1
- package/dist/client/assets/{Edit01-NXKv8M2Y.js → Edit01-PGiGF51x.js} +1 -1
- package/dist/client/assets/{Eye-Da9OHWjs.js → Eye-BHQjRrk8.js} +1 -1
- package/dist/client/assets/{File02-BBbAYdh-.js → File02-8H6UbpEV.js} +1 -1
- package/dist/client/assets/{File06-CZSeKcKm.js → File06-C1Sd5E1A.js} +1 -1
- package/dist/client/assets/{FilterLines-CR4t6v_B.js → FilterLines-C4D0sIiB.js} +1 -1
- package/dist/client/assets/{Globe01-sstJp1qH.js → Globe01-DvHitX1A.js} +1 -1
- package/dist/client/assets/{Globe02-DED7nhMo.js → Globe02-8eZbLs7z.js} +1 -1
- package/dist/client/assets/{Grid01-C85povgK.js → Grid01-CfCG1RrY.js} +1 -1
- package/dist/client/assets/{Hash02-B-r__uQj.js → Hash02-B4zt7eqf.js} +1 -1
- package/dist/client/assets/{Home02-P9zxIWnB.js → Home02-BgWCBPhH.js} +1 -1
- package/dist/client/assets/{Image01-CyQ-9pmM.js → Image01-B8svV61f.js} +1 -1
- package/dist/client/assets/{Inbox01-DUxLR6jm.js → Inbox01-DktY8c3P.js} +1 -1
- package/dist/client/assets/{InfoCircle-ORvzz6Jj.js → InfoCircle-DDBpFLdR.js} +1 -1
- package/dist/client/assets/{Key01-B3LfJVTz.js → Key01-eAlJ77G3.js} +1 -1
- package/dist/client/assets/{LayersTwo01-D0hB1mlt.js → LayersTwo01-Cre7WmYe.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CIizJ9p-.js → LayoutLeft-BdPuu6bH.js} +1 -1
- package/dist/client/assets/{LinkExternal01-zIQsCZyp.js → LinkExternal01-1-7TA6Ra.js} +1 -1
- package/dist/client/assets/{List-Dy03iFlP.js → List-uQZNVPQ-.js} +1 -1
- package/dist/client/assets/{Loading01-DvHkBn5K.js → Loading01-DUUFtL7S.js} +1 -1
- package/dist/client/assets/{Lock01-b36hjLYg.js → Lock01-BqRcOfbm.js} +1 -1
- package/dist/client/assets/{Play-B4gSKcOc.js → Play-DTlFqxwD.js} +1 -1
- package/dist/client/assets/{Plus-C48LE9QF.js → Plus-2wrCLrAD.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-B_P3Otqi.js → RefreshCcw01-CmQ_Zyfb.js} +1 -1
- package/dist/client/assets/{Rows03-RYFV31vk.js → Rows03-CeP6X8F6.js} +1 -1
- package/dist/client/assets/{Save01-C9eXS7Z1.js → Save01-Cq59fc-a.js} +1 -1
- package/dist/client/assets/{SearchMd-Bec1mZCp.js → SearchMd-DOdaT51-.js} +1 -1
- package/dist/client/assets/{Settings01-CGjDKLLq.js → Settings01-jEDDrq49.js} +1 -1
- package/dist/client/assets/{Shield01-QPvxKI9B.js → Shield01-_lpY_BlD.js} +1 -1
- package/dist/client/assets/{Terminal-Dg9FTns0.js → Terminal-CZIzfu4H.js} +1 -1
- package/dist/client/assets/{Trash01-DfwWsbuW.js → Trash01-DJpn1VG4.js} +1 -1
- package/dist/client/assets/{Upload01-CBnp-ZgO.js → Upload01-c6QpJwvP.js} +1 -1
- package/dist/client/assets/{Users03-zNQ-U5kI.js → Users03--eiqKjb_.js} +1 -1
- package/dist/client/assets/{X-BaOBrQh9.js → X-BGHsyt4s.js} +1 -1
- package/dist/client/assets/{XCircle-CGBoiIiF.js → XCircle-BJSW1V34.js} +1 -1
- package/dist/client/assets/{XClose-D5oa0b17.js → XClose-CYrOe1GU.js} +1 -1
- package/dist/client/assets/{Zap-B8kjj6jV.js → Zap-Div5wKlF.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CpRlCZek.js → agent-connections-preview-B33aUr8j.js} +1 -1
- package/dist/client/assets/agent-detail-B1r6DbgP.js +2 -0
- package/dist/client/assets/agents--1wlh1On.js +1 -0
- package/dist/client/assets/{alert-dialog-CHhoNaC0.js → alert-dialog-WtbKGn3h.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bks-N8b9.js → auth-catchall-C-FIrDOU.js} +1 -1
- package/dist/client/assets/{avatar-DX9xarA9.js → avatar-C0Za2Leb.js} +1 -1
- package/dist/client/assets/{badge-CMOYVtO8.js → badge-zns1OAW0.js} +1 -1
- package/dist/client/assets/{binder-CN-yhtfQ.js → binder-C2Kwp5aI.js} +1 -1
- package/dist/client/assets/{breadcrumb-CtNnsyqL.js → breadcrumb-BF7wgZMj.js} +1 -1
- package/dist/client/assets/{card-BECXECFc.js → card-yVoc5Dl_.js} +1 -1
- package/dist/client/assets/{chart-CA07zGfe.js → chart-C09J-0j8.js} +1 -1
- package/dist/client/assets/{checkbox-Bs5NWE_x.js → checkbox-C_yzLnRo.js} +1 -1
- package/dist/client/assets/{circle-alert-CEhC-Q81.js → circle-alert-DEWKfuYJ.js} +1 -1
- package/dist/client/assets/collapsible-e1478K7w.js +23 -0
- package/dist/client/assets/{collection-detail-CNXxywSm.js → collection-detail-12bPsl9i.js} +3 -3
- package/dist/client/assets/{collection-search-aEfiIRVT.js → collection-search-g7bCyEl4.js} +1 -1
- package/dist/client/assets/collection-tab-hxaftEha.js +1 -0
- package/dist/client/assets/{collection-table-wrapper-hM0ppyEG.js → collection-table-wrapper-Bx_0GgHe.js} +1 -1
- package/dist/client/assets/{collection-tabs-Dc6gZtTz.js → collection-tabs-CGvjmn7e.js} +1 -1
- package/dist/client/assets/{command-DI3JwfrE.js → command-DvXRXkaf.js} +1 -1
- package/dist/client/assets/{connect-C0SuJwzK.js → connect-BHcfLUsx.js} +1 -1
- package/dist/client/assets/{connection-card-CzCUOjTN.js → connection-card-Of-LfoL9.js} +1 -1
- package/dist/client/assets/connection-detail-Bfp_CthH.js +1 -0
- package/dist/client/assets/connections-CMRFgF2z.js +1 -0
- package/dist/client/assets/constants-BMZNxJu4.js +1 -0
- package/dist/client/assets/{constants-0JLhMmM7.js → constants-DLWxw8L_.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BRKsH8XB.js → create-organization-dialog-DHmNDQVx.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BUAUU3kY.js → create-project-dialog-BURFxz7l.js} +1 -1
- package/dist/client/assets/{danger--r_qw5of.js → danger-D0vNOgTj.js} +1 -1
- package/dist/client/assets/{danger-zone-fH4LWpAE.js → danger-zone-Dhz8OLxh.js} +1 -1
- package/dist/client/assets/decopilot-events-C1i2IOcF.js +1 -0
- package/dist/client/assets/{dependencies-CfLZZ12D.js → dependencies-DQgcVkpb.js} +1 -1
- package/dist/client/assets/{dialog-CzmRWg_H.js → dialog-B8ODwZHJ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-bZQdGgsX.js → dropdown-menu-Bv0kDZGf.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-B44KCK2N.js → dynamic-plugin-layout-CfJ2iWdk.js} +1 -1
- package/dist/client/assets/editable-task-title-BECK0S9m.js +16 -0
- package/dist/client/assets/{empty-state-BuKC-FeY.js → empty-state-CS91-o6R.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BUYd05S1.js → env-vars-editor-BoUKrNdn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CDK2P3aY.js → extract-connection-data-DPrPXrw7.js} +1 -1
- package/dist/client/assets/{file-browser-B8HL2Mki.js → file-browser-Dyg6fn_p.js} +2 -2
- package/dist/client/assets/{form-EW4LFI0z.js → form-Bqy3P0kv.js} +1 -1
- package/dist/client/assets/{general-B-SJAejg.js → general-CcOfiluy.js} +1 -1
- package/dist/client/assets/{grid-view-B2G72x7D.js → grid-view-uc2-Xd10.js} +1 -1
- package/dist/client/assets/{home-C_Jstend.js → home-DYjBdnSm.js} +1 -1
- package/dist/client/assets/{index-RIE02s6T.js → index-1pfseT2B.js} +1 -1
- package/dist/client/assets/{index-BeKO7nFo.js → index-5XdaBbnC.js} +1 -1
- package/dist/client/assets/{index-hfshaOuF.js → index-B1uFfuid.js} +1 -1
- package/dist/client/assets/{index-gksA6r5d.js → index-BLvVZqmB.js} +1 -1
- package/dist/client/assets/{index-kE57LLiG.js → index-Br7gqIns.js} +22 -22
- package/dist/client/assets/{index-Cp50RRud.js → index-CLZkaGlC.js} +1 -1
- package/dist/client/assets/index-CUEtQJPr.css +1 -0
- package/dist/client/assets/index-CjU9lWJN.js +1 -0
- package/dist/client/assets/{index-CzFqQvXW.js → index-DVHuYwO5.js} +4 -4
- package/dist/client/assets/{index-V5ecgDUm.js → index-tDb6lai2.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B0QSZ6Wg.js → infiniteQueryObserver-BU31NXJd.js} +1 -1
- package/dist/client/assets/{input-Rcf9et7W.js → input-CImrwNsE.js} +1 -1
- package/dist/client/assets/{integration-icon-Cr629JYK.js → integration-icon-CqdgwTQM.js} +1 -1
- package/dist/client/assets/{label-DdGHGWov.js → label-BEcdY3zl.js} +1 -1
- package/dist/client/assets/{layout-CUeJn5m4.js → layout-Cegg55DQ.js} +1 -1
- package/dist/client/assets/{layout-DvurrRZC.js → layout-D1FJR7dQ.js} +1 -1
- package/dist/client/assets/localstorage-keys-B3yhvN27.js +1 -0
- package/dist/client/assets/{login-C70j40x2.js → login-gpMZSjc_.js} +1 -1
- package/dist/client/assets/{markdown-BsZjpnFH.js → markdown-DigmZCi5.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-aRjr0jcc.js → mcp-app-renderer-elbh_bK3.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dk3osgIf.js → mcp-oauth-BJK3oSr3.js} +1 -1
- package/dist/client/assets/{mcp-server-card-znSfWcaP.js → mcp-server-card-B_3KckAV.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Csm9j29j.js → mcp-server-detail-BGmK7vBO.js} +2 -2
- package/dist/client/assets/{members-WbcVb7yX.js → members-DkvmaHrL.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-ChxkdsCv.js → monitoring-dashboard-edit-Dq449CGn.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CL8P3Zx7.js → monitoring-dashboard-view-KyEbCseW.js} +2 -2
- package/dist/client/assets/{monitoring-Dth-Uzfq.js → monitoring-mMb4oyh8.js} +2 -2
- package/dist/client/assets/{oauth-callback-CXzK_RYv.js → oauth-callback-BWIw_10O.js} +1 -1
- package/dist/client/assets/page-LuWQuTOB.js +1 -0
- package/dist/client/assets/{page-CCrDZNhS.js → page-MLghIZgZ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-D7gmiZlA.js → plugin-empty-state-BYi0xCDZ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BIuYztei.js → plugin-empty-state-CfkX75Qn.js} +1 -1
- package/dist/client/assets/{plugin-header-BLBENlfU.js → plugin-header-Bpxodj_N.js} +1 -1
- package/dist/client/assets/{plugin-header-CmlDS_hv.js → plugin-header-C8NyMNoe.js} +1 -1
- package/dist/client/assets/plugins-VAc5tGcP.js +1 -0
- package/dist/client/assets/{popover-C5F2AcFP.js → popover-R_PT2IPW.js} +1 -1
- package/dist/client/assets/{project-app-view-NryMJvXO.js → project-app-view-Bai-Qf0R.js} +1 -1
- package/dist/client/assets/project-layout-daZ99y7q.js +1 -0
- package/dist/client/assets/{project-plugins-QbLHCPXi.js → project-plugins-D9btRO1g.js} +1 -1
- package/dist/client/assets/{projects-list-B_wyuNYf.js → projects-list-DLyGtlCx.js} +1 -1
- package/dist/client/assets/{ranking-layout-CVBOyQIw.js → ranking-layout-Difw19Tu.js} +1 -1
- package/dist/client/assets/{readme-viewer-BmxWIpiS.js → readme-viewer-DMIs62Jq.js} +1 -1
- package/dist/client/assets/{registry-layout-DHUM9TZu.js → registry-layout-DUQv-gnE.js} +1 -1
- package/dist/client/assets/{registry-utils-DRX9Fl5Z.js → registry-utils-BL3Z-ZuV.js} +1 -1
- package/dist/client/assets/{reports-layout-GUNpInzx.js → reports-layout-DOweGRAi.js} +1 -1
- package/dist/client/assets/{reset-password-C_jAWNzd.js → reset-password-gTGJs4eA.js} +1 -1
- package/dist/client/assets/{resizable-CmbMtBt6.js → resizable-C-gCkuLt.js} +1 -1
- package/dist/client/assets/{save-actions-CH-zbfme.js → save-actions-CdZGxDIR.js} +1 -1
- package/dist/client/assets/{scroll-area-B5BKtcc-.js → scroll-area-DsCd8vj6.js} +1 -1
- package/dist/client/assets/{select-CSl7KVC3.js → select-CZ5oa2ZG.js} +1 -1
- package/dist/client/assets/shell-layout-D95AudRc.js +3 -0
- package/dist/client/assets/{sidebar-settings-98pHpdNk.js → sidebar-settings-DoYo5_2f.js} +1 -1
- package/dist/client/assets/{skeleton-BGGjmBE-.js → skeleton-DIOpAjh1.js} +1 -1
- package/dist/client/assets/{spinner-BubUCjpb.js → spinner-B-yGP95y.js} +1 -1
- package/dist/client/assets/{store-invite-BidZUMAQ.js → store-invite-COyr13nI.js} +1 -1
- package/dist/client/assets/{switch-D_s2nP_j.js → switch-C_rwAMG7.js} +1 -1
- package/dist/client/assets/{table-C7IfzCau.js → table-BwN-DdG1.js} +1 -1
- package/dist/client/assets/tabs-CTOkjsDF.js +1 -0
- package/dist/client/assets/tasks-CxbK_rAM.js +1 -0
- package/dist/client/assets/tasks-panel-CI07RnJW.js +1 -0
- package/dist/client/assets/{textarea-CumbsokS.js → textarea-BOlS_fKd.js} +1 -1
- package/dist/client/assets/{time-range-picker-Brh1Ym1N.js → time-range-picker-DWAp9G7R.js} +4 -4
- package/dist/client/assets/{toggle-group-DaSKpJH5.js → toggle-group-CRwxfPk7.js} +1 -1
- package/dist/client/assets/{tools-list-BvNNjQQL.js → tools-list-CQrrEoBF.js} +1 -1
- package/dist/client/assets/{tooltip-BGn6dJhi.js → tooltip-BsUirxUt.js} +1 -1
- package/dist/client/assets/{topbar-portal-mNbAP1zZ.js → topbar-portal-Cy4hr4gX.js} +1 -1
- package/dist/client/assets/{types-CnosXlf3.js → types-gEqZqH3b.js} +1 -1
- package/dist/client/assets/{use-binding-Ctbwf5zu.js → use-binding-Dx_NAnJa.js} +1 -1
- package/dist/client/assets/{use-connection-CmCfM9T5.js → use-connection-CwB1S0Lk.js} +1 -1
- package/dist/client/assets/{use-copy-Dn5NzC6Z.js → use-copy-uCRP4yn6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-b6Af6scy.js → use-create-virtual-mcp-Bm7L9HAR.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-D4coW5d-.js → use-install-from-registry-CMYlie1K.js} +1 -1
- package/dist/client/assets/use-list-state-EN77XpOY.js +1 -0
- package/dist/client/assets/{use-llm-CPv795TN.js → use-llm-C5Q0H0cZ.js} +1 -1
- package/dist/client/assets/{use-mcp-resources--6yZ25c2.js → use-mcp-resources-kkSzYGiM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BTHDM3P3.js → use-mcp-tools-CT-LTM8z.js} +1 -1
- package/dist/client/assets/{use-members-Dzw-FOpA.js → use-members-CYCHCBAZ.js} +1 -1
- package/dist/client/assets/{use-mobile-DIBT-lEk.js → use-mobile-Bot_hVI8.js} +1 -1
- package/dist/client/assets/{use-project-Bd8syAM2.js → use-project-C5wS8512.js} +1 -1
- package/dist/client/assets/{use-settings-modal-D-rqbyuf.js → use-settings-modal-TyiexX8v.js} +1 -1
- package/dist/client/assets/{use-view-mode-k6uWDVq8.js → use-view-mode-CS5zZIj8.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CaM9kbfY.js → use-virtual-mcp-CGnbrFrJ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CutnJ4kj.js +1 -0
- package/dist/client/assets/{useMutation-DsQcwaJP.js → useMutation-BskhtN65.js} +1 -1
- package/dist/client/assets/useQuery-CxvwMb--.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DrLfXfJc.js +1 -0
- package/dist/client/assets/user-BRVh4xuS.js +1 -0
- package/dist/client/assets/workflow-D7s-e1ZH.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +2 -1
- package/dist/server/server.js +2 -1
- package/package.json +1 -1
- package/dist/client/assets/AlertOctagon-Y8Xx5Uc4.js +0 -1
- package/dist/client/assets/agent-detail-ge8lRsMy.js +0 -2
- package/dist/client/assets/agents-CYp6eaDL.js +0 -1
- package/dist/client/assets/collapsible-KhZqz8s6.js +0 -1
- package/dist/client/assets/collection-tab-ByOYG4eu.js +0 -1
- package/dist/client/assets/connection-detail-FUvYBL_f.js +0 -1
- package/dist/client/assets/connections-CZWiV45b.js +0 -1
- package/dist/client/assets/constants-BnCnMsvC.js +0 -1
- package/dist/client/assets/context-CnW_lI9R.js +0 -23
- package/dist/client/assets/decopilot-events-Brt4gAR6.js +0 -1
- package/dist/client/assets/editable-thread-title-BT5MJN2M.js +0 -16
- package/dist/client/assets/index-Bl1kPuE1.css +0 -1
- package/dist/client/assets/index-CLgM5v39.js +0 -1
- package/dist/client/assets/localstorage-keys-DtK7peUq.js +0 -1
- package/dist/client/assets/page-JQWUx5cS.js +0 -1
- package/dist/client/assets/plugins-kPtsND7u.js +0 -1
- package/dist/client/assets/project-layout-CDz2d0hE.js +0 -1
- package/dist/client/assets/shell-layout-DH6hyOML.js +0 -3
- package/dist/client/assets/tabs-BzChyqs4.js +0 -1
- package/dist/client/assets/tasks-fA5J94Ed.js +0 -1
- package/dist/client/assets/use-list-state-pp-Ywt5d.js +0 -1
- package/dist/client/assets/use-mcp-prompts-Bvv0Gku4.js +0 -1
- package/dist/client/assets/use-preferences-fTjyFgCz.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BRjF-D1B.js +0 -1
- package/dist/client/assets/useQuery-BE7O7fKt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BSW1dpRq.js +0 -1
- package/dist/client/assets/workflow-BfURwr1_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as I,d as at,j as s,v as ue,t as Pe,aA as ps,o as hs,s as Re,b as rt,u as me,m as Pt,l as gs,k as vs,K as mt,B as ce,c9 as It,O as Ee,P as Et,S as et,e as ys,aE as bs}from"./index-CzFqQvXW.js";import{u as Ot}from"./use-project-Bd8syAM2.js";import{c as js,d as Ns,b as Ss,a as Lt,D as Dt}from"./dialog-CzmRWg_H.js";import{i as Tt}from"./X-BaOBrQh9.js";import{S as ne}from"./skeleton-BGGjmBE-.js";import{t as ws,i as lt,u as Cs}from"./use-settings-modal-D-rqbyuf.js";import{A as zt}from"./avatar-DX9xarA9.js";import{t as _s}from"./Settings01-CGjDKLLq.js";import{i as ks}from"./Zap-B8kjj6jV.js";import{a as As,b as Ps,c as Is,T as Es}from"./tooltip-BGn6dJhi.js";import{i as Os}from"./Check-BGWNBpXb.js";import{a as Ls}from"./Copy01-Ba42JLNP.js";import{S as Le}from"./switch-D_s2nP_j.js";import{S as Ds,a as Ts,d as We,c as zs}from"./select-CSl7KVC3.js";import{i as $s}from"./Code01-C4dpeKsY.js";import{i as Ms}from"./Shield01-QPvxKI9B.js";import{u as $t}from"./use-preferences-fTjyFgCz.js";import{n as Bs}from"./CheckDone01-DgNkGXSd.js";import{u as Gs}from"./useMutation-DsQcwaJP.js";import{a as Rs,F as Fe,b as Ue,c as Ve,d as Ke,f as Ye,e as Ws}from"./form-EW4LFI0z.js";import{I as Ie}from"./input-Rcf9et7W.js";import{i as Fs}from"./Upload01-CBnp-ZgO.js";import{P as Us}from"./project-plugins-QbLHCPXi.js";import{u as Vs,a as Ks,b as Ys,i as ie,r as Me,D as Mt,c as Be,d as fe,s as ft,e as xt,Z as Bt,g as Gt,f as Rt,h as Wt,j as ke,k as nt,l as Ge,m as it,n as Hs,o as qs,p as Ft,q as ot,t as ct,v as Ut,w as Qs,x as Vt,y as pt,z as Xs,A as Js,B as Zs,R as ea,S as ta,C as sa,E as aa,F as Kt,G as ra,H as la,I as na,J as ia,K as oa,L as ca,M as da,N as ua,O as De,P as ma,Q as ht,T as gt,U as vt,V as fa,W as Yt,X as xa,Y as Ne,_ as pa,$ as ha,a0 as ga,a1 as va,a2 as ya,a3 as He,a4 as ba,a5 as Te,a6 as ja,a7 as Na,a8 as J,a9 as Ht,aa as Sa,ab as wa,ac as Ca,ad as _a,ae as ka,af as Aa,ag as Pa,ah as Ia,ai as Ea,aj as Oa,ak as La,al as Da,am as Ta,an as za,ao as $a,ap as Ma,aq as Ba,ar as Ga}from"./chart-CA07zGfe.js";import{L as Ae}from"./label-DdGHGWov.js";import{B as Ra}from"./badge-CMOYVtO8.js";import{a as Wa,T as qe,b as Qe,c as Fa}from"./tabs-BzChyqs4.js";import{i as Ua}from"./AlertCircle-Dvy3oHwl.js";import{s as qt}from"./Plus-C48LE9QF.js";import{s as Va}from"./RefreshCcw01-B_P3Otqi.js";import{u as _e,a as dt,K as Ka}from"./constants-0JLhMmM7.js";import{h as Ya}from"./use-connection-CmCfM9T5.js";import{b as oe,a as Qt}from"./use-mcp-tools-BTHDM3P3.js";import{u as Ha}from"./use-members-Dzw-FOpA.js";import{c as qa,A as Qa}from"./use-binding-Ctbwf5zu.js";import"./useQuery-BE7O7fKt.js";import"./index-gksA6r5d.js";import"./ChevronDown-CxLgy5uI.js";import"./localstorage-keys-DtK7peUq.js";import"./Container-CH2V2ATa.js";import"./use-install-from-registry-D4coW5d-.js";import"./extract-connection-data-CDK2P3aY.js";import"./constants-BnCnMsvC.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DRX9Fl5Z.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DvHkBn5K.js";import"./index-hfshaOuF.js";import"./binder-CN-yhtfQ.js";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));Xt.displayName="Beaker01";const Jt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Jt.displayName="Bell01";function Xa(t){const e=I.c(26),{activeSection:r,onNavigate:a}=t,{data:n}=at.useSession(),l=n?.user,i=l?.image,o=l?.name??"Profile",d=l?.name??"U";let u;e[0]!==d||e[1]!==i?(u=s.jsx(zt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=u):u=e[2];let c;e[3]!==o||e[4]!==u?(c={key:"account.profile",label:o,icon:u},e[3]=o,e[4]=u,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:s.jsx(_s,{size:14})},e[6]=m):m=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={key:"account.experimental",label:"Experimental",icon:s.jsx(Xt,{size:14})},e[7]=f):f=e[7];let x;e[8]!==c?(x=[c,m,f],e[8]=c,e[9]=x):x=e[9];const h=x;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(ws,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.plugins",label:"Features",icon:s.jsx(ks,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[p,g,{key:"org.billing",label:"Billing",icon:s.jsx(lt,{size:14})}],e[12]=y):y=e[12];const S=y;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=N):N=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[N,h.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=w):w=e[18];let j;e[19]!==r||e[20]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[19]=r,e[20]=a,e[21]=j):j=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.132.0"]})}),e[22]=C):C=e[22];let k;return e[23]!==b||e[24]!==j?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,j,C]}),e[23]=b,e[24]=j,e[25]=k):k=e[25],k}function Ja(){const t=I.c(32),{data:e}=at.useSession(),[r,a]=v.useState(!1),n=e?.user,l=n?.image;let i;t[0]!==n?(i=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=n,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const u=n?.name??"U";let c;t[3]!==u||t[4]!==l?(c=s.jsx(zt,{url:l,fallback:u,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=u,t[4]=l,t[5]=c):c=t[5];const m=n?.name??"User";let f;t[6]!==m?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:m}),t[6]=m,t[7]=f):f=t[7];const x=n?.email;let h;t[8]!==x?(h=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let p;t[10]!==f||t[11]!==h?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,h]}),t[10]=f,t[11]=h,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=S):S=t[17];const N=n?.id;let b;t[18]!==N?(b=s.jsx("span",{className:"font-mono text-sm",children:N}),t[18]=N,t[19]=b):b=t[19];let w;t[20]!==r?(w=r?s.jsx(Os,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ls,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=w):w=t[21];let j;t[22]!==o||t[23]!==b||t[24]!==w?(j=s.jsx(As,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,w]})}),t[22]=o,t[23]=b,t[24]=w,t[25]=j):j=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ps,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let k;t[27]!==j?(k=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[S,s.jsx(Is,{children:s.jsxs(Es,{children:[j,C]})})]})]}),t[27]=j,t[28]=k):k=t[28];let _;return t[29]!==k||t[30]!==g?(_=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,k]}),t[29]=k,t[30]=g,t[31]=_):_=t[31],_}function Xe(t){const e=I.c(27),{icon:r,label:a,description:n,control:l,onClick:i,disabled:o}=t,d=o?void 0:i,u=i?"button":void 0,c=i&&!o?0:void 0;let m;e[0]!==o||e[1]!==i?(m=i&&!o?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=m):m=e[2];const f=i&&!o?"pointer":void 0;let x;e[3]!==f?(x={cursor:f},e[3]=f,e[4]=x):x=e[4];let h;e[5]!==r?(h=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==n?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[9]=n,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let S;e[14]!==y||e[15]!==h?(S=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,y]}),e[14]=y,e[15]=h,e[16]=S):S=e[16];let N;e[17]!==l?(N=s.jsx("div",{onClick:Za,className:"shrink-0",children:l}),e[17]=l,e[18]=N):N=e[18];let b;return e[19]!==d||e[20]!==S||e[21]!==N||e[22]!==u||e[23]!==c||e[24]!==m||e[25]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:u,tabIndex:c,onKeyDown:m,style:x,children:[S,N]}),e[19]=d,e[20]=S,e[21]=N,e[22]=u,e[23]=c,e[24]=m,e[25]=x,e[26]=b):b=e[26],b}function Za(t){return t.stopPropagation()}function yt(){const t=I.c(35),[e,r]=$t();let a;t[0]!==r?(a=async C=>{if(C&&await Notification.requestPermission()!=="granted"){Pe.error("Notifications denied. Please enable them in your browser settings."),r(tr);return}r(k=>({...k,enableNotifications:C}))},t[0]=r,t[1]=a):a=t[1];const n=a;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($s,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(er),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=C=>r(k=>({...k,devMode:C})),t[6]=r,t[7]=d):d=t[7];let u;t[8]!==e.devMode||t[9]!==d?(u=s.jsx(Le,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=u):u=t[10];let c;t[11]!==o||t[12]!==u?(c=s.jsx(Xe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:u}),t[11]=o,t[12]=u,t[13]=c):c=t[13];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Jt,{size:16}),t[14]=m):m=t[14];let f;t[15]!==n||t[16]!==e.enableNotifications?(f=s.jsx(Xe,{icon:m,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>n(!e.enableNotifications),control:s.jsx(Le,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:n})}),t[15]=n,t[16]=e.enableNotifications,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ms,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=C=>r(k=>({...k,toolApprovalLevel:C})),t[19]=r,t[20]=h):h=t[20];let p;t[21]===Symbol.for("react.memo_cache_sentinel")?(p={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=p):p=t[21];const g=p[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Ts,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let S;t[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=S):S=t[24];let N;t[25]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=N):N=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(zs,{children:[S,N,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let w;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==y?(w=s.jsx(Xe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ds,{value:e.toolApprovalLevel,onValueChange:h,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=y,t[30]=w):w=t[30];let j;return t[31]!==w||t[32]!==c||t[33]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-6",children:[l,s.jsxs("div",{className:"flex flex-col",children:[c,f,w]})]}),t[31]=w,t[32]=c,t[33]=f,t[34]=j):j=t[34],j}function er(t){return{...t,devMode:!t.devMode}}function tr(t){return{...t,enableNotifications:!1}}function bt(t){const e=I.c(22),{icon:r,label:a,description:n,checked:l,onCheckedChange:i}=t;let o;e[0]!==l||e[1]!==i?(o=()=>i(!l),e[0]=l,e[1]=i,e[2]=o):o=e[2];let d;e[3]!==r?(d=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=d):d=e[4];let u;e[5]!==a?(u=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[5]=a,e[6]=u):u=e[6];let c;e[7]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[7]=n,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m=s.jsxs("div",{className:"min-w-0",children:[u,c]}),e[9]=u,e[10]=c,e[11]=m):m=e[11];let f;e[12]!==d||e[13]!==m?(f=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[d,m]}),e[12]=d,e[13]=m,e[14]=f):f=e[14];let x;e[15]!==l||e[16]!==i?(x=s.jsx("div",{onClick:sr,className:"shrink-0",children:s.jsx(Le,{checked:l,onCheckedChange:i})}),e[15]=l,e[16]=i,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==f||e[20]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[f,x]}),e[18]=o,e[19]=f,e[20]=x,e[21]=h):h=e[21],h}function sr(t){return t.stopPropagation()}function ar(){const t=I.c(16),[e,r]=$t();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=a):a=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ps,{size:16}),t[1]=n):n=t[1];let l;t[2]!==r?(l=m=>r(f=>({...f,experimental_projects:m})),t[2]=r,t[3]=l):l=t[3];let i;t[4]!==e.experimental_projects||t[5]!==l?(i=s.jsx(bt,{icon:n,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:l}),t[4]=e.experimental_projects,t[5]=l,t[6]=i):i=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Bs,{size:16}),t[7]=o):o=t[7];let d;t[8]!==r?(d=m=>r(f=>({...f,experimental_tasks:m})),t[8]=r,t[9]=d):d=t[9];let u;t[10]!==e.experimental_tasks||t[11]!==d?(u=s.jsx(bt,{icon:o,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:e.experimental_tasks,onCheckedChange:d}),t[10]=e.experimental_tasks,t[11]=d,t[12]=u):u=t[12];let c;return t[13]!==i||t[14]!==u?(c=s.jsxs("div",{className:"flex flex-col gap-6",children:[a,s.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[i,u]})]}),t[13]=i,t[14]=u,t[15]=c):c=t[15],c}const rr=hs({name:Re().min(1,"Name is required").max(255,"Name is too long"),slug:Re().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Re().optional()});function lr(t){const e=I.c(24),{value:r,onChange:a,name:n}=t,l=v.useRef(null);let i;e[0]!==a?(i=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){Pe.error("Image must be smaller than 2MB");return}const j=new FileReader;j.onerror=()=>{const C=j.error;console.error("FileReader error:",C),Pe.error(C?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},j.onloadend=()=>{if(j.readyState===FileReader.DONE&&j.result){const C=j.result;a(C)}},j.readAsDataURL(w)}},e[0]=a,e[1]=i):i=e[1];const o=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{l.current?.click()},e[2]=d):d=e[2];const u=d;let c;e[3]!==a?(c=b=>{b.stopPropagation(),a("")},e[3]=a,e[4]=c):c=e[4];const m=c;let f;e[5]!==o?(f=s.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=f):f=e[6];let x;e[7]!==m||e[8]!==n||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:n||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:m,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Tt,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:u,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Fs,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=m,e[8]=n,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let p;e[11]!==h?(p=s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:u,className:"mb-2",children:h}),e[11]=h,e[12]=p):p=e[12];let g;e[13]!==m||e[14]!==r?(g=r&&s.jsx(ce,{type:"button",variant:"ghost",size:"sm",onClick:m,className:"ml-2",children:"Remove"}),e[13]=m,e[14]=r,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=y):y=e[16];let S;e[17]!==p||e[18]!==g?(S=s.jsxs("div",{className:"flex-1",children:[p,g,y]}),e[17]=p,e[18]=g,e[19]=S):S=e[19];let N;return e[20]!==S||e[21]!==f||e[22]!==x?(N=s.jsxs("div",{className:"flex items-start gap-4",children:[f,x,S]}),e[20]=S,e[21]=f,e[22]=x,e[23]=N):N=e[23],N}function nr(){const t=rt(),{org:e,project:r}=me(),a=Pt(),[n,l]=v.useState(!1),i=gs({resolver:vs(rr),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Gs({mutationFn:async c=>{const m={name:c.name,slug:c.slug};c.logo&&(m.logo=c.logo);const f=await at.organization.update({organizationId:e.id,data:m});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Pe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Pe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{l(!1)}}),d=c=>{l(!0),o.mutate(c)},u=i.formState.isDirty;return s.jsx(Rs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Fe,{control:i.control,name:"name",render:({field:c})=>s.jsxs(Ue,{children:[s.jsx(Ve,{children:"Organization Name"}),s.jsx(Ke,{children:s.jsx(Ie,{placeholder:"My Organization",...c,disabled:n})}),s.jsx(Ye,{})]})}),s.jsx(Fe,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(Ue,{children:[s.jsx(Ve,{children:"Organization Slug"}),s.jsx(Ke,{children:s.jsx(Ie,{placeholder:"my-organization",...c,disabled:n,onChange:m=>{const f=m.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(Ye,{})]})}),s.jsx(Fe,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(Ue,{children:[s.jsx(Ve,{children:"Logo"}),s.jsx(Ke,{children:s.jsx(lr,{value:c.value,onChange:c.onChange,name:i.watch("name")})}),s.jsx(Ye,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(ce,{type:"submit",disabled:!u||n,className:"min-w-24",children:n?"Saving...":"Save Changes"}),u&&s.jsx(ce,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:n,children:"Cancel"})]})]})})}function ir(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(nr,{})]}),t[0]=e):e=t[0],e}var jt=function(e,r){for(var a=arguments.length,n=new Array(a>2?a-2:0),l=2;l<a;l++)n[l-2]=arguments[l];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>n[i++]))}},or=["x1","y1","x2","y2","key"],cr=["offset"],dr=["xAxisId","yAxisId"],ur=["xAxisId","yAxisId"];function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){mr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function mr(t,e,r){return(e=fr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fr(t){var e=xr(t,"string");return typeof e=="symbol"?e:e+""}function xr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,n=pr(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var hr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:n,width:l,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:n,ry:o,width:l,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Zt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var n,{x1:l,y1:i,x2:o,y2:d,key:u}=r,c=ze(r,or),m=(n=nt(c))!==null&&n!==void 0?n:{},{offset:f}=m,x=ze(m,cr);a=v.createElement("line",xe({},x,{x1:l,y1:i,x2:o,y2:d,fill:"none",key:u}))}return a}function gr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,dr),d=n.map((u,c)=>{var m=Z(Z({},o),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return v.createElement(Zt,{key:"line-".concat(c),option:a,lineItemProps:m})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function vr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,ur),d=n.map((u,c)=>{var m=Z(Z({},o),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Zt,{option:a,lineItemProps:m,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function yr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:n,width:l,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var u=o.map(m=>Math.round(m+n-n)).sort((m,f)=>m-f);n!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var x=u[f+1],h=x==null,p=h?n+i-m:x-m;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:m,x:a,height:p,width:l,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function br(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:n,y:l,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var u=d.map(m=>Math.round(m+n-n)).sort((m,f)=>m-f);n!==u[0]&&u.unshift(0);var c=u.map((m,f)=>{var x=u[f+1],h=x==null,p=h?n+i-m:x-m;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:m,y:l,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var jr=(t,e)=>{var{xAxis:r,width:a,height:n,offset:l}=t;return Gt(Rt(Z(Z(Z({},ke),r),{},{ticks:Wt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.left,l.left+l.width,e)},Nr=(t,e)=>{var{yAxis:r,width:a,height:n,offset:l}=t;return Gt(Rt(Z(Z(Z({},ke),r),{},{ticks:Wt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.top,l.top+l.height,e)},Sr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Mt.grid};function es(t){var e=Vs(),r=Ks(),a=Ys(),n=Z(Z({},Me(t,Sr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:l,yAxisId:i,x:o,y:d,width:u,height:c,syncWithTicks:m,horizontalValues:f,verticalValues:x}=n,h=Be(),p=fe(_=>ft(_,"xAxis",l,h)),g=fe(_=>ft(_,"yAxis",i,h));if(!xt(u)||!xt(c)||!ie(o)||!ie(d))return null;var y=n.verticalCoordinatesGenerator||jr,S=n.horizontalCoordinatesGenerator||Nr,{horizontalPoints:N,verticalPoints:b}=n;if((!N||!N.length)&&typeof S=="function"){var w=f&&f.length,j=S({yAxis:g?Z(Z({},g),{},{ticks:w?f:g.ticks}):void 0,width:e??u,height:r??c,offset:a},w?!0:m);jt(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(N=j)}if((!b||!b.length)&&typeof y=="function"){var C=x&&x.length,k=y({xAxis:p?Z(Z({},p),{},{ticks:C?x:p.ticks}):void 0,width:e??u,height:r??c,offset:a},C?!0:m);jt(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(b=k)}return v.createElement(Bt,{zIndex:n.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(hr,{fill:n.fill,fillOpacity:n.fillOpacity,x:n.x,y:n.y,width:n.width,height:n.height,ry:n.ry}),v.createElement(yr,xe({},n,{horizontalPoints:N})),v.createElement(br,xe({},n,{verticalPoints:b})),v.createElement(gr,xe({},n,{offset:a,horizontalPoints:N,xAxis:p,yAxis:g})),v.createElement(vr,xe({},n,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}es.displayName="CartesianGrid";var ts=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ss=(t,e,r)=>Ut(t,"xAxis",ot(t,e),r),as=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),rs=(t,e,r)=>Ut(t,"yAxis",ct(t,e),r),wr=Ge([it,ts,as,ss,rs],(t,e,r,a,n)=>Vt(t,"xAxis")?pt(e,a,!1):pt(r,n,!1)),Cr=(t,e)=>e,ls=Ge([Xs,Cr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),ns=t=>{var e=it(t),r=Vt(e,"xAxis");return r?"yAxis":"xAxis"},_r=(t,e)=>{var r=ns(t);return r==="yAxis"?ct(t,e):ot(t,e)},kr=(t,e,r)=>Js(t,ns(t),_r(t,e),r),Ar=Ge([ls,kr],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,n=Qs(t);if(!(a==null||n==null)){var l=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=l?.find(o=>o.key===n);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Pr=Ge([it,ts,as,ss,rs,Ar,Hs,wr,ls,qs],(t,e,r,a,n,l,i,o,d,u)=>{var{chartData:c,dataStartIndex:m,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||n==null||a.length===0||n.length===0||o==null)){var{data:x}=d,h;if(x&&x.length>0?h=x:h=c?.slice(m,f+1),h!=null)return Hr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:n,dataStartIndex:m,areaSettings:d,stackedData:l,displayedData:h,chartBaseValue:u,bandSize:o})}}),Ir=["id"],Er=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function is(t,e){if(t==null)return{};var r,a,n=Or(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Or(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function St(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(a){Lr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Lr(t,e,r){return(e=Dr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dr(t){var e=Tr(t,"string");return typeof e=="symbol"?e:e+""}function Tr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var zr=t=>{var{dataKey:e,name:r,stroke:a,fill:n,legendType:l,hide:i}=t;return[{inactive:i,dataKey:e,type:l,color:$e(a,n),value:Kt(r,e),payload:t}]},$r=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:n,fill:l,name:i,hide:o,unit:d,tooltipType:u,id:c}=t,m={dataDefinedOnItem:r,getPosition:la,settings:{stroke:a,strokeWidth:n,fill:l,dataKey:e,nameKey:void 0,name:Kt(i,e),hide:o,type:u,color:$e(a,l),unit:d,graphicalItemId:c}};return v.createElement(ra,{tooltipEntrySettings:m})});function Mr(t){var{clipPathId:e,points:r,props:a}=t,{needClip:n,dot:l,dataKey:i}=a,o=nt(a);return v.createElement(ba,{points:r,dot:l,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:n,clipPathId:e})}function Br(t){var{showLabels:e,children:r,points:a}=t,n=a.map(l=>{var i,o,d={x:(i=l.x)!==null&&i!==void 0?i:0,y:(o=l.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:l.value,payload:l.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(va,{value:e?n:void 0},r)}function wt(t){var{points:e,baseLine:r,needClip:a,clipPathId:n,props:l}=t,{layout:i,type:o,stroke:d,connectNulls:u,isRange:c}=l,{id:m}=l,f=is(l,Ir),x=nt(f),h=ya(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(De,{clipPath:a?"url(#clipPath-".concat(n,")"):void 0},v.createElement(He,pe({},h,{id:m,points:e,connectNulls:u,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(He,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:u,fill:"none",points:e})),d!=="none"&&c&&v.createElement(He,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:u,fill:"none",points:r}))),v.createElement(Mr,{points:e,props:f,clipPathId:n}))}function Gr(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.y,d=(r=l[l.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...l.map(m=>m.x||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(m=>m.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-u,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(u)}):null}function Rr(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.x,d=(r=l[l.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var u=a*Math.abs(o-d),c=Math.max(...l.map(m=>m.y||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(m=>m.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Wr(t){var{alpha:e,layout:r,points:a,baseLine:n,strokeWidth:l}=t;return r==="vertical"?v.createElement(Gr,{alpha:e,points:a,baseLine:n,strokeWidth:l}):v.createElement(Rr,{alpha:e,points:a,baseLine:n,strokeWidth:l})}function Fr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:c,animationEasing:m,onAnimationStart:f,onAnimationEnd:x}=a,h=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),p=fa(h,"recharts-area-"),g=Yt(),[y,S]=v.useState(!1),N=!y,b=v.useCallback(()=>{typeof x=="function"&&x(),S(!1)},[x]),w=v.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);if(g==null)return null;var j=n.current,C=l.current;return v.createElement(Br,{showLabels:N,points:i},a.children,v.createElement(xa,{animationId:p,begin:u,duration:c,isActive:d,easing:m,onAnimationEnd:b,onAnimationStart:w,key:p},k=>{if(j){var _=j.length/i.length,E=k===1?i:i.map((A,L)=>{var O=Math.floor(L*_);if(j[O]){var D=j[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),z;return ie(o)?z=Ne(C,o,k):pa(o)||ha(o)?z=Ne(C,0,k):z=o.map((A,L)=>{var O=Math.floor(L*_);if(Array.isArray(C)&&C[O]){var D=C[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),k>0&&(n.current=E,l.current=z),v.createElement(wt,{points:E,baseLine:z,needClip:e,clipPathId:r,props:a})}return k>0&&(n.current=i,l.current=o),v.createElement(De,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Wr,{alpha:k,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(De,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(wt,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(ga,{label:a.label}))}function Ur(t){var{needClip:e,clipPathId:r,props:a}=t,n=v.useRef(null),l=v.useRef();return v.createElement(Fr,{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l})}class Vr extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:n,top:l,left:i,needClip:o,xAxisId:d,yAxisId:u,width:c,height:m,id:f,baseLine:x,zIndex:h}=this.props;if(e)return null;var p=It("recharts-area",n),g=f,{r:y,strokeWidth:S}=da(r),N=ua(r),b=y*2+S,w=o?"url(#clipPath-".concat(N?"":"dots-").concat(g,")"):void 0;return v.createElement(Bt,{zIndex:h},v.createElement(De,{className:p},o&&v.createElement("defs",null,v.createElement(ma,{clipPathId:g,xAxisId:d,yAxisId:u}),!N&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:l-b/2,width:c+b,height:m+b}))),v.createElement(Ur,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}),this.props.isRange&&Array.isArray(x)&&v.createElement(ht,{points:x,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}))}}var os={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Mt.area};function Kr(t){var e,r=Me(t,os),{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,connectNulls:o,dot:d,fill:u,fillOpacity:c,hide:m,isAnimationActive:f,legendType:x,stroke:h,xAxisId:p,yAxisId:g}=r,y=is(r,Er),S=na(),N=ia(),{needClip:b}=oa(p,g),w=Be(),{points:j,isRange:C,baseLine:k}=(e=fe(O=>Pr(O,t.id,w)))!==null&&e!==void 0?e:{},_=ca();if(S!=="horizontal"&&S!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:E,width:z,x:A,y:L}=_;return!j||!j.length?null:v.createElement(Vr,pe({},y,{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,baseLine:k,connectNulls:o,dot:d,fill:u,fillOpacity:c,height:E,hide:m,layout:S,isAnimationActive:f==="auto"?!ja.isSsr:f,isRange:C,legendType:x,needClip:b,points:j,stroke:h,width:z,left:A,top:L,xAxisId:p,yAxisId:g}))}var Yr=(t,e,r,a,n)=>{var l=r??e;if(ie(l))return l;var i=t==="horizontal"?n:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return l==="dataMin"?u:l==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return l==="dataMin"?o[0]:l==="dataMax"?o[1]:o[0]};function Hr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:n,layout:l,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:c,xAxisTicks:m,yAxisTicks:f,bandSize:x}=t,h=n&&n.length,p=Yr(l,i,r,o,d),g=l==="horizontal",y=!1,S=u.map((b,w)=>{var j,C,k,_;if(h)_=n[c+w];else{var E=gt(b,a);Array.isArray(E)?(_=E,y=!0):_=[p,E]}var z=(j=(C=_)===null||C===void 0?void 0:C[1])!==null&&j!==void 0?j:null,A=z==null||h&&!e&>(b,a)==null;if(g){var L;return{x:vt({axis:o,ticks:m,bandSize:x,entry:b,index:w}),y:A?null:(L=d.scale.map(z))!==null&&L!==void 0?L:null,value:_,payload:b}}return{x:A?null:(k=o.scale.map(z))!==null&&k!==void 0?k:null,y:vt({axis:d,ticks:f,bandSize:x,entry:b,index:w}),value:_,payload:b}}),N;return h||y?N=S.map(b=>{var w,j=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:j!=null&&b.y!=null&&(C=d.scale.map(j))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:j!=null&&(w=o.scale.map(j))!==null&&w!==void 0?w:null,y:b.y,payload:b.payload}}):N=g?d.scale.map(p):o.scale.map(p),{points:S,baseLine:N??0,isRange:y}}function qr(t){var e=Me(t,os),r=Be();return v.createElement(ea,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ta,{legendPayload:zr(e)}),v.createElement($r,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(sa,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:aa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Kr,pe({},e,{id:a}))))}var cs=v.memo(qr,Zs);cs.displayName="Area";var Qr=["type"],Xr=["dangerouslySetInnerHTML","ticks","scale"],Jr=["id","scale"];function tt(){return tt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},tt.apply(null,arguments)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function _t(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(a){Zr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Zr(t,e,r){return(e=el(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function el(t){var e=tl(t,"string");return typeof e=="symbol"?e:e+""}function tl(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function st(t,e){if(t==null)return{};var r,a,n=sl(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function sl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function al(t){var e=Ht(),r=v.useRef(null),a=Yt(),{type:n}=t,l=st(t,Qr),i=Da(a,"yAxis",n),o=v.useMemo(()=>{if(i!=null)return _t(_t({},l),{},{type:i})},[i,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(Sa(o)):r.current!==o&&e(wa({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(Ca(r.current)),r.current=null)},[e]),null}function rl(t){var{yAxisId:e,className:r,width:a,label:n}=t,l=v.useRef(null),i=v.useRef(null),o=fe(_a),d=Be(),u=Ht(),c="yAxis",m=fe(j=>ka(j,e)),f=fe(j=>Aa(j,e)),x=fe(j=>Pa(j,c,e,d)),h=fe(j=>Ia(j,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!m||Ea(n)||v.isValidElement(n)||h==null)){var j=l.current;if(j){var C=j.getCalculatedWidth();Math.round(m.width)!==Math.round(C)&&u(Oa({id:e,width:C}))}}},[x,m,u,n,e,a,h]),m==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,S=st(t,Xr),{id:N,scale:b}=h,w=st(h,Jr);return v.createElement(La,tt({},S,w,{ref:l,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:m.width,height:m.height,className:It("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var ll={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,width:J.width,yAxisId:0},nl=t=>{var e=Me(t,ll);return v.createElement(v.Fragment,null,v.createElement(al,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(rl,e))},ds=v.memo(nl,Na);ds.displayName="YAxis";var il=["axis"],ol=v.forwardRef((t,e)=>v.createElement(Ta,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:il,tooltipPayloadSearcher:za,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const n=new Date(r),l=t==="7d"?7:t==="30d"?30:90;return n.setDate(n.getDate()-l),{startDate:n.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function V(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const us="gateway-chip-period";function cl(){try{const t=localStorage.getItem(us);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function dl(t){try{localStorage.setItem(us,t)}catch{}}const ul={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},ml={daily:"daily",weekly:"weekly",monthly:"monthly"},fl=[5,10,25,50,100],xl=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function pl(t){const e=I.c(51),{open:r,onOpenChange:a,connectionId:n,currentLimitUsd:l,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[u,c]=v.useState(null),[m,f]=v.useState(""),[x,h]=v.useState(null),[p,g]=v.useState(null),[y,S]=v.useState(o??"none");let N;e[0]!==n||e[1]!==d.id?(N={connectionId:n,orgId:d.id},e[0]=n,e[1]=d.id,e[2]=N):N=e[2];const b=_e(N);let w;e[3]!==b?(w={client:b},e[3]=b,e[4]=w):w=e[4];const{mutate:j,isPending:C}=Qt(w),k=Pt(),_=i==="postpaid";let E;e[5]!==m?(E=m?Number.parseFloat(m):null,e[5]=m,e[6]=E):E=e[6];const A=u??E,L=y==="none"?null:y,O=_&&A!=null&&A===l&&L===o;let D;e[7]!==b?(D=Ka.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let K;e[9]!==G||e[10]!==k?(K=async()=>{await k.invalidateQueries({queryKey:G,exact:!0}),await k.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=k,e[11]=K):K=e[11];const F=K;let T,$;e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==A||e[16]!==_||e[17]!==y||e[18]!==j||e[19]!==a||e[20]!==F?($=()=>{if(!A||A<=0)return;const B=_?A:l+A;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};_&&(ae.limit_period=y),j({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await F(),te?.checkout_url?h(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),h(null),g(null),S(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=l,e[15]=A,e[16]=_,e[17]=y,e[18]=j,e[19]=a,e[20]=F,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=_?"Configure Spending Limit":"Add Credit",H=_?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=_?"New limit":"Select amount",U=_?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(js,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(Ns,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let R;e[27]!==q||e[28]!==ee?(R=s.jsxs(Ss,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=R):R=e[29];let W;e[30]!==M||e[31]!==x||e[32]!==U||e[33]!==l||e[34]!==m||e[35]!==A||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==_||e[40]!==O||e[41]!==y||e[42]!==u?(W=x?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(ce,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:x,children:[s.jsx(lt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:fl.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",u===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:_?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Ie,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:m,onChange:B=>{f(B.target.value),c(null)}})]})]}),_&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:xl.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>S(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:_?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:l>0?V(l):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:V(l)})]})}),s.jsx(ce,{onClick:$,disabled:C||!A||A<=0||O,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=x,e[32]=U,e[33]=l,e[34]=m,e[35]=A,e[36]=p,e[37]=$,e[38]=C,e[39]=_,e[40]=O,e[41]=y,e[42]=u,e[43]=W):W=e[43];let Q;e[44]!==R||e[45]!==W?(Q=s.jsxs(Lt,{className:"sm:max-w-md",children:[R,W]}),e[44]=R,e[45]=W,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Dt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function hl(t){const e=I.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:n,avgDailySpend:l}=r;if(a==null)return null;let i;e[0]!==n?(i=n?new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=n,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let u;e[2]!==a||e[3]!==d?(u=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=m):m=e[7];let f;e[8]!==l?(f=V(l),e[8]=l,e[9]=f):f=e[9];let x;e[10]!==f?(x=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const p=ul[r.confidence];let g;e[14]!==p?(g=s.jsx(Ra,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==u||e[18]!==c||e[19]!==x||e[20]!==h?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[u,c,m,x,h,g]}),e[16]=g,e[17]=u,e[18]=c,e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function gl(t){const e=I.c(37),{usage:r,limit:a,limitPeriod:n,onConfigureLimit:l,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let u;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(u=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=u):u=e[3];const c=u;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=m):m=e[4];let f;e[5]!==r.total?(f=V(r.total),e[5]=r.total,e[6]=f):f=e[6];let x;e[7]!==f?(x=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=x):x=e[8];let h;e[9]!==d||e[10]!==a.total||e[11]!==n?(h=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a.total)," limit",n&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Va,{size:10}),ml[n]]})]}),e[9]=d,e[10]=a.total,e[11]=n,e[12]=h):h=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==x||e[16]!==h||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,x,h,p]}),e[15]=x,e[16]=h,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(qt,{size:16}),e[19]=y):y=e[19];const S=d?"Configure Limit":"Set Limit";let N;e[20]!==l||e[21]!==S?(N=s.jsxs(ce,{onClick:l,variant:"outline",className:"gap-2",children:[y,S]}),e[20]=l,e[21]=S,e[22]=N):N=e[22];let b;e[23]!==N||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,N]}),e[23]=N,e[24]=g,e[25]=b):b=e[25];let w;e[26]!==d||e[27]!==a.reset||e[28]!==c?(w=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=w):w=e[29];let j;e[30]!==o||e[31]!==i?(j=s.jsx(ms,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=j):j=e[32];let C;return e[33]!==b||e[34]!==w||e[35]!==j?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,w,j]}),e[33]=b,e[34]=w,e[35]=j,e[36]=C):C=e[36],C}function vl(t){const e=I.c(30),{available:r,total:a,estimation:n,onAddCredit:l,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=u):u=e[0];let c;e[1]!==r?(c=V(r),e[1]=r,e[2]=c):c=e[2];let m;e[3]!==c?(m=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=m):m=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==m||e[8]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,m,f]}),e[7]=m,e[8]=f,e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(qt,{size:16}),e[10]=h):h=e[10];let p;e[11]!==l?(p=s.jsxs(ce,{onClick:l,className:"gap-2 px-5",children:[h,"Add Credit"]}),e[11]=l,e[12]=p):p=e[12];let g;e[13]!==x||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[x,p]}),e[13]=x,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[V(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let S;e[20]!==n?(S=s.jsx(hl,{estimation:n}),e[20]=n,e[21]=S):S=e[21];let N;e[22]!==o||e[23]!==i?(N=s.jsx(ms,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=N):N=e[24];let b;return e[25]!==S||e[26]!==N||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,S,N]}),e[25]=S,e[26]=N,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function ms(t){const e=I.c(78),{connectionId:r,alert:a,billingMode:n}=t,{org:l}=me(),[i,o]=v.useState(!1),[d,u]=v.useState(a.enabled),[c,m]=v.useState(String(a.threshold_usd)),[f,x]=v.useState(a.email??""),[h,p]=v.useState(!1),[g,y]=v.useState(null);let S;e[0]!==r||e[1]!==l.id?(S={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=S):S=e[2];const N=_e(S);let b;e[3]!==N?(b={client:N},e[3]=N,e[4]=b):b=e[4];const{mutate:w,isPending:j}=Qt(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let k;e[5]!==f||e[6]!==d||e[7]!==w||e[8]!==c?(k=()=>{y(null),p(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=w,e[8]=c,e[9]=k):k=e[9];const _=k,E=n==="postpaid"?"Usage Alert":"Low-Balance Alert",z=n==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Ua,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==E?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[12]=E,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==n?(ve=a.enabled?n==="postpaid"?`Enabled · Alert at ${V(a.threshold_usd)}`:`Enabled · Alert below ${V(a.threshold_usd)}`:n==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=n,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Oe;return e[25]!==je||e[26]!==be?(Oe=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Oe):Oe=e[27],Oe}let A;e[28]!==E?(A=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[28]=E,e[29]=A):A=e[29];let L;e[30]!==z?(L=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=L):L=e[31];let O;e[32]!==A||e[33]!==L?(O=s.jsxs("div",{children:[A,L]}),e[32]=A,e[33]=L,e[34]=O):O=e[34];let D;e[35]!==d?(D=s.jsx(Le,{checked:d,onCheckedChange:u}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==O||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[O,D]}),e[37]=O,e[38]=D,e[39]=G):G=e[39];const K=!d&&"opacity-50 pointer-events-none";let F;e[40]!==K?(F=ue("flex flex-col gap-3 transition-opacity",K),e[40]=K,e[41]=F):F=e[41];const T=n==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(Ae,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>m(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Ie,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ae,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>x(X.target.value),e[52]=ee):ee=e[52];let R;e[53]!==f?(R=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Ie,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=R):R=e[54];let W;e[55]!==U||e[56]!==R?(W=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,R]}),e[55]=U,e[56]=R,e[57]=W):W=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==F||e[61]!==W||e[62]!==Q?(se=s.jsxs("div",{className:F,children:[W,Q]}),e[60]=F,e[61]=W,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==h?(B=h&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=h,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=j||!C,te=j?"Saving...":"Save Alert";let le;e[67]!==_||e[68]!==re||e[69]!==te?(le=s.jsx(ce,{size:"sm",className:"h-7 text-xs",onClick:_,disabled:re,children:te}),e[67]=_,e[68]=re,e[69]=te,e[70]=le):le=e[70];let de;e[71]!==B||e[72]!==le?(de=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=de):de=e[73];let P;return e[74]!==se||e[75]!==de||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,de]}),e[74]=se,e[75]=de,e[76]=G,e[77]=P):P=e[77],P}const yl={cost:{label:"Cost",color:"var(--chart-1)"}};function bl(){const t=I.c(54),{org:e}=me(),[r,a]=v.useState("30d");let n;t[0]!==r?(n=ut(r),t[0]=r,t[1]=n):n=t[1];const l=n;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=_e(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let u;t[5]!==l?(u={widget:d,timeRange:l},t[5]=l,t[6]=u):u=t[6];let c;t[7]!==o||t[8]!==u?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:u,staleTime:6e4,select:Ce},t[7]=o,t[8]=u,t[9]=c):c=t[9];const{data:m}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let x;t[11]!==l?(x={widget:f,timeRange:l},t[11]=l,t[12]=x):x=t[12];let h;t[13]!==o||t[14]!==x?(h={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:x,staleTime:6e4,select:Ce},t[13]=o,t[14]=x,t[15]=h):h=t[15];const{data:p}=oe(h);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title"}},t[16]=g):g=t[16];let y;t[17]!==l?(y={widget:g,timeRange:l},t[17]=l,t[18]=y):y=t[18];let S;t[19]!==o||t[20]!==y?(S={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=S):S=t[21];const{data:N}=oe(S);let b;t[22]!==m?.timeseries?(b=m?.timeseries??[],t[22]=m?.timeseries,t[23]=b):b=t[23];let w;t[24]!==b?(w=b.map(_l),t[24]=b,t[25]=w):w=t[25];const j=w;let C;if(t[26]!==p?.value||t[27]!==j||t[28]!==N?.groups||t[29]!==m?.timeseries||t[30]!==r){const k=(m?.timeseries??[]).reduce(Cl,0),_=p?.value??0,E=(N?.groups??[]).filter(wl).sort(Sl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let A;t[32]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=A):A=t[32];const L=V(k);let O;t[33]!==L?(O=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:L}),t[33]=L,t[34]=O):O=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==O||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[O,D]}),t[37]=O,t[38]=D,t[39]=G):G=t[39];let K;t[40]!==_?(K=_.toLocaleString(),t[40]=_,t[41]=K):K=t[41];let F;t[42]!==K?(F=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[K," tool calls"]}),t[42]=K,t[43]=F):F=t[43];let T;t[44]!==G||t[45]!==F?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[A,G,F]}),t[44]=G,t[45]=F,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(fs,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==j?(H=j.length>0?s.jsx($a,{config:yl,className:"h-[200px] w-full",children:s.jsxs(ol,{data:j,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(es,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ma,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(ds,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:Nl}),s.jsx(Ba,{content:s.jsx(Ga,{formatter:jl})}),s.jsx(cs,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=j,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,E.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:E.map((M,U)=>{const q=k>0?Math.min(M.value/k*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:V(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=j,t[28]=N?.groups,t[29]=m?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function jl(t){return V(t)}function Nl(t){return`$${t}`}function Sl(t,e){return e.value-t.value}function wl(t){return t.value>0}function Cl(t,e){return t+e.value}function _l(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function kl(){const t=I.c(6),[e,r]=v.useState(cl);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{r(u),dl(u)},t[0]=a):a=t[0];const n=a;let l,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=l,t[2]=i):(l=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[l,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(u=>s.jsx("button",{type:"button",onClick:()=>n(u),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===u?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:u},u))})]}),t[4]=e,t[5]=d):d=t[5],d}function Je(t){const e=I.c(20),{label:r,value:a,subValue:n,maxValue:l,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const u=d,c=l>0?Math.min(u/l*100,100):0;let m;e[2]!==r?(m=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=m):m=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const x=`${c}%`;let h;e[6]!==x?(h={width:x},e[6]=x,e[7]=h):h=e[7];let p;e[8]!==f||e[9]!==h?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:h})}),e[8]=f,e[9]=h,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==n?(y=n&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:n}),e[13]=n,e[14]=y):y=e[14];let S;return e[15]!==m||e[16]!==p||e[17]!==g||e[18]!==y?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[m,p,g,y]}),e[15]=m,e[16]=p,e[17]=g,e[18]=y,e[19]=S):S=e[19],S}function Ze(t){const e=I.c(8),{title:r,children:a,empty:n}=t;let l;e[0]!==r?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=l):l=e[1];let i;e[2]!==a||e[3]!==n?(i=n?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==l||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[l,i]}),e[5]=l,e[6]=i,e[7]=o):o=e[7],o}const kt={"7d":"7 days","30d":"30 days","90d":"90 days"};function fs(t){const e=I.c(4),{period:r,onPeriodChange:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Object.keys(kt),e[0]=n):n=e[0];let l;return e[1]!==a||e[2]!==r?(l=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:n.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:kt[i]},i))}),e[1]=a,e[2]=r,e[3]=l):l=e[3],l}function At(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,n)=>n.cost-a.cost)}function Al(){const t=I.c(27),{org:e}=me(),[r,a]=v.useState("30d"),n=ut(r),{data:l}=Ha(),i=l?.data?.members??[],o=new Map(i.map(Dl));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const u=_e(d),c=P=>({client:u,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn}}},timeRange:n},staleTime:6e4,select:Ce}),{data:m,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title"})),{data:x,isLoading:h}=oe(c({fn:"count_all",groupByColumn:"connection_title"})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id"})),{data:y,isLoading:S}=oe(c({fn:"count_all",groupByColumn:"user_id"})),{data:N,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name"}));let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w={fn:"count_all",groupByColumn:"tool_name"},t[2]=w):w=t[2];const{data:j,isLoading:C}=oe(c(w));if(f||h||g||S||b||C){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Ll)})]}),t[4]=X):X=t[4],X}const _=At(m?.groups??[],x?.groups??[]),E=At(p?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=j?.groups??[],A=new Map((N?.groups??[]).map(Ol)),L=z.map(P=>({name:P.key,calls:P.value,cost:A.get(P.key)??0})).sort(El).slice(0,20),O=_.reduce(Il,0),D=_.reduce(Pl,0),G=_[0]?.cost??1,K=E[0]?.cost??1,F=L[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(fs,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=_.length===0,H=_.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Ze,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=E.length===0,ee=E.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:K,color:"bg-chart-4"},P.key));let R;t[12]!==ee?(R=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=R):R=t[13];let W;t[14]!==R||t[15]!==q?(W=s.jsx(Ze,{title:"Cost by User",empty:q,children:R}),t[14]=R,t[15]=q,t[16]=W):W=t[16];const Q=Ze,se="Top Tools",B=L.length===0,ae="space-y-2.5",re=L.slice(0,8).map(P=>s.jsx(Je,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?V(P.cost):void 0,maxValue:F,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let de;return t[23]!==W||t[24]!==le||t[25]!==U?(de=s.jsxs("div",{className:$,children:[U,W,le]}),t[23]=W,t[24]=le,t[25]=U,t[26]=de):de=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:V(O)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),de]})}function Pl(t,e){return t+e.calls}function Il(t,e){return t+e.cost}function El(t,e){return e.calls-t.calls}function Ol(t){return[t.key,t.value]}function Ll(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Dl(t){return[t.userId,t.user.name??t.user.email]}function Tl(t,e){const r=new Map;for(const a of t){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,n])=>({month:a,...n})).reverse()}function zl(){const t=I.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let n;t[1]!==e.id?(n={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=n):n=t[2];const l=_e(n);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a},t[3]=i):i=t[3];let o;t[4]!==l?(o={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=l,t[5]=o):o=t[5];const{data:d,isLoading:u}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a},t[6]=c):c=t[6];let m;t[7]!==l?(m={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=l,t[8]=m):m=t[8];const{data:f,isLoading:x}=oe(m);if(u||x){let w;return t[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=w):w=t[9],w}let h,p,g,y,S;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const w=Tl(d?.timeseries??[],f?.timeseries??[]);S="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=h):h=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=w.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:w.map($l)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=h,t[13]=p,t[14]=g,t[15]=y,t[16]=S}else h=t[12],p=t[13],g=t[14],y=t[15],S=t[16];let N;t[19]!==p||t[20]!==g||t[21]!==y?(N=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=N):N=t[22];let b;return t[23]!==h||t[24]!==N||t[25]!==S?(b=s.jsxs("div",{className:S,children:[h,N]}),t[23]=h,t[24]=N,t[25]=S,t[26]=b):b=t[26],b}function $l(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:V(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function Ml(t){const e=I.c(31),{connectionId:r}=t,{org:a}=me(),[n,l]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=_e(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==o?(u={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Bl},e[4]=o,e[5]=u):u=e[5];const{data:c,isLoading:m}=oe(u);if(m){let E;return e[6]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=E):E=e[6],E}if(!c)return null;const f=c.limit.remaining??0,x=c.limit.total??0,h=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let S;e[7]!==c.alert?(S=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=S):S=e[8];const N=S,b=c.limit,w=p==="postpaid"&&(x==null||x===0);let j;e[9]!==N||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==x||e[17]!==h?(j=p==="postpaid"?s.jsx(gl,{usage:h,limit:b,limitPeriod:g,onConfigureLimit:()=>l(!0),connectionId:r,alert:N}):s.jsx(vl,{available:f,total:x,estimation:y,onAddCredit:()=>l(!0),connectionId:r,alert:N}),e[9]=N,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=x,e[17]=h,e[18]=j):j=e[18];let C;e[19]!==w?(C=w&&s.jsx(kl,{}),e[19]=w,e[20]=C):C=e[20];let k;e[21]!==p||e[22]!==r||e[23]!==n||e[24]!==g||e[25]!==x?(k=s.jsx(pl,{open:n,onOpenChange:l,connectionId:r,currentLimitUsd:x,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=n,e[24]=g,e[25]=x,e[26]=k):k=e[26];let _;return e[27]!==j||e[28]!==C||e[29]!==k?(_=s.jsxs(s.Fragment,{children:[j,C,k]}),e[27]=j,e[28]=C,e[29]=k,e[30]=_):_=e[30],_}function Bl(t){return t.structuredContent}function Gl(t){const e=I.c(11),{gatewayConnectionId:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=a):a=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Wa,{variant:"underline",children:[s.jsx(qe,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(qe,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(qe,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&s.jsx(Ml,{connectionId:r}),e[2]=r,e[3]=l):l=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(bl,{}),e[4]=i):i=e[4];let o;e[5]!==l?(o=s.jsxs(Qe,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[l,i]}),e[5]=l,e[6]=o):o=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{value:"breakdown",className:"pt-2",children:s.jsx(Al,{})}),e[7]=d):d=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qe,{value:"history",className:"pt-2",children:s.jsx(zl,{})}),e[8]=u):u=e[8];let c;return e[9]!==o?(c=s.jsxs(s.Fragment,{children:[a,s.jsxs(Fa,{defaultValue:"summary",variant:"underline",children:[n,o,d,u]})]}),e[9]=o,e[10]=c):c=e[10],c}function Rl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Wl(){const t=I.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(lt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Fl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Wl,{}):this.props.children}}function Ul(){const t=I.c(4),e=Ya();let r;t[0]!==e?(r=e.find(Vl),t[0]=e,t[1]=r):r=t[1];const n=r?.id??null;let l;return t[2]!==n?(l=s.jsx(Gl,{gatewayConnectionId:n}),t[2]=n,t[3]=l):l=t[3],l}function Vl(t){return qa(t,Qa)}function Kl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Fl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Rl,{}),children:s.jsx(Ul,{})})})}),t[0]=e):e=t[0],e}function xs(){const t=I.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Yl(t){const e=I.c(14),{projectSlug:r,children:a}=t,{org:n}=me(),{data:l,isLoading:i}=Ot(n.id,r);if(i||!l){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(xs,{}),e[0]=m):m=e[0],m}const o=r===Ee;let d;e[1]!==l.description||e[2]!==l.enabledPlugins||e[3]!==l.id||e[4]!==l.name||e[5]!==l.organizationId||e[6]!==l.slug||e[7]!==l.ui||e[8]!==o?(d={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:o},e[1]=l.description,e[2]=l.enabledPlugins,e[3]=l.id,e[4]=l.name,e[5]=l.organizationId,e[6]=l.slug,e[7]=l.ui,e[8]=o,e[9]=d):d=e[9];const u=d;let c;return e[10]!==a||e[11]!==u||e[12]!==n?(c=s.jsx(Et,{org:n,project:u,children:a}),e[10]=a,e[11]=u,e[12]=n,e[13]=c):c=e[13],c}function Hl(t){const e=I.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ja,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"account.experimental":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ar,{}),e[2]=a):a=e[2],a}case"org.general":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ir,{}),e[3]=a):a=e[3],a}case"org.plugins":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Yl,{projectSlug:Ee,children:s.jsx(Us,{})}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function ql(){const t=I.c(23),{isOpen:e,activeSection:r,open:a,close:n}=Cs();let l;t[0]!==n?(l=g=>!g&&n(),t[0]=n,t[1]=l):l=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=i):i=t[2];let o;t[3]!==r||t[4]!==a?(o=s.jsx(v.Suspense,{fallback:i,children:s.jsx(Xa,{activeSection:r,onNavigate:a})}),t[3]=r,t[4]=a,t[5]=o):o=t[5];let d,u;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Tt,{size:16}),u=s.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=u):(d=t[6],u=t[7]);let c;t[8]!==n?(c=s.jsxs("button",{type:"button",onClick:n,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,u]}),t[8]=n,t[9]=c):c=t[9];let m;t[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(xs,{}),t[10]=m):m=t[10];let f;t[11]!==r?(f=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:m,children:s.jsx(Hl,{section:r})})}),t[11]=r,t[12]=f):f=t[12];let x;t[13]!==c||t[14]!==f?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[c,f]}),t[13]=c,t[14]=f,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=s.jsx(Lt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let p;return t[19]!==e||t[20]!==l||t[21]!==h?(p=s.jsx(Dt,{open:e,onOpenChange:l,children:h}),t[19]=e,t[20]=l,t[21]=h,t[22]=p):p=t[22],p}function Ql(t){const e=I.c(12),{projectSlug:r,orgSlug:a,error:n}=t,l=rt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==n.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:n.message}),e[3]=n.message,e[4]=d):d=e[4];let u;e[5]!==l||e[6]!==a?(u=s.jsx(ce,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[5]=l,e[6]=a,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==u?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,u]}),e[8]=o,e[9]=d,e[10]=u,e[11]=c):c=e[11],c}function Xl(t){const e=I.c(9),{projectSlug:r,orgSlug:a}=t,n=rt();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=l):l=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==n||e[4]!==a?(o=s.jsx(ce,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[3]=n,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Jl(){const t=I.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=ys(e),{org:a}=me(),n=r.org,l=r.project,{data:i,isLoading:o,error:d}=Ot(a.id,l);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(et,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==n||t[4]!==l?(p=s.jsx(Ql,{projectSlug:l,orgSlug:n,error:d}),t[2]=d,t[3]=n,t[4]=l,t[5]=p):p=t[5],p}if(!i){let p;return t[6]!==n||t[7]!==l?(p=s.jsx(Xl,{projectSlug:l,orgSlug:n}),t[6]=n,t[7]=l,t[8]=p):p=t[8],p}const u=i.slug===Ee;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==u?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:u},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=u,t[17]=c):c=t[17];const m=c;let f,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(bs,{})}),x=s.jsx(ql,{}),t[18]=f,t[19]=x):(f=t[18],x=t[19]);let h;return t[20]!==m||t[21]!==a?(h=s.jsxs(Et,{org:a,project:m,children:[f,x]}),t[20]=m,t[21]=a,t[22]=h):h=t[22],h}function qn(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Jl,{})}),t[0]=e):e=t[0],e}export{qn as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as E,c as z,j as s,E as qe,u as he,v as P,b as Re,aC as Le,L as Ee,c7 as bt,ba as jt,O as G,aA as vt,w as Nt,z as yt,e as Ke,d as ce,t as oe,c8 as St,bA as kt,m as Ct,B as Oe,A as _t,S as Ve,f as wt,h as $t,N as zt,n as It,K as Pt,aE as Ye,P as At}from"./index-CzFqQvXW.js";import{C as J}from"./index-kE57LLiG.js";import{I as Et}from"./integration-icon-Cr629JYK.js";import{u as Qe,P as ue}from"./index-BeKO7nFo.js";import{d as Ot,u as Tt}from"./constants-0JLhMmM7.js";import{E as Mt,i as Dt,a as Rt,S as Lt,b as Ut,c as Ht,d as Bt,e as Ft}from"./editable-thread-title-BT5MJN2M.js";import{s as be}from"./Plus-C48LE9QF.js";import{t as Ue}from"./Users03-zNQ-U5kI.js";import{i as Fe}from"./X-BaOBrQh9.js";import{b as Wt,i as Gt}from"./context-CnW_lI9R.js";import{C as Ze}from"./create-project-dialog-BUAUU3kY.js";import{u as Pe}from"./use-preferences-fTjyFgCz.js";import{t as Xe,u as Je,i as qt}from"./use-settings-modal-D-rqbyuf.js";import{n as We}from"./CheckDone01-DgNkGXSd.js";import{n as Kt}from"./Container-CH2V2ATa.js";import{e as Vt}from"./Dataflow03-Dbafm5jn.js";import{a as Yt}from"./Home02-P9zxIWnB.js";import{i as Te}from"./LayoutLeft-CIizJ9p-.js";import{t as ve}from"./Settings01-CGjDKLLq.js";import{u as et,a as tt}from"./use-project-Bd8syAM2.js";import{u as Qt}from"./use-mobile-DIBT-lEk.js";import{c as Zt,b as Xt,a as Jt,T as es}from"./tooltip-BGn6dJhi.js";import{S as ee}from"./skeleton-BGGjmBE-.js";import{n as fe}from"./LinkExternal01-zIQsCZyp.js";import{t as st}from"./ChevronDown-CxLgy5uI.js";import{A as pe}from"./avatar-DX9xarA9.js";import{c as V,g as je,d as ts,e as ss,f as is,b as it,D as nt,a as rt}from"./dropdown-menu-bZQdGgsX.js";import{i as xe}from"./Check-BGWNBpXb.js";import{C as ns}from"./create-organization-dialog-BRKsH8XB.js";import{a as rs}from"./Copy01-Ba42JLNP.js";import{i as ls}from"./File06-CZSeKcKm.js";import{i as as}from"./Globe01-sstJp1qH.js";import{i as os}from"./Shield01-QPvxKI9B.js";import{P as cs,b as ds,a as ms}from"./popover-C5F2AcFP.js";import{n as Ge}from"./Inbox01-DUxLR6jm.js";import{s as us}from"./XClose-D5oa0b17.js";import{h as fs}from"./use-connection-CmCfM9T5.js";import{b as ps}from"./use-mcp-tools-BTHDM3P3.js";import{c as xs,A as hs}from"./use-binding-Ctbwf5zu.js";import{C as gs,b as bs,c as js}from"./collapsible-KhZqz8s6.js";import{i as vs}from"./ChevronRight-B-dZm0Fo.js";import{u as He,L as Be}from"./localstorage-keys-DtK7peUq.js";import{R as Ns,a as lt,b as ys}from"./resizable-CmbMtBt6.js";import"./spinner-BubUCjpb.js";import"./use-mcp-prompts-Bvv0Gku4.js";import"./useQuery-BE7O7fKt.js";import"./dialog-CzmRWg_H.js";import"./form-EW4LFI0z.js";import"./label-DdGHGWov.js";import"./input-Rcf9et7W.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-CjPyEOxC.js";import"./Edit01-NXKv8M2Y.js";import"./XCircle-CGBoiIiF.js";import"./AlertCircle-Dvy3oHwl.js";import"./select-CSl7KVC3.js";import"./index-gksA6r5d.js";import"./ArrowLeft-Ddv8Es1G.js";import"./use-copy-Dn5NzC6Z.js";import"./tabs-BzChyqs4.js";import"./badge-CMOYVtO8.js";import"./Code01-C4dpeKsY.js";import"./use-virtual-mcp-CaM9kbfY.js";import"./SearchMd-Bec1mZCp.js";import"./use-create-virtual-mcp-b6Af6scy.js";import"./use-mcp-resources--6yZ25c2.js";import"./marked.esm-BaswSlok.js";import"./markdown-BsZjpnFH.js";import"./mcp-app-renderer-aRjr0jcc.js";import"./types-CnosXlf3.js";import"./Eye-Da9OHWjs.js";import"./Globe02-DED7nhMo.js";import"./LayersTwo01-D0hB1mlt.js";import"./collection-search-aEfiIRVT.js";import"./Loading01-DvHkBn5K.js";import"./generate-id-Dyweu44Y.js";import"./Clock-DjTfMWYb.js";import"./Trash01-DfwWsbuW.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-CPv795TN.js";import"./checkbox-Bs5NWE_x.js";import"./AlignLeft-C1Pd8crU.js";import"./Image01-CyQ-9pmM.js";import"./RefreshCcw01-B_P3Otqi.js";import"./useSuspenseInfiniteQuery-BSW1dpRq.js";import"./infiniteQueryObserver-B0QSZ6Wg.js";import"./useMutation-DsQcwaJP.js";import"./textarea-CumbsokS.js";import"./alert-dialog-CHhoNaC0.js";import"./binder-CN-yhtfQ.js";const at=({size:t=24,color:e="currentColor",...i})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},E.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));at.displayName="BarChart10";const ot=({size:t=24,color:e="currentColor",...i})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},E.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2m-1-5h.01M9 9h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-6.5-3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-6 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}));ot.displayName="FaceSmile";const ct=({size:t=24,color:e="currentColor",...i})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},E.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));ct.displayName="LogOut01";function Ss(){const t=z.c(65),{org:e}=he(),[,i]=Qe(),{selectedVirtualMcp:r,modelsConnections:n,isChatEmpty:a,activeThreadId:l,createThread:o,switchToThread:c,threads:d}=Wt();let u;if(t[0]!==l||t[1]!==d){let F;t[3]!==l?(F=W=>W.id===l,t[3]=l,t[4]=F):F=t[4],u=d.find(F),t[0]=l,t[1]=d,t[2]=u}else u=t[2];const f=u,[m,x]=E.useState(!1),[j,g]=E.useTransition();let h;t[5]!==e.id?(h=Ot(e.id),t[5]=e.id,t[6]=h):h=t[6];const v=r??h;let p;t[7]!==o?(p=()=>{g(()=>{o()})},t[7]=o,t[8]=p):p=t[8];const S=p;if(n.length===0){let F;t[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(ue.Header.Left,{className:"gap-2"}),t[9]=F):F=t[9];let W;t[10]!==i?(W=()=>i(!1),t[10]=i,t[11]=W):W=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Fe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=I):I=t[12];let Q;t[13]!==W?(Q=s.jsxs(ue.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[F,s.jsx(ue.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:W,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:I})})]}),t[13]=W,t[14]=Q):Q=t[14];let ie;t[15]!==e?(ie=s.jsx(J.Main,{className:"flex flex-col items-center",children:s.jsx(J.EmptyState,{children:s.jsx(J.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[15]=e,t[16]=ie):ie=t[16];let re;return t[17]!==Q||t[18]!==ie?(re=s.jsxs(J,{className:"animate-in fade-in-0 duration-200",children:[Q,ie]}),t[17]=Q,t[18]=ie,t[19]=re):re=t[19],re}const N=m?"duration-300 opacity-0 -translate-x-4 pointer-events-none":j?"duration-150 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let b;t[20]!==N?(b=P("absolute inset-0 flex flex-col transition-[opacity,transform] ease-[var(--ease-out-quart)]",N),t[20]=N,t[21]=b):b=t[21];let y;t[22]!==f||t[23]!==a?(y=!a&&f?.title&&s.jsx(Mt,{threadId:f.id,text:f.title,className:"text-sm font-medium text-foreground"}),t[22]=f,t[23]=a,t[24]=y):y=t[24];let _;t[25]!==y?(_=s.jsx(ue.Header.Left,{className:"gap-2",children:y}),t[25]=y,t[26]=_):_=t[26];let w;t[27]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(be,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[27]=w):w=t[27];let k;t[28]!==S||t[29]!==j?(k=s.jsx("button",{type:"button",onClick:S,disabled:j,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:w}),t[28]=S,t[29]=j,t[30]=k):k=t[30];let A;t[31]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x(!0),t[31]=A):A=t[31];let T;t[32]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("button",{type:"button",onClick:A,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:s.jsx(Dt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[32]=T):T=t[32];let L;t[33]!==i?(L=()=>i(!1),t[33]=i,t[34]=L):L=t[34];let H;t[35]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Fe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[35]=H):H=t[35];let U;t[36]!==L?(U=s.jsx("button",{type:"button",onClick:L,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:H}),t[36]=L,t[37]=U):U=t[37];let M;t[38]!==U||t[39]!==k?(M=s.jsxs(ue.Header.Right,{className:"gap-1",children:[k,T,U]}),t[38]=U,t[39]=k,t[40]=M):M=t[40];let D;t[41]!==M||t[42]!==_?(D=s.jsxs(ue.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[_,M]}),t[41]=M,t[42]=_,t[43]=D):D=t[43];let O;t[44]!==v||t[45]!==a?(O=s.jsx(J.Main,{children:a?s.jsx(J.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[s.jsx(Et,{icon:v.icon,name:v.title,size:"lg",fallbackIcon:s.jsx(Ue,{size:32}),className:"size-[60px]! rounded-[18px]!"}),s.jsx("h3",{className:"text-xl font-medium text-foreground",children:v.title}),s.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:v.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(J.IceBreakers,{})]})}):s.jsx(J.Messages,{})}),t[44]=v,t[45]=a,t[46]=O):O=t[46];let B;t[47]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(J.Footer,{children:s.jsx(J.Input,{})}),t[47]=B):B=t[47];let R;t[48]!==D||t[49]!==O||t[50]!==b?(R=s.jsxs("div",{className:b,children:[D,O,B]}),t[48]=D,t[49]=O,t[50]=b,t[51]=R):R=t[51];const K=m?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let ne;t[52]!==K?(ne=P("absolute inset-0 flex flex-col transition-[opacity,transform] duration-300 ease-[var(--ease-out-quart)]",K),t[52]=K,t[53]=ne):ne=t[53];let te;t[54]===Symbol.for("react.memo_cache_sentinel")?(te=()=>x(!1),t[54]=te):te=t[54];let Z;t[55]!==l||t[56]!==c||t[57]!==d?(Z=s.jsx(Rt,{threads:d,activeThreadId:l,onThreadSelect:c,onClose:te}),t[55]=l,t[56]=c,t[57]=d,t[58]=Z):Z=t[58];let q;t[59]!==ne||t[60]!==Z?(q=s.jsx("div",{className:ne,children:Z}),t[59]=ne,t[60]=Z,t[61]=q):q=t[61];let Y;return t[62]!==R||t[63]!==q?(Y=s.jsxs(J,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[R,q]}),t[62]=R,t[63]=q,t[64]=Y):Y=t[64],Y}function ks(){const t=z.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Skeleton,{}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qe,{fallback:e,children:s.jsx(E.Suspense,{fallback:s.jsx(J.Skeleton,{}),children:s.jsx(Ss,{})})}),t[1]=i):i=t[1],i}function Cs(){const t=z.c(61),[e]=Pe(),{locator:i,org:r}=he(),n=Re(),a=Le(),{org:l,project:o}=Ee.parse(i),c=Ee.isOrgAdminProject(i),{data:d}=et(r.id,o);let u;t[0]!==d?.enabledPlugins?(u=d?.enabledPlugins??[],t[0]=d?.enabledPlugins,t[1]=u):u=t[1];const f=u,m=d?.ui?.pinnedViews??[];let x;t[2]!==f?(x=$=>f.includes($.pluginId),t[2]=f,t[3]=x):x=t[3];const j=bt.filter(x),g=a.location.pathname,h=`/${l}/${o}`,C=g===h||g===`${h}/`;let v;t[4]!==h||t[5]!==g?(v=$=>g.startsWith(`${h}/${$}`),t[4]=h,t[5]=g,t[6]=v):v=t[6];const p=v;let S;t[7]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Yt,{}),t[7]=S):S=t[7];const N={key:"home",label:"Home",icon:S,isActive:C,onClick:()=>{C?window.dispatchEvent(new CustomEvent("reset-home-view")):n({to:"/$org/$project",params:{org:l,project:o}})}};let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(We,{}),t[8]=b):b=t[8];const y={key:"tasks",label:"Tasks",icon:b,isActive:p("tasks"),onClick:()=>n({to:"/$org/$project/tasks",params:{org:l,project:G}})};let _;t[9]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Kt,{}),t[9]=_):_=t[9];const w={key:"mcps",label:"Connections",icon:_,isActive:p("mcps"),onClick:()=>n({to:"/$org/$project/mcps",params:{org:l,project:G}})};let k;t[10]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(vt,{}),t[10]=k):k=t[10];const A={key:"projects",label:"Projects",icon:k,isActive:p("projects"),onClick:()=>n({to:"/$org/$project/projects",params:{org:l,project:G}})};let T;t[11]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Xe,{}),t[11]=T):T=t[11];const L={key:"store",label:"Store",icon:T,isActive:p("store"),onClick:()=>n({to:"/$org/$project/store",params:{org:l,project:G}})};let H;t[12]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ue,{}),t[12]=H):H=t[12];const U={key:"agents",label:"Agents",icon:H,isActive:p("agents"),onClick:()=>n({to:"/$org/$project/agents",params:{org:l,project:G}})};let M;t[13]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(at,{}),t[13]=M):M=t[13];const D={key:"monitoring",label:"Monitor",icon:M,isActive:p("monitoring"),onClick:()=>n({to:"/$org/$project/monitoring",params:{org:l,project:G}})};let O;t[14]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ot,{}),t[14]=O):O=t[14];const B={key:"members",label:"Members",icon:O,isActive:p("members"),onClick:()=>n({to:"/$org/$project/members",params:{org:l,project:G}})},R=j.map($=>({key:$.pluginId,label:$.label,icon:$.icon,isActive:p($.pluginId),onClick:()=>n({to:"/$org/$project/$pluginId",params:{org:l,project:o,pluginId:$.pluginId}})}));let K;t[15]!==f?(K=$=>f.includes($.pluginId),t[15]=f,t[16]=K):K=t[16];const te=jt.filter(K).map($=>({type:"group",group:{id:`${$.pluginId}-${$.id}`,label:$.label,items:$.items.map((X,ae)=>({key:`${$.pluginId}-${$.id}-${ae}`,label:X.label,icon:X.icon,isActive:p($.pluginId),onClick:()=>n({to:"/$org/$project/$pluginId",params:{org:l,project:o,pluginId:$.pluginId}})})),defaultExpanded:$.defaultExpanded??!0}})),Z=m.map($=>({key:`app-${$.connectionId}-${$.toolName}`,label:$.label||$.toolName,icon:$.icon?s.jsx("img",{src:$.icon,alt:"",className:"size-4 rounded"}):s.jsx(Te,{}),isActive:p(`apps/${$.connectionId}/${encodeURIComponent($.toolName)}`),onClick:()=>n({to:"/$org/$project/apps/$connectionId/$toolName",params:{org:l,project:o,connectionId:$.connectionId,toolName:$.toolName}})}));let q;t[17]!==Z?(q=Z.length>0?{type:"group",group:{id:"apps",label:"Apps",items:Z,defaultExpanded:!0}}:null,t[17]=Z,t[18]=q):q=t[18];const Y=q;if(c){let $;t[19]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ve,{}),t[19]=$):$=t[19];let X;t[20]!==p?(X=p("settings"),t[20]=p,t[21]=X):X=t[21];let ae;t[22]!==n||t[23]!==l?(ae=()=>n({to:"/$org/$project/settings",params:{org:l,project:G}}),t[22]=n,t[23]=l,t[24]=ae):ae=t[24];let $e;t[25]!==X||t[26]!==ae?($e={key:"settings",label:"Settings",icon:$,isActive:X,onClick:ae},t[25]=X,t[26]=ae,t[27]=$e):$e=t[27];const gt=$e,ze=[{type:"items",items:[N,...e.experimental_tasks?[y]:[],...e.experimental_projects?[A]:[]]},{type:"group",group:{id:"build",label:"Build",items:[U,w,L],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[D,B,gt],defaultExpanded:!0}}];if(R.length>0){let Ie;t[28]!==R?(Ie={type:"items",items:R},t[28]=R,t[29]=Ie):Ie=t[29],ze.push(Ie)}return te.length>0&&ze.push(...te),Y&&ze.push(Y),ze}let F;t[30]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(We,{}),t[30]=F):F=t[30];let W;t[31]!==p?(W=p("tasks"),t[31]=p,t[32]=W):W=t[32];let I;t[33]!==n||t[34]!==l||t[35]!==o?(I=()=>n({to:"/$org/$project/tasks",params:{org:l,project:o}}),t[33]=n,t[34]=l,t[35]=o,t[36]=I):I=t[36];let Q;t[37]!==W||t[38]!==I?(Q={key:"tasks",label:"Tasks",icon:F,isActive:W,onClick:I},t[37]=W,t[38]=I,t[39]=Q):Q=t[39];const ie=Q;let re;t[40]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(Vt,{}),t[40]=re):re=t[40];let de;t[41]!==p?(de=p("workflows"),t[41]=p,t[42]=de):de=t[42];let me;t[43]!==n||t[44]!==l||t[45]!==o?(me=()=>n({to:"/$org/$project/workflows",params:{org:l,project:o}}),t[43]=n,t[44]=l,t[45]=o,t[46]=me):me=t[46];let ke;t[47]!==de||t[48]!==me?(ke={key:"workflows",label:"Workflows",icon:re,isActive:de,onClick:me},t[47]=de,t[48]=me,t[49]=ke):ke=t[49];const xt=ke;let Ce;t[50]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(ve,{}),t[50]=Ce):Ce=t[50];let _e;t[51]!==n||t[52]!==l||t[53]!==o?(_e={key:"configure",label:"Configure",icon:Ce,isActive:!1,isExternal:!0,onClick:()=>n({to:"/$org/$project/projects/$slug/settings/general",params:{org:l,project:G,slug:o}})},t[51]=n,t[52]=l,t[53]=o,t[54]=_e):_e=t[54];const ht=_e;let we;t[55]!==e.experimental_tasks||t[56]!==ie?(we=e.experimental_tasks?[ie]:[],t[55]=e.experimental_tasks,t[56]=ie,t[57]=we):we=t[57];const ge=[{type:"items",items:[N,...we,xt,ht]}];if(R.length>0){let $;t[58]===Symbol.for("react.memo_cache_sentinel")?($={type:"divider"},t[58]=$):$=t[58],ge.push($);let X;t[59]!==R?(X={type:"items",items:R},t[59]=R,t[60]=X):X=t[60],ge.push(X)}return te.length>0&&ge.push(...te),Y&&ge.push(Y),ge}const _s="sidebar_state",ws=3600*24*7,$s="16rem",zs="18rem",Is="3rem",Ps="b",dt=E.createContext(null);function Ae(){const t=E.useContext(dt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function As(t){const e=z.c(21),{defaultOpen:i,open:r,onOpenChange:n,children:a}=t,l=i===void 0?!0:i,o=Qt(),[c,d]=E.useState(!1),[u,f]=E.useState(l),m=r??u;let x;e[0]!==m||e[1]!==n?(x=_=>{const w=typeof _=="function"?_(m):_;n?n(w):f(w),document.cookie=`${_s}=${w}; path=/; max-age=${ws}`},e[0]=m,e[1]=n,e[2]=x):x=e[2];const j=x;let g;e[3]!==o||e[4]!==j?(g=()=>o?d(Os):j(Es),e[3]=o,e[4]=j,e[5]=g):g=e[5];const h=g;let C,v;e[6]!==h?(C=()=>{const _=w=>{if(w.key===Ps&&(w.metaKey||w.ctrlKey)){const k=w.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable)return;w.preventDefault(),h()}};return globalThis.addEventListener("keydown",_),()=>globalThis.removeEventListener("keydown",_)},v=[h],e[6]=h,e[7]=C,e[8]=v):(C=e[7],v=e[8]),E.useEffect(C,v);const p=m?"expanded":"collapsed";let S;e[9]!==o||e[10]!==m||e[11]!==c||e[12]!==j||e[13]!==p||e[14]!==h?(S={state:p,open:m,setOpen:j,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:h},e[9]=o,e[10]=m,e[11]=c,e[12]=j,e[13]=p,e[14]=h,e[15]=S):S=e[15];const N=S;let b;e[16]!==a?(b=s.jsx(Zt,{delayDuration:0,children:a}),e[16]=a,e[17]=b):b=e[17];let y;return e[18]!==N||e[19]!==b?(y=s.jsx(dt.Provider,{value:N,children:b}),e[18]=N,e[19]=b,e[20]=y):y=e[20],y}function Es(t){return!t}function Os(t){return!t}function Ts(t){const e=z.c(14);let i,r,n,a;e[0]!==t?({className:r,style:a,children:i,...n}=t,e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=a):(i=e[1],r=e[2],n=e[3],a=e[4]);let l;e[5]!==a?(l={"--sidebar-width":$s,"--sidebar-width-icon":Is,...a},e[5]=a,e[6]=l):l=e[6];const o=l;let c;e[7]!==r?(c=P("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",r),e[7]=r,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==n||e[11]!==o||e[12]!==c?(d=s.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:c,...n,children:i}),e[9]=i,e[10]=n,e[11]=o,e[12]=c,e[13]=d):d=e[13],d}function Ms(t){const e=z.c(42);let i,r,n,a,l,o;e[0]!==t?({side:a,variant:l,collapsible:o,className:r,children:i,...n}=t,e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=a,e[5]=l,e[6]=o):(i=e[1],r=e[2],n=e[3],a=e[4],l=e[5],o=e[6]);const c=a===void 0?"left":a,d=l===void 0?"sidebar":l,u=o===void 0?"offcanvas":o,{isMobile:f,state:m,openMobile:x,setOpenMobile:j}=Ae();if(u==="none"){let b;e[7]!==r?(b=P("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),e[7]=r,e[8]=b):b=e[8];let y;return e[9]!==i||e[10]!==n||e[11]!==b?(y=s.jsx("div",{"data-slot":"sidebar",className:b,...n,children:i}),e[9]=i,e[10]=n,e[11]=b,e[12]=y):y=e[12],y}if(f){let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={"--sidebar-width":zs},e[13]=b):b=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs(Ut,{className:"sr-only",children:[s.jsx(Ht,{children:"Sidebar"}),s.jsx(Bt,{children:"Displays the mobile sidebar."})]}),e[14]=y):y=e[14];let _;e[15]!==i?(_=s.jsx("div",{className:"flex h-full w-full flex-col",children:i}),e[15]=i,e[16]=_):_=e[16];let w;e[17]!==c||e[18]!==_?(w=s.jsxs(Ft,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:b,side:c,children:[y,_]}),e[17]=c,e[18]=_,e[19]=w):w=e[19];let k;return e[20]!==x||e[21]!==n||e[22]!==j||e[23]!==w?(k=s.jsx(Lt,{open:x,onOpenChange:j,...n,children:w}),e[20]=x,e[21]=n,e[22]=j,e[23]=w,e[24]=k):k=e[24],k}const g=d==="floating"||d==="inset"?"data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"data-[collapsible=icon]:w-(--sidebar-width-icon)";let h;e[25]!==g?(h=P("group peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","w-(--sidebar-width) transition-[width] duration-300 ease-[var(--ease-out-quart)]","data-[collapsible=offcanvas]:w-0",g),e[25]=g,e[26]=h):h=e[26];const C=m==="collapsed"?u:"";let v;e[27]!==r?(v=P("flex flex-col h-full w-(--sidebar-width)",r),e[27]=r,e[28]=v):v=e[28];let p;e[29]!==i?(p=s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i}),e[29]=i,e[30]=p):p=e[30];let S;e[31]!==n||e[32]!==v||e[33]!==p?(S=s.jsx("div",{"data-slot":"sidebar-container",className:v,...n,children:p}),e[31]=n,e[32]=v,e[33]=p,e[34]=S):S=e[34];let N;return e[35]!==c||e[36]!==m||e[37]!==h||e[38]!==C||e[39]!==S||e[40]!==d?(N=s.jsx("div",{className:h,"data-state":m,"data-collapsible":C,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:S}),e[35]=c,e[36]=m,e[37]=h,e[38]=C,e[39]=S,e[40]=d,e[41]=N):N=e[41],N}function Ds(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("main",{"data-slot":"sidebar-inset",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function mt(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("flex flex-col gap-2 p-2",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function Rs(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("flex flex-col gap-2 p-2",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function Ls(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("h-4 m-0! w-full",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-sidebar":"separator",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function Us(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function Ne(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function ye(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("w-full text-sm",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function le(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("flex w-full min-w-0 flex-col gap-1",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}function se(t){const e=z.c(8);let i,r;e[0]!==t?({className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let n;e[3]!==i?(n=P("group/menu-item relative",i),e[3]=i,e[4]=n):n=e[4];let a;return e[5]!==r||e[6]!==n?(a=s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...r}),e[5]=r,e[6]=n,e[7]=a):a=e[7],a}const Hs=yt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-0 pr-0.5 pl-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Se(t){const e=z.c(28);let i,r,n,a,l,o,c;e[0]!==t?({asChild:n,isActive:a,variant:l,size:o,tooltip:c,className:i,...r}=t,e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=a,e[5]=l,e[6]=o,e[7]=c):(i=e[1],r=e[2],n=e[3],a=e[4],l=e[5],o=e[6],c=e[7]);const d=n===void 0?!1:n,u=a===void 0?!1:a,f=l===void 0?"default":l,m=o===void 0?"default":o,x=d?Nt:"button",{isMobile:j,state:g}=Ae();let h;e[8]!==i||e[9]!==m||e[10]!==f?(h=P(Hs({variant:f,size:m}),i),e[8]=i,e[9]=m,e[10]=f,e[11]=h):h=e[11];let C;e[12]!==x||e[13]!==u||e[14]!==r||e[15]!==m||e[16]!==h?(C=s.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":m,"data-active":u,className:h,...r}),e[12]=x,e[13]=u,e[14]=r,e[15]=m,e[16]=h,e[17]=C):C=e[17];const v=C;if(!c)return v;if(typeof c=="string"){let y;e[18]!==c?(y={children:c},e[18]=c,e[19]=y):y=e[19],c=y}let p;e[20]!==v?(p=s.jsx(Jt,{asChild:!0,children:v}),e[20]=v,e[21]=p):p=e[21];const S=g!=="collapsed"||j;let N;e[22]!==S||e[23]!==c?(N=s.jsx(Xt,{side:"right",align:"center",hidden:S,...c}),e[22]=S,e[23]=c,e[24]=N):N=e[24];let b;return e[25]!==p||e[26]!==N?(b=s.jsxs(es,{children:[p,N]}),e[25]=p,e[26]=N,e[27]=b):b=e[27],b}function Bs(t){const e=z.c(11),{label:i,children:r,defaultExpanded:n}=t,a=n===void 0?!0:n,[l,o]=E.useState(a),{state:c}=Ae(),d=c==="collapsed";let u;e[0]!==l||e[1]!==d||e[2]!==i?(u=d?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(le,{children:s.jsx(se,{children:s.jsxs(Se,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>o(!l),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i}),s.jsx(st,{size:12,className:P("text-muted-foreground transition-transform duration-200",!l&&"-rotate-90")})]})})}),e[0]=l,e[1]=d,e[2]=i,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==l||e[6]!==d?(f=(d||l)&&s.jsx(ye,{children:s.jsx(le,{className:"gap-0.5",children:r})}),e[4]=r,e[5]=l,e[6]=d,e[7]=f):f=e[7];let m;return e[8]!==u||e[9]!==f?(m=s.jsxs(Ne,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[u,f]}),e[8]=u,e[9]=f,e[10]=m):m=e[10],m}function ut(t){const e=z.c(22),{item:i}=t,r=i.key,n=i.onClick,a=i.isActive,l=i.label,o=i.isExternal&&"group/external";let c;e[0]!==o?(c=P(o),e[0]=o,e[1]=c):c=e[1];let d;e[2]!==i.icon?(d=s.jsx("span",{className:"[&>svg]:size-4",children:i.icon}),e[2]=i.icon,e[3]=d):d=e[3];const u=i.isExternal&&"group-hover/external:underline underline-offset-2";let f;e[4]!==u?(f=P("truncate group-data-[collapsible=icon]:hidden",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==i.label||e[7]!==f?(m=s.jsx("span",{className:f,children:i.label}),e[6]=i.label,e[7]=f,e[8]=m):m=e[8];let x;e[9]!==i.isExternal?(x=i.isExternal&&s.jsx(fe,{size:12,className:"ml-auto mr-1 shrink-0 opacity-0 group-hover/external:opacity-60 transition-opacity group-data-[collapsible=icon]:hidden"}),e[9]=i.isExternal,e[10]=x):x=e[10];let j;e[11]!==i.isActive||e[12]!==i.label||e[13]!==i.onClick||e[14]!==m||e[15]!==x||e[16]!==c||e[17]!==d?(j=s.jsxs(Se,{onClick:n,isActive:a,tooltip:l,className:c,children:[d,m,x]}),e[11]=i.isActive,e[12]=i.label,e[13]=i.onClick,e[14]=m,e[15]=x,e[16]=c,e[17]=d,e[18]=j):j=e[18];let g;return e[19]!==i.key||e[20]!==j?(g=s.jsx(se,{children:j},r),e[19]=i.key,e[20]=j,e[21]=g):g=e[21],g}function Fs(t){const e=z.c(12),{section:i}=t;switch(i.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ls,{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=i.group.label,n=i.group.defaultExpanded;let a;e[2]!==i.group.items?(a=i.group.items.map(Gs),e[2]=i.group.items,e[3]=a):a=e[3];let l;return e[4]!==i.group.defaultExpanded||e[5]!==i.group.label||e[6]!==a?(l=s.jsx(Bs,{label:r,defaultExpanded:n,children:a}),e[4]=i.group.defaultExpanded,e[5]=i.group.label,e[6]=a,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==i.items?(r=i.items.map(Ws),e[8]=i.items,e[9]=r):r=e[9];let n;return e[10]!==r?(n=s.jsx(Ne,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ye,{children:s.jsx(le,{className:"gap-0.5",children:r})})}),e[10]=r,e[11]=n):n=e[11],n}}}function Ws(t){return s.jsx(ut,{item:t},t.key)}function Gs(t){return s.jsx(ut,{item:t},t.key)}function ft(t){const e=z.c(14),{sections:i,header:r,footer:n,additionalContent:a,variant:l,collapsible:o,contentClassName:c}=t,d=l===void 0?"sidebar":l,u=o===void 0?"icon":o;let f;e[0]!==c?(f=P("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",c),e[0]=c,e[1]=f):f=e[1];let m;e[2]!==i?(m=i.map(qs),e[2]=i,e[3]=m):m=e[3];let x;e[4]!==a||e[5]!==f||e[6]!==m?(x=s.jsxs(Us,{className:f,children:[m,a]}),e[4]=a,e[5]=f,e[6]=m,e[7]=x):x=e[7];let j;return e[8]!==u||e[9]!==n||e[10]!==r||e[11]!==x||e[12]!==d?(j=s.jsxs(Ms,{variant:d,collapsible:u,children:[r,x,n]}),e[8]=u,e[9]=n,e[10]=r,e[11]=x,e[12]=d,e[13]=j):j=e[13],j}function qs(t,e){return s.jsx(Fs,{section:t},e)}ft.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,i)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(ee,{className:"h-full bg-sidebar-accent rounded-md"})},i))})};function Ks(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(ee,{className:"h-8 w-full rounded-lg"}),s.jsx(ee,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function Vs(t){const e=z.c(12),{organizationId:i,currentProjectSlug:r,onSelect:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={suspense:!0},e[0]=a):a=e[0];const{data:l}=tt(i,a);let o,c;if(e[1]!==r||e[2]!==n||e[3]!==l){c=Symbol.for("react.early_return_sentinel");e:{const u=l?.filter(Ys)??[];if(u.length===0){let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=m):m=e[6],c=m;break e}let f;e[7]!==r||e[8]!==n?(f=m=>{const x=r===m.slug,j=m.ui?.themeColor??"#3B82F6";return s.jsxs(V,{className:P("gap-2.5",x&&"bg-accent"),onClick:()=>n(m.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:j},children:m.ui?.icon?s.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:m.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:m.name}),x&&s.jsx(xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},m.id)},e[7]=r,e[8]=n,e[9]=f):f=e[9],o=u.map(f)}e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c}else o=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let d;return e[10]!==o?(d=s.jsx(s.Fragment,{children:o}),e[10]=o,e[11]=d):d=e[11],d}function Ys(t){return t.slug!==G}function Qs(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const i=Math.abs(e)%360;return{backgroundColor:`hsl(${i} 55% 70%)`,color:`hsl(${i} 55% 20%)`}}function Me(t){const e=z.c(44),{isCollapsed:i,onCreateProject:r}=t,n=i===void 0?!1:i;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:l,project:o}=Ke(a),{data:c}=ce.useListOrganizations(),d=Re(),u=c?.find(I=>I.slug===l),[f,m]=E.useState(!1),[x]=Pe(),j=x.experimental_projects,g=o===G,{data:h}=et(u?.id??"",g?"":o??"");let C;e[1]!==l?(C=(I,Q)=>I.slug===l?-1:Q.slug===l?1:I.name.localeCompare(Q.name),e[1]=l,e[2]=C):C=e[2];const v=[...c??[]].sort(C);let p;e[3]!==d||e[4]!==l?(p=()=>{l&&d({to:"/$org/$project",params:{org:l,project:G}})},e[3]=d,e[4]=l,e[5]=p):p=e[5];const S=p;let N;e[6]!==d||e[7]!==l?(N=I=>{l&&d({to:"/$org/$project",params:{org:l,project:I}})},e[6]=d,e[7]=l,e[8]=N):N=e[8];const b=N;let y;e[9]!==d?(y=I=>{d({to:"/$org/$project",params:{org:I,project:G}})},e[9]=d,e[10]=y):y=e[10];const _=y;let w;e[11]!==r?(w=r?()=>r():void 0,e[11]=r,e[12]=w):w=e[12];const k=w;let A;e[13]!==d||e[14]!==l||e[15]!==o?(A=()=>{if(!l||!o)return;const I=o===G;d({to:"/$org/$project",params:{org:l,project:o},search:Q=>({...Q,settings:I?"org.general":`project:${o}:general`})})},e[13]=d,e[14]=l,e[15]=o,e[16]=A):A=e[16];const T=A,L=nt,H=n?"w-auto pr-1.5":"w-full";let U;e[17]!==H?(U=P("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",H),e[17]=H,e[18]=U):U=e[18];const M=g?s.jsx("div",{className:P("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",n?"size-6":"size-8"),style:u?.logo?void 0:Qs(u?.name??""),children:u?.logo?s.jsx("img",{src:u.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:P("font-semibold leading-none",n?"text-[9px]":"text-xs"),children:(u?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:P("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",n?"size-6":"size-8"),style:{backgroundColor:h?.ui?.themeColor??"#60a5fa"},children:h?.ui?.icon?s.jsx("img",{src:h.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:P("font-semibold text-white",n?"text-xs":"text-lg"),children:(h?.name??o??"?").charAt(0).toUpperCase()})});let D;e[19]!==u?.name||e[20]!==h?.name||e[21]!==j||e[22]!==n||e[23]!==g||e[24]!==o?(D=!n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:j?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:u?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:g?"Studio":h?.name??o??""})]}):s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:u?.name??"Select org"})}),s.jsx(Gt,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[19]=u?.name,e[20]=h?.name,e[21]=j,e[22]=n,e[23]=g,e[24]=o,e[25]=D):D=e[25];let O;e[26]!==U||e[27]!==M||e[28]!==D?(O=s.jsx(rt,{asChild:!0,children:s.jsxs("button",{type:"button",className:U,children:[M,D]})}),e[26]=U,e[27]=M,e[28]=D,e[29]=O):O=e[29];const B=it,R="start",K="bottom",ne="w-64 flex flex-col gap-0.5",te=Zs,Z=j?s.jsxs(s.Fragment,{children:[s.jsxs(V,{className:P("gap-2.5",g&&"bg-accent"),onClick:S,children:[s.jsx(pe,{url:u?.logo??"",fallback:u?.name??"",size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",u?.name]}),g&&s.jsx(xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]}),s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),u&&s.jsx(E.Suspense,{fallback:s.jsx(Ks,{}),children:s.jsx(Vs,{organizationId:u.id,currentProjectSlug:o,orgSlug:l??"",onSelect:b})}),k&&s.jsxs(V,{className:"gap-2.5",onClick:k,children:[s.jsx(be,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),s.jsx(je,{}),s.jsxs(ts,{children:[s.jsxs(ss,{className:"gap-2.5",children:[s.jsx(Xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),s.jsxs(is,{className:"w-48 flex flex-col gap-0.5",children:[v.map(I=>s.jsxs(V,{className:P("gap-2.5",I.slug===l&&"bg-accent"),onClick:()=>_(I.slug),children:[s.jsx(pe,{url:I.logo??"",fallback:I.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:I.name}),I.slug===l&&s.jsx(xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id)),s.jsx(je,{}),s.jsxs(V,{className:"gap-2.5",onClick:()=>m(!0),children:[s.jsx(be,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]})]}),s.jsxs(V,{className:"gap-2.5",onClick:T,children:[s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Organizations"}),v.map(I=>s.jsxs(V,{className:P("gap-2.5",I.slug===l&&"bg-accent"),onClick:()=>_(I.slug),children:[s.jsx(pe,{url:I.logo??"",fallback:I.name,size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:I.name}),I.slug===l&&s.jsx(xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id)),s.jsxs(V,{className:"gap-2.5",onClick:()=>m(!0),children:[s.jsx(be,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]}),s.jsx(je,{}),s.jsxs(V,{className:"gap-2.5",onClick:T,children:[s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]});let q;e[30]!==B||e[31]!==te||e[32]!==Z?(q=s.jsx(B,{align:R,side:K,className:ne,onCloseAutoFocus:te,children:Z}),e[30]=B,e[31]=te,e[32]=Z,e[33]=q):q=e[33];let Y;e[34]!==L||e[35]!==O||e[36]!==q?(Y=s.jsxs(L,{children:[O,q]}),e[34]=L,e[35]=O,e[36]=q,e[37]=Y):Y=e[37];let F;e[38]!==f||e[39]!==m?(F=s.jsx(ns,{open:f,onOpenChange:m}),e[38]=f,e[39]=m,e[40]=F):F=e[40];let W;return e[41]!==Y||e[42]!==F?(W=s.jsxs(s.Fragment,{children:[Y,F]}),e[41]=Y,e[42]=F,e[43]=W):W=e[43],W}function Zs(t){return t.preventDefault()}Me.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(ee,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function De(t){const e=z.c(4),{onCreateProject:i}=t,{state:r,toggleSidebar:n}=Ae(),a=r==="collapsed";let l;return e[0]!==a||e[1]!==i||e[2]!==n?(l=s.jsx(mt,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(le,{children:s.jsx(se,{children:a?s.jsxs("div",{className:"flex flex-col w-full gap-0.5",children:[s.jsx(Me,{isCollapsed:!0,onCreateProject:i}),s.jsx(Se,{onClick:n,tooltip:"Expand sidebar",children:s.jsx(Te,{})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(Me,{isCollapsed:!1,onCreateProject:i})}),s.jsx(Se,{onClick:n,tooltip:"Collapse sidebar",className:"size-7 shrink-0",children:s.jsx(Te,{})})]})})})}),e[0]=a,e[1]=i,e[2]=n,e[3]=l):l=e[3],l}De.Skeleton=function(){return s.jsx(mt,{className:"px-3",children:s.jsx(le,{children:s.jsx(se,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(ee,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsx("div",{className:"flex items-center gap-0.5",children:s.jsx(ee,{className:"size-7 rounded-lg bg-sidebar-accent"})})]})})})})};function Xs(t){const e=z.c(50),{user:i,userImage:r}=t,{open:n}=Je(),[a,l]=E.useState(!1);let o;e[0]!==i.email||e[1]!==i.id||e[2]!==i.name?(o=()=>{const K=`ID: ${i.id}
|
|
2
|
-
Name: ${i.name||"N/A"}
|
|
3
|
-
Email: ${i.email}`;navigator.clipboard.writeText(K),l(!0),oe.success("User info copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=i.email,e[1]=i.id,e[2]=i.name,e[3]=o):o=e[3];const c=o,d=i.name||i.email||"U";let u;e[4]!==d||e[5]!==r?(u=s.jsx(pe,{url:r,fallback:d,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=d,e[5]=r,e[6]=u):u=e[6];const f=i.name||"User";let m;e[7]!==f?(m=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:f})}),e[7]=f,e[8]=m):m=e[8];let x;e[9]!==u||e[10]!==m?(x=s.jsx(rt,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[u,m]})}),e[9]=u,e[10]=m,e[11]=x):x=e[11];const j=i.name||i.email||"U";let g;e[12]!==j||e[13]!==r?(g=s.jsx(pe,{url:r,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=j,e[13]=r,e[14]=g):g=e[14];const h=i.name||"User";let C;e[15]!==h?(C=s.jsx("div",{className:"text-sm font-medium truncate",children:h}),e[15]=h,e[16]=C):C=e[16];let v;e[17]!==i.email?(v=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:i.email}),e[17]=i.email,e[18]=v):v=e[18];let p;e[19]!==C||e[20]!==v?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[C,v]}),e[19]=C,e[20]=v,e[21]=p):p=e[21];let S;e[22]!==a?(S=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:a?s.jsx(xe,{size:14,className:"text-green-600"}):s.jsx(rs,{size:14,className:"text-muted-foreground"})}),e[22]=a,e[23]=S):S=e[23];let N;e[24]!==c||e[25]!==p||e[26]!==S||e[27]!==g?(N=s.jsxs(V,{onClick:c,className:"gap-2.5 group",children:[g,p,S]}),e[24]=c,e[25]=p,e[26]=S,e[27]=g,e[28]=N):N=e[28];let b;e[29]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(je,{}),e[29]=b):b=e[29];let y;e[30]!==n?(y=()=>n("account.preferences"),e[30]=n,e[31]=y):y=e[31];let _,w;e[32]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ve,{size:14,className:"shrink-0 text-muted-foreground"}),w=s.jsx("span",{children:"Settings"}),e[32]=_,e[33]=w):(_=e[32],w=e[33]);let k;e[34]!==y?(k=s.jsxs(V,{className:"gap-2.5",onClick:y,children:[_,w]}),e[34]=y,e[35]=k):k=e[35];let A;e[36]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(V,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ls,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx(fe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=A):A=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(V,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(os,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx(fe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=T):T=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(V,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(St,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx(fe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=L):L=e[38];let H;e[39]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(V,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Ue,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx(fe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=H):H=e[39];let U,M;e[40]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(as,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx(fe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),M=s.jsx(je,{}),e[40]=U,e[41]=M):(U=e[40],M=e[41]);let D;e[42]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(V,{className:"gap-2.5",onClick:Js,children:[s.jsx(ct,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=D):D=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"px-2 py-1.5",children:s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.132.0"]})}),e[43]=O):O=e[43];let B;e[44]!==N||e[45]!==k?(B=s.jsxs(it,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:ei,children:[N,b,k,A,T,L,H,U,M,D,O]}),e[44]=N,e[45]=k,e[46]=B):B=e[46];let R;return e[47]!==B||e[48]!==x?(R=s.jsxs(nt,{children:[x,B]}),e[47]=B,e[48]=x,e[49]=R):R=e[49],R}function Js(){return ce.signOut()}function ei(t){return t.preventDefault()}function pt(){const t=z.c(7),{data:e}=ce.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(pe,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const i=e.user,r=i.name??void 0;let n;t[1]!==r||t[2]!==i?(n={...i,name:r},t[1]=r,t[2]=i,t[3]=n):n=t[3];const a=n,l=i.image;let o;return t[4]!==l||t[5]!==a?(o=s.jsx(Xs,{user:a,userImage:l}),t[4]=l,t[5]=a,t[6]=o):o=t[6],o}function ti({invitation:t}){const[e,i]=E.useState(!1),[r,n]=E.useState(!1),a=Ct(),l=async()=>{i(!0);try{const c=await ce.organization.acceptInvitation({invitationId:t.id});if(c.error)oe.error(c.error.message),i(!1);else{const d=await ce.organization.setActive({organizationId:t.organizationId});oe.success("Invitation accepted!");const u=d?.data?.slug;window.location.href=u?`/${u}`:"/"}}catch{oe.error("Failed to accept invitation"),i(!1)}},o=async()=>{n(!0);try{const c=await ce.organization.rejectInvitation({invitationId:t.id});c.error?(oe.error(c.error.message),n(!1)):(oe.success("Invitation declined"),a.invalidateQueries())}catch{oe.error("Failed to decline invitation"),n(!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(Oe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(xe,{size:14})}),s.jsx(Oe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:o,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(us,{size:14})})]})]})}function si(){const t=E.useContext(kt),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}class ii extends E.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,i){}render(){return this.state.hasError?null:this.props.children}}const ni="gateway-chip-period";function ri(){try{const t=localStorage.getItem(ni);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function li(t,e){if(!e||e<=0)return"text-foreground/70";const i=t/e;return i<=.05?"text-destructive":i<=.2?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function ai(t){return t>=90?"text-destructive":t>=70?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function oi(t){const e=z.c(42),{connectionId:i}=t,{open:r}=Je(),{org:n}=he();let a;e[0]!==i||e[1]!==n.id?(a={connectionId:i,orgId:n.id},e[0]=i,e[1]=n.id,e[2]=a):a=e[2];const l=Tt(a);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={},e[3]=o):o=e[3];let c;e[4]!==l?(c={client:l,toolName:"GATEWAY_USAGE",toolArguments:o,staleTime:6e4,select:ci},e[4]=l,e[5]=c):c=e[5];const{data:d}=ps(c),u=d?.billing.mode??"prepaid",f=d?.limit.total??null,m=d?.limit.remaining??0;let x;e[6]!==d?.usage?(x=d?.usage??{total:0,daily:0,weekly:0,monthly:0},e[6]=d?.usage,e[7]=x):x=e[7];const j=x;let g,h,C,v,p,S,N;if(e[8]!==u||e[9]!==g||e[10]!==m||e[11]!==f||e[12]!==r||e[13]!==j){let _;if(u==="prepaid"){g="Credits";let k;e[21]!==m?(k=m.toFixed(2),e[21]=m,e[22]=k):k=e[22],h=`$${k}`,_=li(m,f)}else if(f!=null&&f>0){const k=f-m;let A;e[23]!==f||e[24]!==k?(A=Math.round(k/f*100),e[23]=f,e[24]=k,e[25]=A):A=e[25];const T=Math.min(100,A);g="Usage",h=`${T}%`,_=ai(T)}else{const k=ri(),A=k==="daily"?j.daily:k==="weekly"?j.weekly:j.monthly,T=k==="daily"?"/day":k==="weekly"?"/wk":"/mo";g="Usage";let L;e[26]!==A?(L=A.toFixed(2),e[26]=A,e[27]=L):L=e[27],h=`$${L}${T}`,_="text-foreground/70"}v="button",e[28]!==r?(p=()=>r("org.billing"),e[28]=r,e[29]=p):p=e[29],S="group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors";let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(qt,{size:13,className:"text-muted-foreground/60 shrink-0"}),e[30]=w):w=e[30],e[31]!==g?(N=s.jsxs("div",{className:"flex items-center gap-1.5",children:[w,s.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[31]=g,e[32]=N):N=e[32],C=P("text-xs font-medium tabular-nums",_),e[8]=u,e[9]=g,e[10]=m,e[11]=f,e[12]=r,e[13]=j,e[14]=C,e[15]=v,e[16]=p,e[17]=S,e[18]=N,e[19]=g,e[20]=h}else C=e[14],v=e[15],p=e[16],S=e[17],N=e[18],g=e[19],h=e[20];let b;e[33]!==C||e[34]!==h?(b=s.jsx("span",{className:C,children:h}),e[33]=C,e[34]=h,e[35]=b):b=e[35];let y;return e[36]!==b||e[37]!==v||e[38]!==p||e[39]!==S||e[40]!==N?(y=s.jsxs("button",{type:v,onClick:p,className:S,children:[N,b]}),e[36]=b,e[37]=v,e[38]=p,e[39]=S,e[40]=N,e[41]=y):y=e[41],y}function ci(t){return t.structuredContent}function di(){const t=z.c(4),e=fs();let i;t[0]!==e?(i=e.find(mi),t[0]=e,t[1]=i):i=t[1];const r=i;if(!r?.id)return null;let n;return t[2]!==r.id?(n=s.jsx(oi,{connectionId:r.id}),t[2]=r.id,t[3]=n):n=t[3],n}function mi(t){return xs(t,hs)}function ui(){const t=z.c(13),e=si();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ii,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(di,{})})}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(pt,{})}),t[1]=r):r=t[1];let n;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ds,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(Ge,{size:16})})}),t[2]=n):n=t[2];let a;t[3]!==e.length?(a=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=a):a=t[4];let l;t[5]!==a?(l=s.jsxs("div",{className:"relative",children:[n,a]}),t[5]=a,t[6]=l):l=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=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"})}),t[7]=o):o=t[7];let c;t[8]!==e?(c=s.jsxs(cs,{side:"right",align:"end",sideOffset:24,className:"w-[400px] p-0 h-[650px] flex flex-col",children:[o,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Ge,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(fi)})]}),t[8]=e,t[9]=c):c=t[9];let d;return t[10]!==l||t[11]!==c?(d=s.jsxs(Rs,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[i,s.jsx(le,{children:s.jsx(se,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[r,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(ms,{children:[l,c]})})]})})})]}),t[10]=l,t[11]=c,t[12]=d):d=t[12],d}function fi(t){return s.jsx(ti,{invitation:t},t.id)}function pi(t){const e=z.c(11),{project:i}=t,r=i.ui?.themeColor??"#60a5fa";if(i.ui?.icon){let c;return e[0]!==i.ui.icon?(c=s.jsx("img",{src:i.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=i.ui.icon,e[1]=c):c=e[1],c}let n;e[2]!==r?(n={backgroundColor:r},e[2]=r,e[3]=n):n=e[3];let a;e[4]!==i.name?(a=i.name.charAt(0).toUpperCase(),e[4]=i.name,e[5]=a):a=e[5];let l;e[6]!==a?(l=s.jsx("span",{className:"text-[10px] font-medium text-white",children:a}),e[6]=a,e[7]=l):l=e[7];let o;return e[8]!==n||e[9]!==l?(o=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:n,children:l}),e[8]=n,e[9]=l,e[10]=o):o=e[10],o}function xi(t){const e=z.c(14),{project:i}=t,r=Re(),{org:n}=he();let a;e[0]!==r||e[1]!==n.slug||e[2]!==i.slug?(a=()=>{r({to:"/$org/$project",params:{org:n.slug,project:i.slug}})},e[0]=r,e[1]=n.slug,e[2]=i.slug,e[3]=a):a=e[3];let l;e[4]!==i?(l=s.jsx(pi,{project:i}),e[4]=i,e[5]=l):l=e[5];let o;e[6]!==i.name?(o=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:i.name}),e[6]=i.name,e[7]=o):o=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(vs,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=c):c=e[8];let d;return e[9]!==i.name||e[10]!==a||e[11]!==l||e[12]!==o?(d=s.jsx(se,{children:s.jsxs(Se,{onClick:a,tooltip:i.name,children:[l,o,c]})}),e[9]=i.name,e[10]=a,e[11]=l,e[12]=o,e[13]=d):d=e[13],d}function hi(){const t=z.c(55),{org:e}=he(),{data:i,isLoading:r}=tt(e.id),[n,a]=E.useState(!0),[l,o]=E.useState(!1);let c,d,u,f,m,x,j,g,h,C,v,p,S;if(t[0]!==r||t[1]!==n||t[2]!==i){S=Symbol.for("react.early_return_sentinel");e:{const L=i?.filter(bi)??[];if(r){let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(se,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})}),t[16]=R):R=t[16];let K;t[17]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ne,{className:"py-0 px-0",children:s.jsx(ye,{children:s.jsxs(le,{className:"gap-0.5",children:[R,s.jsx(se,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})]})})}),t[17]=K):K=t[17],S=K;break e}p="group/projects-section mt-2",m=gs,C=n,v=a,f=Ne,h="py-0 px-0",u=ye,d=le,j="gap-0.5";let H;t[18]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=H):H=t[18];const U=!n&&"-rotate-90";let M;t[19]!==U?(M=P("text-muted-foreground shrink-0 transition-transform duration-200",U),t[19]=U,t[20]=M):M=t[20];let D;t[21]!==M?(D=s.jsx(bs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[H,s.jsx(st,{size:12,className:M})]})}),t[21]=M,t[22]=D):D=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O=()=>o(!0),t[23]=O):O=t[23];let B;t[24]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("button",{type:"button",onClick:O,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(be,{size:16})}),t[24]=B):B=t[24],t[25]!==D?(g=s.jsx(se,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[D,B]})}),t[25]=D,t[26]=g):g=t[26],c=js,x=L.length===0?s.jsx(se,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):L.map(gi)}t[0]=r,t[1]=n,t[2]=i,t[3]=c,t[4]=d,t[5]=u,t[6]=f,t[7]=m,t[8]=x,t[9]=j,t[10]=g,t[11]=h,t[12]=C,t[13]=v,t[14]=p,t[15]=S}else c=t[3],d=t[4],u=t[5],f=t[6],m=t[7],x=t[8],j=t[9],g=t[10],h=t[11],C=t[12],v=t[13],p=t[14],S=t[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let N;t[27]!==c||t[28]!==x?(N=s.jsx(c,{children:x}),t[27]=c,t[28]=x,t[29]=N):N=t[29];let b;t[30]!==d||t[31]!==j||t[32]!==g||t[33]!==N?(b=s.jsxs(d,{className:j,children:[g,N]}),t[30]=d,t[31]=j,t[32]=g,t[33]=N,t[34]=b):b=t[34];let y;t[35]!==u||t[36]!==b?(y=s.jsx(u,{children:b}),t[35]=u,t[36]=b,t[37]=y):y=t[37];let _;t[38]!==f||t[39]!==y||t[40]!==h?(_=s.jsx(f,{className:h,children:y}),t[38]=f,t[39]=y,t[40]=h,t[41]=_):_=t[41];let w;t[42]!==m||t[43]!==_||t[44]!==C||t[45]!==v?(w=s.jsx(m,{open:C,onOpenChange:v,children:_}),t[42]=m,t[43]=_,t[44]=C,t[45]=v,t[46]=w):w=t[46];let k;t[47]!==w||t[48]!==p?(k=s.jsx("div",{className:p,children:w}),t[47]=w,t[48]=p,t[49]=k):k=t[49];let A;t[50]!==l?(A=s.jsx(Ze,{open:l,onOpenChange:o}),t[50]=l,t[51]=A):A=t[51];let T;return t[52]!==k||t[53]!==A?(T=s.jsxs(s.Fragment,{children:[k,A]}),t[52]=k,t[53]=A,t[54]=T):T=t[54],T}function gi(t){return s.jsx(xi,{project:t},t.id)}function bi(t){return t.slug!==G}function ji(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(E.Suspense,{fallback:s.jsx(Ne,{className:"py-0 px-0",children:s.jsx(ye,{children:s.jsx(le,{className:"gap-0.5",children:s.jsx(se,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(hi,{})}),t[0]=e):e=t[0],e}function vi(t){const e=z.c(13),{onCreateProject:i}=t,[r]=Pe(),n=Cs(),{locator:a}=he();let l;e[0]!==a?(l=Ee.isOrgAdminProject(a),e[0]=a,e[1]=l):l=e[1];const o=l;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(De.Skeleton,{}),e[2]=c):c=e[2];let d;e[3]!==i?(d=s.jsx(E.Suspense,{fallback:c,children:s.jsx(De,{onCreateProject:i})}),e[3]=i,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ui,{}),e[5]=u):u=e[5];let f;e[6]!==o||e[7]!==r?(f=o&&r.experimental_projects?s.jsx(qe,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(ji,{})})}):null,e[6]=o,e[7]=r,e[8]=f):f=e[8];let m;return e[9]!==n||e[10]!==d||e[11]!==f?(m=s.jsx(ft,{sections:n,header:d,footer:u,additionalContent:f}),e[9]=n,e[10]=d,e[11]=f,e[12]=m):m=e[12],m}function Ni(){const t=z.c(2),i=Le().location.href;let r;return t[0]!==i?(r=s.jsx(zt,{to:"/login",search:{next:i},replace:!0}),t[0]=i,t[1]=r):r=t[1],r}function yi(t){const e=z.c(6),{children:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(_t,{children:s.jsx(Ve,{})}),e[0]=r):r=e[0];let n;e[1]!==i?(n=s.jsx(wt,{children:i}),e[1]=i,e[2]=n):n=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($t,{children:s.jsx(Ni,{})}),e[3]=a):a=e[3];let l;return e[4]!==n?(l=s.jsxs(s.Fragment,{children:[r,n,a]}),e[4]=n,e[5]=l):l=e[5],l}function Si(t){const e=z.c(10),{children:i,className:r}=t,[,n]=E.useTransition();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Be.decoChatPanelWidth(),e[0]=a):a=e[0];const[l,o]=He(a,30);let c;e[1]!==o?(c=m=>n(()=>o(m)),e[1]=o,e[2]=c):c=e[2];const d=c;let u;e[3]!==r?(u=P("min-w-0",r),e[3]=r,e[4]=u):u=e[4];let f;return e[5]!==l||e[6]!==i||e[7]!==d||e[8]!==u?(f=s.jsx(lt,{defaultSize:l,minSize:20,className:u,onResize:d,children:i}),e[5]=l,e[6]=i,e[7]=d,e[8]=u,e[9]=f):f=e[9],f}function ki(t){const e=z.c(5),{children:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Be.sidebarOpen(),e[0]=r):r=e[0];const[n,a]=He(r,!0);let l;return e[1]!==i||e[2]!==a||e[3]!==n?(l=s.jsx(As,{open:n,onOpenChange:a,children:i}),e[1]=i,e[2]=a,e[3]=n,e[4]=l):l=e[4],l}function Ci(t){const e=z.c(24),{isStudio:i,isHomeRoute:r,onCreateProject:n}=t,[a]=Qe();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Be.decoChatPanelWidth(),e[0]=l):l=e[0];const[o]=He(l,30),[c]=Pe(),d=i&&c.experimental_projects?"":void 0,u=`${o}cqi`;let f;e[1]!==u?(f={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":u},e[1]=u,e[2]=f):f=e[2];const m=f;let x;e[3]!==n?(x=s.jsx(vi,{onCreateProject:n}),e[3]=n,e[4]=x):x=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={background:"transparent",containerType:"inline-size"},e[5]=j):j=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g={overflow:"visible"},e[6]=g):g=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h={overflow:"visible"},e[7]=h):h=e[7];const C=a&&"rounded-tr-[0.75rem] border-r";let v;e[8]!==C?(v=P("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",C),e[8]=C,e[9]=v):v=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Ye,{})}),e[10]=p):p=e[10];let S;e[11]!==v?(S=s.jsx(lt,{className:"min-w-0 flex flex-col",style:h,children:s.jsx("div",{className:v,children:p})}),e[11]=v,e[12]=S):S=e[12];let N;e[13]!==a||e[14]!==r?(N=!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ns,{className:"bg-sidebar"}),s.jsx(Si,{className:P("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",a?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx(ks,{})})})})]}),e[13]=a,e[14]=r,e[15]=N):N=e[15];let b;e[16]!==S||e[17]!==N?(b=s.jsx(Ds,{className:"pt-1.5",style:j,children:s.jsxs(ys,{direction:"horizontal",className:"h-full",style:g,children:[S,N]})}),e[16]=S,e[17]=N,e[18]=b):b=e[18];let y;return e[19]!==b||e[20]!==d||e[21]!==m||e[22]!==x?(y=s.jsxs(Ts,{className:"flex-1 bg-sidebar","data-studio":d,style:m,children:[x,b]}),e[19]=b,e[20]=d,e[21]=m,e[22]=x,e[23]=y):y=e[23],y}function _i(){const{org:t,project:e}=Ke({strict:!1}),i=Le(),[r,n]=E.useState(!1),a=i.location.pathname===`/${t}/${e}`||i.location.pathname===`/${t}/${e}/`,l=e??G,{data:o}=It({queryKey:Pt.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:u}=await ce.organization.setActive({organizationSlug:t});return{org:u,project:{slug:l,isOrgAdmin:l===G}}},gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1});if(!o)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(pt,{})})}),s.jsx(Ye,{})]});if(!o.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const c={...o,project:{...o.project,slug:l,isOrgAdmin:l===G}},d=l===G;return s.jsxs(At,{...c,children:[s.jsx(ki,{children:s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",children:s.jsx(J.Provider,{children:s.jsx(Ci,{isStudio:d,isHomeRoute:a,onCreateProject:()=>n(!0)})})})}),s.jsx(Ze,{open:r,onOpenChange:n})]})}function mr(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(yi,{children:s.jsx(E.Suspense,{fallback:s.jsx(Ve,{}),children:s.jsx(_i,{})})}),t[0]=e):e=t[0],e}export{mr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,D as M,G as k,j as d,H as f,aH as P,T as S,U as F,Q as y,J as V,M as T,R as D,c as x,v as g}from"./index-CzFqQvXW.js";var m="Tabs",[G]=F(m,[y]),w=y(),[L,h]=G(m),C=p.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...v}=n,u=M(i),[c,b]=k({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(L,{scope:a,baseId:P(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(f.div,{dir:u,"data-orientation":o,...v,ref:e})})});C.displayName=m;var N="TabsList",j=p.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=w(a);return d.jsx(D,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(f.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});j.displayName=N;var I="TabsTrigger",_=p.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(I,a),i=w(a),l=E(o.baseId,t),v=$(o.baseId,t),u=t===o.value;return d.jsx(V,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(f.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":v,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});_.displayName=I;var R="TabsContent",A=p.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(R,a),l=E(i.baseId,t),v=$(i.baseId,t),u=t===i.value,c=p.useRef(u);return p.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(S,{present:r||u,children:({present:b})=>d.jsx(f.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:v,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});A.displayName=R;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var z=C,H=j,K=_,B=A;function J(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(z,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function O(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(H,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function U(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(B,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Q as T,O as a,U as b,J as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,j as r,E as ae,r as Z,u as oe,b as ie,m as le,n as ne,K as G}from"./index-CzFqQvXW.js";import{C as ce,a as me}from"./collection-table-wrapper-hM0ppyEG.js";import{C as de,E as J}from"./collection-search-aEfiIRVT.js";import{P as _}from"./index-BeKO7nFo.js";import{u as ue,U as pe}from"./use-list-state-pp-Ywt5d.js";import{f as fe}from"./format-time-CMKyl-GC.js";import{a as he,u as xe}from"./constants-0JLhMmM7.js";import{B as ge,a as je,b as ye,c as Se}from"./breadcrumb-CtNnsyqL.js";import{B as b}from"./badge-CMOYVtO8.js";import{i as be}from"./AlertCircle-Dvy3oHwl.js";import{c as _e}from"./AlertOctagon-Y8Xx5Uc4.js";import{n as X}from"./CheckDone01-DgNkGXSd.js";import{i as we}from"./Check-BGWNBpXb.js";import{s as Ce}from"./Clock-DjTfMWYb.js";import{i as ee}from"./Loading01-DvHkBn5K.js";import{u as Ne,a as Te}from"./context-CnW_lI9R.js";import"./dropdown-menu-bZQdGgsX.js";import"./ChevronRight-B-dZm0Fo.js";import"./ArrowDown-B0XF9QfR.js";import"./ArrowUp-CjPyEOxC.js";import"./Grid01-C85povgK.js";import"./List-Dy03iFlP.js";import"./tooltip-BGn6dJhi.js";import"./index-gksA6r5d.js";import"./table-C7IfzCau.js";import"./SearchMd-Bec1mZCp.js";import"./input-Rcf9et7W.js";import"./localstorage-keys-DtK7peUq.js";import"./useQuery-BE7O7fKt.js";import"./useMutation-DsQcwaJP.js";import"./avatar-DX9xarA9.js";import"./use-view-mode-k6uWDVq8.js";import"./use-mobile-DIBT-lEk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-virtual-mcp-CaM9kbfY.js";import"./use-connection-CmCfM9T5.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-CPv795TN.js";import"./use-binding-Ctbwf5zu.js";import"./binder-CN-yhtfQ.js";import"./use-preferences-fTjyFgCz.js";import"./checkbox-Bs5NWE_x.js";import"./dialog-CzmRWg_H.js";import"./X-BaOBrQh9.js";import"./select-CSl7KVC3.js";import"./ChevronDown-CxLgy5uI.js";import"./skeleton-BGGjmBE-.js";import"./AlignLeft-C1Pd8crU.js";import"./ArrowLeft-Ddv8Es1G.js";import"./Image01-CyQ-9pmM.js";import"./RefreshCcw01-B_P3Otqi.js";import"./Settings01-CGjDKLLq.js";import"./useSuspenseInfiniteQuery-BSW1dpRq.js";import"./infiniteQueryObserver-B0QSZ6Wg.js";function ke(e){const s=O.c(9),{status:n,stepCount:l}=e;switch(n){case"in_progress":{let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(ee,{size:11,className:"animate-spin"}),s[0]=a):a=s[0];const c=l?`Running · step ${l}`:"Running";let m;return s[1]!==c?(m=r.jsxs(b,{variant:"secondary",className:"gap-1",children:[a,c]}),s[1]=c,s[2]=m):m=s[2],m}case"completed":{let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(b,{variant:"success",className:"gap-1",children:[r.jsx(we,{size:11}),"Completed"]}),s[3]=a):a=s[3],a}case"requires_action":{let a;return s[4]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(b,{variant:"outline",className:"gap-1 text-blue-600 border-blue-600/40",children:[r.jsx(be,{size:11}),"Waiting for input"]}),s[4]=a):a=s[4],a}case"failed":{let a;return s[5]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(b,{variant:"destructive",className:"gap-1",children:[r.jsx(_e,{size:11}),"Failed"]}),s[5]=a):a=s[5],a}case"expired":{let a;return s[6]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(b,{variant:"outline",className:"gap-1 text-warning border-warning/40",children:[r.jsx(Ce,{size:11}),"Timed out"]}),s[6]=a):a=s[6],a}default:{let a;return s[7]!==n?(a=r.jsx(b,{variant:"secondary",className:"gap-1",children:n}),s[7]=n,s[8]=a):a=s[8],a}}}function ve(){const e=O.c(64),{org:s,project:n,locator:l}=oe();let a;e[0]!==s.id?(a={connectionId:he,orgId:s.id},e[0]=s.id,e[1]=a):a=e[1];const c=xe(a),m=ie(),{switchToThread:I}=Ne(),P=le();let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,e[2]=w):w=e[2];const[R,Q]=Z.useState(w);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=o=>{Q(S=>{const i=new Map(S);return i.set(o.subject,o.data.stepCount),i})},e[3]=C):C=e[3];let d;e[4]!==l||e[5]!==P?(d=o=>{P.invalidateQueries({queryKey:G.taskThreads(l)}),o.data.status!=="in_progress"&&Q(S=>{const i=new Map(S);return i.delete(o.subject),i})},e[4]=l,e[5]=P,e[6]=d):d=e[6];let N;e[7]!==s.id||e[8]!==d?(N={orgId:s.id,onStep:C,onThreadStatus:d},e[7]=s.id,e[8]=d,e[9]=N):N=e[9],Te(N);let T;e[10]!==s.slug?(T={namespace:s.slug,resource:"tasks",defaultSortKey:"updated_at",defaultViewMode:"table"},e[10]=s.slug,e[11]=T):T=e[11];const t=ue(T);let u;e[12]!==l?(u=G.taskThreads(l),e[12]=l,e[13]=u):u=e[13];let p;e[14]!==c?(p=async()=>{if(!c)throw new Error("MCP client is not available");const o=await c.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:100,offset:0}});return(o.structuredContent??o).items??[]},e[14]=c,e[15]=p):p=e[15];let k;e[16]!==u||e[17]!==p?(k={queryKey:u,queryFn:p,staleTime:3e4},e[16]=u,e[17]=p,e[18]=k):k=e[18];const{data:V}=ne(k);let v;if(e[19]!==V||e[20]!==t){const o=V.filter(Ee),S=t.searchTerm?o.filter(U=>U.title.toLowerCase().includes(t.searchTerm.toLowerCase())):o;let i;e[22]!==t?(i=(U,te)=>{const{sortKey:F,sortDirection:W}=t;if(!F||!W)return 0;const se=String(U[F]??""),re=String(te[F]??""),Y=se.localeCompare(re);return W==="asc"?Y:-Y},e[22]=t,e[23]=i):i=e[23],v=[...S].sort(i),e[19]=V,e[20]=t,e[21]=v}else v=e[21];const q=v;let D;e[24]!==m||e[25]!==s.slug||e[26]!==n.slug||e[27]!==I?(D=async o=>{await I(o.id),m({to:"/$org/$project",params:{org:s.slug,project:n.slug}})},e[24]=m,e[25]=s.slug,e[26]=n.slug,e[27]=I,e[28]=D):D=e[28];const A=D;let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K={id:"title",header:"Title",render:Me,cellClassName:"flex-1 min-w-0",sortable:!0},e[29]=K):K=e[29];let f;e[30]!==R?(f={id:"status",header:"Status",render:o=>r.jsx(ke,{status:o.status??"completed",stepCount:R.get(o.id)}),cellClassName:"w-40 shrink-0",sortable:!0},e[30]=R,e[31]=f):f=e[31];let M,E;e[32]===Symbol.for("react.memo_cache_sentinel")?(M={id:"created_by",header:"Created by",render:Ke,cellClassName:"w-32 shrink-0"},E={id:"updated_at",header:"Updated",render:De,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[32]=M,e[33]=E):(M=e[32],E=e[33]);let L;e[34]!==f?(L=[K,f,M,E],e[34]=f,e[35]=L):L=e[35];const H=L;let B;e[36]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(_.Header.Left,{children:r.jsx(ge,{children:r.jsx(je,{children:r.jsx(ye,{children:r.jsx(Se,{children:"Tasks"})})})})}),e[36]=B):B=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=[{id:"title",label:"Title"},{id:"status",label:"Status"},{id:"updated_at",label:"Updated"}],e[37]=z):z=e[37];let h;e[38]!==t.handleSort||e[39]!==t.setViewMode||e[40]!==t.sortDirection||e[41]!==t.sortKey||e[42]!==t.viewMode?(h=r.jsxs(_.Header,{children:[B,r.jsx(_.Header.Right,{children:r.jsx(ce,{viewMode:t.viewMode,onViewModeChange:t.setViewMode,sortKey:t.sortKey,sortDirection:t.sortDirection,onSort:t.handleSort,sortOptions:z})})]}),e[38]=t.handleSort,e[39]=t.setViewMode,e[40]=t.sortDirection,e[41]=t.sortKey,e[42]=t.viewMode,e[43]=h):h=e[43];let x;e[44]!==t?(x=o=>{o.key==="Escape"&&(t.setSearch(""),o.target.blur())},e[44]=t,e[45]=x):x=e[45];let g;e[46]!==t.search||e[47]!==t.setSearch||e[48]!==x?(g=r.jsx(de,{value:t.search,onChange:t.setSearch,placeholder:"Search tasks...",onKeyDown:x}),e[46]=t.search,e[47]=t.setSearch,e[48]=x,e[49]=g):g=e[49];let j;e[50]!==t.search?(j=t.search?r.jsx(J,{image:r.jsx(X,{size:36,className:"text-muted-foreground"}),title:"No tasks found",description:`No tasks match "${t.search}"`}):r.jsx(J,{image:r.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-muted",children:r.jsx(X,{size:32,className:"text-muted-foreground"})}),title:"No tasks yet",description:"Tasks will appear here when agents start processing work."}),e[50]=t.search,e[51]=j):j=e[51];let y;e[52]!==H||e[53]!==t.handleSort||e[54]!==t.sortDirection||e[55]!==t.sortKey||e[56]!==A||e[57]!==j||e[58]!==q?(y=r.jsx(_.Content,{children:r.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r.jsx(me,{columns:H,data:q,isLoading:!1,sortKey:t.sortKey,sortDirection:t.sortDirection,onSort:t.handleSort,onRowClick:A,emptyState:j})})}),e[52]=H,e[53]=t.handleSort,e[54]=t.sortDirection,e[55]=t.sortKey,e[56]=A,e[57]=j,e[58]=q,e[59]=y):y=e[59];let $;return e[60]!==h||e[61]!==g||e[62]!==y?($=r.jsxs(_,{children:[h,g,y]}),e[60]=h,e[61]=g,e[62]=y,e[63]=$):$=e[63],$}function De(e){return r.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?fe(new Date(e.updated_at)):"—"})}function Ke(e){return r.jsx(pe,{id:e.created_by,size:"3xs"})}function Me(e){return r.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ee(e){return!e.hidden}function Lt(){const e=O.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(ae,{children:r.jsx(Z.Suspense,{fallback:r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:r.jsx(ve,{})})}),e[0]=s):s=e[0],s}export{Lt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as w,u as C,K as D,v as M,j as u,r as K}from"./index-CzFqQvXW.js";import{A as B}from"./avatar-DX9xarA9.js";import{u as P}from"./useQuery-BE7O7fKt.js";import{a as k,u as A}from"./constants-0JLhMmM7.js";import{u as L}from"./use-view-mode-k6uWDVq8.js";function R(c){const e=w.c(11),{org:i}=C();let n;e[0]!==i.id?(n={connectionId:k,orgId:i.id},e[0]=i.id,e[1]=n):n=e[1];const o=A(n);let t;e[2]!==c?(t=D.user(c),e[2]=c,e[3]=t):t=e[3];let l;e[4]!==o||e[5]!==c?(l=async()=>{const y=await o.callTool({name:"USER_GET",arguments:{id:c}});return(y.structuredContent??y).user},e[4]=o,e[5]=c,e[6]=l):l=e[6];const f=!!c;let s;return e[7]!==t||e[8]!==l||e[9]!==f?(s={queryKey:t,queryFn:l,staleTime:3e5,retry:1,enabled:f},e[7]=t,e[8]=l,e[9]=f,e[10]=s):s=e[10],P(s)}function Q(c){const e=w.c(39),{id:i,size:n,showEmail:o,className:t}=c,l=n===void 0?"xs":n,f=o===void 0?!1:o,{data:s,isLoading:y,isError:N}=R(i);if(y){let a;e[0]!==t?(a=M("flex items-center gap-2",t),e[0]=t,e[1]=a):a=e[1];let r;e[2]!==l?(r=u.jsx(B.Skeleton,{shape:"circle",size:l}),e[2]=l,e[3]=r):r=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=m):m=e[4];let d;e[5]!==f?(d=f&&u.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=f,e[6]=d):d=e[6];let p;e[7]!==d?(p=u.jsxs("div",{className:"flex flex-col gap-1",children:[m,d]}),e[7]=d,e[8]=p):p=e[8];let b;return e[9]!==a||e[10]!==r||e[11]!==p?(b=u.jsxs("div",{className:a,children:[r,p]}),e[9]=a,e[10]=r,e[11]=p,e[12]=b):b=e[12],b}if(N||!s){let a;e[13]!==t?(a=M("flex items-center gap-2",t),e[13]=t,e[14]=a):a=e[14];let r;e[15]!==l?(r=u.jsx(B,{shape:"circle",size:l,fallback:"?",muted:!0}),e[15]=l,e[16]=r):r=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=u.jsx("div",{className:"flex flex-col",children:u.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=m):m=e[17];let d;return e[18]!==a||e[19]!==r?(d=u.jsxs("div",{className:a,children:[r,m]}),e[18]=a,e[19]=r,e[20]=d):d=e[20],d}let v;e[21]!==t?(v=M("flex items-center gap-2",t),e[21]=t,e[22]=v):v=e[22];const j=s.image??void 0;let g;e[23]!==l||e[24]!==j||e[25]!==s.name?(g=u.jsx(B,{shape:"circle",size:l,url:j,fallback:s.name}),e[23]=l,e[24]=j,e[25]=s.name,e[26]=g):g=e[26];let x;e[27]!==s.name?(x=u.jsx("div",{className:"text-sm font-medium",children:s.name}),e[27]=s.name,e[28]=x):x=e[28];let S;e[29]!==f||e[30]!==s.email?(S=f&&u.jsx("div",{className:"text-xs text-muted-foreground",children:s.email}),e[29]=f,e[30]=s.email,e[31]=S):S=e[31];let h;e[32]!==x||e[33]!==S?(h=u.jsxs("div",{className:"flex flex-col",children:[x,S]}),e[32]=x,e[33]=S,e[34]=h):h=e[34];let F;return e[35]!==v||e[36]!==g||e[37]!==h?(F=u.jsxs("div",{className:v,children:[g,h]}),e[35]=v,e[36]=g,e[37]=h,e[38]=F):F=e[38],F}function q(c){const e=`deco-filters-${c}`,[i,n]=K.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[i,t=>{n(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function z(c){const e=w.c(7),[i,n]=K.useState(c),[o,t]=K.useState(c?"desc":null);let l;e[0]!==o||e[1]!==i?(l=y=>{i!==y?(n(y),t("asc")):o==="asc"?t("desc"):o==="desc"&&(n(void 0),t(null))},e[0]=o,e[1]=i,e[2]=l):l=e[2];const f=l;let s;return e[3]!==f||e[4]!==o||e[5]!==i?(s={sortKey:i,sortDirection:o,handleSort:f},e[3]=f,e[4]=o,e[5]=i,e[6]=s):s=e[6],s}function Y(c){const e=w.c(20),{namespace:i,resource:n,defaultSortKey:o,defaultViewMode:t}=c,l=o===void 0?"title":o,f=t===void 0?"table":t,[s,y]=K.useState(""),N=K.useDeferredValue(s),v=`${i}-${n}`,[j,g]=q(v),x=`mesh-${n}-filter-visible-${i}`;let S;e[0]!==x?(S=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=S):S=e[1];const[h,F]=K.useState(S);let a;e[2]!==x?(a=T=>{F(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=a):a=e[3];const r=a;let m;e[4]!==h||e[5]!==r?(m=()=>{r(!h)},e[4]=h,e[5]=r,e[6]=m):m=e[6];const d=m,[p,b]=L(`mesh-${n}-${i}`,f),{sortKey:U,sortDirection:E,handleSort:V}=z(l),_=U;let $;return e[7]!==h||e[8]!==j||e[9]!==V||e[10]!==s||e[11]!==N||e[12]!==r||e[13]!==g||e[14]!==b||e[15]!==E||e[16]!==_||e[17]!==d||e[18]!==p?($={search:s,searchTerm:N,setSearch:y,filters:j,setFilters:g,filterBarVisible:h,setFilterBarVisible:r,toggleFilterBar:d,viewMode:p,setViewMode:b,sortKey:_,sortDirection:E,handleSort:V},e[7]=h,e[8]=j,e[9]=V,e[10]=s,e[11]=N,e[12]=r,e[13]=g,e[14]=b,e[15]=E,e[16]=_,e[17]=d,e[18]=p,e[19]=$):$=e[19],$}export{Q as U,Y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as l,n as c,at as m,au as f}from"./index-CzFqQvXW.js";import{u as y}from"./useQuery-BE7O7fKt.js";import{K as n}from"./constants-0JLhMmM7.js";async function u(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function q(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function d(s){const e=l.c(12);let t,r;e[0]!==s?({client:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=r.staleTime??3e4;let a;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==p?(a={...r,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=r,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}function w(s){const e=l.c(12);let t,r;e[0]!==s?({client:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=r.staleTime??3e4;let a;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==p?(a={...r,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=r,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}export{w as a,q as g,u as l,d as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o}from"./index-CzFqQvXW.js";import{u as r,L as n}from"./localstorage-keys-DtK7peUq.js";const s={devMode:!1,experimental_projects:!1,experimental_tasks:!1,toolApprovalLevel:"none",enableNotifications:typeof Notification<"u"};function f(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.preferences(),e[0]=t):t=e[0],r(t,a)}function a(e){return{...s,...e}}export{f as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-B0QSZ6Wg.js";import{Y as i}from"./index-CzFqQvXW.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as u,a3 as s}from"./index-CzFqQvXW.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-B0QSZ6Wg.js";import{Y as u,Z as n}from"./index-CzFqQvXW.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as N,u as w,d as q,b as G,j as t,B as I,O as B,c as _,E as Q,_ as J,aD as Z,m as V,K as W,t as A}from"./index-CzFqQvXW.js";import{a as Y,u as X,e as ee}from"./constants-0JLhMmM7.js";import{C as te}from"./collection-tab-ByOYG4eu.js";import{g as ne,h as se}from"./use-connection-CmCfM9T5.js";import{E as R}from"./collection-search-aEfiIRVT.js";import{P as x}from"./index-BeKO7nFo.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-CtNnsyqL.js";import{a as ie,b as oe}from"./use-binding-Ctbwf5zu.js";import{i as le}from"./Loading01-DvHkBn5K.js";import{s as re}from"./RefreshCcw01-B_P3Otqi.js";import{u as ae}from"./useMutation-DsQcwaJP.js";import{e as ce}from"./Dataflow03-Dbafm5jn.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-hM0ppyEG.js";import"./dropdown-menu-bZQdGgsX.js";import"./Check-BGWNBpXb.js";import"./ChevronRight-B-dZm0Fo.js";import"./ArrowDown-B0XF9QfR.js";import"./ArrowUp-CjPyEOxC.js";import"./Grid01-C85povgK.js";import"./List-Dy03iFlP.js";import"./tooltip-BGn6dJhi.js";import"./index-gksA6r5d.js";import"./table-C7IfzCau.js";import"./card-BECXECFc.js";import"./integration-icon-Cr629JYK.js";import"./Container-CH2V2ATa.js";import"./Copy01-Ba42JLNP.js";import"./DotsVertical-D-x0DTAA.js";import"./Edit01-NXKv8M2Y.js";import"./Eye-Da9OHWjs.js";import"./Trash01-DfwWsbuW.js";import"./empty-state-BuKC-FeY.js";import"./Inbox01-DUxLR6jm.js";import"./use-list-state-pp-Ywt5d.js";import"./avatar-DX9xarA9.js";import"./useQuery-BE7O7fKt.js";import"./use-view-mode-k6uWDVq8.js";import"./use-mobile-DIBT-lEk.js";import"./constants-BnCnMsvC.js";import"./alert-dialog-CHhoNaC0.js";import"./Plus-C48LE9QF.js";import"./layout-DvurrRZC.js";import"./SearchMd-Bec1mZCp.js";import"./input-Rcf9et7W.js";import"./localstorage-keys-DtK7peUq.js";import"./binder-CN-yhtfQ.js";const D=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));D.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ne(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=_.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=se();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=ie(m)[0],u=oe(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[U,H]=N.useState(null),L=l&&S&&(l.id||U);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(J,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Z,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(D,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==L||e[24]!==s?(y=L?t.jsx(te,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=L,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(Q,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=_.c(12),{org:e,project:i}=w(),a=V();let o;n[0]!==e.id?(o={connectionId:Y,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=X(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=_.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function at(){const n=_.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:ee()}),n[2]=o):o=n[2],o}export{at as default};
|