decocms 4.372.0 → 4.372.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Ddrj7VUD.js → AlertCircle-DbwtWnTP.js} +1 -1
- package/dist/client/assets/{AreaChart-0mAtLd45.js → AreaChart-tdrxZdfF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BKbGYh2B.js → ArrowLeft-CyH6aWpS.js} +1 -1
- package/dist/client/assets/{ArrowRight-6hYTENh_.js → ArrowRight-Bv0iX4wy.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dhew3Evs.js → ArrowUp-Scf6R8DX.js} +1 -1
- package/dist/client/assets/{CartesianChart-u2Ri6JFS.js → CartesianChart-D1MxLL7k.js} +1 -1
- package/dist/client/assets/{Check-Dnz3uW0f.js → Check-BZE0WrNL.js} +1 -1
- package/dist/client/assets/{CheckCircle-DQbrJHsr.js → CheckCircle-BKb1RVrA.js} +1 -1
- package/dist/client/assets/{ChevronRight-DK_MoZ-7.js → ChevronRight-DNrwFBnC.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B64gqtde.js → ChevronSelectorVertical-oXn0cTzk.js} +1 -1
- package/dist/client/assets/{ChevronUp-XOZg-HiO.js → ChevronUp-D5_IWEtB.js} +1 -1
- package/dist/client/assets/{Copy01-l6PfB431.js → Copy01-DTHuBaTA.js} +1 -1
- package/dist/client/assets/{CreditCard01-DQsLDZWx.js → CreditCard01-CwX6pA0M.js} +1 -1
- package/dist/client/assets/{Database01-vUZciuwF.js → Database01-RGlwXHSd.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dyzdr42E.js → DotsVertical-DE9eZKrJ.js} +1 -1
- package/dist/client/assets/{Download01-_eUxcgg1.js → Download01-qX3hmvr5.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DFc19StE.js → ErrorBarContext-9sp0Dc4M.js} +1 -1
- package/dist/client/assets/{Eye-B7hZLXRZ.js → Eye-DXUjft5i.js} +1 -1
- package/dist/client/assets/{File02-D1W0NjQG.js → File02-g-xJPix_.js} +1 -1
- package/dist/client/assets/{GitBranch01-CRUhFeKk.js → GitBranch01-ddoPQdPH.js} +1 -1
- package/dist/client/assets/{Globe01-D9zr3JIX.js → Globe01-DIy8wXF6.js} +1 -1
- package/dist/client/assets/{HardDrive-7_ZjnLMv.js → HardDrive-DU_z1AQw.js} +1 -1
- package/dist/client/assets/{Image01-7_HSDHV3.js → Image01-DfaxHjlV.js} +1 -1
- package/dist/client/assets/{Key01-ti2CpCiW.js → Key01-mqjfsZRe.js} +1 -1
- package/dist/client/assets/{Line-D9piFifo.js → Line-D02_6GXf.js} +1 -1
- package/dist/client/assets/{Link01-DYWtgbsz.js → Link01-C656VtHx.js} +1 -1
- package/dist/client/assets/{LinkExternal01--55N_6ts.js → LinkExternal01-BkRUjBAn.js} +1 -1
- package/dist/client/assets/{MessageCircle01-DELRsE6A.js → MessageCircle01-CgotMmLL.js} +1 -1
- package/dist/client/assets/{Monitor01-BoIweS2p.js → Monitor01-CQ6Zk1oP.js} +1 -1
- package/dist/client/assets/{Package-CSgBbMFc.js → Package-t6euxYcP.js} +1 -1
- package/dist/client/assets/{Palette-CaHW8y9T.js → Palette-oECS8j3l.js} +1 -1
- package/dist/client/assets/{Play-BolLrTAn.js → Play-DQgzDnaW.js} +1 -1
- package/dist/client/assets/{Plus-C5azC59K.js → Plus-D2HOi_DD.js} +1 -1
- package/dist/client/assets/{Printer-Dn2De3ak.js → Printer-BpZBiqyG.js} +1 -1
- package/dist/client/assets/{SearchLg-BZUR3n9c.js → SearchLg-DbX4T5E-.js} +1 -1
- package/dist/client/assets/{SearchMd-Ms_xvSfF.js → SearchMd-FDCJM3CR.js} +1 -1
- package/dist/client/assets/{Sector-DHu8bCK4.js → Sector-BW9tyobX.js} +1 -1
- package/dist/client/assets/{Settings02-BLcAotUO.js → Settings02-CFcKewXh.js} +1 -1
- package/dist/client/assets/{Share07-BypmcbEF.js → Share07-CxuHcmnM.js} +1 -1
- package/dist/client/assets/{Shield01-C_5dC1mR.js → Shield01-HrKG6yUn.js} +1 -1
- package/dist/client/assets/{Stars01-DTStBsXP.js → Stars01-B_nM3FYf.js} +1 -1
- package/dist/client/assets/{Sun-CEaGM44s.js → Sun-SBoG-e9B.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-l3o5r_PJ.js → SwitchHorizontal01-hHr6GOmU.js} +1 -1
- package/dist/client/assets/{Tool01-C0-Xqkxp.js → Tool01-DHi_Z7zo.js} +1 -1
- package/dist/client/assets/{Tool02-CE2Fqpba.js → Tool02-JY0gm8cg.js} +1 -1
- package/dist/client/assets/{Trash01-DPQmLNZV.js → Trash01-C6bziN5X.js} +1 -1
- package/dist/client/assets/{TrendUp01-uTlAwt0S.js → TrendUp01-Bkdgpfn7.js} +1 -1
- package/dist/client/assets/{Upload01-D-20AdeD.js → Upload01-DC2spim9.js} +1 -1
- package/dist/client/assets/{User01-BA1LEBvQ.js → User01-BbOpA84p.js} +1 -1
- package/dist/client/assets/{UserSquare-D-v_LgOa.js → UserSquare-qgzToKNd.js} +1 -1
- package/dist/client/assets/{Users01-BpRvBK8_.js → Users01-BOsDT0Jv.js} +1 -1
- package/dist/client/assets/{Users03-BaYGM99c.js → Users03-BP-0DNhp.js} +1 -1
- package/dist/client/assets/{X-Dh_K-VDi.js → X-Bzh3NI3m.js} +1 -1
- package/dist/client/assets/{XCircle-BhDUy79p.js → XCircle-CuK2q_XU.js} +1 -1
- package/dist/client/assets/{XClose-Bw0VS-dj.js → XClose-Cvyz3reC.js} +1 -1
- package/dist/client/assets/{Zap-TxetSnv7.js → Zap-DXNovEva.js} +1 -1
- package/dist/client/assets/{ZoomOut-CJKT31Kx.js → ZoomOut-BRjMa-04.js} +1 -1
- package/dist/client/assets/{access-gate-Dt6vr2zi.js → access-gate-NMf18NsK.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bwzbw2rJ.js → add-connection-dialog-GfufFuLz.js} +1 -1
- package/dist/client/assets/{agent-analytics-OtUj5VAg.js → agent-analytics-DKvARLL3.js} +1 -1
- package/dist/client/assets/agent-app-CQgi_fkJ.js +1 -0
- package/dist/client/assets/{agent-assets-Ds2YrU5Y.js → agent-assets-DePuap3v.js} +1 -1
- package/dist/client/assets/{agent-automation-BzHNBuT4.js → agent-automation-NvLs9ax2.js} +1 -1
- package/dist/client/assets/{agent-automations-BvUPSQUr.js → agent-automations-BV3f-ekl.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B2VHxv-N.js → agent-connect-sources-DtqgR_Ib.js} +1 -1
- package/dist/client/assets/agent-deck-Dx12NQ18.js +1 -0
- package/dist/client/assets/{agent-e2e-CCN3csfU.js → agent-e2e-CHL03ziT.js} +1 -1
- package/dist/client/assets/{agent-experiments-C1xtDG8f.js → agent-experiments-CWfra8gc.js} +1 -1
- package/dist/client/assets/agent-file-B5qivcOi.js +1 -0
- package/dist/client/assets/{agent-git-O5fnLyKj.js → agent-git-CU-dqFim.js} +1 -1
- package/dist/client/assets/{agent-hosting-ClZ4R70M.js → agent-hosting-x-9xTx9o.js} +1 -1
- package/dist/client/assets/{agent-icon-Cyx7Smko.js → agent-icon-BD4DM2Lv.js} +1 -1
- package/dist/client/assets/agent-library-file-OKK2mnnF.js +1 -0
- package/dist/client/assets/{agent-monitor-B2s_I09z.js → agent-monitor-CpVDwlgY.js} +1 -1
- package/dist/client/assets/{agent-overview-CLGjxUwU.js → agent-overview-SQDEg6Zv.js} +1 -1
- package/dist/client/assets/agent-settings-BraxsXkL.js +1 -0
- package/dist/client/assets/{agent-site-editor-DElX-Rtx.js → agent-site-editor-BXrb3i4T.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-03I9o24S.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D8Swy0HF.js → agent-site-editor-content-C3uy2bqp.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-BEkJn_qI.js → agent-site-editor-preview-BB-KqzfI.js} +3 -3
- package/dist/client/assets/agent-view-74_Cuyp8.js +1 -0
- package/dist/client/assets/{agent-view-guard-Cc93o9kZ.js → agent-view-guard-q_9RifUL.js} +1 -1
- package/dist/client/assets/{agents-list-D23HRLNK.js → agents-list-BCgsEzHh.js} +1 -1
- package/dist/client/assets/{ai-providers-AQKJLPCp.js → ai-providers-DGgtE9F7.js} +1 -1
- package/dist/client/assets/{alert-Bb5psHaZ.js → alert-Cnsh1M35.js} +1 -1
- package/dist/client/assets/{alert-dialog-DfGZ77rh.js → alert-dialog-Bi9Cy1y8.js} +1 -1
- package/dist/client/assets/{api-keys-7xk7B181.js → api-keys-BlYGdiam.js} +1 -1
- package/dist/client/assets/api-keys-ClN6LoeU.js +1 -0
- package/dist/client/assets/app-editor-CaCDGdiz.js +1 -0
- package/dist/client/assets/{asset-utils-Dl8tpNxx.js → asset-utils-syVIRo9d.js} +1 -1
- package/dist/client/assets/{auth-5BCk_I76.js → auth-D-2jYpOE.js} +1 -1
- package/dist/client/assets/{auth-catchall-BXX_QHt4.js → auth-catchall-C3GEml6h.js} +1 -1
- package/dist/client/assets/{auth-entry-BYY2pacz.js → auth-entry-CJhH7CHs.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bh_B_vjZ.js → auth-split-layout-B3xBkE6i.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bj_Y1vgm.js → authenticate-and-persist-oauth-2yRhuiER.js} +1 -1
- package/dist/client/assets/{automation-list-row-TgtbvSc5.js → automation-list-row-DVPV4sOa.js} +1 -1
- package/dist/client/assets/{automation-runs-CVEQI8qU.js → automation-runs-DnDgp3GT.js} +1 -1
- package/dist/client/assets/automations-XsBsFuGM.js +1 -0
- package/dist/client/assets/{autosend-ClVEnX_S.js → autosend-D-BN-cv5.js} +1 -1
- package/dist/client/assets/{avatar-CR9KEb-s.js → avatar-Duu5Gg02.js} +1 -1
- package/dist/client/assets/{badge-DOT8HE5Z.js → badge-BNBGXxmC.js} +1 -1
- package/dist/client/assets/{block-document-Boj9yYni.js → block-document-BT-7XjFG.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Dh0KsAvE.js → blocks-preview-workspace-context-BvM2Da4n.js} +1 -1
- package/dist/client/assets/{breadcrumb-CVSmj3i3.js → breadcrumb-sWWxibcS.js} +1 -1
- package/dist/client/assets/{buckets-B0FCB4zB.js → buckets-Biauz5yB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C9jBTscU.js → build-improve-prompt-doc-RalyChXZ.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-QprmcNHA.js → bulk-category-panel-CODUgRdO.js} +1 -1
- package/dist/client/assets/{calendar-SAWOBJxF.js → calendar-Dyov14Y_.js} +1 -1
- package/dist/client/assets/{capability-load-error-D1mxtMyB.js → capability-load-error-L3ivCxmO.js} +1 -1
- package/dist/client/assets/{cards-DQPi8IW_.js → cards-ojW-Mo-n.js} +1 -1
- package/dist/client/assets/category-editor-CFCxetoB.js +1 -0
- package/dist/client/assets/{chart-BGm-AILS.js → chart-Con9xnVz.js} +1 -1
- package/dist/client/assets/{chat-context-H28jTcB6.js → chat-context-BBVkwd3p.js} +1 -1
- package/dist/client/assets/{chat-draft-BTIUwp87.js → chat-draft-bAtYgASI.js} +1 -1
- package/dist/client/assets/{checkbox-D_GODf3h.js → checkbox-Dkejdmst.js} +1 -1
- package/dist/client/assets/{choose-editor-CqXPKhwg.js → choose-editor-BKF6XAA7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Nkuy_2dv.js → cli-auth-success-BUl2RZMr.js} +1 -1
- package/dist/client/assets/{client-icons-D55uOktL.js → client-icons-DLMNndDc.js} +1 -1
- package/dist/client/assets/{collapsible-CkoFdRnK.js → collapsible-n44mVpiB.js} +1 -1
- package/dist/client/assets/{collection-detail-7A7zRYv2.js → collection-detail-B7MXGdLU.js} +1 -1
- package/dist/client/assets/{collection-display-button-B730w9Ah.js → collection-display-button-C3iXY6zC.js} +1 -1
- package/dist/client/assets/{collection-search-B2t2IaOK.js → collection-search-CeA9TK20.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-87GtYm7N.js → collection-table-wrapper-SWoJua5h.js} +1 -1
- package/dist/client/assets/{collection-tabs-DAqaNYVU.js → collection-tabs-3kW0qDG6.js} +1 -1
- package/dist/client/assets/{combobox-CA5nnv9O.js → combobox-Px3Uvt7K.js} +1 -1
- package/dist/client/assets/{command-CtFXOSiX.js → command-D2fiEFer.js} +1 -1
- package/dist/client/assets/{command-palette-store-BL5hnWnv.js → command-palette-store-LVCQ6fRv.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DVYB246Y.js → companion-mcps-section-BcoKVpmX.js} +1 -1
- package/dist/client/assets/{connect-F12K-hsA.js → connect-DlipH902.js} +1 -1
- package/dist/client/assets/{connect-layout-DCgHt0wb.js → connect-layout-BQblJmFQ.js} +1 -1
- package/dist/client/assets/{connection-DhRpG43c.js → connection-BfiO32wM.js} +1 -1
- package/dist/client/assets/{connection-card-BCofIpgI.js → connection-card-83VJQMov.js} +1 -1
- package/dist/client/assets/{connection-detail-CkBpJk50.js → connection-detail-j_CvFKhd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C7Pc9F54.js → connection-form-helpers-Ms_1nBbP.js} +1 -1
- package/dist/client/assets/{connections-BsBFmd4I.js → connections-CERSp27f.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CYwIBo_O.js → create-organization-dialog-D0myNU26.js} +1 -1
- package/dist/client/assets/{decofile-api-Cdto5FQ3.js → decofile-api-BVqR93jw.js} +1 -1
- package/dist/client/assets/{decopilot-BecreIFq.js → decopilot-72HlEf1U.js} +1 -1
- package/dist/client/assets/{dialog-SKkzdrcZ.js → dialog-DbzCN1O8.js} +1 -1
- package/dist/client/assets/{discover-BWfGXdtB.js → discover-D5kdY2vL.js} +1 -1
- package/dist/client/assets/{domain-settings-ClqqVAOw.js → domain-settings-uVxQd7aQ.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DQE0snIy.js → download-app-dialog-Bsig7tOs.js} +1 -1
- package/dist/client/assets/{drawer-BleKwXKQ.js → drawer-CBdcJytm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DRuEZVW9.js → dropdown-menu-Dd8nakK9.js} +1 -1
- package/dist/client/assets/{editor-oZAad1yU.js → editor-CpBx0ZCm.js} +1 -1
- package/dist/client/assets/{empty-state-Bi9IU32F.js → empty-state-BIcQyeij.js} +1 -1
- package/dist/client/assets/{empty-state-CaG0BWIR.js → empty-state-ClEXvr10.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C8zB3-0T.js → extract-connection-data-CM8c_Wvw.js} +1 -1
- package/dist/client/assets/{feature-gate-UfjS24Ou.js → feature-gate-BURkiaEd.js} +1 -1
- package/dist/client/assets/{feature-paywall-pQTqQ94T.js → feature-paywall-BOwjYKin.js} +1 -1
- package/dist/client/assets/{file-explorer-s0AeRobY.js → file-explorer-BgbzlNyO.js} +1 -1
- package/dist/client/assets/{file-preview-Dzjub9Lu.js → file-preview-BOFvyeTK.js} +1 -1
- package/dist/client/assets/{file-share-button-BqqM0Upa.js → file-share-button-Doj91OJi.js} +1 -1
- package/dist/client/assets/{file-type-icon-CMiynV8b.js → file-type-icon-C37FwvPU.js} +1 -1
- package/dist/client/assets/{folder-icon-3FCd-eRP.js → folder-icon-Dox5xEXV.js} +1 -1
- package/dist/client/assets/{form-H9AoFazU.js → form-B7dtslOD.js} +1 -1
- package/dist/client/assets/{gateway-client-BQS5H6XZ.js → gateway-client-CFIpVRaR.js} +1 -1
- package/dist/client/assets/{general-st9zEmU7.js → general-BcnikUr3.js} +1 -1
- package/dist/client/assets/{github-icon-TtZ8EUXE.js → github-icon-BcrkxW36.js} +1 -1
- package/dist/client/assets/{home-DMdfBPme.js → home-MrzklFP0.js} +1 -1
- package/dist/client/assets/{hooks-D5z7CgCt.js → hooks-CkL4R3Tj.js} +1 -1
- package/dist/client/assets/{hooks-abtcLONn.js → hooks-D09Ti1PG.js} +1 -1
- package/dist/client/assets/{index-C-9h82SA.js → index-B46P4HkV.js} +1 -1
- package/dist/client/assets/{index-BC68yJ9a.js → index-BFjKFLU3.js} +1 -1
- package/dist/client/assets/{index-DAUnTbKR.js → index-BwuwoN1w.js} +1 -1
- package/dist/client/assets/{index-C1pofvkl.js → index-C9w15wdL.js} +1 -1
- package/dist/client/assets/{index-BQgXOHRB.js → index-CULK6hDm.js} +1 -1
- package/dist/client/assets/{index-Cm__CFgO.js → index-CuiP-22D.js} +1 -1
- package/dist/client/assets/{index-CdCU_XIc.js → index-Cyoz5tz5.js} +1 -1
- package/dist/client/assets/{index-Os5Hiv1r.js → index-D-XXgZ8p.js} +1 -1
- package/dist/client/assets/{index-tw-L0pq4.js → index-D68Q2TT2.js} +1 -1
- package/dist/client/assets/{index-CHIEfkY6.js → index-DLxUQ-f9.js} +1 -1
- package/dist/client/assets/{index-C4m-Xj9t.js → index-DZOe0ODJ.js} +1 -1
- package/dist/client/assets/{index-CZFOUXi8.js → index-G9Ugx8pT.js} +1 -1
- package/dist/client/assets/{index-soiZgi77.js → index-KOGfrBZR.js} +1 -1
- package/dist/client/assets/{index-CoJzC8_g.js → index-NrvdR10n.js} +1 -1
- package/dist/client/assets/{index-redirect-BGMUaELH.js → index-redirect-AuU1lkcv.js} +1 -1
- package/dist/client/assets/{index-Cjhl57C5.js → index-z4bKt11m.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-CTAqrRzL.js → infiniteQueryObserver-BjcfJE2O.js} +1 -1
- package/dist/client/assets/{infra-billing-D-R9Zdx8.js → infra-billing-Blv1R6xm.js} +1 -1
- package/dist/client/assets/{input-CImpk8th.js → input-C7XH8Uj_.js} +1 -1
- package/dist/client/assets/{input-DkPDVfFk.js → input-CSQboV8k.js} +1 -1
- package/dist/client/assets/{input-DNp0K9zv.js → input-I71U33T1.js} +1 -1
- package/dist/client/assets/{integration-icon-Dq1cJDX8.js → integration-icon-DOHTaQ6D.js} +1 -1
- package/dist/client/assets/{label-Bk7iLZH7.js → label-8juC5J-g.js} +1 -1
- package/dist/client/assets/{last-preview-page-BmfL1c7N.js → last-preview-page-C8M_ayBL.js} +1 -1
- package/dist/client/assets/{layout-Ci3akdxf.js → layout-fdXIUmGR.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CqdHGYTA.js → legacy-agents-deep-CIQ2cOBs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BqiddEXn.js → legacy-main-redirect-DdrzU7Xj.js} +1 -1
- package/dist/client/assets/{library-BUfXzmmk.js → library-DyrbEVfm.js} +1 -1
- package/dist/client/assets/{login-BUL2HRoD.js → login-BhC3su0G.js} +1 -1
- package/dist/client/assets/{markdown-Cqyyk371.js → markdown-BhLIBmBv.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-zIU2-SQD.js → mcp-app-renderer-DjwQ0S-h.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qvcFIOHE.js → mcp-oauth-DiqQlKOx.js} +1 -1
- package/dist/client/assets/{members-B2ASFRpM.js → members-PF8wxsqA.js} +1 -1
- package/dist/client/assets/{message-templates-BvJNSKe2.js → message-templates-BvR8vQvs.js} +1 -1
- package/dist/client/assets/{mini-report-page-GL8Uh_Lo.js → mini-report-page-D2etEugE.js} +1 -1
- package/dist/client/assets/{mock-board-D2--sNwu.js → mock-board-jCiKK3gA.js} +3 -3
- package/dist/client/assets/{monaco-editor-Bg8UPXit.js → monaco-editor-BHu8MLvz.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C9igDEpY.js → monitoring-stats-row-2QEp_Jld.js} +1 -1
- package/dist/client/assets/{multi-select-B0yDI0nj.js → multi-select-DcF09HV8.js} +1 -1
- package/dist/client/assets/{mustache-CDAsLK2v.js → mustache-DtVu96DY.js} +1 -1
- package/dist/client/assets/{oauth-callback-D8Lk8lTx.js → oauth-callback-CwSlt3mo.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-P1E8_NRm.js → oauth-callback-ai-provider-Co0a0HMU.js} +1 -1
- package/dist/client/assets/{onboarding-Df5HIECJ.js → onboarding-D-ej0NPt.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-IR0sppyV.js → optimistic-project-sidebar-views-yjPJnhEG.js} +1 -1
- package/dist/client/assets/{org-file-open-context-Dd47NmeH.js → org-file-open-context-BgiBbqKQ.js} +1 -1
- package/dist/client/assets/{organization-choice-B_XEkc76.js → organization-choice-loyQwhEZ.js} +1 -1
- package/dist/client/assets/{orgs-BAOnfPU8.js → orgs-DkENMfud.js} +1 -1
- package/dist/client/assets/{page-seo-form-DbL4-FYa.js → page-seo-form-BBCLz5m0.js} +1 -1
- package/dist/client/assets/{pair-BHYz9F-Z.js → pair-B2TMNGEX.js} +1 -1
- package/dist/client/assets/{plan-ladder-Cqfgwdfc.js → plan-ladder-C80Qcxkm.js} +1 -1
- package/dist/client/assets/{popover-Bn0xXLy8.js → popover-CsEsUqbZ.js} +1 -1
- package/dist/client/assets/{post-calendar-6AuB-9GD.js → post-calendar-gswoVxcp.js} +1 -1
- package/dist/client/assets/{post-editor-D6gFXTiI.js → post-editor-5tYPjO0c.js} +1 -1
- package/dist/client/assets/{preview-content-BJK2rc2w.js → preview-content-D5E6-qEP.js} +1 -1
- package/dist/client/assets/{preview-dialog-CdfWw2XK.js → preview-dialog-D1qWdONG.js} +1 -1
- package/dist/client/assets/{primitives-CSJauIt5.js → primitives-Dy5hA1_y.js} +1 -1
- package/dist/client/assets/{profile-BUYSJtW_.js → profile-9GEyG1R7.js} +1 -1
- package/dist/client/assets/{project-app-view-BAHsn_eP.js → project-app-view-CsjjG0iu.js} +1 -1
- package/dist/client/assets/{project-feed-La6-iUzD.js → project-feed-CEhr0jA4.js} +1 -1
- package/dist/client/assets/{project-icon-CiuTzDLi.js → project-icon-Cw3la58q.js} +1 -1
- package/dist/client/assets/project-reports-D83XbTn5.js +1 -0
- package/dist/client/assets/project-tasks-IrwgrDaD.js +1 -0
- package/dist/client/assets/{prompts-BAZWbRxz.js → prompts-DQaXCBzS.js} +1 -1
- package/dist/client/assets/record-editor-C02fIlfV.js +1 -0
- package/dist/client/assets/{redirect-editor-9oPfVcJw.js → redirect-editor-B2uGI7FY.js} +1 -1
- package/dist/client/assets/registry-CORfkc_Z.js +2 -0
- package/dist/client/assets/{registry-layout-CrG4EYUR.js → registry-layout-tJiz4Tt0.js} +1 -1
- package/dist/client/assets/{reports-DHS4fi6t.js → reports-DvgXBdzM.js} +1 -1
- package/dist/client/assets/reports-X2I2m9Nu.js +1 -0
- package/dist/client/assets/{reports-onboarding-BtdzeKZT.js → reports-onboarding-BLUSVbkd.js} +1 -1
- package/dist/client/assets/{reports-tab-B5bMQgk-.js → reports-tab-DSknxHUH.js} +2 -2
- package/dist/client/assets/{repositories-DbRCe9LF.js → repositories-cOMgIGPf.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bo_Cabzz.js → repository-import-picker-C0YugeGx.js} +1 -1
- package/dist/client/assets/{repository-picker-CRqY_3jm.js → repository-picker-BaqWNwxf.js} +1 -1
- package/dist/client/assets/{require-capability-CLz-loNQ.js → require-capability-CjU7EXPP.js} +1 -1
- package/dist/client/assets/{required-auth-layout-t1gcmOkS.js → required-auth-layout-WkX8CtfT.js} +1 -1
- package/dist/client/assets/{reset-password-C_PBrpSa.js → reset-password-FnA2kczZ.js} +1 -1
- package/dist/client/assets/{resizable-CTEnH3yu.js → resizable-7umHaFcH.js} +1 -1
- package/dist/client/assets/{review-settings-CIZvhdQE.js → review-settings-BHAkNdHq.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DdZo0zBm.js → rich-text-link-control-DgGIjR0I.js} +1 -1
- package/dist/client/assets/{roles-D7Yxadr5.js → roles-iNTzpIoS.js} +1 -1
- package/dist/client/assets/{route-DMLSQe3Y.js → route-BdFq2Icl.js} +1 -1
- package/dist/client/assets/{route-aV7nBxG9.js → route-D2mgsDfh.js} +1 -1
- package/dist/client/assets/{route-BhbKY_6m.js → route-DQ3O_pQ7.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CNau3nKH.js → runnable-block-editor-CCXhy-vO.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Dhs5hLj1.js → sandbox-lifecycle-context-DL9kkwoa.js} +1 -1
- package/dist/client/assets/{schema-BTHH8GSh.js → schema-D0xfowSf.js} +1 -1
- package/dist/client/assets/{scroll-area-YQLTU6PQ.js → scroll-area-BqCCUXvj.js} +1 -1
- package/dist/client/assets/{search-input-Cx2Izgwg.js → search-input-DpLbMQRj.js} +1 -1
- package/dist/client/assets/{secrets-B1YWh_ht.js → secrets-B9E8fieV.js} +1 -1
- package/dist/client/assets/{sections-editor-C4NhZuXp.js → sections-editor-D24EQfD8.js} +1 -1
- package/dist/client/assets/{select-C5Qbx8Kw.js → select-cIekAVlM.js} +1 -1
- package/dist/client/assets/{select-model-CIR4DebA.js → select-model-DcwphIdD.js} +1 -1
- package/dist/client/assets/{seo-editor-b4BYh3S0.js → seo-editor-BRYLT6tF.js} +1 -1
- package/dist/client/assets/{settings-tab-wJidOo3Q.js → settings-tab-DKZf7OJg.js} +1 -1
- package/dist/client/assets/{sheet-DvqFDAlT.js → sheet-DhNzwMUj.js} +1 -1
- package/dist/client/assets/{shell-layout-knqcStSb.js → shell-layout-DMJSwXH6.js} +1 -1
- package/dist/client/assets/{sidebar-CPIvGktg.js → sidebar-BCim0GYP.js} +1 -1
- package/dist/client/assets/{skill-preview-Dr3uDA0q.js → skill-preview-eH_MzYft.js} +1 -1
- package/dist/client/assets/{skills-B7mrIhFJ.js → skills-BtiwGp2Q.js} +1 -1
- package/dist/client/assets/{sso-JfSG6sY-.js → sso-BOpSC7cb.js} +1 -1
- package/dist/client/assets/{store-CRU_7Bvk.js → store-DmrioYP8.js} +1 -1
- package/dist/client/assets/store-registry-B398fyC0.js +2 -0
- package/dist/client/assets/{switch-Cf30aXkY.js → switch-9PLadaw_.js} +1 -1
- package/dist/client/assets/{synced-repos-C5RH3GVW.js → synced-repos-gfJnKqre.js} +1 -1
- package/dist/client/assets/{table-D6IMkB4T.js → table-B6mPp07a.js} +1 -1
- package/dist/client/assets/{tabs-DSOAK--9.js → tabs-Co2GUrNY.js} +1 -1
- package/dist/client/assets/{task-board-DpuhnKzF.js → task-board-lQZGfEfb.js} +1 -1
- package/dist/client/assets/{task-route-CPm3yGLT.js → task-route-Btltx00G.js} +1 -1
- package/dist/client/assets/{task-status-CesK2f9G.js → task-status-CLlOhQGx.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DWWMZZdU.js → taskboard-analytics-CCRKXVH2.js} +1 -1
- package/dist/client/assets/tasks-BqLnbtfB.js +1 -0
- package/dist/client/assets/{tasks-BGbHPX0w.js → tasks-D_kcQmbi.js} +1 -1
- package/dist/client/assets/{textarea-DXDx4Cy0.js → textarea-BEOceSll.js} +1 -1
- package/dist/client/assets/{thread-intent-Cdmdi4Qs.js → thread-intent-9fI0jPLV.js} +1 -1
- package/dist/client/assets/{thread-route-CnHTxNkK.js → thread-route-B1EuqJlg.js} +1 -1
- package/dist/client/assets/{thread-route-BMICHdvv.js → thread-route-DG6kj-ho.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BGNoSu7i.js → thread-sheet-body-CbIiPC8V.js} +1 -1
- package/dist/client/assets/{toggle-group-Cj0z3PRY.js → toggle-group-Ck5f9XVv.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BehOLAeE.js → toolbar-icon-button-8ctMGgIP.js} +1 -1
- package/dist/client/assets/{tooltip-BDUrOxgN.js → tooltip-BuKeolDX.js} +1 -1
- package/dist/client/assets/{track-BJHbd99y.js → track-B7aLvyYR.js} +1 -1
- package/dist/client/assets/{types-DlfDRNRB.js → types-Bh4jNqv3.js} +1 -1
- package/dist/client/assets/{usage-stats-nuoZXpxw.js → usage-stats-waRf4dtg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-QvFz5SFX.js → use-ai-providers-B0bxSHYG.js} +1 -1
- package/dist/client/assets/{use-automations-jwtTHLHf.js → use-automations-BdS9yl-d.js} +1 -1
- package/dist/client/assets/{use-autosave-D5Khb0ju.js → use-autosave-CfERN5UF.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DDWKSdwn.js → use-connect-companion-_GDNSGRN.js} +1 -1
- package/dist/client/assets/{use-connection-CpOBycNm.js → use-connection-CPQUKm0a.js} +1 -1
- package/dist/client/assets/{use-copy-M0GDas2Q.js → use-copy-DUiBegp6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BFxHh87r.js → use-create-virtual-mcp-BRT9hKZ3.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BAJylOmL.js → use-date-fns-locale-PFUAQIxr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CAXyZd0j.js → use-debounced-autosave-CyDohN_c.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CVkWNti9.js → use-debounced-value-DeY1TNRX.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D4THYOkS.js → use-deco-credits-Du6WCMYS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DlUI-60k.js → use-decopilot-events-_O_0AHeH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BznnJgfw.js → use-delete-connection-kqt66yqS.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Buoxj9IO.js → use-deployment-admin-MznxNIiy.js} +1 -1
- package/dist/client/assets/{use-entitlements-BP7WwVM_.js → use-entitlements-BWaaNeuI.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cu15Ye_n.js → use-fast-preview-draft-url-BrZtKg6o.js} +1 -1
- package/dist/client/assets/{use-file-configs-CyU7Mcil.js → use-file-configs-sqbLS09v.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-AtjP0SZW.js → use-infinite-scroll-RrOnf-fI.js} +1 -1
- package/dist/client/assets/{use-join-requests-aG0T3ECI.js → use-join-requests-BZzsbvb0.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-IIO818_j.js → use-main-panel-tabs-CyT7yQAB.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-bcJwzpw7.js → use-mcp-auth-status-DvQCYJw0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bf0VpOBw.js → use-mcp-client-B1u2B39v.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DxcgJEJ7.js → use-mcp-prompts-DxT8Kz-M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DhZM9sTC.js → use-mcp-tools-Ch_j97A3.js} +1 -1
- package/dist/client/assets/{use-members-CsAzsmBA.js → use-members-H3oi0qPu.js} +1 -1
- package/dist/client/assets/{use-mobile-C5SrWG9H.js → use-mobile-CV7f0Wqe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DOYg6fyU.js → use-navigate-to-agent-BMSyO1iB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Cjz--xRu.js → use-open-billing-url-BGn9Wkis.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C16MEGGe.js → use-org-auth-client-ZxEGrzhh.js} +1 -1
- package/dist/client/assets/{use-org-fs-BSDHmLev.js → use-org-fs-D6lKuMAi.js} +1 -1
- package/dist/client/assets/{use-org-notice-BALWnbFe.js → use-org-notice-C5thI8aD.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dpa7KwXX.js → use-org-sso-vHIufIoJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cog-K9KN.js → use-organization-roles-DmWmnvDm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-pqtCEzuj.js → use-organization-settings-C-XY0Wze.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-bhAOxlzp.js → use-panel-navigate-BG4d0Vrr.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DnirX6kM.js → use-project-native-view-presence-0NQTfFQT.js} +1 -1
- package/dist/client/assets/{use-project-scope-BfeOcOX-.js → use-project-scope-DRope0ob.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BJotyFay.js → use-registry-connections-D_a0MIjQ.js} +1 -1
- package/dist/client/assets/{use-releases-CjPEhpWE.js → use-releases-BPrtCiPS.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-R9_oa5XU.js → use-reports-diagnostic-BtS3SpeX.js} +1 -1
- package/dist/client/assets/{use-route-default-main-DO9nAIOF.js → use-route-default-main-DBXt2fvS.js} +1 -1
- package/dist/client/assets/{use-secrets-Do9S2OuA.js → use-secrets-C5iKdreo.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DTsnvRL8.js → use-section-preview-base-Dwn5dF7B.js} +1 -1
- package/dist/client/assets/{use-session-runtime--RMOkDN5.js → use-session-runtime-DU2zS-3V.js} +1 -1
- package/dist/client/assets/{use-tags-C-xYWG0d.js → use-tags-BvskEBAC.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DqKWhXe3.js → use-task-board-analytics-DjIJHPkR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Bm567Cyu.js → use-task-metadata-9gheSHac.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DA9fNv-d.js → use-thread-outputs-DAcljy5D.js} +1 -1
- package/dist/client/assets/{use-view-mode-mEqX4oRI.js → use-view-mode-CTt0Tykp.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BvrPyGzX.js → use-virtual-mcp-Bq1RMGPF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C6OBOha-.js +1 -0
- package/dist/client/assets/{useQueries-DqQ6INqi.js → useQueries-DMqJmHGu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-XFcbI_PD.js +1 -0
- package/dist/client/assets/{users-BS3mOvNq.js → users-B0Y-7Aab.js} +1 -1
- package/dist/client/assets/{utils-DAYUNxCI.js → utils-CU3t1jst.js} +1 -1
- package/dist/client/assets/{variant-calendar-D_T3c3MC.js → variant-calendar-Bp201sXA.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BSFlzIhP.js → variant-matcher-override-DUPu0vkW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CzqFE_Lp.js → view-mode-toggle-DaZN0qXY.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CG3JbZx8.js → virtual-mcp-BYPZngzy.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +118 -118
- package/dist/server/server.js +114 -114
- package/package.json +1 -1
- package/dist/client/assets/agent-app-huXdhJP6.js +0 -1
- package/dist/client/assets/agent-deck-DGboeeyf.js +0 -1
- package/dist/client/assets/agent-file-B8pH22Ku.js +0 -1
- package/dist/client/assets/agent-library-file-D-88nLF8.js +0 -1
- package/dist/client/assets/agent-settings-BzADpWtq.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CGdhTJXE.js +0 -2
- package/dist/client/assets/agent-view-BZUeqD_l.js +0 -1
- package/dist/client/assets/api-keys-DfV1qFa5.js +0 -1
- package/dist/client/assets/app-editor-CK2-PFMD.js +0 -1
- package/dist/client/assets/automations-CfjjbeEx.js +0 -1
- package/dist/client/assets/category-editor-CG20ku6V.js +0 -1
- package/dist/client/assets/project-reports-jZGDkYDU.js +0 -1
- package/dist/client/assets/project-tasks-BDg0EJtT.js +0 -1
- package/dist/client/assets/record-editor-C96ND1CU.js +0 -1
- package/dist/client/assets/registry-rXZoWB8a.js +0 -2
- package/dist/client/assets/reports-C9YET_Fq.js +0 -1
- package/dist/client/assets/store-registry-Q0TOzx2-.js +0 -2
- package/dist/client/assets/tasks-DTqkQgJb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C-lwb5Ji.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CjJ_vWiS.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 je,j as s,m as Ds,K as As,b as Be,l as Ee,r as H,h as Qe,B as Oe,t as ve,M as An,u as Bs,au as Fe}from"./index-Cjhl57C5.js";import{A as Bn}from"./agent-view-guard-Cc93o9kZ.js";import{F as $n}from"./feature-gate-UfjS24Ou.js";import{u as Et,b as $s}from"./chat-context-H28jTcB6.js";import{i as Ls}from"./AlertCircle-Ddrj7VUD.js";import{y as jt,I as Os,J as Rs,K as Fs,L as Ln,M as On,N as Ks,O as Rn,h as It,P as Fn,Q as Kn,R as In,x as Is,S as Mn,T as zn,U as Vn}from"./agent-icon-Cyx7Smko.js";import{i as Mt}from"./File02-D1W0NjQG.js";import{c as Ms}from"./SwitchHorizontal01-l3o5r_PJ.js";import{s as Un}from"./Plus-C5azC59K.js";import{i as zs}from"./SearchLg-BZUR3n9c.js";import{t as Vs}from"./Users01-BpRvBK8_.js";import{f as Gn,e as Hn,b as Jn,A as Wn,a as Yn,d as qn,c as Qn,g as Xn}from"./alert-dialog-DfGZ77rh.js";import{S as Dt}from"./scroll-area-YQLTU6PQ.js";import{T as Ie,a as Me,c as ze}from"./tooltip-BDUrOxgN.js";import{S as $t,j as Zn,c as eo,g as Us,B as Lt,P as to,k as so,n as no,o as oo,u as Gs,l as lo,q as ao,R as io,s as Hs,r as ro,t as co,d as Js,v as uo,w as Ws,x as Ys,y as mo,M as fo,h as po,p as ho,z as go,A as xo,e as bo,f as yo,C as is,D as qs,i as vo,E as So}from"./runnable-block-editor-CNau3nKH.js";import{r as Jt,S as ko,l as Wt,i as jo,m as Co,o as wo,n as Ct,v as No,R as Qs,G as Yt,g as Po,q as To,e as rs,t as _o,d as Eo,u as Do,w as cs,h as Ao,x as Bo,y as $o}from"./claim-phase-copy-0btUuJoC.js";import{u as Lo,P as Oo}from"./mustache-CDAsLK2v.js";import{t as qt}from"./ChevronUp-XOZg-HiO.js";import{s as Xs}from"./Database01-vUZciuwF.js";import{i as Zs}from"./Zap-TxetSnv7.js";import{C as Ro,a as Fo,b as Ko}from"./collapsible-CkoFdRnK.js";import{c as Io,d as Mo}from"./sandbox-lifecycle-context-Dhs5hLj1.js";import{u as zo}from"./use-session-runtime--RMOkDN5.js";import{c as Qt,d as Xt,e as Zt,b as es,D as ts,h as Vo}from"./dialog-SKkzdrcZ.js";import{I as rt}from"./input-CImpk8th.js";import{C as ss}from"./checkbox-D_GODf3h.js";import{L as Ot}from"./label-Bk7iLZH7.js";import{c as Uo,b as Go,a as Ho,d as Jo,S as Wo}from"./select-C5Qbx8Kw.js";import{a as en,d as tn}from"./use-virtual-mcp-BvrPyGzX.js";import{i as Nt}from"./ChevronRight-DK_MoZ-7.js";import{i as ds}from"./Share07-BypmcbEF.js";import{i as Yo}from"./Globe01-D9zr3JIX.js";import{c as qo,b as Qo,s as Xo}from"./TrendUp01-uTlAwt0S.js";import{i as ns}from"./X-Dh_K-VDi.js";import"./rich-text-link-control-DdZo0zBm.js";import{M as Zo}from"./monaco-editor-Bg8UPXit.js";import{s as sn}from"./Trash01-DPQmLNZV.js";import{d as bt,f as pt,D as zt,e as us,b as Vt,c as Ut,a as lt,g as Rt}from"./dropdown-menu-DRuEZVW9.js";import{a as el}from"./Copy01-l6PfB431.js";import{i as tl}from"./Tool01-C0-Xqkxp.js";import{b as ms}from"./use-project-scope-BfeOcOX-.js";import{E as sl}from"./empty-state-Bi9IU32F.js";import{G as fs}from"./github-icon-TtZ8EUXE.js";import{R as nl}from"./repository-import-picker-Bo_Cabzz.js";import{b as ol}from"./thread-route-CnHTxNkK.js";function ll(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 al(t,e,n){return typeof t!="string"?null:ll(Jt(t,e),n)}function nn(t,e,n){if(!e||typeof t!="string")return!1;const o=al(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=je.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 il(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function rl(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 cl(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 dl(t,e,n){if(t===ko)return null;const o=ln(t);if(!o)return null;const{vendor:c,app:l}=o,i=an(c,l,n),r=Wt(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 ul(t,e,n){const o=e.__resolveType;if(typeof o!="string"||jo(t,e)||!Co(o))return null;const c=ln(o)??il(t);if(!c)return null;const l=Wt(o,n),{vendor:i,app:r}=c;return{id:At(i,r),app:r,vendor:i,title:l.title??wo(t,e,n),description:l.description??"",category:rl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function ml(t,e,n){const o=new Map;for(const l of t){const i=cl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=dl(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=ul(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(fl)}function fl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function pl(){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 hl(t,e,n){const o=je.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=As.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:pl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=Ds(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?ml(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 gl=["sections","apps","loaders","actions"];function xl(t){const e=je.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 h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const p=n==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==p?(f=s.jsx(Le,{id:"redirects",icon:Os,label:h,count:o.redirects,active:p,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=p,e[17]=f):f=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const g=n==="site";let v;e[20]!==l||e[21]!==g||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:On,label:y,active:g,onSelect:l}),e[20]=l,e[21]=g,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 C;e[26]!==l||e[27]!==S||e[28]!==k?(C=s.jsx(Le,{id:"seo",icon:Ks,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=C):C=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const U=n==="calendar";let T;e[32]!==l||e[33]!==w||e[34]!==U?(T=s.jsx(Le,{id:"calendar",icon:Rn,label:w,active:U,onSelect:l}),e[32]=l,e[33]=w,e[34]=U,e[35]=T):T=e[35];let j;e[36]!==n||e[37]!==o||e[38]!==l?(j=s.jsx(bl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=j):j=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(Rs,{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:Vs,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Fs,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:Ln,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 M;e[48]!==v||e[49]!==C||e[50]!==T||e[51]!==j||e[52]!==I||e[53]!==d||e[54]!==f?(M=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,f,v,C,T,j,I]}),e[48]=v,e[49]=C,e[50]=T,e[51]=j,e[52]=I,e[53]=d,e[54]=f,e[55]=M):M=e[55];let F;return e[56]!==a||e[57]!==M?(F=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,M]}),e[56]=a,e[57]=M,e[58]=F):F=e[58],F}function bl(t){const e=je.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=gl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=H.useState(!1),x=a||r;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=Ee("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"),h=s.jsx(Fn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let p;e[4]!==l?(p=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=p):p=e[5];let f;e[6]!==p?(f=s.jsx("span",{className:"flex-1 truncate",children:p}),e[6]=p,e[7]=f):f=e[7];const y=x&&"rotate-180";let g;e[8]!==y?(g=Ee("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(qt,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let S;e[12]!==f||e[13]!==v?(S=s.jsxs(Ro,{className:d,children:[h,f,v]}),e[12]=f,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 C=n==="sections";let w;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==C?(w=s.jsx(Le,{id:"sections",icon:It,label:k,count:o.sections,active:C,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=C,e[21]=w):w=e[21];let U;e[22]!==l?(U=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=U):U=e[23];const T=n==="apps";let j;e[24]!==o.apps||e[25]!==c||e[26]!==U||e[27]!==T?(j=s.jsx(Le,{id:"apps",icon:Ms,label:U,count:o.apps,active:T,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=U,e[27]=T,e[28]=j):j=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const M=n==="loaders";let F;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==M?(F=s.jsx(Le,{id:"loaders",icon:Xs,label:I,count:o.loaders,active:M,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=M,e[35]=F):F=e[35];let A;e[36]!==l?(A=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=A):A=e[37];const z=n==="actions";let K;e[38]!==o.actions||e[39]!==c||e[40]!==A||e[41]!==z?(K=s.jsx(Le,{id:"actions",icon:Zs,label:A,count:o.actions,active:z,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=A,e[41]=z,e[42]=K):K=e[42];let _;e[43]!==w||e[44]!==j||e[45]!==F||e[46]!==K?(_=s.jsxs(Fo,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,j,F,K]}),e[43]=w,e[44]=j,e[45]=F,e[46]=K,e[47]=_):_=e[47];let $;return e[48]!==x||e[49]!==_||e[50]!==S?($=s.jsxs(Ko,{open:x,onOpenChange:u,children:[S,_]}),e[48]=x,e[49]=_,e[50]=S,e[51]=$):$=e[51],$}function Le(t){const e=je.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 h;e[3]!==x||e[4]!==d?(h=Ee("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]=h):h=e[5];let p;e[6]!==o?(p=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=p):p=e[7];let f;e[8]!==c?(f=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=f):f=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:Ee("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 g;return e[13]!==u||e[14]!==h||e[15]!==p||e[16]!==f||e[17]!==y?(g=s.jsxs("button",{type:"button",onClick:u,className:h,children:[p,f,y]}),e[13]=u,e[14]=h,e[15]=p,e[16]=f,e[17]=y,e[18]=g):g=e[18],g}function yl(t){const e=je.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=Zn({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 vl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Sl(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&&!vl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function ps(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 kl(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 jl(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 Cl(t){const e=Us(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function wl(t,e){return eo(t,e)}const Nl=1e3;function Pl(t,e){for(let n=0;n<Nl;n++){const o=Us(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Tl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},_l={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},El={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Dl(t){const e=je.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,h=i===void 0?!1:i,p=Be(),[f,y]=H.useState(c),[g,v]=H.useState(l),[S,k]=H.useState(Lt),[C,w]=H.useState(null),[U,T]=H.useState(n);n!==U&&(T(n),n&&(y(c),v(l),k(Lt),w(null)));const j=o==="create"&&!!a?.length;let I;e[0]!==h||e[1]!==d?(I=me=>{!me&&!h&&(w(null),d(!1))},e[0]=h,e[1]=d,e[2]=I):I=e[2];const M=I;let F;e[3]!==h||e[4]!==f||e[5]!==x||e[6]!==g||e[7]!==j||e[8]!==S||e[9]!==u?(F=async me=>{me.preventDefault();const fe=f.trim(),be=g.trim();if(!fe||!be||h)return;const ne=No(be);if(ne){w(ne);return}const pe=u?.({name:fe,path:be});if(pe){w(pe);return}w(null),await x({name:fe,path:be,templateKey:j&&S!==Lt?S:null})},e[3]=h,e[4]=f,e[5]=x,e[6]=g,e[7]=j,e[8]=S,e[9]=u,e[10]=F):F=e[10];const A=F,z=C??r,K=Tl[o];let _;e[11]!==p||e[12]!==K?(_=p(K),e[11]=p,e[12]=K,e[13]=_):_=e[13];let $;e[14]!==_?($=s.jsx(Qt,{children:s.jsx(Xt,{children:_})}),e[14]=_,e[15]=$):$=e[15];let V;e[16]!==h||e[17]!==j||e[18]!==p||e[19]!==S||e[20]!==a?(V=j&&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:p("sandbox.pageFormDialog.labelTemplate")}),s.jsx(to,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:h})]}),e[16]=h,e[17]=j,e[18]=p,e[19]=S,e[20]=a,e[21]=V):V=e[21];let B;e[22]!==p?(B=p("sandbox.pageFormDialog.labelName"),e[22]=p,e[23]=B):B=e[23];let W;e[24]!==B?(W=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[24]=B,e[25]=W):W=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=me=>y(me.target.value),e[26]=X):X=e[26];let E;e[27]!==p?(E=p("sandbox.pageFormDialog.placeholderName"),e[27]=p,e[28]=E):E=e[28];let G;e[29]!==h||e[30]!==f||e[31]!==E?(G=s.jsx(rt,{id:"page-form-name",value:f,onChange:X,placeholder:E,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=E,e[32]=G):G=e[32];let Y;e[33]!==G||e[34]!==W?(Y=s.jsxs("div",{className:"space-y-1.5",children:[W,G]}),e[33]=G,e[34]=W,e[35]=Y):Y=e[35];let J;e[36]!==p?(J=p("sandbox.pageFormDialog.labelPath"),e[36]=p,e[37]=J):J=e[37];let L;e[38]!==J?(L=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:J}),e[38]=J,e[39]=L):L=e[39];let se;e[40]===Symbol.for("react.memo_cache_sentinel")?(se=me=>v(me.target.value),e[40]=se):se=e[40];let re;e[41]!==p?(re=p("sandbox.pageFormDialog.placeholderPath"),e[41]=p,e[42]=re):re=e[42];let le;e[43]!==h||e[44]!==g||e[45]!==re?(le=s.jsx(rt,{id:"page-form-path",value:g,onChange:se,placeholder:re,disabled:h}),e[43]=h,e[44]=g,e[45]=re,e[46]=le):le=e[46];let oe;e[47]!==L||e[48]!==le?(oe=s.jsxs("div",{className:"space-y-1.5",children:[L,le]}),e[47]=L,e[48]=le,e[49]=oe):oe=e[49];let ae;e[50]!==z?(ae=z&&s.jsx("p",{className:"text-xs text-destructive",children:z}),e[50]=z,e[51]=ae):ae=e[51];let ce;e[52]!==Y||e[53]!==oe||e[54]!==ae||e[55]!==V?(ce=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,oe,ae]}),e[52]=Y,e[53]=oe,e[54]=ae,e[55]=V,e[56]=ce):ce=e[56];let O;e[57]!==d?(O=()=>d(!1),e[57]=d,e[58]=O):O=e[58];let te;e[59]!==p?(te=p("sandbox.pageFormDialog.buttonCancel"),e[59]=p,e[60]=te):te=e[60];let Z;e[61]!==h||e[62]!==O||e[63]!==te?(Z=s.jsx(Oe,{type:"button",variant:"outline",onClick:O,disabled:h,children:te}),e[61]=h,e[62]=O,e[63]=te,e[64]=Z):Z=e[64];let ee;e[65]!==h||e[66]!==f||e[67]!==g?(ee=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=ee):ee=e[68];let ie;e[69]!==h||e[70]!==o||e[71]!==p?(ie=h?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),p(El[o])]}):p(_l[o]),e[69]=h,e[70]=o,e[71]=p,e[72]=ie):ie=e[72];let R;e[73]!==ee||e[74]!==ie?(R=s.jsx(Oe,{type:"submit",disabled:ee,children:ie}),e[73]=ee,e[74]=ie,e[75]=R):R=e[75];let ge;e[76]!==Z||e[77]!==R?(ge=s.jsxs(Zt,{children:[Z,R]}),e[76]=Z,e[77]=R,e[78]=ge):ge=e[78];let D;e[79]!==A||e[80]!==ce||e[81]!==ge||e[82]!==$?(D=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:A,children:[$,ce,ge]})}),e[79]=A,e[80]=ce,e[81]=ge,e[82]=$,e[83]=D):D=e[83];let xe;return e[84]!==M||e[85]!==n||e[86]!==D?(xe=s.jsx(ts,{open:n,onOpenChange:M,children:D}),e[84]=M,e[85]=n,e[86]=D,e[87]=xe):xe=e[87],xe}const Al=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],hs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Bl(t){const e=je.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=H.useState(hs),[d,h]=H.useState(null),[p,f]=H.useState(n);n!==p&&(f(n),n&&(x(hs),h(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=he=>x(Te=>({...Te,...he})),e[0]=y):y=e[0];const g=y;let v;e[1]!==r||e[2]!==i?(v=he=>{!he&&!r&&(h(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 he=>{he.preventDefault();const Te=u.from.trim(),$e=u.to.trim();if(!Te||!$e||r){h(a("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...u,from:Te,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const C=k,w=d??c;let U;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(U=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=U):U=e[12];const T=U;let j;e[13]!==a?(j=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=j):j=e[14];let I;e[15]!==j?(I=s.jsx(Qt,{children:s.jsx(Xt,{children:j})}),e[15]=j,e[16]=I):I=e[16];let M;e[17]!==a?(M=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=M):M=e[18];let F;e[19]!==M?(F=s.jsx(Ot,{htmlFor:"redirect-form-from",children:M}),e[19]=M,e[20]=F):F=e[20];const A=u.from;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=he=>g({from:he.target.value}),e[21]=z):z=e[21];let K;e[22]!==a?(K=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=K):K=e[23];let _;e[24]!==r||e[25]!==u.from||e[26]!==K?(_=s.jsx(rt,{id:"redirect-form-from",value:A,onChange:z,placeholder:K,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=K,e[27]=_):_=e[27];let $;e[28]!==_||e[29]!==F?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[28]=_,e[29]=F,e[30]=$):$=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let B;e[33]!==V?(B=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=B):B=e[34];const W=u.to;let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=he=>g({to:he.target.value}),e[35]=X):X=e[35];let E;e[36]!==a?(E=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=E):E=e[37];let G;e[38]!==r||e[39]!==u.to||e[40]!==E?(G=s.jsx(rt,{id:"redirect-form-to",value:W,onChange:X,placeholder:E,disabled:r}),e[38]=r,e[39]=u.to,e[40]=E,e[41]=G):G=e[41];let Y;e[42]!==B||e[43]!==G?(Y=s.jsxs("div",{className:"space-y-1.5",children:[B,G]}),e[42]=B,e[43]=G,e[44]=Y):Y=e[44];let J;e[45]!==a?(J=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=J):J=e[46];let L;e[47]!==J?(L=s.jsx(Ot,{htmlFor:"redirect-form-type",children:J}),e[47]=J,e[48]=L):L=e[48];const se=u.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=he=>g({type:he}),e[49]=re):re=e[49];let le;e[50]!==a?(le=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=le):le=e[51];let oe;e[52]!==le?(oe=s.jsx(Go,{id:"redirect-form-type",className:"w-full",children:s.jsx(Ho,{placeholder:le})}),e[52]=le,e[53]=oe):oe=e[53];let ae;e[54]!==a?(ae=Al.map(he=>s.jsx(Uo,{value:he.value,children:a(he.labelKey,{status:Qs[he.value]})},he.value)),e[54]=a,e[55]=ae):ae=e[55];let ce;e[56]!==ae?(ce=s.jsx(Jo,{children:ae}),e[56]=ae,e[57]=ce):ce=e[57];let O;e[58]!==r||e[59]!==u.type||e[60]!==oe||e[61]!==ce?(O=s.jsxs(Wo,{value:se,onValueChange:re,disabled:r,children:[oe,ce]}),e[58]=r,e[59]=u.type,e[60]=oe,e[61]=ce,e[62]=O):O=e[62];let te;e[63]!==L||e[64]!==O?(te=s.jsxs("div",{className:"space-y-1.5",children:[L,O]}),e[63]=L,e[64]=O,e[65]=te):te=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=he=>g({discardQueryParameters:he===!0}),e[66]=Z):Z=e[66];let ee;e[67]!==r||e[68]!==u.discardQueryParameters?(ee=s.jsx(ss,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:Z}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ee):ee=e[69];let ie;e[70]!==a?(ie=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ie):ie=e[71];let R;e[72]!==ie?(R=s.jsx("span",{className:"text-sm",children:ie}),e[72]=ie,e[73]=R):R=e[73];let ge;e[74]!==ee||e[75]!==R?(ge=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ee,R]}),e[74]=ee,e[75]=R,e[76]=ge):ge=e[76];let D;e[77]!==w?(D=w&&s.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=D):D=e[78];let xe;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==ge||e[83]!==D?(xe=s.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,ge,D]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=ge,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==i?(me=()=>i(!1),e[85]=i,e[86]=me):me=e[86];let fe;e[87]!==a?(fe=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=fe):fe=e[88];let be;e[89]!==r||e[90]!==me||e[91]!==fe?(be=s.jsx(Oe,{type:"button",variant:"outline",onClick:me,disabled:r,children:fe}),e[89]=r,e[90]=me,e[91]=fe,e[92]=be):be=e[92];const ne=!T;let pe;e[93]!==r||e[94]!==a?(pe=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]=pe):pe=e[95];let Ce;e[96]!==ne||e[97]!==pe?(Ce=s.jsx(Oe,{type:"submit",disabled:ne,children:pe}),e[96]=ne,e[97]=pe,e[98]=Ce):Ce=e[98];let we;e[99]!==be||e[100]!==Ce?(we=s.jsxs(Zt,{children:[be,Ce]}),e[99]=be,e[100]=Ce,e[101]=we):we=e[101];let Ne;e[102]!==C||e[103]!==xe||e[104]!==we||e[105]!==I?(Ne=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[I,xe,we]})}),e[102]=C,e[103]=xe,e[104]=we,e[105]=I,e[106]=Ne):Ne=e[106];let Se;return e[107]!==S||e[108]!==n||e[109]!==Ne?(Se=s.jsx(ts,{open:n,onOpenChange:S,children:Ne}),e[107]=S,e[108]=n,e[109]=Ne,e[110]=Se):Se=e[110],Se}function $l(t){const e=je.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]=H.useState(c),[h,p]=H.useState(n);n!==h&&(p(n),n&&d(c));let f;e[0]!==a||e[1]!==r?(f=se=>{!se&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=f):f=e[2];const y=f;let g;e[3]!==a||e[4]!==x||e[5]!==i?(g=async se=>{se.preventDefault();const re=x.trim();!re||a||await i(re)},e[3]=a,e[4]=x,e[5]=i,e[6]=g):g=e[6];const v=g;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(Xt,{children:S}),e[9]=S,e[10]=k):k=e[10];let C;e[11]!==u?(C=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=C):C=e[12];let w;e[13]!==C?(w=s.jsx(Vo,{children:C}),e[13]=C,e[14]=w):w=e[14];let U;e[15]!==k||e[16]!==w?(U=s.jsxs(Qt,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=U):U=e[17];let T;e[18]!==u?(T=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=T):T=e[19];let j;e[20]!==T?(j=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:T}),e[20]=T,e[21]=j):j=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=se=>d(se.target.value),e[22]=I):I=e[22];let M;e[23]!==a||e[24]!==x?(M=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=M):M=e[25];let F;e[26]!==j||e[27]!==M?(F=s.jsxs("div",{className:"space-y-1.5",children:[j,M]}),e[26]=j,e[27]=M,e[28]=F):F=e[28];let A;e[29]!==u?(A=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=A):A=e[30];let z;e[31]!==A?(z=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[31]=A,e[32]=z):z=e[32];let K;e[33]!==o?(K=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=K):K=e[34];let _;e[35]!==z||e[36]!==K?(_=s.jsxs("div",{className:"space-y-1.5",children:[z,K]}),e[35]=z,e[36]=K,e[37]=_):_=e[37];let $;e[38]!==F||e[39]!==_?($=s.jsxs("div",{className:"space-y-4 py-4",children:[F,_]}),e[38]=F,e[39]=_,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let B;e[43]!==u?(B=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=B):B=e[44];let W;e[45]!==a||e[46]!==V||e[47]!==B?(W=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:B}),e[45]=a,e[46]=V,e[47]=B,e[48]=W):W=e[48];let X;e[49]!==a||e[50]!==x?(X=!x.trim()||a,e[49]=a,e[50]=x,e[51]=X):X=e[51];let E;e[52]!==a||e[53]!==u?(E=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]=E):E=e[54];let G;e[55]!==X||e[56]!==E?(G=s.jsx(Oe,{type:"submit",disabled:X,children:E}),e[55]=X,e[56]=E,e[57]=G):G=e[57];let Y;e[58]!==W||e[59]!==G?(Y=s.jsxs(Zt,{children:[W,G]}),e[58]=W,e[59]=G,e[60]=Y):Y=e[60];let J;e[61]!==v||e[62]!==$||e[63]!==Y||e[64]!==U?(J=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[U,$,Y]})}),e[61]=v,e[62]=$,e[63]=Y,e[64]=U,e[65]=J):J=e[65];let L;return e[66]!==y||e[67]!==n||e[68]!==J?(L=s.jsx(ts,{open:n,onOpenChange:y,children:J}),e[66]=y,e[67]=n,e[68]=J,e[69]=L):L=e[69],L}function Ll(t){const e=je.c(7),{type:n}=t,o=Qs[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"},os=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return os.includes(t)}const ls={posts:"post",authors:"author",categories:"category"},rn={posts:Ft.post,authors:Ft.author,categories:Ft.category},Ol=Object.fromEntries(Object.entries(rn).map(([t,e])=>[e,t]));function Rl(t){return typeof t=="string"?Ol[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pe(t){return typeof t=="string"?t:""}function Fl(t,e){switch(t){case"posts":return{label:Pe(e.title)||"Untitled post",subtitle:Pe(e.slug)};case"authors":return{label:Pe(e.name)||"Unnamed author",subtitle:Pe(e.email)};case"categories":return{label:Pe(e.name)||"Unnamed category",subtitle:Pe(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=Rl(c.__resolveType);if(!l)continue;const i=Je(c[ls[l]])??{},{label:r,subtitle:a}=Fl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of os)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Kl(t,e){return cn(t)[e]}function vt(t,e){return Kl(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const gs=Object.freeze({});function xt(t,e){return t?Je(t[ls[e]])??gs:gs}function it(t,e,n){return{name:t,__resolveType:rn[e],[ls[e]]:n}}function Yi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:Pe(Je(h)?.[n]),i=h=>typeof h=="string"?h:Pe(Je(h)?.name),r=h=>{const p=l(h),f=p?t.find(({payload:g})=>Pe(g[n])===p):void 0;if(f)return f;const y=i(h);return y?t.find(({payload:g})=>Pe(g.name)===y):void 0},a=t.map(({key:h,payload:p})=>({value:h,label:Pe(p.name)||Pe(p[n])||h})),u=new Map,x=[];return c.forEach((h,p)=>{const f=r(h);if(f){x.includes(f.key)||x.push(f.key);return}const y=`unresolved:${p}`;u.set(y,h),x.push(y),a.push({value:y,label:i(h)||l(h)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:h=>h.map(p=>{const f=t.find(y=>y.key===p);return f?o(f.payload):u.get(p)}).filter(p=>p!==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?Pe(e.slug):""}function Il(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.email):""}function dn(t){const e=[];return Pe(t.title).trim()||e.push("Title"),Pe(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Pe(t.excerpt).trim()||e.push("Excerpt"),Pe(t.image).trim()||e.push("Cover image"),e}const un=8;function mn(t){const e=Pe(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function qi(t,e){return e!=="published"||mn(t)==="published"?!1:dn(t).length>0}function Ml(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,un).toISOString()}function Qi(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Pe(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Ml(n):o}}function fn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Pe(n.title)||"Untitled post",slug:Pe(n.slug),date:Pe(n.date),scheduledDatetime:Pe(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Il).filter(Boolean),missing:dn(n),status:mn(n)}))}function zl(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 Vl(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 Xi(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 Ul(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function xs(t){return{...t,dateModified:new Date().toISOString()}}function Gt(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}/${Gt(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-${Gt(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-${Gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Gl={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"}},bs="Box";function Hl(t){return t.startsWith("site/")?"site":"app"}function Jl(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 Zi(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(!ql(l)||e.has(l))continue;e.add(l);const i=Wt(l,t),r=Wl(l),a=Gl[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),h=u==="site"?i.icon:void 0,p=h&&Jl(h)?h:void 0,f=p!==void 0?a?.iconName??bs:ht(h,a?.iconName)??bs;n.push({resolveType:l,title:x,description:d,iconName:f,iconUrl:p,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Wl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const Yl=["blog/sections/blocks/","site/sections/Blog/Post/"];function ql(t){return Yl.some(e=>t.startsWith(e))}const er=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tr=["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 sr(t){return new Date(t.getFullYear(),t.getMonth(),1)}function nr(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 Ht(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 ys(t,e){return Ht(t,e)+Ql(t)}function or(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 lr(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 h=x.getTime()<n.getTime()?n:x,p=d.getTime()>=o.getTime()?Pt(o,-1):d,f=Ht(h,n),y=Ht(p,h)+1;if(y<=0)continue;const g=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=ys(new Date(g),n),k=Math.max(ys(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:f,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 Xl(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),un);return{...pn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Tt(t)}}function Zl(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 ea(t,e){const n=Zl(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 ta(t){return _t(t.scheduledDatetime)??_t(t.date)}function ar(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:_t(c.scheduledDatetime)!==null},i=ta(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 sa="0.161.0",na="0.162.0",ir="deno task update";function vs(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function Ss(t,e){const n=vs(t),o=vs(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 oa(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 la(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 aa(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=oa(t.denoJson)??la(t.meta);return!e||Ss(e,sa)<0?{kind:"outdated",version:e}:Ss(e,na)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function rr(t){return t.kind==="publish-only"||t.kind==="full"}function cr(t){return t.kind==="full"}function ia(t){const e=je.c(16),n=en(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=so(t.virtualMcpId),c=Et()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=As.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 h=await no({...t,threadId:c},oo(o,"deno.json"));return h.kind==="data"?h.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}=Ds(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=aa({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=je.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:h,invalid:p,invalidReason:f,onToggleSelect:y,onClick:g,menu:v}=t,S=Be(),k=r==="global";let C;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(C=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:Ee("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:Ee("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Yt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=C):C=e[5];const w=C,U=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 T;e[6]!==U?(T=Ee("group relative flex min-w-0 items-center rounded-md transition-colors",U),e[6]=U,e[7]=T):T=e[7];let j;e[8]!==y||e[9]!==x||e[10]!==h||e[11]!==d||e[12]!==S||e[13]!==c?(j=x&&s.jsx("span",{className:Ee("flex shrink-0 items-center pl-2.5 transition-opacity",h||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ra,children:s.jsx(ss,{checked:h,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=h,e[11]=d,e[12]=S,e[13]=c,e[14]=j):j=e[14];const I=p&&!i&&"text-destructive";let M;e[15]!==I?(M=Ee("block truncate text-sm font-medium",I),e[15]=I,e[16]=M):M=e[16];let F;e[17]!==M||e[18]!==c?(F=s.jsx("span",{className:M,children:c}),e[17]=M,e[18]=c,e[19]=F):F=e[19];const A=i?"text-accent-foreground/70":"text-muted-foreground";let z;e[20]!==A?(z=Ee("block truncate text-xs",A),e[20]=A,e[21]=z):z=e[21];let K;e[22]!==l||e[23]!==z?(K=s.jsx("span",{className:z,children:l}),e[22]=l,e[23]=z,e[24]=K):K=e[24];let _;e[25]!==K||e[26]!==F?(_=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[25]=K,e[26]=F,e[27]=_):_=e[27];let $;e[28]!==i||e[29]!==p||e[30]!==f?($=p&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:Ee("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Ls,{size:14})})}),f&&s.jsx(Me,{side:"bottom",children:f})]}),e[28]=i,e[29]=p,e[30]=f,e[31]=$):$=e[31];let V;e[32]!==g||e[33]!==w||e[34]!==_||e[35]!==$||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[w,_,$,u]}),e[32]=g,e[33]=w,e[34]=_,e[35]=$,e[36]=u,e[37]=V):V=e[37];let B;e[38]!==i||e[39]!==v?(B=v&&s.jsx("div",{className:Ee("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=B):B=e[40];let W;return e[41]!==V||e[42]!==B||e[43]!==T||e[44]!==j?(W=s.jsxs("div",{className:T,children:[j,V,B]}),e[41]=V,e[42]=B,e[43]=T,e[44]=j,e[45]=W):W=e[45],W}function ra(t){return t.stopPropagation()}function He(t){const e=je.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 ca={loaders:Xs,actions:Zs},da={loaders:"Loaders",actions:"Actions"},ua={analytics:Qo,blog:Rs,commerce:qo,site:Kn,website:Yo};function ma(t,e){return e===0?ua[t.toLowerCase()]??ds:ds}function kt(t,e){return e===0?co(t):t}function fa(t){const e=je.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,h]=H.useState(x),[p,f]=H.useState(null),[y,g]=H.useState(""),[v,S]=H.useState(Sa),[k,C]=H.useState(a);k!==a&&(C(a),h([]),f(null),g(""),S(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{S(L=>{const se=new Set(L);return se.has(J)?se.delete(J):se.add(J),se})},e[1]=w):w=e[1];const U=w;let T;e[2]!==c||e[3]!==n||e[4]!==o?(T={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=T):T=e[5];const j=Gs(T);let I;e[6]!==j?(I=Js((J,L)=>j.mutate({blockKey:J,data:L})),e[6]=j,e[7]=I):I=e[7];const M=I;let F;e[8]!==a?(F=uo(a),e[8]=a,e[9]=F):F=e[9];const A=F,z=ca[a];let K,_,$,V,B,W,X;if(e[10]!==z||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]!==j||e[20]!==M||e[21]!==y||e[22]!==p||e[23]!==A||e[24]!==u||e[25]!==o){$=Symbol.for("react.early_return_sentinel");e:{const J=[...lo(i,r,a).map(va),...ao(i,a).map(ya)],L=y.trim().toLowerCase(),se=L.length>0,re=se?J.filter(N=>N.title.toLowerCase().includes(L)||N.resolveType.toLowerCase().includes(L)):[],le=new Map,oe=[],ae=new Map;if(!se){for(const N of J){const de=N.folderPath;if(!(de.length<d.length)&&d.every((ye,De)=>de[De]===ye))if(de.length===d.length)if(N.savedKey!==void 0){const ye=ae.get(N.resolveType);ye?ye.push(N):ae.set(N.resolveType,[N])}else oe.push(N);else{const ye=de[d.length],De=le.get(ye)??{count:0,savedCount:0};N.savedKey!==void 0?De.savedCount=De.savedCount+1:De.count=De.count+1,le.set(ye,De)}}oe.sort(ba);for(const N of ae.values())N.sort(xa)}const ce=[...ae.entries()].filter(N=>{const[de]=N;return!oe.some(ye=>ye.resolveType===de)}).flatMap(ga).sort(ha);let O;e[33]!==d?(O=(N,de)=>kt(N.name,d.length).localeCompare(kt(de.name,d.length)),e[33]=d,e[34]=O):O=e[34];const te=[...le.entries()].map(pa).sort(O);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=N=>{f(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=Z):Z=e[35];const ee=Z;let ie;e[36]!==j||e[37]!==A||e[38]!==u?(ie=async(N,de)=>{await j.mutateAsync({blockKey:N,data:de}),ve.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:A,blockId:N})),f({mode:"saved",key:N})},e[36]=j,e[37]=A,e[38]=u,e[39]=ie):ie=e[39];const R=ie;let ge;e[40]!==r||e[41]!==p?(ge=ka(p,r),e[40]=r,e[41]=p,e[42]=ge):ge=e[42];const D=ge;if(D){const N=`${D.mode}:${D.mode==="saved"?D.blockKey:D.resolveType}`;let de;e[43]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[43]=de):de=e[43];let ye;e[44]!==c||e[45]!==r||e[46]!==R||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==j.isPending||e[52]!==M||e[53]!==N||e[54]!==D.editorTarget||e[55]!==D.initialValue||e[56]!==o?(ye=s.jsx(io,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:D.editorTarget,initialValue:D.initialValue,isCreating:j.isPending,onCreate:R,onSaveReferencedBlock:M,onBack:de},N),e[44]=c,e[45]=r,e[46]=R,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=j.isPending,e[52]=M,e[53]=N,e[54]=D.editorTarget,e[55]=D.initialValue,e[56]=o,e[57]=ye):ye=e[57],$=ye;break e}X="flex h-full w-full min-w-0 flex-col";let xe;e[58]!==u?(xe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=xe):xe=e[59];let me;e[60]===Symbol.for("react.memo_cache_sentinel")?(me=()=>h([]),e[60]=me):me=e[60];const fe=d.length===0?"font-medium text-foreground":"text-muted-foreground";let be;e[61]!==fe?(be=Ee("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",fe),e[61]=fe,e[62]=be):be=e[62];const ne=da[a];let pe;e[63]!==be||e[64]!==ne?(pe=s.jsx("button",{type:"button",onClick:me,className:be,children:ne}),e[63]=be,e[64]=ne,e[65]=pe):pe=e[65];let Ce;e[66]!==d?(Ce=d.map((N,de)=>{const ye=de===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:()=>h(d.slice(0,de+1)),className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ye?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,de)})]},`${N}-${de}`)}),e[66]=d,e[67]=Ce):Ce=e[67];let we;e[68]!==xe||e[69]!==pe||e[70]!==Ce?(we=s.jsxs("nav",{"aria-label":xe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[pe,Ce]}),e[68]=xe,e[69]=pe,e[70]=Ce,e[71]=we):we=e[71];let Ne;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(zs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ne):Ne=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=N=>g(N.target.value),e[73]=Se):Se=e[73];let he;e[74]!==a||e[75]!==u?(he=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=he):he=e[76];let Te;e[77]!==a||e[78]!==u?(Te=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=Te):Te=e[79];let $e;e[80]!==y||e[81]!==he||e[82]!==Te?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ne,s.jsx("input",{type:"text",value:y,onChange:Se,placeholder:he,"aria-label":Te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=he,e[82]=Te,e[83]=$e):$e=e[83],e[84]!==we||e[85]!==$e?(_=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,$e]}),e[84]=we,e[85]=$e,e[86]=_):_=e[86],K=Dt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",B=se?re.length===0?s.jsx(He,{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:re.map(N=>s.jsx(Re,{icon:z,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey??N.resolveType))}):te.length===0&&oe.length===0&&ce.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[te.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(N=>{const de=ma(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>h([...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(de,{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:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(oe.length>0||ce.length>0)&&s.jsxs("div",{className:Ee("flex flex-col gap-1",te.length>0&&"mt-4"),children:[oe.map(N=>{const de=ae.get(N.resolveType)??[],ye=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:z,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)}),de.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>U(N.resolveType),"aria-expanded":ye,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:Yt},children:[ye?s.jsx(qt,{size:12,className:"shrink-0"}):s.jsx(Nt,{size:12,className:"shrink-0"}),u(ye?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",de.length,")"]}),ye&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:de.map(De=>s.jsx(Re,{icon:z,accent:"global",title:De.title,subtitle:De.resolveType,active:!1,onClick:()=>ee(De)},De.savedKey))})]})]},N.resolveType)}),ce.map(N=>s.jsx(Re,{icon:z,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey))]})]})}e[10]=z,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]=j,e[20]=M,e[21]=y,e[22]=p,e[23]=A,e[24]=u,e[25]=o,e[26]=K,e[27]=_,e[28]=$,e[29]=V,e[30]=B,e[31]=W,e[32]=X}else K=e[26],_=e[27],$=e[28],V=e[29],B=e[30],W=e[31],X=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let E;e[87]!==V||e[88]!==B?(E=s.jsx("div",{className:V,children:B}),e[87]=V,e[88]=B,e[89]=E):E=e[89];let G;e[90]!==K||e[91]!==E||e[92]!==W?(G=s.jsx(K,{className:W,children:E}),e[90]=K,e[91]=E,e[92]=W,e[93]=G):G=e[93];let Y;return e[94]!==_||e[95]!==G||e[96]!==X?(Y=s.jsxs("div",{className:X,children:[_,G]}),e[94]=_,e[95]=G,e[96]=X,e[97]=Y):Y=e[97],Y}function pa(t){const[e,n]=t;return{name:e,...n}}function ha(t,e){return t.title.localeCompare(e.title)}function ga(t){const[,e]=t;return e}function xa(t,e){return t.title.localeCompare(e.title)}function ba(t,e){return t.title.localeCompare(e.title)}function ya(t){return{resolveType:t.resolveType,title:t.title,folderPath:Hs(t.resolveType)}}function va(t){return{resolveType:t.resolveType,title:t.title,folderPath:Hs(t.resolveType),savedKey:t.key}}function Sa(){return new Set}function ka(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}=ro(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function ja(t){const e=je.c(106),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:h,onSaveReferencedBlock:p}=t,f=Be(),y=Et(),g=y?.virtualMcpId,S=tn(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[C,w]=H.useState(k);let U;e[1]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[1]=U):U=e[1];const[T,j]=H.useState(U),[I,M]=H.useState(0),[F,A]=H.useState(!1);let z;e[2]!==i||e[3]!==a?(z=Jt(a,i),e[2]=i,e[3]=a,e[4]=z):z=e[4];const K=z;let _,$,V,B,W,X,E,G;if(e[5]!==S||e[6]!==c||e[7]!==r||e[8]!==T||e[9]!==C||e[10]!==d||e[11]!==h||e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==f||e[16]!==y?.taskId||e[17]!==u||e[18]!==o){const oe=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,ae=y?.taskId??null,ce=l??void 0;let O;e[27]!==S||e[28]!==c||e[29]!==n||e[30]!==ce||e[31]!==ae||e[32]!==o?(O={orgSlug:n,virtualMcpId:o,branch:c,threadId:ae,previewUrl:ce,siteSlug:S},e[27]=S,e[28]=c,e[29]=n,e[30]=ce,e[31]=ae,e[32]=o,e[33]=O):O=e[33],$=O;let te,Z,ee,ie;if(e[34]!==r||e[35]!==T||e[36]!==C||e[37]!==h||e[38]!==f||e[39]!==u){const pe=[u,...T],Ce=Ne=>{j(T.slice(0,Ne)),M(Ca)};let we;e[48]!==r||e[49]!==C||e[50]!==h?(we=async Ne=>{const Se=mo(Ne,r);if(Se){ve.error(Se);return}await h(Ne,C),A(!1)},e[48]=r,e[49]=C,e[50]=h,e[51]=we):we=e[51],_=we,G="flex h-full w-full min-w-0",E="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ie="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(te=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=te):te=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ee=pe.map((Ne,Se)=>{const he=Se===pe.length-1,Te=Ws(Ne);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Se>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Se),title:Te,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",he?"font-medium text-foreground":"text-muted-foreground"),children:Te})]},`${Te}-${Se}`)}),e[34]=r,e[35]=T,e[36]=C,e[37]=h,e[38]=f,e[39]=u,e[40]=_,e[41]=te,e[42]=Z,e[43]=ee,e[44]=ie,e[45]=W,e[46]=E,e[47]=G}else _=e[40],te=e[41],Z=e[42],ee=e[43],ie=e[44],W=e[45],E=e[46],G=e[47];let R;e[54]!==te||e[55]!==Z||e[56]!==ee?(R=s.jsx("nav",{"aria-label":te,className:Z,children:ee}),e[54]=te,e[55]=Z,e[56]=ee,e[57]=R):R=e[57];let ge;e[58]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>A(!0),e[58]=ge):ge=e[58];let D;e[59]!==f?(D=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=D):D=e[60];let xe;e[61]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(In,{size:14}),e[61]=xe):xe=e[61];let me;e[62]!==d||e[63]!==D?(me=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ge,"aria-label":D,children:xe})}),e[62]=d,e[63]=D,e[64]=me):me=e[64];let fe;e[65]!==f?(fe=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=fe):fe=e[66];let be;e[67]!==fe?(be=s.jsx(Me,{side:"bottom",children:fe}),e[67]=fe,e[68]=be):be=e[68];let ne;e[69]!==me||e[70]!==be?(ne=s.jsxs(ze,{children:[me,be]}),e[69]=me,e[70]=be,e[71]=ne):ne=e[71],e[72]!==ie||e[73]!==R||e[74]!==ne?(X=s.jsxs("div",{className:ie,children:[R,ne]}),e[72]=ie,e[73]=R,e[74]=ne,e[75]=X):X=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",B=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:oe}),e[5]=S,e[6]=c,e[7]=r,e[8]=T,e[9]=C,e[10]=d,e[11]=h,e[12]=n,e[13]=l,e[14]=a,e[15]=f,e[16]=y?.taskId,e[17]=u,e[18]=o,e[19]=_,e[20]=$,e[21]=V,e[22]=B,e[23]=W,e[24]=X,e[25]=E,e[26]=G}else _=e[19],$=e[20],V=e[21],B=e[22],W=e[23],X=e[24],E=e[25],G=e[26];let Y;e[76]!==V||e[77]!==B?(Y=s.jsx("p",{className:V,children:B}),e[76]=V,e[77]=B,e[78]=Y):Y=e[78];let J;e[79]!==Y||e[80]!==W||e[81]!==X?(J=s.jsxs("div",{className:W,children:[X,Y]}),e[79]=Y,e[80]=W,e[81]=X,e[82]=J):J=e[82];let L;e[83]!==r||e[84]!==T||e[85]!==I||e[86]!==C||e[87]!==i||e[88]!==p||e[89]!==$||e[90]!==K||e[91]!==f?(L=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:K?s.jsx(Ys,{schema:K,value:C,onChange:oe=>w(oe),basePath:"",breadcrumbPath:T,onBreadcrumbChange:j,meta:i,decofile:r,onSaveReferencedBlock:p,sandbox:$},I):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=T,e[85]=I,e[86]=C,e[87]=i,e[88]=p,e[89]=$,e[90]=K,e[91]=f,e[92]=L):L=e[92];let se;e[93]!==J||e[94]!==L||e[95]!==E?(se=s.jsxs("div",{className:E,children:[J,L]}),e[93]=J,e[94]=L,e[95]=E,e[96]=se):se=e[96];let re;e[97]!==x||e[98]!==_||e[99]!==d||e[100]!==F?(re=s.jsx(fo,{open:F,onOpenChange:A,defaultBlockId:x,isPending:d,onSubmit:_}),e[97]=x,e[98]=_,e[99]=d,e[100]=F,e[101]=re):re=e[101];let le;return e[102]!==se||e[103]!==re||e[104]!==G?(le=s.jsxs("div",{className:G,children:[se,re]}),e[102]=se,e[103]=re,e[104]=G,e[105]=le):le=e[105],le}function Ca(t){return t+1}function wa(t,e){const n={__resolveType:t},o=ho([n],e)[0];return o?go(n,o,e):null}function Na({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=Et(),x=u?.virtualMcpId,h=tn(x===e?e:null)?.metadata?.siteSlug??null,[p]=H.useState(()=>wa(i,l)),[f,y]=H.useState(p?.data??{}),[g,v]=H.useState([]),[S,k]=H.useState(0),[C,w]=H.useState(!1),[U,T]=H.useState(null),j=U!==null,{save:I,flush:M}=po({orgSlug:t,virtualMcpId:e,branch:n}),F=p?.resolveType?Jt(p.resolveType,c):null,A=l[i],z=A?Po(i,A):i,K=u?.taskId??null,_={orgSlug:t,virtualMcpId:e,branch:n,threadId:K,previewUrl:o??void 0,siteSlug:h},$=E=>{y(E),I(i,E)},V=()=>{j?(T(null),w(!1),k(E=>E+1)):T(JSON.stringify(f,null,2))},B=E=>{const G=E??"";try{const Y=JSON.parse(G);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),$(Y);return}w(!0)}catch{w(!0)}},W=[z,...g],X=E=>{v(g.slice(0,E)),k(G=>G+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:Yt},"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:W.map((E,G)=>{const Y=G===W.length-1,J=Ws(E);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[G>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>X(G),title:J,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Y?"font-medium text-foreground":"text-muted-foreground"),children:J})]},`${J}-${G}`)})}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:j?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":j,children:j?s.jsx(ns,{size:14}):s.jsx(Is,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(j?"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:F?s.jsx(Ys,{schema:F,value:f,onChange:E=>$(E),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:_},S):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),U!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[C&&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(Zo,{language:"json",height:"100%",code:U,onChange:B,onSave:E=>{B(E),M()}})})]})]})]})})}function Pa(t){const e=je.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,h=Be();if(!n){let y;e[0]!==h?(y=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=y):y=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==y||e[5]!==g?(v=s.jsx(He,{title:y,description:g}),e[4]=y,e[5]=g,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,g=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=xo(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(w,U)=>x(n.resolveType,w,U),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let C;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?(C=s.jsx(ja,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:g,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]=C):C=e[25],C}const p=`saved:${n.key}`;let f;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]!==p||e[34]!==c?(f=s.jsx(Na,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},p),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=p,e[34]=c,e[35]=f):f=e[35],f}const ks="__all__",js={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},Ta={"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"},Cs="status:";function ws(t){if(!t.startsWith(Cs))return null;const e=t.slice(Cs.length);return e in wt?e:null}const Ns=H.forwardRef(function(e,n){const o=je.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=Ee("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 h;o[11]!==a?(h=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=h):h=o[12];let p;o[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qt,{size:12,className:"shrink-0 opacity-60"}),o[13]=p):p=o[13];let f;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==h?(f=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,h,p]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=h,o[19]=f):f=o[19],f});function as(t){const e=je.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 _a(t){const e=je.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:h}=t,p=Be();let f;if(e[0]!==n||e[1]!==l){let D;e[3]!==l?(D=xe=>xe.slug===l,e[3]=l,e[4]=D):D=e[4],f=n.find(D),e[0]=n,e[1]=l,e[2]=f}else f=e[2];const y=f;let g;if(e[5]!==i||e[6]!==o){let D;e[8]!==i?(D=xe=>xe.email===i,e[8]=i,e[9]=D):D=e[9],g=o.find(D),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==p?(k=y?.name??v?.name??p(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=p,e[14]=k):k=e[14];const C=k,w=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:ks;let U;e[15]!==x||e[16]!==u||e[17]!==d?(U=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=U):U=e[18];const T=U;let j;e[19]!==T||e[20]!==x||e[21]!==u||e[22]!==d?(j=D=>{D.startsWith("cat:")?(x(null),d(null),u(D.slice(4))):D.startsWith("author:")?(u(null),d(null),x(D.slice(7))):ws(D)?(u(null),x(null),d(ws(D))):T()},e[19]=T,e[20]=x,e[21]=u,e[22]=d,e[23]=j):j=e[23];const I=j;let M;e[24]!==C||e[25]!==S?(M=s.jsx(zt,{asChild:!0,children:s.jsx(Ns,{icon:Mn,active:S,value:C,className:"min-w-0 shrink"})}),e[24]=C,e[25]=S,e[26]=M):M=e[26];let F;e[27]!==p?(F=p("sandbox.postToolbar.filterBy"),e[27]=p,e[28]=F):F=e[28];let A;e[29]!==F?(A=s.jsx(pt,{children:F}),e[29]=F,e[30]=A):A=e[30];let z;e[31]!==p?(z=p("sandbox.postToolbar.allPosts"),e[31]=p,e[32]=z):z=e[32];let K;e[33]!==z?(K=s.jsx(bt,{value:ks,children:z}),e[33]=z,e[34]=K):K=e[34];let _;e[35]!==p?(_=p("sandbox.postToolbar.statusLabel"),e[35]=p,e[36]=_):_=e[36];let $;e[37]!==_?($=s.jsx(pt,{className:"text-muted-foreground/70",children:_}),e[37]=_,e[38]=$):$=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let B;e[40]!==c||e[41]!==p?(B=V.map(D=>s.jsxs(bt,{value:`status:${D}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:p(wt[D])}),s.jsx(as,{count:c[D]})]},`status:${D}`)),e[40]=c,e[41]=p,e[42]=B):B=e[42];let W;e[43]!==n.length||e[44]!==p?(W=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=p,e[45]=W):W=e[45];let X;e[46]!==n?(X=n.map(Da),e[46]=n,e[47]=X):X=e[47];let E;e[48]!==o.length||e[49]!==p?(E=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=p,e[50]=E):E=e[50];let G;e[51]!==o?(G=o.map(Ea),e[51]=o,e[52]=G):G=e[52];let Y;e[53]!==w||e[54]!==I||e[55]!==K||e[56]!==$||e[57]!==B||e[58]!==W||e[59]!==X||e[60]!==E||e[61]!==G?(Y=s.jsxs(us,{value:w,onValueChange:I,children:[K,$,B,W,X,E,G]}),e[53]=w,e[54]=I,e[55]=K,e[56]=$,e[57]=B,e[58]=W,e[59]=X,e[60]=E,e[61]=G,e[62]=Y):Y=e[62];let J;e[63]!==Y||e[64]!==A?(J=s.jsxs(Vt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[A,Y]}),e[63]=Y,e[64]=A,e[65]=J):J=e[65];let L;e[66]!==J||e[67]!==M?(L=s.jsxs(Ut,{children:[M,J]}),e[66]=J,e[67]=M,e[68]=L):L=e[68];let se;e[69]!==T||e[70]!==S||e[71]!==p?(se=S&&s.jsx(Aa,{label:p("sandbox.postToolbar.clearFilter"),onClick:T}),e[69]=T,e[70]=S,e[71]=p,e[72]=se):se=e[72];const re=Ta[a];let le;e[73]!==p||e[74]!==re?(le=p(re),e[73]=p,e[74]=re,e[75]=le):le=e[75];let oe;e[76]!==le?(oe=s.jsx(zt,{asChild:!0,children:s.jsx(Ns,{icon:zn,active:!0,value:le})}),e[76]=le,e[77]=oe):oe=e[77];let ae;e[78]!==p?(ae=p("sandbox.postToolbar.sortBy"),e[78]=p,e[79]=ae):ae=e[79];let ce;e[80]!==ae?(ce=s.jsx(pt,{children:ae}),e[80]=ae,e[81]=ce):ce=e[81];let O;e[82]!==h?(O=D=>h(D),e[82]=h,e[83]=O):O=e[83];let te;e[84]===Symbol.for("react.memo_cache_sentinel")?(te=Object.keys(js),e[84]=te):te=e[84];let Z;e[85]!==p?(Z=te.map(D=>s.jsx(bt,{value:D,children:p(js[D])},D)),e[85]=p,e[86]=Z):Z=e[86];let ee;e[87]!==a||e[88]!==O||e[89]!==Z?(ee=s.jsx(us,{value:a,onValueChange:O,children:Z}),e[87]=a,e[88]=O,e[89]=Z,e[90]=ee):ee=e[90];let ie;e[91]!==ce||e[92]!==ee?(ie=s.jsxs(Vt,{align:"end",className:"w-44",children:[ce,ee]}),e[91]=ce,e[92]=ee,e[93]=ie):ie=e[93];let R;e[94]!==oe||e[95]!==ie?(R=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(Ut,{children:[oe,ie]})}),e[94]=oe,e[95]=ie,e[96]=R):R=e[96];let ge;return e[97]!==L||e[98]!==se||e[99]!==R?(ge=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[L,se,R]}),e[97]=L,e[98]=se,e[99]=R,e[100]=ge):ge=e[100],ge}function Ea(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(as,{count:t.count})]},`author:${t.email}`)}function Da(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(as,{count:t.count})]},`cat:${t.slug}`)}function Aa(t){const e=je.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{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 Ba(t){const e=je.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:$a,children:s.jsx(ss,{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 $a(t){return t.stopPropagation()}function La(t){const e=je.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(Ba,{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 h;e[8]!==r?(h=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(sn,{size:14}),e[10]=p):p=e[10];let f;e[11]!==l||e[12]!==d||e[13]!==h?(f=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":h,children:p})}),e[11]=l,e[12]=d,e[13]=h,e[14]=f):f=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let g;e[17]!==y?(g=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=g):g=e[18];let v;e[19]!==f||e[20]!==g?(v=s.jsxs(ze,{children:[f,g]}),e[19]=f,e[20]=g,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(ns,{size:14}),e[24]=k):k=e[24];let C;e[25]!==i||e[26]!==S?(C=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]=C):C=e[27];let w;e[28]!==r?(w=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=w):w=e[29];let U;e[30]!==w?(U=s.jsx(Me,{side:"bottom",children:w}),e[30]=w,e[31]=U):U=e[31];let T;e[32]!==C||e[33]!==U?(T=s.jsxs(ze,{children:[C,U]}),e[32]=C,e[33]=U,e[34]=T):T=e[34];let j;e[35]!==v||e[36]!==T?(j=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,T]}),e[35]=v,e[36]=T,e[37]=j):j=e[37];let I;return e[38]!==a||e[39]!==j||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,j]}),e[38]=a,e[39]=j,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=je.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(Vn,{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:Oa,children:x})}),e[3]=u,e[4]=d):d=e[4];let h;e[5]!==o||e[6]!==a?(h=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(tl,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=h):h=e[7];let p;e[8]!==n||e[9]!==a?(p=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(el,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=p):p=e[10];let f;e[11]!==c||e[12]!==a?(f=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(Xo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=f):f=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(Ks,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Is,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Rt,{}),e[18]=g):g=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 C;e[25]!==k||e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==y?(C=s.jsxs(Vt,{align:"end",className:"w-44",children:[h,p,f,y,g,k]}),e[25]=k,e[26]=h,e[27]=p,e[28]=f,e[29]=y,e[30]=C):C=e[30];let w;return e[31]!==C||e[32]!==d?(w=s.jsxs(Ut,{children:[d,C]}),e[31]=C,e[32]=d,e[33]=w):w=e[33],w}function Oa(t){return t.stopPropagation()}function Ra(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Fa(t){const e=new Map;for(const n of t){const o=Ra(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 Ps(t){const e=je.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=Ee("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 Ts=H.lazy(()=>Fe(()=>import("./app-editor-CK2-PFMD.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,194,195,196,197,198,199])).then(t=>({default:t.AppEditor}))),Ka=H.lazy(()=>Fe(()=>import("./post-editor-D6gFXTiI.js"),__vite__mapDeps([200,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,62,31,33,34,35,36,37,38,39,40,41,28,29,24,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82,127,201,186,162,114,115,81,130,140,136,134,86,85,87,88,89,83,90,91,92,93,94,95,96,97,98,99,100,27,101,102,103,104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,128,129,25,26,131,132,133,135,137,138,139,141,142,143,144,145,146,147,148,149,202,84,166,203,204,205,206,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199])).then(t=>({default:t.PostEditor}))),Ia=H.lazy(()=>Fe(()=>import("./record-editor-C96ND1CU.js"),__vite__mapDeps([207,1,2,82,127,26,27,28,29,134,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,39,53,59,89,83,31,32,33,34,35,36,37,38,40,41,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,90,91,92,93,94,95,96,97,81,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,128,129,130,25,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,204,206,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,194,195,196,197,198,199])).then(t=>({default:t.RecordEditor}))),Ma=H.lazy(()=>Fe(()=>import("./category-editor-CG20ku6V.js"),__vite__mapDeps([208,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,37,53,62,31,32,33,34,35,36,38,39,40,41,28,29,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,148,82,127,202,84,83,135,114,115,81,130,86,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,27,101,102,103,104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,128,129,25,26,131,132,133,134,136,137,138,139,140,141,142,143,144,145,146,147,149,166,203,204,205,206,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,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,194,195,196,197,198,199])).then(t=>({default:t.CategoryEditor}))),za=H.lazy(()=>Fe(()=>import("./bulk-category-panel-QprmcNHA.js"),__vite__mapDeps([209,1,2,53,79,127,210,43,26,27,28,29,100])).then(t=>({default:t.BulkCategoryPanel}))),Va=H.lazy(()=>Fe(()=>import("./sections-editor-C4NhZuXp.js"),__vite__mapDeps([211,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,29,31,32,33,34,35,36,37,38,39,40,41,28,24,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,25,26,27,100,81,82,86,85,87,88,89,83,90,91,92,93,94,95,96,97,98,99,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,195,212,30,84,213])).then(t=>({default:t.SectionsEditor}))),Ua=H.lazy(()=>Fe(()=>import("./seo-editor-b4BYh3S0.js"),__vite__mapDeps([214,1,2,24,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,79,80,25,26,27,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,89,83,90,91,92,93,94,95,96,97,81,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,82,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,212])).then(t=>({default:t.SeoEditor}))),Ga=H.lazy(()=>Fe(()=>import("./variant-calendar-D_T3c3MC.js"),__vite__mapDeps([215,1,2,31,32,33,34,35,36,37,38,39,40,41,28,29,24,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,127,25,26,27,136,100,216,150,151,152,122,8,9,153,7,103,107,6,10,154,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,105,81,155,156,99,124,125,126,82,98,157,113,158,85,96,95,97,92,93,140,159,147,106,160,161,162,163,109,110,130,164,165,166,167,138,168,169,170,171,172,173,174,175,176,177,178,179,144,145,180,181,116,134,182,183,184,185,186,187,188,91,94,101,102,104,108,111,112,114,115,117,118,119,120,121,123,128,129,189,89,90,190,191,146,142,192,193,194,148,86,87,88,83,131,132,133,135,137,139,141,143,149,195,196,197,198,199])).then(t=>({default:t.VariantCalendar}))),Ha=H.lazy(()=>Fe(()=>import("./post-calendar-6AuB-9GD.js"),__vite__mapDeps([217,1,2,32,31,33,34,35,36,37,38,39,40,41,28,29,24,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,218,25,26,27,150,151,152,122,8,9,153,7,103,107,6,10,154,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,105,100,81,155,156,99,124,125,126,127,82,98,157,113,158,85,96,95,97,92,93,140,159,147,106,160,161,162,163,109,110,130,164,165,166,167,138,168,169,170,171,172,173,174,175,176,177,178,179,144,145,180,181,116,134,182,183,184,185,186,187,188,91,94,101,102,104,108,111,112,114,115,117,118,119,120,121,123,128,129,189,89,90,190,191,146,142,192,193,194,148,86,87,88,83,131,132,133,135,136,137,139,141,143,149,195,196,197,198,199])).then(t=>({default:t.PostCalendar}))),Ja=H.lazy(()=>Fe(()=>import("./redirect-editor-9oPfVcJw.js"),__vite__mapDeps([219,1,2,162,28,82,127,26,27,29,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,39,53,59,89,83,31,32,33,34,35,36,37,38,40,41,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,90,91,92,93,94,95,96,97,81,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,128,129,130,25,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,206])).then(t=>({default:t.RedirectEditor})));function Wa(t){const e=je.c(20),{deepLinkPage:n}=t,{currentBranch:o,virtualMcpId:c}=$s(),{org:l}=An(),i=Io(),r=Mo(),{runtime:a,previewServerUrl:u}=zo(c),x=a==="cms";let d;e[0]!==x||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(d=Sl({fastPreviewActive:x,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=x,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=d):d=e[3];const h=d;if(h.kind==="sandbox-card"){const y=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==r.start||e[6]!==y||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(yl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:y}),e[4]=h.state,e[5]=r.start,e[6]=y,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!c||!o){let y;return e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{title:"Waiting for sandbox context…"}),e[10]=y):y=e[10],y}const p=x?u:r.previewUrl;let f;return e[11]!==o||e[12]!==n||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==c?(f=s.jsx(qa,{orgSlug:l.slug,virtualMcpId:c,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=n,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=p,e[18]=c,e[19]=f):f=e[19],f}const _s=2e3,Ya=15;function Es(t,e,n,o){return typeof e!="string"||n&&(nn(e,n,o)||t.state.dataUpdateCount>=Ya)?!1:_s}function qa({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:h}=bo(x,{fetchEnabled:i}),p=Bs({strict:!1}),[f,y]=H.useState(()=>p.contentCollection&&qe(p.contentCollection)&&p.contentCollection||"pages"),[g,v]=H.useState(()=>p.contentItem&&qe(f)?{collection:f,key:p.contentItem}:null),[S,k]=H.useState(null),C=!!(l?.pageId||l?.path||l?.pathTemplate),[w,U]=H.useState(!1);if(C&&!w&&g===null&&d){U(!0);const m=To(rs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[T,j]=H.useState(""),[I,M]=H.useState(null),[F,A]=H.useState(null),[z,K]=H.useState(null),[_,$]=H.useState("date-desc"),[V,B]=H.useState(()=>new Set),[W,X]=H.useState(null),E=()=>{B(new Set),X(null)},G=m=>{v(m),k(null)},[Y,J]=H.useState(f);Y!==f&&(J(f),j(""),M(null),A(null),K(null),$("date-desc"),B(new Set),X(null));const{data:L,isLoading:se,isFetching:re}=yo(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(f==="apps"&&g&&g.collection==="apps"){const q=d?.[g.key];return Es(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(f==="site"&&d){const q=P?cs(d,P):null,Q=d.site,ke=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Es(m,ke,P,["seo"])}return!1}}),le=(m,P)=>!nn(m,L,P)&&(se||re),{catalog:oe,isLoading:ae}=hl(L??void 0,d??void 0,{enabled:f==="apps"}),ce=ia({orgSlug:t,virtualMcpId:e,branch:n,meta:L}),O=Gs(x),te=Lo(x),[Z,ee]=H.useState(null),[ie,R]=H.useState(),[ge,D]=H.useState(!1),[xe,me]=H.useState(),[fe,be]=H.useState(null),[ne,pe]=H.useState(null),[Ce,we]=H.useState(null),Ne=!d||!L;if(h||se||Ne&&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(Ne)return s.jsx(He,{title:"Could not load site data."});const Se=rs(d).sort((m,P)=>m.name.localeCompare(P.name)),he=_o(d).sort((m,P)=>m.from.localeCompare(P.from)),Te=Eo(d,L),$e=f==="sections"?Do(L):[],N=cs(d,L),de=cn(d),ye=os.some(m=>de[m].length>0),De=qe(f)?de[f]:[],ct=(ye?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=f==="posts"&&(V.size>0||W!==null),dt=et?fn(d).filter(m=>V.has(m.key)):[],ut=is(L,"loaders"),tt=is(L,"actions");if(!Ao(d,L)&&!ye&&ut===0&&tt===0)return s.jsx(He,{icon:Ls,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Bt={pages:Se.length,sections:Te.length,apps:oe.length,loaders:ut,actions:tt,redirects:he.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},We=new Set(Se.map(m=>Ct(m.path))),st=new Set(Se.map(m=>m.name)),mt=new Set(Te.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=qs(d,m.key),Q=vo(d,m.key,Math.max(0,q-1)),ke=So(P.sections,Q);if(ke)try{await O.mutateAsync({blockKey:m.key,data:{...P,sections:ke}}),ve.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(_e){ve.error(_e instanceof Error?_e.message:"Could not add variant")}},Ve=()=>{R(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{R(void 0),ee({mode:"duplicate",sourceKey:m.key,initialName:ps(st,m.name),initialPath:kl(We,m.path)})},Ge=m=>{R(void 0),ee({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!Z)return;const{mode:P,sourceKey:q}=Z;try{if(P==="create"){let Q;if(m.templateKey){const _e=d[m.templateKey];if(!_e)throw new Error("Selected template no longer exists.");Q={..._e,name:m.name,path:m.path}}else Q=wl(m.name,m.path);const ke=Pl(d,m.name);await O.mutateAsync({blockKey:ke,data:Q}),ve.success(`Created "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:ke,data:_e}=Cl({source:Q,pages:Se,newName:m.name,newPath:m.path});await O.mutateAsync({blockKey:ke,data:_e}),ve.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const ke={...Q,name:m.name,path:m.path};await O.mutateAsync({blockKey:q,data:ke}),ve.success("Page updated"),g?.collection==="pages"&&g.key===q&&v({collection:"pages",key:q,path:m.path})}ee(null)}catch(Q){R(Q instanceof Error?Q.message:"Save failed")}},ue=({path:m})=>{if(!Z)return null;const P=Ct(m);return(Z.mode==="rename"?Ct(Z.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await O.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),ve.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Js((m,P)=>O.mutate({blockKey:m,data:P})),bn=async m=>{const P=d[m.key];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=jl(d,m.key),Q=ps(mt,m.name),ke={...P,name:Q};try{await O.mutateAsync({blockKey:q,data:ke}),ve.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:a("sandbox.contentBrowser.duplicateFailed"))}},yn=async m=>{if(!fe)return;const P=d[fe];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:fe,data:{...P,name:m}}),ve.success(a("sandbox.contentBrowser.sectionRenamed")),be(null)}catch(q){ve.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},vn=()=>{me(void 0),D(!0)},Sn=async m=>{const P=Bo(d,m.from),q=$o(m);try{await O.mutateAsync({blockKey:P,data:q}),ve.success("Created redirect"),D(!1),v({collection:"redirects",key:P})}catch(Q){me(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 O.mutateAsync({blockKey:P,data:q}),ve.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){ve.error(Q instanceof Error?Q.message:"Could not create")}},jn=async m=>{const P=Kt(d,"posts"),q=it(P,"posts",Xl(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),J("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){ve.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},Cn=async(m,P)=>{const q=d[m],Q=q?ea(xt(q,"posts"),P):null;if(!Q){ve.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(ke){ve.error(ke instanceof Error?ke.message:a("sandbox.postCalendar.couldNotReschedule"))}},wn=async m=>{const P=d[m.key];if(!P){ve.error("Record not found.");return}const q=Kt(d,m.kind),Q=m.kind==="posts"?"title":"name",ke={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await O.mutateAsync({blockKey:q,data:it(q,m.kind,ke)}),ve.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:"Duplicate failed")}},Nn=m=>{B(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Pn=m=>{y("posts"),J("posts"),v(null),k(null),j(""),M(null),A(null),K(null),$("date-desc"),B(new Set),X(m||null)},Tn=async(m,P)=>{const q=[...V];let Q=0;for(const ke of q){const _e=d[ke],ot=xt(_e,"posts"),ft=m==="add"?zl(ot,P):Vl(ot,P);ft!==ot&&(await O.mutateAsync({blockKey:ke,data:it(ke,"posts",xs(ft))}),Q+=1)}return Q},_n=async(m,P)=>{const q=V.size;try{const Q=await Tn(m,P),ke=m==="add"?"Added to":"Moved",_e=q-Q;ve.success(`${ke} ${Q} ${Q===1?"post":"posts"}`+(_e>0?` (${_e} already set)`:"")),E()}catch(Q){ve.error(Q instanceof Error?Q.message:"Bulk update failed")}},En=async()=>{if(ne)try{if(ne.kind==="blog-bulk"){for(const Q of ne.keys)await te.mutateAsync({blockKey:Q});ve.success(`Deleted ${ne.count} ${ne.count===1?"post":"posts"}`),g&&g.collection!=="available-section"&&ne.keys.includes(g.key)&&v(null),E(),pe(null);return}const{kind:m,key:P,label:q}=ne;if(m==="blog"){if(ne.blogKind==="categories"){const Q=xt(d[P],"categories").slug,ke=typeof Q=="string"?Q:"";if(ke)for(const{key:_e,payload:ot}of vt(d,"posts")){const ft=Ul(ot,ke);ft!==ot&&await O.mutateAsync({blockKey:_e,data:it(_e,"posts",xs(ft))})}}await te.mutateAsync({blockKey:P})}else await te.mutateAsync({blockKey:P});ve.success(`Deleted "${q}"`),g&&g.collection!=="available-section"&&g.key===P&&v(null),pe(null)}catch(m){ve.error(m instanceof Error?m.message:"Delete failed")}},St=te.isPending||O.isPending,Dn=ne?.kind==="blog"?yt[ne.blogKind]:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"}`:ne?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(xl,{active:f,counts:Bt,showBlog:ye,onSelect:m=>{y(m),v(null),k(null)}}),f!=="seo"&&f!=="site"&&f!=="calendar"&&f!=="post-schedule"&&f!=="loaders"&&f!=="actions"&&s.jsx(Qa,{activeCollection:f,pages:Se,redirects:he,sections:Te,availableSections:$e,appCatalog:oe,appCatalogLoading:ae,blogEntries:De,decofile:d,searchQuery:T,onSearchChange:j,postCategoryFilter:I,postAuthorFilter:F,postStatusFilter:z,postSort:_,onPostCategoryFilterChange:m=>{M(m),B(new Set)},onPostAuthorFilterChange:m=>{A(m),B(new Set)},onPostStatusFilterChange:m=>{K(m),B(new Set)},onPostSortChange:$,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:Nn,onSelectAllPosts:m=>B(new Set(m)),onClearPostSelection:()=>B(new Set),onExitPostSelection:E,onBulkDeletePosts:()=>pe({kind:"blog-bulk",keys:[...V],count:V.size}),selection:g,onSelect:G,onCreate:()=>{f==="pages"?Ve():f==="redirects"?vn():qe(f)&&kn(f)},onDuplicatePage:Ue,onRenamePage:Ge,onAddPageVariant:nt,onDeletePage:m=>pe({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=>we(m.key),onDuplicateSection:bn,onRenameSection:m=>be(m.key),onDeleteSection:m=>pe({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>pe({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:wn,onDeleteBlog:m=>pe({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?s.jsx(fa,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,kind:f}):s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?s.jsx(Ga,{decofile:d}):f==="post-schedule"?s.jsx(Ha,{decofile:d,support:ce,isCreating:O.isPending,onCreate:m=>{jn(m)},onReschedule:(m,P)=>{Cn(m,P)},onSelect:m=>{y("posts"),J("posts"),v({collection:"posts",key:m}),k(null)}}):f==="site"?N?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:L,title:"Site",excludeFields:["seo"],schemaPending:le(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(He,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="seo"?s.jsx(Ua,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:L,target:{kind:"site"},previewBaseUrl:c}):f==="sections"?s.jsx(Pa,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,isCreating:O.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(za,{posts:dt,categories:ct,initialSlug:W,isPending:O.isPending,onApply:(m,P)=>{_n(m,P)},onClose:E},W??"selection"):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:o,schemaPending:le(typeof d[g.key]?.__resolveType=="string"?String(d[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="posts"?s.jsx(Ka,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:c},`post:${g.key}`):g.collection==="categories"?s.jsx(Ma,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,onManagePosts:Pn,onOpenPost:m=>{y("posts"),J("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${g.key}`):g.collection==="authors"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:g.key,block:d[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(Ja,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key]},`redirect:${g.key}`):s.jsx(Va,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&S===g.key,onExitSeo:()=>k(null)},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(He,{title:`Select ${qe(f)?`a ${yt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),Z&&s.jsx(Dl,{open:!!Z,mode:Z.mode,initialName:Z.initialName,initialPath:Z.initialPath,isPending:O.isPending,error:ie,templates:Se,validate:ue,onSubmit:b,onOpenChange:m=>{m||(ee(null),R(void 0))}}),s.jsx(Bl,{open:ge,isPending:O.isPending,error:xe,onSubmit:Sn,onOpenChange:m=>{m||(D(!1),me(void 0))}}),fe&&s.jsx($l,{open:!!fe,blockKey:fe,initialName:Te.find(m=>m.key===fe)?.name??fe,isPending:O.isPending,onSubmit:yn,onOpenChange:m=>{m||be(null)}}),Ce&&s.jsx(Oo,{open:!!Ce,onOpenChange:m=>{m||we(null)},pageKey:Ce,decofile:d,onSave:m=>O.mutateAsync({blockKey:Ce,data:m})}),s.jsx(Gn,{open:!!ne,onOpenChange:m=>{!m&&!St&&pe(null)},children:s.jsxs(Hn,{children:[s.jsxs(Jn,{children:[s.jsx(Wn,{children:`Delete ${Dn}?`}),s.jsx(Yn,{children:ne?.kind==="section"?`"${ne.label}" will be removed. Pages that still reference it will lose this section.`:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ne?`"${ne.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(qn,{children:[s.jsx(Qn,{disabled:St,children:"Cancel"}),s.jsx(Xn,{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=je.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:h,postCategoryFilter:p,postAuthorFilter:f,postStatusFilter:y,postSort:g,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:C,selectedPostKeys:w,postBulkPanelOpen:U,onTogglePostSelect:T,onSelectAllPosts:j,onClearPostSelection:I,onExitPostSelection:M,onBulkDeletePosts:F,selection:A,onSelect:z,onCreate:K,onDuplicatePage:_,onRenamePage:$,onAddPageVariant:V,onDeletePage:B,onEditPageSeo:W,onViewPageJson:X,onDuplicateSection:E,onRenameSection:G,onDeleteSection:Y,onDeleteRedirect:J,onDuplicateBlog:L,onDeleteBlog:se}=t;let re,le,oe,ae,ce,O,te;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==F||e[8]!==I||e[9]!==K||e[10]!==se||e[11]!==B||e[12]!==J||e[13]!==Y||e[14]!==L||e[15]!==_||e[16]!==E||e[17]!==W||e[18]!==M||e[19]!==S||e[20]!==v||e[21]!==C||e[22]!==k||e[23]!==$||e[24]!==G||e[25]!==h||e[26]!==z||e[27]!==j||e[28]!==T||e[29]!==X||e[30]!==o||e[31]!==f||e[32]!==U||e[33]!==p||e[34]!==g||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==w||e[40]!==A){const R=d.toLowerCase(),ge=o.filter(b=>!R||b.name.toLowerCase().includes(R)||b.path.toLowerCase().includes(R)),D=c.filter(b=>!R||b.from.toLowerCase().includes(R)||b.to.toLowerCase().includes(R)),xe=l.filter(b=>!R||b.name.toLowerCase().includes(R)||b.key.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)),me=i.filter(b=>!R||b.title.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)||(b.description?.toLowerCase().includes(R)??!1)),fe=Fa(xe),be=r.filter(b=>!R||b.title.toLowerCase().includes(R)||b.app.toLowerCase().includes(R)||b.vendor.toLowerCase().includes(R)||b.category.toLowerCase().includes(R)),ne=u.filter(b=>!R||b.label.toLowerCase().includes(R)||b.subtitle.toLowerCase().includes(R)),pe=n==="posts",Ce=ti,we=pe?fn(x):[],Ne=new Map,Se=new Map,he={published:0,scheduled:0,draft:0};for(const b of we)he[b.status]=he[b.status]+1;for(const b of we){for(const ue of b.categorySlugs)Ne.set(ue,(Ne.get(ue)??0)+1);for(const ue of b.authorEmails)Se.set(ue,(Se.get(ue)??0)+1)}const Te=(pe?vt(x,"categories"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.slug)||ue;return{slug:Ye,name:Ce(Ae.name)||Ce(Ae.slug)||ue,count:Ne.get(Ye)??0}}).filter(ei),$e=(pe?vt(x,"authors"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.email);return{email:Ye,name:Ce(Ae.name)||Ce(Ae.email)||ue,count:Se.get(Ye)??0}}).filter(Za);let N;e[48]!==p?(N=b=>!p||b.categorySlugs.includes(p),e[48]=p,e[49]=N):N=e[49];let de;e[50]!==f?(de=b=>!f||b.authorEmails.includes(f),e[50]=f,e[51]=de):de=e[51];let ye;e[52]!==y?(ye=b=>!y||b.status===y,e[52]=y,e[53]=ye):ye=e[53];let De;e[54]!==g?(De=(b,ue)=>{if(g==="az")return b.title.localeCompare(ue.title);if(g==="za")return ue.title.localeCompare(b.title);const Ae=b.date.localeCompare(ue.date);return g==="date-asc"?Ae:-Ae},e[54]=g,e[55]=De):De=e[55];const ct=we.filter(b=>!R||b.title.toLowerCase().includes(R)||b.slug.toLowerCase().includes(R)).filter(N).filter(de).filter(ye).sort(De),et=w.size,dt=ct.map(Xa),ut=dt.length>0&&dt.every(b=>w.has(b)),tt=et>0||U,Bt=()=>{ut?I():j(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";ce="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(zs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==h?(Ve=b=>h(b.target.value),e[57]=h,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 Ge;e[63]!==st||e[64]!==K||e[65]!==mt?(Ge=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:K,"aria-label":st,children:s.jsx(Un,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=K,e[65]=mt,e[66]=Ge):Ge=e[66],e[67]!==Ue||e[68]!==Ge?(O=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,Ge]}),e[67]=Ue,e[68]=Ge,e[69]=O):O=e[69],te=pe&&(tt?s.jsx(La,{count:et,allSelected:ut,onToggleSelectAll:Bt,onDelete:F,onExit:M}):s.jsx(_a,{categories:Te,authors:$e,categoryFilter:p,statusCounts:he,authorFilter:f,statusFilter:y,sort:g,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:C})),re=Dt,ae="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",le="flex flex-col gap-1 p-1.5",oe=n==="pages"?ge.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ge.map(b=>{const ue=A?.collection==="pages"&&A.key===b.key,Ae=qs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:ue,variantCount:Ae,onClick:()=>z({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>_(b),onRename:()=>$(b),onAddVariant:()=>V(b),onEditSeo:()=>W(b),onViewJson:()=>X(b),onDelete:()=>B(b)})},b.key)}):n==="sections"?xe.length===0&&me.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:[fe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:It,label:"Saved sections"}),fe.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(ue=>{const Ae=A?.collection==="sections"&&A.key===ue.key;return s.jsx(Re,{icon:It,accent:"global",title:ue.name,subtitle:b.label,active:Ae,onClick:()=>z({collection:"sections",key:ue.key}),menu:s.jsx(gt,{onDuplicate:()=>E(ue),onRename:()=>G(ue),onDelete:()=>Y(ue)})},ue.key)})]},b.label))]}),me.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:jt,label:"Available sections",className:Ee(fe.length>0&&"mt-3")}),me.map(b=>{const ue=A?.collection==="available-section"&&A.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:ue,onClick:()=>z({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"})}):be.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):be.map(b=>{const ue=A?.collection==="apps"&&b.blockKey!==null&&A.key===b.blockKey;return s.jsx(Re,{icon:Ms,logoUrl:b.logo,title:b.title,subtitle:b.category,active:ue,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){ve.message(`${b.title} is not installed on this site.`);return}z({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?D.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):D.map(b=>s.jsx(Re,{icon:Os,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:A?.collection==="redirects"&&A.key===b.key,trailing:s.jsx(Ll,{type:b.type}),onClick:()=>z({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>J(b)})},b.key)):pe?ct.length===0?s.jsx(at,{hasItems:we.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const ue={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:A?.collection==="posts"&&A.key===b.key,selectable:!0,selectionActive:tt,selected:w.has(b.key),onToggleSelect:()=>T(b.key),onClick:()=>tt?T(b.key):z({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(ue),onDelete:()=>se(ue)})},b.key)}):ne.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ne.map(b=>{const ue=A?.collection===b.kind&&A.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Mt:b.kind==="authors"?Vs:Fs,title:b.label,subtitle:b.subtitle,active:ue,onClick:()=>z({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(b),onDelete:()=>se(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]=F,e[8]=I,e[9]=K,e[10]=se,e[11]=B,e[12]=J,e[13]=Y,e[14]=L,e[15]=_,e[16]=E,e[17]=W,e[18]=M,e[19]=S,e[20]=v,e[21]=C,e[22]=k,e[23]=$,e[24]=G,e[25]=h,e[26]=z,e[27]=j,e[28]=T,e[29]=X,e[30]=o,e[31]=f,e[32]=U,e[33]=p,e[34]=g,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=w,e[40]=A,e[41]=re,e[42]=le,e[43]=oe,e[44]=ae,e[45]=ce,e[46]=O,e[47]=te}else re=e[41],le=e[42],oe=e[43],ae=e[44],ce=e[45],O=e[46],te=e[47];let Z;e[70]!==le||e[71]!==oe?(Z=s.jsx("div",{className:le,children:oe}),e[70]=le,e[71]=oe,e[72]=Z):Z=e[72];let ee;e[73]!==re||e[74]!==ae||e[75]!==Z?(ee=s.jsx(re,{className:ae,children:Z}),e[73]=re,e[74]=ae,e[75]=Z,e[76]=ee):ee=e[76];let ie;return e[77]!==ce||e[78]!==O||e[79]!==te||e[80]!==ee?(ie=s.jsxs("div",{className:ce,children:[O,te,ee]}),e[77]=ce,e[78]=O,e[79]=te,e[80]=ee,e[81]=ie):ie=e[81],ie}function Xa(t){return t.key}function Za(t){return t.email}function ei(t){return t.slug}function ti(t){return typeof t=="string"?t:""}function si(t){const e=je.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=H.useState(!1),i=en(n),{activeTask:r}=$s();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=Bs(a);if(!(ms(i?.metadata)||ms(r?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(fs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let p;e[2]!==o?(p=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=p):p=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let y,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),g=s.jsx(fs,{className:"size-4"}),e[6]=y,e[7]=g):(y=e[6],g=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:[g,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==p||e[13]!==f||e[14]!==S?(k=s.jsx(sl,{className:"h-full",image:h,title:p,description:f,actions:S}),e[12]=p,e[13]=f,e[14]=S,e[15]=k):k=e[15];let C;e[16]!==c?(C=s.jsx(nl,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=C):C=e[17];let w;return e[18]!==C||e[19]!==k?(w=s.jsxs(s.Fragment,{children:[k,C]}),e[18]=C,e[19]=k,e[20]=w):w=e[20],w}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Wa,{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 ni(){const t=je.c(2),e=ol();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx($n,{feature:"cms",children:s.jsx(si,{virtualMcpId:e})})}),t[0]=e,t[1]=n):n=t[1],n}const dr=Object.freeze(Object.defineProperty({__proto__:null,default:ni},Symbol.toStringTag,{value:"Module"}));export{na as A,ir as B,dr as C,tr as M,er as W,rr as a,it as b,cr as c,qi as d,Yi as e,Qi as f,xt as g,Wl as h,ql as i,Zi as j,fn as k,vt as l,dn as m,jl as n,Xi as o,mn as p,sr as q,al as r,xs as s,or as t,ia as u,Xe as v,lr as w,nr as x,ar as y,Tt as z};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-CaCDGdiz.js","assets/index-z4bKt11m.js","assets/index-CpNTsElB.css","assets/chat-context-BBVkwd3p.js","assets/use-panel-navigate-BG4d0Vrr.js","assets/thread-route-B1EuqJlg.js","assets/use-project-scope-DRope0ob.js","assets/use-virtual-mcp-Bq1RMGPF.js","assets/use-mcp-client-B1u2B39v.js","assets/auth-D-2jYpOE.js","assets/github-repo-BknN0SVI.js","assets/autosend-D-BN-cv5.js","assets/thread-intent-9fI0jPLV.js","assets/slugify-CEUa2lfQ.js","assets/hooks-CkL4R3Tj.js","assets/backoff-8mStPHYB.js","assets/task-board-lQZGfEfb.js","assets/schema-D0xfowSf.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-BWaaNeuI.js","assets/use-ai-providers-B0bxSHYG.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-_O_0AHeH.js","assets/use-organization-settings-C-XY0Wze.js","assets/ChevronRight-DNrwFBnC.js","assets/scroll-area-BqCCUXvj.js","assets/select-cIekAVlM.js","assets/index-B46P4HkV.js","assets/Check-BZE0WrNL.js","assets/ChevronUp-D5_IWEtB.js","assets/use-section-preview-base-Dwn5dF7B.js","assets/agent-icon-BD4DM2Lv.js","assets/AlertCircle-DbwtWnTP.js","assets/Tool01-DHi_Z7zo.js","assets/ArrowUp-Scf6R8DX.js","assets/ArrowLeft-CyH6aWpS.js","assets/Tool02-JY0gm8cg.js","assets/ArrowRight-Bv0iX4wy.js","assets/TrendUp01-Bkdgpfn7.js","assets/ZoomOut-BRjMa-04.js","assets/Users03-BP-0DNhp.js","assets/CheckCircle-BKb1RVrA.js","assets/ChevronSelectorVertical-oXn0cTzk.js","assets/DotsVertical-DE9eZKrJ.js","assets/UserSquare-qgzToKNd.js","assets/Copy01-DTHuBaTA.js","assets/CreditCard01-CwX6pA0M.js","assets/Database01-RGlwXHSd.js","assets/MessageCircle01-CgotMmLL.js","assets/Download01-qX3hmvr5.js","assets/Printer-BpZBiqyG.js","assets/Settings02-CFcKewXh.js","assets/Eye-DXUjft5i.js","assets/File02-g-xJPix_.js","assets/Share07-CxuHcmnM.js","assets/GitBranch01-ddoPQdPH.js","assets/Globe01-DIy8wXF6.js","assets/SwitchHorizontal01-hHr6GOmU.js","assets/HardDrive-DU_z1AQw.js","assets/Image01-DfaxHjlV.js","assets/Key01-mqjfsZRe.js","assets/Link01-C656VtHx.js","assets/LinkExternal01-BkRUjBAn.js","assets/Monitor01-CQ6Zk1oP.js","assets/Sun-SBoG-e9B.js","assets/Package-t6euxYcP.js","assets/Palette-oECS8j3l.js","assets/Play-DQgzDnaW.js","assets/Plus-D2HOi_DD.js","assets/SearchLg-DbX4T5E-.js","assets/SearchMd-FDCJM3CR.js","assets/Shield01-HrKG6yUn.js","assets/Stars01-B_nM3FYf.js","assets/Trash01-C6bziN5X.js","assets/Upload01-DC2spim9.js","assets/User01-BbOpA84p.js","assets/Users01-BOsDT0Jv.js","assets/XCircle-CuK2q_XU.js","assets/XClose-Cvyz3reC.js","assets/X-Bzh3NI3m.js","assets/Zap-DXNovEva.js","assets/dialog-DbzCN1O8.js","assets/input-C7XH8Uj_.js","assets/claim-phase-copy-0btUuJoC.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-DU2zS-3V.js","assets/runnable-block-editor-CCXhy-vO.js","assets/decofile-api-BVqR93jw.js","assets/utils-CU3t1jst.js","assets/sandbox-url-D3mC8qhT.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B2TMNGEX.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-n44mVpiB.js","assets/use-copy-DUiBegp6.js","assets/usage-stats-waRf4dtg.js","assets/markdown-BhLIBmBv.js","assets/org-file-open-context-BgiBbqKQ.js","assets/use-mobile-CV7f0Wqe.js","assets/tooltip-BuKeolDX.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-DjwQ0S-h.js","assets/types-Bh4jNqv3.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-CFIpVRaR.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/shell-layout-DMJSwXH6.js","assets/avatar-Duu5Gg02.js","assets/download-app-dialog-Bsig7tOs.js","assets/anchors-yqDzZN4K.js","assets/use-org-notice-C5thI8aD.js","assets/command-palette-store-LVCQ6fRv.js","assets/command-D2fiEFer.js","assets/index-Cyoz5tz5.js","assets/integration-icon-DOHTaQ6D.js","assets/project-icon-Cw3la58q.js","assets/required-auth-layout-WkX8CtfT.js","assets/use-org-sso-vHIufIoJ.js","assets/shell-layout-CuFt8bor.css","assets/sheet-DhNzwMUj.js","assets/use-connection-CPQUKm0a.js","assets/use-navigate-to-agent-BMSyO1iB.js","assets/use-mcp-prompts-DxT8Kz-M.js","assets/index-CuiP-22D.js","assets/form-B7dtslOD.js","assets/label-8juC5J-g.js","assets/use-thread-outputs-DAcljy5D.js","assets/file-type-icon-C37FwvPU.js","assets/popover-CsEsUqbZ.js","assets/monaco-editor-BHu8MLvz.js","assets/editor-CpBx0ZCm.js","assets/calendar-Dyov14Y_.js","assets/textarea-BEOceSll.js","assets/rich-text-link-control-DgGIjR0I.js","assets/switch-9PLadaw_.js","assets/safe-image-url-D5z803Ot.js","assets/dropdown-menu-Dd8nakK9.js","assets/search-input-DpLbMQRj.js","assets/tabs-Co2GUrNY.js","assets/use-debounced-value-DeY1TNRX.js","assets/use-file-configs-sqbLS09v.js","assets/asset-utils-syVIRo9d.js","assets/useInfiniteQuery-C6OBOha-.js","assets/infiniteQueryObserver-BjcfJE2O.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-Ck5f9XVv.js","assets/alert-dialog-Bi9Cy1y8.js","assets/sandbox-git-api-CMdpE2TE.js","assets/agent-view-guard-q_9RifUL.js","assets/use-main-panel-tabs-CyT7yQAB.js","assets/use-route-default-main-DBXt2fvS.js","assets/use-mcp-tools-Ch_j97A3.js","assets/index-BFjKFLU3.js","assets/drawer-CBdcJytm.js","assets/collection-search-CeA9TK20.js","assets/input-I71U33T1.js","assets/chat-draft-bAtYgASI.js","assets/use-deco-credits-Du6WCMYS.js","assets/use-open-billing-url-BGn9Wkis.js","assets/decopilot-72HlEf1U.js","assets/checkbox-Dkejdmst.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-CULK6hDm.js","assets/input-CSQboV8k.js","assets/hooks-D09Ti1PG.js","assets/use-org-fs-D6lKuMAi.js","assets/question-004-sINsf4GQ.js","assets/use-members-H3oi0qPu.js","assets/use-org-auth-client-ZxEGrzhh.js","assets/feature-paywall-BOwjYKin.js","assets/plan-ladder-C80Qcxkm.js","assets/add-connection-dialog-GfufFuLz.js","assets/extract-connection-data-CM8c_Wvw.js","assets/metadata-dUsYcpuu.js","assets/github-D4UJ99TO.js","assets/connection-BfiO32wM.js","assets/connection-card-83VJQMov.js","assets/use-registry-connections-D_a0MIjQ.js","assets/retry-i8LvYSZg.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-Ms_1nBbP.js","assets/authenticate-and-persist-oauth-2yRhuiER.js","assets/mcp-oauth-DiqQlKOx.js","assets/collection-tabs-3kW0qDG6.js","assets/badge-BNBGXxmC.js","assets/use-infinite-scroll-RrOnf-fI.js","assets/useSuspenseInfiniteQuery-XFcbI_PD.js","assets/sandbox-lifecycle-context-DL9kkwoa.js","assets/use-task-metadata-9gheSHac.js","assets/use-project-native-view-presence-0NQTfFQT.js","assets/site-slug-uya6Wp4-.js","assets/virtual-mcp-BYPZngzy.js","assets/feature-gate-BURkiaEd.js","assets/mustache-DtVu96DY.js","assets/empty-state-BIcQyeij.js","assets/github-icon-BcrkxW36.js","assets/repository-import-picker-C0YugeGx.js","assets/repository-picker-BaqWNwxf.js","assets/post-editor-5tYPjO0c.js","assets/multi-select-DcF09HV8.js","assets/block-document-BT-7XjFG.js","assets/index-DLxUQ-f9.js","assets/primitives-Dy5hA1_y.js","assets/use-fast-preview-draft-url-BrZtKg6o.js","assets/use-autosave-CfERN5UF.js","assets/record-editor-C02fIlfV.js","assets/category-editor-CFCxetoB.js","assets/bulk-category-panel-CODUgRdO.js","assets/index-KOGfrBZR.js","assets/sections-editor-D24EQfD8.js","assets/page-seo-form-BBCLz5m0.js","assets/variant-matcher-override-DUPu0vkW.js","assets/seo-editor-BRYLT6tF.js","assets/variant-calendar-Bp201sXA.js","assets/view-mode-toggle-DaZN0qXY.js","assets/post-calendar-gswoVxcp.js","assets/alert-Cnsh1M35.js","assets/redirect-editor-B2uGI7FY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as je,j as s,m as Ds,K as As,b as Be,l as Ee,r as H,h as Qe,B as Oe,t as ve,M as An,u as Bs,au as Fe}from"./index-z4bKt11m.js";import{A as Bn}from"./agent-view-guard-q_9RifUL.js";import{F as $n}from"./feature-gate-BURkiaEd.js";import{u as Et,b as $s}from"./chat-context-BBVkwd3p.js";import{i as Ls}from"./AlertCircle-DbwtWnTP.js";import{y as jt,I as Os,J as Rs,K as Fs,L as Ln,M as On,N as Ks,O as Rn,h as It,P as Fn,Q as Kn,R as In,x as Is,S as Mn,T as zn,U as Vn}from"./agent-icon-BD4DM2Lv.js";import{i as Mt}from"./File02-g-xJPix_.js";import{c as Ms}from"./SwitchHorizontal01-hHr6GOmU.js";import{s as Un}from"./Plus-D2HOi_DD.js";import{i as zs}from"./SearchLg-DbX4T5E-.js";import{t as Vs}from"./Users01-BOsDT0Jv.js";import{f as Gn,e as Hn,b as Jn,A as Wn,a as Yn,d as qn,c as Qn,g as Xn}from"./alert-dialog-Bi9Cy1y8.js";import{S as Dt}from"./scroll-area-BqCCUXvj.js";import{T as Ie,a as Me,c as ze}from"./tooltip-BuKeolDX.js";import{S as $t,j as Zn,c as eo,g as Us,B as Lt,P as to,k as so,n as no,o as oo,u as Gs,l as lo,q as ao,R as io,s as Hs,r as ro,t as co,d as Js,v as uo,w as Ws,x as Ys,y as mo,M as fo,h as po,p as ho,z as go,A as xo,e as bo,f as yo,C as is,D as qs,i as vo,E as So}from"./runnable-block-editor-CCXhy-vO.js";import{r as Jt,S as ko,l as Wt,i as jo,m as Co,o as wo,n as Ct,v as No,R as Qs,G as Yt,g as Po,q as To,e as rs,t as _o,d as Eo,u as Do,w as cs,h as Ao,x as Bo,y as $o}from"./claim-phase-copy-0btUuJoC.js";import{u as Lo,P as Oo}from"./mustache-DtVu96DY.js";import{t as qt}from"./ChevronUp-D5_IWEtB.js";import{s as Xs}from"./Database01-RGlwXHSd.js";import{i as Zs}from"./Zap-DXNovEva.js";import{C as Ro,a as Fo,b as Ko}from"./collapsible-n44mVpiB.js";import{c as Io,d as Mo}from"./sandbox-lifecycle-context-DL9kkwoa.js";import{u as zo}from"./use-session-runtime-DU2zS-3V.js";import{c as Qt,d as Xt,e as Zt,b as es,D as ts,h as Vo}from"./dialog-DbzCN1O8.js";import{I as rt}from"./input-C7XH8Uj_.js";import{C as ss}from"./checkbox-Dkejdmst.js";import{L as Ot}from"./label-8juC5J-g.js";import{c as Uo,b as Go,a as Ho,d as Jo,S as Wo}from"./select-cIekAVlM.js";import{a as en,d as tn}from"./use-virtual-mcp-Bq1RMGPF.js";import{i as Nt}from"./ChevronRight-DNrwFBnC.js";import{i as ds}from"./Share07-CxuHcmnM.js";import{i as Yo}from"./Globe01-DIy8wXF6.js";import{c as qo,b as Qo,s as Xo}from"./TrendUp01-Bkdgpfn7.js";import{i as ns}from"./X-Bzh3NI3m.js";import"./rich-text-link-control-DgGIjR0I.js";import{M as Zo}from"./monaco-editor-BHu8MLvz.js";import{s as sn}from"./Trash01-C6bziN5X.js";import{d as bt,f as pt,D as zt,e as us,b as Vt,c as Ut,a as lt,g as Rt}from"./dropdown-menu-Dd8nakK9.js";import{a as el}from"./Copy01-DTHuBaTA.js";import{i as tl}from"./Tool01-DHi_Z7zo.js";import{b as ms}from"./use-project-scope-DRope0ob.js";import{E as sl}from"./empty-state-BIcQyeij.js";import{G as fs}from"./github-icon-BcrkxW36.js";import{R as nl}from"./repository-import-picker-C0YugeGx.js";import{b as ol}from"./thread-route-B1EuqJlg.js";function ll(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 al(t,e,n){return typeof t!="string"?null:ll(Jt(t,e),n)}function nn(t,e,n){if(!e||typeof t!="string")return!1;const o=al(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=je.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 il(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function rl(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 cl(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 dl(t,e,n){if(t===ko)return null;const o=ln(t);if(!o)return null;const{vendor:c,app:l}=o,i=an(c,l,n),r=Wt(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 ul(t,e,n){const o=e.__resolveType;if(typeof o!="string"||jo(t,e)||!Co(o))return null;const c=ln(o)??il(t);if(!c)return null;const l=Wt(o,n),{vendor:i,app:r}=c;return{id:At(i,r),app:r,vendor:i,title:l.title??wo(t,e,n),description:l.description??"",category:rl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function ml(t,e,n){const o=new Map;for(const l of t){const i=cl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=dl(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=ul(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(fl)}function fl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function pl(){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 hl(t,e,n){const o=je.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=As.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:pl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=Ds(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?ml(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 gl=["sections","apps","loaders","actions"];function xl(t){const e=je.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 h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const p=n==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==p?(f=s.jsx(Le,{id:"redirects",icon:Os,label:h,count:o.redirects,active:p,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=p,e[17]=f):f=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const g=n==="site";let v;e[20]!==l||e[21]!==g||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:On,label:y,active:g,onSelect:l}),e[20]=l,e[21]=g,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 C;e[26]!==l||e[27]!==S||e[28]!==k?(C=s.jsx(Le,{id:"seo",icon:Ks,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=C):C=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const U=n==="calendar";let T;e[32]!==l||e[33]!==w||e[34]!==U?(T=s.jsx(Le,{id:"calendar",icon:Rn,label:w,active:U,onSelect:l}),e[32]=l,e[33]=w,e[34]=U,e[35]=T):T=e[35];let j;e[36]!==n||e[37]!==o||e[38]!==l?(j=s.jsx(bl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=j):j=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(Rs,{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:Vs,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Fs,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:Ln,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 M;e[48]!==v||e[49]!==C||e[50]!==T||e[51]!==j||e[52]!==I||e[53]!==d||e[54]!==f?(M=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,f,v,C,T,j,I]}),e[48]=v,e[49]=C,e[50]=T,e[51]=j,e[52]=I,e[53]=d,e[54]=f,e[55]=M):M=e[55];let F;return e[56]!==a||e[57]!==M?(F=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,M]}),e[56]=a,e[57]=M,e[58]=F):F=e[58],F}function bl(t){const e=je.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=gl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=H.useState(!1),x=a||r;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=Ee("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"),h=s.jsx(Fn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let p;e[4]!==l?(p=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=p):p=e[5];let f;e[6]!==p?(f=s.jsx("span",{className:"flex-1 truncate",children:p}),e[6]=p,e[7]=f):f=e[7];const y=x&&"rotate-180";let g;e[8]!==y?(g=Ee("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(qt,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let S;e[12]!==f||e[13]!==v?(S=s.jsxs(Ro,{className:d,children:[h,f,v]}),e[12]=f,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 C=n==="sections";let w;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==C?(w=s.jsx(Le,{id:"sections",icon:It,label:k,count:o.sections,active:C,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=C,e[21]=w):w=e[21];let U;e[22]!==l?(U=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=U):U=e[23];const T=n==="apps";let j;e[24]!==o.apps||e[25]!==c||e[26]!==U||e[27]!==T?(j=s.jsx(Le,{id:"apps",icon:Ms,label:U,count:o.apps,active:T,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=U,e[27]=T,e[28]=j):j=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const M=n==="loaders";let F;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==M?(F=s.jsx(Le,{id:"loaders",icon:Xs,label:I,count:o.loaders,active:M,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=M,e[35]=F):F=e[35];let A;e[36]!==l?(A=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=A):A=e[37];const z=n==="actions";let K;e[38]!==o.actions||e[39]!==c||e[40]!==A||e[41]!==z?(K=s.jsx(Le,{id:"actions",icon:Zs,label:A,count:o.actions,active:z,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=A,e[41]=z,e[42]=K):K=e[42];let _;e[43]!==w||e[44]!==j||e[45]!==F||e[46]!==K?(_=s.jsxs(Fo,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,j,F,K]}),e[43]=w,e[44]=j,e[45]=F,e[46]=K,e[47]=_):_=e[47];let $;return e[48]!==x||e[49]!==_||e[50]!==S?($=s.jsxs(Ko,{open:x,onOpenChange:u,children:[S,_]}),e[48]=x,e[49]=_,e[50]=S,e[51]=$):$=e[51],$}function Le(t){const e=je.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 h;e[3]!==x||e[4]!==d?(h=Ee("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]=h):h=e[5];let p;e[6]!==o?(p=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=p):p=e[7];let f;e[8]!==c?(f=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=f):f=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:Ee("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 g;return e[13]!==u||e[14]!==h||e[15]!==p||e[16]!==f||e[17]!==y?(g=s.jsxs("button",{type:"button",onClick:u,className:h,children:[p,f,y]}),e[13]=u,e[14]=h,e[15]=p,e[16]=f,e[17]=y,e[18]=g):g=e[18],g}function yl(t){const e=je.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=Zn({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 vl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Sl(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&&!vl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function ps(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 kl(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 jl(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 Cl(t){const e=Us(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function wl(t,e){return eo(t,e)}const Nl=1e3;function Pl(t,e){for(let n=0;n<Nl;n++){const o=Us(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Tl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},_l={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},El={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Dl(t){const e=je.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,h=i===void 0?!1:i,p=Be(),[f,y]=H.useState(c),[g,v]=H.useState(l),[S,k]=H.useState(Lt),[C,w]=H.useState(null),[U,T]=H.useState(n);n!==U&&(T(n),n&&(y(c),v(l),k(Lt),w(null)));const j=o==="create"&&!!a?.length;let I;e[0]!==h||e[1]!==d?(I=me=>{!me&&!h&&(w(null),d(!1))},e[0]=h,e[1]=d,e[2]=I):I=e[2];const M=I;let F;e[3]!==h||e[4]!==f||e[5]!==x||e[6]!==g||e[7]!==j||e[8]!==S||e[9]!==u?(F=async me=>{me.preventDefault();const fe=f.trim(),be=g.trim();if(!fe||!be||h)return;const ne=No(be);if(ne){w(ne);return}const pe=u?.({name:fe,path:be});if(pe){w(pe);return}w(null),await x({name:fe,path:be,templateKey:j&&S!==Lt?S:null})},e[3]=h,e[4]=f,e[5]=x,e[6]=g,e[7]=j,e[8]=S,e[9]=u,e[10]=F):F=e[10];const A=F,z=C??r,K=Tl[o];let _;e[11]!==p||e[12]!==K?(_=p(K),e[11]=p,e[12]=K,e[13]=_):_=e[13];let $;e[14]!==_?($=s.jsx(Qt,{children:s.jsx(Xt,{children:_})}),e[14]=_,e[15]=$):$=e[15];let V;e[16]!==h||e[17]!==j||e[18]!==p||e[19]!==S||e[20]!==a?(V=j&&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:p("sandbox.pageFormDialog.labelTemplate")}),s.jsx(to,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:h})]}),e[16]=h,e[17]=j,e[18]=p,e[19]=S,e[20]=a,e[21]=V):V=e[21];let B;e[22]!==p?(B=p("sandbox.pageFormDialog.labelName"),e[22]=p,e[23]=B):B=e[23];let W;e[24]!==B?(W=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[24]=B,e[25]=W):W=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=me=>y(me.target.value),e[26]=X):X=e[26];let E;e[27]!==p?(E=p("sandbox.pageFormDialog.placeholderName"),e[27]=p,e[28]=E):E=e[28];let G;e[29]!==h||e[30]!==f||e[31]!==E?(G=s.jsx(rt,{id:"page-form-name",value:f,onChange:X,placeholder:E,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=E,e[32]=G):G=e[32];let Y;e[33]!==G||e[34]!==W?(Y=s.jsxs("div",{className:"space-y-1.5",children:[W,G]}),e[33]=G,e[34]=W,e[35]=Y):Y=e[35];let J;e[36]!==p?(J=p("sandbox.pageFormDialog.labelPath"),e[36]=p,e[37]=J):J=e[37];let L;e[38]!==J?(L=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:J}),e[38]=J,e[39]=L):L=e[39];let se;e[40]===Symbol.for("react.memo_cache_sentinel")?(se=me=>v(me.target.value),e[40]=se):se=e[40];let re;e[41]!==p?(re=p("sandbox.pageFormDialog.placeholderPath"),e[41]=p,e[42]=re):re=e[42];let le;e[43]!==h||e[44]!==g||e[45]!==re?(le=s.jsx(rt,{id:"page-form-path",value:g,onChange:se,placeholder:re,disabled:h}),e[43]=h,e[44]=g,e[45]=re,e[46]=le):le=e[46];let oe;e[47]!==L||e[48]!==le?(oe=s.jsxs("div",{className:"space-y-1.5",children:[L,le]}),e[47]=L,e[48]=le,e[49]=oe):oe=e[49];let ae;e[50]!==z?(ae=z&&s.jsx("p",{className:"text-xs text-destructive",children:z}),e[50]=z,e[51]=ae):ae=e[51];let ce;e[52]!==Y||e[53]!==oe||e[54]!==ae||e[55]!==V?(ce=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,oe,ae]}),e[52]=Y,e[53]=oe,e[54]=ae,e[55]=V,e[56]=ce):ce=e[56];let O;e[57]!==d?(O=()=>d(!1),e[57]=d,e[58]=O):O=e[58];let te;e[59]!==p?(te=p("sandbox.pageFormDialog.buttonCancel"),e[59]=p,e[60]=te):te=e[60];let Z;e[61]!==h||e[62]!==O||e[63]!==te?(Z=s.jsx(Oe,{type:"button",variant:"outline",onClick:O,disabled:h,children:te}),e[61]=h,e[62]=O,e[63]=te,e[64]=Z):Z=e[64];let ee;e[65]!==h||e[66]!==f||e[67]!==g?(ee=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=ee):ee=e[68];let ie;e[69]!==h||e[70]!==o||e[71]!==p?(ie=h?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),p(El[o])]}):p(_l[o]),e[69]=h,e[70]=o,e[71]=p,e[72]=ie):ie=e[72];let R;e[73]!==ee||e[74]!==ie?(R=s.jsx(Oe,{type:"submit",disabled:ee,children:ie}),e[73]=ee,e[74]=ie,e[75]=R):R=e[75];let ge;e[76]!==Z||e[77]!==R?(ge=s.jsxs(Zt,{children:[Z,R]}),e[76]=Z,e[77]=R,e[78]=ge):ge=e[78];let D;e[79]!==A||e[80]!==ce||e[81]!==ge||e[82]!==$?(D=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:A,children:[$,ce,ge]})}),e[79]=A,e[80]=ce,e[81]=ge,e[82]=$,e[83]=D):D=e[83];let xe;return e[84]!==M||e[85]!==n||e[86]!==D?(xe=s.jsx(ts,{open:n,onOpenChange:M,children:D}),e[84]=M,e[85]=n,e[86]=D,e[87]=xe):xe=e[87],xe}const Al=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],hs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Bl(t){const e=je.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=H.useState(hs),[d,h]=H.useState(null),[p,f]=H.useState(n);n!==p&&(f(n),n&&(x(hs),h(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=he=>x(Te=>({...Te,...he})),e[0]=y):y=e[0];const g=y;let v;e[1]!==r||e[2]!==i?(v=he=>{!he&&!r&&(h(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 he=>{he.preventDefault();const Te=u.from.trim(),$e=u.to.trim();if(!Te||!$e||r){h(a("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...u,from:Te,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const C=k,w=d??c;let U;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(U=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=U):U=e[12];const T=U;let j;e[13]!==a?(j=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=j):j=e[14];let I;e[15]!==j?(I=s.jsx(Qt,{children:s.jsx(Xt,{children:j})}),e[15]=j,e[16]=I):I=e[16];let M;e[17]!==a?(M=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=M):M=e[18];let F;e[19]!==M?(F=s.jsx(Ot,{htmlFor:"redirect-form-from",children:M}),e[19]=M,e[20]=F):F=e[20];const A=u.from;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=he=>g({from:he.target.value}),e[21]=z):z=e[21];let K;e[22]!==a?(K=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=K):K=e[23];let _;e[24]!==r||e[25]!==u.from||e[26]!==K?(_=s.jsx(rt,{id:"redirect-form-from",value:A,onChange:z,placeholder:K,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=K,e[27]=_):_=e[27];let $;e[28]!==_||e[29]!==F?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[28]=_,e[29]=F,e[30]=$):$=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let B;e[33]!==V?(B=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=B):B=e[34];const W=u.to;let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=he=>g({to:he.target.value}),e[35]=X):X=e[35];let E;e[36]!==a?(E=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=E):E=e[37];let G;e[38]!==r||e[39]!==u.to||e[40]!==E?(G=s.jsx(rt,{id:"redirect-form-to",value:W,onChange:X,placeholder:E,disabled:r}),e[38]=r,e[39]=u.to,e[40]=E,e[41]=G):G=e[41];let Y;e[42]!==B||e[43]!==G?(Y=s.jsxs("div",{className:"space-y-1.5",children:[B,G]}),e[42]=B,e[43]=G,e[44]=Y):Y=e[44];let J;e[45]!==a?(J=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=J):J=e[46];let L;e[47]!==J?(L=s.jsx(Ot,{htmlFor:"redirect-form-type",children:J}),e[47]=J,e[48]=L):L=e[48];const se=u.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=he=>g({type:he}),e[49]=re):re=e[49];let le;e[50]!==a?(le=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=le):le=e[51];let oe;e[52]!==le?(oe=s.jsx(Go,{id:"redirect-form-type",className:"w-full",children:s.jsx(Ho,{placeholder:le})}),e[52]=le,e[53]=oe):oe=e[53];let ae;e[54]!==a?(ae=Al.map(he=>s.jsx(Uo,{value:he.value,children:a(he.labelKey,{status:Qs[he.value]})},he.value)),e[54]=a,e[55]=ae):ae=e[55];let ce;e[56]!==ae?(ce=s.jsx(Jo,{children:ae}),e[56]=ae,e[57]=ce):ce=e[57];let O;e[58]!==r||e[59]!==u.type||e[60]!==oe||e[61]!==ce?(O=s.jsxs(Wo,{value:se,onValueChange:re,disabled:r,children:[oe,ce]}),e[58]=r,e[59]=u.type,e[60]=oe,e[61]=ce,e[62]=O):O=e[62];let te;e[63]!==L||e[64]!==O?(te=s.jsxs("div",{className:"space-y-1.5",children:[L,O]}),e[63]=L,e[64]=O,e[65]=te):te=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=he=>g({discardQueryParameters:he===!0}),e[66]=Z):Z=e[66];let ee;e[67]!==r||e[68]!==u.discardQueryParameters?(ee=s.jsx(ss,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:Z}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ee):ee=e[69];let ie;e[70]!==a?(ie=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ie):ie=e[71];let R;e[72]!==ie?(R=s.jsx("span",{className:"text-sm",children:ie}),e[72]=ie,e[73]=R):R=e[73];let ge;e[74]!==ee||e[75]!==R?(ge=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ee,R]}),e[74]=ee,e[75]=R,e[76]=ge):ge=e[76];let D;e[77]!==w?(D=w&&s.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=D):D=e[78];let xe;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==ge||e[83]!==D?(xe=s.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,ge,D]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=ge,e[83]=D,e[84]=xe):xe=e[84];let me;e[85]!==i?(me=()=>i(!1),e[85]=i,e[86]=me):me=e[86];let fe;e[87]!==a?(fe=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=fe):fe=e[88];let be;e[89]!==r||e[90]!==me||e[91]!==fe?(be=s.jsx(Oe,{type:"button",variant:"outline",onClick:me,disabled:r,children:fe}),e[89]=r,e[90]=me,e[91]=fe,e[92]=be):be=e[92];const ne=!T;let pe;e[93]!==r||e[94]!==a?(pe=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]=pe):pe=e[95];let Ce;e[96]!==ne||e[97]!==pe?(Ce=s.jsx(Oe,{type:"submit",disabled:ne,children:pe}),e[96]=ne,e[97]=pe,e[98]=Ce):Ce=e[98];let we;e[99]!==be||e[100]!==Ce?(we=s.jsxs(Zt,{children:[be,Ce]}),e[99]=be,e[100]=Ce,e[101]=we):we=e[101];let Ne;e[102]!==C||e[103]!==xe||e[104]!==we||e[105]!==I?(Ne=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[I,xe,we]})}),e[102]=C,e[103]=xe,e[104]=we,e[105]=I,e[106]=Ne):Ne=e[106];let Se;return e[107]!==S||e[108]!==n||e[109]!==Ne?(Se=s.jsx(ts,{open:n,onOpenChange:S,children:Ne}),e[107]=S,e[108]=n,e[109]=Ne,e[110]=Se):Se=e[110],Se}function $l(t){const e=je.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]=H.useState(c),[h,p]=H.useState(n);n!==h&&(p(n),n&&d(c));let f;e[0]!==a||e[1]!==r?(f=se=>{!se&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=f):f=e[2];const y=f;let g;e[3]!==a||e[4]!==x||e[5]!==i?(g=async se=>{se.preventDefault();const re=x.trim();!re||a||await i(re)},e[3]=a,e[4]=x,e[5]=i,e[6]=g):g=e[6];const v=g;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(Xt,{children:S}),e[9]=S,e[10]=k):k=e[10];let C;e[11]!==u?(C=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=C):C=e[12];let w;e[13]!==C?(w=s.jsx(Vo,{children:C}),e[13]=C,e[14]=w):w=e[14];let U;e[15]!==k||e[16]!==w?(U=s.jsxs(Qt,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=U):U=e[17];let T;e[18]!==u?(T=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=T):T=e[19];let j;e[20]!==T?(j=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:T}),e[20]=T,e[21]=j):j=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=se=>d(se.target.value),e[22]=I):I=e[22];let M;e[23]!==a||e[24]!==x?(M=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=M):M=e[25];let F;e[26]!==j||e[27]!==M?(F=s.jsxs("div",{className:"space-y-1.5",children:[j,M]}),e[26]=j,e[27]=M,e[28]=F):F=e[28];let A;e[29]!==u?(A=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=A):A=e[30];let z;e[31]!==A?(z=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[31]=A,e[32]=z):z=e[32];let K;e[33]!==o?(K=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=K):K=e[34];let _;e[35]!==z||e[36]!==K?(_=s.jsxs("div",{className:"space-y-1.5",children:[z,K]}),e[35]=z,e[36]=K,e[37]=_):_=e[37];let $;e[38]!==F||e[39]!==_?($=s.jsxs("div",{className:"space-y-4 py-4",children:[F,_]}),e[38]=F,e[39]=_,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let B;e[43]!==u?(B=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=B):B=e[44];let W;e[45]!==a||e[46]!==V||e[47]!==B?(W=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:B}),e[45]=a,e[46]=V,e[47]=B,e[48]=W):W=e[48];let X;e[49]!==a||e[50]!==x?(X=!x.trim()||a,e[49]=a,e[50]=x,e[51]=X):X=e[51];let E;e[52]!==a||e[53]!==u?(E=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]=E):E=e[54];let G;e[55]!==X||e[56]!==E?(G=s.jsx(Oe,{type:"submit",disabled:X,children:E}),e[55]=X,e[56]=E,e[57]=G):G=e[57];let Y;e[58]!==W||e[59]!==G?(Y=s.jsxs(Zt,{children:[W,G]}),e[58]=W,e[59]=G,e[60]=Y):Y=e[60];let J;e[61]!==v||e[62]!==$||e[63]!==Y||e[64]!==U?(J=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[U,$,Y]})}),e[61]=v,e[62]=$,e[63]=Y,e[64]=U,e[65]=J):J=e[65];let L;return e[66]!==y||e[67]!==n||e[68]!==J?(L=s.jsx(ts,{open:n,onOpenChange:y,children:J}),e[66]=y,e[67]=n,e[68]=J,e[69]=L):L=e[69],L}function Ll(t){const e=je.c(7),{type:n}=t,o=Qs[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"},os=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return os.includes(t)}const ls={posts:"post",authors:"author",categories:"category"},rn={posts:Ft.post,authors:Ft.author,categories:Ft.category},Ol=Object.fromEntries(Object.entries(rn).map(([t,e])=>[e,t]));function Rl(t){return typeof t=="string"?Ol[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pe(t){return typeof t=="string"?t:""}function Fl(t,e){switch(t){case"posts":return{label:Pe(e.title)||"Untitled post",subtitle:Pe(e.slug)};case"authors":return{label:Pe(e.name)||"Unnamed author",subtitle:Pe(e.email)};case"categories":return{label:Pe(e.name)||"Unnamed category",subtitle:Pe(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=Rl(c.__resolveType);if(!l)continue;const i=Je(c[ls[l]])??{},{label:r,subtitle:a}=Fl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of os)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Kl(t,e){return cn(t)[e]}function vt(t,e){return Kl(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const gs=Object.freeze({});function xt(t,e){return t?Je(t[ls[e]])??gs:gs}function it(t,e,n){return{name:t,__resolveType:rn[e],[ls[e]]:n}}function Yi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:Pe(Je(h)?.[n]),i=h=>typeof h=="string"?h:Pe(Je(h)?.name),r=h=>{const p=l(h),f=p?t.find(({payload:g})=>Pe(g[n])===p):void 0;if(f)return f;const y=i(h);return y?t.find(({payload:g})=>Pe(g.name)===y):void 0},a=t.map(({key:h,payload:p})=>({value:h,label:Pe(p.name)||Pe(p[n])||h})),u=new Map,x=[];return c.forEach((h,p)=>{const f=r(h);if(f){x.includes(f.key)||x.push(f.key);return}const y=`unresolved:${p}`;u.set(y,h),x.push(y),a.push({value:y,label:i(h)||l(h)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:h=>h.map(p=>{const f=t.find(y=>y.key===p);return f?o(f.payload):u.get(p)}).filter(p=>p!==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?Pe(e.slug):""}function Il(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.email):""}function dn(t){const e=[];return Pe(t.title).trim()||e.push("Title"),Pe(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Pe(t.excerpt).trim()||e.push("Excerpt"),Pe(t.image).trim()||e.push("Cover image"),e}const un=8;function mn(t){const e=Pe(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function qi(t,e){return e!=="published"||mn(t)==="published"?!1:dn(t).length>0}function Ml(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,un).toISOString()}function Qi(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Pe(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Ml(n):o}}function fn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Pe(n.title)||"Untitled post",slug:Pe(n.slug),date:Pe(n.date),scheduledDatetime:Pe(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Il).filter(Boolean),missing:dn(n),status:mn(n)}))}function zl(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 Vl(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 Xi(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 Ul(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function xs(t){return{...t,dateModified:new Date().toISOString()}}function Gt(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}/${Gt(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-${Gt(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-${Gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Gl={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"}},bs="Box";function Hl(t){return t.startsWith("site/")?"site":"app"}function Jl(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 Zi(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(!ql(l)||e.has(l))continue;e.add(l);const i=Wt(l,t),r=Wl(l),a=Gl[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),h=u==="site"?i.icon:void 0,p=h&&Jl(h)?h:void 0,f=p!==void 0?a?.iconName??bs:ht(h,a?.iconName)??bs;n.push({resolveType:l,title:x,description:d,iconName:f,iconUrl:p,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Wl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const Yl=["blog/sections/blocks/","site/sections/Blog/Post/"];function ql(t){return Yl.some(e=>t.startsWith(e))}const er=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tr=["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 sr(t){return new Date(t.getFullYear(),t.getMonth(),1)}function nr(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 Ht(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 ys(t,e){return Ht(t,e)+Ql(t)}function or(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 lr(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 h=x.getTime()<n.getTime()?n:x,p=d.getTime()>=o.getTime()?Pt(o,-1):d,f=Ht(h,n),y=Ht(p,h)+1;if(y<=0)continue;const g=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=ys(new Date(g),n),k=Math.max(ys(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:f,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 Xl(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),un);return{...pn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Tt(t)}}function Zl(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 ea(t,e){const n=Zl(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 ta(t){return _t(t.scheduledDatetime)??_t(t.date)}function ar(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:_t(c.scheduledDatetime)!==null},i=ta(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 sa="0.161.0",na="0.162.0",ir="deno task update";function vs(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function Ss(t,e){const n=vs(t),o=vs(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 oa(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 la(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 aa(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=oa(t.denoJson)??la(t.meta);return!e||Ss(e,sa)<0?{kind:"outdated",version:e}:Ss(e,na)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function rr(t){return t.kind==="publish-only"||t.kind==="full"}function cr(t){return t.kind==="full"}function ia(t){const e=je.c(16),n=en(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=so(t.virtualMcpId),c=Et()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=As.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 h=await no({...t,threadId:c},oo(o,"deno.json"));return h.kind==="data"?h.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}=Ds(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=aa({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=je.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:h,invalid:p,invalidReason:f,onToggleSelect:y,onClick:g,menu:v}=t,S=Be(),k=r==="global";let C;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(C=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:Ee("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:Ee("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Yt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=C):C=e[5];const w=C,U=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 T;e[6]!==U?(T=Ee("group relative flex min-w-0 items-center rounded-md transition-colors",U),e[6]=U,e[7]=T):T=e[7];let j;e[8]!==y||e[9]!==x||e[10]!==h||e[11]!==d||e[12]!==S||e[13]!==c?(j=x&&s.jsx("span",{className:Ee("flex shrink-0 items-center pl-2.5 transition-opacity",h||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ra,children:s.jsx(ss,{checked:h,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=h,e[11]=d,e[12]=S,e[13]=c,e[14]=j):j=e[14];const I=p&&!i&&"text-destructive";let M;e[15]!==I?(M=Ee("block truncate text-sm font-medium",I),e[15]=I,e[16]=M):M=e[16];let F;e[17]!==M||e[18]!==c?(F=s.jsx("span",{className:M,children:c}),e[17]=M,e[18]=c,e[19]=F):F=e[19];const A=i?"text-accent-foreground/70":"text-muted-foreground";let z;e[20]!==A?(z=Ee("block truncate text-xs",A),e[20]=A,e[21]=z):z=e[21];let K;e[22]!==l||e[23]!==z?(K=s.jsx("span",{className:z,children:l}),e[22]=l,e[23]=z,e[24]=K):K=e[24];let _;e[25]!==K||e[26]!==F?(_=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[25]=K,e[26]=F,e[27]=_):_=e[27];let $;e[28]!==i||e[29]!==p||e[30]!==f?($=p&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:Ee("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Ls,{size:14})})}),f&&s.jsx(Me,{side:"bottom",children:f})]}),e[28]=i,e[29]=p,e[30]=f,e[31]=$):$=e[31];let V;e[32]!==g||e[33]!==w||e[34]!==_||e[35]!==$||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left cursor-pointer",children:[w,_,$,u]}),e[32]=g,e[33]=w,e[34]=_,e[35]=$,e[36]=u,e[37]=V):V=e[37];let B;e[38]!==i||e[39]!==v?(B=v&&s.jsx("div",{className:Ee("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=B):B=e[40];let W;return e[41]!==V||e[42]!==B||e[43]!==T||e[44]!==j?(W=s.jsxs("div",{className:T,children:[j,V,B]}),e[41]=V,e[42]=B,e[43]=T,e[44]=j,e[45]=W):W=e[45],W}function ra(t){return t.stopPropagation()}function He(t){const e=je.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 ca={loaders:Xs,actions:Zs},da={loaders:"Loaders",actions:"Actions"},ua={analytics:Qo,blog:Rs,commerce:qo,site:Kn,website:Yo};function ma(t,e){return e===0?ua[t.toLowerCase()]??ds:ds}function kt(t,e){return e===0?co(t):t}function fa(t){const e=je.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,h]=H.useState(x),[p,f]=H.useState(null),[y,g]=H.useState(""),[v,S]=H.useState(Sa),[k,C]=H.useState(a);k!==a&&(C(a),h([]),f(null),g(""),S(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{S(L=>{const se=new Set(L);return se.has(J)?se.delete(J):se.add(J),se})},e[1]=w):w=e[1];const U=w;let T;e[2]!==c||e[3]!==n||e[4]!==o?(T={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=T):T=e[5];const j=Gs(T);let I;e[6]!==j?(I=Js((J,L)=>j.mutate({blockKey:J,data:L})),e[6]=j,e[7]=I):I=e[7];const M=I;let F;e[8]!==a?(F=uo(a),e[8]=a,e[9]=F):F=e[9];const A=F,z=ca[a];let K,_,$,V,B,W,X;if(e[10]!==z||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]!==j||e[20]!==M||e[21]!==y||e[22]!==p||e[23]!==A||e[24]!==u||e[25]!==o){$=Symbol.for("react.early_return_sentinel");e:{const J=[...lo(i,r,a).map(va),...ao(i,a).map(ya)],L=y.trim().toLowerCase(),se=L.length>0,re=se?J.filter(N=>N.title.toLowerCase().includes(L)||N.resolveType.toLowerCase().includes(L)):[],le=new Map,oe=[],ae=new Map;if(!se){for(const N of J){const de=N.folderPath;if(!(de.length<d.length)&&d.every((ye,De)=>de[De]===ye))if(de.length===d.length)if(N.savedKey!==void 0){const ye=ae.get(N.resolveType);ye?ye.push(N):ae.set(N.resolveType,[N])}else oe.push(N);else{const ye=de[d.length],De=le.get(ye)??{count:0,savedCount:0};N.savedKey!==void 0?De.savedCount=De.savedCount+1:De.count=De.count+1,le.set(ye,De)}}oe.sort(ba);for(const N of ae.values())N.sort(xa)}const ce=[...ae.entries()].filter(N=>{const[de]=N;return!oe.some(ye=>ye.resolveType===de)}).flatMap(ga).sort(ha);let O;e[33]!==d?(O=(N,de)=>kt(N.name,d.length).localeCompare(kt(de.name,d.length)),e[33]=d,e[34]=O):O=e[34];const te=[...le.entries()].map(pa).sort(O);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=N=>{f(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=Z):Z=e[35];const ee=Z;let ie;e[36]!==j||e[37]!==A||e[38]!==u?(ie=async(N,de)=>{await j.mutateAsync({blockKey:N,data:de}),ve.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:A,blockId:N})),f({mode:"saved",key:N})},e[36]=j,e[37]=A,e[38]=u,e[39]=ie):ie=e[39];const R=ie;let ge;e[40]!==r||e[41]!==p?(ge=ka(p,r),e[40]=r,e[41]=p,e[42]=ge):ge=e[42];const D=ge;if(D){const N=`${D.mode}:${D.mode==="saved"?D.blockKey:D.resolveType}`;let de;e[43]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[43]=de):de=e[43];let ye;e[44]!==c||e[45]!==r||e[46]!==R||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==j.isPending||e[52]!==M||e[53]!==N||e[54]!==D.editorTarget||e[55]!==D.initialValue||e[56]!==o?(ye=s.jsx(io,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:D.editorTarget,initialValue:D.initialValue,isCreating:j.isPending,onCreate:R,onSaveReferencedBlock:M,onBack:de},N),e[44]=c,e[45]=r,e[46]=R,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=j.isPending,e[52]=M,e[53]=N,e[54]=D.editorTarget,e[55]=D.initialValue,e[56]=o,e[57]=ye):ye=e[57],$=ye;break e}X="flex h-full w-full min-w-0 flex-col";let xe;e[58]!==u?(xe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=xe):xe=e[59];let me;e[60]===Symbol.for("react.memo_cache_sentinel")?(me=()=>h([]),e[60]=me):me=e[60];const fe=d.length===0?"font-medium text-foreground":"text-muted-foreground";let be;e[61]!==fe?(be=Ee("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",fe),e[61]=fe,e[62]=be):be=e[62];const ne=da[a];let pe;e[63]!==be||e[64]!==ne?(pe=s.jsx("button",{type:"button",onClick:me,className:be,children:ne}),e[63]=be,e[64]=ne,e[65]=pe):pe=e[65];let Ce;e[66]!==d?(Ce=d.map((N,de)=>{const ye=de===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:()=>h(d.slice(0,de+1)),className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ye?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,de)})]},`${N}-${de}`)}),e[66]=d,e[67]=Ce):Ce=e[67];let we;e[68]!==xe||e[69]!==pe||e[70]!==Ce?(we=s.jsxs("nav",{"aria-label":xe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[pe,Ce]}),e[68]=xe,e[69]=pe,e[70]=Ce,e[71]=we):we=e[71];let Ne;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(zs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ne):Ne=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=N=>g(N.target.value),e[73]=Se):Se=e[73];let he;e[74]!==a||e[75]!==u?(he=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=he):he=e[76];let Te;e[77]!==a||e[78]!==u?(Te=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=Te):Te=e[79];let $e;e[80]!==y||e[81]!==he||e[82]!==Te?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ne,s.jsx("input",{type:"text",value:y,onChange:Se,placeholder:he,"aria-label":Te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=he,e[82]=Te,e[83]=$e):$e=e[83],e[84]!==we||e[85]!==$e?(_=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,$e]}),e[84]=we,e[85]=$e,e[86]=_):_=e[86],K=Dt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",B=se?re.length===0?s.jsx(He,{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:re.map(N=>s.jsx(Re,{icon:z,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey??N.resolveType))}):te.length===0&&oe.length===0&&ce.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[te.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(N=>{const de=ma(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>h([...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(de,{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:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(oe.length>0||ce.length>0)&&s.jsxs("div",{className:Ee("flex flex-col gap-1",te.length>0&&"mt-4"),children:[oe.map(N=>{const de=ae.get(N.resolveType)??[],ye=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:z,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)}),de.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>U(N.resolveType),"aria-expanded":ye,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:Yt},children:[ye?s.jsx(qt,{size:12,className:"shrink-0"}):s.jsx(Nt,{size:12,className:"shrink-0"}),u(ye?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",de.length,")"]}),ye&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:de.map(De=>s.jsx(Re,{icon:z,accent:"global",title:De.title,subtitle:De.resolveType,active:!1,onClick:()=>ee(De)},De.savedKey))})]})]},N.resolveType)}),ce.map(N=>s.jsx(Re,{icon:z,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey))]})]})}e[10]=z,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]=j,e[20]=M,e[21]=y,e[22]=p,e[23]=A,e[24]=u,e[25]=o,e[26]=K,e[27]=_,e[28]=$,e[29]=V,e[30]=B,e[31]=W,e[32]=X}else K=e[26],_=e[27],$=e[28],V=e[29],B=e[30],W=e[31],X=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let E;e[87]!==V||e[88]!==B?(E=s.jsx("div",{className:V,children:B}),e[87]=V,e[88]=B,e[89]=E):E=e[89];let G;e[90]!==K||e[91]!==E||e[92]!==W?(G=s.jsx(K,{className:W,children:E}),e[90]=K,e[91]=E,e[92]=W,e[93]=G):G=e[93];let Y;return e[94]!==_||e[95]!==G||e[96]!==X?(Y=s.jsxs("div",{className:X,children:[_,G]}),e[94]=_,e[95]=G,e[96]=X,e[97]=Y):Y=e[97],Y}function pa(t){const[e,n]=t;return{name:e,...n}}function ha(t,e){return t.title.localeCompare(e.title)}function ga(t){const[,e]=t;return e}function xa(t,e){return t.title.localeCompare(e.title)}function ba(t,e){return t.title.localeCompare(e.title)}function ya(t){return{resolveType:t.resolveType,title:t.title,folderPath:Hs(t.resolveType)}}function va(t){return{resolveType:t.resolveType,title:t.title,folderPath:Hs(t.resolveType),savedKey:t.key}}function Sa(){return new Set}function ka(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}=ro(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function ja(t){const e=je.c(106),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:h,onSaveReferencedBlock:p}=t,f=Be(),y=Et(),g=y?.virtualMcpId,S=tn(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[C,w]=H.useState(k);let U;e[1]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[1]=U):U=e[1];const[T,j]=H.useState(U),[I,M]=H.useState(0),[F,A]=H.useState(!1);let z;e[2]!==i||e[3]!==a?(z=Jt(a,i),e[2]=i,e[3]=a,e[4]=z):z=e[4];const K=z;let _,$,V,B,W,X,E,G;if(e[5]!==S||e[6]!==c||e[7]!==r||e[8]!==T||e[9]!==C||e[10]!==d||e[11]!==h||e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==f||e[16]!==y?.taskId||e[17]!==u||e[18]!==o){const oe=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,ae=y?.taskId??null,ce=l??void 0;let O;e[27]!==S||e[28]!==c||e[29]!==n||e[30]!==ce||e[31]!==ae||e[32]!==o?(O={orgSlug:n,virtualMcpId:o,branch:c,threadId:ae,previewUrl:ce,siteSlug:S},e[27]=S,e[28]=c,e[29]=n,e[30]=ce,e[31]=ae,e[32]=o,e[33]=O):O=e[33],$=O;let te,Z,ee,ie;if(e[34]!==r||e[35]!==T||e[36]!==C||e[37]!==h||e[38]!==f||e[39]!==u){const pe=[u,...T],Ce=Ne=>{j(T.slice(0,Ne)),M(Ca)};let we;e[48]!==r||e[49]!==C||e[50]!==h?(we=async Ne=>{const Se=mo(Ne,r);if(Se){ve.error(Se);return}await h(Ne,C),A(!1)},e[48]=r,e[49]=C,e[50]=h,e[51]=we):we=e[51],_=we,G="flex h-full w-full min-w-0",E="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ie="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(te=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=te):te=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ee=pe.map((Ne,Se)=>{const he=Se===pe.length-1,Te=Ws(Ne);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Se>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Se),title:Te,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",he?"font-medium text-foreground":"text-muted-foreground"),children:Te})]},`${Te}-${Se}`)}),e[34]=r,e[35]=T,e[36]=C,e[37]=h,e[38]=f,e[39]=u,e[40]=_,e[41]=te,e[42]=Z,e[43]=ee,e[44]=ie,e[45]=W,e[46]=E,e[47]=G}else _=e[40],te=e[41],Z=e[42],ee=e[43],ie=e[44],W=e[45],E=e[46],G=e[47];let R;e[54]!==te||e[55]!==Z||e[56]!==ee?(R=s.jsx("nav",{"aria-label":te,className:Z,children:ee}),e[54]=te,e[55]=Z,e[56]=ee,e[57]=R):R=e[57];let ge;e[58]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>A(!0),e[58]=ge):ge=e[58];let D;e[59]!==f?(D=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=D):D=e[60];let xe;e[61]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(In,{size:14}),e[61]=xe):xe=e[61];let me;e[62]!==d||e[63]!==D?(me=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ge,"aria-label":D,children:xe})}),e[62]=d,e[63]=D,e[64]=me):me=e[64];let fe;e[65]!==f?(fe=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=fe):fe=e[66];let be;e[67]!==fe?(be=s.jsx(Me,{side:"bottom",children:fe}),e[67]=fe,e[68]=be):be=e[68];let ne;e[69]!==me||e[70]!==be?(ne=s.jsxs(ze,{children:[me,be]}),e[69]=me,e[70]=be,e[71]=ne):ne=e[71],e[72]!==ie||e[73]!==R||e[74]!==ne?(X=s.jsxs("div",{className:ie,children:[R,ne]}),e[72]=ie,e[73]=R,e[74]=ne,e[75]=X):X=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",B=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:oe}),e[5]=S,e[6]=c,e[7]=r,e[8]=T,e[9]=C,e[10]=d,e[11]=h,e[12]=n,e[13]=l,e[14]=a,e[15]=f,e[16]=y?.taskId,e[17]=u,e[18]=o,e[19]=_,e[20]=$,e[21]=V,e[22]=B,e[23]=W,e[24]=X,e[25]=E,e[26]=G}else _=e[19],$=e[20],V=e[21],B=e[22],W=e[23],X=e[24],E=e[25],G=e[26];let Y;e[76]!==V||e[77]!==B?(Y=s.jsx("p",{className:V,children:B}),e[76]=V,e[77]=B,e[78]=Y):Y=e[78];let J;e[79]!==Y||e[80]!==W||e[81]!==X?(J=s.jsxs("div",{className:W,children:[X,Y]}),e[79]=Y,e[80]=W,e[81]=X,e[82]=J):J=e[82];let L;e[83]!==r||e[84]!==T||e[85]!==I||e[86]!==C||e[87]!==i||e[88]!==p||e[89]!==$||e[90]!==K||e[91]!==f?(L=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:K?s.jsx(Ys,{schema:K,value:C,onChange:oe=>w(oe),basePath:"",breadcrumbPath:T,onBreadcrumbChange:j,meta:i,decofile:r,onSaveReferencedBlock:p,sandbox:$},I):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=T,e[85]=I,e[86]=C,e[87]=i,e[88]=p,e[89]=$,e[90]=K,e[91]=f,e[92]=L):L=e[92];let se;e[93]!==J||e[94]!==L||e[95]!==E?(se=s.jsxs("div",{className:E,children:[J,L]}),e[93]=J,e[94]=L,e[95]=E,e[96]=se):se=e[96];let re;e[97]!==x||e[98]!==_||e[99]!==d||e[100]!==F?(re=s.jsx(fo,{open:F,onOpenChange:A,defaultBlockId:x,isPending:d,onSubmit:_}),e[97]=x,e[98]=_,e[99]=d,e[100]=F,e[101]=re):re=e[101];let le;return e[102]!==se||e[103]!==re||e[104]!==G?(le=s.jsxs("div",{className:G,children:[se,re]}),e[102]=se,e[103]=re,e[104]=G,e[105]=le):le=e[105],le}function Ca(t){return t+1}function wa(t,e){const n={__resolveType:t},o=ho([n],e)[0];return o?go(n,o,e):null}function Na({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=Et(),x=u?.virtualMcpId,h=tn(x===e?e:null)?.metadata?.siteSlug??null,[p]=H.useState(()=>wa(i,l)),[f,y]=H.useState(p?.data??{}),[g,v]=H.useState([]),[S,k]=H.useState(0),[C,w]=H.useState(!1),[U,T]=H.useState(null),j=U!==null,{save:I,flush:M}=po({orgSlug:t,virtualMcpId:e,branch:n}),F=p?.resolveType?Jt(p.resolveType,c):null,A=l[i],z=A?Po(i,A):i,K=u?.taskId??null,_={orgSlug:t,virtualMcpId:e,branch:n,threadId:K,previewUrl:o??void 0,siteSlug:h},$=E=>{y(E),I(i,E)},V=()=>{j?(T(null),w(!1),k(E=>E+1)):T(JSON.stringify(f,null,2))},B=E=>{const G=E??"";try{const Y=JSON.parse(G);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),$(Y);return}w(!0)}catch{w(!0)}},W=[z,...g],X=E=>{v(g.slice(0,E)),k(G=>G+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:Yt},"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:W.map((E,G)=>{const Y=G===W.length-1,J=Ws(E);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[G>0&&s.jsx(Nt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>X(G),title:J,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",Y?"font-medium text-foreground":"text-muted-foreground"),children:J})]},`${J}-${G}`)})}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:j?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":j,children:j?s.jsx(ns,{size:14}):s.jsx(Is,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(j?"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:F?s.jsx(Ys,{schema:F,value:f,onChange:E=>$(E),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:_},S):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),U!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[C&&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(Zo,{language:"json",height:"100%",code:U,onChange:B,onSave:E=>{B(E),M()}})})]})]})]})})}function Pa(t){const e=je.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,h=Be();if(!n){let y;e[0]!==h?(y=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=y):y=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==y||e[5]!==g?(v=s.jsx(He,{title:y,description:g}),e[4]=y,e[5]=g,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,g=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=xo(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(w,U)=>x(n.resolveType,w,U),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let C;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?(C=s.jsx(ja,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:g,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]=C):C=e[25],C}const p=`saved:${n.key}`;let f;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]!==p||e[34]!==c?(f=s.jsx(Na,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},p),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=p,e[34]=c,e[35]=f):f=e[35],f}const ks="__all__",js={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},Ta={"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"},Cs="status:";function ws(t){if(!t.startsWith(Cs))return null;const e=t.slice(Cs.length);return e in wt?e:null}const Ns=H.forwardRef(function(e,n){const o=je.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=Ee("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 h;o[11]!==a?(h=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=h):h=o[12];let p;o[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qt,{size:12,className:"shrink-0 opacity-60"}),o[13]=p):p=o[13];let f;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==h?(f=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,h,p]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=h,o[19]=f):f=o[19],f});function as(t){const e=je.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 _a(t){const e=je.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:h}=t,p=Be();let f;if(e[0]!==n||e[1]!==l){let D;e[3]!==l?(D=xe=>xe.slug===l,e[3]=l,e[4]=D):D=e[4],f=n.find(D),e[0]=n,e[1]=l,e[2]=f}else f=e[2];const y=f;let g;if(e[5]!==i||e[6]!==o){let D;e[8]!==i?(D=xe=>xe.email===i,e[8]=i,e[9]=D):D=e[9],g=o.find(D),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==p?(k=y?.name??v?.name??p(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=p,e[14]=k):k=e[14];const C=k,w=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:ks;let U;e[15]!==x||e[16]!==u||e[17]!==d?(U=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=U):U=e[18];const T=U;let j;e[19]!==T||e[20]!==x||e[21]!==u||e[22]!==d?(j=D=>{D.startsWith("cat:")?(x(null),d(null),u(D.slice(4))):D.startsWith("author:")?(u(null),d(null),x(D.slice(7))):ws(D)?(u(null),x(null),d(ws(D))):T()},e[19]=T,e[20]=x,e[21]=u,e[22]=d,e[23]=j):j=e[23];const I=j;let M;e[24]!==C||e[25]!==S?(M=s.jsx(zt,{asChild:!0,children:s.jsx(Ns,{icon:Mn,active:S,value:C,className:"min-w-0 shrink"})}),e[24]=C,e[25]=S,e[26]=M):M=e[26];let F;e[27]!==p?(F=p("sandbox.postToolbar.filterBy"),e[27]=p,e[28]=F):F=e[28];let A;e[29]!==F?(A=s.jsx(pt,{children:F}),e[29]=F,e[30]=A):A=e[30];let z;e[31]!==p?(z=p("sandbox.postToolbar.allPosts"),e[31]=p,e[32]=z):z=e[32];let K;e[33]!==z?(K=s.jsx(bt,{value:ks,children:z}),e[33]=z,e[34]=K):K=e[34];let _;e[35]!==p?(_=p("sandbox.postToolbar.statusLabel"),e[35]=p,e[36]=_):_=e[36];let $;e[37]!==_?($=s.jsx(pt,{className:"text-muted-foreground/70",children:_}),e[37]=_,e[38]=$):$=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let B;e[40]!==c||e[41]!==p?(B=V.map(D=>s.jsxs(bt,{value:`status:${D}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:p(wt[D])}),s.jsx(as,{count:c[D]})]},`status:${D}`)),e[40]=c,e[41]=p,e[42]=B):B=e[42];let W;e[43]!==n.length||e[44]!==p?(W=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=p,e[45]=W):W=e[45];let X;e[46]!==n?(X=n.map(Da),e[46]=n,e[47]=X):X=e[47];let E;e[48]!==o.length||e[49]!==p?(E=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=p,e[50]=E):E=e[50];let G;e[51]!==o?(G=o.map(Ea),e[51]=o,e[52]=G):G=e[52];let Y;e[53]!==w||e[54]!==I||e[55]!==K||e[56]!==$||e[57]!==B||e[58]!==W||e[59]!==X||e[60]!==E||e[61]!==G?(Y=s.jsxs(us,{value:w,onValueChange:I,children:[K,$,B,W,X,E,G]}),e[53]=w,e[54]=I,e[55]=K,e[56]=$,e[57]=B,e[58]=W,e[59]=X,e[60]=E,e[61]=G,e[62]=Y):Y=e[62];let J;e[63]!==Y||e[64]!==A?(J=s.jsxs(Vt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[A,Y]}),e[63]=Y,e[64]=A,e[65]=J):J=e[65];let L;e[66]!==J||e[67]!==M?(L=s.jsxs(Ut,{children:[M,J]}),e[66]=J,e[67]=M,e[68]=L):L=e[68];let se;e[69]!==T||e[70]!==S||e[71]!==p?(se=S&&s.jsx(Aa,{label:p("sandbox.postToolbar.clearFilter"),onClick:T}),e[69]=T,e[70]=S,e[71]=p,e[72]=se):se=e[72];const re=Ta[a];let le;e[73]!==p||e[74]!==re?(le=p(re),e[73]=p,e[74]=re,e[75]=le):le=e[75];let oe;e[76]!==le?(oe=s.jsx(zt,{asChild:!0,children:s.jsx(Ns,{icon:zn,active:!0,value:le})}),e[76]=le,e[77]=oe):oe=e[77];let ae;e[78]!==p?(ae=p("sandbox.postToolbar.sortBy"),e[78]=p,e[79]=ae):ae=e[79];let ce;e[80]!==ae?(ce=s.jsx(pt,{children:ae}),e[80]=ae,e[81]=ce):ce=e[81];let O;e[82]!==h?(O=D=>h(D),e[82]=h,e[83]=O):O=e[83];let te;e[84]===Symbol.for("react.memo_cache_sentinel")?(te=Object.keys(js),e[84]=te):te=e[84];let Z;e[85]!==p?(Z=te.map(D=>s.jsx(bt,{value:D,children:p(js[D])},D)),e[85]=p,e[86]=Z):Z=e[86];let ee;e[87]!==a||e[88]!==O||e[89]!==Z?(ee=s.jsx(us,{value:a,onValueChange:O,children:Z}),e[87]=a,e[88]=O,e[89]=Z,e[90]=ee):ee=e[90];let ie;e[91]!==ce||e[92]!==ee?(ie=s.jsxs(Vt,{align:"end",className:"w-44",children:[ce,ee]}),e[91]=ce,e[92]=ee,e[93]=ie):ie=e[93];let R;e[94]!==oe||e[95]!==ie?(R=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(Ut,{children:[oe,ie]})}),e[94]=oe,e[95]=ie,e[96]=R):R=e[96];let ge;return e[97]!==L||e[98]!==se||e[99]!==R?(ge=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[L,se,R]}),e[97]=L,e[98]=se,e[99]=R,e[100]=ge):ge=e[100],ge}function Ea(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(as,{count:t.count})]},`author:${t.email}`)}function Da(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(as,{count:t.count})]},`cat:${t.slug}`)}function Aa(t){const e=je.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{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 Ba(t){const e=je.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:$a,children:s.jsx(ss,{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 $a(t){return t.stopPropagation()}function La(t){const e=je.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(Ba,{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 h;e[8]!==r?(h=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(sn,{size:14}),e[10]=p):p=e[10];let f;e[11]!==l||e[12]!==d||e[13]!==h?(f=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":h,children:p})}),e[11]=l,e[12]=d,e[13]=h,e[14]=f):f=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let g;e[17]!==y?(g=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=g):g=e[18];let v;e[19]!==f||e[20]!==g?(v=s.jsxs(ze,{children:[f,g]}),e[19]=f,e[20]=g,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(ns,{size:14}),e[24]=k):k=e[24];let C;e[25]!==i||e[26]!==S?(C=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]=C):C=e[27];let w;e[28]!==r?(w=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=w):w=e[29];let U;e[30]!==w?(U=s.jsx(Me,{side:"bottom",children:w}),e[30]=w,e[31]=U):U=e[31];let T;e[32]!==C||e[33]!==U?(T=s.jsxs(ze,{children:[C,U]}),e[32]=C,e[33]=U,e[34]=T):T=e[34];let j;e[35]!==v||e[36]!==T?(j=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,T]}),e[35]=v,e[36]=T,e[37]=j):j=e[37];let I;return e[38]!==a||e[39]!==j||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,j]}),e[38]=a,e[39]=j,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=je.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(Vn,{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:Oa,children:x})}),e[3]=u,e[4]=d):d=e[4];let h;e[5]!==o||e[6]!==a?(h=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(tl,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=h):h=e[7];let p;e[8]!==n||e[9]!==a?(p=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(el,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=p):p=e[10];let f;e[11]!==c||e[12]!==a?(f=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(Xo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=f):f=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(Ks,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Is,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Rt,{}),e[18]=g):g=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 C;e[25]!==k||e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==y?(C=s.jsxs(Vt,{align:"end",className:"w-44",children:[h,p,f,y,g,k]}),e[25]=k,e[26]=h,e[27]=p,e[28]=f,e[29]=y,e[30]=C):C=e[30];let w;return e[31]!==C||e[32]!==d?(w=s.jsxs(Ut,{children:[d,C]}),e[31]=C,e[32]=d,e[33]=w):w=e[33],w}function Oa(t){return t.stopPropagation()}function Ra(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Fa(t){const e=new Map;for(const n of t){const o=Ra(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 Ps(t){const e=je.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=Ee("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 Ts=H.lazy(()=>Fe(()=>import("./app-editor-CaCDGdiz.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,194,195,196,197,198,199])).then(t=>({default:t.AppEditor}))),Ka=H.lazy(()=>Fe(()=>import("./post-editor-5tYPjO0c.js"),__vite__mapDeps([200,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,62,31,33,34,35,36,37,38,39,40,41,28,29,24,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82,127,201,186,162,114,115,81,130,140,136,134,86,85,87,88,89,83,90,91,92,93,94,95,96,97,98,99,100,27,101,102,103,104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,128,129,25,26,131,132,133,135,137,138,139,141,142,143,144,145,146,147,148,149,202,84,166,203,204,205,206,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,187,188,189,190,191,192,193,194,195,196,197,198,199])).then(t=>({default:t.PostEditor}))),Ia=H.lazy(()=>Fe(()=>import("./record-editor-C02fIlfV.js"),__vite__mapDeps([207,1,2,82,127,26,27,28,29,134,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,39,53,59,89,83,31,32,33,34,35,36,37,38,40,41,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,90,91,92,93,94,95,96,97,81,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,128,129,130,25,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,204,206,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,194,195,196,197,198,199])).then(t=>({default:t.RecordEditor}))),Ma=H.lazy(()=>Fe(()=>import("./category-editor-CFCxetoB.js"),__vite__mapDeps([208,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,37,53,62,31,32,33,34,35,36,38,39,40,41,28,29,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,148,82,127,202,84,83,135,114,115,81,130,86,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,27,101,102,103,104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,128,129,25,26,131,132,133,134,136,137,138,139,140,141,142,143,144,145,146,147,149,166,203,204,205,206,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,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,194,195,196,197,198,199])).then(t=>({default:t.CategoryEditor}))),za=H.lazy(()=>Fe(()=>import("./bulk-category-panel-CODUgRdO.js"),__vite__mapDeps([209,1,2,53,79,127,210,43,26,27,28,29,100])).then(t=>({default:t.BulkCategoryPanel}))),Va=H.lazy(()=>Fe(()=>import("./sections-editor-D24EQfD8.js"),__vite__mapDeps([211,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,29,31,32,33,34,35,36,37,38,39,40,41,28,24,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,25,26,27,100,81,82,86,85,87,88,89,83,90,91,92,93,94,95,96,97,98,99,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,195,212,30,84,213])).then(t=>({default:t.SectionsEditor}))),Ua=H.lazy(()=>Fe(()=>import("./seo-editor-BRYLT6tF.js"),__vite__mapDeps([214,1,2,24,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,79,80,25,26,27,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,89,83,90,91,92,93,94,95,96,97,81,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,82,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,212])).then(t=>({default:t.SeoEditor}))),Ga=H.lazy(()=>Fe(()=>import("./variant-calendar-Bp201sXA.js"),__vite__mapDeps([215,1,2,31,32,33,34,35,36,37,38,39,40,41,28,29,24,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,127,25,26,27,136,100,216,150,151,152,122,8,9,153,7,103,107,6,10,154,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,105,81,155,156,99,124,125,126,82,98,157,113,158,85,96,95,97,92,93,140,159,147,106,160,161,162,163,109,110,130,164,165,166,167,138,168,169,170,171,172,173,174,175,176,177,178,179,144,145,180,181,116,134,182,183,184,185,186,187,188,91,94,101,102,104,108,111,112,114,115,117,118,119,120,121,123,128,129,189,89,90,190,191,146,142,192,193,194,148,86,87,88,83,131,132,133,135,137,139,141,143,149,195,196,197,198,199])).then(t=>({default:t.VariantCalendar}))),Ha=H.lazy(()=>Fe(()=>import("./post-calendar-gswoVxcp.js"),__vite__mapDeps([217,1,2,32,31,33,34,35,36,37,38,39,40,41,28,29,24,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,218,25,26,27,150,151,152,122,8,9,153,7,103,107,6,10,154,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,105,100,81,155,156,99,124,125,126,127,82,98,157,113,158,85,96,95,97,92,93,140,159,147,106,160,161,162,163,109,110,130,164,165,166,167,138,168,169,170,171,172,173,174,175,176,177,178,179,144,145,180,181,116,134,182,183,184,185,186,187,188,91,94,101,102,104,108,111,112,114,115,117,118,119,120,121,123,128,129,189,89,90,190,191,146,142,192,193,194,148,86,87,88,83,131,132,133,135,136,137,139,141,143,149,195,196,197,198,199])).then(t=>({default:t.PostCalendar}))),Ja=H.lazy(()=>Fe(()=>import("./redirect-editor-B2uGI7FY.js"),__vite__mapDeps([219,1,2,162,28,82,127,26,27,29,86,85,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,87,88,39,53,59,89,83,31,32,33,34,35,36,37,38,40,41,24,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,90,91,92,93,94,95,96,97,81,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,128,129,130,25,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,206])).then(t=>({default:t.RedirectEditor})));function Wa(t){const e=je.c(20),{deepLinkPage:n}=t,{currentBranch:o,virtualMcpId:c}=$s(),{org:l}=An(),i=Io(),r=Mo(),{runtime:a,previewServerUrl:u}=zo(c),x=a==="cms";let d;e[0]!==x||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(d=Sl({fastPreviewActive:x,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=x,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=d):d=e[3];const h=d;if(h.kind==="sandbox-card"){const y=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==r.start||e[6]!==y||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(yl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:y}),e[4]=h.state,e[5]=r.start,e[6]=y,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!c||!o){let y;return e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{title:"Waiting for sandbox context…"}),e[10]=y):y=e[10],y}const p=x?u:r.previewUrl;let f;return e[11]!==o||e[12]!==n||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==c?(f=s.jsx(qa,{orgSlug:l.slug,virtualMcpId:c,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=n,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=p,e[18]=c,e[19]=f):f=e[19],f}const _s=2e3,Ya=15;function Es(t,e,n,o){return typeof e!="string"||n&&(nn(e,n,o)||t.state.dataUpdateCount>=Ya)?!1:_s}function qa({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:h}=bo(x,{fetchEnabled:i}),p=Bs({strict:!1}),[f,y]=H.useState(()=>p.contentCollection&&qe(p.contentCollection)&&p.contentCollection||"pages"),[g,v]=H.useState(()=>p.contentItem&&qe(f)?{collection:f,key:p.contentItem}:null),[S,k]=H.useState(null),C=!!(l?.pageId||l?.path||l?.pathTemplate),[w,U]=H.useState(!1);if(C&&!w&&g===null&&d){U(!0);const m=To(rs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[T,j]=H.useState(""),[I,M]=H.useState(null),[F,A]=H.useState(null),[z,K]=H.useState(null),[_,$]=H.useState("date-desc"),[V,B]=H.useState(()=>new Set),[W,X]=H.useState(null),E=()=>{B(new Set),X(null)},G=m=>{v(m),k(null)},[Y,J]=H.useState(f);Y!==f&&(J(f),j(""),M(null),A(null),K(null),$("date-desc"),B(new Set),X(null));const{data:L,isLoading:se,isFetching:re}=yo(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(f==="apps"&&g&&g.collection==="apps"){const q=d?.[g.key];return Es(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(f==="site"&&d){const q=P?cs(d,P):null,Q=d.site,ke=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Es(m,ke,P,["seo"])}return!1}}),le=(m,P)=>!nn(m,L,P)&&(se||re),{catalog:oe,isLoading:ae}=hl(L??void 0,d??void 0,{enabled:f==="apps"}),ce=ia({orgSlug:t,virtualMcpId:e,branch:n,meta:L}),O=Gs(x),te=Lo(x),[Z,ee]=H.useState(null),[ie,R]=H.useState(),[ge,D]=H.useState(!1),[xe,me]=H.useState(),[fe,be]=H.useState(null),[ne,pe]=H.useState(null),[Ce,we]=H.useState(null),Ne=!d||!L;if(h||se||Ne&&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(Ne)return s.jsx(He,{title:"Could not load site data."});const Se=rs(d).sort((m,P)=>m.name.localeCompare(P.name)),he=_o(d).sort((m,P)=>m.from.localeCompare(P.from)),Te=Eo(d,L),$e=f==="sections"?Do(L):[],N=cs(d,L),de=cn(d),ye=os.some(m=>de[m].length>0),De=qe(f)?de[f]:[],ct=(ye?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=f==="posts"&&(V.size>0||W!==null),dt=et?fn(d).filter(m=>V.has(m.key)):[],ut=is(L,"loaders"),tt=is(L,"actions");if(!Ao(d,L)&&!ye&&ut===0&&tt===0)return s.jsx(He,{icon:Ls,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Bt={pages:Se.length,sections:Te.length,apps:oe.length,loaders:ut,actions:tt,redirects:he.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},We=new Set(Se.map(m=>Ct(m.path))),st=new Set(Se.map(m=>m.name)),mt=new Set(Te.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=qs(d,m.key),Q=vo(d,m.key,Math.max(0,q-1)),ke=So(P.sections,Q);if(ke)try{await O.mutateAsync({blockKey:m.key,data:{...P,sections:ke}}),ve.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(_e){ve.error(_e instanceof Error?_e.message:"Could not add variant")}},Ve=()=>{R(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{R(void 0),ee({mode:"duplicate",sourceKey:m.key,initialName:ps(st,m.name),initialPath:kl(We,m.path)})},Ge=m=>{R(void 0),ee({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!Z)return;const{mode:P,sourceKey:q}=Z;try{if(P==="create"){let Q;if(m.templateKey){const _e=d[m.templateKey];if(!_e)throw new Error("Selected template no longer exists.");Q={..._e,name:m.name,path:m.path}}else Q=wl(m.name,m.path);const ke=Pl(d,m.name);await O.mutateAsync({blockKey:ke,data:Q}),ve.success(`Created "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:ke,data:_e}=Cl({source:Q,pages:Se,newName:m.name,newPath:m.path});await O.mutateAsync({blockKey:ke,data:_e}),ve.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const ke={...Q,name:m.name,path:m.path};await O.mutateAsync({blockKey:q,data:ke}),ve.success("Page updated"),g?.collection==="pages"&&g.key===q&&v({collection:"pages",key:q,path:m.path})}ee(null)}catch(Q){R(Q instanceof Error?Q.message:"Save failed")}},ue=({path:m})=>{if(!Z)return null;const P=Ct(m);return(Z.mode==="rename"?Ct(Z.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await O.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),ve.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Js((m,P)=>O.mutate({blockKey:m,data:P})),bn=async m=>{const P=d[m.key];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=jl(d,m.key),Q=ps(mt,m.name),ke={...P,name:Q};try{await O.mutateAsync({blockKey:q,data:ke}),ve.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:a("sandbox.contentBrowser.duplicateFailed"))}},yn=async m=>{if(!fe)return;const P=d[fe];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:fe,data:{...P,name:m}}),ve.success(a("sandbox.contentBrowser.sectionRenamed")),be(null)}catch(q){ve.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},vn=()=>{me(void 0),D(!0)},Sn=async m=>{const P=Bo(d,m.from),q=$o(m);try{await O.mutateAsync({blockKey:P,data:q}),ve.success("Created redirect"),D(!1),v({collection:"redirects",key:P})}catch(Q){me(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 O.mutateAsync({blockKey:P,data:q}),ve.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){ve.error(Q instanceof Error?Q.message:"Could not create")}},jn=async m=>{const P=Kt(d,"posts"),q=it(P,"posts",Xl(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),J("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){ve.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},Cn=async(m,P)=>{const q=d[m],Q=q?ea(xt(q,"posts"),P):null;if(!Q){ve.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(ke){ve.error(ke instanceof Error?ke.message:a("sandbox.postCalendar.couldNotReschedule"))}},wn=async m=>{const P=d[m.key];if(!P){ve.error("Record not found.");return}const q=Kt(d,m.kind),Q=m.kind==="posts"?"title":"name",ke={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await O.mutateAsync({blockKey:q,data:it(q,m.kind,ke)}),ve.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:"Duplicate failed")}},Nn=m=>{B(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Pn=m=>{y("posts"),J("posts"),v(null),k(null),j(""),M(null),A(null),K(null),$("date-desc"),B(new Set),X(m||null)},Tn=async(m,P)=>{const q=[...V];let Q=0;for(const ke of q){const _e=d[ke],ot=xt(_e,"posts"),ft=m==="add"?zl(ot,P):Vl(ot,P);ft!==ot&&(await O.mutateAsync({blockKey:ke,data:it(ke,"posts",xs(ft))}),Q+=1)}return Q},_n=async(m,P)=>{const q=V.size;try{const Q=await Tn(m,P),ke=m==="add"?"Added to":"Moved",_e=q-Q;ve.success(`${ke} ${Q} ${Q===1?"post":"posts"}`+(_e>0?` (${_e} already set)`:"")),E()}catch(Q){ve.error(Q instanceof Error?Q.message:"Bulk update failed")}},En=async()=>{if(ne)try{if(ne.kind==="blog-bulk"){for(const Q of ne.keys)await te.mutateAsync({blockKey:Q});ve.success(`Deleted ${ne.count} ${ne.count===1?"post":"posts"}`),g&&g.collection!=="available-section"&&ne.keys.includes(g.key)&&v(null),E(),pe(null);return}const{kind:m,key:P,label:q}=ne;if(m==="blog"){if(ne.blogKind==="categories"){const Q=xt(d[P],"categories").slug,ke=typeof Q=="string"?Q:"";if(ke)for(const{key:_e,payload:ot}of vt(d,"posts")){const ft=Ul(ot,ke);ft!==ot&&await O.mutateAsync({blockKey:_e,data:it(_e,"posts",xs(ft))})}}await te.mutateAsync({blockKey:P})}else await te.mutateAsync({blockKey:P});ve.success(`Deleted "${q}"`),g&&g.collection!=="available-section"&&g.key===P&&v(null),pe(null)}catch(m){ve.error(m instanceof Error?m.message:"Delete failed")}},St=te.isPending||O.isPending,Dn=ne?.kind==="blog"?yt[ne.blogKind]:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"}`:ne?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(xl,{active:f,counts:Bt,showBlog:ye,onSelect:m=>{y(m),v(null),k(null)}}),f!=="seo"&&f!=="site"&&f!=="calendar"&&f!=="post-schedule"&&f!=="loaders"&&f!=="actions"&&s.jsx(Qa,{activeCollection:f,pages:Se,redirects:he,sections:Te,availableSections:$e,appCatalog:oe,appCatalogLoading:ae,blogEntries:De,decofile:d,searchQuery:T,onSearchChange:j,postCategoryFilter:I,postAuthorFilter:F,postStatusFilter:z,postSort:_,onPostCategoryFilterChange:m=>{M(m),B(new Set)},onPostAuthorFilterChange:m=>{A(m),B(new Set)},onPostStatusFilterChange:m=>{K(m),B(new Set)},onPostSortChange:$,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:Nn,onSelectAllPosts:m=>B(new Set(m)),onClearPostSelection:()=>B(new Set),onExitPostSelection:E,onBulkDeletePosts:()=>pe({kind:"blog-bulk",keys:[...V],count:V.size}),selection:g,onSelect:G,onCreate:()=>{f==="pages"?Ve():f==="redirects"?vn():qe(f)&&kn(f)},onDuplicatePage:Ue,onRenamePage:Ge,onAddPageVariant:nt,onDeletePage:m=>pe({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=>we(m.key),onDuplicateSection:bn,onRenameSection:m=>be(m.key),onDeleteSection:m=>pe({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>pe({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:wn,onDeleteBlog:m=>pe({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?s.jsx(fa,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,kind:f}):s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?s.jsx(Ga,{decofile:d}):f==="post-schedule"?s.jsx(Ha,{decofile:d,support:ce,isCreating:O.isPending,onCreate:m=>{jn(m)},onReschedule:(m,P)=>{Cn(m,P)},onSelect:m=>{y("posts"),J("posts"),v({collection:"posts",key:m}),k(null)}}):f==="site"?N?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:L,title:"Site",excludeFields:["seo"],schemaPending:le(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(He,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="seo"?s.jsx(Ua,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:L,target:{kind:"site"},previewBaseUrl:c}):f==="sections"?s.jsx(Pa,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,isCreating:O.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(za,{posts:dt,categories:ct,initialSlug:W,isPending:O.isPending,onApply:(m,P)=>{_n(m,P)},onClose:E},W??"selection"):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:o,schemaPending:le(typeof d[g.key]?.__resolveType=="string"?String(d[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="posts"?s.jsx(Ka,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:c},`post:${g.key}`):g.collection==="categories"?s.jsx(Ma,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,onManagePosts:Pn,onOpenPost:m=>{y("posts"),J("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${g.key}`):g.collection==="authors"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:g.key,block:d[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(Ja,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key]},`redirect:${g.key}`):s.jsx(Va,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&S===g.key,onExitSeo:()=>k(null)},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(He,{title:`Select ${qe(f)?`a ${yt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),Z&&s.jsx(Dl,{open:!!Z,mode:Z.mode,initialName:Z.initialName,initialPath:Z.initialPath,isPending:O.isPending,error:ie,templates:Se,validate:ue,onSubmit:b,onOpenChange:m=>{m||(ee(null),R(void 0))}}),s.jsx(Bl,{open:ge,isPending:O.isPending,error:xe,onSubmit:Sn,onOpenChange:m=>{m||(D(!1),me(void 0))}}),fe&&s.jsx($l,{open:!!fe,blockKey:fe,initialName:Te.find(m=>m.key===fe)?.name??fe,isPending:O.isPending,onSubmit:yn,onOpenChange:m=>{m||be(null)}}),Ce&&s.jsx(Oo,{open:!!Ce,onOpenChange:m=>{m||we(null)},pageKey:Ce,decofile:d,onSave:m=>O.mutateAsync({blockKey:Ce,data:m})}),s.jsx(Gn,{open:!!ne,onOpenChange:m=>{!m&&!St&&pe(null)},children:s.jsxs(Hn,{children:[s.jsxs(Jn,{children:[s.jsx(Wn,{children:`Delete ${Dn}?`}),s.jsx(Yn,{children:ne?.kind==="section"?`"${ne.label}" will be removed. Pages that still reference it will lose this section.`:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ne?`"${ne.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(qn,{children:[s.jsx(Qn,{disabled:St,children:"Cancel"}),s.jsx(Xn,{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=je.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:h,postCategoryFilter:p,postAuthorFilter:f,postStatusFilter:y,postSort:g,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:C,selectedPostKeys:w,postBulkPanelOpen:U,onTogglePostSelect:T,onSelectAllPosts:j,onClearPostSelection:I,onExitPostSelection:M,onBulkDeletePosts:F,selection:A,onSelect:z,onCreate:K,onDuplicatePage:_,onRenamePage:$,onAddPageVariant:V,onDeletePage:B,onEditPageSeo:W,onViewPageJson:X,onDuplicateSection:E,onRenameSection:G,onDeleteSection:Y,onDeleteRedirect:J,onDuplicateBlog:L,onDeleteBlog:se}=t;let re,le,oe,ae,ce,O,te;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==F||e[8]!==I||e[9]!==K||e[10]!==se||e[11]!==B||e[12]!==J||e[13]!==Y||e[14]!==L||e[15]!==_||e[16]!==E||e[17]!==W||e[18]!==M||e[19]!==S||e[20]!==v||e[21]!==C||e[22]!==k||e[23]!==$||e[24]!==G||e[25]!==h||e[26]!==z||e[27]!==j||e[28]!==T||e[29]!==X||e[30]!==o||e[31]!==f||e[32]!==U||e[33]!==p||e[34]!==g||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==w||e[40]!==A){const R=d.toLowerCase(),ge=o.filter(b=>!R||b.name.toLowerCase().includes(R)||b.path.toLowerCase().includes(R)),D=c.filter(b=>!R||b.from.toLowerCase().includes(R)||b.to.toLowerCase().includes(R)),xe=l.filter(b=>!R||b.name.toLowerCase().includes(R)||b.key.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)),me=i.filter(b=>!R||b.title.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)||(b.description?.toLowerCase().includes(R)??!1)),fe=Fa(xe),be=r.filter(b=>!R||b.title.toLowerCase().includes(R)||b.app.toLowerCase().includes(R)||b.vendor.toLowerCase().includes(R)||b.category.toLowerCase().includes(R)),ne=u.filter(b=>!R||b.label.toLowerCase().includes(R)||b.subtitle.toLowerCase().includes(R)),pe=n==="posts",Ce=ti,we=pe?fn(x):[],Ne=new Map,Se=new Map,he={published:0,scheduled:0,draft:0};for(const b of we)he[b.status]=he[b.status]+1;for(const b of we){for(const ue of b.categorySlugs)Ne.set(ue,(Ne.get(ue)??0)+1);for(const ue of b.authorEmails)Se.set(ue,(Se.get(ue)??0)+1)}const Te=(pe?vt(x,"categories"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.slug)||ue;return{slug:Ye,name:Ce(Ae.name)||Ce(Ae.slug)||ue,count:Ne.get(Ye)??0}}).filter(ei),$e=(pe?vt(x,"authors"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.email);return{email:Ye,name:Ce(Ae.name)||Ce(Ae.email)||ue,count:Se.get(Ye)??0}}).filter(Za);let N;e[48]!==p?(N=b=>!p||b.categorySlugs.includes(p),e[48]=p,e[49]=N):N=e[49];let de;e[50]!==f?(de=b=>!f||b.authorEmails.includes(f),e[50]=f,e[51]=de):de=e[51];let ye;e[52]!==y?(ye=b=>!y||b.status===y,e[52]=y,e[53]=ye):ye=e[53];let De;e[54]!==g?(De=(b,ue)=>{if(g==="az")return b.title.localeCompare(ue.title);if(g==="za")return ue.title.localeCompare(b.title);const Ae=b.date.localeCompare(ue.date);return g==="date-asc"?Ae:-Ae},e[54]=g,e[55]=De):De=e[55];const ct=we.filter(b=>!R||b.title.toLowerCase().includes(R)||b.slug.toLowerCase().includes(R)).filter(N).filter(de).filter(ye).sort(De),et=w.size,dt=ct.map(Xa),ut=dt.length>0&&dt.every(b=>w.has(b)),tt=et>0||U,Bt=()=>{ut?I():j(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";ce="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(zs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==h?(Ve=b=>h(b.target.value),e[57]=h,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 Ge;e[63]!==st||e[64]!==K||e[65]!==mt?(Ge=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:K,"aria-label":st,children:s.jsx(Un,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=K,e[65]=mt,e[66]=Ge):Ge=e[66],e[67]!==Ue||e[68]!==Ge?(O=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,Ge]}),e[67]=Ue,e[68]=Ge,e[69]=O):O=e[69],te=pe&&(tt?s.jsx(La,{count:et,allSelected:ut,onToggleSelectAll:Bt,onDelete:F,onExit:M}):s.jsx(_a,{categories:Te,authors:$e,categoryFilter:p,statusCounts:he,authorFilter:f,statusFilter:y,sort:g,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:C})),re=Dt,ae="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",le="flex flex-col gap-1 p-1.5",oe=n==="pages"?ge.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ge.map(b=>{const ue=A?.collection==="pages"&&A.key===b.key,Ae=qs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:ue,variantCount:Ae,onClick:()=>z({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>_(b),onRename:()=>$(b),onAddVariant:()=>V(b),onEditSeo:()=>W(b),onViewJson:()=>X(b),onDelete:()=>B(b)})},b.key)}):n==="sections"?xe.length===0&&me.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:[fe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:It,label:"Saved sections"}),fe.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(ue=>{const Ae=A?.collection==="sections"&&A.key===ue.key;return s.jsx(Re,{icon:It,accent:"global",title:ue.name,subtitle:b.label,active:Ae,onClick:()=>z({collection:"sections",key:ue.key}),menu:s.jsx(gt,{onDuplicate:()=>E(ue),onRename:()=>G(ue),onDelete:()=>Y(ue)})},ue.key)})]},b.label))]}),me.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:jt,label:"Available sections",className:Ee(fe.length>0&&"mt-3")}),me.map(b=>{const ue=A?.collection==="available-section"&&A.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:ue,onClick:()=>z({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"})}):be.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):be.map(b=>{const ue=A?.collection==="apps"&&b.blockKey!==null&&A.key===b.blockKey;return s.jsx(Re,{icon:Ms,logoUrl:b.logo,title:b.title,subtitle:b.category,active:ue,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){ve.message(`${b.title} is not installed on this site.`);return}z({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?D.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):D.map(b=>s.jsx(Re,{icon:Os,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:A?.collection==="redirects"&&A.key===b.key,trailing:s.jsx(Ll,{type:b.type}),onClick:()=>z({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>J(b)})},b.key)):pe?ct.length===0?s.jsx(at,{hasItems:we.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const ue={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:A?.collection==="posts"&&A.key===b.key,selectable:!0,selectionActive:tt,selected:w.has(b.key),onToggleSelect:()=>T(b.key),onClick:()=>tt?T(b.key):z({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(ue),onDelete:()=>se(ue)})},b.key)}):ne.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ne.map(b=>{const ue=A?.collection===b.kind&&A.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Mt:b.kind==="authors"?Vs:Fs,title:b.label,subtitle:b.subtitle,active:ue,onClick:()=>z({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(b),onDelete:()=>se(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]=F,e[8]=I,e[9]=K,e[10]=se,e[11]=B,e[12]=J,e[13]=Y,e[14]=L,e[15]=_,e[16]=E,e[17]=W,e[18]=M,e[19]=S,e[20]=v,e[21]=C,e[22]=k,e[23]=$,e[24]=G,e[25]=h,e[26]=z,e[27]=j,e[28]=T,e[29]=X,e[30]=o,e[31]=f,e[32]=U,e[33]=p,e[34]=g,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=w,e[40]=A,e[41]=re,e[42]=le,e[43]=oe,e[44]=ae,e[45]=ce,e[46]=O,e[47]=te}else re=e[41],le=e[42],oe=e[43],ae=e[44],ce=e[45],O=e[46],te=e[47];let Z;e[70]!==le||e[71]!==oe?(Z=s.jsx("div",{className:le,children:oe}),e[70]=le,e[71]=oe,e[72]=Z):Z=e[72];let ee;e[73]!==re||e[74]!==ae||e[75]!==Z?(ee=s.jsx(re,{className:ae,children:Z}),e[73]=re,e[74]=ae,e[75]=Z,e[76]=ee):ee=e[76];let ie;return e[77]!==ce||e[78]!==O||e[79]!==te||e[80]!==ee?(ie=s.jsxs("div",{className:ce,children:[O,te,ee]}),e[77]=ce,e[78]=O,e[79]=te,e[80]=ee,e[81]=ie):ie=e[81],ie}function Xa(t){return t.key}function Za(t){return t.email}function ei(t){return t.slug}function ti(t){return typeof t=="string"?t:""}function si(t){const e=je.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=H.useState(!1),i=en(n),{activeTask:r}=$s();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=Bs(a);if(!(ms(i?.metadata)||ms(r?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(fs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let p;e[2]!==o?(p=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=p):p=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let y,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),g=s.jsx(fs,{className:"size-4"}),e[6]=y,e[7]=g):(y=e[6],g=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:[g,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==p||e[13]!==f||e[14]!==S?(k=s.jsx(sl,{className:"h-full",image:h,title:p,description:f,actions:S}),e[12]=p,e[13]=f,e[14]=S,e[15]=k):k=e[15];let C;e[16]!==c?(C=s.jsx(nl,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=C):C=e[17];let w;return e[18]!==C||e[19]!==k?(w=s.jsxs(s.Fragment,{children:[k,C]}),e[18]=C,e[19]=k,e[20]=w):w=e[20],w}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Wa,{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 ni(){const t=je.c(2),e=ol();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx($n,{feature:"cms",children:s.jsx(si,{virtualMcpId:e})})}),t[0]=e,t[1]=n):n=t[1],n}const dr=Object.freeze(Object.defineProperty({__proto__:null,default:ni},Symbol.toStringTag,{value:"Module"}));export{na as A,ir as B,dr as C,tr as M,er as W,rr as a,it as b,cr as c,qi as d,Yi as e,Qi as f,xt as g,Wl as h,ql as i,Zi as j,fn as k,vt as l,dn as m,jl as n,Xi as o,mn as p,sr as q,al as r,xs as s,or as t,ia as u,Xe as v,lr as w,nr as x,ar as y,Tt as z};
|