decocms 4.17.0 → 4.17.2
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-D8gnDqwf.js → AlertCircle-DdrwwZMq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BlXghneM.js → ArrowUpRight-jXBy9ipz.js} +1 -1
- package/dist/client/assets/{CheckCircle-DCCFCHyS.js → CheckCircle-3ZOkMXIL.js} +1 -1
- package/dist/client/assets/{ChevronDown-BLALKRGM.js → ChevronDown-CLx4-WM1.js} +1 -1
- package/dist/client/assets/{ChevronRight-Gacf5_E2.js → ChevronRight-jYKilAXW.js} +1 -1
- package/dist/client/assets/{ChevronUp-DBXbYduj.js → ChevronUp-BGt4chTY.js} +1 -1
- package/dist/client/assets/{DotsVertical-D7ryssxp.js → DotsVertical-CqrNmdxL.js} +1 -1
- package/dist/client/assets/{Eye-BFLaa-Ve.js → Eye-o5yQXJvl.js} +1 -1
- package/dist/client/assets/{FilterLines-CK4jmUMp.js → FilterLines-CDGBU4Yu.js} +1 -1
- package/dist/client/assets/{Globe01-Bx-hz-as.js → Globe01-CcG20jKe.js} +1 -1
- package/dist/client/assets/{Globe04-u6eY2Kop.js → Globe04-Cv_V-Fs_.js} +1 -1
- package/dist/client/assets/{HardDrive-B06hZ2KP.js → HardDrive-BSIK0u4A.js} +1 -1
- package/dist/client/assets/{Key01-D0oVN5CX.js → Key01-DgIKoZGo.js} +1 -1
- package/dist/client/assets/{LayoutLeft-1bN-FR8E.js → LayoutLeft-Ck3c6EbZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D4vA-I3a.js → LinkExternal01-C4RHyT_k.js} +1 -1
- package/dist/client/assets/{Monitor01-DrJKeSJ4.js → Monitor01-CWIDsYmm.js} +1 -1
- package/dist/client/assets/{Palette-CvuWqoBi.js → Palette-BFwjtSY1.js} +1 -1
- package/dist/client/assets/{Play-DuOwU6E2.js → Play-DqQKGu-U.js} +1 -1
- package/dist/client/assets/{Plus-Bz2JwGOE.js → Plus-DZiClNST.js} +1 -1
- package/dist/client/assets/{SearchLg-CfwbHNr5.js → SearchLg-CaS6w27I.js} +1 -1
- package/dist/client/assets/{SearchMd-Bn2Kbs9E.js → SearchMd-CYoVQBZq.js} +1 -1
- package/dist/client/assets/{Settings02-N32UBNZq.js → Settings02-C-6P9tLl.js} +1 -1
- package/dist/client/assets/{Shield01-BztOm8mA.js → Shield01-B3rvsBtl.js} +1 -1
- package/dist/client/assets/{Star01-GFElhP7X.js → Star01-CkOKT_Ec.js} +1 -1
- package/dist/client/assets/{Stars01-CK-XatBt.js → Stars01-sPe6wVRL.js} +1 -1
- package/dist/client/assets/{Stars02-BpRz9194.js → Stars02-YL1S7hw5.js} +1 -1
- package/dist/client/assets/{Sun-CRJdfBLT.js → Sun-CX24eczl.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Bcp8nSOf.js → SwitchHorizontal01-1JfD3pEr.js} +1 -1
- package/dist/client/assets/{Tool01-DrE6CqtR.js → Tool01-84S8urW1.js} +1 -1
- package/dist/client/assets/{Trash01-kVRWRMat.js → Trash01-oru1b8W8.js} +1 -1
- package/dist/client/assets/{Upload01-TiHLQTwG.js → Upload01-Cou_1dwr.js} +1 -1
- package/dist/client/assets/{User01-9o9EbE3X.js → User01-BL-jdznB.js} +1 -1
- package/dist/client/assets/{Users01-CMbqiB_R.js → Users01-CvViXbMH.js} +1 -1
- package/dist/client/assets/{Users03-K1B4uaw7.js → Users03-B-JAgn9g.js} +1 -1
- package/dist/client/assets/{X-BQZZQdg0.js → X-D1xM7jXL.js} +1 -1
- package/dist/client/assets/{XCircle-BOFvuFHl.js → XCircle-D1ibZ16t.js} +1 -1
- package/dist/client/assets/{XClose-ChRyc7zA.js → XClose-D0Zu_lRC.js} +1 -1
- package/dist/client/assets/{Zap-RN8PAcZE.js → Zap-Bo8lb0F-.js} +1 -1
- package/dist/client/assets/{ZapSquare-D4RqdrSL.js → ZapSquare-B4AjMOPu.js} +1 -1
- package/dist/client/assets/{ZoomOut-CwXzA7X6.js → ZoomOut-DfCeUHFX.js} +1 -1
- package/dist/client/assets/{access-gate-DayZt2qh.js → access-gate-CRTZfiyx.js} +1 -1
- package/dist/client/assets/{add-section-modal-BgsTQi1S.js → add-section-modal-t6NTp3dt.js} +1 -1
- package/dist/client/assets/{agent-capabilities-C8WZk9re.js → agent-capabilities-BDCwG9Eh.js} +1 -1
- package/dist/client/assets/agent-icon-C1BWispo.js +1 -0
- package/dist/client/assets/{agents-list-Bb32bFe0.js → agents-list-D2wP1uld.js} +1 -1
- package/dist/client/assets/ai-providers-D8gEIycW.js +1 -0
- package/dist/client/assets/{alert-DGlfAxXY.js → alert-DAyg3TSF.js} +1 -1
- package/dist/client/assets/{alert-dialog-D87-BKea.js → alert-dialog-ha1v59qY.js} +2 -2
- package/dist/client/assets/app-editor-3RKJRSU7.js +1 -0
- package/dist/client/assets/{auth-catchall-CDZHIENi.js → auth-catchall-B-EHVfUd.js} +1 -1
- package/dist/client/assets/{auth-entry--IJuST3G.js → auth-entry-BFuuwZkf.js} +1 -1
- package/dist/client/assets/{auth-pLLkIszG.js → auth-ou2428Bw.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Cm8DpBZy.js → auth-split-layout-lfv3bwPm.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-VdmVLbtW.js → authenticate-and-persist-oauth-B3lWqExf.js} +1 -1
- package/dist/client/assets/{automation-list-row-DJcYtMaz.js → automation-list-row-DUKMiAFn.js} +1 -1
- package/dist/client/assets/{automation-runs-BQZ05VJM.js → automation-runs-HEfBB2IO.js} +1 -1
- package/dist/client/assets/{automations-DXzG8kgd.js → automations-DcVo9aht.js} +1 -1
- package/dist/client/assets/{avatar-DxH3BnSs.js → avatar-tYV7Xj5e.js} +1 -1
- package/dist/client/assets/{badge-wh5eWpb9.js → badge-DjU6bfHE.js} +1 -1
- package/dist/client/assets/{block-document-OYJ-kskh.js → block-document-CYnqjTQ5.js} +1 -1
- package/dist/client/assets/{brand-context-Dkhy-emW.js → brand-context-D5KhJzF5.js} +1 -1
- package/dist/client/assets/{breadcrumb-DZbB5tzN.js → breadcrumb-C_jNPElt.js} +1 -1
- package/dist/client/assets/{buckets-DWf7-mkQ.js → buckets-Bi6Dz7dc.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BfqGc7PR.js → bulk-category-panel-CQyTVuMJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-B0knfbbl.js → capability-load-error-B4T1DTOe.js} +1 -1
- package/dist/client/assets/{card-D-LCVQQb.js → card-BcWpe7XA.js} +1 -1
- package/dist/client/assets/category-editor-CHiWWzkP.js +1 -0
- package/dist/client/assets/{chat-context-CIKFBD8u.js → chat-context-BXvC8snN.js} +1 -1
- package/dist/client/assets/{checkbox-CFdij7Ei.js → checkbox-BGLrFwOD.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BJWjcvwa.js → cli-auth-success-SPj5zX1c.js} +1 -1
- package/dist/client/assets/{collection-detail-C8jnHEZw.js → collection-detail-ClK5ckvV.js} +1 -1
- package/dist/client/assets/{collection-display-button-DDEI8eBI.js → collection-display-button-AdaNOeng.js} +1 -1
- package/dist/client/assets/{collection-search-B0gYtEWh.js → collection-search-BWPhJb0W.js} +1 -1
- package/dist/client/assets/{collection-tabs-DGDRpyxJ.js → collection-tabs-LbK97vzL.js} +1 -1
- package/dist/client/assets/{command-VE4J0WmB.js → command-BrahLBH2.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DtwhvPKV.js → commerce-onboarding-BY8ZIbvj.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DRNK5Zqx.js → connect-desktop-dialog-wN68EGmx.js} +1 -1
- package/dist/client/assets/{connection-card-Dzp4nWAC.js → connection-card-CS0ZRcyq.js} +1 -1
- package/dist/client/assets/{connection-detail-BnRE6ILz.js → connection-detail-6cGe5AzW.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BKzMCiDP.js → connection-form-helpers--RFzi4SS.js} +1 -1
- package/dist/client/assets/{connections-BPohRO-Z.js → connections-BM_4XV1f.js} +1 -1
- package/dist/client/assets/{decopilot-D_-94MU_.js → decopilot-DitDP2XU.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DA88fFcW.js → decopilot-sse-pool-DrXwOdO1.js} +1 -1
- package/dist/client/assets/{dialog-BdIjDk0G.js → dialog-DaSKz7DM.js} +1 -1
- package/dist/client/assets/{domain-settings-CTC9j3wY.js → domain-settings-BssGRdmx.js} +1 -1
- package/dist/client/assets/{drawer-D1X6O6Aa.js → drawer-DdiW0TLs.js} +1 -1
- package/dist/client/assets/{dropdown-menu-8PMbgM0q.js → dropdown-menu-5pJpeeqf.js} +1 -1
- package/dist/client/assets/{empty-state-y_scHUYK.js → empty-state-B08-kVr_.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BhI39RpO.js → extract-connection-data-X711B5tE.js} +1 -1
- package/dist/client/assets/file-explorer-CXo4_clT.js +2 -0
- package/dist/client/assets/{file-type-icon-Bx1NX_Gy.js → file-type-icon-Cm6D0wrz.js} +1 -1
- package/dist/client/assets/{files-BFgu7BJp.js → files-K9oI8c_-.js} +1 -1
- package/dist/client/assets/{form-P-LOMg0X.js → form-D1efg8C-.js} +1 -1
- package/dist/client/assets/{general-DaU6Yz-f.js → general-BSA7tAJi.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CmustdLW.js → github-repo-picker-CXt90kMG.js} +1 -1
- package/dist/client/assets/{hooks-UY6BFV6z.js → hooks-BgBnOJ3c.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CopvXqdM.js → import-from-deco-dialog-P6TRPQ14.js} +1 -1
- package/dist/client/assets/index-8NfBTjo_.js +1 -0
- package/dist/client/assets/{index-BwaOBBZ-.js → index-B96RsdAE.js} +1 -1
- package/dist/client/assets/{index-DStyXwbT.js → index-BtaxzVR0.js} +1 -1
- package/dist/client/assets/{index-D4EP6iY-.js → index-C3i4LyhT.js} +1 -1
- package/dist/client/assets/{index-DJMmArQj.js → index-D3ZbfB7L.js} +1 -1
- package/dist/client/assets/{index-BrtU3HWl.js → index-D9Jl2teh.js} +1 -1
- package/dist/client/assets/{index-Dq2Ts3Yi.js → index-Da2BgJQV.js} +1 -1
- package/dist/client/assets/{index-BbFfuuHN.js → index-DikJYrmI.js} +1 -1
- package/dist/client/assets/{index-Cgz2WBho.js → index-YOEpEUyS.js} +1 -1
- package/dist/client/assets/{index-BgCyOgdF.js → index-YqfRemtU.js} +13 -13
- package/dist/client/assets/{index-CAQVV5KO.js → index-cif87MVR.js} +1 -1
- package/dist/client/assets/{index-BZCHEyhA.js → index-pn1YPMKj.js} +1 -1
- package/dist/client/assets/{index-DHTICC_v.js → index-qfheH9Xc.js} +26 -26
- package/dist/client/assets/{index-redirect-YHMCgUs4.js → index-redirect-DdgddsNH.js} +1 -1
- package/dist/client/assets/{input-DgsFOGyM.js → input-c3bkJxBD.js} +1 -1
- package/dist/client/assets/{integration-icon-m6Sa_hcd.js → integration-icon-DsTjAPrY.js} +1 -1
- package/dist/client/assets/{label-CwMsBEmc.js → label-C-M0DX5a.js} +1 -1
- package/dist/client/assets/{library-tab-DZNwBek9.js → library-tab-D1dP6e2l.js} +1 -1
- package/dist/client/assets/{login-DDPQBbDq.js → login-DMQTn7wh.js} +1 -1
- package/dist/client/assets/{mcp-oauth-SxDhA9AX.js → mcp-oauth-D8P2QaWG.js} +1 -1
- package/dist/client/assets/{members-DiR3wVIq.js → members-B3Jf-1QZ.js} +1 -1
- package/dist/client/assets/{monaco-editor-iFVtSMuF.js → monaco-editor-Bn7nTC-y.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D6W0tudn.js → monitoring-stats-row-D2SCaVP_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Dc1dGP3j.js → oauth-callback-ai-provider-BrGx-toi.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cj-8kU65.js → oauth-callback-arRRISlw.js} +1 -1
- package/dist/client/assets/{onboarding-DF_zbux6.js → onboarding-DfQssXGo.js} +1 -1
- package/dist/client/assets/{org-install-CEMN6R-y.js → org-install-CAxOgyNR.js} +1 -1
- package/dist/client/assets/{org-layout-bk5Xtfa_.js → org-layout-C7RcAVm5.js} +1 -1
- package/dist/client/assets/{organization-choice-CE_aU8pP.js → organization-choice-aXwHBCUC.js} +1 -1
- package/dist/client/assets/{page-seo-form-Derb8U-C.js → page-seo-form-DTBhJgv0.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DSFzu1g0.js +1 -0
- package/dist/client/assets/{popover-4-S-2t4S.js → popover-DvGqLTJl.js} +1 -1
- package/dist/client/assets/post-editor-C-KR7OSD.js +1 -0
- package/dist/client/assets/{primitives-DFOak6EH.js → primitives-Cbyyj3A3.js} +1 -1
- package/dist/client/assets/{profile-BNOuWcgq.js → profile-eglAZx5J.js} +1 -1
- package/dist/client/assets/project-app-view-BZfBTk7X.js +1 -0
- package/dist/client/assets/record-editor-lkwoQjs9.js +1 -0
- package/dist/client/assets/registry-_cXAc0hk.js +2 -0
- package/dist/client/assets/{registry-layout-BPKVzNcW.js → registry-layout-hOf6zsxt.js} +1 -1
- package/dist/client/assets/{require-capability-BJprrccL.js → require-capability-XNz95caz.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B0YEEBld.js → required-auth-layout-CrFETKOt.js} +1 -1
- package/dist/client/assets/{reset-password-CkXuGUs6.js → reset-password-DvMp7JEU.js} +1 -1
- package/dist/client/assets/{roles-lfwag5Tp.js → roles-HzDtUpXH.js} +1 -1
- package/dist/client/assets/{scroll-area-C8YtCymQ.js → scroll-area-Bkg-mZA1.js} +1 -1
- package/dist/client/assets/{search-input-Du_36cRj.js → search-input-Csys3Koh.js} +1 -1
- package/dist/client/assets/{secrets-CnPg0qON.js → secrets-Bc04lDOi.js} +1 -1
- package/dist/client/assets/{sections-editor-BR6KfAKE.js → sections-editor-DMIuM8hP.js} +1 -1
- package/dist/client/assets/{select-DzzBmNmo.js → select-CyjV0F4C.js} +1 -1
- package/dist/client/assets/{select-model-F8Y_Cf3t.js → select-model-DkNEmCB-.js} +1 -1
- package/dist/client/assets/seo-editor-CXv7fPuW.js +1 -0
- package/dist/client/assets/{settings-layout-CGT7LCro.js → settings-layout-CqQSdUJ1.js} +1 -1
- package/dist/client/assets/{settings-section-rq7s23q-.js → settings-section-CWGTzuvV.js} +1 -1
- package/dist/client/assets/{sheet-B3q7nz8B.js → sheet-DuOoVZUG.js} +1 -1
- package/dist/client/assets/{shell-controls-mi9y4ySh.js → shell-controls-_ERLWSRt.js} +1 -1
- package/dist/client/assets/{shell-layout-QzfqSuxf.js → shell-layout-DbD_tkNz.js} +1 -1
- package/dist/client/assets/{sidebar-D2BmctMK.js → sidebar-Dk_5AbOf.js} +1 -1
- package/dist/client/assets/{skeleton-f0d6RrIL.js → skeleton-erh5yXDG.js} +1 -1
- package/dist/client/assets/{sso-D4e1TwT3.js → sso-CA0aW0DE.js} +1 -1
- package/dist/client/assets/{store-DxI78Zhs.js → store-fNZRBFZQ.js} +1 -1
- package/dist/client/assets/store-registry-Bfou8ECl.js +2 -0
- package/dist/client/assets/{studio-tools-D6ANxpFE.js → studio-tools-BaSvhr-J.js} +1 -1
- package/dist/client/assets/{switch-BRlkUTqX.js → switch-BHo8xs7D.js} +1 -1
- package/dist/client/assets/{table-65-g1dd8.js → table-7NpUUPTt.js} +1 -1
- package/dist/client/assets/{tabs-ByVhqny2.js → tabs-MyyL-fGu.js} +1 -1
- package/dist/client/assets/task-row-CSJH3BP-.js +1 -0
- package/dist/client/assets/{task-status-BMnLETgS.js → task-status-CcNy4g07.js} +1 -1
- package/dist/client/assets/{textarea-Dp78LmPE.js → textarea-DE7i4Gz-.js} +1 -1
- package/dist/client/assets/{toggle-group-BIoy7tOG.js → toggle-group-BPcVs9aZ.js} +1 -1
- package/dist/client/assets/{toolbar-C1WgDWOZ.js → toolbar-DO76WyPk.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DdAIuoK2.js → toolbar-icon-button-CRc66nZ-.js} +1 -1
- package/dist/client/assets/tools-list-Bq5PisM1.js +1 -0
- package/dist/client/assets/{tooltip-CWNyrHYY.js → tooltip-CBYM2iV5.js} +1 -1
- package/dist/client/assets/{types-BHL4d6ji.js → types-BxTesI-C.js} +5 -5
- package/dist/client/assets/{use-ai-providers-CVS8EjHf.js → use-ai-providers-BLBRqrOl.js} +1 -1
- package/dist/client/assets/{use-automations-DJ1_UqKB.js → use-automations-5UyPQOVR.js} +1 -1
- package/dist/client/assets/{use-capability-BmznXR_9.js → use-capability-BOo3wKB9.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BXZK-6ig.js → use-clock-tick-DpMHy-Ay.js} +1 -1
- package/dist/client/assets/{use-collections-BnOL5hT8.js → use-collections-CQf58LpF.js} +1 -1
- package/dist/client/assets/{use-connection-CRsO-Bab.js → use-connection-BuG3o_JE.js} +1 -1
- package/dist/client/assets/{use-copy-DK8lBdjB.js → use-copy-jWg55WQ8.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C50juX43.js → use-create-virtual-mcp-LuXF-lyt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Q8tZcL7-.js → use-debounced-autosave-BlFX0cfT.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C2hJqHIV.js → use-debounced-value-Df6CEQAw.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BB7o7ets.js → use-decopilot-events-uI4wGrsY.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D7WMNDAi.js → use-delete-connection-UF4lOt5V.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bxsm4MXe.js → use-file-configs-Bs9D0249.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DFBavgZf.js → use-infinite-scroll-DlYly1rf.js} +1 -1
- package/dist/client/assets/{use-join-requests-CNT469hS.js → use-join-requests-B315-fOS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DAJmDOVO.js → use-mcp-client-CpnbLiac.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-D3eulxzR.js → use-mcp-prompts-B5dgZtuY.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-AjHzJbIQ.js → use-mcp-tools-DpNh0INt.js} +1 -1
- package/dist/client/assets/{use-members-BZroloWO.js → use-members-BRjOC4BL.js} +1 -1
- package/dist/client/assets/{use-mobile-BkWraisf.js → use-mobile-BnJF8Qa_.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Dlhjy-0a.js → use-navigate-to-agent-CI_L2BEy.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BG_aw3vg.js → use-org-auth-client-DmjZpfi2.js} +1 -1
- package/dist/client/assets/{use-org-sso-CEETlaem.js → use-org-sso-B_xa25Ag.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BrhJCA0y.js → use-organization-roles-BO6fS6vf.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D9G2tGsW.js → use-organization-settings-DtUUny9s.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CTTYiKTQ.js → use-registry-connections-CLetM4Ks.js} +1 -1
- package/dist/client/assets/{use-secrets-sB7thdOD.js → use-secrets-CuFzitLe.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DuOBmrHo.js → use-status-sounds-4tbPTgQW.js} +1 -1
- package/dist/client/assets/{use-view-mode-CFXBQhh0.js → use-view-mode-C2fVP0l9.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CJycW-Qv.js → use-virtual-mcp-OVYXqA3Z.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CgWnzkKu.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DtkXwhfE.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-DohIOUYY.js → useSuspenseQueries-g4R4jK3t.js} +1 -1
- package/dist/client/assets/{variant-calendar-DxXS9CiZ.js → variant-calendar-amJKLF4x.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D2SvIjQW.js → view-mode-toggle-DGsaaoN8.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-BRuLsBYY.js +0 -1
- package/dist/client/assets/ai-providers-CtFbvrBB.js +0 -1
- package/dist/client/assets/app-editor-BTeZcD9G.js +0 -1
- package/dist/client/assets/category-editor-dubEmgpx.js +0 -1
- package/dist/client/assets/file-explorer-BD0vY2dd.js +0 -2
- package/dist/client/assets/index-DTpadbju.js +0 -1
- package/dist/client/assets/page-seo-sheet-BoNARuVh.js +0 -1
- package/dist/client/assets/post-editor-CHJjQHP8.js +0 -1
- package/dist/client/assets/project-app-view-ChmoDNv-.js +0 -1
- package/dist/client/assets/record-editor-CS39Vomm.js +0 -1
- package/dist/client/assets/registry-D4tm3ZFm.js +0 -2
- package/dist/client/assets/seo-editor-gJ1HxoCF.js +0 -1
- package/dist/client/assets/shell-route-loading-Bpj8AlnX.js +0 -1
- package/dist/client/assets/store-registry-DKwI23vv.js +0 -2
- package/dist/client/assets/tools-list-BrZf2-sc.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Bl42Nudd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-uA0LQwFa.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as B,s as N,av as ae,ax as le,ay as he,aw as xe,a_ as me,c as U,n as ge,p as be,r as O,j as s,a0 as Ee,t as Q,$ as ye,G as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,v as je,E as $e}from"./index-DHTICC_v.js";import{i as Re}from"./AlertCircle-D8gnDqwf.js";import{P as te}from"./index-BZCHEyhA.js";import{S as ne}from"./skeleton-f0d6RrIL.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-rq7s23q-.js";import{u as X,b as se,c as Se}from"./use-ai-providers-CVS8EjHf.js";import{i as Oe}from"./CheckCircle-DCCFCHyS.js";import{n as Me,o as Te,p as Ue,S as ze}from"./chat-context-CIKFBD8u.js";import{d as qe,e as Le}from"./use-organization-settings-D9G2tGsW.js";import{M as Ve}from"./select-model-F8Y_Cf3t.js";import{u as Be}from"./use-debounced-autosave-Q8tZcL7-.js";import{I as ie}from"./input-DgsFOGyM.js";import{T as pe,a as Ge}from"./toggle-group-BIoy7tOG.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-D87-BKea.js";import{u as H}from"./studio-tools-D6ANxpFE.js";import{s as Qe}from"./Plus-Bz2JwGOE.js";import{b as Ye}from"./Tool01-DrE6CqtR.js";import{s as We}from"./Trash01-kVRWRMat.js";import{A as He}from"./avatar-DxH3BnSs.js";import{O as Ke,P as Je,C as fe}from"./decopilot-D_-94MU_.js";import{i as Xe}from"./Settings02-N32UBNZq.js";import{s as Ze}from"./Eye-BFLaa-Ve.js";import{D as et,c as tt,a as st,d as it,e as rt}from"./dialog-BdIjDk0G.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-BJprrccL.js";import"./sidebar-D2BmctMK.js";import"./LayoutLeft-1bN-FR8E.js";import"./use-mobile-BkWraisf.js";import"./sheet-B3q7nz8B.js";import"./X-BQZZQdg0.js";import"./tooltip-CWNyrHYY.js";import"./card-D-LCVQQb.js";import"./ArrowUpRight-BlXghneM.js";import"./hooks-UY6BFV6z.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-decopilot-events-BB7o7ets.js";import"./tab-id-DPNwWMUY.js";import"./drawer-D1X6O6Aa.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./ChevronUp-DBXbYduj.js";import"./User01-9o9EbE3X.js";import"./checkbox-CFdij7Ei.js";import"./select-DzzBmNmo.js";import"./ChevronDown-BLALKRGM.js";import"./Key01-D0oVN5CX.js";import"./SearchMd-Bn2Kbs9E.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-DrJKeSJ4.js";import"./ChevronRight-Gacf5_E2.js";import"./Stars01-CK-XatBt.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BmznXR_9.js";import"./access-gate-DayZt2qh.js";import"./capability-load-error-B0knfbbl.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const R=y.keyId??m??"";S(R),a({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==R?(M=[o,t,j,_,p,f,y,R],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(pe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==R||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:R}),e[32]=f,e[33]=R,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:M,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Rt).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Re,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(fe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(fe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Ft,{error:t??new Error("Failed to load AI providers")})}function Qs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Qs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-DHTICC_v.js";import{i as je}from"./ChevronRight-Gacf5_E2.js";import{S as ke}from"./scroll-area-C8YtCymQ.js";import{A as _e}from"./add-section-modal-BgsTQi1S.js";import{ap as Be,aq as we,ar as Ae,j as Ne,k as Re,as as Ce,Y as Ee,at as Ke,ac as Te}from"./index-BgCyOgdF.js";import"./agent-icon-BRuLsBYY.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronDown-BLALKRGM.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./ZoomOut-CwXzA7X6.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./LinkExternal01-D4vA-I3a.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./XClose-ChRyc7zA.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./tooltip-CWNyrHYY.js";import"./file-type-icon-Bx1NX_Gy.js";import"./dialog-BdIjDk0G.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./content-blocks-o63cs2vh.js";import"./types-BHL4d6ji.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./chat-context-CIKFBD8u.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-ai-providers-CVS8EjHf.js";import"./studio-tools-D6ANxpFE.js";import"./use-decopilot-events-BB7o7ets.js";import"./use-organization-settings-D9G2tGsW.js";import"./shell-layout-QzfqSuxf.js";import"./avatar-DxH3BnSs.js";import"./alert-dialog-D87-BKea.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./sheet-B3q7nz8B.js";import"./integration-icon-m6Sa_hcd.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-connection-CRsO-Bab.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./label-CwMsBEmc.js";import"./input-DgsFOGyM.js";import"./select-DzzBmNmo.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./index-Cgz2WBho.js";import"./toolbar-C1WgDWOZ.js";import"./use-debounced-value-C2hJqHIV.js";import"./dropdown-menu-8PMbgM0q.js";import"./textarea-Dp78LmPE.js";import"./index-BwaOBBZ-.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-status-sounds-DuOBmrHo.js";import"./empty-state-y_scHUYK.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function gr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,Y=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const G=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:J,isPending:Q}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const W=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const X=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let V;e[34]!==c||e[35]!==J||e[36]!==W?(V=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await W.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),J()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=J,e[36]=W,e[37]=V):V=e[37];const y=V;let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t=>{P.current=t.append,re(!0)},e[38]=I):I=e[38];const ve=I;let U;e[39]!==y?(U=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=U):U=e[40];const le=U;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==Q?(j=o.jsx(Ke,{isPending:Q,isError:!1}),e[48]=Q,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==G||e[61]!==s||e[62]!==u||e[63]!==X||e[64]!==h||e[65]!==Y?(_=o.jsx(ke,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Te,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:X,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):Y?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=G,e[61]=s,e[62]=u,e[63]=X,e[64]=h,e[65]=Y,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{gr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as G,r as S,l as J,j as t,B as U,i as Q,t as I}from"./index-DHTICC_v.js";import{i as V}from"./XCircle-BOFvuFHl.js";import{aD as Y,X as T}from"./agent-icon-BRuLsBYY.js";import{n as Z}from"./LinkExternal01-D4vA-I3a.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-D87-BKea.js";import{I as L}from"./input-DgsFOGyM.js";import{L as M}from"./label-CwMsBEmc.js";import{au as at,av as nt,aD as mt,at as lt,aw as R,ay as pt,aE as ct}from"./index-BgCyOgdF.js";import{c as dt,B as ut,a as gt}from"./block-document-OYJ-kskh.js";import{u as xt,s as v,E as ft}from"./primitives-DFOak6EH.js";import{t as ht}from"./ChevronDown-BLALKRGM.js";import{f as yt,h as jt,e as vt}from"./scroll-area-C8YtCymQ.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronRight-Gacf5_E2.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./ZoomOut-CwXzA7X6.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./XClose-ChRyc7zA.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./library-tab-DZNwBek9.js";import"./chat-context-CIKFBD8u.js";import"./hooks-UY6BFV6z.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-ai-providers-CVS8EjHf.js";import"./studio-tools-D6ANxpFE.js";import"./use-decopilot-events-BB7o7ets.js";import"./tab-id-DPNwWMUY.js";import"./use-organization-settings-D9G2tGsW.js";import"./tooltip-CWNyrHYY.js";import"./dialog-BdIjDk0G.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./use-mobile-BkWraisf.js";import"./use-mcp-prompts-D3eulxzR.js";import"./shell-layout-QzfqSuxf.js";import"./avatar-DxH3BnSs.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./form-P-LOMg0X.js";import"./select-DzzBmNmo.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./index-Cgz2WBho.js";import"./file-type-icon-Bx1NX_Gy.js";import"./toolbar-C1WgDWOZ.js";import"./use-debounced-value-C2hJqHIV.js";import"./dropdown-menu-8PMbgM0q.js";import"./textarea-Dp78LmPE.js";import"./index-BwaOBBZ-.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./use-connection-CRsO-Bab.js";import"./extract-connection-data-BhI39RpO.js";import"./integration-icon-m6Sa_hcd.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-status-sounds-DuOBmrHo.js";import"./empty-state-y_scHUYK.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./types-BHL4d6ji.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./sheet-B3q7nz8B.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";import"./use-copy-DK8lBdjB.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=G.c(18),{icon:f,title:m,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==m?(i=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=J("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function sr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=nt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:m,data:R(m,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[n,C]=S.useState(null),[N,E]=S.useState(!1),$=a?mt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,H=o=>s("slug",o),W=async(o,w)=>{const q=v(r.name);E(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:m,data:R(m,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},X=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){H(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:X,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(V,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),n&&W(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{sr as CategoryEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Z,r as u,j as r,i as ie,B as he,dX as Mt,a3 as Dt,a9 as se,dY as Rt,dZ as Pt,d_ as Et,d$ as kt,bK as Tt,e0 as Ot,e1 as qe,a5 as At,e2 as Lt,e3 as Ft,e4 as It,e5 as $t,e6 as _t,e7 as zt,e8 as Wt,e9 as Gt,ea as Kt,l as ae,m as Bt,t as W,K as $e}from"./index-DHTICC_v.js";import{F as Vt,l as Ut}from"./index-BwaOBBZ-.js";import{i as qt,az as Xt,aA as Qt,aB as ue,aC as Ht,X as _e}from"./agent-icon-BRuLsBYY.js";import{a as Jt}from"./Tool01-DrE6CqtR.js";import{s as Yt}from"./XClose-ChRyc7zA.js";import{S as Zt}from"./scroll-area-C8YtCymQ.js";import{T as ze,a as We,b as Ge}from"./tooltip-CWNyrHYY.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-D87-BKea.js";import{u as cn}from"./chat-context-CIKFBD8u.js";import{b as dn}from"./shell-layout-QzfqSuxf.js";import{am as fe,an as Ke,ao as un}from"./index-BgCyOgdF.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-BdIjDk0G.js";import{I as Be}from"./input-DgsFOGyM.js";import{t as vn}from"./ChevronDown-BLALKRGM.js";import{i as yn}from"./ChevronRight-Gacf5_E2.js";import{a as Cn}from"./ZoomOut-CwXzA7X6.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-Cgz2WBho.js";import"./AlertCircle-D8gnDqwf.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./LinkExternal01-D4vA-I3a.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./file-type-icon-Bx1NX_Gy.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./content-blocks-o63cs2vh.js";import"./types-BHL4d6ji.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D6ANxpFE.js";import"./sheet-B3q7nz8B.js";import"./integration-icon-m6Sa_hcd.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-connection-CRsO-Bab.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./label-CwMsBEmc.js";import"./select-DzzBmNmo.js";import"./use-ai-providers-CVS8EjHf.js";import"./use-decopilot-events-BB7o7ets.js";import"./use-organization-settings-D9G2tGsW.js";import"./avatar-DxH3BnSs.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./dropdown-menu-8PMbgM0q.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./textarea-Dp78LmPE.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-status-sounds-DuOBmrHo.js";import"./empty-state-y_scHUYK.js";import"./toolbar-C1WgDWOZ.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./use-debounced-value-C2hJqHIV.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(i){const e=Z.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(s),C=Pn[a];s!==B&&(U(s),s&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const Q=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const X=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(ie,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==X||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:X,children:[G,j,b]})}),e[42]=X,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==Q||e[48]!==s||e[49]!==S?(z=r.jsx(gn,{open:s,onOpenChange:Q,children:S}),e[47]=Q,e[48]=s,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Xe]=kn(Me),Qe=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};Qe.displayName=Me;var He="ContextMenuTrigger",Je=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=Xe(He,s),x=F(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:se(i.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?i.onPointerDown:se(i.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?i.onPointerMove:se(i.onPointerMove,xe(d)),onPointerCancel:a?i.onPointerCancel:se(i.onPointerCancel,xe(d)),onPointerUp:a?i.onPointerUp:se(i.onPointerUp,xe(d))})]})});Je.displayName=He;var On="ContextMenuPortal",Ye=i=>{const{__scopeContextMenu:e,...s}=i,a=F(e);return r.jsx(Et,{...a,...s})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=Xe(Ze,s),m=F(s),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Xn="ContextMenuArrow",Qn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Wt,{...c,...a,ref:e})});Qn.displayName=Xn;var Hn="ContextMenuSubTrigger",Jn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Hn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Kt,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var er=Qe,tr=Je,nr=Ye,rr=et,or=tt,sr=nt;function ir(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(er,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function ar(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function lr(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(i){const e=Z.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(sr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(i){const e=Z.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=i,I=x===void 0?!1:x,Q=s.kind==="directory",{Icon:q,color:X}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==X||e[9]!==Q||e[10]!==c||e[11]!==I?(R=Q?r.jsxs(r.Fragment,{children:[I?r.jsx(ie,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:X}})]}),e[7]=q,e[8]=X,e[9]=Q,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==s.name?(P=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(ir,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function ur(i){const e=V(i);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(i){const e=i.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Ht,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function Qs({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,Q]=u.useState(""),[q,X]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,H]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(i,e,s)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${i}/${e}/${s}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function st(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function it(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),H(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),H(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){H(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),H(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),it(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),X(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{X(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(i,e,s,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(i,e,s,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(i,e,s)});try{const l=await un(i,e,s);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?st(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>Q(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Xt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&H(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{Qs as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as w,j as s,C as We,r as O,l as F,v as ae,D as Dt,F as Cs,a as be,G as de,b as he,H as ws,I as ks,t as ge,J as Is,M as zs,m as $s,B as Te,y as As,P as Ts,K as Ot,k as Mt,i as Pt,e as ot,u as it,E as Et,o as Ds,s as Os,n as Ms,p as Ps,d as Es,x as Fs,R as Ft,O as Rs}from"./index-DHTICC_v.js";import{u as Ce,S as at,a as ct,b as _e,c as ue,d as se,e as Rt,f as Lt,g as Ls,h as Bs,i as tt,j as Hs,k as Us,l as Gs}from"./sidebar-D2BmctMK.js";import{u as dt}from"./use-mobile-BkWraisf.js";import{S as fe}from"./skeleton-f0d6RrIL.js";import{i as Bt}from"./LayoutLeft-1bN-FR8E.js";import{T as xe}from"./toolbar-icon-button-DdAIuoK2.js";import{P as Pe,a as Ne,b as Ee}from"./popover-4-S-2t4S.js";import{D as Ht,a as Ut,b as Gt}from"./drawer-D1X6O6Aa.js";import{A as Me}from"./avatar-DxH3BnSs.js";import{a as je,b as ve,c as st,T as ye}from"./tooltip-CWNyrHYY.js";import{a as ht}from"./Eye-BFLaa-Ve.js";import{n as qs,i as Ws}from"./Globe01-Bx-hz-as.js";import{i as Ks}from"./ZoomOut-CwXzA7X6.js";import{i as Vs}from"./ZapSquare-D4RqdrSL.js";import{i as qt}from"./Monitor01-DrJKeSJ4.js";import{n as Xs,a as Qs}from"./Sun-CRJdfBLT.js";import{a as Ke,b as Ys}from"./Settings02-N32UBNZq.js";import{i as Js}from"./Shield01-BztOm8mA.js";import{a as Zs}from"./Users03-K1B4uaw7.js";import{a as pt,b as gt,c as Wt,A as De,d as bt,i as en,s as tn,e as sn}from"./agent-icon-BRuLsBYY.js";import"./index-Dq2Ts3Yi.js";import{n as Ve}from"./Stars02-BpRz9194.js";import{u as nn,v as rn,C as ln}from"./connect-desktop-dialog-DRNK5Zqx.js";import{i as Xe}from"./ChevronUp-DBXbYduj.js";import{s as Kt}from"./XClose-ChRyc7zA.js";import{u as on,a as an}from"./use-join-requests-CNT469hS.js";import{i as Vt}from"./ChevronRight-Gacf5_E2.js";import{u as cn,R as dn,a as mn,b as mt,r as un}from"./shell-layout-QzfqSuxf.js";import{u as Xt,g as fn}from"./agent-capabilities-C8WZk9re.js";import{i as xn}from"./FilterLines-CK4jmUMp.js";import{T as hn,a as pn}from"./toggle-group-BIoy7tOG.js";import{u as gn,S as bn,a as Ge,i as jn}from"./use-mcp-client-DAJmDOVO.js";import{u as Qt,a as Yt}from"./use-virtual-mcp-CJycW-Qv.js";import{u as vn,a as ut,b as Jt,T as yn}from"./hooks-UY6BFV6z.js";import{c as Sn,a as Nn,b as _n,d as Cn,e as wn}from"./dialog-BdIjDk0G.js";import{C as kn,a as In,b as zn,c as $n,d as An}from"./command-VE4J0WmB.js";import{u as Zt}from"./studio-tools-D6ANxpFE.js";import{i as Tn}from"./Zap-RN8PAcZE.js";import{S as es,M as Dn}from"./shell-controls-mi9y4ySh.js";import{T as ts,S as On}from"./shell-route-loading-Bpj8AlnX.js";import{t as ft}from"./ChevronDown-BLALKRGM.js";import{S as Mn}from"./task-status-BMnLETgS.js";import{S as ss,u as Pn,g as En,a as Fn,b as Rn}from"./use-navigate-to-agent-Dlhjy-0a.js";import{S as Ln,C as Bn}from"./chat-context-CIKFBD8u.js";import{B as jt,a as Hn,b as Un,c as Gn}from"./breadcrumb-DZbB5tzN.js";import{T as te}from"./toolbar-C1WgDWOZ.js";import{s as Ae}from"./Plus-Bz2JwGOE.js";import{i as ns}from"./SearchMd-Bn2Kbs9E.js";import{A as qn,a as Wn,b as Kn,c as Vn,d as Xn,e as Qn,f as Yn}from"./alert-dialog-D87-BKea.js";import{F as Jn,a as Zn,b as er,c as tr,d as sr,f as nr,e as rr}from"./form-P-LOMg0X.js";import{I as lr}from"./input-DgsFOGyM.js";import{s as or}from"./Star01-GFElhP7X.js";import{u as ir}from"./use-create-virtual-mcp-C50juX43.js";import{I as ar,u as cr,W as dr}from"./import-from-deco-dialog-CopvXqdM.js";import{G as mr,a as ur}from"./github-repo-picker-CmustdLW.js";import"./sheet-B3q7nz8B.js";import"./X-BQZZQdg0.js";import"./User01-9o9EbE3X.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./CheckCircle-DCCFCHyS.js";import"./DotsVertical-D7ryssxp.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LinkExternal01-D4vA-I3a.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./SearchLg-CfwbHNr5.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./Users01-CMbqiB_R.js";import"./use-capability-BmznXR_9.js";import"./required-auth-layout-B0YEEBld.js";import"./tab-id-DPNwWMUY.js";import"./use-organization-settings-D9G2tGsW.js";import"./use-org-sso-CEETlaem.js";import"./use-ai-providers-CVS8EjHf.js";import"./auth-pLLkIszG.js";import"./use-collections-BnOL5hT8.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-BbFfuuHN.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-BB7o7ets.js";import"./label-CwMsBEmc.js";import"./use-connection-CRsO-Bab.js";import"./github-installations-DzN1UQ4x.js";import"./collection-search-B0gYtEWh.js";import"./checkbox-CFdij7Ei.js";import"./use-debounced-value-C2hJqHIV.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./extract-connection-data-BhI39RpO.js";function fr(t){const e=w.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:l,isMobile:o}=Ce();if(o||l==="collapsed")return null;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:i,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const xt=240,xr=400,hr="sidebar.width";function Oe(t){return Math.max(xt,Math.min(xr,t))}function pr(){const t=w.c(11),[e,n]=We(hr,gr),r=O.useRef(null);let l;t[0]!==n||t[1]!==e?(l=m=>{m.preventDefault();const u=m.clientX,f=Oe(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=Oe(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Oe(f+(b.clientX-u));n(j);for(const v of p)v.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=l):l=t[2];const o=l;let i;t[3]!==n?(i=()=>{n(xt)},t[3]=n,t[4]=i):i=t[4];const a=i;let c;t[5]!==e?(c=Oe(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==o||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function gr(t){return typeof t=="number"?Oe(t):xt}function rs(){return[]}function ls(t){const e=w.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let l;return e[1]!==n?(l=s.jsxs(at,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(ct,{children:s.jsx(_e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=l):l=e[2],l}function os(t){const e=w.c(18),{item:n}=t,{isMobile:r,setOpenMobile:l}=Ce();let o;e[0]!==r||e[1]!==n||e[2]!==l?(o=()=>{ae("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&l(!1)},e[0]=r,e[1]=n,e[2]=l,e[3]=o):o=e[3];const i=o,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=F(c),e[4]=c,e[5]=d):d=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==i||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=i,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==u?(f=s.jsx(se,{className:d,children:u},a),e[14]=n.key,e[15]=d,e[16]=u,e[17]=f):f=e[17],f}function br(t){const e=w.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Rt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,l=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map(vr),e[2]=n.group.items,e[3]=o):o=e[3];let i;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(i=s.jsx(ls,{label:r,defaultExpanded:l,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=i):i=e[7],i}case"items":{let r;e[8]!==n.items?(r=n.items.map(jr),e[8]=n.items,e[9]=r):r=e[9];let l;return e[10]!==r?(l=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=l):l=e[11],l}case"custom":return n.content}}function jr(t){return s.jsx(os,{item:t},t.key)}function vr(t){return s.jsx(os,{item:t},t.key)}function yr(t){const e=w.c(14),{sections:n,footer:r,additionalContent:l,variant:o,contentClassName:i}=t,a=o===void 0?"sidebar":o;let c;e[0]!==i?(c=F("flex flex-col flex-1 px-2 py-2 gap-0.5",i),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Sr),e[2]=n,e[3]=d):d=e[3];let m;e[4]!==l?(m=l&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:l}),e[4]=l,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==d||e[8]!==m?(u=s.jsxs(Lt,{className:c,children:[d,m]}),e[6]=c,e[7]=d,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==r||e[11]!==u||e[12]!==a?(f=s.jsxs(Ls,{variant:a,children:[u,r]}),e[10]=r,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Sr(t,e){return s.jsx(br,{section:t},e)}function is(t){const e=w.c(2);let n;return e[0]!==t?(n=s.jsx(yr,{...t}),e[0]=t,e[1]=n):n=e[1],n}is.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(fe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Nr(t){const e=w.c(16),{onToggle:n,className:r}=t,o=Dt().logo??Cs,i=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let c;e[0]!==r?(c=F("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==i?(d=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=i,e[3]=d):d=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,m]})}),e[6]=d,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Bt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(xe,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;return e[12]!==c||e[13]!==u||e[14]!==h?(p=s.jsxs(Bs,{className:c,children:[u,h]}),e[12]=c,e[13]=u,e[14]=h,e[15]=p):p=e[15],p}function vt(t){const e=w.c(18),{item:n,onClose:r}=t,l=n.isActive&&"z-10";let o;e[0]!==l?(o=F(l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n||e[3]!==r?(i=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=i):i=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==i||e[12]!==a||e[13]!==c?(d=s.jsxs(ue,{onClick:i,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=i,e[12]=a,e[13]=c,e[14]=d):d=e[14];let m;return e[15]!==o||e[16]!==d?(m=s.jsx(se,{className:o,children:d}),e[15]=o,e[16]=d,e[17]=m):m=e[17],m}function _r(t){const e=w.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,o=n.group.defaultExpanded;let i;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(vt,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],i=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=i}else i=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==i?(a=s.jsx(ls,{label:l,defaultExpanded:o,children:i}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=i,e[10]=a):a=e[10],a}case"items":{let l;if(e[11]!==r||e[12]!==n.items){let i;e[14]!==r?(i=a=>s.jsx(vt,{item:a,onClose:r},a.key),e[14]=r,e[15]=i):i=e[15],l=n.items.map(i),e[11]=r,e[12]=n.items,e[13]=l}else l=e[13];let o;return e[16]!==l?(o=s.jsx(at,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ct,{children:s.jsx(_e,{className:"gap-1.5",children:l})})}),e[16]=l,e[17]=o):o=e[17],o}case"custom":return n.content}}function Cr(t){const e=w.c(17),{sections:n,onClose:r,footer:l,additionalContent:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=i):i=e[0];let a;e[1]!==r?(a=s.jsx(O.Suspense,{fallback:i,children:s.jsx(Nr,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(_r,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==o?(d=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==c||e[11]!==d?(m=s.jsxs(Lt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=m):m=e[12];let u;return e[13]!==l||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,l]}),e[13]=l,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=w.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[m,u]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let l;e[11]!==n||e[12]!==r?(l=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=l):l=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let i;e[16]!==n.label?(i=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=i):i=e[17];let a;return e[18]!==l||e[19]!==o||e[20]!==i?(a=s.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[o,i]}),e[18]=l,e[19]=o,e[20]=i,e[21]=a):a=e[21],a}function yt(t){const e=w.c(126),{user:n,userImage:r,menuItems:l,signOutItem:o,themeOptions:i,preferences:a,setPreferences:c,close:d,isMobile:m}=t;if(m){const L=n?.name??"U";let H;e[0]!==L||e[1]!==r?(H=s.jsx(Me,{url:r,fallback:L,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=L,e[1]=r,e[2]=H):H=e[2];const Z=n?.name??"User";let K;e[3]!==Z?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=K):K=e[4];const ee=n?.email;let G;e[5]!==ee?(G=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee}),e[5]=ee,e[6]=G):G=e[6];let le;e[7]!==K||e[8]!==G?(le=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,G]}),e[7]=K,e[8]=G,e[9]=le):le=e[9];let ce;e[10]!==n?(ce=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(zr)},e[10]=n,e[11]=ce):ce=e[11];let V;e[12]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(ht,{size:14}),e[12]=V):V=e[12];let J;e[13]!==ce?(J=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ce,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:V})}),e[13]=ce,e[14]=J):J=e[14];let me;e[15]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=me):me=e[15];let I;e[16]!==J?(I=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[J,me]})}),e[16]=J,e[17]=I):I=e[17];let D;e[18]!==I||e[19]!==H||e[20]!==le?(D=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[H,le,I]}),e[18]=I,e[19]=H,e[20]=le,e[21]=D):D=e[21];let B;if(e[22]!==d||e[23]!==l){let pe;e[25]!==d?(pe=Le=>s.jsx(Be,{item:Le,onClose:d},Le.key),e[25]=d,e[26]=pe):pe=e[26],B=l.map(pe),e[22]=d,e[23]=l,e[24]=B}else B=e[24];let P;e[27]!==d||e[28]!==o?(P=s.jsx(Be,{item:o,onClose:d}),e[27]=d,e[28]=o,e[29]=P):P=e[29];let X;e[30]!==B||e[31]!==P?(X=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[B,P]})}),e[30]=B,e[31]=P,e[32]=X):X=e[32];let oe;if(e[33]!==a.theme||e[34]!==c||e[35]!==i){let pe;e[37]!==a.theme||e[38]!==c?(pe=Le=>{const{value:Je,icon:Ss,label:Ns}=Le;return s.jsx("button",{type:"button","aria-label":Ns,onClick:()=>c(_s=>({..._s,theme:Je})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Je?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ss},Je)},e[37]=a.theme,e[38]=c,e[39]=pe):pe=e[39],oe=i.map(pe),e[33]=a.theme,e[34]=c,e[35]=i,e[36]=oe}else oe=e[36];let ie;e[40]!==oe?(ie=s.jsx("div",{className:"flex items-center gap-0.5",children:oe}),e[40]=oe,e[41]=ie):ie=e[41];const Se=a.enableSounds?"Disable sounds":"Enable sounds";let U;e[42]!==c?(U=()=>c(Ir),e[42]=c,e[43]=U):U=e[43];const Ye=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Ye?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Ye),e[44]=Ye,e[45]=we):we=e[45];let ke;e[46]!==a.enableSounds?(ke=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[46]=a.enableSounds,e[47]=ke):ke=e[47];let Ie;e[48]!==Se||e[49]!==U||e[50]!==we||e[51]!==ke?(Ie=s.jsx("button",{type:"button","aria-label":Se,onClick:U,className:we,children:ke}),e[48]=Se,e[49]=U,e[50]=we,e[51]=ke,e[52]=Ie):Ie=e[52];let Fe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.0"]}),e[53]=Fe):Fe=e[53];let ze;e[54]!==Ie?(ze=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Fe]}),e[54]=Ie,e[55]=ze):ze=e[55];let $e;e[56]!==ie||e[57]!==ze?($e=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ie,ze]}),e[56]=ie,e[57]=ze,e[58]=$e):$e=e[58];let Re;return e[59]!==D||e[60]!==X||e[61]!==$e?(Re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,X,$e]}),e[59]=D,e[60]=X,e[61]=$e,e[62]=Re):Re=e[62],Re}const u=n?.name??"U";let f;e[63]!==u||e[64]!==r?(f=s.jsx(Me,{url:r,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=r,e[65]=f):f=e[65];const h=n?.name??"User";let p;e[66]!==h?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=p):p=e[67];const x=n?.email;let g;e[68]!==x?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x}),e[68]=x,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(kr)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ht,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let _;e[78]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=_):_=e[78];let k;e[79]!==y?(k=s.jsx(st,{delayDuration:300,children:s.jsxs(ye,{children:[y,_]})}),e[79]=y,e[80]=k):k=e[80];let N;e[81]!==k||e[82]!==f||e[83]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=N):N=e[84];let C;if(e[85]!==d||e[86]!==l){let L;e[88]!==d?(L=H=>s.jsx(Be,{item:H,onClose:d},H.key),e[88]=d,e[89]=L):L=e[89],C=l.map(L),e[85]=d,e[86]=l,e[87]=C}else C=e[87];let S;e[90]!==d||e[91]!==o?(S=s.jsx(Be,{item:o,onClose:d}),e[90]=d,e[91]=o,e[92]=S):S=e[92];let z;e[93]!==C||e[94]!==S?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[C,S]}),e[93]=C,e[94]=S,e[95]=z):z=e[95];let T;if(e[96]!==a.theme||e[97]!==c||e[98]!==i){let L;e[100]!==a.theme||e[101]!==c?(L=H=>{const{value:Z,icon:K,label:ee}=H;return s.jsx("button",{type:"button","aria-label":ee,onClick:()=>c(G=>({...G,theme:Z})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Z)},e[100]=a.theme,e[101]=c,e[102]=L):L=e[102],T=i.map(L),e[96]=a.theme,e[97]=c,e[98]=i,e[99]=T}else T=e[99];let A;e[103]!==T?(A=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[103]=T,e[104]=A):A=e[104];const $=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[105]!==c?(E=()=>c(wr),e[105]=c,e[106]=E):E=e[106];const W=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let M;e[107]!==W?(M=F("size-7 rounded-md flex items-center justify-center transition-colors",W),e[107]=W,e[108]=M):M=e[108];let q;e[109]!==a.enableSounds?(q=a.enableSounds?s.jsx(pt,{size:14}):s.jsx(gt,{size:14}),e[109]=a.enableSounds,e[110]=q):q=e[110];let R;e[111]!==$||e[112]!==E||e[113]!==M||e[114]!==q?(R=s.jsx("button",{type:"button","aria-label":$,onClick:E,className:M,children:q}),e[111]=$,e[112]=E,e[113]=M,e[114]=q,e[115]=R):R=e[115];let Q;e[116]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.17.0"]}),e[116]=Q):Q=e[116];let Y;e[117]!==R?(Y=s.jsxs("div",{className:"flex items-center gap-2",children:[R,Q]}),e[117]=R,e[118]=Y):Y=e[118];let ne;e[119]!==A||e[120]!==Y?(ne=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[A,Y]}),e[119]=A,e[120]=Y,e[121]=ne):ne=e[121];let re;return e[122]!==N||e[123]!==z||e[124]!==ne?(re=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,z,ne]})}),e[122]=N,e[123]=z,e[124]=ne,e[125]=re):re=e[125],re}function wr(t){return{...t,enableSounds:!t.enableSounds}}function kr(){ge.success("User ID copied")}function Ir(t){return{...t,enableSounds:!t.enableSounds}}function zr(){ge.success("User ID copied")}function nt(){const t=w.c(34),{data:e}=be.useSession(),{org:n}=de(),r=he();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org",shouldThrow:!1},t[0]=l):l=t[0];const i=ws(l)?.params.org,[a,c]=ks(),d=dt(),[m,u]=O.useState(!1),f=e?.user,h=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const x=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ke,{size:16}),t[2]=g):g=t[2];let b;t[3]!==r||t[4]!==i?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{r({to:"/$org/settings/profile",params:{org:i??""}})}},t[3]=r,t[4]=i,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==r?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(qs,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=r,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(Ks,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(Js,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Is,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Ws,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let C;t[14]!==b||t[15]!==j?(C=[b,...j,v,y,_,k,N],t[14]=b,t[15]=j,t[16]=C):C=t[16];const S=C;let z;t[17]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Vs,{size:16}),onClick:Ar},t[17]=z):z=t[17];const T=z;let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=A):A=t[18];let $;t[19]===Symbol.for("react.memo_cache_sentinel")?($={value:"dark",icon:s.jsx(Qs,{size:14}),label:"Dark theme"},t[19]=$):$=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=[A,$,{value:"system",icon:s.jsx(qt,{size:14}),label:"System theme"}],t[20]=E):E=t[20];const W=E;let M;t[21]!==d||t[22]!==S||t[23]!==a||t[24]!==c||t[25]!==f||t[26]!==h?(M={user:f,userImage:h,menuItems:S,signOutItem:T,themeOptions:W,preferences:a,setPreferences:c,close:x,isMobile:d},t[21]=d,t[22]=S,t[23]=a,t[24]=c,t[25]=f,t[26]=h,t[27]=M):M=t[27];const q=M;let R;return t[28]!==d||t[29]!==m||t[30]!==q||t[31]!==f?.name||t[32]!==h?(R=s.jsx(s.Fragment,{children:d?s.jsxs(Ht,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Ut,{className:"h-[80dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Account"}),s.jsx(yt,{...q})]})]}):s.jsxs(Pe,{open:m,onOpenChange:u,children:[s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Me,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ee,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:$r,children:s.jsx(yt,{...q})})]})}),t[28]=d,t[29]=m,t[30]=q,t[31]=f?.name,t[32]=h,t[33]=R):R=t[33],R}function $r(t){return t.preventDefault()}function Ar(){ae("signed_out",{source:"account_popover"}),zs(),be.signOut()}function rt(){const t=w.c(22),e=nn(),[n,r]=O.useState(!1);let l;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=rn(e.capabilities);l=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=l}else l=t[4];const o=l;let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=()=>r(!0),t[5]=i):i=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qt,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let m;t[9]!==a||t[10]!==d?(m=s.jsx(je,{asChild:!0,children:s.jsxs(xe,{onClick:i,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(ve,{side:"bottom",children:o}),t[12]=o,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(ln,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function Tr({invitation:t}){const[e,n]=O.useState(!1),[r,l]=O.useState(!1),o=$s(),i=async()=>{n(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){ge.error(d.error.message),n(!1);return}}catch{ge.error("Failed to accept invitation"),n(!1);return}ge.success("Invitation accepted!"),As();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{l(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});c.error?(ge.error(c.error.message),l(!1)):(ge.success("Invitation declined"),o.invalidateQueries())}catch{ge.error("Failed to decline invitation"),l(!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(Te,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:i,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Xe,{size:14})}),s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Kt,{size:14})})]})]})}function Dr(t){const e=w.c(29),{request:n}=t,{approve:r,deny:l}=on(),o=r.isPending||l.isPending,i=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==i?(c=i.charAt(0).toUpperCase(),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(Me,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==i?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:i})]}),e[6]=i,e[7]=u):u=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{size:14}),e[11]=h):h=e[11];let p;e[12]!==o||e[13]!==f?(p=s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:o,"aria-label":"Approve join request",children:h}),e[12]=o,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==l||e[16]!==n.id?(x=()=>l.mutate(n.id),e[15]=l,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Kt,{size:14}),e[18]=g):g=e[18];let b;e[19]!==o||e[20]!==x?(b=s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:o,"aria-label":"Deny join request",children:g}),e[19]=o,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let v;return e[25]!==j||e[26]!==d||e[27]!==u?(v=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:[d,u,j]}),e[25]=j,e[26]=d,e[27]=u,e[28]=v):v=e[28],v}function Or(t){const e=w.c(14),{release:n,isSeen:r,onSelect:l}=t;let o;e[0]!==r?(o=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=o):o=e[1];let i;e[2]!==n.eyebrow?(i=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==i||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[i,a]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Vt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let m;return e[10]!==l||e[11]!==o||e[12]!==c?(m=s.jsxs("button",{type:"button",onClick:l,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[o,c,d]}),e[10]=l,e[11]=o,e[12]=c,e[13]=m):m=e[13],m}function Mr(){const t=O.useContext(Ts),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function as(){const t=w.c(11),{isSeen:e,markSeen:n,unseenCount:r}=cn(),l=Mr(),o=an();let i;if(t[0]!==e||t[1]!==l||t[2]!==o){const d=[...o].sort(Lr).map(Rr),m=[...l].sort(Fr).map(Er);let u;t[4]!==e?(u=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...dn].sort(Pr).map(u);i=[...d,...m,...f],t[0]=e,t[1]=l,t[2]=o,t[3]=i}else i=t[3];const a=r+l.length+o.length;let c;return t[6]!==n||t[7]!==l||t[8]!==i||t[9]!==a?(c={items:i,pendingInvitations:l,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=l,t[8]=i,t[9]=a,t[10]=c):c=t[10],c}function Pr(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Er(t){return{type:"invitation",invitation:t}}function Fr(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Rr(t){return{type:"join-request",request:t}}function Lr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class cs extends O.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function ds(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Br(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];let i;t[2]!==l?(i=F(l!=null&&ds(l)),t[2]=l,t[3]=i):i=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Wt,{}),t[7]=c):c=t[7];let d;t[8]!==l?(d=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,t[9]=d):d=t[9];let m;t[10]!==d?(m=s.jsx("span",{children:d}),t[10]=d,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==i||t[14]!==a||t[15]!==m?(u=s.jsx(_e,{children:s.jsx(se,{children:s.jsxs(ue,{tooltip:o,className:i,onClick:a,children:[c,m]})})}),t[12]=o,t[13]=i,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function Hr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Br,{})})}),t[0]=e):e=t[0],e}function Ur(){const t=w.c(17),e=he(),{org:n}=de(),{hasDecoKey:r,balanceDollars:l}=Xt();if(!r)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];const i=o;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==l?(c=F(l!=null&&ds(l)),t[5]=l,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Wt,{className:"size-4"}),t[7]=d):d=t[7];let m;t[8]!==a||t[9]!==c||t[10]!==i?(m=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":i,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=i,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(ve,{side:"top",children:i}),t[12]=i,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(ye,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function Gr(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(cs,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Ur,{})})}),t[0]=e):e=t[0],e}function ms(t){const e=w.c(15),{children:n}=t,{items:r,markReleaseSeen:l}=as(),[o,i]=O.useState(null);let a;if(e[0]!==r||e[1]!==o){let x;e[3]!==o?(x=g=>g.type==="release"&&g.release.id===o,e[3]=o,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=o,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let m;e[5]!==l?(m=x=>{i(x),l(x)},e[5]=l,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||i(null)},e[7]=f):f=e[7];let h;e[8]!==u||e[9]!==r||e[10]!==d?(h=s.jsx(Ee,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(Te,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>i(null),children:s.jsx(Ys,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(mn,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Ve,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(Dr,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(Tr,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Or,{release:x.release,isSeen:x.isSeen,onSelect:()=>u(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=u,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Pe,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function us(){const{redDotCount:t}=as();return t>0}function qr(){const t=w.c(6),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{children:"Inbox"}),t[3]=l):l=t[3];let o;return t[4]!==r?(o=s.jsx(ms,{children:s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:"Inbox",className:"relative",children:[n,r,l]})})}),t[4]=r,t[5]=o):o=t[5],o}function Wr(){const t=w.c(8),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let l;t[3]!==r?(l=s.jsx(Ne,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=l):l=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ve,{side:"top",children:"Inbox"}),t[5]=o):o=t[5];let i;return t[6]!==l?(i=s.jsx(ms,{children:s.jsxs(ye,{delayDuration:300,children:[l,o]})}),t[6]=l,t[7]=i):i=t[7],i}function Kr(){const t=w.c(7),e=he(),{org:n}=de();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let l,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{}),o=s.jsx("span",{children:"Settings"}),t[3]=l,t[4]=o):(l=t[3],o=t[4]);let i;return t[5]!==r?(i=s.jsxs(ue,{tooltip:"Settings",onClick:r,children:[l,o]}),t[5]=r,t[6]=i):i=t[6],i}function Vr(){const t=w.c(9),e=he(),{org:n}=de();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{className:"size-4"}),t[3]=l):l=t[3];let o;t[4]!==r?(o=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":"Settings",onClick:r,children:l})}),t[4]=r,t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ve,{side:"top",children:"Settings"}),t[6]=i):i=t[6];let a;return t[7]!==o?(a=s.jsxs(ye,{delayDuration:300,children:[o,i]}),t[7]=o,t[8]=a):a=t[8],a}function Xr(){const t=w.c(6),{state:e}=Ce();if(e==="collapsed"){let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Hr,{}),t[0]=l):l=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(se,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(rt,{})})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(se,{children:s.jsx(qr,{})}),t[2]=i):i=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(se,{children:s.jsx(Kr,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(tt,{className:"px-2 pb-3 gap-1",children:[l,s.jsxs(_e,{children:[o,i,a,s.jsx(se,{children:s.jsx(nt,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(tt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),s.jsx(Vr,{}),s.jsx(Wr,{}),s.jsx(rt,{}),s.jsx(Gr,{})]})}),t[5]=r):r=t[5],r}function Qr(){const t=w.c(8),e=he(),{org:n}=de(),{setOpenMobile:r}=Ce();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(_e,{children:s.jsx(se,{children:s.jsx(nt,{})})})}),t[0]=l):l=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==r?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ke,{className:"size-4"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(tt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[l,s.jsx(xe,{"aria-label":"Settings",onClick:o,children:i})]})}),t[6]=o,t[7]=a):a=t[7],a}function St(t){const e=w.c(15),{className:n,wrapperClassName:r,children:l}=t,[o,i]=O.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&i(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const c=a;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=b=>{const j=b.currentTarget;i(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=d):d=e[1];const m=d;let u;e[2]!==r?(u=F("relative",r),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==l||e[5]!==n?(f=s.jsx("div",{ref:c,onScroll:m,className:n,children:l}),e[4]=l,e[5]=n,e[6]=f):f=e[6];const h=o?"opacity-100":"opacity-0";let p;e[7]!==h?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=p):p=e[8];let x;e[9]!==p?(x=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=x):x=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==x?(g=s.jsxs("div",{className:u,children:[f,x]}),e[11]=u,e[12]=f,e[13]=x,e[14]=g):g=e[14],g}function Yr(t){const e=w.c(8),{virtualMcpId:n,size:r,showAutomationBadge:l}=t,o=r===void 0?"sm":r;let i;e[0]!==o||e[1]!==n?(i=n?s.jsx(Jr,{virtualMcpId:n,size:o}):s.jsx(De,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==l?(a=l&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Tn,{size:10,className:"text-white"})}),e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Jr(t){const e=w.c(6),{virtualMcpId:n,size:r}=t,l=Qt(n);if(!l){let a;return e[0]!==r?(a=s.jsx(De,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const o=l.icon??null;let i;return e[2]!==l.title||e[3]!==r||e[4]!==o?(i=s.jsx(De,{icon:o,name:l.title,size:r}),e[2]=l.title,e[3]=r,e[4]=o,e[5]=i):i=e[5],i}function Nt(t){const e=w.c(36),{open:n,onOpenChange:r}=t,[l,o]=O.useState(""),{org:i}=de(),{setTaskId:a}=mt(),c=Zt();let d,m,u;e[0]!==i.id||e[1]!==l?(u=l.trim(),m=Mt,d=Ot.globalSearch(i.id,u),e[0]=i.id,e[1]=l,e[2]=d,e[3]=m,e[4]=u):(d=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==c||e[6]!==u?(h=async()=>await c.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=c,e[6]=u,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=m(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==r?(v=$=>{$||o(""),r($)},e[14]=r,e[15]=v):v=e[15];const y=v;let _;e[16]!==y||e[17]!==a?(_=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=_):_=e[18];const k=_;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Sn,{className:"sr-only",children:[s.jsx(Nn,{children:"Search"}),s.jsx(_n,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let C;e[20]!==l?(C=s.jsx(zn,{value:l,onValueChange:o,placeholder:"Search..."}),e[20]=l,e[21]=C):C=e[21];let S;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(S=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(kn,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(In,{value:`thread:${$.id}:${$.title}`,onSelect:()=>k($),className:"gap-2.5",children:[s.jsx(Yr,{virtualMcpId:$.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:$.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=S):S=e[26];let z;e[27]!==S?(z=s.jsx($n,{children:S}),e[27]=S,e[28]=z):z=e[28];let T;e[29]!==C||e[30]!==z?(T=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(An,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[C,z]})]}),e[29]=C,e[30]=z,e[31]=T):T=e[31];let A;return e[32]!==y||e[33]!==n||e[34]!==T?(A=s.jsx(wn,{open:n,onOpenChange:y,children:T}),e[32]=y,e[33]=n,e[34]=T,e[35]=A):A=e[35],A}const _t=["requires_action","in_progress","failed","expired","completed"];function Zr(t){const e=new Map(_t.map(n=>[n,[]]));for(const n of t){const r=n.status??"completed";(e.get(r)??e.get("completed")).push(n)}return _t.map(n=>({status:n,threads:e.get(n)}))}const el="sidebar.group.expanded.";function tl(t,e){const n=w.c(3),[r,l]=We(`${el}${t}`,e);let o;return n[0]!==r||n[1]!==l?(o=[r,l],n[0]=r,n[1]=l,n[2]=o):o=n[2],o}function fs(t){const e=w.c(12),{onClick:n,isFetching:r,indented:l}=t,o=l?"-ml-4 pl-6 pr-2":"px-2";let i;e[0]!==o?(i=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==r?(a=r&&s.jsx(Pt,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let m;return e[6]!==r||e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==d?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:i,children:[a,d]}),e[6]=r,e[7]=n,e[8]=i,e[9]=a,e[10]=d,e[11]=m):m=e[11],m}function sl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function nl(t){return t.member==="mine"&&!t.currentUserId}const xs=4;let Ue=0;const lt=[];function rl(){for(;Ue<xs&<.length>0;){const t=lt.shift();t&&t()}}function hs(t){return new Promise((e,n)=>{const r=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,rl()})};Ue<xs?r():lt.push(r)})}const Qe=10;function Ct(t,e,n,r,l){const o={hidden:!1};r.member==="mine"&&r.currentUserId&&(o.created_by=r.currentUserId),r.type==="automation"&&(o.has_trigger=!0),r.type==="manual"&&(o.has_trigger=!1);const i={where:o,limit:l,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return i.status=e,i}function ll(t,e,n,r){let l=0;for(const o of t)ps(o,e,n,r)&&l++;return l}function Ze(t,e,n,r){return ll(t,e,n,r)}function ol(t,e){return!!(t>=Qe||t===0&&e)}function wt(t,e){return t<e}function il(t,e){return e===!1?!1:e===!0?!0:t}function ps(t,e,n,r){return!(t.hidden||(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const qe=new Map,He=new Map;function al(t,e){return e?t>=Qe?!0:null:!1}function kt(t){return qe.get(t)}function cl(t,e){qe.set(t,e)}function dl(t,e,n){const r=qe.get(t);if(r!==void 0){n(r);return}let l=He.get(t);l||(l=hs(e).then(o=>(qe.set(t,o),He.delete(t),o)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,l)),l.then(n,()=>n(!1))}function It(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ml(t,e,n,r,l){let o=0;for(const i of t)e.has(i.id)||ps(i,n,r,l)&&o++;return o}function ul(t,e,n,r){const l=w.c(8),{org:o}=de(),i=sl(o.id,t,e,n);let a;l[0]!==n?(a=nl(n),l[0]=n,l[1]=a):a=l[1];const c=a,[d,m]=O.useState({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==i&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});const u=vn(),{threads:f,hasMore:h}=ut(),p=Ze(f,t,e,n),x=ol(p,h),g=al(p,h),b=Zt();if(d.identity===i&&d.serverHasMore===null){const N=g??kt(i);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:N})}!c&&d.identity===i&&d.serverHasMore===null&&g===null&&kt(i)===void 0&&d.probeSubscribedIdentity!==i&&(m(N=>N.identity===i?{...N,isProbing:!0,probeSubscribedIdentity:i}:N),dl(i,async()=>{const N=Ct(t,e,0,n,1),C=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:S}=It(C),z=Ze(u.threads.get(),t,e,n);return S===void 0?!1:wt(z,S)},N=>{m(C=>C.identity!==i?C:{...C,isProbing:!1,serverHasMore:N})}));const v=async function(){if(d.isFetching||d.isProbing||c)return;const C=i;m(S=>S.identity===C?{...S,isFetching:!0}:S);try{const S=Ze(f,t,e,n),z=Ct(t,e,S,n,Qe),T=await hs(()=>b.call("COLLECTION_THREADS_LIST",z)),{items:A,hasMore:$,totalCount:E}=It(T),W=new Set(f.map(fl)),M=ml(A,W,t,e,n),q=S;u.mergeThreads(A),m(R=>{if(R.identity!==C)return R;let Q;return E!==void 0?Q=wt(q+M,E):Q=A.length===0||M===0?!1:$,cl(C,Q),{...R,isFetching:!1,serverHasMore:Q}})}catch(S){const z=S,T=z instanceof Error?z.message:String(z);ge.error(`Could not load more tasks: ${T}`),m(A=>A.identity===C?{...A,isFetching:!1}:A)}},y=d.isFetching||d.isProbing,_=!c&&!y&&il(x,d.serverHasMore);let k;return l[2]!==y||l[3]!==v||l[4]!==_||l[5]!==d.isProbing||l[6]!==d.serverHasMore?(k={hasMore:_,isFetching:y,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:v},l[2]=y,l[3]=v,l[4]=_,l[5]=d.isProbing,l[6]=d.serverHasMore,l[7]=k):k=l[7],k}function fl(t){return t.id}function xl(t){const e=w.c(18),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,{isFetching:c,isProbing:d,loadMore:m,hasMore:u,serverHasMore:f}=ul("status",n,a),[h,p]=O.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{m()}));let x;if(e[0]!==l||e[1]!==a||e[2]!==i||e[3]!==o||e[4]!==r){let j;e[6]!==l||e[7]!==a||e[8]!==i||e[9]!==o?(j=v=>s.jsx(ts,{task:v,isActive:l===v.id,onClick:()=>o(v),onArchive:v.created_by===a.currentUserId?()=>i(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=l,e[7]=a,e[8]=i,e[9]=o,e[10]=j):j=e[10],x=r.map(j),e[0]=l,e[1]=a,e[2]=i,e[3]=o,e[4]=r,e[5]=x}else x=e[5];let g;e[11]!==u||e[12]!==c||e[13]!==m?(g=(u||c)&&s.jsx(fs,{onClick:()=>{m()},isFetching:c,indented:!0}),e[11]=u,e[12]=c,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==x||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function hl(t){const e=w.c(35),{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a}=t,c=Mn[n],d=c.icon,[m,u]=tl(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==m?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:m?s.jsx(ft,{size:14}):s.jsx(Vt,{size:14})}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let v;e[15]!==r.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=v):v=e[16];let y;e[17]!==m||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,v]}),e[17]=m,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let _;e[24]!==l||e[25]!==m||e[26]!==a||e[27]!==i||e[28]!==o||e[29]!==n||e[30]!==r?(_=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xl,{status:n,threads:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a})}),e[24]=l,e[25]=m,e[26]=a,e[27]=i,e[28]=o,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==y||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,_]}),e[32]=y,e[33]=_,e[34]=k):k=e[34],k}function zt(t){const e=w.c(34),{threads:n,groupBy:r,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a,hasMore:c,isFetchingMore:d,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!c&&!d){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ve,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(r==="status"){let x;if(e[3]!==l||e[4]!==a||e[5]!==i||e[6]!==o||e[7]!==n){let b;e[9]!==l||e[10]!==a||e[11]!==i||e[12]!==o?(b=j=>s.jsx(hl,{status:j.status,threads:j.threads,activeTaskId:l,onSelectTask:o,onArchiveTask:i,filters:a},j.status),e[9]=l,e[10]=a,e[11]=i,e[12]=o,e[13]=b):b=e[13],x=Zr(n).map(b),e[3]=l,e[4]=a,e[5]=i,e[6]=o,e[7]=n,e[8]=x}else x=e[8];let g;return e[14]!==x?(g=s.jsx(s.Fragment,{children:x}),e[14]=x,e[15]=g):g=e[15],g}let f;if(e[16]!==l||e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==n){let x;e[22]!==l||e[23]!==a||e[24]!==i||e[25]!==o?(x=g=>s.jsx(ts,{task:g,isActive:l===g.id,onClick:()=>o(g),onArchive:g.created_by===a.currentUserId?()=>i(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=l,e[23]=a,e[24]=i,e[25]=o,e[26]=x):x=e[26],f=n.map(x),e[16]=l,e[17]=a,e[18]=i,e[19]=o,e[20]=n,e[21]=f}else f=e[21];let h;e[27]!==c||e[28]!==d||e[29]!==m?(h=(c||d)&&s.jsx(fs,{onClick:m,isFetching:d}),e[27]=c,e[28]=d,e[29]=m,e[30]=h):h=e[30];let p;return e[31]!==f||e[32]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),e[31]=f,e[32]=h,e[33]=p):p=e[33],p}function $t(t){const e=w.c(17),{label:n,onClick:r,active:l,children:o}=t,[i,a]=O.useState(!1);let c,d,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>a(!0),d=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=c,e[1]=d,e[2]=m,e[3]=u):(c=e[0],d=e[1],m=e[2],u=e[3]);const f=l&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=F(f),e[4]=f,e[5]=h):h=e[5];let p;e[6]!==o||e[7]!==n||e[8]!==r||e[9]!==h?(p=s.jsx(je,{asChild:!0,children:s.jsx(xe,{"aria-label":n,onClick:r,onPointerEnter:c,onPointerLeave:d,onFocus:m,onBlur:u,className:h,children:o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=h,e[10]=p):p=e[10];let x;e[11]!==n?(x=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=x):x=e[12];let g;return e[13]!==i||e[14]!==p||e[15]!==x?(g=s.jsxs(ye,{open:i,children:[p,x]}),e[13]=i,e[14]=p,e[15]=x,e[16]=g):g=e[16],g}function et(t){const e=w.c(13),{label:n,value:r,onChange:l,options:o}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==l?(a=u=>u&&l(u),e[2]=l,e[3]=a):a=e[3];let c;e[4]!==o?(c=o.map(pl),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==a||e[7]!==c||e[8]!==r?(d=s.jsx(pn,{type:"single",size:"sm",value:r,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:c}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9];let m;return e[10]!==i||e[11]!==d?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i,d]}),e[10]=i,e[11]=d,e[12]=m):m=e[12],m}function pl(t){return s.jsxs(hn,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:r}=de(),l=gn({connectionId:bn,orgId:r.id,orgSlug:r.slug}),o=Ge(r.id).id,i=Yt(),{threads:a,hasMore:c,isFetchingMore:d,fetchNextPage:m}=ut(),u=a.filter(I=>!I.hidden),{hide:f}=Jt(),h=he(),{setTaskId:p,createNewTask:x}=mt(),g=ot({strict:!1}),b=it({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},_=[...u].sort((I,D)=>(D.updated_at??"").localeCompare(I.updated_at??"")),[k,N]=O.useState("all"),[C,S]=O.useState("flat"),[z,T]=We("sidebar-threads-scope-all",!1),[A,$]=O.useState(!1),[E,W]=O.useState(!1),M={type:k,member:"mine",currentUserId:n??null},q=I=>n?I.filter(D=>D.created_by===n):[],R=I=>k==="automation"?I.filter(D=>!!D.trigger_id):k==="manual"?I.filter(D=>!D.trigger_id):I,Q=q(_),Y=R(Q),ne=R(_),re=z?ne:Y,L=I=>{if(n&&I.created_by&&I.created_by!==n)return;const D=I.id===j;if(f(I.id),!D)return;const B=Q.find(P=>P.id!==I.id&&P.virtual_mcp_id===I.virtual_mcp_id);y(),B?p(B.id,B.virtual_mcp_id):h({to:"/$org",params:{org:r.slug}})},H=I=>{y(),p(I.id,I.virtual_mcp_id)},Z=async I=>{try{const D=await l.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((D.structuredContent??D).items?.length??0)===0}catch{return!1}},K=async()=>{const I=v??o;ae("sidebar_new_thread_clicked",{virtual_mcp_id:I});const D=Q.find(B=>B.virtual_mcp_id===I&&B.title==="New chat");if(D&&await Z(D.id)){y(),p(D.id,I);return}y(),x(I)},{state:ee,isMobile:G,toggleSidebar:le}=Ce();if(ee==="collapsed"&&!G){const I=Ge(r.id),D=new Map((i??[]).map(P=>[P.id,P])),B=P=>(P?D.get(P):void 0)??(P===o?I:void 0);return s.jsxs(_e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(se,{children:s.jsx(ue,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:le,children:s.jsx(Bt,{size:16})})}),s.jsx(se,{children:s.jsx(ue,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})}),re.map(P=>{const X=B(P.virtual_mcp_id);return s.jsx(se,{children:s.jsx(ue,{tooltip:P.title||"New chat",isActive:P.id===j,onClick:()=>H(P),children:s.jsx(De,{icon:X?.icon??null,name:X?.title??"Agent",size:"2xs"})})},P.id)})]})}const V=C!=="flat"||k!=="all"||z===!0,J=s.jsxs(Pe,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(Ne,{asChild:!0,children:s.jsxs(xe,{"aria-label":"Filter threads",active:V,children:[s.jsx(xn,{size:16}),V&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ve,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ee,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(et,{label:"View",value:C,onChange:I=>{ae("tasks_panel_group_by_changed",{to_value:I}),S(I)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(et,{label:"Type",value:k,onChange:I=>{ae("tasks_panel_filter_changed",{to_value:I}),N(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(et,{label:"Scope",value:z?"team":"mine",onChange:I=>T(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),me=I=>s.jsx(st,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(es,{}),J]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx($t,{label:"Search threads",onClick:()=>{ae("tasks_panel_search_opened"),W(!0),$(!0)},children:s.jsx(en,{size:16})}),s.jsx($t,{label:"New thread",onClick:()=>{K()},children:s.jsx(bt,{size:16})})]})]})});return G?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!0),s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[me(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(St,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(zt,{threads:re,groupBy:C,activeTaskId:j,onSelectTask:H,onArchiveTask:L,filters:M,hasMore:c,isFetchingMore:d,onLoadMore:()=>{m()},filtersActive:V})})}),E&&s.jsx(Nt,{open:A,onOpenChange:$})]})}const gl=5,bl=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function bs(){const t=w.c(3),{state:e}=Ce();if(e==="collapsed"){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:gl}).map(yl)}),t[0]=l):l=t[0],l}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"}),s.jsx(fe,{className:"size-6 rounded-md"})]}),s.jsx(fe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:bl.map(jl)})]}),t[2]=r):r=t[2],r}function jl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(fe,{className:"size-5 rounded-full shrink-0"}),s.jsx(fe,{className:F("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(vl)})]},e)}function vl(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(fe,{className:"h-3 flex-1 rounded-sm"})},e)}function yl(t,e){return s.jsx(fe,{className:"size-10 rounded-lg mx-auto"},e)}function Sl(){const t=w.c(4),e=rs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xr,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=r):r=t[1];let l;return t[2]!==e?(l=s.jsx(ss,{children:s.jsx(is,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=l):l=t[3],l}function Nl(t){const e=w.c(8),{onClose:n}=t,r=rs();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Qr,{}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let i;e[2]!==n?(i=s.jsx(Et,{children:s.jsx(O.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a=s.jsx(ss,{children:s.jsx(Cr,{sections:r,onClose:n,footer:l,additionalContent:i})}),e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const _l=Ds({name:Os().min(2,"Organization name is required")});function Cl(t){const e=w.c(41),{open:n,onOpenChange:r}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={resolver:Ms(_l),defaultValues:{name:""}},e[0]=l):l=e[0];const o=Ps(l);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={mutationFn:kl,onSuccess:wl},e[1]=i):i=e[1];const a=Es(i),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Kn,{children:[s.jsx(Vn,{children:"Create a new organization"}),s.jsx(Xn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let m;if(e[3]!==a||e[4]!==o){let N;e[6]!==a?(N=C=>a.mutateAsync(C),e[6]=a,e[7]=N):N=e[7],m=o.handleSubmit(N),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=N=>{const{field:C}=N;return s.jsxs(er,{children:[s.jsx(tr,{children:"Organization Name"}),s.jsx(sr,{children:s.jsx(lr,{...C,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(nr,{children:"The name of your company or organization"}),C.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",js(C.value)]})]}),s.jsx(rr,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(Jn,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==o?(p=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=p):p=e[17];let x;e[18]!==o.formState.isSubmitting||e[19]!==p?(x=s.jsx(qn,{disabled:o.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!o.formState.isValid||o.formState.isSubmitting;let b;e[21]!==o.formState.isSubmitting?(b=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ln,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(Te,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==x?(v=s.jsxs(Qn,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=h,e[33]=y):y=e[33];let _;e[34]!==o||e[35]!==y?(_=s.jsxs(Wn,{children:[d,s.jsx(Zn,{...o,children:y})]}),e[34]=o,e[35]=y,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(Yn,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function wl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function kl(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Il(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function vs(t){const e=w.c(13),{org:n,size:r}=t,l=r===void 0?"sm":r,o=l==="xs"?"size-5":"size-6",i=l==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=F(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Il(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==i?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",i),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=i,e[8]=d):d=e[8];let m;return e[9]!==a||e[10]!==c||e[11]!==d?(m=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=m):m=e[12],m}function zl(t){const e=w.c(24),{orgParam:n,onSelectOrg:r,onCreateOrg:l}=t,{data:o}=Fs();let i;e[0]!==n?(i=(S,z)=>S.slug===n?-1:z.slug===n?1:S.name.localeCompare(z.name),e[0]=n,e[1]=i):i=e[1];const a=[...o??[]].sort(i),[c,d]=O.useState(""),m=c.toLowerCase(),u=m?a.filter(S=>S.name.toLowerCase().includes(m)||S.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ns,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=S=>d(S.target.value),e[3]=h):h=e[3];let p;e[4]!==c?(p=S=>S.key==="Escape"&&c&&d(""),e[4]=c,e[5]=p):p=e[5];let x;e[6]!==c||e[7]!==p?(x=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:c,onChange:h,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=c,e[7]=p,e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ae,{size:16}),e[9]=g):g=e[9];let b;e[10]!==l?(b=s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=l,e[11]=b):b=e[11];let j;e[12]!==x||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,x,b]}),e[12]=x,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:c?`No organizations match "${c}"`:"No organizations available"});let _;e[15]!==r||e[16]!==n?(_=S=>s.jsxs("button",{type:"button",onClick:()=>r(S.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",S.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(vs,{org:S,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.slug})]}),S.slug===n&&s.jsx(Xe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},S.id),e[15]=r,e[16]=n,e[17]=_):_=e[17];const k=u.map(_);let N;e[18]!==y||e[19]!==k?(N=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=N):N=e[20];let C;return e[21]!==N||e[22]!==j?(C=s.jsxs(s.Fragment,{children:[j,N]}),e[21]=N,e[22]=j,e[23]=C):C=e[23],C}function $l(t){const e=w.c(22),{trigger:n,orgParam:r,align:l,side:o}=t,i=l===void 0?"start":l,a=o===void 0?"bottom":o,c=he(),[d,m]=O.useState(!1),[u,f]=O.useState(!1);let h;e[0]!==n?(h=s.jsx(Ne,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const p=String(d);let x;e[2]!==c?(x=k=>{m(!1),c({to:"/$org",params:{org:k}})},e[2]=c,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==r||e[6]!==p||e[7]!==x?(b=s.jsx(zl,{orgParam:r,onSelectOrg:x,onCreateOrg:g},p),e[5]=r,e[6]=p,e[7]=x,e[8]=b):b=e[8];let j;e[9]!==i||e[10]!==a||e[11]!==b?(j=s.jsx(Ee,{side:a,align:i,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Tl,onCloseAutoFocus:Al,children:b}),e[9]=i,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==d||e[14]!==h||e[15]!==j?(v=s.jsxs(Pe,{open:d,onOpenChange:m,children:[h,j]}),e[13]=d,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Cl,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let _;return e[19]!==y||e[20]!==v?(_=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=_):_=e[21],_}function Al(t){return t.preventDefault()}function Tl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Dl(t){const e=w.c(21),{value:n,onChange:r,placeholder:l,onKeyDown:o,className:i,isSearching:a,disabled:c}=t,d=l===void 0?"Search...":l;let m;e[0]!==i?(m=F("shrink-0 w-full border-b border-border h-12",i),e[0]=i,e[1]=m):m=e[1];const u=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Pt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==o||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:o,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=o,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Ol="Select an existing agent";function Ml(t){const e=w.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ve,{side:"right",sideOffset:8,children:Ol}),e[2]=l):l=e[2];let o;return e[3]!==r?(o=s.jsxs(ye,{defaultOpen:!0,delayDuration:0,children:[r,l]}),e[3]=r,e[4]=o):o=e[4],o}function Pl(){const t=w.c(5),{enableDecoImport:e}=Dt(),{data:n}=be.useSession();let r;t[0]!==n?.user?.email?(r=Ot.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const l=!!e&&!!n?.user?.email;let o;t[2]!==r||t[3]!==l?(o={queryKey:r,queryFn:El,enabled:l,staleTime:3e5},t[2]=r,t[3]=l,t[4]=o):o=t[4];const{data:i}=Mt(o);return i?.isDecoUser??!1}async function El(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Fl(t){const e=he(),{create:n}=Jt(),{locator:r}=de(),l=ot({strict:!1}),o=it({strict:!1});return async i=>{const a=crypto.randomUUID(),c=i===o.virtualmcpid?un(t,r,l.taskId??""):null;try{await n({id:a,virtual_mcp_id:i,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:i}})}}function At(t){const e=w.c(17),{agent:n,selected:r,onClick:l}=t,o=r?"bg-accent":"hover:bg-accent";let i;e[0]!==o?(i=F("flex flex-col items-center gap-2 p-3 rounded-xl transition-colors cursor-pointer group",o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(De,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let c;e[5]!==r?(c=r&&s.jsx("span",{className:"absolute -bottom-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-background",children:s.jsx(Xe,{size:10,className:"text-foreground"})}),e[5]=r,e[6]=c):c=e[6];let d;e[7]!==a||e[8]!==c?(d=s.jsxs("div",{className:"relative",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9];let m;e[10]!==n.title?(m=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[10]=n.title,e[11]=m):m=e[11];let u;return e[12]!==l||e[13]!==i||e[14]!==d||e[15]!==m?(u=s.jsxs("button",{type:"button",onClick:l,className:i,children:[d,m]}),e[12]=l,e[13]=i,e[14]=d,e[15]=m,e[16]=u):u=e[16],u}function Rl(t){const e=w.c(60),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:l,onSelectAgent:o,selectedAgentId:i}=t,[a,c]=O.useState(""),d=Yt(),m=d??[],{org:u}=de(),{data:f}=be.useSession(),h=f?.user?.id??"anon",p=En(d),x=Fn();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:b,isCreating:j}=ir(g),{createFromTemplate:v,isCreating:y}=cr(),_=Pl(),k=Fl(u.slug),N=fn(d),C=a.toLowerCase(),S=m.filter(Ll).filter(U=>!N.has(U.id)).filter(U=>!a||U.title.toLowerCase().includes(C)),z=Ge(u.id),T=!a||z.title.toLowerCase().includes(C);let A;e[1]!==n||e[2]!==o?(A=()=>{o?.(null),n(),c("")},e[1]=n,e[2]=o,e[3]=A):A=e[3];const $=A,E=U=>{if(o){o(U.id),n(),c("");return}Rn({orgId:u.id,userId:h},U.id,p),x(),n(),c(""),k(U.id)},W="flex flex-col max-h-[min(640px,80dvh)]";let M;e[4]!==a?(M=s.jsx(Dl,{value:a,onChange:c,placeholder:"Search agents..."}),e[4]=a,e[5]=M):M=e[5];const q="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let R;e[6]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[6]=R):R=e[6];const Q="grid grid-cols-3 gap-1";let Y;e[7]!==b||e[8]!==n?(Y=async()=>{ae("agent_create_new_clicked",{source:"browse_popover"}),await b(),n()},e[7]=b,e[8]=n,e[9]=Y):Y=e[9];let ne,re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ae,{size:16,className:"text-muted-foreground"})}),ne=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[10]=ne,e[11]=re):(ne=e[10],re=e[11]);let L;e[12]!==j||e[13]!==Y?(L=s.jsxs("button",{type:"button",disabled:j,onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[re,ne]}),e[12]=j,e[13]=Y,e[14]=L):L=e[14];let H;e[15]!==v||e[16]!==n?(H=async()=>{ae("agent_create_clicked",{source:"browse_popover",method:"website"}),await v(dr),n()},e[15]=v,e[16]=n,e[17]=H):H=e[17];let Z,K;e[18]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(or,{className:"size-5 text-muted-foreground"})}),K=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[18]=Z,e[19]=K):(Z=e[18],K=e[19]);let ee;e[20]!==y||e[21]!==H?(ee=s.jsxs("button",{type:"button",disabled:y,onClick:H,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[Z,K]}),e[20]=y,e[21]=H,e[22]=ee):ee=e[22];let G;e[23]!==n||e[24]!==l?(G=()=>{ae("agent_import_clicked",{source:"github"}),l(),n()},e[23]=n,e[24]=l,e[25]=G):G=e[25];let le,ce;e[26]===Symbol.for("react.memo_cache_sentinel")?(le=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(ur,{className:"size-5 text-muted-foreground"})}),ce=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[26]=le,e[27]=ce):(le=e[26],ce=e[27]);let V;e[28]!==G?(V=s.jsxs("button",{type:"button",onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[le,ce]}),e[28]=G,e[29]=V):V=e[29];let J;e[30]!==_||e[31]!==n||e[32]!==r?(J=_&&s.jsxs("button",{type:"button",onClick:()=>{ae("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[30]=_,e[31]=n,e[32]=r,e[33]=J):J=e[33];const me=o&&T&&z&&s.jsx(At,{agent:z,selected:!i||i===z.id,onClick:$}),I=S.map(U=>s.jsx(At,{agent:U,selected:o?i===U.id:void 0,onClick:()=>E(U)},U.id));let D;e[34]!==L||e[35]!==ee||e[36]!==V||e[37]!==J||e[38]!==me||e[39]!==I?(D=s.jsxs("div",{className:Q,children:[L,ee,V,J,me,I]}),e[34]=L,e[35]=ee,e[36]=V,e[37]=J,e[38]=me,e[39]=I,e[40]=D):D=e[40];let B;e[41]!==j||e[42]!==a||e[43]!==S.length?(B=S.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:a?"No agents found":"No agents yet"}),e[41]=j,e[42]=a,e[43]=S.length,e[44]=B):B=e[44];let P;e[45]!==D||e[46]!==B||e[47]!==R?(P=s.jsxs("div",{className:q,children:[R,D,B]}),e[45]=D,e[46]=B,e[47]=R,e[48]=P):P=e[48];let X;e[49]!==u.slug?(X={org:u.slug},e[49]=u.slug,e[50]=X):X=e[50];let oe;e[51]!==n?(oe=()=>n(),e[51]=n,e[52]=oe):oe=e[52];let ie;e[53]!==X||e[54]!==oe?(ie=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ft,{to:"/$org/settings/agents",params:X,onClick:oe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[53]=X,e[54]=oe,e[55]=ie):ie=e[55];let Se;return e[56]!==P||e[57]!==ie||e[58]!==M?(Se=s.jsxs("div",{className:W,children:[M,P,ie]}),e[56]=P,e[57]=ie,e[58]=M,e[59]=Se):Se=e[59],Se}function Ll(t){return!jn(t.id)}function Bl(t){const e=w.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r,trigger:l,onSelectAgent:o,selectedAgentId:i,side:a,align:c}=n,d=r===void 0?!1:r,m=a===void 0?"right":a,u=c===void 0?"start":c,[f,h]=O.useState(!1),[p,x]=O.useState(!1),[g,b]=O.useState(!1),j=dt(),{setOpenMobile:v}=Ce(),y=Pn(),_=y?"border border-border":void 0;let k;e[2]!==y?(k=M=>y?s.jsx(Ml,{children:M}):M,e[2]=y,e[3]=k):k=e[3];const N=k;let C;e[4]!==j||e[5]!==v?(C=()=>{h(!1),j&&v(!1)},e[4]=j,e[5]=v,e[6]=C):C=e[6];const S=C;let z;e[7]!==S||e[8]!==o||e[9]!==f||e[10]!==i?(z=f&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(fe,{className:"h-4 w-24"})}),children:s.jsx(Rl,{onClose:S,onOpenImportDeco:()=>x(!0),onOpenGithubImport:()=>{b(!0),S()},onSelectAgent:o,selectedAgentId:i})}),e[7]=S,e[8]=o,e[9]=f,e[10]=i,e[11]=z):z=e[11];const T=z;let A;e[12]!==u||e[13]!==d||e[14]!==_||e[15]!==y||e[16]!==j||e[17]!==f||e[18]!==T||e[19]!==m||e[20]!==l||e[21]!==N?(A=j?s.jsxs(s.Fragment,{children:[l?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:l}):d?N(s.jsx(xe,{"aria-label":"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Ae,{className:"size-4"})})):s.jsx(se,{children:N(s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),onClick:()=>{ae("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ht,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[s.jsx(Gt,{className:"sr-only",children:"Browse agents"}),T]})})]}):s.jsxs(Pe,{open:f,onOpenChange:M=>{M&&!f&&ae("agent_browser_opened",{surface:"desktop_popover"}),h(M)},children:[l?s.jsx(Ne,{asChild:!0,children:l}):d?N(s.jsx(Ne,{asChild:!0,children:s.jsx(xe,{"aria-label":"Browse agents",className:F(_),children:s.jsx(Ae,{className:"size-4"})})})):s.jsx(se,{children:N(s.jsx(Ne,{asChild:!0,children:s.jsxs(ue,{tooltip:y?void 0:"Browse agents",className:F(_),children:[s.jsx(Ae,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ee,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:T})]}),e[12]=u,e[13]=d,e[14]=_,e[15]=y,e[16]=j,e[17]=f,e[18]=T,e[19]=m,e[20]=l,e[21]=N,e[22]=A):A=e[22];let $;e[23]!==p?($=s.jsx(ar,{open:p,onOpenChange:x}),e[23]=p,e[24]=$):$=e[24];let E;e[25]!==g?(E=s.jsx(mr,{open:g,onOpenChange:b}),e[25]=g,e[26]=E):E=e[26];let W;return e[27]!==E||e[28]!==A||e[29]!==$?(W=s.jsxs(s.Fragment,{children:[A,$,E]}),e[27]=E,e[28]=A,e[29]=$,e[30]=W):W=e[30],W}const ys="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Hl(t){const e=w.c(19),{agentId:n,onOpenHome:r,onPick:l}=t,o=Qt(n),i=o?.title??"Decopilot",a=`Open ${i} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==i?(d=s.jsx(De,{icon:c,name:i,size:"2xs"}),e[0]=c,e[1]=i,e[2]=d):d=e[2];let m;e[3]!==r||e[4]!==a||e[5]!==d?(m=s.jsx("button",{type:"button",onClick:r,"aria-label":a,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=r,e[4]=a,e[5]=d,e[6]=m):m=e[6];let u;e[7]!==i?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:i}),e[7]=i,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let h;e[10]!==u?(h=s.jsxs("button",{type:"button",className:ys,children:[u,f]}),e[10]=u,e[11]=h):h=e[11];let p;e[12]!==n||e[13]!==l||e[14]!==h?(p=s.jsx(Bl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:h}),e[12]=n,e[13]=l,e[14]=h,e[15]=p):p=e[15];let x;return e[16]!==m||e[17]!==p?(x=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=x):x=e[18],x}function Tt(){const t=w.c(34),{org:e}=de(),{state:n}=Ce(),r=n==="collapsed",l=he();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const i=ot(o);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const c=it(a),{threads:d}=ut(),{setTaskId:m,createNewTask:u}=mt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const h=f.id,p=i.taskId?c.virtualmcpid??h:h;let x;t[4]!==u||t[5]!==h||t[6]!==l||t[7]!==e.slug||t[8]!==m||t[9]!==d?(x=T=>{if(!T||T===h){l({to:"/$org",params:{org:e.slug}});return}const A=d.find($=>!$.hidden&&$.virtual_mcp_id===T&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));A?m(A.id,T):u(T)},t[4]=u,t[5]=h,t[6]=l,t[7]=e.slug,t[8]=m,t[9]=d,t[10]=x):x=t[10];const g=x;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(te.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ft,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==r?(y=!r&&s.jsx($l,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ys,children:[s.jsx(vs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(ft,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=r,t[18]=y):y=t[18];let _;t[19]!==v||t[20]!==y?(_=s.jsxs(jt,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=_):_=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Hn,{}),t[22]=k):k=t[22];let N;t[23]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[23]=N):N=t[23];let C;t[24]!==p||t[25]!==g?(C=()=>g(p),t[24]=p,t[25]=g,t[26]=C):C=t[26];let S;t[27]!==p||t[28]!==g||t[29]!==C?(S=s.jsx(jt,{children:s.jsx(O.Suspense,{fallback:N,children:s.jsx(Hl,{agentId:p,onOpenHome:C,onPick:g})})}),t[27]=p,t[28]=g,t[29]=C,t[30]=S):S=t[30];let z;return t[31]!==S||t[32]!==_?(z=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Gn,{className:"flex-nowrap",children:[_,k,S]})}),t[31]=S,t[32]=_,t[33]=z):z=t[33],z}const Ul="sidebar.open";function Gl(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(On,{}),t[0]=e):e=t[0],e}function Li(){const t=w.c(24),e=dt(),[n,r]=We(Ul,!1),{width:l,wrapperRef:o,onStartResize:i,resetWidth:a}=pr();let c;t[0]!==e?(c=e?s.jsxs(te.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(es,{}),s.jsx(Tt,{}),s.jsx(rt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(te.TogglesSlot,{}),s.jsx(te.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(te.CenterSlot,{}),s.jsx(te.RightSlot,{})]}):s.jsxs(te.Header,{children:[s.jsx(te.LeftColumn,{children:s.jsx(Tt,{})}),s.jsx(te.CenterSlot,{}),s.jsxs(te.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(te.TabsSlot,{})}),s.jsx(te.RightSlot,{}),s.jsx(te.TogglesSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${l}px`;let m;t[2]!==d?(m={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==i||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Sl,{}),s.jsx(fr,{onPointerDown:i,onDoubleClick:a})]}),t[4]=e,t[5]=i,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Hs,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(O.Suspense,{fallback:s.jsx(Gl,{}),children:s.jsx(Rs,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==u||t[11]!==f||t[12]!==o?(x=s.jsxs(Us,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=o,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dn,{renderSidebar:ql}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(Bn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(yn,{children:s.jsx(te.Provider,{children:s.jsx(Gs,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ql(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Nl,{onClose:e})})})}export{Li as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-DHTICC_v.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-B3q7nz8B.js";import{S as nt}from"./scroll-area-C8YtCymQ.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-Derb8U-C.js";import{p as xt}from"./index-BgCyOgdF.js";import"./X-BQZZQdg0.js";import"./agent-icon-BRuLsBYY.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronDown-BLALKRGM.js";import"./ChevronRight-Gacf5_E2.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./ZoomOut-CwXzA7X6.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./LinkExternal01-D4vA-I3a.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./XClose-ChRyc7zA.js";import"./Zap-RN8PAcZE.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./tooltip-CWNyrHYY.js";import"./file-type-icon-Bx1NX_Gy.js";import"./dialog-BdIjDk0G.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./content-blocks-o63cs2vh.js";import"./types-BHL4d6ji.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./chat-context-CIKFBD8u.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-ai-providers-CVS8EjHf.js";import"./studio-tools-D6ANxpFE.js";import"./use-decopilot-events-BB7o7ets.js";import"./use-organization-settings-D9G2tGsW.js";import"./shell-layout-QzfqSuxf.js";import"./avatar-DxH3BnSs.js";import"./alert-dialog-D87-BKea.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./integration-icon-m6Sa_hcd.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-connection-CRsO-Bab.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./label-CwMsBEmc.js";import"./input-DgsFOGyM.js";import"./select-DzzBmNmo.js";import"./switch-BRlkUTqX.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./index-Cgz2WBho.js";import"./toolbar-C1WgDWOZ.js";import"./use-debounced-value-C2hJqHIV.js";import"./dropdown-menu-8PMbgM0q.js";import"./textarea-Dp78LmPE.js";import"./index-BwaOBBZ-.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-status-sounds-DuOBmrHo.js";import"./empty-state-y_scHUYK.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";function ri(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ri as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as H,j as t,B as Z}from"./index-DHTICC_v.js";import{n as ee}from"./LinkExternal01-D4vA-I3a.js";import{aD as te,t as oe}from"./agent-icon-BRuLsBYY.js";import{I as J}from"./input-DgsFOGyM.js";import{L as G}from"./label-CwMsBEmc.js";import{M as ie}from"./automation-runs-BQZ05VJM.js";import{T as Q,a as se,b as W,c as le}from"./tabs-ByVhqny2.js";import{T as re}from"./textarea-Dp78LmPE.js";import{au as ae,av as me,at as pe,aw as ne,ax as ce,ay as de,az as fe}from"./index-BgCyOgdF.js";import{b as ue,a as xe,B as he}from"./block-document-OYJ-kskh.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-DFOak6EH.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronDown-BLALKRGM.js";import"./ChevronRight-Gacf5_E2.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./ZoomOut-CwXzA7X6.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./XClose-ChRyc7zA.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./use-connection-CRsO-Bab.js";import"./use-collections-BnOL5hT8.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./card-D-LCVQQb.js";import"./sheet-B3q7nz8B.js";import"./table-65-g1dd8.js";import"./empty-state-y_scHUYK.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./task-status-BMnLETgS.js";import"./use-automations-DJ1_UqKB.js";import"./studio-tools-D6ANxpFE.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./badge-wh5eWpb9.js";import"./select-DzzBmNmo.js";import"./tooltip-CWNyrHYY.js";import"./checkbox-CFdij7Ei.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./dialog-BdIjDk0G.js";import"./popover-4-S-2t4S.js";import"./avatar-DxH3BnSs.js";import"./scroll-area-C8YtCymQ.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./file-type-icon-Bx1NX_Gy.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./content-blocks-o63cs2vh.js";import"./types-BHL4d6ji.js";import"./chat-context-CIKFBD8u.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CVS8EjHf.js";import"./use-decopilot-events-BB7o7ets.js";import"./use-organization-settings-D9G2tGsW.js";import"./shell-layout-QzfqSuxf.js";import"./alert-dialog-D87-BKea.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./integration-icon-m6Sa_hcd.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./index-Cgz2WBho.js";import"./toolbar-C1WgDWOZ.js";import"./use-debounced-value-C2hJqHIV.js";import"./dropdown-menu-8PMbgM0q.js";import"./index-BwaOBBZ-.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./shell-route-loading-Bpj8AlnX.js";import"./use-status-sounds-DuOBmrHo.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function ai(A){const e=H.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:l,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ge(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Y)=>_({...r,[T]:Y}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==r||e[14]!==x?(S=ue({decofile:m,post:r,previewBaseUrl:x}),e[12]=m,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let U;e[40]!==L||e[41]!==R?(U=t.jsx(ve,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=U):U=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=O):O=e[43];let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(se,{children:[O,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=K):K=e[44];let $;e[45]!==r.sections?($=xe(r.sections),e[45]=r.sections,e[46]=$):$=e[46];let D;e[47]!==h?(D=T=>h("sections",T),e[47]=h,e[48]=D):D=e[48];let I;e[49]!==u||e[50]!==$||e[51]!==D?(I=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:$,onChange:D,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=$,e[51]=D,e[52]=I):I=e[52];let M;e[53]!==m||e[54]!==r||e[55]!==h?(M=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:r,decofile:m,onChange:h})})}),e[53]=m,e[54]=r,e[55]=h,e[56]=M):M=e[56];let z;e[57]!==I||e[58]!==M?(z=t.jsxs(le,{defaultValue:"content",className:"mt-6 gap-4",children:[K,I,M]}),e[57]=I,e[58]=M,e[59]=z):z=e[59];let V;e[60]!==U||e[61]!==z?(V=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[U,z]})}),e[60]=U,e[61]=z,e[62]=V):V=e[62];let q;return e[63]!==v||e[64]!==V?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[v,V]}),e[63]=v,e[64]=V,e[65]=q):q=e[65],q}function Ce(A){const e=H.c(59),{post:i,decofile:d,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(re,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=H.c(15),{value:i,onChange:d}=A;let o,l,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(G,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=l,e[4]=p,e[5]=m}else o=e[2],l=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:l,children:[p,m,u]}),e[10]=l,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:d,kind:o,valueField:l,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==l){x=de(d,o);let f;e[6]!==l?(f=(c,g)=>F(c[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==l){const f=Array.isArray(m)?m:[];let a;e[13]!==l?(a=c=>F(c[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[l]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(G,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{ai as PostEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,G as H,j as A}from"./index-DHTICC_v.js";import{l as L,g as E,s as y}from"./scroll-area-C8YtCymQ.js";import{p as O,u as k}from"./use-mcp-client-DAJmDOVO.js";import{b as q,c as B}from"./use-mcp-tools-AjHzJbIQ.js";import{u as G}from"./index-BgCyOgdF.js";import{c as Y}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-BHL4d6ji.js";import{u as z,b as F}from"./chat-context-CIKFBD8u.js";import{b as J}from"./shell-layout-QzfqSuxf.js";import"./agent-icon-BRuLsBYY.js";import"./AlertCircle-D8gnDqwf.js";import"./Tool01-DrE6CqtR.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronDown-BLALKRGM.js";import"./ChevronRight-Gacf5_E2.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./ZoomOut-CwXzA7X6.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./LinkExternal01-D4vA-I3a.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./XClose-ChRyc7zA.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./tooltip-CWNyrHYY.js";import"./file-type-icon-Bx1NX_Gy.js";import"./dialog-BdIjDk0G.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D6ANxpFE.js";import"./sheet-B3q7nz8B.js";import"./integration-icon-m6Sa_hcd.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-connection-CRsO-Bab.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./label-CwMsBEmc.js";import"./input-DgsFOGyM.js";import"./select-DzzBmNmo.js";import"./auth-pLLkIszG.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./use-ai-providers-CVS8EjHf.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DxH3BnSs.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./index-Cgz2WBho.js";import"./alert-dialog-D87-BKea.js";import"./toolbar-C1WgDWOZ.js";import"./use-debounced-value-C2hJqHIV.js";import"./dropdown-menu-8PMbgM0q.js";import"./textarea-Dp78LmPE.js";import"./index-BwaOBBZ-.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./use-organization-settings-D9G2tGsW.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-status-sounds-DuOBmrHo.js";import"./use-decopilot-events-BB7o7ets.js";import"./empty-state-y_scHUYK.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=Y(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function De(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=G();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{De as AppViewContent};
|