decocms 4.363.1 → 4.364.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CgERhdh6.js → AlertCircle-EniJtD8E.js} +1 -1
- package/dist/client/assets/{AreaChart-kU4sTinA.js → AreaChart-DZpAPo6a.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BVx6AQzq.js → ArrowLeft-Clu1mSdY.js} +1 -1
- package/dist/client/assets/{ArrowRight-DZQert3q.js → ArrowRight-Cu8UuHNR.js} +1 -1
- package/dist/client/assets/{ArrowUp-lpfNBlP2.js → ArrowUp-C0eratGp.js} +1 -1
- package/dist/client/assets/{Check-DClZtAIP.js → Check-BWpBE9uf.js} +1 -1
- package/dist/client/assets/{CheckCircle-BGqFZ8sM.js → CheckCircle-cinYKmPU.js} +1 -1
- package/dist/client/assets/{ChevronRight-BNfU55ld.js → ChevronRight-DzRB-rdO.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-ilm76_0p.js → ChevronSelectorVertical-BiIbFU31.js} +1 -1
- package/dist/client/assets/{ChevronUp-CbF1Gmeo.js → ChevronUp-DGrguvGW.js} +1 -1
- package/dist/client/assets/{Copy01-DiITYBuR.js → Copy01-DayLu0dF.js} +1 -1
- package/dist/client/assets/{CreditCard01-Zpy-4Wu9.js → CreditCard01-4OsjIT5f.js} +1 -1
- package/dist/client/assets/{Database01-zcGUPFsG.js → Database01-2gG_9E30.js} +1 -1
- package/dist/client/assets/{DotsVertical-LmkOTjL4.js → DotsVertical-CucJCL9y.js} +1 -1
- package/dist/client/assets/{Download01-C4blLpML.js → Download01-BC2rKbuh.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-KbkdtIBU.js → ErrorBarContext-CRh7XbJc.js} +1 -1
- package/dist/client/assets/{Eye-Cd7v-liN.js → Eye-dnrP5DkM.js} +1 -1
- package/dist/client/assets/{File02-CceuR6rF.js → File02-BhckHV8N.js} +1 -1
- package/dist/client/assets/{GitBranch01-Dil6c2wv.js → GitBranch01-BBn4dN5f.js} +1 -1
- package/dist/client/assets/{Globe01-BVji6jXS.js → Globe01-SLAc63wC.js} +1 -1
- package/dist/client/assets/{HardDrive-B4UY5qYp.js → HardDrive-FlnOYA_8.js} +1 -1
- package/dist/client/assets/{Image01-CpXdMb8x.js → Image01-BrHSH-Vi.js} +1 -1
- package/dist/client/assets/{Key01-BsAAVoJx.js → Key01-CKcg8G1v.js} +1 -1
- package/dist/client/assets/{Link01-OqB-2yPE.js → Link01-3t9JrUgl.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DobnLseV.js → LinkExternal01-Cp7uxK1i.js} +1 -1
- package/dist/client/assets/{Monitor01-BTqHf-K4.js → Monitor01-BUruMK2r.js} +1 -1
- package/dist/client/assets/{Package-CCkk0w5h.js → Package-CdfyZYxN.js} +1 -1
- package/dist/client/assets/{Palette-BBWt8owf.js → Palette-CglyAOTg.js} +1 -1
- package/dist/client/assets/{Play-CPeIBqH_.js → Play-rnw1eV52.js} +1 -1
- package/dist/client/assets/{Plus-DaErdsG1.js → Plus-Bxp02MWl.js} +1 -1
- package/dist/client/assets/{Printer-BG6NfeSZ.js → Printer-fz_zwxfT.js} +1 -1
- package/dist/client/assets/{SearchLg-DxQfk550.js → SearchLg-FC9suxna.js} +1 -1
- package/dist/client/assets/{SearchMd-BNXjQ2BV.js → SearchMd-DRRptSJN.js} +1 -1
- package/dist/client/assets/{Sector-D2wxgDkd.js → Sector-CJIPfQ5Z.js} +1 -1
- package/dist/client/assets/{Settings02-DL8f5fN1.js → Settings02-D2oiGU4q.js} +1 -1
- package/dist/client/assets/{Share07-D1Sv14jA.js → Share07-D_kiq5Fr.js} +1 -1
- package/dist/client/assets/{Shield01-BsobIEfQ.js → Shield01-CjyLhqlS.js} +1 -1
- package/dist/client/assets/{Stars01-f37Q7vDf.js → Stars01-COChWymR.js} +1 -1
- package/dist/client/assets/{Sun-DjKz3VjB.js → Sun-nKOZMh9n.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BIyO34Jw.js → SwitchHorizontal01-CxlKjkIX.js} +1 -1
- package/dist/client/assets/{Tool01-D6HOM_aJ.js → Tool01-BnKd95Y1.js} +1 -1
- package/dist/client/assets/{Tool02-BrfQeZRx.js → Tool02-C_xRWqQk.js} +1 -1
- package/dist/client/assets/{Trash01-DQjprOwc.js → Trash01-DqUm2RRh.js} +1 -1
- package/dist/client/assets/{TrendUp01-DIz6JZwT.js → TrendUp01-PFzYDizC.js} +1 -1
- package/dist/client/assets/{Upload01-BDeLrRhf.js → Upload01-CqWnAR1-.js} +1 -1
- package/dist/client/assets/{User01-B8a5ssx2.js → User01-BJoNdkjl.js} +1 -1
- package/dist/client/assets/{UserSquare-yIpHwPSn.js → UserSquare-CCDsU001.js} +1 -1
- package/dist/client/assets/{Users01-BCRhQsCX.js → Users01-DSQPwtP5.js} +1 -1
- package/dist/client/assets/{Users03-DWh3D2_T.js → Users03-CRtXqa1Q.js} +1 -1
- package/dist/client/assets/{XCircle-DudPVYQR.js → XCircle-9Cb0khfg.js} +1 -1
- package/dist/client/assets/{XClose-DpDcHm9Y.js → XClose-Cw4b4Uag.js} +1 -1
- package/dist/client/assets/{Zap-C5eiFR0N.js → Zap-ChVc0p76.js} +1 -1
- package/dist/client/assets/{ZoomOut-DdupjPFF.js → ZoomOut-BXPGwF_O.js} +1 -1
- package/dist/client/assets/{access-gate-Dnh0JyKy.js → access-gate-BZbNb1lq.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BSihy3_s.js → add-connection-dialog-s1GRGQ63.js} +1 -1
- package/dist/client/assets/{agent-analytics-C1OAYjbt.js → agent-analytics-C4aHsqYV.js} +1 -1
- package/dist/client/assets/agent-app-CzbKRw1_.js +1 -0
- package/dist/client/assets/{agent-assets-vYQq8qui.js → agent-assets-B6lPIA_2.js} +1 -1
- package/dist/client/assets/{agent-automation-BPNX454_.js → agent-automation-Bmdy2mNK.js} +1 -1
- package/dist/client/assets/{agent-automations-BLOXID0N.js → agent-automations-5exIOZ--.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BzEccd4r.js → agent-connect-sources-ozaEzrP4.js} +1 -1
- package/dist/client/assets/agent-deck-D5-mvZ5i.js +1 -0
- package/dist/client/assets/{agent-e2e-DM8adI3E.js → agent-e2e-s-Nk1F2Y.js} +1 -1
- package/dist/client/assets/agent-file-DkGApBvp.js +1 -0
- package/dist/client/assets/{agent-git-DarQSTRH.js → agent-git-Bu3r6tWp.js} +1 -1
- package/dist/client/assets/{agent-hosting-Dnr2S-TT.js → agent-hosting-CdYzW_dA.js} +1 -1
- package/dist/client/assets/{agent-icon-vDfwuZu4.js → agent-icon-DrlilhFJ.js} +1 -1
- package/dist/client/assets/agent-library-file-CK85m8fH.js +1 -0
- package/dist/client/assets/{agent-monitor-DpaaBIhL.js → agent-monitor-DEQ-34KF.js} +1 -1
- package/dist/client/assets/{agent-overview-D9IrP622.js → agent-overview-BQIF-rwN.js} +1 -1
- package/dist/client/assets/agent-settings-gb3smN_4.js +1 -0
- package/dist/client/assets/{agent-site-editor-DTFbZmEY.js → agent-site-editor-DtPpWjDD.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DkcL_YVi.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BE26aik7.js → agent-site-editor-content-6zQLGSyR.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-ki_D8wtP.js → agent-site-editor-preview-D8mxBZIU.js} +3 -3
- package/dist/client/assets/agent-view-D9WzU94g.js +1 -0
- package/dist/client/assets/{agent-view-guard-DomQyuot.js → agent-view-guard-nj1TYVsk.js} +1 -1
- package/dist/client/assets/{agents-list-B0vnsITA.js → agents-list-hiZ_XS0O.js} +1 -1
- package/dist/client/assets/{ai-providers-CxaMjUP7.js → ai-providers-oY9ilqJZ.js} +1 -1
- package/dist/client/assets/{alert-DcFgIKLk.js → alert-D-emvPaG.js} +1 -1
- package/dist/client/assets/{alert-dialog-CiKfgw9r.js → alert-dialog-BE9ltHtr.js} +1 -1
- package/dist/client/assets/{api-keys-CEPWE1iS.js → api-keys-4NMR09V3.js} +1 -1
- package/dist/client/assets/api-keys-BQayHq-8.js +1 -0
- package/dist/client/assets/app-editor-DeI0TeES.js +1 -0
- package/dist/client/assets/{asset-utils-DJXdpjr9.js → asset-utils-CR65HphV.js} +1 -1
- package/dist/client/assets/{auth-ksbj4Esa.js → auth-RjDDTUUT.js} +1 -1
- package/dist/client/assets/{auth-catchall-DV5KEwZ2.js → auth-catchall-qxwSZGuB.js} +1 -1
- package/dist/client/assets/{auth-entry-Fe8qT_kq.js → auth-entry-ddblLMjc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CFJK_BXW.js → auth-split-layout-oGs_kK_4.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DMvGjBUE.js → authenticate-and-persist-oauth-DXlrPDSv.js} +1 -1
- package/dist/client/assets/{automation-list-row-CkrObNhq.js → automation-list-row-XibuWgpW.js} +1 -1
- package/dist/client/assets/{automation-runs-C-5kRp10.js → automation-runs-nZP284NC.js} +1 -1
- package/dist/client/assets/automations-CDxxuCym.js +1 -0
- package/dist/client/assets/{autosend-BzUVLyEq.js → autosend-HdosN86x.js} +1 -1
- package/dist/client/assets/{avatar-CW4PxBuN.js → avatar-DcDvs8Zz.js} +1 -1
- package/dist/client/assets/{badge-C5Ilvf_J.js → badge-DJpaBl8u.js} +1 -1
- package/dist/client/assets/{block-document-Zfk-C1Kp.js → block-document-LCYQj9PJ.js} +1 -1
- package/dist/client/assets/{breadcrumb-BajFgW5V.js → breadcrumb-BOAVRiAa.js} +1 -1
- package/dist/client/assets/{buckets-CyNocIPE.js → buckets-Ze5fok7v.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BrRLOIlw.js → build-improve-prompt-doc-Dn9xs_5X.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-e217-dmm.js → bulk-category-panel-D-Hh71MB.js} +1 -1
- package/dist/client/assets/{calendar-DGiOuDgZ.js → calendar-DTnssie4.js} +1 -1
- package/dist/client/assets/{capability-load-error-DFv8gs5U.js → capability-load-error-CJ3e1sqb.js} +1 -1
- package/dist/client/assets/{cards-XHNjVWeh.js → cards-DTFINi5r.js} +1 -1
- package/dist/client/assets/category-editor-4KcN0JRt.js +1 -0
- package/dist/client/assets/{chart-C7CmtzOp.js → chart-Jb0gHMLD.js} +1 -1
- package/dist/client/assets/{chat-context-HB_KOUNM.js → chat-context-CXknhaDs.js} +1 -1
- package/dist/client/assets/{checkbox-Dg_GkeBT.js → checkbox-D8Ab2Vb-.js} +1 -1
- package/dist/client/assets/{choose-editor-DO1mGCL1.js → choose-editor-Chy2VB_F.js} +1 -1
- package/dist/client/assets/{cli-auth-success-e-RADpiN.js → cli-auth-success-B27gos5d.js} +1 -1
- package/dist/client/assets/{client-icons-tt6oaVA2.js → client-icons-CoIMqlIz.js} +1 -1
- package/dist/client/assets/{collapsible-CycyYnXe.js → collapsible-DH_CZdwE.js} +1 -1
- package/dist/client/assets/{collection-detail-DhtfN_Wl.js → collection-detail-D8Sq0PzS.js} +1 -1
- package/dist/client/assets/{collection-display-button-BRbx9UhH.js → collection-display-button-P_aK73Om.js} +1 -1
- package/dist/client/assets/{collection-search-j4HjYlys.js → collection-search-CzGq8Uso.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-0LZ9BKlr.js → collection-table-wrapper-ChqJqpKo.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bc9QOlJ8.js → collection-tabs-BLgGMB42.js} +1 -1
- package/dist/client/assets/{command-BpjWfGyr.js → command-B6LMVdkQ.js} +1 -1
- package/dist/client/assets/{command-palette-store-D19nXDNm.js → command-palette-store-BwHku_Zt.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CdG4FfWS.js → commerce-onboarding-EmIMFBqV.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CVcicsr9.js → companion-mcps-section-BszDkkOp.js} +1 -1
- package/dist/client/assets/{connect-COU6F3Do.js → connect-CM-97gwN.js} +1 -1
- package/dist/client/assets/{connect-layout-Bl-ol5HH.js → connect-layout-C_MQVbrT.js} +1 -1
- package/dist/client/assets/{connection-By77bjvj.js → connection-OmoYXqZk.js} +1 -1
- package/dist/client/assets/{connection-card-Br8jDKgZ.js → connection-card-Cy-GdKQl.js} +1 -1
- package/dist/client/assets/{connection-detail-vVdPGlxv.js → connection-detail-CuBiFvjK.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CFXh6BoJ.js → connection-form-helpers-D3hdN_Pk.js} +1 -1
- package/dist/client/assets/{connections-BBNFmXEe.js → connections-BnO49Vti.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CRl8hry2.js → create-organization-dialog--p2RMsV5.js} +1 -1
- package/dist/client/assets/{decode-html-entities-Cf7wUEql.js → decode-html-entities-DDqE27I4.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D2Qtyl-A.js → decopilot-sse-pool-CfYFArSW.js} +1 -1
- package/dist/client/assets/{dialog-DJBpjJnY.js → dialog-otnvxVN0.js} +1 -1
- package/dist/client/assets/{discover-y7BsppSE.js → discover-BZKxvY_j.js} +1 -1
- package/dist/client/assets/{domain-settings-B_cuGCF0.js → domain-settings-QORwmdcG.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DYhv8XsJ.js → download-app-dialog-BqNRF4Sn.js} +1 -1
- package/dist/client/assets/{drawer-B5NRhNfW.js → drawer-s7gtDrb4.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DzwCPltk.js → dropdown-menu-BxKUbUkE.js} +1 -1
- package/dist/client/assets/{editor-BHnwprUT.js → editor-DCxsAs7o.js} +1 -1
- package/dist/client/assets/{empty-state-CJ95hR0w.js → empty-state-CL4F2BS4.js} +1 -1
- package/dist/client/assets/{empty-state-CXolWOTn.js → empty-state-Cz1DkYZE.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B1nPGa4h.js → extract-connection-data-CqGCTPdZ.js} +1 -1
- package/dist/client/assets/{file-explorer-Dj1zqDxa.js → file-explorer-Uvp7ogK8.js} +1 -1
- package/dist/client/assets/{file-preview-kRDXQYfi.js → file-preview-18IJQMnU.js} +1 -1
- package/dist/client/assets/{file-share-button-P5GnoZYM.js → file-share-button-Cef5f1VZ.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cg81au_Z.js → file-type-icon-DGllFDOf.js} +1 -1
- package/dist/client/assets/{folder-icon-Bey_C_xd.js → folder-icon-p8jB76CU.js} +1 -1
- package/dist/client/assets/{form-EGCuUtdG.js → form-KjPevg0A.js} +1 -1
- package/dist/client/assets/{general-BJ_Ksgnn.js → general-t-IB2WC3.js} +1 -1
- package/dist/client/assets/{github-icon-CiNkodR8.js → github-icon-D51q_6S8.js} +1 -1
- package/dist/client/assets/{home-Cmddezu3.js → home-Bhl8U_ph.js} +1 -1
- package/dist/client/assets/{hooks-Bb9SArul.js → hooks-BhviOOpn.js} +1 -1
- package/dist/client/assets/{hooks-BSkeWBV7.js → hooks-k1OxvonE.js} +1 -1
- package/dist/client/assets/{index-6GXqHE0w.js → index-B3yBTWEk.js} +4 -4
- package/dist/client/assets/{index-BVRQ9yUZ.js → index-Bwc7J041.js} +1 -1
- package/dist/client/assets/{index-CY40-aHW.js → index-C1N-CFMR.js} +1 -1
- package/dist/client/assets/{index-BaItIL-_.js → index-C7WIaN4y.js} +1 -1
- package/dist/client/assets/{index-DCQ3taiG.js → index-CRCvoACn.js} +1 -1
- package/dist/client/assets/{index-B9bOVdMd.js → index-D4YJGrDI.js} +3 -3
- package/dist/client/assets/{index-hC6VOnUm.js → index-DD-r2o4M.js} +1 -1
- package/dist/client/assets/{index-CUa7fAjf.js → index-DOk05MCp.js} +1 -1
- package/dist/client/assets/{index-B7ENeoW4.js → index-DlQKfvnq.js} +1 -1
- package/dist/client/assets/{index-Cu77hgR2.js → index-DqX9hbqM.js} +1 -1
- package/dist/client/assets/{index-Dg14Zpi9.js → index-fTs6ROSj.js} +1 -1
- package/dist/client/assets/{index-qEipD_7S.js → index-m01im2kT.js} +1 -1
- package/dist/client/assets/{index-redirect-BRL1uQPT.js → index-redirect-e7Kr1hOd.js} +1 -1
- package/dist/client/assets/{index-cEqwHhEg.js → index-w1d_dmEj.js} +1 -1
- package/dist/client/assets/{index-9FQARZdh.js → index-xVQnUsdi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C7FrFXuf.js → infiniteQueryObserver-DgAoAIrN.js} +1 -1
- package/dist/client/assets/{infra-billing-B0e93_qz.js → infra-billing-B2HwpfSN.js} +1 -1
- package/dist/client/assets/{input-D8xrvlz-.js → input-BnbYz5_9.js} +1 -1
- package/dist/client/assets/{input-BRqLi1TH.js → input-DxAgQLPa.js} +1 -1
- package/dist/client/assets/{input-TvernbmY.js → input-HFOrJf5B.js} +1 -1
- package/dist/client/assets/{integration-icon-B6H5J7sl.js → integration-icon-BPwWRlNG.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CsolElt3.js → invite-member-dialog-vPcEYe6v.js} +1 -1
- package/dist/client/assets/{label-aWEsDmHM.js → label-CqlSWrLn.js} +1 -1
- package/dist/client/assets/{layout-CAwe_kK2.js → layout-aU1eoqDA.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DJ_t0QLc.js → legacy-agents-deep-CpKjJlPs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CySqEohs.js → legacy-main-redirect-ZPChWdtD.js} +1 -1
- package/dist/client/assets/{library-DRmbr8Ht.js → library-uYIcEGdr.js} +1 -1
- package/dist/client/assets/{login-DQDbHhI7.js → login-CfxNz6kc.js} +1 -1
- package/dist/client/assets/{markdown-CBvmi8AF.js → markdown-B1038zFJ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BQ7hPzlx.js → mcp-app-renderer-Cb8Ud-E7.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DhRKpyTH.js → mcp-oauth-D6isOO_s.js} +1 -1
- package/dist/client/assets/{members-NHaXKGgP.js → members-DHLsomPg.js} +1 -1
- package/dist/client/assets/{mini-report-page-BcG9QHwQ.js → mini-report-page-iTjakIrU.js} +1 -1
- package/dist/client/assets/{monaco-editor-C5zvkMO4.js → monaco-editor-WNMTPDp9.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CWqusnLf.js → monitoring-stats-row-B_mR1zw-.js} +1 -1
- package/dist/client/assets/{multi-select-CvACpZbb.js → multi-select-D54pM3d4.js} +1 -1
- package/dist/client/assets/{mustache-DQXz9E52.js → mustache-r9snVmI4.js} +1 -1
- package/dist/client/assets/{oauth-callback-BHJTnNxG.js → oauth-callback-GAK1H0Is.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-wF0_7wc5.js → oauth-callback-ai-provider-sdaHeEFx.js} +1 -1
- package/dist/client/assets/{onboarding-20FUHLvO.js → onboarding-BKPW4du6.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DKtRXqQ0.js → optimistic-project-sidebar-views-yrtk59Mo.js} +1 -1
- package/dist/client/assets/{org-layout-DRrVivAL.js → org-layout-BNIg984j.js} +1 -1
- package/dist/client/assets/{organization-choice-BmSYuBSE.js → organization-choice-DvXG7tgx.js} +1 -1
- package/dist/client/assets/{orgs-1ZlqeM-y.js → orgs-NTyzCYi-.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cpi2Oike.js → page-seo-form-DAkbVQPg.js} +1 -1
- package/dist/client/assets/{pair-CD8Vxcvs.js → pair-C08OPQNP.js} +1 -1
- package/dist/client/assets/{popover-Ci-k968-.js → popover-DIqZ2IKF.js} +1 -1
- package/dist/client/assets/{post-calendar-CgTLYrrU.js → post-calendar-DuH_hA9y.js} +1 -1
- package/dist/client/assets/{post-editor-DyayPm7u.js → post-editor-BAf6FqSQ.js} +1 -1
- package/dist/client/assets/{preview-content-DhEgigNG.js → preview-content-B5xB74fu.js} +1 -1
- package/dist/client/assets/{preview-dialog-CKWnRekk.js → preview-dialog-b2QyOGzU.js} +1 -1
- package/dist/client/assets/{primitives-1lR28duD.js → primitives-4_D03rJK.js} +1 -1
- package/dist/client/assets/{profile-DixSbE4L.js → profile-COT-hKKD.js} +1 -1
- package/dist/client/assets/{project-app-view-DBHiU3Rg.js → project-app-view-DJ_q7UHg.js} +1 -1
- package/dist/client/assets/{project-feed-boKgu_TR.js → project-feed-DJ_jJM3E.js} +1 -1
- package/dist/client/assets/{project-icon-DIXBuD-A.js → project-icon-Bl3bXnhv.js} +1 -1
- package/dist/client/assets/project-reports-q4w3pT5T.js +1 -0
- package/dist/client/assets/project-tasks-DqlAyIfE.js +1 -0
- package/dist/client/assets/{prompts-BROxvafI.js → prompts-CI44HEcf.js} +1 -1
- package/dist/client/assets/record-editor-n0M7yiQw.js +1 -0
- package/dist/client/assets/redirect-editor-CK3YSOdb.js +1 -0
- package/dist/client/assets/registry-DkzCUqTc.js +2 -0
- package/dist/client/assets/{registry-layout-BUEF9YqP.js → registry-layout-CvRfdld3.js} +1 -1
- package/dist/client/assets/{reports-B1C9NU2m.js → reports-C-eaYxW3.js} +1 -1
- package/dist/client/assets/reports-C2LVTrmJ.js +1 -0
- package/dist/client/assets/{reports-tab-uLMivl2p.js → reports-tab-qffeKlGd.js} +2 -2
- package/dist/client/assets/repositories-ao250fUH.js +1 -0
- package/dist/client/assets/{repository-import-picker-DVnadPZ8.js → repository-import-picker-Bg_h8YsG.js} +1 -1
- package/dist/client/assets/repository-picker-BDWGy2xY.js +1 -0
- package/dist/client/assets/{require-capability-DSFKKTc-.js → require-capability-CmR_46yt.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DMNBbcf3.js → required-auth-layout-BEc3NUsQ.js} +1 -1
- package/dist/client/assets/{reset-password-GCDcBOjo.js → reset-password-BlF157J6.js} +1 -1
- package/dist/client/assets/{review-settings-VwYzzjCc.js → review-settings-BBciVvfB.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-C6A8Q9Jd.js → rich-text-link-control-CrwbAR31.js} +1 -1
- package/dist/client/assets/{roles-PgEO9KN-.js → roles-CuHUTdKb.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Db2XbJYi.js → runnable-block-editor-2CMWc-S3.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DxbfUbxP.js → sandbox-lifecycle-context-CXd9Um8u.js} +1 -1
- package/dist/client/assets/{schema-Cnskrzk1.js → schema-BQbhQoxs.js} +1 -1
- package/dist/client/assets/{scroll-area-CaE3a4_T.js → scroll-area-BgZjjLM3.js} +1 -1
- package/dist/client/assets/{search-input-lFP9sD3O.js → search-input-uXtJ6IU8.js} +1 -1
- package/dist/client/assets/{secrets-BU_daRxy.js → secrets-C1mCKV1g.js} +1 -1
- package/dist/client/assets/{sections-editor-D-W8vM7g.js → sections-editor-Bv2odcBq.js} +1 -1
- package/dist/client/assets/{select-Ce9NznPv.js → select-Bc5UZb4n.js} +1 -1
- package/dist/client/assets/{select-model-CjTijsS7.js → select-model-BDGEzt-Y.js} +1 -1
- package/dist/client/assets/{seo-editor-O94He1NF.js → seo-editor-DJw3ydvJ.js} +1 -1
- package/dist/client/assets/settings-layout-DlH0gQXK.js +1 -0
- package/dist/client/assets/{settings-sidebar-BcAe-WS4.js → settings-sidebar-DswZBMwm.js} +1 -1
- package/dist/client/assets/{settings-tab-Cg5CqTki.js → settings-tab-Ru2atFmZ.js} +1 -1
- package/dist/client/assets/{shell-controls-gkZZS07l.js → shell-controls-DkLEUvEw.js} +1 -1
- package/dist/client/assets/{shell-layout-C3IRibnI.js → shell-layout-1dFmVwYI.js} +1 -1
- package/dist/client/assets/{skill-preview-MIddvDZe.js → skill-preview-CGe8kUoa.js} +1 -1
- package/dist/client/assets/{skills-hRnVKZ5K.js → skills-BGdKR-aF.js} +1 -1
- package/dist/client/assets/{sso-BePH_NId.js → sso-M-OsbEtw.js} +1 -1
- package/dist/client/assets/{store-CqeIEwHN.js → store-BY4ZRY7y.js} +1 -1
- package/dist/client/assets/store-registry-DQHLJpOA.js +2 -0
- package/dist/client/assets/{switch-D5GcuD9Z.js → switch-CJ5Ir2Zx.js} +1 -1
- package/dist/client/assets/{synced-repos-Cnp4m7yg.js → synced-repos-9D-CfhL7.js} +1 -1
- package/dist/client/assets/{table-O0SpY8ZO.js → table-Di_WRNkb.js} +1 -1
- package/dist/client/assets/{tabs-DQoXHeZr.js → tabs-DV8akPGb.js} +1 -1
- package/dist/client/assets/{task-board-DyZE7mH1.js → task-board-CXsHf2Zn.js} +1 -1
- package/dist/client/assets/{task-route-CayeX6cv.js → task-route-D79aS9d_.js} +1 -1
- package/dist/client/assets/{task-status-CyTozLxL.js → task-status-DIr_2V94.js} +1 -1
- package/dist/client/assets/tasks-C6DyE2q-.js +1 -0
- package/dist/client/assets/{tasks-Da-h-zLm.js → tasks-CiIHA5f1.js} +1 -1
- package/dist/client/assets/{textarea-BpFOmm9_.js → textarea-CneoU2lJ.js} +1 -1
- package/dist/client/assets/{thread-intent-AJKohiRy.js → thread-intent-DVKldCEq.js} +1 -1
- package/dist/client/assets/{thread-route-CEvVLI2K.js → thread-route-CKY-dKC0.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Bs4b4fMK.js → thread-sheet-body-CcUGPZXB.js} +1 -1
- package/dist/client/assets/{toggle-group-Cs1yIHkK.js → toggle-group-9HQCpj-q.js} +1 -1
- package/dist/client/assets/{tool-namespace-ySa3S1AM.js → tool-namespace-BVMQcKlk.js} +1 -1
- package/dist/client/assets/{toolbar-DOOz2W24.js → toolbar-D0oe2g2b.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Dp-AbzNZ.js → toolbar-icon-button-EOE8J-Ai.js} +1 -1
- package/dist/client/assets/{track-Dns1NpdC.js → track-BzMi8kcZ.js} +1 -1
- package/dist/client/assets/{types-C1gRrnQe.js → types-Csu6Ims7.js} +1 -1
- package/dist/client/assets/{usage-stats-D5mXC24B.js → usage-stats-BNse37Wk.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bg_y9f3x.js → use-ai-providers-qnkcjapR.js} +1 -1
- package/dist/client/assets/{use-automations-BI_yIok-.js → use-automations-CYOC_eS5.js} +1 -1
- package/dist/client/assets/{use-autosave-BB0U2eiK.js → use-autosave-CCprSQ13.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-DqKipeip.js → use-commerce-diagnostic-mdvL2BW-.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Mci4Y6hu.js → use-connect-companion-2fL060lG.js} +1 -1
- package/dist/client/assets/{use-connection-DCUpGmsb.js → use-connection-DCLPda2h.js} +1 -1
- package/dist/client/assets/{use-copy-GVBAvo9n.js → use-copy-14DzRp8J.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CizXpVyQ.js → use-create-virtual-mcp-DoCSQs95.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CcPpBz8y.js → use-date-fns-locale-DYzMvrWB.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-wCEzYUZh.js → use-debounced-autosave-BRAVEUZc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D0SYNQsR.js → use-debounced-value-Cud3o3Fq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DjxZxHMq.js → use-deco-credits-rwNQ1gMg.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-zpeu2MCG.js → use-decopilot-events-DYRVevWg.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B-DNpbCU.js → use-delete-connection-ueGIYWMK.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Dpkh4HgH.js → use-deployment-admin-D6IzoXV0.js} +1 -1
- package/dist/client/assets/{use-file-configs-B1FdrMZJ.js → use-file-configs-BwD1CaWo.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BXOEU8Y7.js → use-infinite-scroll-DkLPxlOu.js} +1 -1
- package/dist/client/assets/{use-join-requests-1Ow065Yq.js → use-join-requests-DTGTfD21.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CeyJWpQP.js → use-main-panel-tabs-EW6rbxam.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CSQiZCDG.js → use-mcp-auth-status-CPh3Lmzs.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bq-mjhw3.js → use-mcp-client-DsJzBus3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CWmeNLXn.js → use-mcp-prompts-i0LZ2nQA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DGdyHn8U.js → use-mcp-tools-Dc3F6Krl.js} +1 -1
- package/dist/client/assets/{use-members-Dnee1tF2.js → use-members-C0MdJrYz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Drdqs1cr.js → use-navigate-to-agent-Bbq0oQ0Y.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Cju1isPI.js → use-open-billing-url-DvTk9GH0.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CVFBkaiI.js → use-org-auth-client-4o0wRx2Q.js} +1 -1
- package/dist/client/assets/{use-org-fs-DG1oJieK.js → use-org-fs-BEoPvlnI.js} +1 -1
- package/dist/client/assets/{use-org-notice-PUfO84YR.js → use-org-notice-CXYMfMUq.js} +1 -1
- package/dist/client/assets/{use-org-sso-uleG21Aq.js → use-org-sso-CdSz0xa8.js} +1 -1
- package/dist/client/assets/{use-organization-roles-yO3kgQbK.js → use-organization-roles-DzWM9Nv-.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrJN-E78.js → use-organization-settings-BAVHurZk.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CCqZdv2O.js → use-panel-navigate-Byvx0cbx.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-01L5j4lu.js → use-project-native-view-presence-D-AyEulW.js} +1 -1
- package/dist/client/assets/{use-project-scope-DZ9tacAx.js → use-project-scope-B2cuvtTy.js} +1 -1
- package/dist/client/assets/{use-registry-connections-cro5WL6A.js → use-registry-connections-DikbDR8w.js} +1 -1
- package/dist/client/assets/{use-secrets-w6G8jtp4.js → use-secrets-D-c1ciPZ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-lro_p1nx.js → use-section-preview-base-CwIWGkgy.js} +1 -1
- package/dist/client/assets/{use-session-runtime-TS34dEJv.js → use-session-runtime-BHahDP0E.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DQ2pMmh0.js → use-status-sounds-CnCb1h48.js} +1 -1
- package/dist/client/assets/{use-tags-B6zE47mm.js → use-tags-C2LhenRb.js} +1 -1
- package/dist/client/assets/{use-task-metadata-C4MfiHBQ.js → use-task-metadata-CB3EJ29f.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CpCqTMOi.js → use-thread-outputs-9oZhiYbB.js} +1 -1
- package/dist/client/assets/{use-view-mode-B9wUn2ad.js → use-view-mode-BvOL5I4W.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CMlCV8Oj.js → use-virtual-mcp-Bk09OpEg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-GKCP1c_7.js +1 -0
- package/dist/client/assets/{useQueries-C6OAJOs7.js → useQueries-qr8TAkZc.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DmEiIBI4.js +1 -0
- package/dist/client/assets/{users-CYflDdFv.js → users-C1ExMDuM.js} +1 -1
- package/dist/client/assets/{utils-B-5U5Z26.js → utils-B14U8IKK.js} +1 -1
- package/dist/client/assets/{variant-calendar-BsFwTl3D.js → variant-calendar-urd0wE-3.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CRlEf4IL.js → variant-matcher-override-DvY-JiuY.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-kY4gR8CN.js → view-mode-toggle-swSorpD7.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CKi1xJsO.js → virtual-mcp-DGQbDtgM.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +678 -668
- package/dist/server/migrate.js +171 -161
- package/dist/server/server.js +418 -418
- package/package.json +1 -1
- package/dist/client/assets/agent-app-62cavSHy.js +0 -1
- package/dist/client/assets/agent-deck-DVW32bsA.js +0 -1
- package/dist/client/assets/agent-file-C7nywZCe.js +0 -1
- package/dist/client/assets/agent-library-file-D4p-8dXS.js +0 -1
- package/dist/client/assets/agent-settings-CxGAsqqN.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dcgjtfwk.js +0 -2
- package/dist/client/assets/agent-view-DYYYDEW_.js +0 -1
- package/dist/client/assets/api-keys-DoGNEUpY.js +0 -1
- package/dist/client/assets/app-editor-CRjlYU-M.js +0 -1
- package/dist/client/assets/automations-CKhgbURI.js +0 -1
- package/dist/client/assets/category-editor-zLRtagcy.js +0 -1
- package/dist/client/assets/project-reports-ChLta7_v.js +0 -1
- package/dist/client/assets/project-tasks-nUWazd1g.js +0 -1
- package/dist/client/assets/record-editor-FqHaN2k4.js +0 -1
- package/dist/client/assets/redirect-editor-CWYZom_C.js +0 -1
- package/dist/client/assets/registry-C3_EEMj-.js +0 -2
- package/dist/client/assets/reports-BY7Ca1Ey.js +0 -1
- package/dist/client/assets/repositories-BgD13VwL.js +0 -1
- package/dist/client/assets/repository-picker-BGpoa_g_.js +0 -1
- package/dist/client/assets/settings-layout-CWQI71Tg.js +0 -1
- package/dist/client/assets/store-registry-BCokMLik.js +0 -2
- package/dist/client/assets/tasks-DGTMeQBa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CM35R0yt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DWyGwvh9.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-
|
|
2
|
-
import{c as Ce,j as s,m as As,K as Bs,b as Be,l as _e,r as U,h as Qe,B as Oe,a6 as Ie,a7 as Me,a9 as ze,t as Se,ap as Jt,I as An,u as $s,an as Fe}from"./index-6GXqHE0w.js";import{A as Bn}from"./agent-view-guard-DomQyuot.js";import{b as Et,a as Ls}from"./chat-context-HB_KOUNM.js";import{i as Os}from"./AlertCircle-CgERhdh6.js";import{o as jt,v as Rs,w as Fs,x as Ks,y as $n,z as Ln,B as Is,C as On,h as It,D as Rn,E as Fn,F as Kn,G as Ms,H as In,I as Mn,J as zn}from"./agent-icon-vDfwuZu4.js";import{i as Mt}from"./File02-CceuR6rF.js";import{c as zs}from"./SwitchHorizontal01-BIyO34Jw.js";import{s as Vn}from"./Plus-DaErdsG1.js";import{i as Vs}from"./SearchLg-DxQfk550.js";import{t as Us}from"./Users01-BCRhQsCX.js";import{A as Un,a as Hn,b as Gn,c as Jn,d as Wn,e as Yn,f as qn,g as Qn}from"./alert-dialog-CiKfgw9r.js";import{S as Dt}from"./scroll-area-CaE3a4_T.js";import{z as Wt,S as Xn,A as Yt,B as Zn,C as eo,E as to,n as Ct,v as so,F as Hs,G as qt,c as Qt,H as no,I as oo,e as rs,J as lo,g as ao,K as io,L as cs,h as ro,O as co,P as uo}from"./index-CUa7fAjf.js";import{S as $t,j as mo,c as fo,g as Gs,B as Lt,P as po,k as ho,n as go,o as xo,u as Js,l as bo,q as yo,R as vo,s as Ws,r as So,t as ko,d as Ys,v as jo,w as qs,x as Qs,y as Co,M as wo,h as No,p as Po,z as To,A as _o,e as Eo,f as Do,C as ds,D as Xs,i as Ao,E as Bo}from"./runnable-block-editor-Db2XbJYi.js";import{u as $o,P as Lo}from"./mustache-DQXz9E52.js";import{t as Xt}from"./ChevronUp-CbF1Gmeo.js";import{s as Zs}from"./Database01-zcGUPFsG.js";import{i as en}from"./Zap-C5eiFR0N.js";import{C as Oo,a as Ro,b as Fo}from"./collapsible-CycyYnXe.js";import{u as Ko,a as Io}from"./sandbox-lifecycle-context-DxbfUbxP.js";import{u as Mo}from"./use-session-runtime-TS34dEJv.js";import{c as Zt,d as es,e as ts,b as ss,D as ns,h as zo}from"./dialog-DJBpjJnY.js";import{I as rt}from"./input-TvernbmY.js";import{C as os}from"./checkbox-Dg_GkeBT.js";import{L as Ot}from"./label-aWEsDmHM.js";import{c as Vo,b as Uo,a as Ho,d as Go,S as Jo}from"./select-Ce9NznPv.js";import{a as tn}from"./use-virtual-mcp-CMlCV8Oj.js";import{i as Nt}from"./ChevronRight-BNfU55ld.js";import{i as us}from"./Share07-D1Sv14jA.js";import{i as Wo}from"./Globe01-BVji6jXS.js";import{c as Yo,b as qo,s as Qo}from"./TrendUp01-DIz6JZwT.js";import"./rich-text-link-control-C6A8Q9Jd.js";import{M as Xo}from"./monaco-editor-C5zvkMO4.js";import{s as sn}from"./Trash01-DQjprOwc.js";import{d as bt,f as pt,D as zt,e as ms,b as Vt,c as Ut,a as lt,g as Rt}from"./dropdown-menu-DzwCPltk.js";import{a as Zo}from"./Copy01-DiITYBuR.js";import{i as el}from"./Tool01-D6HOM_aJ.js";import{b as fs}from"./use-project-scope-DZ9tacAx.js";import{E as tl}from"./empty-state-CXolWOTn.js";import{G as ps}from"./github-icon-CiNkodR8.js";import{R as sl}from"./repository-import-picker-DVnadPZ8.js";import{a as nl}from"./thread-route-CEvVLI2K.js";function ol(t,e){if(!t||!e?.length)return t;const n=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(n).length>0?{...t,properties:n}:t}function ll(t,e,n){return typeof t!="string"?null:ol(Wt(t,e),n)}function nn(t,e,n){if(!e||typeof t!="string")return!1;const o=ll(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=Ce.c(6),{hasItems:n,emptyLabel:o,emptyHint:c}=t;let l;e[0]!==c||e[1]!==o||e[2]!==n?(l=n?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:c})]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function At(t,e){return`${t}-${e}`}function on(t,e){return`site/apps/${t}/${e}.ts`}function ln(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const n=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return n?{vendor:n[1],app:n[2]}:null}function al(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function il(t){return t==="local"?"Custom":"Installed"}function an(t,e,n){const o=new Set([At(t,e),e].map(l=>l.toLowerCase())),c=on(t,e);for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===c)return l}return null}function rl(t,e){const n=t.vendor.alias,o=t.name,c=an(n,o,e);return{id:At(n,o),app:o,vendor:n,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:on(n,o),blockKey:c,installed:c!==null}}function cl(t,e,n){if(t===Xn)return null;const o=ln(t);if(!o)return null;const{vendor:c,app:l}=o,i=an(c,l,n),r=Yt(t,e);return{id:At(c,l),app:l,vendor:c,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:i,installed:i!==null}}function dl(t,e,n){const o=e.__resolveType;if(typeof o!="string"||Zn(t,e)||!eo(o))return null;const c=ln(o)??al(t);if(!c)return null;const l=Yt(o,n),{vendor:i,app:r}=c;return{id:At(i,r),app:r,vendor:i,title:l.title??to(t,e,n),description:l.description??"",category:il(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function ul(t,e,n){const o=new Map;for(const l of t){const i=rl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=cl(l,e,n);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=dl(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(ml)}function ml(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function fl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function pl(t,e,n){const o=Ce.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Bs.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:fl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=As(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?ul(r.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=r.data,o[6]=a):a=o[6];const u=a,x=r.isLoading&&!r.isError;let d;return o[7]!==u||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==x?(d={catalog:u,isLoading:x,isError:r.isError,refetch:r.refetch},o[7]=u,o[8]=r.isError,o[9]=r.refetch,o[10]=x,o[11]=d):d=o[11],d}const hl=["sections","apps","loaders","actions"];function gl(t){const e=Ce.c(59),{active:n,counts:o,showBlog:c,onSelect:l}=t,i=Be();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==r?(a=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=u):u=e[5];const x=n==="pages";let d;e[6]!==o.pages||e[7]!==l||e[8]!==u||e[9]!==x?(d=s.jsx(Le,{id:"pages",icon:jt,label:u,count:o.pages,active:x,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=u,e[9]=x,e[10]=d):d=e[10];let g;e[11]!==i?(g=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=g):g=e[12];const f=n==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==g||e[16]!==f?(p=s.jsx(Le,{id:"redirects",icon:Rs,label:g,count:o.redirects,active:f,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=g,e[16]=f,e[17]=p):p=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const h=n==="site";let v;e[20]!==l||e[21]!==h||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:Ln,label:y,active:h,onSelect:l}),e[20]=l,e[21]=h,e[22]=y,e[23]=v):v=e[23];let S;e[24]!==i?(S=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=S):S=e[25];const k=n==="seo";let w;e[26]!==l||e[27]!==S||e[28]!==k?(w=s.jsx(Le,{id:"seo",icon:Is,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=w):w=e[29];let j;e[30]!==i?(j=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=j):j=e[31];const M=n==="calendar";let z;e[32]!==l||e[33]!==j||e[34]!==M?(z=s.jsx(Le,{id:"calendar",icon:On,label:j,active:M,onSelect:l}),e[32]=l,e[33]=j,e[34]=M,e[35]=z):z=e[35];let C;e[36]!==n||e[37]!==o||e[38]!==l?(C=s.jsx(xl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=C):C=e[39];let I;e[40]!==n||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==c||e[46]!==i?(I=c&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Fs,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Le,{id:"posts",icon:Mt,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:n==="posts",onSelect:l}),s.jsx(Le,{id:"authors",icon:Us,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Ks,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:$n,label:i("sandbox.collectionsSidebar.postSchedule"),active:n==="post-schedule",onSelect:l})]}),e[40]=n,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=c,e[46]=i,e[47]=I):I=e[47];let B;e[48]!==v||e[49]!==w||e[50]!==z||e[51]!==C||e[52]!==I||e[53]!==d||e[54]!==p?(B=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,p,v,w,z,C,I]}),e[48]=v,e[49]=w,e[50]=z,e[51]=C,e[52]=I,e[53]=d,e[54]=p,e[55]=B):B=e[55];let O;return e[56]!==a||e[57]!==B?(O=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,B]}),e[56]=a,e[57]=B,e[58]=O):O=e[58],O}function xl(t){const e=Ce.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=hl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=U.useState(!1),x=a||r;let d,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=_e("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),g=s.jsx(Rn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=g):(d=e[2],g=e[3]);let f;e[4]!==l?(f=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==f?(p=s.jsx("span",{className:"flex-1 truncate",children:f}),e[6]=f,e[7]=p):p=e[7];const y=x&&"rotate-180";let h;e[8]!==y?(h=_e("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=h):h=e[9];let v;e[10]!==h?(v=s.jsx(Xt,{size:16,className:h}),e[10]=h,e[11]=v):v=e[11];let S;e[12]!==p||e[13]!==v?(S=s.jsxs(Oo,{className:d,children:[g,p,v]}),e[12]=p,e[13]=v,e[14]=S):S=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const w=n==="sections";let j;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==w?(j=s.jsx(Le,{id:"sections",icon:It,label:k,count:o.sections,active:w,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=w,e[21]=j):j=e[21];let M;e[22]!==l?(M=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=M):M=e[23];const z=n==="apps";let C;e[24]!==o.apps||e[25]!==c||e[26]!==M||e[27]!==z?(C=s.jsx(Le,{id:"apps",icon:zs,label:M,count:o.apps,active:z,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=M,e[27]=z,e[28]=C):C=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const B=n==="loaders";let O;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==B?(O=s.jsx(Le,{id:"loaders",icon:Zs,label:I,count:o.loaders,active:B,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=B,e[35]=O):O=e[35];let _;e[36]!==l?(_=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=_):_=e[37];const H=n==="actions";let R;e[38]!==o.actions||e[39]!==c||e[40]!==_||e[41]!==H?(R=s.jsx(Le,{id:"actions",icon:en,label:_,count:o.actions,active:H,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=_,e[41]=H,e[42]=R):R=e[42];let F;e[43]!==j||e[44]!==C||e[45]!==O||e[46]!==R?(F=s.jsxs(Ro,{className:"flex flex-col gap-0.5 pt-0.5",children:[j,C,O,R]}),e[43]=j,e[44]=C,e[45]=O,e[46]=R,e[47]=F):F=e[47];let K;return e[48]!==x||e[49]!==F||e[50]!==S?(K=s.jsxs(Fo,{open:x,onOpenChange:u,children:[S,F]}),e[48]=x,e[49]=F,e[50]=S,e[51]=K):K=e[51],K}function Le(t){const e=Ce.c(19),{id:n,icon:o,label:c,count:l,active:i,onSelect:r,indent:a}=t;let u;e[0]!==n||e[1]!==r?(u=()=>r(n),e[0]=n,e[1]=r,e[2]=u):u=e[2];const x=a&&"pl-6",d=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let g;e[3]!==x||e[4]!==d?(g=_e("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",x,d),e[3]=x,e[4]=d,e[5]=g):g=e[5];let f;e[6]!==o?(f=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==c?(p=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=p):p=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:_e("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=y):y=e[12];let h;return e[13]!==u||e[14]!==g||e[15]!==f||e[16]!==p||e[17]!==y?(h=s.jsxs("button",{type:"button",onClick:u,className:g,children:[f,p,y]}),e[13]=u,e[14]=g,e[15]=f,e[16]=p,e[17]=y,e[18]=h):h=e[18],h}function bl(t){const e=Ce.c(12),{state:n,claimPhase:o,lifecycle:c,onStart:l,connectionsHref:i}=t;switch(n.kind){case"starting":{let r;e[0]!==o||e[1]!==c?(r=mo({claimPhase:o,lifecycle:c}),e[0]=o,e[1]=c,e[2]=r):r=e[2];let a;return e[3]!==o||e[4]!==r?(a=s.jsx($t,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=a):a=e[5],a}case"suspended":{let r;return e[6]!==l?(r=s.jsx($t,{kind:"suspended",onResume:l}),e[6]=l,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==i||e[9]!==l||e[10]!==n.error?(r=s.jsx($t,{kind:"errored",error:n.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=n.error,e[11]=r):r=e[11],r}}}const yl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function vl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",n=!e&&!yl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function hs(t,e){const n=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${n} (copy)`;if(!t.has(o))return o;for(let c=2;c<1e3;c++){const l=`${n} (copy ${c})`;if(!t.has(l))return l}return`${n} (copy ${Date.now()})`}function Sl(t,e){const n=Ct,o=e.replace(/-copy(?:-\d+)?$/,""),c=`${o}-copy`;if(!t.has(n(c)))return c;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(n(i)))return i}return`${o}-copy-${Date.now()}`}function kl(t,e){const n=e.replace(/_copy(?:_\d+)?$/,""),o=`${n}_copy`;if(!Object.hasOwn(t,o))return o;for(let c=2;c<1e3;c++){const l=`${n}_copy_${c}`;if(!Object.hasOwn(t,l))return l}return`${n}_copy_${Date.now()}`}function jl(t){const e=Gs(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function Cl(t,e){return fo(t,e)}const wl=1e3;function Nl(t,e){for(let n=0;n<wl;n++){const o=Gs(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Pl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Tl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},_l={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function El(t){const e=Ce.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,g=i===void 0?!1:i,f=Be(),[p,y]=U.useState(c),[h,v]=U.useState(l),[S,k]=U.useState(Lt),[w,j]=U.useState(null),[M,z]=U.useState(n);n!==M&&(z(n),n&&(y(c),v(l),k(Lt),j(null)));const C=o==="create"&&!!a?.length;let I;e[0]!==g||e[1]!==d?(I=he=>{!he&&!g&&(j(null),d(!1))},e[0]=g,e[1]=d,e[2]=I):I=e[2];const B=I;let O;e[3]!==g||e[4]!==p||e[5]!==x||e[6]!==h||e[7]!==C||e[8]!==S||e[9]!==u?(O=async he=>{he.preventDefault();const ge=p.trim(),ye=h.trim();if(!ge||!ye||g)return;const ie=so(ye);if(ie){j(ie);return}const de=u?.({name:ge,path:ye});if(de){j(de);return}j(null),await x({name:ge,path:ye,templateKey:C&&S!==Lt?S:null})},e[3]=g,e[4]=p,e[5]=x,e[6]=h,e[7]=C,e[8]=S,e[9]=u,e[10]=O):O=e[10];const _=O,H=w??r,R=Pl[o];let F;e[11]!==f||e[12]!==R?(F=f(R),e[11]=f,e[12]=R,e[13]=F):F=e[13];let K;e[14]!==F?(K=s.jsx(Zt,{children:s.jsx(es,{children:F})}),e[14]=F,e[15]=K):K=e[15];let V;e[16]!==g||e[17]!==C||e[18]!==f||e[19]!==S||e[20]!==a?(V=C&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:f("sandbox.pageFormDialog.labelTemplate")}),s.jsx(po,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:g})]}),e[16]=g,e[17]=C,e[18]=f,e[19]=S,e[20]=a,e[21]=V):V=e[21];let D;e[22]!==f?(D=f("sandbox.pageFormDialog.labelName"),e[22]=f,e[23]=D):D=e[23];let A;e[24]!==D?(A=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:D}),e[24]=D,e[25]=A):A=e[25];let J;e[26]===Symbol.for("react.memo_cache_sentinel")?(J=he=>y(he.target.value),e[26]=J):J=e[26];let G;e[27]!==f?(G=f("sandbox.pageFormDialog.placeholderName"),e[27]=f,e[28]=G):G=e[28];let W;e[29]!==g||e[30]!==p||e[31]!==G?(W=s.jsx(rt,{id:"page-form-name",value:p,onChange:J,placeholder:G,autoFocus:!0,disabled:g}),e[29]=g,e[30]=p,e[31]=G,e[32]=W):W=e[32];let Z;e[33]!==W||e[34]!==A?(Z=s.jsxs("div",{className:"space-y-1.5",children:[A,W]}),e[33]=W,e[34]=A,e[35]=Z):Z=e[35];let Y;e[36]!==f?(Y=f("sandbox.pageFormDialog.labelPath"),e[36]=f,e[37]=Y):Y=e[37];let $;e[38]!==Y?($=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:Y}),e[38]=Y,e[39]=$):$=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=he=>v(he.target.value),e[40]=ee):ee=e[40];let ue;e[41]!==f?(ue=f("sandbox.pageFormDialog.placeholderPath"),e[41]=f,e[42]=ue):ue=e[42];let oe;e[43]!==g||e[44]!==h||e[45]!==ue?(oe=s.jsx(rt,{id:"page-form-path",value:h,onChange:ee,placeholder:ue,disabled:g}),e[43]=g,e[44]=h,e[45]=ue,e[46]=oe):oe=e[46];let te;e[47]!==$||e[48]!==oe?(te=s.jsxs("div",{className:"space-y-1.5",children:[$,oe]}),e[47]=$,e[48]=oe,e[49]=te):te=e[49];let se;e[50]!==H?(se=H&&s.jsx("p",{className:"text-xs text-destructive",children:H}),e[50]=H,e[51]=se):se=e[51];let le;e[52]!==Z||e[53]!==te||e[54]!==se||e[55]!==V?(le=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Z,te,se]}),e[52]=Z,e[53]=te,e[54]=se,e[55]=V,e[56]=le):le=e[56];let E;e[57]!==d?(E=()=>d(!1),e[57]=d,e[58]=E):E=e[58];let ne;e[59]!==f?(ne=f("sandbox.pageFormDialog.buttonCancel"),e[59]=f,e[60]=ne):ne=e[60];let X;e[61]!==g||e[62]!==E||e[63]!==ne?(X=s.jsx(Oe,{type:"button",variant:"outline",onClick:E,disabled:g,children:ne}),e[61]=g,e[62]=E,e[63]=ne,e[64]=X):X=e[64];let ae;e[65]!==g||e[66]!==p||e[67]!==h?(ae=!p.trim()||!h.trim()||g,e[65]=g,e[66]=p,e[67]=h,e[68]=ae):ae=e[68];let ce;e[69]!==g||e[70]!==o||e[71]!==f?(ce=g?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),f(_l[o])]}):f(Tl[o]),e[69]=g,e[70]=o,e[71]=f,e[72]=ce):ce=e[72];let L;e[73]!==ae||e[74]!==ce?(L=s.jsx(Oe,{type:"submit",disabled:ae,children:ce}),e[73]=ae,e[74]=ce,e[75]=L):L=e[75];let me;e[76]!==X||e[77]!==L?(me=s.jsxs(ts,{children:[X,L]}),e[76]=X,e[77]=L,e[78]=me):me=e[78];let T;e[79]!==_||e[80]!==le||e[81]!==me||e[82]!==K?(T=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:_,children:[K,le,me]})}),e[79]=_,e[80]=le,e[81]=me,e[82]=K,e[83]=T):T=e[83];let pe;return e[84]!==B||e[85]!==n||e[86]!==T?(pe=s.jsx(ns,{open:n,onOpenChange:B,children:T}),e[84]=B,e[85]=n,e[86]=T,e[87]=pe):pe=e[87],pe}const Dl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],gs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Al(t){const e=Ce.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=U.useState(gs),[d,g]=U.useState(null),[f,p]=U.useState(n);n!==f&&(p(n),n&&(x(gs),g(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=be=>x(De=>({...De,...be})),e[0]=y):y=e[0];const h=y;let v;e[1]!==r||e[2]!==i?(v=be=>{!be&&!r&&(g(null),i(!1))},e[1]=r,e[2]=i,e[3]=v):v=e[3];const S=v;let k;e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==a?(k=async be=>{be.preventDefault();const De=u.from.trim(),$e=u.to.trim();if(!De||!$e||r){g(a("sandbox.redirectFormDialog.errorRequired"));return}g(null),await l({...u,from:De,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const w=k,j=d??c;let M;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(M=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=M):M=e[12];const z=M;let C;e[13]!==a?(C=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=C):C=e[14];let I;e[15]!==C?(I=s.jsx(Zt,{children:s.jsx(es,{children:C})}),e[15]=C,e[16]=I):I=e[16];let B;e[17]!==a?(B=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=B):B=e[18];let O;e[19]!==B?(O=s.jsx(Ot,{htmlFor:"redirect-form-from",children:B}),e[19]=B,e[20]=O):O=e[20];const _=u.from;let H;e[21]===Symbol.for("react.memo_cache_sentinel")?(H=be=>h({from:be.target.value}),e[21]=H):H=e[21];let R;e[22]!==a?(R=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=R):R=e[23];let F;e[24]!==r||e[25]!==u.from||e[26]!==R?(F=s.jsx(rt,{id:"redirect-form-from",value:_,onChange:H,placeholder:R,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=R,e[27]=F):F=e[27];let K;e[28]!==F||e[29]!==O?(K=s.jsxs("div",{className:"space-y-1.5",children:[O,F]}),e[28]=F,e[29]=O,e[30]=K):K=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let D;e[33]!==V?(D=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=D):D=e[34];const A=u.to;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=be=>h({to:be.target.value}),e[35]=J):J=e[35];let G;e[36]!==a?(G=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=G):G=e[37];let W;e[38]!==r||e[39]!==u.to||e[40]!==G?(W=s.jsx(rt,{id:"redirect-form-to",value:A,onChange:J,placeholder:G,disabled:r}),e[38]=r,e[39]=u.to,e[40]=G,e[41]=W):W=e[41];let Z;e[42]!==D||e[43]!==W?(Z=s.jsxs("div",{className:"space-y-1.5",children:[D,W]}),e[42]=D,e[43]=W,e[44]=Z):Z=e[44];let Y;e[45]!==a?(Y=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=Y):Y=e[46];let $;e[47]!==Y?($=s.jsx(Ot,{htmlFor:"redirect-form-type",children:Y}),e[47]=Y,e[48]=$):$=e[48];const ee=u.type;let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=be=>h({type:be}),e[49]=ue):ue=e[49];let oe;e[50]!==a?(oe=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=oe):oe=e[51];let te;e[52]!==oe?(te=s.jsx(Uo,{id:"redirect-form-type",className:"w-full",children:s.jsx(Ho,{placeholder:oe})}),e[52]=oe,e[53]=te):te=e[53];let se;e[54]!==a?(se=Dl.map(be=>s.jsx(Vo,{value:be.value,children:a(be.labelKey,{status:Hs[be.value]})},be.value)),e[54]=a,e[55]=se):se=e[55];let le;e[56]!==se?(le=s.jsx(Go,{children:se}),e[56]=se,e[57]=le):le=e[57];let E;e[58]!==r||e[59]!==u.type||e[60]!==te||e[61]!==le?(E=s.jsxs(Jo,{value:ee,onValueChange:ue,disabled:r,children:[te,le]}),e[58]=r,e[59]=u.type,e[60]=te,e[61]=le,e[62]=E):E=e[62];let ne;e[63]!==$||e[64]!==E?(ne=s.jsxs("div",{className:"space-y-1.5",children:[$,E]}),e[63]=$,e[64]=E,e[65]=ne):ne=e[65];let X;e[66]===Symbol.for("react.memo_cache_sentinel")?(X=be=>h({discardQueryParameters:be===!0}),e[66]=X):X=e[66];let ae;e[67]!==r||e[68]!==u.discardQueryParameters?(ae=s.jsx(os,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:X}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ae):ae=e[69];let ce;e[70]!==a?(ce=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ce):ce=e[71];let L;e[72]!==ce?(L=s.jsx("span",{className:"text-sm",children:ce}),e[72]=ce,e[73]=L):L=e[73];let me;e[74]!==ae||e[75]!==L?(me=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ae,L]}),e[74]=ae,e[75]=L,e[76]=me):me=e[76];let T;e[77]!==j?(T=j&&s.jsx("p",{className:"text-xs text-destructive",children:j}),e[77]=j,e[78]=T):T=e[78];let pe;e[79]!==K||e[80]!==Z||e[81]!==ne||e[82]!==me||e[83]!==T?(pe=s.jsxs("div",{className:"space-y-4 py-4",children:[K,Z,ne,me,T]}),e[79]=K,e[80]=Z,e[81]=ne,e[82]=me,e[83]=T,e[84]=pe):pe=e[84];let he;e[85]!==i?(he=()=>i(!1),e[85]=i,e[86]=he):he=e[86];let ge;e[87]!==a?(ge=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=ge):ge=e[88];let ye;e[89]!==r||e[90]!==he||e[91]!==ge?(ye=s.jsx(Oe,{type:"button",variant:"outline",onClick:he,disabled:r,children:ge}),e[89]=r,e[90]=he,e[91]=ge,e[92]=ye):ye=e[92];const ie=!z;let de;e[93]!==r||e[94]!==a?(de=r?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),a("sandbox.redirectFormDialog.pending")]}):a("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=a,e[95]=de):de=e[95];let xe;e[96]!==ie||e[97]!==de?(xe=s.jsx(Oe,{type:"submit",disabled:ie,children:de}),e[96]=ie,e[97]=de,e[98]=xe):xe=e[98];let ke;e[99]!==ye||e[100]!==xe?(ke=s.jsxs(ts,{children:[ye,xe]}),e[99]=ye,e[100]=xe,e[101]=ke):ke=e[101];let Te;e[102]!==w||e[103]!==pe||e[104]!==ke||e[105]!==I?(Te=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:w,children:[I,pe,ke]})}),e[102]=w,e[103]=pe,e[104]=ke,e[105]=I,e[106]=Te):Te=e[106];let we;return e[107]!==S||e[108]!==n||e[109]!==Te?(we=s.jsx(ns,{open:n,onOpenChange:S,children:Te}),e[107]=S,e[108]=n,e[109]=Te,e[110]=we):we=e[110],we}function Bl(t){const e=Ce.c(70),{open:n,blockKey:o,initialName:c,isPending:l,onSubmit:i,onOpenChange:r}=t,a=l===void 0?!1:l,u=Be(),[x,d]=U.useState(c),[g,f]=U.useState(n);n!==g&&(f(n),n&&d(c));let p;e[0]!==a||e[1]!==r?(p=ee=>{!ee&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=p):p=e[2];const y=p;let h;e[3]!==a||e[4]!==x||e[5]!==i?(h=async ee=>{ee.preventDefault();const ue=x.trim();!ue||a||await i(ue)},e[3]=a,e[4]=x,e[5]=i,e[6]=h):h=e[6];const v=h;let S;e[7]!==u?(S=u("sandbox.sectionRenameDialog.title"),e[7]=u,e[8]=S):S=e[8];let k;e[9]!==S?(k=s.jsx(es,{children:S}),e[9]=S,e[10]=k):k=e[10];let w;e[11]!==u?(w=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=w):w=e[12];let j;e[13]!==w?(j=s.jsx(zo,{children:w}),e[13]=w,e[14]=j):j=e[14];let M;e[15]!==k||e[16]!==j?(M=s.jsxs(Zt,{children:[k,j]}),e[15]=k,e[16]=j,e[17]=M):M=e[17];let z;e[18]!==u?(z=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=z):z=e[19];let C;e[20]!==z?(C=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:z}),e[20]=z,e[21]=C):C=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=ee=>d(ee.target.value),e[22]=I):I=e[22];let B;e[23]!==a||e[24]!==x?(B=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=B):B=e[25];let O;e[26]!==C||e[27]!==B?(O=s.jsxs("div",{className:"space-y-1.5",children:[C,B]}),e[26]=C,e[27]=B,e[28]=O):O=e[28];let _;e[29]!==u?(_=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=_):_=e[30];let H;e[31]!==_?(H=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:_}),e[31]=_,e[32]=H):H=e[32];let R;e[33]!==o?(R=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=R):R=e[34];let F;e[35]!==H||e[36]!==R?(F=s.jsxs("div",{className:"space-y-1.5",children:[H,R]}),e[35]=H,e[36]=R,e[37]=F):F=e[37];let K;e[38]!==O||e[39]!==F?(K=s.jsxs("div",{className:"space-y-4 py-4",children:[O,F]}),e[38]=O,e[39]=F,e[40]=K):K=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let D;e[43]!==u?(D=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=D):D=e[44];let A;e[45]!==a||e[46]!==V||e[47]!==D?(A=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:D}),e[45]=a,e[46]=V,e[47]=D,e[48]=A):A=e[48];let J;e[49]!==a||e[50]!==x?(J=!x.trim()||a,e[49]=a,e[50]=x,e[51]=J):J=e[51];let G;e[52]!==a||e[53]!==u?(G=a?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),u("sandbox.sectionRenameDialog.saving")]}):u("sandbox.sectionRenameDialog.save"),e[52]=a,e[53]=u,e[54]=G):G=e[54];let W;e[55]!==J||e[56]!==G?(W=s.jsx(Oe,{type:"submit",disabled:J,children:G}),e[55]=J,e[56]=G,e[57]=W):W=e[57];let Z;e[58]!==A||e[59]!==W?(Z=s.jsxs(ts,{children:[A,W]}),e[58]=A,e[59]=W,e[60]=Z):Z=e[60];let Y;e[61]!==v||e[62]!==K||e[63]!==Z||e[64]!==M?(Y=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[M,K,Z]})}),e[61]=v,e[62]=K,e[63]=Z,e[64]=M,e[65]=Y):Y=e[65];let $;return e[66]!==y||e[67]!==n||e[68]!==Y?($=s.jsx(ns,{open:n,onOpenChange:y,children:Y}),e[66]=y,e[67]=n,e[68]=Y,e[69]=$):$=e[69],$}function $l(t){const e=Ce.c(7),{type:n}=t,o=Hs[n];let c;e[0]!==o?(c=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=c):c=e[1];const l=n==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(Me,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==c||e[5]!==i?(r=s.jsxs(ze,{children:[c,i]}),e[4]=c,e[5]=i,e[6]=r):r=e[6],r}const Ft={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},ls=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return ls.includes(t)}const as={posts:"post",authors:"author",categories:"category"},rn={posts:Ft.post,authors:Ft.author,categories:Ft.category},Ll=Object.fromEntries(Object.entries(rn).map(([t,e])=>[e,t]));function Ol(t){return typeof t=="string"?Ll[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Ne(t){return typeof t=="string"?t:""}function Rl(t,e){switch(t){case"posts":return{label:Ne(e.title)||"Untitled post",subtitle:Ne(e.slug)};case"authors":return{label:Ne(e.name)||"Unnamed author",subtitle:Ne(e.email)};case"categories":return{label:Ne(e.name)||"Unnamed category",subtitle:Ne(e.slug)};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}function cn(t){const e={posts:[],authors:[],categories:[]};for(const[n,o]of Object.entries(t)){const c=Je(o);if(!c)continue;const l=Ol(c.__resolveType);if(!l)continue;const i=Je(c[as[l]])??{},{label:r,subtitle:a}=Rl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of ls)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Fl(t,e){return cn(t)[e]}function vt(t,e){return Fl(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const xs=Object.freeze({});function xt(t,e){return t?Je(t[as[e]])??xs:xs}function it(t,e,n){return{name:t,__resolveType:rn[e],[as[e]]:n}}function Hi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=g=>typeof g=="string"?g:Ne(Je(g)?.[n]),i=g=>typeof g=="string"?g:Ne(Je(g)?.name),r=g=>{const f=l(g),p=f?t.find(({payload:h})=>Ne(h[n])===f):void 0;if(p)return p;const y=i(g);return y?t.find(({payload:h})=>Ne(h.name)===y):void 0},a=t.map(({key:g,payload:f})=>({value:g,label:Ne(f.name)||Ne(f[n])||g})),u=new Map,x=[];return c.forEach((g,f)=>{const p=r(g);if(p){x.includes(p.key)||x.push(p.key);return}const y=`unresolved:${f}`;u.set(y,g),x.push(y),a.push({value:y,label:i(g)||l(g)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:g=>g.map(f=>{const p=t.find(y=>y.key===f);return p?o(p.payload):u.get(f)}).filter(f=>f!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function Ke(t){if(typeof t=="string")return t;const e=Je(t);return e?Ne(e.slug):""}function Kl(t){if(typeof t=="string")return t;const e=Je(t);return e?Ne(e.email):""}function dn(t){const e=[];return Ne(t.title).trim()||e.push("Title"),Ne(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Ne(t.excerpt).trim()||e.push("Excerpt"),Ne(t.image).trim()||e.push("Cover image"),e}const un=8;function mn(t){const e=Ne(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function Gi(t,e){return e!=="published"||mn(t)==="published"?!1:dn(t).length>0}function Il(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,un).toISOString()}function Ji(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Ne(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Il(n):o}}function fn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Ne(n.title)||"Untitled post",slug:Ne(n.slug),date:Ne(n.date),scheduledDatetime:Ne(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Kl).filter(Boolean),missing:dn(n),status:mn(n)}))}function Ml(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e.slug)?t:{...t,categories:[...n,{name:e.name,slug:e.slug}]}}function zl(t,e){const n=Ze(t.categories);return n.length===1&&Ke(n[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function Wi(t,e,n){const o=Ze(t.categories);if(!o.some(r=>Ke(r)===e))return t;const c=o.map(r=>{const a=Ke(r);return a===e||a===n.slug?{name:n.name,slug:n.slug}:r}),l=new Set,i=c.filter(r=>{const a=Ke(r);return a?l.has(a)?!1:(l.add(a),!0):!0});return{...t,categories:i}}function Vl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function bs(t){return{...t,dateModified:new Date().toISOString()}}function Ht(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}function Kt(t,e){const n=`collections/blog/${e}/${Ht(12)}`;if(!Object.hasOwn(t,n))return n;throw new Error("Could not generate a unique blog block key")}function pn(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Ht(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Ht(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Ul={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},ys="Box";function Hl(t){return t.startsWith("site/")?"site":"app"}function Gl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function ht(...t){for(const e of t)if(e!==void 0)return e}function Yi(t){const e=new Set,n=[],o=t.manifest?.blocks??{};for(const c of Object.values(o))for(const l of Object.keys(c)){if(!Yl(l)||e.has(l))continue;e.add(l);const i=Yt(l,t),r=Jl(l),a=Ul[r],u=Hl(l),x=(u==="site"?ht(i.title,a?.title):ht(a?.title,i.title))??r,d=u==="site"?ht(i.description,a?.description):ht(a?.description,i.description),g=u==="site"?i.icon:void 0,f=g&&Gl(g)?g:void 0,p=f!==void 0?a?.iconName??ys:ht(g,a?.iconName)??ys;n.push({resolveType:l,title:x,description:d,iconName:p,iconUrl:f,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Jl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const Wl=["blog/sections/blocks/","site/sections/Blog/Post/"];function Yl(t){return Wl.some(e=>t.startsWith(e))}const qi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Qi=["January","February","March","April","May","June","July","August","September","October","November","December"],hn=1440*60*1e3;function Xe(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Xi(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Zi(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Pt(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Gt(t,e){return Math.round((Xe(t).getTime()-Xe(e).getTime())/hn)}function ql(t){const e=(t.getTime()-Xe(t).getTime())/hn;return Math.min(Math.max(e,0),1)}function vs(t,e){return Gt(t,e)+ql(t)}function er(t){const e=Pt(t,-t.getDay()),n=[];for(let o=0;o<6;o++){const c=[];for(let l=0;l<7;l++)c.push(Pt(e,o*7+l));n.push(c)}for(;n.length>0&&n[n.length-1].every(o=>o.getMonth()!==t.getMonth());)n.pop();return n}function tr(t,e){const n=Xe(t[0]),o=Pt(n,7),c=n.getTime(),l=o.getTime(),i=[];for(const u of e){const x=Xe(u.start),d=Xe(u.end);if(d.getTime()<n.getTime()||x.getTime()>=o.getTime())continue;const g=x.getTime()<n.getTime()?n:x,f=d.getTime()>=o.getTime()?Pt(o,-1):d,p=Gt(g,n),y=Gt(f,g)+1;if(y<=0)continue;const h=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=vs(new Date(h),n),k=Math.max(vs(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:p,span:y,leftUnits:S,widthUnits:k})}i.sort((u,x)=>u.startCol-x.startCol||x.span-u.span||u.variant.blockKey.localeCompare(x.variant.blockKey));const r=[],a=[];for(const u of i){let x=r.findIndex(d=>d<=u.startCol);x===-1&&(x=r.length,r.push(0)),r[x]=u.startCol+u.span,a.push({...u,lane:x})}return a}function Tt(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${n}`}const gn=/^(\d{4})-(\d{2})-(\d{2})$/;function _t(t){const e=t.trim();if(!e)return null;const n=gn.exec(e);if(n){const c=Number(n[1]),l=Number(n[2])-1,i=Number(n[3]),r=new Date(c,l,i);return r.getMonth()===l&&r.getDate()===i?r:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:Xe(o)}function Ql(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),un);return{...pn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Tt(t)}}function Xl(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(gn.test(e))return _t(e);const n=new Date(e);return Number.isNaN(n.getTime())?null:n}function Zl(t,e){const n=Xl(t.scheduledDatetime);if(!n)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),c={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Tt(n)&&(c.date=Tt(o)),c}function ea(t){return _t(t.scheduledDatetime)??_t(t.date)}function sr(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:_t(c.scheduledDatetime)!==null},i=ea(c);if(!i){n.push(l);continue}const r=Tt(i),a=e.get(r);a?a.push(l):e.set(r,[l])}const o=(c,l)=>Number(l.scheduled)-Number(c.scheduled)||c.post.title.localeCompare(l.post.title);for(const c of e.values())c.sort(o);return n.sort(o),{byDay:e,undated:n}}const ta="0.161.0",sa="0.162.0",nr="deno task update";function Ss(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function ks(t,e){const n=Ss(t),o=Ss(e);if(!n||!o)return 0;for(let c=0;c<3;c++){const l=n[c]-o[c];if(l!==0)return l}return 0}const xn=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function na(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){if(typeof n!="string")continue;const o=xn.exec(n)?.[1];if(o)return o}return null}function oa(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){const o=n?.title;if(typeof o!="string")continue;const c=xn.exec(o)?.[1];if(c)return c}return null}function la(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=na(t.denoJson)??oa(t.meta);return!e||ks(e,ta)<0?{kind:"outdated",version:e}:ks(e,sa)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function or(t){return t.kind==="publish-only"||t.kind==="full"}function lr(t){return t.kind==="full"}function aa(t){const e=Ce.c(16),n=tn(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=ho(t.virtualMcpId),c=Et()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=Bs.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=l):l=e[3];let i;e[4]!==o||e[5]!==t||e[6]!==c?(i=async()=>{const g=await go({...t,threadId:c},xo(o,"deno.json"));return g.kind==="data"?g.data:null},e[4]=o,e[5]=t,e[6]=c,e[7]=i):i=e[7];const r=n==="deno";let a;e[8]!==l||e[9]!==i||e[10]!==r?(a={queryKey:l,queryFn:i,enabled:r,staleTime:3e5},e[8]=l,e[9]=i,e[10]=r,e[11]=a):a=e[11];const{data:u}=As(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=la({packageManager:n,denoJson:x,meta:t.meta}),e[12]=n,e[13]=t.meta,e[14]=x,e[15]=d):d=e[15],d}function Re(t){const e=Ce.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:g,invalid:f,invalidReason:p,onToggleSelect:y,onClick:h,menu:v}=t,S=Be(),k=r==="global";let w;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(w=a&&a>1?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(n,{size:16,className:"shrink-0 text-success"})}),s.jsxs(Me,{side:"right",children:[a," variants"]})]})}):o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:_e("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:s.jsx(n,{size:16,className:_e("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:qt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=w):w=e[5];const j=w,M=i?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let z;e[6]!==M?(z=_e("group relative flex min-w-0 items-center rounded-md transition-colors",M),e[6]=M,e[7]=z):z=e[7];let C;e[8]!==y||e[9]!==x||e[10]!==g||e[11]!==d||e[12]!==S||e[13]!==c?(C=x&&s.jsx("span",{className:_e("flex shrink-0 items-center pl-2.5 transition-opacity",g||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ia,children:s.jsx(os,{checked:g,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=g,e[11]=d,e[12]=S,e[13]=c,e[14]=C):C=e[14];const I=f&&!i&&"text-destructive";let B;e[15]!==I?(B=_e("block truncate text-sm font-medium",I),e[15]=I,e[16]=B):B=e[16];let O;e[17]!==B||e[18]!==c?(O=s.jsx("span",{className:B,children:c}),e[17]=B,e[18]=c,e[19]=O):O=e[19];const _=i?"text-accent-foreground/70":"text-muted-foreground";let H;e[20]!==_?(H=_e("block truncate text-xs",_),e[20]=_,e[21]=H):H=e[21];let R;e[22]!==l||e[23]!==H?(R=s.jsx("span",{className:H,children:l}),e[22]=l,e[23]=H,e[24]=R):R=e[24];let F;e[25]!==R||e[26]!==O?(F=s.jsxs("span",{className:"min-w-0 flex-1",children:[O,R]}),e[25]=R,e[26]=O,e[27]=F):F=e[27];let K;e[28]!==i||e[29]!==f||e[30]!==p?(K=f&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:_e("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Os,{size:14})})}),p&&s.jsx(Me,{side:"bottom",children:p})]}),e[28]=i,e[29]=f,e[30]=p,e[31]=K):K=e[31];let V;e[32]!==h||e[33]!==j||e[34]!==F||e[35]!==K||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[j,F,K,u]}),e[32]=h,e[33]=j,e[34]=F,e[35]=K,e[36]=u,e[37]=V):V=e[37];let D;e[38]!==i||e[39]!==v?(D=v&&s.jsx("div",{className:_e("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=D):D=e[40];let A;return e[41]!==V||e[42]!==D||e[43]!==z||e[44]!==C?(A=s.jsxs("div",{className:z,children:[C,V,D]}),e[41]=V,e[42]=D,e[43]=z,e[44]=C,e[45]=A):A=e[45],A}function ia(t){return t.stopPropagation()}function Ge(t){const e=Ce.c(10),{icon:n,title:o,description:c}=t;let l;e[0]!==n?(l=n&&s.jsx(n,{size:24,className:"text-muted-foreground/60"}),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==c?(r=c&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:c}),e[4]=c,e[5]=r):r=e[5];let a;return e[6]!==l||e[7]!==i||e[8]!==r?(a=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,r]}),e[6]=l,e[7]=i,e[8]=r,e[9]=a):a=e[9],a}const ra={loaders:Zs,actions:en},ca={loaders:"Loaders",actions:"Actions"},da={analytics:qo,blog:Fs,commerce:Yo,site:Fn,website:Wo};function ua(t,e){return e===0?da[t.toLowerCase()]??us:us}function kt(t,e){return e===0?ko(t):t}function ma(t){const e=Ce.c(98),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a}=t,u=Be();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[d,g]=U.useState(x),[f,p]=U.useState(null),[y,h]=U.useState(""),[v,S]=U.useState(va),[k,w]=U.useState(a);k!==a&&(w(a),g([]),p(null),h(""),S(new Set));let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=Y=>{S($=>{const ee=new Set($);return ee.has(Y)?ee.delete(Y):ee.add(Y),ee})},e[1]=j):j=e[1];const M=j;let z;e[2]!==c||e[3]!==n||e[4]!==o?(z={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=z):z=e[5];const C=Js(z);let I;e[6]!==C?(I=Ys((Y,$)=>C.mutate({blockKey:Y,data:$})),e[6]=C,e[7]=I):I=e[7];const B=I;let O;e[8]!==a?(O=jo(a),e[8]=a,e[9]=O):O=e[9];const _=O,H=ra[a];let R,F,K,V,D,A,J;if(e[10]!==H||e[11]!==c||e[12]!==r||e[13]!==a||e[14]!==i||e[15]!==v||e[16]!==n||e[17]!==d||e[18]!==l||e[19]!==C||e[20]!==B||e[21]!==y||e[22]!==f||e[23]!==_||e[24]!==u||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const Y=[...bo(i,r,a).map(ya),...yo(i,a).map(ba)],$=y.trim().toLowerCase(),ee=$.length>0,ue=ee?Y.filter(N=>N.title.toLowerCase().includes($)||N.resolveType.toLowerCase().includes($)):[],oe=new Map,te=[],se=new Map;if(!ee){for(const N of Y){const re=N.folderPath;if(!(re.length<d.length)&&d.every((ve,Ee)=>re[Ee]===ve))if(re.length===d.length)if(N.savedKey!==void 0){const ve=se.get(N.resolveType);ve?ve.push(N):se.set(N.resolveType,[N])}else te.push(N);else{const ve=re[d.length],Ee=oe.get(ve)??{count:0,savedCount:0};N.savedKey!==void 0?Ee.savedCount=Ee.savedCount+1:Ee.count=Ee.count+1,oe.set(ve,Ee)}}te.sort(xa);for(const N of se.values())N.sort(ga)}const le=[...se.entries()].filter(N=>{const[re]=N;return!te.some(ve=>ve.resolveType===re)}).flatMap(ha).sort(pa);let E;e[33]!==d?(E=(N,re)=>kt(N.name,d.length).localeCompare(kt(re.name,d.length)),e[33]=d,e[34]=E):E=e[34];const ne=[...oe.entries()].map(fa).sort(E);let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=N=>{p(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=X):X=e[35];const ae=X;let ce;e[36]!==C||e[37]!==_||e[38]!==u?(ce=async(N,re)=>{await C.mutateAsync({blockKey:N,data:re}),Se.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:_,blockId:N})),p({mode:"saved",key:N})},e[36]=C,e[37]=_,e[38]=u,e[39]=ce):ce=e[39];const L=ce;let me;e[40]!==r||e[41]!==f?(me=Sa(f,r),e[40]=r,e[41]=f,e[42]=me):me=e[42];const T=me;if(T){const N=`${T.mode}:${T.mode==="saved"?T.blockKey:T.resolveType}`;let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=()=>p(null),e[43]=re):re=e[43];let ve;e[44]!==c||e[45]!==r||e[46]!==L||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==C.isPending||e[52]!==B||e[53]!==N||e[54]!==T.editorTarget||e[55]!==T.initialValue||e[56]!==o?(ve=s.jsx(vo,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:T.editorTarget,initialValue:T.initialValue,isCreating:C.isPending,onCreate:L,onSaveReferencedBlock:B,onBack:re},N),e[44]=c,e[45]=r,e[46]=L,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=C.isPending,e[52]=B,e[53]=N,e[54]=T.editorTarget,e[55]=T.initialValue,e[56]=o,e[57]=ve):ve=e[57],K=ve;break e}J="flex h-full w-full min-w-0 flex-col";let pe;e[58]!==u?(pe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=pe):pe=e[59];let he;e[60]===Symbol.for("react.memo_cache_sentinel")?(he=()=>g([]),e[60]=he):he=e[60];const ge=d.length===0?"font-medium text-foreground":"text-muted-foreground";let ye;e[61]!==ge?(ye=_e("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ge),e[61]=ge,e[62]=ye):ye=e[62];const ie=ca[a];let de;e[63]!==ye||e[64]!==ie?(de=s.jsx("button",{type:"button",onClick:he,className:ye,children:ie}),e[63]=ye,e[64]=ie,e[65]=de):de=e[65];let xe;e[66]!==d?(xe=d.map((N,re)=>{const ve=re===d.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>g(d.slice(0,re+1)),className:_e("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,re)})]},`${N}-${re}`)}),e[66]=d,e[67]=xe):xe=e[67];let ke;e[68]!==pe||e[69]!==de||e[70]!==xe?(ke=s.jsxs("nav",{"aria-label":pe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[de,xe]}),e[68]=pe,e[69]=de,e[70]=xe,e[71]=ke):ke=e[71];let Te;e[72]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Te):Te=e[72];let we;e[73]===Symbol.for("react.memo_cache_sentinel")?(we=N=>h(N.target.value),e[73]=we):we=e[73];let be;e[74]!==a||e[75]!==u?(be=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=be):be=e[76];let De;e[77]!==a||e[78]!==u?(De=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=De):De=e[79];let $e;e[80]!==y||e[81]!==be||e[82]!==De?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Te,s.jsx("input",{type:"text",value:y,onChange:we,placeholder:be,"aria-label":De,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=be,e[82]=De,e[83]=$e):$e=e[83],e[84]!==ke||e[85]!==$e?(F=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[ke,$e]}),e[84]=ke,e[85]=$e,e[86]=F):F=e[86],R=Dt,A="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",D=ee?ue.length===0?s.jsx(Ge,{title:u("sandbox.runnableBlocksBrowser.noSearchResults",{kind:a,query:y.trim()}),description:u("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:ue.map(N=>s.jsx(Re,{icon:H,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)},N.savedKey??N.resolveType))}):ne.length===0&&te.length===0&&le.length===0?s.jsx(Ge,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[ne.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:ne.map(N=>{const re=ua(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>g([...d,N.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(re,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:kt(N.name,d.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N.count," ",N.count===1?_:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(te.length>0||le.length>0)&&s.jsxs("div",{className:_e("flex flex-col gap-1",ne.length>0&&"mt-4"),children:[te.map(N=>{const re=se.get(N.resolveType)??[],ve=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:H,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)}),re.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>M(N.resolveType),"aria-expanded":ve,className:"flex items-center gap-1 self-start rounded-md px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:qt},children:[ve?s.jsx(Xt,{size:12,className:"shrink-0"}):s.jsx(Nt,{size:12,className:"shrink-0"}),u(ve?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",re.length,")"]}),ve&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:re.map(Ee=>s.jsx(Re,{icon:H,accent:"global",title:Ee.title,subtitle:Ee.resolveType,active:!1,onClick:()=>ae(Ee)},Ee.savedKey))})]})]},N.resolveType)}),le.map(N=>s.jsx(Re,{icon:H,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)},N.savedKey))]})]})}e[10]=H,e[11]=c,e[12]=r,e[13]=a,e[14]=i,e[15]=v,e[16]=n,e[17]=d,e[18]=l,e[19]=C,e[20]=B,e[21]=y,e[22]=f,e[23]=_,e[24]=u,e[25]=o,e[26]=R,e[27]=F,e[28]=K,e[29]=V,e[30]=D,e[31]=A,e[32]=J}else R=e[26],F=e[27],K=e[28],V=e[29],D=e[30],A=e[31],J=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let G;e[87]!==V||e[88]!==D?(G=s.jsx("div",{className:V,children:D}),e[87]=V,e[88]=D,e[89]=G):G=e[89];let W;e[90]!==R||e[91]!==G||e[92]!==A?(W=s.jsx(R,{className:A,children:G}),e[90]=R,e[91]=G,e[92]=A,e[93]=W):W=e[93];let Z;return e[94]!==F||e[95]!==W||e[96]!==J?(Z=s.jsxs("div",{className:J,children:[F,W]}),e[94]=F,e[95]=W,e[96]=J,e[97]=Z):Z=e[97],Z}function fa(t){const[e,n]=t;return{name:e,...n}}function pa(t,e){return t.title.localeCompare(e.title)}function ha(t){const[,e]=t;return e}function ga(t,e){return t.title.localeCompare(e.title)}function xa(t,e){return t.title.localeCompare(e.title)}function ba(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ws(t.resolveType)}}function ya(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ws(t.resolveType),savedKey:t.key}}function va(){return new Set}function Sa(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:n,props:o,title:c}=So(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function ka(t){const e=Ce.c(83),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:g,onSaveReferencedBlock:f}=t,p=Be(),y=Qt(),h=y?.entity?.id===o?y.entity.metadata?.siteSlug??null:null;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={},e[0]=v):v=e[0];const[S,k]=U.useState(v);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=[],e[1]=w):w=e[1];const[j,M]=U.useState(w),[z,C]=U.useState(0),[I,B]=U.useState(!1);let O;e[2]!==i||e[3]!==a?(O=Wt(a,i),e[2]=i,e[3]=a,e[4]=O):O=e[4];const _=O,H=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,R=Et()?.taskId??null,F=l??void 0;let K;e[5]!==h||e[6]!==c||e[7]!==n||e[8]!==F||e[9]!==R||e[10]!==o?(K={orgSlug:n,virtualMcpId:o,branch:c,threadId:R,previewUrl:F,siteSlug:h},e[5]=h,e[6]=c,e[7]=n,e[8]=F,e[9]=R,e[10]=o,e[11]=K):K=e[11];const V=K;let D,A,J,G,W,Z,Y,$;if(e[12]!==r||e[13]!==j||e[14]!==S||e[15]!==g||e[16]!==p||e[17]!==u){const ye=[u,...j],ie=xe=>{M(j.slice(0,xe)),C(ja)};let de;e[26]!==r||e[27]!==S||e[28]!==g?(de=async xe=>{const ke=Co(xe,r);if(ke){Se.error(ke);return}await g(xe,S),B(!1)},e[26]=r,e[27]=S,e[28]=g,e[29]=de):de=e[29],D=de,G="flex h-full w-full min-w-0",J="flex min-w-0 flex-1 flex-col",A="shrink-0 border-b px-3 py-2.5",$="flex min-w-0 items-center gap-2 overflow-hidden",e[30]!==p?(W=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[30]=p,e[31]=W):W=e[31],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",Y=ye.map((xe,ke)=>{const Te=ke===ye.length-1,we=qs(xe);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[ke>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>ie(ke),title:we,className:_e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Te?"font-medium text-foreground":"text-muted-foreground"),children:we})]},`${we}-${ke}`)}),e[12]=r,e[13]=j,e[14]=S,e[15]=g,e[16]=p,e[17]=u,e[18]=D,e[19]=A,e[20]=J,e[21]=G,e[22]=W,e[23]=Z,e[24]=Y,e[25]=$}else D=e[18],A=e[19],J=e[20],G=e[21],W=e[22],Z=e[23],Y=e[24],$=e[25];let ee;e[32]!==W||e[33]!==Z||e[34]!==Y?(ee=s.jsx("nav",{"aria-label":W,className:Z,children:Y}),e[32]=W,e[33]=Z,e[34]=Y,e[35]=ee):ee=e[35];let ue;e[36]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>B(!0),e[36]=ue):ue=e[36];let oe;e[37]!==p?(oe=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[37]=p,e[38]=oe):oe=e[38];let te;e[39]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Kn,{size:14}),e[39]=te):te=e[39];let se;e[40]!==d||e[41]!==oe?(se=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ue,"aria-label":oe,children:te})}),e[40]=d,e[41]=oe,e[42]=se):se=e[42];let le;e[43]!==p?(le=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[43]=p,e[44]=le):le=e[44];let E;e[45]!==le?(E=s.jsx(Me,{side:"bottom",children:le}),e[45]=le,e[46]=E):E=e[46];let ne;e[47]!==se||e[48]!==E?(ne=s.jsxs(ze,{children:[se,E]}),e[47]=se,e[48]=E,e[49]=ne):ne=e[49];let X;e[50]!==ee||e[51]!==ne||e[52]!==$?(X=s.jsxs("div",{className:$,children:[ee,ne]}),e[50]=ee,e[51]=ne,e[52]=$,e[53]=X):X=e[53];const ae="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",ce=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:H});let L;e[54]!==ce?(L=s.jsx("p",{className:ae,children:ce}),e[54]=ce,e[55]=L):L=e[55];let me;e[56]!==A||e[57]!==X||e[58]!==L?(me=s.jsxs("div",{className:A,children:[X,L]}),e[56]=A,e[57]=X,e[58]=L,e[59]=me):me=e[59];let T;e[60]!==r||e[61]!==j||e[62]!==z||e[63]!==S||e[64]!==i||e[65]!==f||e[66]!==V||e[67]!==_||e[68]!==p?(T=s.jsx(Dt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:_?s.jsx(Qs,{schema:_,value:S,onChange:ye=>k(ye),basePath:"",breadcrumbPath:j,onBreadcrumbChange:M,meta:i,decofile:r,onSaveReferencedBlock:f,sandbox:V},z):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[60]=r,e[61]=j,e[62]=z,e[63]=S,e[64]=i,e[65]=f,e[66]=V,e[67]=_,e[68]=p,e[69]=T):T=e[69];let pe;e[70]!==J||e[71]!==me||e[72]!==T?(pe=s.jsxs("div",{className:J,children:[me,T]}),e[70]=J,e[71]=me,e[72]=T,e[73]=pe):pe=e[73];let he;e[74]!==x||e[75]!==D||e[76]!==d||e[77]!==I?(he=s.jsx(wo,{open:I,onOpenChange:B,defaultBlockId:x,isPending:d,onSubmit:D}),e[74]=x,e[75]=D,e[76]=d,e[77]=I,e[78]=he):he=e[78];let ge;return e[79]!==G||e[80]!==pe||e[81]!==he?(ge=s.jsxs("div",{className:G,children:[pe,he]}),e[79]=G,e[80]=pe,e[81]=he,e[82]=ge):ge=e[82],ge}function ja(t){return t+1}function Ca(t,e){const n={__resolveType:t},o=Po([n],e)[0];return o?To(n,o,e):null}function wa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=Qt(),x=u?.entity?.id===e?u.entity.metadata?.siteSlug??null:null,[d]=U.useState(()=>Ca(i,l)),[g,f]=U.useState(d?.data??{}),[p,y]=U.useState([]),[h,v]=U.useState(0),[S,k]=U.useState(!1),[w,j]=U.useState(null),M=w!==null,{save:z,flush:C}=No({orgSlug:t,virtualMcpId:e,branch:n}),I=d?.resolveType?Wt(d.resolveType,c):null,B=l[i],O=B?no(i,B):i,_=Et()?.taskId??null,H={orgSlug:t,virtualMcpId:e,branch:n,threadId:_,previewUrl:o??void 0,siteSlug:x},R=A=>{f(A),z(i,A)},F=()=>{M?(j(null),k(!1),v(A=>A+1)):j(JSON.stringify(g,null,2))},K=A=>{const J=A??"";try{const G=JSON.parse(J);if(G&&typeof G=="object"&&!Array.isArray(G)){k(!1),R(G);return}k(!0)}catch{k(!0)}},V=[O,...p],D=A=>{y(p.slice(0,A)),v(J=>J+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt},"aria-hidden":!0}),s.jsx("nav",{"aria-label":a("sandbox.savedSectionEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:V.map((A,J)=>{const G=J===V.length-1,W=qs(A);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[J>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>D(J),title:W,className:_e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",G?"font-medium text-foreground":"text-muted-foreground"),children:W})]},`${W}-${J}`)})}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:M?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:F,"aria-label":a(M?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":M,children:M?s.jsx(Jt,{size:14}):s.jsx(Ms,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(M?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:a("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Dt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:I?s.jsx(Qs,{schema:I,value:g,onChange:A=>R(A),basePath:"",breadcrumbPath:p,onBreadcrumbChange:y,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:H},h):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),w!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:a("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Xo,{language:"json",height:"100%",code:w,onChange:K,onSave:A=>{K(A),C()}})})]})]})]})})}function Na(t){const e=Ce.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,g=Be();if(!n){let y;e[0]!==g?(y=g("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=g,e[1]=y):y=e[1];let h;e[2]!==g?(h=g("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=g,e[3]=h):h=e[3];let v;return e[4]!==y||e[5]!==h?(v=s.jsx(Ge,{title:y,description:h}),e[4]=y,e[5]=h,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,h=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=_o(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(j,M)=>x(n.resolveType,j,M),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let w;return e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==r||e[16]!==d||e[17]!==o||e[18]!==i||e[19]!==n.resolveType||e[20]!==n.title||e[21]!==y||e[22]!==S||e[23]!==k||e[24]!==c?(w=s.jsx(ka,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:h,title:v,defaultBlockId:S,isCreating:u,onCreate:k,onSaveReferencedBlock:d},y),e[12]=l,e[13]=a,e[14]=u,e[15]=r,e[16]=d,e[17]=o,e[18]=i,e[19]=n.resolveType,e[20]=n.title,e[21]=y,e[22]=S,e[23]=k,e[24]=c,e[25]=w):w=e[25],w}const f=`saved:${n.key}`;let p;return e[26]!==l||e[27]!==a||e[28]!==r||e[29]!==d||e[30]!==o||e[31]!==i||e[32]!==n.key||e[33]!==f||e[34]!==c?(p=s.jsx(wa,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},f),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=f,e[34]=c,e[35]=p):p=e[35],p}const js="__all__",Cs={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},Pa={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},wt={published:"sandbox.postToolbar.statusPublished",scheduled:"sandbox.postToolbar.statusScheduled",draft:"sandbox.postToolbar.statusDraft"},ws="status:";function Ns(t){if(!t.startsWith(ws))return null;const e=t.slice(ws.length);return e in wt?e:null}const Ps=U.forwardRef(function(e,n){const o=Ce.c(20);let c,l,i,r,a;o[0]!==e?({icon:c,active:l,value:a,className:i,...r}=e,o[0]=e,o[1]=c,o[2]=l,o[3]=i,o[4]=r,o[5]=a):(c=o[1],l=o[2],i=o[3],r=o[4],a=o[5]);const u=l?"text-foreground":"text-muted-foreground";let x;o[6]!==i||o[7]!==u?(x=_e("h-7 gap-1 px-1.5 text-xs",u,i),o[6]=i,o[7]=u,o[8]=x):x=o[8];let d;o[9]!==c?(d=s.jsx(c,{size:14,className:"shrink-0"}),o[9]=c,o[10]=d):d=o[10];let g;o[11]!==a?(g=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=g):g=o[12];let f;o[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Xt,{size:12,className:"shrink-0 opacity-60"}),o[13]=f):f=o[13];let p;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==g?(p=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,g,f]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=g,o[19]=p):p=o[19],p});function is(t){const e=Ce.c(2),{count:n}=t;let o;return e[0]!==n?(o=s.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:n}),e[0]=n,e[1]=o):o=e[1],o}function Ta(t){const e=Ce.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:g}=t,f=Be();let p;if(e[0]!==n||e[1]!==l){let T;e[3]!==l?(T=pe=>pe.slug===l,e[3]=l,e[4]=T):T=e[4],p=n.find(T),e[0]=n,e[1]=l,e[2]=p}else p=e[2];const y=p;let h;if(e[5]!==i||e[6]!==o){let T;e[8]!==i?(T=pe=>pe.email===i,e[8]=i,e[9]=T):T=e[9],h=o.find(T),e[5]=i,e[6]=o,e[7]=h}else h=e[7];const v=h,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==f?(k=y?.name??v?.name??f(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=f,e[14]=k):k=e[14];const w=k,j=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:js;let M;e[15]!==x||e[16]!==u||e[17]!==d?(M=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=M):M=e[18];const z=M;let C;e[19]!==z||e[20]!==x||e[21]!==u||e[22]!==d?(C=T=>{T.startsWith("cat:")?(x(null),d(null),u(T.slice(4))):T.startsWith("author:")?(u(null),d(null),x(T.slice(7))):Ns(T)?(u(null),x(null),d(Ns(T))):z()},e[19]=z,e[20]=x,e[21]=u,e[22]=d,e[23]=C):C=e[23];const I=C;let B;e[24]!==w||e[25]!==S?(B=s.jsx(zt,{asChild:!0,children:s.jsx(Ps,{icon:In,active:S,value:w,className:"min-w-0 shrink"})}),e[24]=w,e[25]=S,e[26]=B):B=e[26];let O;e[27]!==f?(O=f("sandbox.postToolbar.filterBy"),e[27]=f,e[28]=O):O=e[28];let _;e[29]!==O?(_=s.jsx(pt,{children:O}),e[29]=O,e[30]=_):_=e[30];let H;e[31]!==f?(H=f("sandbox.postToolbar.allPosts"),e[31]=f,e[32]=H):H=e[32];let R;e[33]!==H?(R=s.jsx(bt,{value:js,children:H}),e[33]=H,e[34]=R):R=e[34];let F;e[35]!==f?(F=f("sandbox.postToolbar.statusLabel"),e[35]=f,e[36]=F):F=e[36];let K;e[37]!==F?(K=s.jsx(pt,{className:"text-muted-foreground/70",children:F}),e[37]=F,e[38]=K):K=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let D;e[40]!==c||e[41]!==f?(D=V.map(T=>s.jsxs(bt,{value:`status:${T}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:f(wt[T])}),s.jsx(is,{count:c[T]})]},`status:${T}`)),e[40]=c,e[41]=f,e[42]=D):D=e[42];let A;e[43]!==n.length||e[44]!==f?(A=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=f,e[45]=A):A=e[45];let J;e[46]!==n?(J=n.map(Ea),e[46]=n,e[47]=J):J=e[47];let G;e[48]!==o.length||e[49]!==f?(G=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=f,e[50]=G):G=e[50];let W;e[51]!==o?(W=o.map(_a),e[51]=o,e[52]=W):W=e[52];let Z;e[53]!==j||e[54]!==I||e[55]!==R||e[56]!==K||e[57]!==D||e[58]!==A||e[59]!==J||e[60]!==G||e[61]!==W?(Z=s.jsxs(ms,{value:j,onValueChange:I,children:[R,K,D,A,J,G,W]}),e[53]=j,e[54]=I,e[55]=R,e[56]=K,e[57]=D,e[58]=A,e[59]=J,e[60]=G,e[61]=W,e[62]=Z):Z=e[62];let Y;e[63]!==Z||e[64]!==_?(Y=s.jsxs(Vt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[_,Z]}),e[63]=Z,e[64]=_,e[65]=Y):Y=e[65];let $;e[66]!==Y||e[67]!==B?($=s.jsxs(Ut,{children:[B,Y]}),e[66]=Y,e[67]=B,e[68]=$):$=e[68];let ee;e[69]!==z||e[70]!==S||e[71]!==f?(ee=S&&s.jsx(Da,{label:f("sandbox.postToolbar.clearFilter"),onClick:z}),e[69]=z,e[70]=S,e[71]=f,e[72]=ee):ee=e[72];const ue=Pa[a];let oe;e[73]!==f||e[74]!==ue?(oe=f(ue),e[73]=f,e[74]=ue,e[75]=oe):oe=e[75];let te;e[76]!==oe?(te=s.jsx(zt,{asChild:!0,children:s.jsx(Ps,{icon:Mn,active:!0,value:oe})}),e[76]=oe,e[77]=te):te=e[77];let se;e[78]!==f?(se=f("sandbox.postToolbar.sortBy"),e[78]=f,e[79]=se):se=e[79];let le;e[80]!==se?(le=s.jsx(pt,{children:se}),e[80]=se,e[81]=le):le=e[81];let E;e[82]!==g?(E=T=>g(T),e[82]=g,e[83]=E):E=e[83];let ne;e[84]===Symbol.for("react.memo_cache_sentinel")?(ne=Object.keys(Cs),e[84]=ne):ne=e[84];let X;e[85]!==f?(X=ne.map(T=>s.jsx(bt,{value:T,children:f(Cs[T])},T)),e[85]=f,e[86]=X):X=e[86];let ae;e[87]!==a||e[88]!==E||e[89]!==X?(ae=s.jsx(ms,{value:a,onValueChange:E,children:X}),e[87]=a,e[88]=E,e[89]=X,e[90]=ae):ae=e[90];let ce;e[91]!==le||e[92]!==ae?(ce=s.jsxs(Vt,{align:"end",className:"w-44",children:[le,ae]}),e[91]=le,e[92]=ae,e[93]=ce):ce=e[93];let L;e[94]!==te||e[95]!==ce?(L=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(Ut,{children:[te,ce]})}),e[94]=te,e[95]=ce,e[96]=L):L=e[96];let me;return e[97]!==$||e[98]!==ee||e[99]!==L?(me=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[$,ee,L]}),e[97]=$,e[98]=ee,e[99]=L,e[100]=me):me=e[100],me}function _a(t){return s.jsxs(bt,{value:`author:${t.email}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(is,{count:t.count})]},`author:${t.email}`)}function Ea(t){return s.jsxs(bt,{value:`cat:${t.slug}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(is,{count:t.count})]},`cat:${t.slug}`)}function Da(t){const e=Ce.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Jt,{size:12}),e[0]=c):c=e[0];let l;return e[1]!==n||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":n,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:c}),e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function Aa(t){const e=Ce.c(18),{checked:n,disabled:o,onToggle:c}=t,l=Be();let i;e[0]!==c?(i=()=>c(),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=l(n?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n||e[6]!==o||e[7]!==i||e[8]!==r?(a=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Ba,children:s.jsx(os,{checked:n,disabled:o,onCheckedChange:i,"aria-label":r})})}),e[5]=n,e[6]=o,e[7]=i,e[8]=r,e[9]=a):a=e[9];let u;e[10]!==n||e[11]!==l?(u=l(n?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=n,e[11]=l,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx(Me,{side:"bottom",children:u}),e[13]=u,e[14]=x):x=e[14];let d;return e[15]!==a||e[16]!==x?(d=s.jsxs(ze,{children:[a,x]}),e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function Ba(t){return t.stopPropagation()}function $a(t){const e=Ce.c(42),{count:n,allSelected:o,onToggleSelectAll:c,onDelete:l,onExit:i}=t,r=Be();let a;e[0]!==o||e[1]!==c?(a=s.jsx(Aa,{checked:o,onToggle:c}),e[0]=o,e[1]=c,e[2]=a):a=e[2];let u;e[3]!==n||e[4]!==r?(u=r("sandbox.postToolbar.itemsSelected",{count:n}),e[3]=n,e[4]=r,e[5]=u):u=e[5];let x;e[6]!==u?(x=s.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=x):x=e[7];const d=n===0;let g;e[8]!==r?(g=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=g):g=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(sn,{size:14}),e[10]=f):f=e[10];let p;e[11]!==l||e[12]!==d||e[13]!==g?(p=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:d,onClick:l,"aria-label":g,children:f})}),e[11]=l,e[12]=d,e[13]=g,e[14]=p):p=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let h;e[17]!==y?(h=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=h):h=e[18];let v;e[19]!==p||e[20]!==h?(v=s.jsxs(ze,{children:[p,h]}),e[19]=p,e[20]=h,e[21]=v):v=e[21];let S;e[22]!==r?(S=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=S):S=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Jt,{size:14}),e[24]=k):k=e[24];let w;e[25]!==i||e[26]!==S?(w=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":S,children:k})}),e[25]=i,e[26]=S,e[27]=w):w=e[27];let j;e[28]!==r?(j=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=j):j=e[29];let M;e[30]!==j?(M=s.jsx(Me,{side:"bottom",children:j}),e[30]=j,e[31]=M):M=e[31];let z;e[32]!==w||e[33]!==M?(z=s.jsxs(ze,{children:[w,M]}),e[32]=w,e[33]=M,e[34]=z):z=e[34];let C;e[35]!==v||e[36]!==z?(C=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,z]}),e[35]=v,e[36]=z,e[37]=C):C=e[37];let I;return e[38]!==a||e[39]!==C||e[40]!==x?(I=s.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[a,x,C]}),e[38]=a,e[39]=C,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=Ce.c(34),{onDuplicate:n,onRename:o,onAddVariant:c,onEditSeo:l,onViewJson:i,onDelete:r}=t,a=Be();let u;e[0]!==a?(u=a("sandbox.itemActions.moreActions"),e[0]=a,e[1]=u):u=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(zn,{size:14}),e[2]=x):x=e[2];let d;e[3]!==u?(d=s.jsx(zt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":u,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:La,children:x})}),e[3]=u,e[4]=d):d=e[4];let g;e[5]!==o||e[6]!==a?(g=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(el,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=g):g=e[7];let f;e[8]!==n||e[9]!==a?(f=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(Zo,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=f):f=e[10];let p;e[11]!==c||e[12]!==a?(p=c&&s.jsxs(s.Fragment,{children:[s.jsx(Rt,{}),s.jsxs(lt,{onClick:c,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Qo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=p):p=e[13];let y;e[14]!==l||e[15]!==i||e[16]!==a?(y=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(Rt,{}),l&&s.jsxs(lt,{onClick:l,children:[s.jsx(Is,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Ms,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Rt,{}),e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(sn,{size:14}),e[19]=v):v=e[19];let S;e[20]!==a?(S=a("sandbox.itemActions.delete"),e[20]=a,e[21]=S):S=e[21];let k;e[22]!==r||e[23]!==S?(k=s.jsxs(lt,{onClick:r,className:"text-destructive focus:text-destructive",children:[v,S]}),e[22]=r,e[23]=S,e[24]=k):k=e[24];let w;e[25]!==k||e[26]!==g||e[27]!==f||e[28]!==p||e[29]!==y?(w=s.jsxs(Vt,{align:"end",className:"w-44",children:[g,f,p,y,h,k]}),e[25]=k,e[26]=g,e[27]=f,e[28]=p,e[29]=y,e[30]=w):w=e[30];let j;return e[31]!==w||e[32]!==d?(j=s.jsxs(Ut,{children:[d,w]}),e[31]=w,e[32]=d,e[33]=j):j=e[33],j}function La(t){return t.stopPropagation()}function Oa(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Ra(t){const e=new Map;for(const n of t){const o=Oa(n.resolveType),c=e.get(o);c?c.push(n):e.set(o,[n])}return[...e.entries()].map(([n,o])=>({label:n,sections:o})).sort((n,o)=>n.label.localeCompare(o.label))}function Ts(t){const e=Ce.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=_e("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",c),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==n?(i=s.jsx(n,{size:13,className:"shrink-0"}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const _s=U.lazy(()=>Fe(()=>import("./app-editor-CRjlYU-M.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193])).then(t=>({default:t.AppEditor}))),Fa=U.lazy(()=>Fe(()=>import("./post-editor-DyayPm7u.js"),__vite__mapDeps([194,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,32,61,31,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,80,93,195,135,106,146,147,79,110,102,186,130,182,101,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,27,103,104,105,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,131,132,133,134,136,137,138,139,140,141,142,143,144,145,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,187,188,189,196,197,198,199,190,191,192,193])).then(t=>({default:t.PostEditor}))),Ka=U.lazy(()=>Fe(()=>import("./record-editor-FqHaN2k4.js"),__vite__mapDeps([200,1,2,80,93,27,28,29,130,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,94,95,45,48,39,31,32,33,35,36,37,38,40,41,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,186,187,188,189,198,199,190,191,192,193])).then(t=>({default:t.RecordEditor}))),Ia=U.lazy(()=>Fe(()=>import("./category-editor-zLRtagcy.js"),__vite__mapDeps([201,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,37,52,61,31,32,33,34,35,36,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,178,80,93,196,81,82,83,84,85,86,87,79,88,89,90,91,92,94,95,96,97,98,99,100,101,27,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,185,182,26,183,184,186,187,188,189,197,198,199,190,191,192,193])).then(t=>({default:t.CategoryEditor}))),Ma=U.lazy(()=>Fe(()=>import("./bulk-category-panel-e217-dmm.js"),__vite__mapDeps([202,1,2,52,93,203,43,27,28,29])).then(t=>({default:t.BulkCategoryPanel}))),za=U.lazy(()=>Fe(()=>import("./sections-editor-D-W8vM7g.js"),__vite__mapDeps([204,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,93,80,94,95,28,45,48,39,31,32,33,35,36,37,38,40,41,29,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,101,27,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,182,183,184,185,186,187,188,189,191,205,30,206])).then(t=>({default:t.SectionsEditor}))),Va=U.lazy(()=>Fe(()=>import("./seo-editor-O94He1NF.js"),__vite__mapDeps([207,1,2,25,31,32,33,34,35,36,37,38,39,40,41,28,29,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,26,27,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,83,84,85,86,87,79,88,89,90,91,92,93,80,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,186,187,188,189,205])).then(t=>({default:t.SeoEditor}))),Ua=U.lazy(()=>Fe(()=>import("./variant-calendar-BsFwTl3D.js"),__vite__mapDeps([208,1,2,31,32,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,93,26,27,186,209,190,82,4,5,6,7,8,9,10,83,84,85,86,3,11,12,13,14,15,16,17,18,19,20,21,22,23,24,87,79,88,89,90,91,92,80,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,178,81,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,182,183,184,185,187,188,189,191,192,193])).then(t=>({default:t.VariantCalendar}))),Ha=U.lazy(()=>Fe(()=>import("./post-calendar-CgTLYrrU.js"),__vite__mapDeps([210,1,2,32,31,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,211,26,27,190,82,4,5,6,7,8,9,10,83,84,85,86,3,11,12,13,14,15,16,17,18,19,20,21,22,23,24,87,79,88,89,90,91,92,93,80,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,178,81,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,182,183,184,185,186,187,188,189,191,192,193])).then(t=>({default:t.PostCalendar}))),Ga=U.lazy(()=>Fe(()=>import("./redirect-editor-CWYZom_C.js"),__vite__mapDeps([212,1,2,106,28,80,93,27,29,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,94,95,45,48,39,31,32,33,35,36,37,38,40,41,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,102,103,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,186,187,188,189,199])).then(t=>({default:t.RedirectEditor})));function Ja(t){const e=Ce.c(20),{deepLinkPage:n}=t,o=Qt(),{currentBranch:c}=Ls(),{org:l}=An(),i=o?.entity?.id??null,r=Ko(),a=Io(),{runtime:u,previewServerUrl:x}=Mo(i),d=u==="cms";let g;e[0]!==d||e[1]!==a.previewState||e[2]!==r.lifecycle.phase?(g=vl({fastPreviewActive:d,previewState:a.previewState,lifecyclePhase:r.lifecycle.phase}),e[0]=d,e[1]=a.previewState,e[2]=r.lifecycle.phase,e[3]=g):g=e[3];const f=g;if(f.kind==="sandbox-card"){const h=`/${l.slug}/settings/connections`;let v;return e[4]!==f.state||e[5]!==a.start||e[6]!==h||e[7]!==r.lifecycle||e[8]!==r.phase?(v=s.jsx(bl,{state:f.state,claimPhase:r.phase,lifecycle:r.lifecycle,onStart:a.start,connectionsHref:h}),e[4]=f.state,e[5]=a.start,e[6]=h,e[7]=r.lifecycle,e[8]=r.phase,e[9]=v):v=e[9],v}if(!i||!c){let h;return e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ge,{title:"Waiting for sandbox context…"}),e[10]=h):h=e[10],h}const p=d?x:a.previewUrl;let y;return e[11]!==c||e[12]!==n||e[13]!==f.devServerReady||e[14]!==f.sandboxWarming||e[15]!==a.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==i?(y=s.jsx(Ya,{orgSlug:l.slug,virtualMcpId:i,branch:c,previewUrl:a.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:f.devServerReady,sandboxWarming:f.sandboxWarming}),e[11]=c,e[12]=n,e[13]=f.devServerReady,e[14]=f.sandboxWarming,e[15]=a.previewUrl,e[16]=l.slug,e[17]=p,e[18]=i,e[19]=y):y=e[19],y}const Es=2e3,Wa=15;function Ds(t,e,n,o){return typeof e!="string"||n&&(nn(e,n,o)||t.state.dataUpdateCount>=Wa)?!1:Es}function Ya({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,sitePreviewUrl:c,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const a=Be(),u=Et()?.taskId??null,x={orgSlug:t,virtualMcpId:e,branch:n,threadId:u,previewUrl:o},{data:d,isLoading:g}=Eo(x,{fetchEnabled:i}),f=$s({strict:!1}),[p,y]=U.useState(()=>f.contentCollection&&qe(f.contentCollection)&&f.contentCollection||"pages"),[h,v]=U.useState(()=>f.contentItem&&qe(p)?{collection:p,key:f.contentItem}:null),[S,k]=U.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[j,M]=U.useState(!1);if(w&&!j&&h===null&&d){M(!0);const m=oo(rs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[z,C]=U.useState(""),[I,B]=U.useState(null),[O,_]=U.useState(null),[H,R]=U.useState(null),[F,K]=U.useState("date-desc"),[V,D]=U.useState(()=>new Set),[A,J]=U.useState(null),G=()=>{D(new Set),J(null)},W=m=>{v(m),k(null)},[Z,Y]=U.useState(p);Z!==p&&(Y(p),C(""),B(null),_(null),R(null),K("date-desc"),D(new Set),J(null));const{data:$,isLoading:ee,isFetching:ue}=Do(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(p==="apps"&&h&&h.collection==="apps"){const q=d?.[h.key];return Ds(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(p==="site"&&d){const q=P?cs(d,P):null,Q=d.site,je=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Ds(m,je,P,["seo"])}return!1}}),oe=(m,P)=>!nn(m,$,P)&&(ee||ue),{catalog:te,isLoading:se}=pl($??void 0,d??void 0,{enabled:p==="apps"}),le=aa({orgSlug:t,virtualMcpId:e,branch:n,meta:$}),E=Js(x),ne=$o(x),[X,ae]=U.useState(null),[ce,L]=U.useState(),[me,T]=U.useState(!1),[pe,he]=U.useState(),[ge,ye]=U.useState(null),[ie,de]=U.useState(null),[xe,ke]=U.useState(null),Te=!d||!$;if(g||ee||Te&&r)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})});if(Te)return s.jsx(Ge,{title:"Could not load site data."});const we=rs(d).sort((m,P)=>m.name.localeCompare(P.name)),be=lo(d).sort((m,P)=>m.from.localeCompare(P.from)),De=ao(d,$),$e=p==="sections"?io($):[],N=cs(d,$),re=cn(d),ve=ls.some(m=>re[m].length>0),Ee=qe(p)?re[p]:[],ct=(ve?vt(d,"categories"):[]).map(({key:m,payload:P})=>{const q=typeof P.slug=="string"?P.slug:"",Q=typeof P.name=="string"?P.name:"";return{slug:q||m,name:Q||q||m}}).filter(m=>m.slug).sort((m,P)=>m.name.localeCompare(P.name)),et=p==="posts"&&(V.size>0||A!==null),dt=et?fn(d).filter(m=>V.has(m.key)):[],ut=ds($,"loaders"),tt=ds($,"actions");if(!ro(d,$)&&!ve&&ut===0&&tt===0)return s.jsx(Ge,{icon:Os,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Bt={pages:we.length,sections:De.length,apps:te.length,loaders:ut,actions:tt,redirects:be.length,posts:re.posts.length,authors:re.authors.length,categories:re.categories.length},We=new Set(we.map(m=>Ct(m.path))),st=new Set(we.map(m=>m.name)),mt=new Set(De.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=Xs(d,m.key),Q=Ao(d,m.key,Math.max(0,q-1)),je=Bo(P.sections,Q);if(je)try{await E.mutateAsync({blockKey:m.key,data:{...P,sections:je}}),Se.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:"Could not add variant")}},Ve=()=>{L(void 0),ae({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{L(void 0),ae({mode:"duplicate",sourceKey:m.key,initialName:hs(st,m.name),initialPath:Sl(We,m.path)})},He=m=>{L(void 0),ae({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!X)return;const{mode:P,sourceKey:q}=X;try{if(P==="create"){let Q;if(m.templateKey){const Pe=d[m.templateKey];if(!Pe)throw new Error("Selected template no longer exists.");Q={...Pe,name:m.name,path:m.path}}else Q=Cl(m.name,m.path);const je=Nl(d,m.name);await E.mutateAsync({blockKey:je,data:Q}),Se.success(`Created "${m.name}"`),v({collection:"pages",key:je,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:je,data:Pe}=jl({source:Q,pages:we,newName:m.name,newPath:m.path});await E.mutateAsync({blockKey:je,data:Pe}),Se.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:je,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const je={...Q,name:m.name,path:m.path};await E.mutateAsync({blockKey:q,data:je}),Se.success("Page updated"),h?.collection==="pages"&&h.key===q&&v({collection:"pages",key:q,path:m.path})}ae(null)}catch(Q){L(Q instanceof Error?Q.message:"Save failed")}},fe=({path:m})=>{if(!X)return null;const P=Ct(m);return(X.mode==="rename"?Ct(X.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await E.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),Se.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Ys((m,P)=>E.mutate({blockKey:m,data:P})),bn=async m=>{const P=d[m.key];if(!P){Se.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=kl(d,m.key),Q=hs(mt,m.name),je={...P,name:Q};try{await E.mutateAsync({blockKey:q,data:je}),Se.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:a("sandbox.contentBrowser.duplicateFailed"))}},yn=async m=>{if(!ge)return;const P=d[ge];if(!P){Se.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await E.mutateAsync({blockKey:ge,data:{...P,name:m}}),Se.success(a("sandbox.contentBrowser.sectionRenamed")),ye(null)}catch(q){Se.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},vn=()=>{he(void 0),T(!0)},Sn=async m=>{const P=co(d,m.from),q=uo(m);try{await E.mutateAsync({blockKey:P,data:q}),Se.success("Created redirect"),T(!1),v({collection:"redirects",key:P})}catch(Q){he(Q instanceof Error?Q.message:"Could not create redirect")}},kn=async m=>{const P=Kt(d,m),q=it(P,m,pn(m));try{await E.mutateAsync({blockKey:P,data:q}),Se.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){Se.error(Q instanceof Error?Q.message:"Could not create")}},jn=async m=>{const P=Kt(d,"posts"),q=it(P,"posts",Ql(m));try{await E.mutateAsync({blockKey:P,data:q}),Se.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),Y("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){Se.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},Cn=async(m,P)=>{const q=d[m],Q=q?Zl(xt(q,"posts"),P):null;if(!Q){Se.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await E.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(je){Se.error(je instanceof Error?je.message:a("sandbox.postCalendar.couldNotReschedule"))}},wn=async m=>{const P=d[m.key];if(!P){Se.error("Record not found.");return}const q=Kt(d,m.kind),Q=m.kind==="posts"?"title":"name",je={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await E.mutateAsync({blockKey:q,data:it(q,m.kind,je)}),Se.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:"Duplicate failed")}},Nn=m=>{D(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Pn=m=>{y("posts"),Y("posts"),v(null),k(null),C(""),B(null),_(null),R(null),K("date-desc"),D(new Set),J(m||null)},Tn=async(m,P)=>{const q=[...V];let Q=0;for(const je of q){const Pe=d[je],ot=xt(Pe,"posts"),ft=m==="add"?Ml(ot,P):zl(ot,P);ft!==ot&&(await E.mutateAsync({blockKey:je,data:it(je,"posts",bs(ft))}),Q+=1)}return Q},_n=async(m,P)=>{const q=V.size;try{const Q=await Tn(m,P),je=m==="add"?"Added to":"Moved",Pe=q-Q;Se.success(`${je} ${Q} ${Q===1?"post":"posts"}`+(Pe>0?` (${Pe} already set)`:"")),G()}catch(Q){Se.error(Q instanceof Error?Q.message:"Bulk update failed")}},En=async()=>{if(ie)try{if(ie.kind==="blog-bulk"){for(const Q of ie.keys)await ne.mutateAsync({blockKey:Q});Se.success(`Deleted ${ie.count} ${ie.count===1?"post":"posts"}`),h&&h.collection!=="available-section"&&ie.keys.includes(h.key)&&v(null),G(),de(null);return}const{kind:m,key:P,label:q}=ie;if(m==="blog"){if(ie.blogKind==="categories"){const Q=xt(d[P],"categories").slug,je=typeof Q=="string"?Q:"";if(je)for(const{key:Pe,payload:ot}of vt(d,"posts")){const ft=Vl(ot,je);ft!==ot&&await E.mutateAsync({blockKey:Pe,data:it(Pe,"posts",bs(ft))})}}await ne.mutateAsync({blockKey:P})}else await ne.mutateAsync({blockKey:P});Se.success(`Deleted "${q}"`),h&&h.collection!=="available-section"&&h.key===P&&v(null),de(null)}catch(m){Se.error(m instanceof Error?m.message:"Delete failed")}},St=ne.isPending||E.isPending,Dn=ie?.kind==="blog"?yt[ie.blogKind]:ie?.kind==="blog-bulk"?`${ie.count} ${ie.count===1?"post":"posts"}`:ie?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(gl,{active:p,counts:Bt,showBlog:ve,onSelect:m=>{y(m),v(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="calendar"&&p!=="post-schedule"&&p!=="loaders"&&p!=="actions"&&s.jsx(qa,{activeCollection:p,pages:we,redirects:be,sections:De,availableSections:$e,appCatalog:te,appCatalogLoading:se,blogEntries:Ee,decofile:d,searchQuery:z,onSearchChange:C,postCategoryFilter:I,postAuthorFilter:O,postStatusFilter:H,postSort:F,onPostCategoryFilterChange:m=>{B(m),D(new Set)},onPostAuthorFilterChange:m=>{_(m),D(new Set)},onPostStatusFilterChange:m=>{R(m),D(new Set)},onPostSortChange:K,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:Nn,onSelectAllPosts:m=>D(new Set(m)),onClearPostSelection:()=>D(new Set),onExitPostSelection:G,onBulkDeletePosts:()=>de({kind:"blog-bulk",keys:[...V],count:V.size}),selection:h,onSelect:W,onCreate:()=>{p==="pages"?Ve():p==="redirects"?vn():qe(p)&&kn(p)},onDuplicatePage:Ue,onRenamePage:He,onAddPageVariant:nt,onDeletePage:m=>de({kind:"page",key:m.key,label:m.name}),onEditPageSeo:m=>{const P={collection:"pages",key:m.key,path:m.path};v(P),k(m.key)},onViewPageJson:m=>ke(m.key),onDuplicateSection:bn,onRenameSection:m=>ye(m.key),onDeleteSection:m=>de({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>de({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:wn,onDeleteBlog:m=>de({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?s.jsx(ma,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:$,decofile:d,kind:p}):s.jsx(U.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?s.jsx(Ua,{decofile:d}):p==="post-schedule"?s.jsx(Ha,{decofile:d,support:le,isCreating:E.isPending,onCreate:m=>{jn(m)},onReschedule:(m,P)=>{Cn(m,P)},onSelect:m=>{y("posts"),Y("posts"),v({collection:"posts",key:m}),k(null)}}):p==="site"?N?s.jsx(_s,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:$,title:"Site",excludeFields:["seo"],schemaPending:oe(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(Ge,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="seo"?s.jsx(Va,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:$,target:{kind:"site"},previewBaseUrl:c}):p==="sections"?s.jsx(Na,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:$,decofile:d,isCreating:E.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(Ma,{posts:dt,categories:ct,initialSlug:A,isPending:E.isPending,onApply:(m,P)=>{_n(m,P)},onClose:G},A??"selection"):h&&h.collection!=="available-section"?h.collection==="apps"?s.jsx(_s,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,previewBaseUrl:o,schemaPending:oe(typeof d[h.key]?.__resolveType=="string"?String(d[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="posts"?s.jsx(Fa,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,previewBaseUrl:c},`post:${h.key}`):h.collection==="categories"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,onManagePosts:Pn,onOpenPost:m=>{y("posts"),Y("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${h.key}`):h.collection==="authors"?s.jsx(Ka,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:h.key,block:d[h.key]},`authors:${h.key}`):h.collection==="redirects"?s.jsx(Ga,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key]},`redirect:${h.key}`):s.jsx(za,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&S===h.key,onExitSeo:()=>k(null)},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):s.jsx(Ge,{title:`Select ${qe(p)?`a ${yt[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),X&&s.jsx(El,{open:!!X,mode:X.mode,initialName:X.initialName,initialPath:X.initialPath,isPending:E.isPending,error:ce,templates:we,validate:fe,onSubmit:b,onOpenChange:m=>{m||(ae(null),L(void 0))}}),s.jsx(Al,{open:me,isPending:E.isPending,error:pe,onSubmit:Sn,onOpenChange:m=>{m||(T(!1),he(void 0))}}),ge&&s.jsx(Bl,{open:!!ge,blockKey:ge,initialName:De.find(m=>m.key===ge)?.name??ge,isPending:E.isPending,onSubmit:yn,onOpenChange:m=>{m||ye(null)}}),xe&&s.jsx(Lo,{open:!!xe,onOpenChange:m=>{m||ke(null)},pageKey:xe,decofile:d,onSave:m=>E.mutateAsync({blockKey:xe,data:m})}),s.jsx(Un,{open:!!ie,onOpenChange:m=>{!m&&!St&&de(null)},children:s.jsxs(Hn,{children:[s.jsxs(Gn,{children:[s.jsx(Jn,{children:`Delete ${Dn}?`}),s.jsx(Wn,{children:ie?.kind==="section"?`"${ie.label}" will be removed. Pages that still reference it will lose this section.`:ie?.kind==="blog-bulk"?`${ie.count} ${ie.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ie?`"${ie.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(Yn,{children:[s.jsx(qn,{disabled:St,children:"Cancel"}),s.jsx(Qn,{onClick:m=>{m.preventDefault(),En()},disabled:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:St?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function qa(t){const e=Ce.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:g,postCategoryFilter:f,postAuthorFilter:p,postStatusFilter:y,postSort:h,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:w,selectedPostKeys:j,postBulkPanelOpen:M,onTogglePostSelect:z,onSelectAllPosts:C,onClearPostSelection:I,onExitPostSelection:B,onBulkDeletePosts:O,selection:_,onSelect:H,onCreate:R,onDuplicatePage:F,onRenamePage:K,onAddPageVariant:V,onDeletePage:D,onEditPageSeo:A,onViewPageJson:J,onDuplicateSection:G,onRenameSection:W,onDeleteSection:Z,onDeleteRedirect:Y,onDuplicateBlog:$,onDeleteBlog:ee}=t;let ue,oe,te,se,le,E,ne;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==O||e[8]!==I||e[9]!==R||e[10]!==ee||e[11]!==D||e[12]!==Y||e[13]!==Z||e[14]!==$||e[15]!==F||e[16]!==G||e[17]!==A||e[18]!==B||e[19]!==S||e[20]!==v||e[21]!==w||e[22]!==k||e[23]!==K||e[24]!==W||e[25]!==g||e[26]!==H||e[27]!==C||e[28]!==z||e[29]!==J||e[30]!==o||e[31]!==p||e[32]!==M||e[33]!==f||e[34]!==h||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==j||e[40]!==_){const L=d.toLowerCase(),me=o.filter(b=>!L||b.name.toLowerCase().includes(L)||b.path.toLowerCase().includes(L)),T=c.filter(b=>!L||b.from.toLowerCase().includes(L)||b.to.toLowerCase().includes(L)),pe=l.filter(b=>!L||b.name.toLowerCase().includes(L)||b.key.toLowerCase().includes(L)||b.resolveType.toLowerCase().includes(L)),he=i.filter(b=>!L||b.title.toLowerCase().includes(L)||b.resolveType.toLowerCase().includes(L)||(b.description?.toLowerCase().includes(L)??!1)),ge=Ra(pe),ye=r.filter(b=>!L||b.title.toLowerCase().includes(L)||b.app.toLowerCase().includes(L)||b.vendor.toLowerCase().includes(L)||b.category.toLowerCase().includes(L)),ie=u.filter(b=>!L||b.label.toLowerCase().includes(L)||b.subtitle.toLowerCase().includes(L)),de=n==="posts",xe=ei,ke=de?fn(x):[],Te=new Map,we=new Map,be={published:0,scheduled:0,draft:0};for(const b of ke)be[b.status]=be[b.status]+1;for(const b of ke){for(const fe of b.categorySlugs)Te.set(fe,(Te.get(fe)??0)+1);for(const fe of b.authorEmails)we.set(fe,(we.get(fe)??0)+1)}const De=(de?vt(x,"categories"):[]).map(b=>{const{key:fe,payload:Ae}=b,Ye=xe(Ae.slug)||fe;return{slug:Ye,name:xe(Ae.name)||xe(Ae.slug)||fe,count:Te.get(Ye)??0}}).filter(Za),$e=(de?vt(x,"authors"):[]).map(b=>{const{key:fe,payload:Ae}=b,Ye=xe(Ae.email);return{email:Ye,name:xe(Ae.name)||xe(Ae.email)||fe,count:we.get(Ye)??0}}).filter(Xa);let N;e[48]!==f?(N=b=>!f||b.categorySlugs.includes(f),e[48]=f,e[49]=N):N=e[49];let re;e[50]!==p?(re=b=>!p||b.authorEmails.includes(p),e[50]=p,e[51]=re):re=e[51];let ve;e[52]!==y?(ve=b=>!y||b.status===y,e[52]=y,e[53]=ve):ve=e[53];let Ee;e[54]!==h?(Ee=(b,fe)=>{if(h==="az")return b.title.localeCompare(fe.title);if(h==="za")return fe.title.localeCompare(b.title);const Ae=b.date.localeCompare(fe.date);return h==="date-asc"?Ae:-Ae},e[54]=h,e[55]=Ee):Ee=e[55];const ct=ke.filter(b=>!L||b.title.toLowerCase().includes(L)||b.slug.toLowerCase().includes(L)).filter(N).filter(re).filter(ve).sort(Ee),et=j.size,dt=ct.map(Qa),ut=dt.length>0&&dt.every(b=>j.has(b)),tt=et>0||M,Bt=()=>{ut?I():C(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";le="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let nt;e[56]===Symbol.for("react.memo_cache_sentinel")?(nt=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==g?(Ve=b=>g(b.target.value),e[57]=g,e[58]=Ve):Ve=e[58];let Ue;e[59]!==We||e[60]!==d||e[61]!==Ve?(Ue=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[nt,s.jsx("input",{type:"text",value:d,onChange:Ve,placeholder:We,"aria-label":We,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[59]=We,e[60]=d,e[61]=Ve,e[62]=Ue):Ue=e[62];let He;e[63]!==st||e[64]!==R||e[65]!==mt?(He=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:R,"aria-label":st,children:s.jsx(Vn,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=R,e[65]=mt,e[66]=He):He=e[66],e[67]!==Ue||e[68]!==He?(E=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,He]}),e[67]=Ue,e[68]=He,e[69]=E):E=e[69],ne=de&&(tt?s.jsx($a,{count:et,allSelected:ut,onToggleSelectAll:Bt,onDelete:O,onExit:B}):s.jsx(Ta,{categories:De,authors:$e,categoryFilter:f,statusCounts:be,authorFilter:p,statusFilter:y,sort:h,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:w})),ue=Dt,se="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",oe="flex flex-col gap-1 p-1.5",te=n==="pages"?me.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):me.map(b=>{const fe=_?.collection==="pages"&&_.key===b.key,Ae=Xs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:fe,variantCount:Ae,onClick:()=>H({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>F(b),onRename:()=>K(b),onAddVariant:()=>V(b),onEditSeo:()=>A(b),onViewJson:()=>J(b),onDelete:()=>D(b)})},b.key)}):n==="sections"?pe.length===0&&he.length===0?s.jsx(at,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[ge.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ts,{icon:It,label:"Saved sections"}),ge.map(b=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:b.label}),b.sections.map(fe=>{const Ae=_?.collection==="sections"&&_.key===fe.key;return s.jsx(Re,{icon:It,accent:"global",title:fe.name,subtitle:b.label,active:Ae,onClick:()=>H({collection:"sections",key:fe.key}),menu:s.jsx(gt,{onDuplicate:()=>G(fe),onRename:()=>W(fe),onDelete:()=>Z(fe)})},fe.key)})]},b.label))]}),he.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ts,{icon:jt,label:"Available sections",className:_e(ge.length>0&&"mt-3")}),he.map(b=>{const fe=_?.collection==="available-section"&&_.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:fe,onClick:()=>H({collection:"available-section",resolveType:b.resolveType,title:b.title})},b.resolveType)})]})]}):n==="apps"?a?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Qe,{className:"size-4.5 text-muted-foreground"})}):ye.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ye.map(b=>{const fe=_?.collection==="apps"&&b.blockKey!==null&&_.key===b.blockKey;return s.jsx(Re,{icon:zs,logoUrl:b.logo,title:b.title,subtitle:b.category,active:fe,trailing:b.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!b.installed||!b.blockKey){Se.message(`${b.title} is not installed on this site.`);return}H({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?T.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):T.map(b=>s.jsx(Re,{icon:Rs,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:_?.collection==="redirects"&&_.key===b.key,trailing:s.jsx($l,{type:b.type}),onClick:()=>H({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>Y(b)})},b.key)):de?ct.length===0?s.jsx(at,{hasItems:ke.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const fe={key:b.key,kind:"posts",label:b.title,subtitle:b.slug};return s.jsx(Re,{icon:Mt,title:b.title,subtitle:b.slug||"no slug",invalid:b.missing.length>0,invalidReason:`Missing: ${b.missing.join(", ")}`,active:_?.collection==="posts"&&_.key===b.key,selectable:!0,selectionActive:tt,selected:j.has(b.key),onToggleSelect:()=>z(b.key),onClick:()=>tt?z(b.key):H({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>$(fe),onDelete:()=>ee(fe)})},b.key)}):ie.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ie.map(b=>{const fe=_?.collection===b.kind&&_.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Mt:b.kind==="authors"?Us:Ks,title:b.label,subtitle:b.subtitle,active:fe,onClick:()=>H({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>$(b),onDelete:()=>ee(b)})},b.key)}),e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=u,e[5]=x,e[6]=V,e[7]=O,e[8]=I,e[9]=R,e[10]=ee,e[11]=D,e[12]=Y,e[13]=Z,e[14]=$,e[15]=F,e[16]=G,e[17]=A,e[18]=B,e[19]=S,e[20]=v,e[21]=w,e[22]=k,e[23]=K,e[24]=W,e[25]=g,e[26]=H,e[27]=C,e[28]=z,e[29]=J,e[30]=o,e[31]=p,e[32]=M,e[33]=f,e[34]=h,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=j,e[40]=_,e[41]=ue,e[42]=oe,e[43]=te,e[44]=se,e[45]=le,e[46]=E,e[47]=ne}else ue=e[41],oe=e[42],te=e[43],se=e[44],le=e[45],E=e[46],ne=e[47];let X;e[70]!==oe||e[71]!==te?(X=s.jsx("div",{className:oe,children:te}),e[70]=oe,e[71]=te,e[72]=X):X=e[72];let ae;e[73]!==ue||e[74]!==se||e[75]!==X?(ae=s.jsx(ue,{className:se,children:X}),e[73]=ue,e[74]=se,e[75]=X,e[76]=ae):ae=e[76];let ce;return e[77]!==le||e[78]!==E||e[79]!==ne||e[80]!==ae?(ce=s.jsxs("div",{className:le,children:[E,ne,ae]}),e[77]=le,e[78]=E,e[79]=ne,e[80]=ae,e[81]=ce):ce=e[81],ce}function Qa(t){return t.key}function Xa(t){return t.email}function Za(t){return t.slug}function ei(t){return typeof t=="string"?t:""}function ti(t){const e=Ce.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=U.useState(!1),i=tn(n),{activeTask:r}=Ls();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=$s(a);if(!(fs(i?.metadata)||fs(r?.metadata))){let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(ps,{className:"size-7 text-foreground"})}),e[1]=g):g=e[1];let f;e[2]!==o?(f=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let y,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),h=s.jsx(ps,{className:"size-4"}),e[6]=y,e[7]=h):(y=e[6],h=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let S;e[10]!==v?(S=s.jsxs(Oe,{onClick:y,children:[h,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==f||e[13]!==p||e[14]!==S?(k=s.jsx(tl,{className:"h-full",image:g,title:f,description:p,actions:S}),e[12]=f,e[13]=p,e[14]=S,e[15]=k):k=e[15];let w;e[16]!==c?(w=s.jsx(sl,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=w):w=e[17];let j;return e[18]!==w||e[19]!==k?(j=s.jsxs(s.Fragment,{children:[k,w]}),e[18]=w,e[19]=k,e[20]=j):j=e[20],j}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Ja,{deepLinkPage:{pageId:u.contentPageId,path:u.contentPath,pathTemplate:u.contentPathTemplate}}),e[21]=u.contentPageId,e[22]=u.contentPath,e[23]=u.contentPathTemplate,e[24]=d):d=e[24],d}function si(){const t=Ce.c(2),e=nl();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx(ti,{virtualMcpId:e})}),t[0]=e,t[1]=n):n=t[1],n}const ar=Object.freeze(Object.defineProperty({__proto__:null,default:si},Symbol.toStringTag,{value:"Module"}));export{sa as A,nr as B,ar as C,Qi as M,qi as W,or as a,it as b,lr as c,Gi as d,Hi as e,Ji as f,xt as g,Jl as h,Yl as i,Yi as j,fn as k,vt as l,dn as m,kl as n,Wi as o,mn as p,Xi as q,ll as r,bs as s,er as t,aa as u,Xe as v,tr as w,Zi as x,sr as y,Tt as z};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-DeI0TeES.js","assets/index-B3yBTWEk.js","assets/index-DJADaZ4J.css","assets/chat-context-CXknhaDs.js","assets/use-panel-navigate-Byvx0cbx.js","assets/thread-route-CKY-dKC0.js","assets/use-project-scope-B2cuvtTy.js","assets/use-virtual-mcp-Bk09OpEg.js","assets/use-mcp-client-DsJzBus3.js","assets/auth-RjDDTUUT.js","assets/github-repo-C0igpkr9.js","assets/autosend-HdosN86x.js","assets/thread-intent-DVKldCEq.js","assets/slugify-CEUa2lfQ.js","assets/hooks-k1OxvonE.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/decopilot-sse-pool-CfYFArSW.js","assets/task-board-CXsHf2Zn.js","assets/schema-BQbhQoxs.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-ai-providers-qnkcjapR.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-DYRVevWg.js","assets/use-organization-settings-BAVHurZk.js","assets/ChevronRight-DzRB-rdO.js","assets/scroll-area-BgZjjLM3.js","assets/select-Bc5UZb4n.js","assets/Check-BWpBE9uf.js","assets/ChevronUp-DGrguvGW.js","assets/use-section-preview-base-CwIWGkgy.js","assets/agent-icon-DrlilhFJ.js","assets/AlertCircle-EniJtD8E.js","assets/Tool01-BnKd95Y1.js","assets/ArrowUp-C0eratGp.js","assets/ArrowLeft-Clu1mSdY.js","assets/Tool02-C_xRWqQk.js","assets/ArrowRight-Cu8UuHNR.js","assets/TrendUp01-PFzYDizC.js","assets/ZoomOut-BXPGwF_O.js","assets/Users03-CRtXqa1Q.js","assets/CheckCircle-cinYKmPU.js","assets/ChevronSelectorVertical-BiIbFU31.js","assets/DotsVertical-CucJCL9y.js","assets/UserSquare-CCDsU001.js","assets/Copy01-DayLu0dF.js","assets/CreditCard01-4OsjIT5f.js","assets/Database01-2gG_9E30.js","assets/Download01-BC2rKbuh.js","assets/Printer-fz_zwxfT.js","assets/Settings02-D2oiGU4q.js","assets/Eye-dnrP5DkM.js","assets/File02-BhckHV8N.js","assets/Share07-D_kiq5Fr.js","assets/GitBranch01-BBn4dN5f.js","assets/Globe01-SLAc63wC.js","assets/SwitchHorizontal01-CxlKjkIX.js","assets/HardDrive-FlnOYA_8.js","assets/Image01-BrHSH-Vi.js","assets/Key01-CKcg8G1v.js","assets/Link01-3t9JrUgl.js","assets/LinkExternal01-Cp7uxK1i.js","assets/Monitor01-BUruMK2r.js","assets/Sun-nKOZMh9n.js","assets/Package-CdfyZYxN.js","assets/Palette-CglyAOTg.js","assets/Play-rnw1eV52.js","assets/Plus-Bxp02MWl.js","assets/SearchLg-FC9suxna.js","assets/SearchMd-DRRptSJN.js","assets/Shield01-CjyLhqlS.js","assets/Stars01-COChWymR.js","assets/Trash01-DqUm2RRh.js","assets/Upload01-CqWnAR1-.js","assets/User01-BJoNdkjl.js","assets/Users01-DSQPwtP5.js","assets/XCircle-9Cb0khfg.js","assets/XClose-Cw4b4Uag.js","assets/Zap-ChVc0p76.js","assets/dialog-otnvxVN0.js","assets/input-HFOrJf5B.js","assets/index-DOk05MCp.js","assets/use-main-panel-tabs-EW6rbxam.js","assets/use-connection-DCLPda2h.js","assets/use-mcp-tools-Dc3F6Krl.js","assets/types-Csu6Ims7.js","assets/utils-CVEq3hMx.js","assets/tool-namespace-BVMQcKlk.js","assets/drawer-s7gtDrb4.js","assets/collection-search-CzGq8Uso.js","assets/use-mcp-prompts-i0LZ2nQA.js","assets/usage-stats-BNse37Wk.js","assets/form-KjPevg0A.js","assets/label-CqlSWrLn.js","assets/use-copy-14DzRp8J.js","assets/markdown-B1038zFJ.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/input-DxAgQLPa.js","assets/command-palette-store-BwHku_Zt.js","assets/use-open-billing-url-DvTk9GH0.js","assets/use-session-runtime-BHahDP0E.js","assets/tabs-DV8akPGb.js","assets/toggle-group-9HQCpj-q.js","assets/use-deco-credits-rwNQ1gMg.js","assets/index-DlQKfvnq.js","assets/checkbox-D8Ab2Vb-.js","assets/ai-providers-logos-DD3qZ33J.js","assets/avatar-DcDvs8Zz.js","assets/download-app-dialog-BqNRF4Sn.js","assets/popover-DIqZ2IKF.js","assets/input-BnbYz5_9.js","assets/hooks-BhviOOpn.js","assets/use-org-fs-BEoPvlnI.js","assets/dropdown-menu-BxKUbUkE.js","assets/question-004-sINsf4GQ.js","assets/use-members-C0MdJrYz.js","assets/use-org-auth-client-4o0wRx2Q.js","assets/add-connection-dialog-s1GRGQ63.js","assets/extract-connection-data-CqGCTPdZ.js","assets/metadata-dUsYcpuu.js","assets/github-D4UJ99TO.js","assets/connection-OmoYXqZk.js","assets/connection-card-Cy-GdKQl.js","assets/use-registry-connections-DikbDR8w.js","assets/useInfiniteQuery-GKCP1c_7.js","assets/infiniteQueryObserver-DgAoAIrN.js","assets/retry-CErkP7V6.js","assets/connection-slug-CITJ0kGN.js","assets/integration-icon-BPwWRlNG.js","assets/textarea-CneoU2lJ.js","assets/connection-form-helpers-D3hdN_Pk.js","assets/authenticate-and-persist-oauth-DXlrPDSv.js","assets/mcp-oauth-D6isOO_s.js","assets/collection-tabs-BLgGMB42.js","assets/badge-DJpaBl8u.js","assets/use-infinite-scroll-DkLPxlOu.js","assets/useSuspenseInfiniteQuery-DmEiIBI4.js","assets/pair-C08OPQNP.js","assets/collapsible-DH_CZdwE.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Cb8Ud-E7.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-1dFmVwYI.js","assets/anchors-yqDzZN4K.js","assets/source-system-tabs-CnEGUb4r.js","assets/command-B6LMVdkQ.js","assets/index-w1d_dmEj.js","assets/project-icon-Bl3bXnhv.js","assets/required-auth-layout-BEc3NUsQ.js","assets/use-org-sso-CdSz0xa8.js","assets/use-org-notice-CXYMfMUq.js","assets/shell-layout-CuFt8bor.css","assets/use-navigate-to-agent-Bbq0oQ0Y.js","assets/use-thread-outputs-9oZhiYbB.js","assets/file-type-icon-DGllFDOf.js","assets/sandbox-lifecycle-context-CXd9Um8u.js","assets/sandbox-url-D3mC8qhT.js","assets/use-task-metadata-CB3EJ29f.js","assets/use-project-native-view-presence-D-AyEulW.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-BwD1CaWo.js","assets/site-slug-uya6Wp4-.js","assets/virtual-mcp-DGQbDtgM.js","assets/use-status-sounds-CnCb1h48.js","assets/empty-state-Cz1DkYZE.js","assets/serial-task-queue-CGOeQgpr.js","assets/toolbar-D0oe2g2b.js","assets/legacy-main-redirect-ZPChWdtD.js","assets/preview-dialog-b2QyOGzU.js","assets/preview-content-B5xB74fu.js","assets/file-preview-18IJQMnU.js","assets/utils-B14U8IKK.js","assets/editor-DCxsAs7o.js","assets/file-share-button-Cef5f1VZ.js","assets/toolbar-icon-button-EOE8J-Ai.js","assets/github-icon-D51q_6S8.js","assets/decode-html-entities-DDqE27I4.js","assets/alert-dialog-BE9ltHtr.js","assets/use-debounced-value-Cud3o3Fq.js","assets/task-status-DIr_2V94.js","assets/index-DDGTF8rc.css","assets/runnable-block-editor-2CMWc-S3.js","assets/monaco-editor-WNMTPDp9.js","assets/calendar-DTnssie4.js","assets/rich-text-link-control-CrwbAR31.js","assets/switch-CJ5Ir2Zx.js","assets/safe-image-url-D5z803Ot.js","assets/search-input-uXtJ6IU8.js","assets/asset-utils-CR65HphV.js","assets/agent-view-guard-nj1TYVsk.js","assets/mustache-r9snVmI4.js","assets/repository-import-picker-Bg_h8YsG.js","assets/repository-picker-BDWGy2xY.js","assets/post-editor-BAf6FqSQ.js","assets/multi-select-D54pM3d4.js","assets/block-document-LCYQj9PJ.js","assets/index-C1N-CFMR.js","assets/primitives-4_D03rJK.js","assets/use-autosave-CCprSQ13.js","assets/record-editor-n0M7yiQw.js","assets/category-editor-4KcN0JRt.js","assets/bulk-category-panel-D-Hh71MB.js","assets/index-m01im2kT.js","assets/sections-editor-Bv2odcBq.js","assets/page-seo-form-DAkbVQPg.js","assets/variant-matcher-override-DvY-JiuY.js","assets/seo-editor-DJw3ydvJ.js","assets/variant-calendar-urd0wE-3.js","assets/view-mode-toggle-swSorpD7.js","assets/post-calendar-DuH_hA9y.js","assets/alert-D-emvPaG.js","assets/redirect-editor-CK3YSOdb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as Ce,j as s,m as As,K as Bs,b as Be,l as _e,r as U,h as Qe,B as Oe,a6 as Ie,a7 as Me,a9 as ze,t as Se,ap as Jt,I as An,u as $s,an as Fe}from"./index-B3yBTWEk.js";import{A as Bn}from"./agent-view-guard-nj1TYVsk.js";import{b as Et,a as Ls}from"./chat-context-CXknhaDs.js";import{i as Os}from"./AlertCircle-EniJtD8E.js";import{o as jt,v as Rs,w as Fs,x as Ks,y as $n,z as Ln,B as Is,C as On,h as It,D as Rn,E as Fn,F as Kn,G as Ms,H as In,I as Mn,J as zn}from"./agent-icon-DrlilhFJ.js";import{i as Mt}from"./File02-BhckHV8N.js";import{c as zs}from"./SwitchHorizontal01-CxlKjkIX.js";import{s as Vn}from"./Plus-Bxp02MWl.js";import{i as Vs}from"./SearchLg-FC9suxna.js";import{t as Us}from"./Users01-DSQPwtP5.js";import{A as Un,a as Hn,b as Gn,c as Jn,d as Wn,e as Yn,f as qn,g as Qn}from"./alert-dialog-BE9ltHtr.js";import{S as Dt}from"./scroll-area-BgZjjLM3.js";import{z as Wt,S as Xn,A as Yt,B as Zn,C as eo,E as to,n as Ct,v as so,F as Hs,G as qt,c as Qt,H as no,I as oo,e as rs,J as lo,g as ao,K as io,L as cs,h as ro,O as co,P as uo}from"./index-DOk05MCp.js";import{S as $t,j as mo,c as fo,g as Gs,B as Lt,P as po,k as ho,n as go,o as xo,u as Js,l as bo,q as yo,R as vo,s as Ws,r as So,t as ko,d as Ys,v as jo,w as qs,x as Qs,y as Co,M as wo,h as No,p as Po,z as To,A as _o,e as Eo,f as Do,C as ds,D as Xs,i as Ao,E as Bo}from"./runnable-block-editor-2CMWc-S3.js";import{u as $o,P as Lo}from"./mustache-r9snVmI4.js";import{t as Xt}from"./ChevronUp-DGrguvGW.js";import{s as Zs}from"./Database01-2gG_9E30.js";import{i as en}from"./Zap-ChVc0p76.js";import{C as Oo,a as Ro,b as Fo}from"./collapsible-DH_CZdwE.js";import{u as Ko,a as Io}from"./sandbox-lifecycle-context-CXd9Um8u.js";import{u as Mo}from"./use-session-runtime-BHahDP0E.js";import{c as Zt,d as es,e as ts,b as ss,D as ns,h as zo}from"./dialog-otnvxVN0.js";import{I as rt}from"./input-HFOrJf5B.js";import{C as os}from"./checkbox-D8Ab2Vb-.js";import{L as Ot}from"./label-CqlSWrLn.js";import{c as Vo,b as Uo,a as Ho,d as Go,S as Jo}from"./select-Bc5UZb4n.js";import{a as tn}from"./use-virtual-mcp-Bk09OpEg.js";import{i as Nt}from"./ChevronRight-DzRB-rdO.js";import{i as us}from"./Share07-D_kiq5Fr.js";import{i as Wo}from"./Globe01-SLAc63wC.js";import{c as Yo,b as qo,s as Qo}from"./TrendUp01-PFzYDizC.js";import"./rich-text-link-control-CrwbAR31.js";import{M as Xo}from"./monaco-editor-WNMTPDp9.js";import{s as sn}from"./Trash01-DqUm2RRh.js";import{d as bt,f as pt,D as zt,e as ms,b as Vt,c as Ut,a as lt,g as Rt}from"./dropdown-menu-BxKUbUkE.js";import{a as Zo}from"./Copy01-DayLu0dF.js";import{i as el}from"./Tool01-BnKd95Y1.js";import{b as fs}from"./use-project-scope-B2cuvtTy.js";import{E as tl}from"./empty-state-Cz1DkYZE.js";import{G as ps}from"./github-icon-D51q_6S8.js";import{R as sl}from"./repository-import-picker-Bg_h8YsG.js";import{a as nl}from"./thread-route-CKY-dKC0.js";function ol(t,e){if(!t||!e?.length)return t;const n=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(n).length>0?{...t,properties:n}:t}function ll(t,e,n){return typeof t!="string"?null:ol(Wt(t,e),n)}function nn(t,e,n){if(!e||typeof t!="string")return!1;const o=ll(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=Ce.c(6),{hasItems:n,emptyLabel:o,emptyHint:c}=t;let l;e[0]!==c||e[1]!==o||e[2]!==n?(l=n?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:c})]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function At(t,e){return`${t}-${e}`}function on(t,e){return`site/apps/${t}/${e}.ts`}function ln(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const n=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return n?{vendor:n[1],app:n[2]}:null}function al(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function il(t){return t==="local"?"Custom":"Installed"}function an(t,e,n){const o=new Set([At(t,e),e].map(l=>l.toLowerCase())),c=on(t,e);for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===c)return l}return null}function rl(t,e){const n=t.vendor.alias,o=t.name,c=an(n,o,e);return{id:At(n,o),app:o,vendor:n,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:on(n,o),blockKey:c,installed:c!==null}}function cl(t,e,n){if(t===Xn)return null;const o=ln(t);if(!o)return null;const{vendor:c,app:l}=o,i=an(c,l,n),r=Yt(t,e);return{id:At(c,l),app:l,vendor:c,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:i,installed:i!==null}}function dl(t,e,n){const o=e.__resolveType;if(typeof o!="string"||Zn(t,e)||!eo(o))return null;const c=ln(o)??al(t);if(!c)return null;const l=Yt(o,n),{vendor:i,app:r}=c;return{id:At(i,r),app:r,vendor:i,title:l.title??to(t,e,n),description:l.description??"",category:il(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function ul(t,e,n){const o=new Map;for(const l of t){const i=rl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=cl(l,e,n);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=dl(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(ml)}function ml(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function fl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function pl(t,e,n){const o=Ce.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Bs.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:fl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=As(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?ul(r.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=r.data,o[6]=a):a=o[6];const u=a,x=r.isLoading&&!r.isError;let d;return o[7]!==u||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==x?(d={catalog:u,isLoading:x,isError:r.isError,refetch:r.refetch},o[7]=u,o[8]=r.isError,o[9]=r.refetch,o[10]=x,o[11]=d):d=o[11],d}const hl=["sections","apps","loaders","actions"];function gl(t){const e=Ce.c(59),{active:n,counts:o,showBlog:c,onSelect:l}=t,i=Be();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==r?(a=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=u):u=e[5];const x=n==="pages";let d;e[6]!==o.pages||e[7]!==l||e[8]!==u||e[9]!==x?(d=s.jsx(Le,{id:"pages",icon:jt,label:u,count:o.pages,active:x,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=u,e[9]=x,e[10]=d):d=e[10];let g;e[11]!==i?(g=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=g):g=e[12];const f=n==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==g||e[16]!==f?(p=s.jsx(Le,{id:"redirects",icon:Rs,label:g,count:o.redirects,active:f,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=g,e[16]=f,e[17]=p):p=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const h=n==="site";let v;e[20]!==l||e[21]!==h||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:Ln,label:y,active:h,onSelect:l}),e[20]=l,e[21]=h,e[22]=y,e[23]=v):v=e[23];let S;e[24]!==i?(S=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=S):S=e[25];const k=n==="seo";let w;e[26]!==l||e[27]!==S||e[28]!==k?(w=s.jsx(Le,{id:"seo",icon:Is,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=w):w=e[29];let j;e[30]!==i?(j=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=j):j=e[31];const M=n==="calendar";let z;e[32]!==l||e[33]!==j||e[34]!==M?(z=s.jsx(Le,{id:"calendar",icon:On,label:j,active:M,onSelect:l}),e[32]=l,e[33]=j,e[34]=M,e[35]=z):z=e[35];let C;e[36]!==n||e[37]!==o||e[38]!==l?(C=s.jsx(xl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=C):C=e[39];let I;e[40]!==n||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==c||e[46]!==i?(I=c&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Fs,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Le,{id:"posts",icon:Mt,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:n==="posts",onSelect:l}),s.jsx(Le,{id:"authors",icon:Us,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Ks,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:$n,label:i("sandbox.collectionsSidebar.postSchedule"),active:n==="post-schedule",onSelect:l})]}),e[40]=n,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=c,e[46]=i,e[47]=I):I=e[47];let B;e[48]!==v||e[49]!==w||e[50]!==z||e[51]!==C||e[52]!==I||e[53]!==d||e[54]!==p?(B=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,p,v,w,z,C,I]}),e[48]=v,e[49]=w,e[50]=z,e[51]=C,e[52]=I,e[53]=d,e[54]=p,e[55]=B):B=e[55];let O;return e[56]!==a||e[57]!==B?(O=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,B]}),e[56]=a,e[57]=B,e[58]=O):O=e[58],O}function xl(t){const e=Ce.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=hl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=U.useState(!1),x=a||r;let d,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=_e("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),g=s.jsx(Rn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=g):(d=e[2],g=e[3]);let f;e[4]!==l?(f=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==f?(p=s.jsx("span",{className:"flex-1 truncate",children:f}),e[6]=f,e[7]=p):p=e[7];const y=x&&"rotate-180";let h;e[8]!==y?(h=_e("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=h):h=e[9];let v;e[10]!==h?(v=s.jsx(Xt,{size:16,className:h}),e[10]=h,e[11]=v):v=e[11];let S;e[12]!==p||e[13]!==v?(S=s.jsxs(Oo,{className:d,children:[g,p,v]}),e[12]=p,e[13]=v,e[14]=S):S=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const w=n==="sections";let j;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==w?(j=s.jsx(Le,{id:"sections",icon:It,label:k,count:o.sections,active:w,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=w,e[21]=j):j=e[21];let M;e[22]!==l?(M=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=M):M=e[23];const z=n==="apps";let C;e[24]!==o.apps||e[25]!==c||e[26]!==M||e[27]!==z?(C=s.jsx(Le,{id:"apps",icon:zs,label:M,count:o.apps,active:z,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=M,e[27]=z,e[28]=C):C=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const B=n==="loaders";let O;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==B?(O=s.jsx(Le,{id:"loaders",icon:Zs,label:I,count:o.loaders,active:B,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=B,e[35]=O):O=e[35];let _;e[36]!==l?(_=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=_):_=e[37];const H=n==="actions";let R;e[38]!==o.actions||e[39]!==c||e[40]!==_||e[41]!==H?(R=s.jsx(Le,{id:"actions",icon:en,label:_,count:o.actions,active:H,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=_,e[41]=H,e[42]=R):R=e[42];let F;e[43]!==j||e[44]!==C||e[45]!==O||e[46]!==R?(F=s.jsxs(Ro,{className:"flex flex-col gap-0.5 pt-0.5",children:[j,C,O,R]}),e[43]=j,e[44]=C,e[45]=O,e[46]=R,e[47]=F):F=e[47];let K;return e[48]!==x||e[49]!==F||e[50]!==S?(K=s.jsxs(Fo,{open:x,onOpenChange:u,children:[S,F]}),e[48]=x,e[49]=F,e[50]=S,e[51]=K):K=e[51],K}function Le(t){const e=Ce.c(19),{id:n,icon:o,label:c,count:l,active:i,onSelect:r,indent:a}=t;let u;e[0]!==n||e[1]!==r?(u=()=>r(n),e[0]=n,e[1]=r,e[2]=u):u=e[2];const x=a&&"pl-6",d=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let g;e[3]!==x||e[4]!==d?(g=_e("flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",x,d),e[3]=x,e[4]=d,e[5]=g):g=e[5];let f;e[6]!==o?(f=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==c?(p=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=p):p=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:_e("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=y):y=e[12];let h;return e[13]!==u||e[14]!==g||e[15]!==f||e[16]!==p||e[17]!==y?(h=s.jsxs("button",{type:"button",onClick:u,className:g,children:[f,p,y]}),e[13]=u,e[14]=g,e[15]=f,e[16]=p,e[17]=y,e[18]=h):h=e[18],h}function bl(t){const e=Ce.c(12),{state:n,claimPhase:o,lifecycle:c,onStart:l,connectionsHref:i}=t;switch(n.kind){case"starting":{let r;e[0]!==o||e[1]!==c?(r=mo({claimPhase:o,lifecycle:c}),e[0]=o,e[1]=c,e[2]=r):r=e[2];let a;return e[3]!==o||e[4]!==r?(a=s.jsx($t,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=a):a=e[5],a}case"suspended":{let r;return e[6]!==l?(r=s.jsx($t,{kind:"suspended",onResume:l}),e[6]=l,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==i||e[9]!==l||e[10]!==n.error?(r=s.jsx($t,{kind:"errored",error:n.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=n.error,e[11]=r):r=e[11],r}}}const yl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function vl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",n=!e&&!yl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function hs(t,e){const n=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${n} (copy)`;if(!t.has(o))return o;for(let c=2;c<1e3;c++){const l=`${n} (copy ${c})`;if(!t.has(l))return l}return`${n} (copy ${Date.now()})`}function Sl(t,e){const n=Ct,o=e.replace(/-copy(?:-\d+)?$/,""),c=`${o}-copy`;if(!t.has(n(c)))return c;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(n(i)))return i}return`${o}-copy-${Date.now()}`}function kl(t,e){const n=e.replace(/_copy(?:_\d+)?$/,""),o=`${n}_copy`;if(!Object.hasOwn(t,o))return o;for(let c=2;c<1e3;c++){const l=`${n}_copy_${c}`;if(!Object.hasOwn(t,l))return l}return`${n}_copy_${Date.now()}`}function jl(t){const e=Gs(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function Cl(t,e){return fo(t,e)}const wl=1e3;function Nl(t,e){for(let n=0;n<wl;n++){const o=Gs(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Pl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Tl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},_l={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function El(t){const e=Ce.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,g=i===void 0?!1:i,f=Be(),[p,y]=U.useState(c),[h,v]=U.useState(l),[S,k]=U.useState(Lt),[w,j]=U.useState(null),[M,z]=U.useState(n);n!==M&&(z(n),n&&(y(c),v(l),k(Lt),j(null)));const C=o==="create"&&!!a?.length;let I;e[0]!==g||e[1]!==d?(I=he=>{!he&&!g&&(j(null),d(!1))},e[0]=g,e[1]=d,e[2]=I):I=e[2];const B=I;let O;e[3]!==g||e[4]!==p||e[5]!==x||e[6]!==h||e[7]!==C||e[8]!==S||e[9]!==u?(O=async he=>{he.preventDefault();const ge=p.trim(),ye=h.trim();if(!ge||!ye||g)return;const ie=so(ye);if(ie){j(ie);return}const de=u?.({name:ge,path:ye});if(de){j(de);return}j(null),await x({name:ge,path:ye,templateKey:C&&S!==Lt?S:null})},e[3]=g,e[4]=p,e[5]=x,e[6]=h,e[7]=C,e[8]=S,e[9]=u,e[10]=O):O=e[10];const _=O,H=w??r,R=Pl[o];let F;e[11]!==f||e[12]!==R?(F=f(R),e[11]=f,e[12]=R,e[13]=F):F=e[13];let K;e[14]!==F?(K=s.jsx(Zt,{children:s.jsx(es,{children:F})}),e[14]=F,e[15]=K):K=e[15];let V;e[16]!==g||e[17]!==C||e[18]!==f||e[19]!==S||e[20]!==a?(V=C&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:f("sandbox.pageFormDialog.labelTemplate")}),s.jsx(po,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:g})]}),e[16]=g,e[17]=C,e[18]=f,e[19]=S,e[20]=a,e[21]=V):V=e[21];let D;e[22]!==f?(D=f("sandbox.pageFormDialog.labelName"),e[22]=f,e[23]=D):D=e[23];let A;e[24]!==D?(A=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:D}),e[24]=D,e[25]=A):A=e[25];let J;e[26]===Symbol.for("react.memo_cache_sentinel")?(J=he=>y(he.target.value),e[26]=J):J=e[26];let G;e[27]!==f?(G=f("sandbox.pageFormDialog.placeholderName"),e[27]=f,e[28]=G):G=e[28];let W;e[29]!==g||e[30]!==p||e[31]!==G?(W=s.jsx(rt,{id:"page-form-name",value:p,onChange:J,placeholder:G,autoFocus:!0,disabled:g}),e[29]=g,e[30]=p,e[31]=G,e[32]=W):W=e[32];let Z;e[33]!==W||e[34]!==A?(Z=s.jsxs("div",{className:"space-y-1.5",children:[A,W]}),e[33]=W,e[34]=A,e[35]=Z):Z=e[35];let Y;e[36]!==f?(Y=f("sandbox.pageFormDialog.labelPath"),e[36]=f,e[37]=Y):Y=e[37];let $;e[38]!==Y?($=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:Y}),e[38]=Y,e[39]=$):$=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=he=>v(he.target.value),e[40]=ee):ee=e[40];let ue;e[41]!==f?(ue=f("sandbox.pageFormDialog.placeholderPath"),e[41]=f,e[42]=ue):ue=e[42];let oe;e[43]!==g||e[44]!==h||e[45]!==ue?(oe=s.jsx(rt,{id:"page-form-path",value:h,onChange:ee,placeholder:ue,disabled:g}),e[43]=g,e[44]=h,e[45]=ue,e[46]=oe):oe=e[46];let te;e[47]!==$||e[48]!==oe?(te=s.jsxs("div",{className:"space-y-1.5",children:[$,oe]}),e[47]=$,e[48]=oe,e[49]=te):te=e[49];let se;e[50]!==H?(se=H&&s.jsx("p",{className:"text-xs text-destructive",children:H}),e[50]=H,e[51]=se):se=e[51];let le;e[52]!==Z||e[53]!==te||e[54]!==se||e[55]!==V?(le=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Z,te,se]}),e[52]=Z,e[53]=te,e[54]=se,e[55]=V,e[56]=le):le=e[56];let E;e[57]!==d?(E=()=>d(!1),e[57]=d,e[58]=E):E=e[58];let ne;e[59]!==f?(ne=f("sandbox.pageFormDialog.buttonCancel"),e[59]=f,e[60]=ne):ne=e[60];let X;e[61]!==g||e[62]!==E||e[63]!==ne?(X=s.jsx(Oe,{type:"button",variant:"outline",onClick:E,disabled:g,children:ne}),e[61]=g,e[62]=E,e[63]=ne,e[64]=X):X=e[64];let ae;e[65]!==g||e[66]!==p||e[67]!==h?(ae=!p.trim()||!h.trim()||g,e[65]=g,e[66]=p,e[67]=h,e[68]=ae):ae=e[68];let ce;e[69]!==g||e[70]!==o||e[71]!==f?(ce=g?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),f(_l[o])]}):f(Tl[o]),e[69]=g,e[70]=o,e[71]=f,e[72]=ce):ce=e[72];let L;e[73]!==ae||e[74]!==ce?(L=s.jsx(Oe,{type:"submit",disabled:ae,children:ce}),e[73]=ae,e[74]=ce,e[75]=L):L=e[75];let me;e[76]!==X||e[77]!==L?(me=s.jsxs(ts,{children:[X,L]}),e[76]=X,e[77]=L,e[78]=me):me=e[78];let T;e[79]!==_||e[80]!==le||e[81]!==me||e[82]!==K?(T=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:_,children:[K,le,me]})}),e[79]=_,e[80]=le,e[81]=me,e[82]=K,e[83]=T):T=e[83];let pe;return e[84]!==B||e[85]!==n||e[86]!==T?(pe=s.jsx(ns,{open:n,onOpenChange:B,children:T}),e[84]=B,e[85]=n,e[86]=T,e[87]=pe):pe=e[87],pe}const Dl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],gs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Al(t){const e=Ce.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=U.useState(gs),[d,g]=U.useState(null),[f,p]=U.useState(n);n!==f&&(p(n),n&&(x(gs),g(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=be=>x(De=>({...De,...be})),e[0]=y):y=e[0];const h=y;let v;e[1]!==r||e[2]!==i?(v=be=>{!be&&!r&&(g(null),i(!1))},e[1]=r,e[2]=i,e[3]=v):v=e[3];const S=v;let k;e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==a?(k=async be=>{be.preventDefault();const De=u.from.trim(),$e=u.to.trim();if(!De||!$e||r){g(a("sandbox.redirectFormDialog.errorRequired"));return}g(null),await l({...u,from:De,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const w=k,j=d??c;let M;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(M=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=M):M=e[12];const z=M;let C;e[13]!==a?(C=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=C):C=e[14];let I;e[15]!==C?(I=s.jsx(Zt,{children:s.jsx(es,{children:C})}),e[15]=C,e[16]=I):I=e[16];let B;e[17]!==a?(B=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=B):B=e[18];let O;e[19]!==B?(O=s.jsx(Ot,{htmlFor:"redirect-form-from",children:B}),e[19]=B,e[20]=O):O=e[20];const _=u.from;let H;e[21]===Symbol.for("react.memo_cache_sentinel")?(H=be=>h({from:be.target.value}),e[21]=H):H=e[21];let R;e[22]!==a?(R=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=R):R=e[23];let F;e[24]!==r||e[25]!==u.from||e[26]!==R?(F=s.jsx(rt,{id:"redirect-form-from",value:_,onChange:H,placeholder:R,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=R,e[27]=F):F=e[27];let K;e[28]!==F||e[29]!==O?(K=s.jsxs("div",{className:"space-y-1.5",children:[O,F]}),e[28]=F,e[29]=O,e[30]=K):K=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let D;e[33]!==V?(D=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=D):D=e[34];const A=u.to;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=be=>h({to:be.target.value}),e[35]=J):J=e[35];let G;e[36]!==a?(G=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=G):G=e[37];let W;e[38]!==r||e[39]!==u.to||e[40]!==G?(W=s.jsx(rt,{id:"redirect-form-to",value:A,onChange:J,placeholder:G,disabled:r}),e[38]=r,e[39]=u.to,e[40]=G,e[41]=W):W=e[41];let Z;e[42]!==D||e[43]!==W?(Z=s.jsxs("div",{className:"space-y-1.5",children:[D,W]}),e[42]=D,e[43]=W,e[44]=Z):Z=e[44];let Y;e[45]!==a?(Y=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=Y):Y=e[46];let $;e[47]!==Y?($=s.jsx(Ot,{htmlFor:"redirect-form-type",children:Y}),e[47]=Y,e[48]=$):$=e[48];const ee=u.type;let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=be=>h({type:be}),e[49]=ue):ue=e[49];let oe;e[50]!==a?(oe=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=oe):oe=e[51];let te;e[52]!==oe?(te=s.jsx(Uo,{id:"redirect-form-type",className:"w-full",children:s.jsx(Ho,{placeholder:oe})}),e[52]=oe,e[53]=te):te=e[53];let se;e[54]!==a?(se=Dl.map(be=>s.jsx(Vo,{value:be.value,children:a(be.labelKey,{status:Hs[be.value]})},be.value)),e[54]=a,e[55]=se):se=e[55];let le;e[56]!==se?(le=s.jsx(Go,{children:se}),e[56]=se,e[57]=le):le=e[57];let E;e[58]!==r||e[59]!==u.type||e[60]!==te||e[61]!==le?(E=s.jsxs(Jo,{value:ee,onValueChange:ue,disabled:r,children:[te,le]}),e[58]=r,e[59]=u.type,e[60]=te,e[61]=le,e[62]=E):E=e[62];let ne;e[63]!==$||e[64]!==E?(ne=s.jsxs("div",{className:"space-y-1.5",children:[$,E]}),e[63]=$,e[64]=E,e[65]=ne):ne=e[65];let X;e[66]===Symbol.for("react.memo_cache_sentinel")?(X=be=>h({discardQueryParameters:be===!0}),e[66]=X):X=e[66];let ae;e[67]!==r||e[68]!==u.discardQueryParameters?(ae=s.jsx(os,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:X}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ae):ae=e[69];let ce;e[70]!==a?(ce=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ce):ce=e[71];let L;e[72]!==ce?(L=s.jsx("span",{className:"text-sm",children:ce}),e[72]=ce,e[73]=L):L=e[73];let me;e[74]!==ae||e[75]!==L?(me=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ae,L]}),e[74]=ae,e[75]=L,e[76]=me):me=e[76];let T;e[77]!==j?(T=j&&s.jsx("p",{className:"text-xs text-destructive",children:j}),e[77]=j,e[78]=T):T=e[78];let pe;e[79]!==K||e[80]!==Z||e[81]!==ne||e[82]!==me||e[83]!==T?(pe=s.jsxs("div",{className:"space-y-4 py-4",children:[K,Z,ne,me,T]}),e[79]=K,e[80]=Z,e[81]=ne,e[82]=me,e[83]=T,e[84]=pe):pe=e[84];let he;e[85]!==i?(he=()=>i(!1),e[85]=i,e[86]=he):he=e[86];let ge;e[87]!==a?(ge=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=ge):ge=e[88];let ye;e[89]!==r||e[90]!==he||e[91]!==ge?(ye=s.jsx(Oe,{type:"button",variant:"outline",onClick:he,disabled:r,children:ge}),e[89]=r,e[90]=he,e[91]=ge,e[92]=ye):ye=e[92];const ie=!z;let de;e[93]!==r||e[94]!==a?(de=r?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),a("sandbox.redirectFormDialog.pending")]}):a("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=a,e[95]=de):de=e[95];let xe;e[96]!==ie||e[97]!==de?(xe=s.jsx(Oe,{type:"submit",disabled:ie,children:de}),e[96]=ie,e[97]=de,e[98]=xe):xe=e[98];let ke;e[99]!==ye||e[100]!==xe?(ke=s.jsxs(ts,{children:[ye,xe]}),e[99]=ye,e[100]=xe,e[101]=ke):ke=e[101];let Te;e[102]!==w||e[103]!==pe||e[104]!==ke||e[105]!==I?(Te=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:w,children:[I,pe,ke]})}),e[102]=w,e[103]=pe,e[104]=ke,e[105]=I,e[106]=Te):Te=e[106];let we;return e[107]!==S||e[108]!==n||e[109]!==Te?(we=s.jsx(ns,{open:n,onOpenChange:S,children:Te}),e[107]=S,e[108]=n,e[109]=Te,e[110]=we):we=e[110],we}function Bl(t){const e=Ce.c(70),{open:n,blockKey:o,initialName:c,isPending:l,onSubmit:i,onOpenChange:r}=t,a=l===void 0?!1:l,u=Be(),[x,d]=U.useState(c),[g,f]=U.useState(n);n!==g&&(f(n),n&&d(c));let p;e[0]!==a||e[1]!==r?(p=ee=>{!ee&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=p):p=e[2];const y=p;let h;e[3]!==a||e[4]!==x||e[5]!==i?(h=async ee=>{ee.preventDefault();const ue=x.trim();!ue||a||await i(ue)},e[3]=a,e[4]=x,e[5]=i,e[6]=h):h=e[6];const v=h;let S;e[7]!==u?(S=u("sandbox.sectionRenameDialog.title"),e[7]=u,e[8]=S):S=e[8];let k;e[9]!==S?(k=s.jsx(es,{children:S}),e[9]=S,e[10]=k):k=e[10];let w;e[11]!==u?(w=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=w):w=e[12];let j;e[13]!==w?(j=s.jsx(zo,{children:w}),e[13]=w,e[14]=j):j=e[14];let M;e[15]!==k||e[16]!==j?(M=s.jsxs(Zt,{children:[k,j]}),e[15]=k,e[16]=j,e[17]=M):M=e[17];let z;e[18]!==u?(z=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=z):z=e[19];let C;e[20]!==z?(C=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:z}),e[20]=z,e[21]=C):C=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=ee=>d(ee.target.value),e[22]=I):I=e[22];let B;e[23]!==a||e[24]!==x?(B=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=B):B=e[25];let O;e[26]!==C||e[27]!==B?(O=s.jsxs("div",{className:"space-y-1.5",children:[C,B]}),e[26]=C,e[27]=B,e[28]=O):O=e[28];let _;e[29]!==u?(_=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=_):_=e[30];let H;e[31]!==_?(H=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:_}),e[31]=_,e[32]=H):H=e[32];let R;e[33]!==o?(R=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=R):R=e[34];let F;e[35]!==H||e[36]!==R?(F=s.jsxs("div",{className:"space-y-1.5",children:[H,R]}),e[35]=H,e[36]=R,e[37]=F):F=e[37];let K;e[38]!==O||e[39]!==F?(K=s.jsxs("div",{className:"space-y-4 py-4",children:[O,F]}),e[38]=O,e[39]=F,e[40]=K):K=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let D;e[43]!==u?(D=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=D):D=e[44];let A;e[45]!==a||e[46]!==V||e[47]!==D?(A=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:D}),e[45]=a,e[46]=V,e[47]=D,e[48]=A):A=e[48];let J;e[49]!==a||e[50]!==x?(J=!x.trim()||a,e[49]=a,e[50]=x,e[51]=J):J=e[51];let G;e[52]!==a||e[53]!==u?(G=a?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),u("sandbox.sectionRenameDialog.saving")]}):u("sandbox.sectionRenameDialog.save"),e[52]=a,e[53]=u,e[54]=G):G=e[54];let W;e[55]!==J||e[56]!==G?(W=s.jsx(Oe,{type:"submit",disabled:J,children:G}),e[55]=J,e[56]=G,e[57]=W):W=e[57];let Z;e[58]!==A||e[59]!==W?(Z=s.jsxs(ts,{children:[A,W]}),e[58]=A,e[59]=W,e[60]=Z):Z=e[60];let Y;e[61]!==v||e[62]!==K||e[63]!==Z||e[64]!==M?(Y=s.jsx(ss,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[M,K,Z]})}),e[61]=v,e[62]=K,e[63]=Z,e[64]=M,e[65]=Y):Y=e[65];let $;return e[66]!==y||e[67]!==n||e[68]!==Y?($=s.jsx(ns,{open:n,onOpenChange:y,children:Y}),e[66]=y,e[67]=n,e[68]=Y,e[69]=$):$=e[69],$}function $l(t){const e=Ce.c(7),{type:n}=t,o=Hs[n];let c;e[0]!==o?(c=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=c):c=e[1];const l=n==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(Me,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==c||e[5]!==i?(r=s.jsxs(ze,{children:[c,i]}),e[4]=c,e[5]=i,e[6]=r):r=e[6],r}const Ft={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},ls=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return ls.includes(t)}const as={posts:"post",authors:"author",categories:"category"},rn={posts:Ft.post,authors:Ft.author,categories:Ft.category},Ll=Object.fromEntries(Object.entries(rn).map(([t,e])=>[e,t]));function Ol(t){return typeof t=="string"?Ll[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Ne(t){return typeof t=="string"?t:""}function Rl(t,e){switch(t){case"posts":return{label:Ne(e.title)||"Untitled post",subtitle:Ne(e.slug)};case"authors":return{label:Ne(e.name)||"Unnamed author",subtitle:Ne(e.email)};case"categories":return{label:Ne(e.name)||"Unnamed category",subtitle:Ne(e.slug)};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}function cn(t){const e={posts:[],authors:[],categories:[]};for(const[n,o]of Object.entries(t)){const c=Je(o);if(!c)continue;const l=Ol(c.__resolveType);if(!l)continue;const i=Je(c[as[l]])??{},{label:r,subtitle:a}=Rl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of ls)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Fl(t,e){return cn(t)[e]}function vt(t,e){return Fl(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const xs=Object.freeze({});function xt(t,e){return t?Je(t[as[e]])??xs:xs}function it(t,e,n){return{name:t,__resolveType:rn[e],[as[e]]:n}}function Hi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=g=>typeof g=="string"?g:Ne(Je(g)?.[n]),i=g=>typeof g=="string"?g:Ne(Je(g)?.name),r=g=>{const f=l(g),p=f?t.find(({payload:h})=>Ne(h[n])===f):void 0;if(p)return p;const y=i(g);return y?t.find(({payload:h})=>Ne(h.name)===y):void 0},a=t.map(({key:g,payload:f})=>({value:g,label:Ne(f.name)||Ne(f[n])||g})),u=new Map,x=[];return c.forEach((g,f)=>{const p=r(g);if(p){x.includes(p.key)||x.push(p.key);return}const y=`unresolved:${f}`;u.set(y,g),x.push(y),a.push({value:y,label:i(g)||l(g)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:g=>g.map(f=>{const p=t.find(y=>y.key===f);return p?o(p.payload):u.get(f)}).filter(f=>f!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function Ke(t){if(typeof t=="string")return t;const e=Je(t);return e?Ne(e.slug):""}function Kl(t){if(typeof t=="string")return t;const e=Je(t);return e?Ne(e.email):""}function dn(t){const e=[];return Ne(t.title).trim()||e.push("Title"),Ne(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Ne(t.excerpt).trim()||e.push("Excerpt"),Ne(t.image).trim()||e.push("Cover image"),e}const un=8;function mn(t){const e=Ne(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function Gi(t,e){return e!=="published"||mn(t)==="published"?!1:dn(t).length>0}function Il(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,un).toISOString()}function Ji(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Ne(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Il(n):o}}function fn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Ne(n.title)||"Untitled post",slug:Ne(n.slug),date:Ne(n.date),scheduledDatetime:Ne(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Kl).filter(Boolean),missing:dn(n),status:mn(n)}))}function Ml(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e.slug)?t:{...t,categories:[...n,{name:e.name,slug:e.slug}]}}function zl(t,e){const n=Ze(t.categories);return n.length===1&&Ke(n[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function Wi(t,e,n){const o=Ze(t.categories);if(!o.some(r=>Ke(r)===e))return t;const c=o.map(r=>{const a=Ke(r);return a===e||a===n.slug?{name:n.name,slug:n.slug}:r}),l=new Set,i=c.filter(r=>{const a=Ke(r);return a?l.has(a)?!1:(l.add(a),!0):!0});return{...t,categories:i}}function Vl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function bs(t){return{...t,dateModified:new Date().toISOString()}}function Ht(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}function Kt(t,e){const n=`collections/blog/${e}/${Ht(12)}`;if(!Object.hasOwn(t,n))return n;throw new Error("Could not generate a unique blog block key")}function pn(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Ht(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Ht(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Ul={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},ys="Box";function Hl(t){return t.startsWith("site/")?"site":"app"}function Gl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function ht(...t){for(const e of t)if(e!==void 0)return e}function Yi(t){const e=new Set,n=[],o=t.manifest?.blocks??{};for(const c of Object.values(o))for(const l of Object.keys(c)){if(!Yl(l)||e.has(l))continue;e.add(l);const i=Yt(l,t),r=Jl(l),a=Ul[r],u=Hl(l),x=(u==="site"?ht(i.title,a?.title):ht(a?.title,i.title))??r,d=u==="site"?ht(i.description,a?.description):ht(a?.description,i.description),g=u==="site"?i.icon:void 0,f=g&&Gl(g)?g:void 0,p=f!==void 0?a?.iconName??ys:ht(g,a?.iconName)??ys;n.push({resolveType:l,title:x,description:d,iconName:p,iconUrl:f,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Jl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const Wl=["blog/sections/blocks/","site/sections/Blog/Post/"];function Yl(t){return Wl.some(e=>t.startsWith(e))}const qi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Qi=["January","February","March","April","May","June","July","August","September","October","November","December"],hn=1440*60*1e3;function Xe(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Xi(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Zi(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Pt(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Gt(t,e){return Math.round((Xe(t).getTime()-Xe(e).getTime())/hn)}function ql(t){const e=(t.getTime()-Xe(t).getTime())/hn;return Math.min(Math.max(e,0),1)}function vs(t,e){return Gt(t,e)+ql(t)}function er(t){const e=Pt(t,-t.getDay()),n=[];for(let o=0;o<6;o++){const c=[];for(let l=0;l<7;l++)c.push(Pt(e,o*7+l));n.push(c)}for(;n.length>0&&n[n.length-1].every(o=>o.getMonth()!==t.getMonth());)n.pop();return n}function tr(t,e){const n=Xe(t[0]),o=Pt(n,7),c=n.getTime(),l=o.getTime(),i=[];for(const u of e){const x=Xe(u.start),d=Xe(u.end);if(d.getTime()<n.getTime()||x.getTime()>=o.getTime())continue;const g=x.getTime()<n.getTime()?n:x,f=d.getTime()>=o.getTime()?Pt(o,-1):d,p=Gt(g,n),y=Gt(f,g)+1;if(y<=0)continue;const h=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=vs(new Date(h),n),k=Math.max(vs(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:p,span:y,leftUnits:S,widthUnits:k})}i.sort((u,x)=>u.startCol-x.startCol||x.span-u.span||u.variant.blockKey.localeCompare(x.variant.blockKey));const r=[],a=[];for(const u of i){let x=r.findIndex(d=>d<=u.startCol);x===-1&&(x=r.length,r.push(0)),r[x]=u.startCol+u.span,a.push({...u,lane:x})}return a}function Tt(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${n}`}const gn=/^(\d{4})-(\d{2})-(\d{2})$/;function _t(t){const e=t.trim();if(!e)return null;const n=gn.exec(e);if(n){const c=Number(n[1]),l=Number(n[2])-1,i=Number(n[3]),r=new Date(c,l,i);return r.getMonth()===l&&r.getDate()===i?r:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:Xe(o)}function Ql(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),un);return{...pn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Tt(t)}}function Xl(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(gn.test(e))return _t(e);const n=new Date(e);return Number.isNaN(n.getTime())?null:n}function Zl(t,e){const n=Xl(t.scheduledDatetime);if(!n)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),c={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Tt(n)&&(c.date=Tt(o)),c}function ea(t){return _t(t.scheduledDatetime)??_t(t.date)}function sr(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:_t(c.scheduledDatetime)!==null},i=ea(c);if(!i){n.push(l);continue}const r=Tt(i),a=e.get(r);a?a.push(l):e.set(r,[l])}const o=(c,l)=>Number(l.scheduled)-Number(c.scheduled)||c.post.title.localeCompare(l.post.title);for(const c of e.values())c.sort(o);return n.sort(o),{byDay:e,undated:n}}const ta="0.161.0",sa="0.162.0",nr="deno task update";function Ss(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function ks(t,e){const n=Ss(t),o=Ss(e);if(!n||!o)return 0;for(let c=0;c<3;c++){const l=n[c]-o[c];if(l!==0)return l}return 0}const xn=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function na(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){if(typeof n!="string")continue;const o=xn.exec(n)?.[1];if(o)return o}return null}function oa(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){const o=n?.title;if(typeof o!="string")continue;const c=xn.exec(o)?.[1];if(c)return c}return null}function la(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=na(t.denoJson)??oa(t.meta);return!e||ks(e,ta)<0?{kind:"outdated",version:e}:ks(e,sa)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function or(t){return t.kind==="publish-only"||t.kind==="full"}function lr(t){return t.kind==="full"}function aa(t){const e=Ce.c(16),n=tn(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=ho(t.virtualMcpId),c=Et()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=Bs.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=l):l=e[3];let i;e[4]!==o||e[5]!==t||e[6]!==c?(i=async()=>{const g=await go({...t,threadId:c},xo(o,"deno.json"));return g.kind==="data"?g.data:null},e[4]=o,e[5]=t,e[6]=c,e[7]=i):i=e[7];const r=n==="deno";let a;e[8]!==l||e[9]!==i||e[10]!==r?(a={queryKey:l,queryFn:i,enabled:r,staleTime:3e5},e[8]=l,e[9]=i,e[10]=r,e[11]=a):a=e[11];const{data:u}=As(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=la({packageManager:n,denoJson:x,meta:t.meta}),e[12]=n,e[13]=t.meta,e[14]=x,e[15]=d):d=e[15],d}function Re(t){const e=Ce.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:g,invalid:f,invalidReason:p,onToggleSelect:y,onClick:h,menu:v}=t,S=Be(),k=r==="global";let w;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(w=a&&a>1?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(n,{size:16,className:"shrink-0 text-success"})}),s.jsxs(Me,{side:"right",children:[a," variants"]})]})}):o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:_e("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:s.jsx(n,{size:16,className:_e("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:qt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=w):w=e[5];const j=w,M=i?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let z;e[6]!==M?(z=_e("group relative flex min-w-0 items-center rounded-md transition-colors",M),e[6]=M,e[7]=z):z=e[7];let C;e[8]!==y||e[9]!==x||e[10]!==g||e[11]!==d||e[12]!==S||e[13]!==c?(C=x&&s.jsx("span",{className:_e("flex shrink-0 items-center pl-2.5 transition-opacity",g||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ia,children:s.jsx(os,{checked:g,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=g,e[11]=d,e[12]=S,e[13]=c,e[14]=C):C=e[14];const I=f&&!i&&"text-destructive";let B;e[15]!==I?(B=_e("block truncate text-sm font-medium",I),e[15]=I,e[16]=B):B=e[16];let O;e[17]!==B||e[18]!==c?(O=s.jsx("span",{className:B,children:c}),e[17]=B,e[18]=c,e[19]=O):O=e[19];const _=i?"text-accent-foreground/70":"text-muted-foreground";let H;e[20]!==_?(H=_e("block truncate text-xs",_),e[20]=_,e[21]=H):H=e[21];let R;e[22]!==l||e[23]!==H?(R=s.jsx("span",{className:H,children:l}),e[22]=l,e[23]=H,e[24]=R):R=e[24];let F;e[25]!==R||e[26]!==O?(F=s.jsxs("span",{className:"min-w-0 flex-1",children:[O,R]}),e[25]=R,e[26]=O,e[27]=F):F=e[27];let K;e[28]!==i||e[29]!==f||e[30]!==p?(K=f&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:_e("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Os,{size:14})})}),p&&s.jsx(Me,{side:"bottom",children:p})]}),e[28]=i,e[29]=f,e[30]=p,e[31]=K):K=e[31];let V;e[32]!==h||e[33]!==j||e[34]!==F||e[35]!==K||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[j,F,K,u]}),e[32]=h,e[33]=j,e[34]=F,e[35]=K,e[36]=u,e[37]=V):V=e[37];let D;e[38]!==i||e[39]!==v?(D=v&&s.jsx("div",{className:_e("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=D):D=e[40];let A;return e[41]!==V||e[42]!==D||e[43]!==z||e[44]!==C?(A=s.jsxs("div",{className:z,children:[C,V,D]}),e[41]=V,e[42]=D,e[43]=z,e[44]=C,e[45]=A):A=e[45],A}function ia(t){return t.stopPropagation()}function Ge(t){const e=Ce.c(10),{icon:n,title:o,description:c}=t;let l;e[0]!==n?(l=n&&s.jsx(n,{size:24,className:"text-muted-foreground/60"}),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==c?(r=c&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:c}),e[4]=c,e[5]=r):r=e[5];let a;return e[6]!==l||e[7]!==i||e[8]!==r?(a=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,r]}),e[6]=l,e[7]=i,e[8]=r,e[9]=a):a=e[9],a}const ra={loaders:Zs,actions:en},ca={loaders:"Loaders",actions:"Actions"},da={analytics:qo,blog:Fs,commerce:Yo,site:Fn,website:Wo};function ua(t,e){return e===0?da[t.toLowerCase()]??us:us}function kt(t,e){return e===0?ko(t):t}function ma(t){const e=Ce.c(98),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a}=t,u=Be();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[d,g]=U.useState(x),[f,p]=U.useState(null),[y,h]=U.useState(""),[v,S]=U.useState(va),[k,w]=U.useState(a);k!==a&&(w(a),g([]),p(null),h(""),S(new Set));let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=Y=>{S($=>{const ee=new Set($);return ee.has(Y)?ee.delete(Y):ee.add(Y),ee})},e[1]=j):j=e[1];const M=j;let z;e[2]!==c||e[3]!==n||e[4]!==o?(z={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=z):z=e[5];const C=Js(z);let I;e[6]!==C?(I=Ys((Y,$)=>C.mutate({blockKey:Y,data:$})),e[6]=C,e[7]=I):I=e[7];const B=I;let O;e[8]!==a?(O=jo(a),e[8]=a,e[9]=O):O=e[9];const _=O,H=ra[a];let R,F,K,V,D,A,J;if(e[10]!==H||e[11]!==c||e[12]!==r||e[13]!==a||e[14]!==i||e[15]!==v||e[16]!==n||e[17]!==d||e[18]!==l||e[19]!==C||e[20]!==B||e[21]!==y||e[22]!==f||e[23]!==_||e[24]!==u||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const Y=[...bo(i,r,a).map(ya),...yo(i,a).map(ba)],$=y.trim().toLowerCase(),ee=$.length>0,ue=ee?Y.filter(N=>N.title.toLowerCase().includes($)||N.resolveType.toLowerCase().includes($)):[],oe=new Map,te=[],se=new Map;if(!ee){for(const N of Y){const re=N.folderPath;if(!(re.length<d.length)&&d.every((ve,Ee)=>re[Ee]===ve))if(re.length===d.length)if(N.savedKey!==void 0){const ve=se.get(N.resolveType);ve?ve.push(N):se.set(N.resolveType,[N])}else te.push(N);else{const ve=re[d.length],Ee=oe.get(ve)??{count:0,savedCount:0};N.savedKey!==void 0?Ee.savedCount=Ee.savedCount+1:Ee.count=Ee.count+1,oe.set(ve,Ee)}}te.sort(xa);for(const N of se.values())N.sort(ga)}const le=[...se.entries()].filter(N=>{const[re]=N;return!te.some(ve=>ve.resolveType===re)}).flatMap(ha).sort(pa);let E;e[33]!==d?(E=(N,re)=>kt(N.name,d.length).localeCompare(kt(re.name,d.length)),e[33]=d,e[34]=E):E=e[34];const ne=[...oe.entries()].map(fa).sort(E);let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=N=>{p(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=X):X=e[35];const ae=X;let ce;e[36]!==C||e[37]!==_||e[38]!==u?(ce=async(N,re)=>{await C.mutateAsync({blockKey:N,data:re}),Se.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:_,blockId:N})),p({mode:"saved",key:N})},e[36]=C,e[37]=_,e[38]=u,e[39]=ce):ce=e[39];const L=ce;let me;e[40]!==r||e[41]!==f?(me=Sa(f,r),e[40]=r,e[41]=f,e[42]=me):me=e[42];const T=me;if(T){const N=`${T.mode}:${T.mode==="saved"?T.blockKey:T.resolveType}`;let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=()=>p(null),e[43]=re):re=e[43];let ve;e[44]!==c||e[45]!==r||e[46]!==L||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==C.isPending||e[52]!==B||e[53]!==N||e[54]!==T.editorTarget||e[55]!==T.initialValue||e[56]!==o?(ve=s.jsx(vo,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:T.editorTarget,initialValue:T.initialValue,isCreating:C.isPending,onCreate:L,onSaveReferencedBlock:B,onBack:re},N),e[44]=c,e[45]=r,e[46]=L,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=C.isPending,e[52]=B,e[53]=N,e[54]=T.editorTarget,e[55]=T.initialValue,e[56]=o,e[57]=ve):ve=e[57],K=ve;break e}J="flex h-full w-full min-w-0 flex-col";let pe;e[58]!==u?(pe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=pe):pe=e[59];let he;e[60]===Symbol.for("react.memo_cache_sentinel")?(he=()=>g([]),e[60]=he):he=e[60];const ge=d.length===0?"font-medium text-foreground":"text-muted-foreground";let ye;e[61]!==ge?(ye=_e("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ge),e[61]=ge,e[62]=ye):ye=e[62];const ie=ca[a];let de;e[63]!==ye||e[64]!==ie?(de=s.jsx("button",{type:"button",onClick:he,className:ye,children:ie}),e[63]=ye,e[64]=ie,e[65]=de):de=e[65];let xe;e[66]!==d?(xe=d.map((N,re)=>{const ve=re===d.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>g(d.slice(0,re+1)),className:_e("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,re)})]},`${N}-${re}`)}),e[66]=d,e[67]=xe):xe=e[67];let ke;e[68]!==pe||e[69]!==de||e[70]!==xe?(ke=s.jsxs("nav",{"aria-label":pe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[de,xe]}),e[68]=pe,e[69]=de,e[70]=xe,e[71]=ke):ke=e[71];let Te;e[72]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Te):Te=e[72];let we;e[73]===Symbol.for("react.memo_cache_sentinel")?(we=N=>h(N.target.value),e[73]=we):we=e[73];let be;e[74]!==a||e[75]!==u?(be=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=be):be=e[76];let De;e[77]!==a||e[78]!==u?(De=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=De):De=e[79];let $e;e[80]!==y||e[81]!==be||e[82]!==De?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Te,s.jsx("input",{type:"text",value:y,onChange:we,placeholder:be,"aria-label":De,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=be,e[82]=De,e[83]=$e):$e=e[83],e[84]!==ke||e[85]!==$e?(F=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[ke,$e]}),e[84]=ke,e[85]=$e,e[86]=F):F=e[86],R=Dt,A="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",D=ee?ue.length===0?s.jsx(Ge,{title:u("sandbox.runnableBlocksBrowser.noSearchResults",{kind:a,query:y.trim()}),description:u("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:ue.map(N=>s.jsx(Re,{icon:H,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)},N.savedKey??N.resolveType))}):ne.length===0&&te.length===0&&le.length===0?s.jsx(Ge,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[ne.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:ne.map(N=>{const re=ua(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>g([...d,N.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(re,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:kt(N.name,d.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N.count," ",N.count===1?_:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(te.length>0||le.length>0)&&s.jsxs("div",{className:_e("flex flex-col gap-1",ne.length>0&&"mt-4"),children:[te.map(N=>{const re=se.get(N.resolveType)??[],ve=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:H,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)}),re.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>M(N.resolveType),"aria-expanded":ve,className:"flex items-center gap-1 self-start rounded-md px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:qt},children:[ve?s.jsx(Xt,{size:12,className:"shrink-0"}):s.jsx(Nt,{size:12,className:"shrink-0"}),u(ve?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",re.length,")"]}),ve&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:re.map(Ee=>s.jsx(Re,{icon:H,accent:"global",title:Ee.title,subtitle:Ee.resolveType,active:!1,onClick:()=>ae(Ee)},Ee.savedKey))})]})]},N.resolveType)}),le.map(N=>s.jsx(Re,{icon:H,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ae(N)},N.savedKey))]})]})}e[10]=H,e[11]=c,e[12]=r,e[13]=a,e[14]=i,e[15]=v,e[16]=n,e[17]=d,e[18]=l,e[19]=C,e[20]=B,e[21]=y,e[22]=f,e[23]=_,e[24]=u,e[25]=o,e[26]=R,e[27]=F,e[28]=K,e[29]=V,e[30]=D,e[31]=A,e[32]=J}else R=e[26],F=e[27],K=e[28],V=e[29],D=e[30],A=e[31],J=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let G;e[87]!==V||e[88]!==D?(G=s.jsx("div",{className:V,children:D}),e[87]=V,e[88]=D,e[89]=G):G=e[89];let W;e[90]!==R||e[91]!==G||e[92]!==A?(W=s.jsx(R,{className:A,children:G}),e[90]=R,e[91]=G,e[92]=A,e[93]=W):W=e[93];let Z;return e[94]!==F||e[95]!==W||e[96]!==J?(Z=s.jsxs("div",{className:J,children:[F,W]}),e[94]=F,e[95]=W,e[96]=J,e[97]=Z):Z=e[97],Z}function fa(t){const[e,n]=t;return{name:e,...n}}function pa(t,e){return t.title.localeCompare(e.title)}function ha(t){const[,e]=t;return e}function ga(t,e){return t.title.localeCompare(e.title)}function xa(t,e){return t.title.localeCompare(e.title)}function ba(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ws(t.resolveType)}}function ya(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ws(t.resolveType),savedKey:t.key}}function va(){return new Set}function Sa(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:n,props:o,title:c}=So(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function ka(t){const e=Ce.c(83),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:g,onSaveReferencedBlock:f}=t,p=Be(),y=Qt(),h=y?.entity?.id===o?y.entity.metadata?.siteSlug??null:null;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={},e[0]=v):v=e[0];const[S,k]=U.useState(v);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=[],e[1]=w):w=e[1];const[j,M]=U.useState(w),[z,C]=U.useState(0),[I,B]=U.useState(!1);let O;e[2]!==i||e[3]!==a?(O=Wt(a,i),e[2]=i,e[3]=a,e[4]=O):O=e[4];const _=O,H=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,R=Et()?.taskId??null,F=l??void 0;let K;e[5]!==h||e[6]!==c||e[7]!==n||e[8]!==F||e[9]!==R||e[10]!==o?(K={orgSlug:n,virtualMcpId:o,branch:c,threadId:R,previewUrl:F,siteSlug:h},e[5]=h,e[6]=c,e[7]=n,e[8]=F,e[9]=R,e[10]=o,e[11]=K):K=e[11];const V=K;let D,A,J,G,W,Z,Y,$;if(e[12]!==r||e[13]!==j||e[14]!==S||e[15]!==g||e[16]!==p||e[17]!==u){const ye=[u,...j],ie=xe=>{M(j.slice(0,xe)),C(ja)};let de;e[26]!==r||e[27]!==S||e[28]!==g?(de=async xe=>{const ke=Co(xe,r);if(ke){Se.error(ke);return}await g(xe,S),B(!1)},e[26]=r,e[27]=S,e[28]=g,e[29]=de):de=e[29],D=de,G="flex h-full w-full min-w-0",J="flex min-w-0 flex-1 flex-col",A="shrink-0 border-b px-3 py-2.5",$="flex min-w-0 items-center gap-2 overflow-hidden",e[30]!==p?(W=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[30]=p,e[31]=W):W=e[31],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",Y=ye.map((xe,ke)=>{const Te=ke===ye.length-1,we=qs(xe);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[ke>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>ie(ke),title:we,className:_e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Te?"font-medium text-foreground":"text-muted-foreground"),children:we})]},`${we}-${ke}`)}),e[12]=r,e[13]=j,e[14]=S,e[15]=g,e[16]=p,e[17]=u,e[18]=D,e[19]=A,e[20]=J,e[21]=G,e[22]=W,e[23]=Z,e[24]=Y,e[25]=$}else D=e[18],A=e[19],J=e[20],G=e[21],W=e[22],Z=e[23],Y=e[24],$=e[25];let ee;e[32]!==W||e[33]!==Z||e[34]!==Y?(ee=s.jsx("nav",{"aria-label":W,className:Z,children:Y}),e[32]=W,e[33]=Z,e[34]=Y,e[35]=ee):ee=e[35];let ue;e[36]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>B(!0),e[36]=ue):ue=e[36];let oe;e[37]!==p?(oe=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[37]=p,e[38]=oe):oe=e[38];let te;e[39]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Kn,{size:14}),e[39]=te):te=e[39];let se;e[40]!==d||e[41]!==oe?(se=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ue,"aria-label":oe,children:te})}),e[40]=d,e[41]=oe,e[42]=se):se=e[42];let le;e[43]!==p?(le=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[43]=p,e[44]=le):le=e[44];let E;e[45]!==le?(E=s.jsx(Me,{side:"bottom",children:le}),e[45]=le,e[46]=E):E=e[46];let ne;e[47]!==se||e[48]!==E?(ne=s.jsxs(ze,{children:[se,E]}),e[47]=se,e[48]=E,e[49]=ne):ne=e[49];let X;e[50]!==ee||e[51]!==ne||e[52]!==$?(X=s.jsxs("div",{className:$,children:[ee,ne]}),e[50]=ee,e[51]=ne,e[52]=$,e[53]=X):X=e[53];const ae="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",ce=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:H});let L;e[54]!==ce?(L=s.jsx("p",{className:ae,children:ce}),e[54]=ce,e[55]=L):L=e[55];let me;e[56]!==A||e[57]!==X||e[58]!==L?(me=s.jsxs("div",{className:A,children:[X,L]}),e[56]=A,e[57]=X,e[58]=L,e[59]=me):me=e[59];let T;e[60]!==r||e[61]!==j||e[62]!==z||e[63]!==S||e[64]!==i||e[65]!==f||e[66]!==V||e[67]!==_||e[68]!==p?(T=s.jsx(Dt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:_?s.jsx(Qs,{schema:_,value:S,onChange:ye=>k(ye),basePath:"",breadcrumbPath:j,onBreadcrumbChange:M,meta:i,decofile:r,onSaveReferencedBlock:f,sandbox:V},z):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[60]=r,e[61]=j,e[62]=z,e[63]=S,e[64]=i,e[65]=f,e[66]=V,e[67]=_,e[68]=p,e[69]=T):T=e[69];let pe;e[70]!==J||e[71]!==me||e[72]!==T?(pe=s.jsxs("div",{className:J,children:[me,T]}),e[70]=J,e[71]=me,e[72]=T,e[73]=pe):pe=e[73];let he;e[74]!==x||e[75]!==D||e[76]!==d||e[77]!==I?(he=s.jsx(wo,{open:I,onOpenChange:B,defaultBlockId:x,isPending:d,onSubmit:D}),e[74]=x,e[75]=D,e[76]=d,e[77]=I,e[78]=he):he=e[78];let ge;return e[79]!==G||e[80]!==pe||e[81]!==he?(ge=s.jsxs("div",{className:G,children:[pe,he]}),e[79]=G,e[80]=pe,e[81]=he,e[82]=ge):ge=e[82],ge}function ja(t){return t+1}function Ca(t,e){const n={__resolveType:t},o=Po([n],e)[0];return o?To(n,o,e):null}function wa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=Qt(),x=u?.entity?.id===e?u.entity.metadata?.siteSlug??null:null,[d]=U.useState(()=>Ca(i,l)),[g,f]=U.useState(d?.data??{}),[p,y]=U.useState([]),[h,v]=U.useState(0),[S,k]=U.useState(!1),[w,j]=U.useState(null),M=w!==null,{save:z,flush:C}=No({orgSlug:t,virtualMcpId:e,branch:n}),I=d?.resolveType?Wt(d.resolveType,c):null,B=l[i],O=B?no(i,B):i,_=Et()?.taskId??null,H={orgSlug:t,virtualMcpId:e,branch:n,threadId:_,previewUrl:o??void 0,siteSlug:x},R=A=>{f(A),z(i,A)},F=()=>{M?(j(null),k(!1),v(A=>A+1)):j(JSON.stringify(g,null,2))},K=A=>{const J=A??"";try{const G=JSON.parse(J);if(G&&typeof G=="object"&&!Array.isArray(G)){k(!1),R(G);return}k(!0)}catch{k(!0)}},V=[O,...p],D=A=>{y(p.slice(0,A)),v(J=>J+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt},"aria-hidden":!0}),s.jsx("nav",{"aria-label":a("sandbox.savedSectionEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:V.map((A,J)=>{const G=J===V.length-1,W=qs(A);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[J>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>D(J),title:W,className:_e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",G?"font-medium text-foreground":"text-muted-foreground"),children:W})]},`${W}-${J}`)})}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:M?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:F,"aria-label":a(M?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":M,children:M?s.jsx(Jt,{size:14}):s.jsx(Ms,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(M?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:a("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Dt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:I?s.jsx(Qs,{schema:I,value:g,onChange:A=>R(A),basePath:"",breadcrumbPath:p,onBreadcrumbChange:y,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:H},h):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),w!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:a("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Xo,{language:"json",height:"100%",code:w,onChange:K,onSave:A=>{K(A),C()}})})]})]})]})})}function Na(t){const e=Ce.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,g=Be();if(!n){let y;e[0]!==g?(y=g("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=g,e[1]=y):y=e[1];let h;e[2]!==g?(h=g("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=g,e[3]=h):h=e[3];let v;return e[4]!==y||e[5]!==h?(v=s.jsx(Ge,{title:y,description:h}),e[4]=y,e[5]=h,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,h=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=_o(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(j,M)=>x(n.resolveType,j,M),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let w;return e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==r||e[16]!==d||e[17]!==o||e[18]!==i||e[19]!==n.resolveType||e[20]!==n.title||e[21]!==y||e[22]!==S||e[23]!==k||e[24]!==c?(w=s.jsx(ka,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:h,title:v,defaultBlockId:S,isCreating:u,onCreate:k,onSaveReferencedBlock:d},y),e[12]=l,e[13]=a,e[14]=u,e[15]=r,e[16]=d,e[17]=o,e[18]=i,e[19]=n.resolveType,e[20]=n.title,e[21]=y,e[22]=S,e[23]=k,e[24]=c,e[25]=w):w=e[25],w}const f=`saved:${n.key}`;let p;return e[26]!==l||e[27]!==a||e[28]!==r||e[29]!==d||e[30]!==o||e[31]!==i||e[32]!==n.key||e[33]!==f||e[34]!==c?(p=s.jsx(wa,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},f),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=f,e[34]=c,e[35]=p):p=e[35],p}const js="__all__",Cs={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},Pa={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},wt={published:"sandbox.postToolbar.statusPublished",scheduled:"sandbox.postToolbar.statusScheduled",draft:"sandbox.postToolbar.statusDraft"},ws="status:";function Ns(t){if(!t.startsWith(ws))return null;const e=t.slice(ws.length);return e in wt?e:null}const Ps=U.forwardRef(function(e,n){const o=Ce.c(20);let c,l,i,r,a;o[0]!==e?({icon:c,active:l,value:a,className:i,...r}=e,o[0]=e,o[1]=c,o[2]=l,o[3]=i,o[4]=r,o[5]=a):(c=o[1],l=o[2],i=o[3],r=o[4],a=o[5]);const u=l?"text-foreground":"text-muted-foreground";let x;o[6]!==i||o[7]!==u?(x=_e("h-7 gap-1 px-1.5 text-xs",u,i),o[6]=i,o[7]=u,o[8]=x):x=o[8];let d;o[9]!==c?(d=s.jsx(c,{size:14,className:"shrink-0"}),o[9]=c,o[10]=d):d=o[10];let g;o[11]!==a?(g=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=g):g=o[12];let f;o[13]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Xt,{size:12,className:"shrink-0 opacity-60"}),o[13]=f):f=o[13];let p;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==g?(p=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,g,f]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=g,o[19]=p):p=o[19],p});function is(t){const e=Ce.c(2),{count:n}=t;let o;return e[0]!==n?(o=s.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:n}),e[0]=n,e[1]=o):o=e[1],o}function Ta(t){const e=Ce.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:g}=t,f=Be();let p;if(e[0]!==n||e[1]!==l){let T;e[3]!==l?(T=pe=>pe.slug===l,e[3]=l,e[4]=T):T=e[4],p=n.find(T),e[0]=n,e[1]=l,e[2]=p}else p=e[2];const y=p;let h;if(e[5]!==i||e[6]!==o){let T;e[8]!==i?(T=pe=>pe.email===i,e[8]=i,e[9]=T):T=e[9],h=o.find(T),e[5]=i,e[6]=o,e[7]=h}else h=e[7];const v=h,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==f?(k=y?.name??v?.name??f(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=f,e[14]=k):k=e[14];const w=k,j=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:js;let M;e[15]!==x||e[16]!==u||e[17]!==d?(M=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=M):M=e[18];const z=M;let C;e[19]!==z||e[20]!==x||e[21]!==u||e[22]!==d?(C=T=>{T.startsWith("cat:")?(x(null),d(null),u(T.slice(4))):T.startsWith("author:")?(u(null),d(null),x(T.slice(7))):Ns(T)?(u(null),x(null),d(Ns(T))):z()},e[19]=z,e[20]=x,e[21]=u,e[22]=d,e[23]=C):C=e[23];const I=C;let B;e[24]!==w||e[25]!==S?(B=s.jsx(zt,{asChild:!0,children:s.jsx(Ps,{icon:In,active:S,value:w,className:"min-w-0 shrink"})}),e[24]=w,e[25]=S,e[26]=B):B=e[26];let O;e[27]!==f?(O=f("sandbox.postToolbar.filterBy"),e[27]=f,e[28]=O):O=e[28];let _;e[29]!==O?(_=s.jsx(pt,{children:O}),e[29]=O,e[30]=_):_=e[30];let H;e[31]!==f?(H=f("sandbox.postToolbar.allPosts"),e[31]=f,e[32]=H):H=e[32];let R;e[33]!==H?(R=s.jsx(bt,{value:js,children:H}),e[33]=H,e[34]=R):R=e[34];let F;e[35]!==f?(F=f("sandbox.postToolbar.statusLabel"),e[35]=f,e[36]=F):F=e[36];let K;e[37]!==F?(K=s.jsx(pt,{className:"text-muted-foreground/70",children:F}),e[37]=F,e[38]=K):K=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let D;e[40]!==c||e[41]!==f?(D=V.map(T=>s.jsxs(bt,{value:`status:${T}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:f(wt[T])}),s.jsx(is,{count:c[T]})]},`status:${T}`)),e[40]=c,e[41]=f,e[42]=D):D=e[42];let A;e[43]!==n.length||e[44]!==f?(A=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=f,e[45]=A):A=e[45];let J;e[46]!==n?(J=n.map(Ea),e[46]=n,e[47]=J):J=e[47];let G;e[48]!==o.length||e[49]!==f?(G=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=f,e[50]=G):G=e[50];let W;e[51]!==o?(W=o.map(_a),e[51]=o,e[52]=W):W=e[52];let Z;e[53]!==j||e[54]!==I||e[55]!==R||e[56]!==K||e[57]!==D||e[58]!==A||e[59]!==J||e[60]!==G||e[61]!==W?(Z=s.jsxs(ms,{value:j,onValueChange:I,children:[R,K,D,A,J,G,W]}),e[53]=j,e[54]=I,e[55]=R,e[56]=K,e[57]=D,e[58]=A,e[59]=J,e[60]=G,e[61]=W,e[62]=Z):Z=e[62];let Y;e[63]!==Z||e[64]!==_?(Y=s.jsxs(Vt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[_,Z]}),e[63]=Z,e[64]=_,e[65]=Y):Y=e[65];let $;e[66]!==Y||e[67]!==B?($=s.jsxs(Ut,{children:[B,Y]}),e[66]=Y,e[67]=B,e[68]=$):$=e[68];let ee;e[69]!==z||e[70]!==S||e[71]!==f?(ee=S&&s.jsx(Da,{label:f("sandbox.postToolbar.clearFilter"),onClick:z}),e[69]=z,e[70]=S,e[71]=f,e[72]=ee):ee=e[72];const ue=Pa[a];let oe;e[73]!==f||e[74]!==ue?(oe=f(ue),e[73]=f,e[74]=ue,e[75]=oe):oe=e[75];let te;e[76]!==oe?(te=s.jsx(zt,{asChild:!0,children:s.jsx(Ps,{icon:Mn,active:!0,value:oe})}),e[76]=oe,e[77]=te):te=e[77];let se;e[78]!==f?(se=f("sandbox.postToolbar.sortBy"),e[78]=f,e[79]=se):se=e[79];let le;e[80]!==se?(le=s.jsx(pt,{children:se}),e[80]=se,e[81]=le):le=e[81];let E;e[82]!==g?(E=T=>g(T),e[82]=g,e[83]=E):E=e[83];let ne;e[84]===Symbol.for("react.memo_cache_sentinel")?(ne=Object.keys(Cs),e[84]=ne):ne=e[84];let X;e[85]!==f?(X=ne.map(T=>s.jsx(bt,{value:T,children:f(Cs[T])},T)),e[85]=f,e[86]=X):X=e[86];let ae;e[87]!==a||e[88]!==E||e[89]!==X?(ae=s.jsx(ms,{value:a,onValueChange:E,children:X}),e[87]=a,e[88]=E,e[89]=X,e[90]=ae):ae=e[90];let ce;e[91]!==le||e[92]!==ae?(ce=s.jsxs(Vt,{align:"end",className:"w-44",children:[le,ae]}),e[91]=le,e[92]=ae,e[93]=ce):ce=e[93];let L;e[94]!==te||e[95]!==ce?(L=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(Ut,{children:[te,ce]})}),e[94]=te,e[95]=ce,e[96]=L):L=e[96];let me;return e[97]!==$||e[98]!==ee||e[99]!==L?(me=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[$,ee,L]}),e[97]=$,e[98]=ee,e[99]=L,e[100]=me):me=e[100],me}function _a(t){return s.jsxs(bt,{value:`author:${t.email}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(is,{count:t.count})]},`author:${t.email}`)}function Ea(t){return s.jsxs(bt,{value:`cat:${t.slug}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(is,{count:t.count})]},`cat:${t.slug}`)}function Da(t){const e=Ce.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Jt,{size:12}),e[0]=c):c=e[0];let l;return e[1]!==n||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":n,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:c}),e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function Aa(t){const e=Ce.c(18),{checked:n,disabled:o,onToggle:c}=t,l=Be();let i;e[0]!==c?(i=()=>c(),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=l(n?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n||e[6]!==o||e[7]!==i||e[8]!==r?(a=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:Ba,children:s.jsx(os,{checked:n,disabled:o,onCheckedChange:i,"aria-label":r})})}),e[5]=n,e[6]=o,e[7]=i,e[8]=r,e[9]=a):a=e[9];let u;e[10]!==n||e[11]!==l?(u=l(n?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=n,e[11]=l,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx(Me,{side:"bottom",children:u}),e[13]=u,e[14]=x):x=e[14];let d;return e[15]!==a||e[16]!==x?(d=s.jsxs(ze,{children:[a,x]}),e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function Ba(t){return t.stopPropagation()}function $a(t){const e=Ce.c(42),{count:n,allSelected:o,onToggleSelectAll:c,onDelete:l,onExit:i}=t,r=Be();let a;e[0]!==o||e[1]!==c?(a=s.jsx(Aa,{checked:o,onToggle:c}),e[0]=o,e[1]=c,e[2]=a):a=e[2];let u;e[3]!==n||e[4]!==r?(u=r("sandbox.postToolbar.itemsSelected",{count:n}),e[3]=n,e[4]=r,e[5]=u):u=e[5];let x;e[6]!==u?(x=s.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=x):x=e[7];const d=n===0;let g;e[8]!==r?(g=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=g):g=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(sn,{size:14}),e[10]=f):f=e[10];let p;e[11]!==l||e[12]!==d||e[13]!==g?(p=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:d,onClick:l,"aria-label":g,children:f})}),e[11]=l,e[12]=d,e[13]=g,e[14]=p):p=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let h;e[17]!==y?(h=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=h):h=e[18];let v;e[19]!==p||e[20]!==h?(v=s.jsxs(ze,{children:[p,h]}),e[19]=p,e[20]=h,e[21]=v):v=e[21];let S;e[22]!==r?(S=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=S):S=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Jt,{size:14}),e[24]=k):k=e[24];let w;e[25]!==i||e[26]!==S?(w=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":S,children:k})}),e[25]=i,e[26]=S,e[27]=w):w=e[27];let j;e[28]!==r?(j=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=j):j=e[29];let M;e[30]!==j?(M=s.jsx(Me,{side:"bottom",children:j}),e[30]=j,e[31]=M):M=e[31];let z;e[32]!==w||e[33]!==M?(z=s.jsxs(ze,{children:[w,M]}),e[32]=w,e[33]=M,e[34]=z):z=e[34];let C;e[35]!==v||e[36]!==z?(C=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,z]}),e[35]=v,e[36]=z,e[37]=C):C=e[37];let I;return e[38]!==a||e[39]!==C||e[40]!==x?(I=s.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[a,x,C]}),e[38]=a,e[39]=C,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=Ce.c(34),{onDuplicate:n,onRename:o,onAddVariant:c,onEditSeo:l,onViewJson:i,onDelete:r}=t,a=Be();let u;e[0]!==a?(u=a("sandbox.itemActions.moreActions"),e[0]=a,e[1]=u):u=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(zn,{size:14}),e[2]=x):x=e[2];let d;e[3]!==u?(d=s.jsx(zt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":u,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:La,children:x})}),e[3]=u,e[4]=d):d=e[4];let g;e[5]!==o||e[6]!==a?(g=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(el,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=g):g=e[7];let f;e[8]!==n||e[9]!==a?(f=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(Zo,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=f):f=e[10];let p;e[11]!==c||e[12]!==a?(p=c&&s.jsxs(s.Fragment,{children:[s.jsx(Rt,{}),s.jsxs(lt,{onClick:c,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Qo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=p):p=e[13];let y;e[14]!==l||e[15]!==i||e[16]!==a?(y=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(Rt,{}),l&&s.jsxs(lt,{onClick:l,children:[s.jsx(Is,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Ms,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Rt,{}),e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(sn,{size:14}),e[19]=v):v=e[19];let S;e[20]!==a?(S=a("sandbox.itemActions.delete"),e[20]=a,e[21]=S):S=e[21];let k;e[22]!==r||e[23]!==S?(k=s.jsxs(lt,{onClick:r,className:"text-destructive focus:text-destructive",children:[v,S]}),e[22]=r,e[23]=S,e[24]=k):k=e[24];let w;e[25]!==k||e[26]!==g||e[27]!==f||e[28]!==p||e[29]!==y?(w=s.jsxs(Vt,{align:"end",className:"w-44",children:[g,f,p,y,h,k]}),e[25]=k,e[26]=g,e[27]=f,e[28]=p,e[29]=y,e[30]=w):w=e[30];let j;return e[31]!==w||e[32]!==d?(j=s.jsxs(Ut,{children:[d,w]}),e[31]=w,e[32]=d,e[33]=j):j=e[33],j}function La(t){return t.stopPropagation()}function Oa(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Ra(t){const e=new Map;for(const n of t){const o=Oa(n.resolveType),c=e.get(o);c?c.push(n):e.set(o,[n])}return[...e.entries()].map(([n,o])=>({label:n,sections:o})).sort((n,o)=>n.label.localeCompare(o.label))}function Ts(t){const e=Ce.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=_e("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",c),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==n?(i=s.jsx(n,{size:13,className:"shrink-0"}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const _s=U.lazy(()=>Fe(()=>import("./app-editor-DeI0TeES.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193])).then(t=>({default:t.AppEditor}))),Fa=U.lazy(()=>Fe(()=>import("./post-editor-BAf6FqSQ.js"),__vite__mapDeps([194,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,32,61,31,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,80,93,195,135,106,146,147,79,110,102,186,130,182,101,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,27,103,104,105,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,131,132,133,134,136,137,138,139,140,141,142,143,144,145,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,187,188,189,196,197,198,199,190,191,192,193])).then(t=>({default:t.PostEditor}))),Ka=U.lazy(()=>Fe(()=>import("./record-editor-n0M7yiQw.js"),__vite__mapDeps([200,1,2,80,93,27,28,29,130,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,94,95,45,48,39,31,32,33,35,36,37,38,40,41,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,186,187,188,189,198,199,190,191,192,193])).then(t=>({default:t.RecordEditor}))),Ia=U.lazy(()=>Fe(()=>import("./category-editor-4KcN0JRt.js"),__vite__mapDeps([201,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,37,52,61,31,32,33,34,35,36,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,178,80,93,196,81,82,83,84,85,86,87,79,88,89,90,91,92,94,95,96,97,98,99,100,101,27,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,185,182,26,183,184,186,187,188,189,197,198,199,190,191,192,193])).then(t=>({default:t.CategoryEditor}))),Ma=U.lazy(()=>Fe(()=>import("./bulk-category-panel-D-Hh71MB.js"),__vite__mapDeps([202,1,2,52,93,203,43,27,28,29])).then(t=>({default:t.BulkCategoryPanel}))),za=U.lazy(()=>Fe(()=>import("./sections-editor-Bv2odcBq.js"),__vite__mapDeps([204,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,93,80,94,95,28,45,48,39,31,32,33,35,36,37,38,40,41,29,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,101,27,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,182,183,184,185,186,187,188,189,191,205,30,206])).then(t=>({default:t.SectionsEditor}))),Va=U.lazy(()=>Fe(()=>import("./seo-editor-DJw3ydvJ.js"),__vite__mapDeps([207,1,2,25,31,32,33,34,35,36,37,38,39,40,41,28,29,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,26,27,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,83,84,85,86,87,79,88,89,90,91,92,93,80,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,183,184,185,186,187,188,189,205])).then(t=>({default:t.SeoEditor}))),Ua=U.lazy(()=>Fe(()=>import("./variant-calendar-urd0wE-3.js"),__vite__mapDeps([208,1,2,31,32,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,93,26,27,186,209,190,82,4,5,6,7,8,9,10,83,84,85,86,3,11,12,13,14,15,16,17,18,19,20,21,22,23,24,87,79,88,89,90,91,92,80,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,178,81,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,182,183,184,185,187,188,189,191,192,193])).then(t=>({default:t.VariantCalendar}))),Ha=U.lazy(()=>Fe(()=>import("./post-calendar-DuH_hA9y.js"),__vite__mapDeps([210,1,2,32,31,33,34,35,36,37,38,39,40,41,28,29,25,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,211,26,27,190,82,4,5,6,7,8,9,10,83,84,85,86,3,11,12,13,14,15,16,17,18,19,20,21,22,23,24,87,79,88,89,90,91,92,93,80,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,178,81,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,181,182,183,184,185,186,187,188,189,191,192,193])).then(t=>({default:t.PostCalendar}))),Ga=U.lazy(()=>Fe(()=>import("./redirect-editor-CK3YSOdb.js"),__vite__mapDeps([212,1,2,106,28,80,93,27,29,182,101,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,81,82,55,62,83,84,85,86,34,87,79,88,89,69,90,91,92,94,95,45,48,39,31,32,33,35,36,37,38,40,41,25,42,43,44,46,47,49,50,51,52,53,54,56,57,58,59,60,61,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,96,97,98,99,100,102,103,104,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,26,183,184,185,186,187,188,189,199])).then(t=>({default:t.RedirectEditor})));function Ja(t){const e=Ce.c(20),{deepLinkPage:n}=t,o=Qt(),{currentBranch:c}=Ls(),{org:l}=An(),i=o?.entity?.id??null,r=Ko(),a=Io(),{runtime:u,previewServerUrl:x}=Mo(i),d=u==="cms";let g;e[0]!==d||e[1]!==a.previewState||e[2]!==r.lifecycle.phase?(g=vl({fastPreviewActive:d,previewState:a.previewState,lifecyclePhase:r.lifecycle.phase}),e[0]=d,e[1]=a.previewState,e[2]=r.lifecycle.phase,e[3]=g):g=e[3];const f=g;if(f.kind==="sandbox-card"){const h=`/${l.slug}/settings/connections`;let v;return e[4]!==f.state||e[5]!==a.start||e[6]!==h||e[7]!==r.lifecycle||e[8]!==r.phase?(v=s.jsx(bl,{state:f.state,claimPhase:r.phase,lifecycle:r.lifecycle,onStart:a.start,connectionsHref:h}),e[4]=f.state,e[5]=a.start,e[6]=h,e[7]=r.lifecycle,e[8]=r.phase,e[9]=v):v=e[9],v}if(!i||!c){let h;return e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ge,{title:"Waiting for sandbox context…"}),e[10]=h):h=e[10],h}const p=d?x:a.previewUrl;let y;return e[11]!==c||e[12]!==n||e[13]!==f.devServerReady||e[14]!==f.sandboxWarming||e[15]!==a.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==i?(y=s.jsx(Ya,{orgSlug:l.slug,virtualMcpId:i,branch:c,previewUrl:a.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:f.devServerReady,sandboxWarming:f.sandboxWarming}),e[11]=c,e[12]=n,e[13]=f.devServerReady,e[14]=f.sandboxWarming,e[15]=a.previewUrl,e[16]=l.slug,e[17]=p,e[18]=i,e[19]=y):y=e[19],y}const Es=2e3,Wa=15;function Ds(t,e,n,o){return typeof e!="string"||n&&(nn(e,n,o)||t.state.dataUpdateCount>=Wa)?!1:Es}function Ya({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,sitePreviewUrl:c,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const a=Be(),u=Et()?.taskId??null,x={orgSlug:t,virtualMcpId:e,branch:n,threadId:u,previewUrl:o},{data:d,isLoading:g}=Eo(x,{fetchEnabled:i}),f=$s({strict:!1}),[p,y]=U.useState(()=>f.contentCollection&&qe(f.contentCollection)&&f.contentCollection||"pages"),[h,v]=U.useState(()=>f.contentItem&&qe(p)?{collection:p,key:f.contentItem}:null),[S,k]=U.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[j,M]=U.useState(!1);if(w&&!j&&h===null&&d){M(!0);const m=oo(rs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[z,C]=U.useState(""),[I,B]=U.useState(null),[O,_]=U.useState(null),[H,R]=U.useState(null),[F,K]=U.useState("date-desc"),[V,D]=U.useState(()=>new Set),[A,J]=U.useState(null),G=()=>{D(new Set),J(null)},W=m=>{v(m),k(null)},[Z,Y]=U.useState(p);Z!==p&&(Y(p),C(""),B(null),_(null),R(null),K("date-desc"),D(new Set),J(null));const{data:$,isLoading:ee,isFetching:ue}=Do(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(p==="apps"&&h&&h.collection==="apps"){const q=d?.[h.key];return Ds(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(p==="site"&&d){const q=P?cs(d,P):null,Q=d.site,je=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Ds(m,je,P,["seo"])}return!1}}),oe=(m,P)=>!nn(m,$,P)&&(ee||ue),{catalog:te,isLoading:se}=pl($??void 0,d??void 0,{enabled:p==="apps"}),le=aa({orgSlug:t,virtualMcpId:e,branch:n,meta:$}),E=Js(x),ne=$o(x),[X,ae]=U.useState(null),[ce,L]=U.useState(),[me,T]=U.useState(!1),[pe,he]=U.useState(),[ge,ye]=U.useState(null),[ie,de]=U.useState(null),[xe,ke]=U.useState(null),Te=!d||!$;if(g||ee||Te&&r)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})});if(Te)return s.jsx(Ge,{title:"Could not load site data."});const we=rs(d).sort((m,P)=>m.name.localeCompare(P.name)),be=lo(d).sort((m,P)=>m.from.localeCompare(P.from)),De=ao(d,$),$e=p==="sections"?io($):[],N=cs(d,$),re=cn(d),ve=ls.some(m=>re[m].length>0),Ee=qe(p)?re[p]:[],ct=(ve?vt(d,"categories"):[]).map(({key:m,payload:P})=>{const q=typeof P.slug=="string"?P.slug:"",Q=typeof P.name=="string"?P.name:"";return{slug:q||m,name:Q||q||m}}).filter(m=>m.slug).sort((m,P)=>m.name.localeCompare(P.name)),et=p==="posts"&&(V.size>0||A!==null),dt=et?fn(d).filter(m=>V.has(m.key)):[],ut=ds($,"loaders"),tt=ds($,"actions");if(!ro(d,$)&&!ve&&ut===0&&tt===0)return s.jsx(Ge,{icon:Os,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Bt={pages:we.length,sections:De.length,apps:te.length,loaders:ut,actions:tt,redirects:be.length,posts:re.posts.length,authors:re.authors.length,categories:re.categories.length},We=new Set(we.map(m=>Ct(m.path))),st=new Set(we.map(m=>m.name)),mt=new Set(De.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=Xs(d,m.key),Q=Ao(d,m.key,Math.max(0,q-1)),je=Bo(P.sections,Q);if(je)try{await E.mutateAsync({blockKey:m.key,data:{...P,sections:je}}),Se.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:"Could not add variant")}},Ve=()=>{L(void 0),ae({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{L(void 0),ae({mode:"duplicate",sourceKey:m.key,initialName:hs(st,m.name),initialPath:Sl(We,m.path)})},He=m=>{L(void 0),ae({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!X)return;const{mode:P,sourceKey:q}=X;try{if(P==="create"){let Q;if(m.templateKey){const Pe=d[m.templateKey];if(!Pe)throw new Error("Selected template no longer exists.");Q={...Pe,name:m.name,path:m.path}}else Q=Cl(m.name,m.path);const je=Nl(d,m.name);await E.mutateAsync({blockKey:je,data:Q}),Se.success(`Created "${m.name}"`),v({collection:"pages",key:je,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:je,data:Pe}=jl({source:Q,pages:we,newName:m.name,newPath:m.path});await E.mutateAsync({blockKey:je,data:Pe}),Se.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:je,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const je={...Q,name:m.name,path:m.path};await E.mutateAsync({blockKey:q,data:je}),Se.success("Page updated"),h?.collection==="pages"&&h.key===q&&v({collection:"pages",key:q,path:m.path})}ae(null)}catch(Q){L(Q instanceof Error?Q.message:"Save failed")}},fe=({path:m})=>{if(!X)return null;const P=Ct(m);return(X.mode==="rename"?Ct(X.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await E.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),Se.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Ys((m,P)=>E.mutate({blockKey:m,data:P})),bn=async m=>{const P=d[m.key];if(!P){Se.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=kl(d,m.key),Q=hs(mt,m.name),je={...P,name:Q};try{await E.mutateAsync({blockKey:q,data:je}),Se.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:a("sandbox.contentBrowser.duplicateFailed"))}},yn=async m=>{if(!ge)return;const P=d[ge];if(!P){Se.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await E.mutateAsync({blockKey:ge,data:{...P,name:m}}),Se.success(a("sandbox.contentBrowser.sectionRenamed")),ye(null)}catch(q){Se.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},vn=()=>{he(void 0),T(!0)},Sn=async m=>{const P=co(d,m.from),q=uo(m);try{await E.mutateAsync({blockKey:P,data:q}),Se.success("Created redirect"),T(!1),v({collection:"redirects",key:P})}catch(Q){he(Q instanceof Error?Q.message:"Could not create redirect")}},kn=async m=>{const P=Kt(d,m),q=it(P,m,pn(m));try{await E.mutateAsync({blockKey:P,data:q}),Se.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){Se.error(Q instanceof Error?Q.message:"Could not create")}},jn=async m=>{const P=Kt(d,"posts"),q=it(P,"posts",Ql(m));try{await E.mutateAsync({blockKey:P,data:q}),Se.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),Y("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){Se.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},Cn=async(m,P)=>{const q=d[m],Q=q?Zl(xt(q,"posts"),P):null;if(!Q){Se.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await E.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(je){Se.error(je instanceof Error?je.message:a("sandbox.postCalendar.couldNotReschedule"))}},wn=async m=>{const P=d[m.key];if(!P){Se.error("Record not found.");return}const q=Kt(d,m.kind),Q=m.kind==="posts"?"title":"name",je={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await E.mutateAsync({blockKey:q,data:it(q,m.kind,je)}),Se.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(Pe){Se.error(Pe instanceof Error?Pe.message:"Duplicate failed")}},Nn=m=>{D(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Pn=m=>{y("posts"),Y("posts"),v(null),k(null),C(""),B(null),_(null),R(null),K("date-desc"),D(new Set),J(m||null)},Tn=async(m,P)=>{const q=[...V];let Q=0;for(const je of q){const Pe=d[je],ot=xt(Pe,"posts"),ft=m==="add"?Ml(ot,P):zl(ot,P);ft!==ot&&(await E.mutateAsync({blockKey:je,data:it(je,"posts",bs(ft))}),Q+=1)}return Q},_n=async(m,P)=>{const q=V.size;try{const Q=await Tn(m,P),je=m==="add"?"Added to":"Moved",Pe=q-Q;Se.success(`${je} ${Q} ${Q===1?"post":"posts"}`+(Pe>0?` (${Pe} already set)`:"")),G()}catch(Q){Se.error(Q instanceof Error?Q.message:"Bulk update failed")}},En=async()=>{if(ie)try{if(ie.kind==="blog-bulk"){for(const Q of ie.keys)await ne.mutateAsync({blockKey:Q});Se.success(`Deleted ${ie.count} ${ie.count===1?"post":"posts"}`),h&&h.collection!=="available-section"&&ie.keys.includes(h.key)&&v(null),G(),de(null);return}const{kind:m,key:P,label:q}=ie;if(m==="blog"){if(ie.blogKind==="categories"){const Q=xt(d[P],"categories").slug,je=typeof Q=="string"?Q:"";if(je)for(const{key:Pe,payload:ot}of vt(d,"posts")){const ft=Vl(ot,je);ft!==ot&&await E.mutateAsync({blockKey:Pe,data:it(Pe,"posts",bs(ft))})}}await ne.mutateAsync({blockKey:P})}else await ne.mutateAsync({blockKey:P});Se.success(`Deleted "${q}"`),h&&h.collection!=="available-section"&&h.key===P&&v(null),de(null)}catch(m){Se.error(m instanceof Error?m.message:"Delete failed")}},St=ne.isPending||E.isPending,Dn=ie?.kind==="blog"?yt[ie.blogKind]:ie?.kind==="blog-bulk"?`${ie.count} ${ie.count===1?"post":"posts"}`:ie?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(gl,{active:p,counts:Bt,showBlog:ve,onSelect:m=>{y(m),v(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="calendar"&&p!=="post-schedule"&&p!=="loaders"&&p!=="actions"&&s.jsx(qa,{activeCollection:p,pages:we,redirects:be,sections:De,availableSections:$e,appCatalog:te,appCatalogLoading:se,blogEntries:Ee,decofile:d,searchQuery:z,onSearchChange:C,postCategoryFilter:I,postAuthorFilter:O,postStatusFilter:H,postSort:F,onPostCategoryFilterChange:m=>{B(m),D(new Set)},onPostAuthorFilterChange:m=>{_(m),D(new Set)},onPostStatusFilterChange:m=>{R(m),D(new Set)},onPostSortChange:K,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:Nn,onSelectAllPosts:m=>D(new Set(m)),onClearPostSelection:()=>D(new Set),onExitPostSelection:G,onBulkDeletePosts:()=>de({kind:"blog-bulk",keys:[...V],count:V.size}),selection:h,onSelect:W,onCreate:()=>{p==="pages"?Ve():p==="redirects"?vn():qe(p)&&kn(p)},onDuplicatePage:Ue,onRenamePage:He,onAddPageVariant:nt,onDeletePage:m=>de({kind:"page",key:m.key,label:m.name}),onEditPageSeo:m=>{const P={collection:"pages",key:m.key,path:m.path};v(P),k(m.key)},onViewPageJson:m=>ke(m.key),onDuplicateSection:bn,onRenameSection:m=>ye(m.key),onDeleteSection:m=>de({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>de({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:wn,onDeleteBlog:m=>de({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?s.jsx(ma,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:$,decofile:d,kind:p}):s.jsx(U.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?s.jsx(Ua,{decofile:d}):p==="post-schedule"?s.jsx(Ha,{decofile:d,support:le,isCreating:E.isPending,onCreate:m=>{jn(m)},onReschedule:(m,P)=>{Cn(m,P)},onSelect:m=>{y("posts"),Y("posts"),v({collection:"posts",key:m}),k(null)}}):p==="site"?N?s.jsx(_s,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:$,title:"Site",excludeFields:["seo"],schemaPending:oe(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(Ge,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="seo"?s.jsx(Va,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:$,target:{kind:"site"},previewBaseUrl:c}):p==="sections"?s.jsx(Na,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:$,decofile:d,isCreating:E.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(Ma,{posts:dt,categories:ct,initialSlug:A,isPending:E.isPending,onApply:(m,P)=>{_n(m,P)},onClose:G},A??"selection"):h&&h.collection!=="available-section"?h.collection==="apps"?s.jsx(_s,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,previewBaseUrl:o,schemaPending:oe(typeof d[h.key]?.__resolveType=="string"?String(d[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="posts"?s.jsx(Fa,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,previewBaseUrl:c},`post:${h.key}`):h.collection==="categories"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key],decofile:d,meta:$,onManagePosts:Pn,onOpenPost:m=>{y("posts"),Y("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${h.key}`):h.collection==="authors"?s.jsx(Ka,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:h.key,block:d[h.key]},`authors:${h.key}`):h.collection==="redirects"?s.jsx(Ga,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:h.key,block:d[h.key]},`redirect:${h.key}`):s.jsx(za,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&S===h.key,onExitSeo:()=>k(null)},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):s.jsx(Ge,{title:`Select ${qe(p)?`a ${yt[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),X&&s.jsx(El,{open:!!X,mode:X.mode,initialName:X.initialName,initialPath:X.initialPath,isPending:E.isPending,error:ce,templates:we,validate:fe,onSubmit:b,onOpenChange:m=>{m||(ae(null),L(void 0))}}),s.jsx(Al,{open:me,isPending:E.isPending,error:pe,onSubmit:Sn,onOpenChange:m=>{m||(T(!1),he(void 0))}}),ge&&s.jsx(Bl,{open:!!ge,blockKey:ge,initialName:De.find(m=>m.key===ge)?.name??ge,isPending:E.isPending,onSubmit:yn,onOpenChange:m=>{m||ye(null)}}),xe&&s.jsx(Lo,{open:!!xe,onOpenChange:m=>{m||ke(null)},pageKey:xe,decofile:d,onSave:m=>E.mutateAsync({blockKey:xe,data:m})}),s.jsx(Un,{open:!!ie,onOpenChange:m=>{!m&&!St&&de(null)},children:s.jsxs(Hn,{children:[s.jsxs(Gn,{children:[s.jsx(Jn,{children:`Delete ${Dn}?`}),s.jsx(Wn,{children:ie?.kind==="section"?`"${ie.label}" will be removed. Pages that still reference it will lose this section.`:ie?.kind==="blog-bulk"?`${ie.count} ${ie.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ie?`"${ie.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(Yn,{children:[s.jsx(qn,{disabled:St,children:"Cancel"}),s.jsx(Qn,{onClick:m=>{m.preventDefault(),En()},disabled:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:St?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function qa(t){const e=Ce.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:g,postCategoryFilter:f,postAuthorFilter:p,postStatusFilter:y,postSort:h,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:w,selectedPostKeys:j,postBulkPanelOpen:M,onTogglePostSelect:z,onSelectAllPosts:C,onClearPostSelection:I,onExitPostSelection:B,onBulkDeletePosts:O,selection:_,onSelect:H,onCreate:R,onDuplicatePage:F,onRenamePage:K,onAddPageVariant:V,onDeletePage:D,onEditPageSeo:A,onViewPageJson:J,onDuplicateSection:G,onRenameSection:W,onDeleteSection:Z,onDeleteRedirect:Y,onDuplicateBlog:$,onDeleteBlog:ee}=t;let ue,oe,te,se,le,E,ne;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==O||e[8]!==I||e[9]!==R||e[10]!==ee||e[11]!==D||e[12]!==Y||e[13]!==Z||e[14]!==$||e[15]!==F||e[16]!==G||e[17]!==A||e[18]!==B||e[19]!==S||e[20]!==v||e[21]!==w||e[22]!==k||e[23]!==K||e[24]!==W||e[25]!==g||e[26]!==H||e[27]!==C||e[28]!==z||e[29]!==J||e[30]!==o||e[31]!==p||e[32]!==M||e[33]!==f||e[34]!==h||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==j||e[40]!==_){const L=d.toLowerCase(),me=o.filter(b=>!L||b.name.toLowerCase().includes(L)||b.path.toLowerCase().includes(L)),T=c.filter(b=>!L||b.from.toLowerCase().includes(L)||b.to.toLowerCase().includes(L)),pe=l.filter(b=>!L||b.name.toLowerCase().includes(L)||b.key.toLowerCase().includes(L)||b.resolveType.toLowerCase().includes(L)),he=i.filter(b=>!L||b.title.toLowerCase().includes(L)||b.resolveType.toLowerCase().includes(L)||(b.description?.toLowerCase().includes(L)??!1)),ge=Ra(pe),ye=r.filter(b=>!L||b.title.toLowerCase().includes(L)||b.app.toLowerCase().includes(L)||b.vendor.toLowerCase().includes(L)||b.category.toLowerCase().includes(L)),ie=u.filter(b=>!L||b.label.toLowerCase().includes(L)||b.subtitle.toLowerCase().includes(L)),de=n==="posts",xe=ei,ke=de?fn(x):[],Te=new Map,we=new Map,be={published:0,scheduled:0,draft:0};for(const b of ke)be[b.status]=be[b.status]+1;for(const b of ke){for(const fe of b.categorySlugs)Te.set(fe,(Te.get(fe)??0)+1);for(const fe of b.authorEmails)we.set(fe,(we.get(fe)??0)+1)}const De=(de?vt(x,"categories"):[]).map(b=>{const{key:fe,payload:Ae}=b,Ye=xe(Ae.slug)||fe;return{slug:Ye,name:xe(Ae.name)||xe(Ae.slug)||fe,count:Te.get(Ye)??0}}).filter(Za),$e=(de?vt(x,"authors"):[]).map(b=>{const{key:fe,payload:Ae}=b,Ye=xe(Ae.email);return{email:Ye,name:xe(Ae.name)||xe(Ae.email)||fe,count:we.get(Ye)??0}}).filter(Xa);let N;e[48]!==f?(N=b=>!f||b.categorySlugs.includes(f),e[48]=f,e[49]=N):N=e[49];let re;e[50]!==p?(re=b=>!p||b.authorEmails.includes(p),e[50]=p,e[51]=re):re=e[51];let ve;e[52]!==y?(ve=b=>!y||b.status===y,e[52]=y,e[53]=ve):ve=e[53];let Ee;e[54]!==h?(Ee=(b,fe)=>{if(h==="az")return b.title.localeCompare(fe.title);if(h==="za")return fe.title.localeCompare(b.title);const Ae=b.date.localeCompare(fe.date);return h==="date-asc"?Ae:-Ae},e[54]=h,e[55]=Ee):Ee=e[55];const ct=ke.filter(b=>!L||b.title.toLowerCase().includes(L)||b.slug.toLowerCase().includes(L)).filter(N).filter(re).filter(ve).sort(Ee),et=j.size,dt=ct.map(Qa),ut=dt.length>0&&dt.every(b=>j.has(b)),tt=et>0||M,Bt=()=>{ut?I():C(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";le="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let nt;e[56]===Symbol.for("react.memo_cache_sentinel")?(nt=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==g?(Ve=b=>g(b.target.value),e[57]=g,e[58]=Ve):Ve=e[58];let Ue;e[59]!==We||e[60]!==d||e[61]!==Ve?(Ue=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[nt,s.jsx("input",{type:"text",value:d,onChange:Ve,placeholder:We,"aria-label":We,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[59]=We,e[60]=d,e[61]=Ve,e[62]=Ue):Ue=e[62];let He;e[63]!==st||e[64]!==R||e[65]!==mt?(He=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:R,"aria-label":st,children:s.jsx(Vn,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=R,e[65]=mt,e[66]=He):He=e[66],e[67]!==Ue||e[68]!==He?(E=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,He]}),e[67]=Ue,e[68]=He,e[69]=E):E=e[69],ne=de&&(tt?s.jsx($a,{count:et,allSelected:ut,onToggleSelectAll:Bt,onDelete:O,onExit:B}):s.jsx(Ta,{categories:De,authors:$e,categoryFilter:f,statusCounts:be,authorFilter:p,statusFilter:y,sort:h,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:w})),ue=Dt,se="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",oe="flex flex-col gap-1 p-1.5",te=n==="pages"?me.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):me.map(b=>{const fe=_?.collection==="pages"&&_.key===b.key,Ae=Xs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:fe,variantCount:Ae,onClick:()=>H({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>F(b),onRename:()=>K(b),onAddVariant:()=>V(b),onEditSeo:()=>A(b),onViewJson:()=>J(b),onDelete:()=>D(b)})},b.key)}):n==="sections"?pe.length===0&&he.length===0?s.jsx(at,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[ge.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ts,{icon:It,label:"Saved sections"}),ge.map(b=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:b.label}),b.sections.map(fe=>{const Ae=_?.collection==="sections"&&_.key===fe.key;return s.jsx(Re,{icon:It,accent:"global",title:fe.name,subtitle:b.label,active:Ae,onClick:()=>H({collection:"sections",key:fe.key}),menu:s.jsx(gt,{onDuplicate:()=>G(fe),onRename:()=>W(fe),onDelete:()=>Z(fe)})},fe.key)})]},b.label))]}),he.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ts,{icon:jt,label:"Available sections",className:_e(ge.length>0&&"mt-3")}),he.map(b=>{const fe=_?.collection==="available-section"&&_.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:fe,onClick:()=>H({collection:"available-section",resolveType:b.resolveType,title:b.title})},b.resolveType)})]})]}):n==="apps"?a?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Qe,{className:"size-4.5 text-muted-foreground"})}):ye.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ye.map(b=>{const fe=_?.collection==="apps"&&b.blockKey!==null&&_.key===b.blockKey;return s.jsx(Re,{icon:zs,logoUrl:b.logo,title:b.title,subtitle:b.category,active:fe,trailing:b.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!b.installed||!b.blockKey){Se.message(`${b.title} is not installed on this site.`);return}H({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?T.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):T.map(b=>s.jsx(Re,{icon:Rs,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:_?.collection==="redirects"&&_.key===b.key,trailing:s.jsx($l,{type:b.type}),onClick:()=>H({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>Y(b)})},b.key)):de?ct.length===0?s.jsx(at,{hasItems:ke.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const fe={key:b.key,kind:"posts",label:b.title,subtitle:b.slug};return s.jsx(Re,{icon:Mt,title:b.title,subtitle:b.slug||"no slug",invalid:b.missing.length>0,invalidReason:`Missing: ${b.missing.join(", ")}`,active:_?.collection==="posts"&&_.key===b.key,selectable:!0,selectionActive:tt,selected:j.has(b.key),onToggleSelect:()=>z(b.key),onClick:()=>tt?z(b.key):H({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>$(fe),onDelete:()=>ee(fe)})},b.key)}):ie.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ie.map(b=>{const fe=_?.collection===b.kind&&_.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Mt:b.kind==="authors"?Us:Ks,title:b.label,subtitle:b.subtitle,active:fe,onClick:()=>H({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>$(b),onDelete:()=>ee(b)})},b.key)}),e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=u,e[5]=x,e[6]=V,e[7]=O,e[8]=I,e[9]=R,e[10]=ee,e[11]=D,e[12]=Y,e[13]=Z,e[14]=$,e[15]=F,e[16]=G,e[17]=A,e[18]=B,e[19]=S,e[20]=v,e[21]=w,e[22]=k,e[23]=K,e[24]=W,e[25]=g,e[26]=H,e[27]=C,e[28]=z,e[29]=J,e[30]=o,e[31]=p,e[32]=M,e[33]=f,e[34]=h,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=j,e[40]=_,e[41]=ue,e[42]=oe,e[43]=te,e[44]=se,e[45]=le,e[46]=E,e[47]=ne}else ue=e[41],oe=e[42],te=e[43],se=e[44],le=e[45],E=e[46],ne=e[47];let X;e[70]!==oe||e[71]!==te?(X=s.jsx("div",{className:oe,children:te}),e[70]=oe,e[71]=te,e[72]=X):X=e[72];let ae;e[73]!==ue||e[74]!==se||e[75]!==X?(ae=s.jsx(ue,{className:se,children:X}),e[73]=ue,e[74]=se,e[75]=X,e[76]=ae):ae=e[76];let ce;return e[77]!==le||e[78]!==E||e[79]!==ne||e[80]!==ae?(ce=s.jsxs("div",{className:le,children:[E,ne,ae]}),e[77]=le,e[78]=E,e[79]=ne,e[80]=ae,e[81]=ce):ce=e[81],ce}function Qa(t){return t.key}function Xa(t){return t.email}function Za(t){return t.slug}function ei(t){return typeof t=="string"?t:""}function ti(t){const e=Ce.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=U.useState(!1),i=tn(n),{activeTask:r}=Ls();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=$s(a);if(!(fs(i?.metadata)||fs(r?.metadata))){let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(ps,{className:"size-7 text-foreground"})}),e[1]=g):g=e[1];let f;e[2]!==o?(f=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let y,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),h=s.jsx(ps,{className:"size-4"}),e[6]=y,e[7]=h):(y=e[6],h=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let S;e[10]!==v?(S=s.jsxs(Oe,{onClick:y,children:[h,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==f||e[13]!==p||e[14]!==S?(k=s.jsx(tl,{className:"h-full",image:g,title:f,description:p,actions:S}),e[12]=f,e[13]=p,e[14]=S,e[15]=k):k=e[15];let w;e[16]!==c?(w=s.jsx(sl,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=w):w=e[17];let j;return e[18]!==w||e[19]!==k?(j=s.jsxs(s.Fragment,{children:[k,w]}),e[18]=w,e[19]=k,e[20]=j):j=e[20],j}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Ja,{deepLinkPage:{pageId:u.contentPageId,path:u.contentPath,pathTemplate:u.contentPathTemplate}}),e[21]=u.contentPageId,e[22]=u.contentPath,e[23]=u.contentPathTemplate,e[24]=d):d=e[24],d}function si(){const t=Ce.c(2),e=nl();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx(ti,{virtualMcpId:e})}),t[0]=e,t[1]=n):n=t[1],n}const ar=Object.freeze(Object.defineProperty({__proto__:null,default:si},Symbol.toStringTag,{value:"Module"}));export{sa as A,nr as B,ar as C,Qi as M,qi as W,or as a,it as b,lr as c,Gi as d,Hi as e,Ji as f,xt as g,Jl as h,Yl as i,Yi as j,fn as k,vt as l,dn as m,kl as n,Wi as o,mn as p,Xi as q,ll as r,bs as s,er as t,aa as u,Xe as v,tr as w,Zi as x,sr as y,Tt as z};
|