decocms 4.513.6 → 4.513.8
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/{ActiveShapeUtils-BD1rvm75.js → ActiveShapeUtils-uKFYSg4Y.js} +1 -1
- package/dist/client/assets/{AlertCircle-DGyqrcs1.js → AlertCircle-Q16nTVAa.js} +1 -1
- package/dist/client/assets/{AreaChart-DXZzRQIg.js → AreaChart-k5WqYBKX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-eYPah7GY.js → ArrowLeft-C_dTX_8N.js} +1 -1
- package/dist/client/assets/{ArrowUp-D5AH9Pcx.js → ArrowUp--4P0C-xl.js} +1 -1
- package/dist/client/assets/{BarChart-CIrIL-8i.js → BarChart-VS3Ye-qY.js} +1 -1
- package/dist/client/assets/{Building02-DYC0suyK.js → Building02-Gub-pr-8.js} +1 -1
- package/dist/client/assets/{CartesianChart-DI2rF1vs.js → CartesianChart-BvH4QiKh.js} +1 -1
- package/dist/client/assets/{CategoricalChart-C37JtV-R.js → CategoricalChart-CTrV8dYV.js} +1 -1
- package/dist/client/assets/{CheckCircle-CqYnJPRs.js → CheckCircle-CQxu_pm9.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DdGE8kvW.js → ChevronSelectorVertical-GBLm8Zpl.js} +1 -1
- package/dist/client/assets/{ChevronUp-COqs90Hs.js → ChevronUp-DK-Gvyk8.js} +1 -1
- package/dist/client/assets/{Copy01-CgH6S_M4.js → Copy01-EWitDFCf.js} +1 -1
- package/dist/client/assets/{CreditCard01-D9MXYjlv.js → CreditCard01-wx_z4Iiz.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cb3iOarq.js → DotsVertical-DIT5hu2b.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Bm6BBMsf.js → ErrorBarContext-C56oRnGq.js} +1 -1
- package/dist/client/assets/{Globe04-CzPjgHLa.js → Globe04-B45_cBRN.js} +1 -1
- package/dist/client/assets/{Image01-DRhv7dXw.js → Image01-BfGAREA7.js} +1 -1
- package/dist/client/assets/{Key01-BDIGM7UK.js → Key01-BV7tzZs6.js} +1 -1
- package/dist/client/assets/{Link01-D-kjAU9F.js → Link01-9civFIb9.js} +1 -1
- package/dist/client/assets/{LinkBroken01-XQhOMQAy.js → LinkBroken01-DmmKNgpp.js} +1 -1
- package/dist/client/assets/{Monitor01-BVPal7YC.js → Monitor01-BoSs_8gg.js} +1 -1
- package/dist/client/assets/{Play-d8pW2_Wo.js → Play-CleWZLOG.js} +1 -1
- package/dist/client/assets/{Plus-BqeqBPMZ.js → Plus-DQf-jm_3.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BR8YoYbZ.js → ReferenceLine-DtJF7ODu.js} +1 -1
- package/dist/client/assets/{SearchMd-pSkC4ygW.js → SearchMd-D0zp0uee.js} +1 -1
- package/dist/client/assets/{Sector-Dq8AGG4_.js → Sector-CWBWrJZQ.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DZQO7QtG.js → ShoppingBag01-B7gta_qY.js} +1 -1
- package/dist/client/assets/{Sun-BCgybCT7.js → Sun-BfjJa3ru.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CeUNJpHb.js → SwitchHorizontal01-BJyDDPw9.js} +1 -1
- package/dist/client/assets/{Tool01-BgkFSAcX.js → Tool01-Bp-TbrXi.js} +1 -1
- package/dist/client/assets/{Trash01-DeYkLyg0.js → Trash01-Dlk_Sh-H.js} +1 -1
- package/dist/client/assets/{Upload01-zDvi7WnN.js → Upload01-DlF9Jqso.js} +1 -1
- package/dist/client/assets/{User01-DBX94Vod.js → User01-BcekHhAV.js} +1 -1
- package/dist/client/assets/{UserSquare-4I8cSrJU.js → UserSquare-cdWcOBLL.js} +1 -1
- package/dist/client/assets/{Users01-BNiwpGyg.js → Users01-BIP-PxGt.js} +1 -1
- package/dist/client/assets/{XClose-DFp85o1X.js → XClose-L_GNViCD.js} +1 -1
- package/dist/client/assets/{ZoomOut-Clz13c-y.js → ZoomOut-B3s5275g.js} +1 -1
- package/dist/client/assets/{access-gate-hn6vo27o.js → access-gate-CsHtyNGi.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-B8d5rNLA.js → add-connection-dialog-DwDvS8Uw.js} +1 -1
- package/dist/client/assets/{agent-analytics-oR-UJrdu.js → agent-analytics-bhSR3DTp.js} +1 -1
- package/dist/client/assets/agent-app-D3AENVQT.js +1 -0
- package/dist/client/assets/{agent-assets-BAJSaOwb.js → agent-assets-BwCvdqkQ.js} +1 -1
- package/dist/client/assets/{agent-automation-BFa_aFcv.js → agent-automation-BB_6G_CX.js} +1 -1
- package/dist/client/assets/{agent-automations-BqpWj5js.js → agent-automations-1AEGAcHU.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DLbP8QgT.js → agent-connect-sources-Dh_ELrva.js} +1 -1
- package/dist/client/assets/agent-deck-Cd8T_xPW.js +1 -0
- package/dist/client/assets/{agent-e2e-CZm4tSr4.js → agent-e2e-Bz8yllNo.js} +1 -1
- package/dist/client/assets/{agent-experiments-B-6D2jQi.js → agent-experiments-BmvDtQNl.js} +1 -1
- package/dist/client/assets/agent-file-BoVEwoJD.js +1 -0
- package/dist/client/assets/{agent-hosting-CdENGPus.js → agent-hosting-DtDQtjNQ.js} +1 -1
- package/dist/client/assets/{agent-icon-DtUVrwO-.js → agent-icon-D6wS7rd0.js} +1 -1
- package/dist/client/assets/agent-library-BeoJetpR.js +1 -0
- package/dist/client/assets/agent-library-file-DCYJT22p.js +1 -0
- package/dist/client/assets/{agent-monitor-Bs7IFe5F.js → agent-monitor-DduGwwal.js} +1 -1
- package/dist/client/assets/{agent-overview-BM6-btAT.js → agent-overview-Bj_gDP1X.js} +1 -1
- package/dist/client/assets/{agent-releases-Cg_1lF6D.js → agent-releases-CAjd1_1N.js} +1 -1
- package/dist/client/assets/agent-settings-CnK9fsFs.js +1 -0
- package/dist/client/assets/{agent-site-editor-Duykn_pL.js → agent-site-editor-DMCFUFgp.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-C20F9ay-.js +2 -0
- package/dist/client/assets/agent-site-editor-content-ChnnFjhK.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BxDD-Aar.js +1 -0
- package/dist/client/assets/agent-view-3YMZSj3x.js +1 -0
- package/dist/client/assets/{agent-view-guard-hqisp_aZ.js → agent-view-guard-AH_0N8JG.js} +1 -1
- package/dist/client/assets/{agents-list-Be9D6Efa.js → agents-list-ZmW8mXyl.js} +1 -1
- package/dist/client/assets/{ai-providers-Bcx4_XEI.js → ai-providers-CJqDCuAR.js} +1 -1
- package/dist/client/assets/{alert-DV4VVYX_.js → alert-PPdejvI2.js} +1 -1
- package/dist/client/assets/{alert-dialog-C884MJiU.js → alert-dialog-ygFmYcOa.js} +1 -1
- package/dist/client/assets/{analytics-sections-BRVAxDPl.js → analytics-sections-CveDF2n6.js} +1 -1
- package/dist/client/assets/api-keys-BRV_KE0D.js +1 -0
- package/dist/client/assets/{api-keys-77z_zTHe.js → api-keys-CbBz_rxa.js} +1 -1
- package/dist/client/assets/{app-editor-D1Yz0-KZ.js → app-editor-Cio5Pq66.js} +1 -1
- package/dist/client/assets/{asset-utils-Bgywf85e.js → asset-utils-Duz2qYol.js} +1 -1
- package/dist/client/assets/{auth-BWk8-zOv.js → auth-BVkTFTOt.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ba5IqUJT.js → auth-catchall-lx3pSppE.js} +1 -1
- package/dist/client/assets/{auth-entry-DtA-KX4U.js → auth-entry-Dz_b1brR.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DlRuMXq_.js → auth-split-layout-CFlGWfV0.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-IsdfY2Pl.js → authenticate-and-persist-oauth-POYqGagt.js} +1 -1
- package/dist/client/assets/{automation-list-row-BLQDRByW.js → automation-list-row-C69hu-tr.js} +1 -1
- package/dist/client/assets/{automation-runs-CfNYuBTf.js → automation-runs-CefmsDTb.js} +1 -1
- package/dist/client/assets/{automations-ClBeWsXG.js → automations-C6R9dV-_.js} +1 -1
- package/dist/client/assets/{autosend-00EmkCtt.js → autosend-CL2OZPvg.js} +1 -1
- package/dist/client/assets/{avatar-DKDZgWFa.js → avatar-LfY3dprD.js} +1 -1
- package/dist/client/assets/{badge-Bmk8ti5E.js → badge-CyDHDRPg.js} +1 -1
- package/dist/client/assets/{block-document-DM_YLluw.js → block-document-Di6OpT4O.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DbDIw_fH.js → blocks-preview-workspace-context-DcqAhd0P.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CbP4bRnZ.js → blocks-tab-states-BjRnBrj4.js} +3 -3
- package/dist/client/assets/{blog-schema-CUk-sbP9.js → blog-schema-C2heOfy2.js} +1 -1
- package/dist/client/assets/{board-analytics-QLChF2Fg.js → board-analytics-fCGfPXJ7.js} +1 -1
- package/dist/client/assets/{buckets-CNsJAB6o.js → buckets-j1BXX0Sb.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DJN4jxYS.js → build-improve-prompt-doc-BJrt-jCW.js} +1 -1
- package/dist/client/assets/{calendar-GjUu2S3w.js → calendar-sxNtZ9wG.js} +1 -1
- package/dist/client/assets/{capability-load-error-BVmBezr5.js → capability-load-error-CB4I7CRT.js} +1 -1
- package/dist/client/assets/{category-editor-BbN07orU.js → category-editor-D_K2FWTB.js} +1 -1
- package/dist/client/assets/{chart-Batu-asC.js → chart-NRF3lK-V.js} +1 -1
- package/dist/client/assets/{chat-context-0V74JN43.js → chat-context-Dv2E4fnf.js} +1 -1
- package/dist/client/assets/{chat-draft-b20iPSzq.js → chat-draft-X1dGJc2x.js} +1 -1
- package/dist/client/assets/{checkbox-FJR9GBSz.js → checkbox-CaUezNgL.js} +1 -1
- package/dist/client/assets/{choose-editor-B4AQNoUW.js → choose-editor-CDMfdVL-.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B7oLHBHH.js → cli-auth-success-aITDjw-8.js} +1 -1
- package/dist/client/assets/{client-icons-Db2DsGLl.js → client-icons-DRk6JWY6.js} +1 -1
- package/dist/client/assets/cms-settings-editor-C_3APl39.js +1 -0
- package/dist/client/assets/{collapsible-BaAUa-uq.js → collapsible-DHXUZre4.js} +1 -1
- package/dist/client/assets/{collection-detail-BpTqwPQh.js → collection-detail-BXabjop0.js} +1 -1
- package/dist/client/assets/{collection-display-button-qOjw_9dn.js → collection-display-button-Cdfgosxf.js} +1 -1
- package/dist/client/assets/{collection-search-BvClByDx.js → collection-search-Dcze6ySb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DRrT-L4P.js → collection-table-wrapper-CWGTaBjx.js} +1 -1
- package/dist/client/assets/{collection-tabs-yyL7thvn.js → collection-tabs-yg6VVFu9.js} +1 -1
- package/dist/client/assets/{column-rules-oi7XUNCk.js → column-rules-C_Hndp-C.js} +1 -1
- package/dist/client/assets/{combobox-DMjnN_aL.js → combobox-B5xPQiKP.js} +1 -1
- package/dist/client/assets/{coming-soon-page-B0mfPnqP.js → coming-soon-page-DsS1SnMg.js} +1 -1
- package/dist/client/assets/{command-HQXCvIc1.js → command-KXg0ZuU-.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BE_rdnSM.js → companion-mcps-section-Da_S5Z-R.js} +1 -1
- package/dist/client/assets/{config-BPYy0PCN.js → config-UdFHLZs6.js} +1 -1
- package/dist/client/assets/{connect-DOJcei6R.js → connect-CsG4Vqc-.js} +1 -1
- package/dist/client/assets/{connect-layout-Cf6GuLdj.js → connect-layout-DE_So4kH.js} +1 -1
- package/dist/client/assets/{connection-BpKydrrq.js → connection-CEK3iDim.js} +1 -1
- package/dist/client/assets/{connection-card-IwdFS34P.js → connection-card-Zhg6xn7V.js} +1 -1
- package/dist/client/assets/{connection-detail-C2DKmrpZ.js → connection-detail-lT3XwVgT.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BvKR417-.js → connection-form-helpers-DAFP702a.js} +1 -1
- package/dist/client/assets/{connections-BXBz-7gT.js → connections-Chwm450B.js} +1 -1
- package/dist/client/assets/{content-tab-D9fcn3Hp.js → content-tab-DYpKep2J.js} +3 -3
- package/dist/client/assets/{context-C-E2WXON.js → context-Bfj5rpO_.js} +1 -1
- package/dist/client/assets/{context-menu-TYrOMe5c.js → context-menu-BFA8rRfY.js} +1 -1
- package/dist/client/assets/{context-shell-On92TM5F.js → context-shell-CUCiFtf6.js} +3 -3
- package/dist/client/assets/{core.esm-CpQIzrUC.js → core.esm-BO316fgf.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DgF1IFc_.js → create-organization-dialog-Cb6YY9K7.js} +1 -1
- package/dist/client/assets/{daily-pulse-BOC5UzEe.js → daily-pulse-C0-1QTxZ.js} +1 -1
- package/dist/client/assets/{discover-BlLiIBf4.js → discover-BqgmKYIf.js} +1 -1
- package/dist/client/assets/{domain-settings-BDcWjcTo.js → domain-settings-B_QSN-on.js} +1 -1
- package/dist/client/assets/{drawer-DDevbGRy.js → drawer-DL0G-oy-.js} +1 -1
- package/dist/client/assets/{editor-DlDOOY_4.js → editor-B62-XQRE.js} +1 -1
- package/dist/client/assets/{editor-classes-BA-XOPn9.js → editor-classes-BAKuqcj0.js} +1 -1
- package/dist/client/assets/{empty-state-D0xYsV2u.js → empty-state-JTI0oLk7.js} +1 -1
- package/dist/client/assets/{empty-state-t0TjoYVp.js → empty-state-lzzC-d42.js} +1 -1
- package/dist/client/assets/{extract-connection-data-dh3iYmVg.js → extract-connection-data-BlmKelwb.js} +1 -1
- package/dist/client/assets/{feature-gate-BqkgE7TM.js → feature-gate-DQ2MNs-B.js} +1 -1
- package/dist/client/assets/{feature-paywall-BeChu0JL.js → feature-paywall-BSXK-EmV.js} +1 -1
- package/dist/client/assets/{file-explorer-DbsjbKj4.js → file-explorer-CcePNy3q.js} +1 -1
- package/dist/client/assets/{file-preview-BPilYeri.js → file-preview-DFkUyLsr.js} +1 -1
- package/dist/client/assets/{file-share-button-tFfE-sDm.js → file-share-button-CQ2Uf2PU.js} +1 -1
- package/dist/client/assets/{file-type-icon-CqiTsqkN.js → file-type-icon-HF5UcaS2.js} +1 -1
- package/dist/client/assets/flat-project-B3HLdqxT.js +1 -0
- package/dist/client/assets/{folder-icon-CqdHG3Ev.js → folder-icon-DaIPH_Nm.js} +1 -1
- package/dist/client/assets/{form-C2a6JNu4.js → form-DNjk4sZI.js} +1 -1
- package/dist/client/assets/{general-B_qz-x25.js → general-D2dbnN_J.js} +1 -1
- package/dist/client/assets/{home-Ctm57HqD.js → home-CvMudobI.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-CtVznVdZ.js → hosted-publish-feedback-DtU7FOId.js} +1 -1
- package/dist/client/assets/{icon-button-C9jD2Hx3.js → icon-button-WP5IJTs8.js} +1 -1
- package/dist/client/assets/{index-F1Fq1aIw.js → index-B9qNCJbx.js} +1 -1
- package/dist/client/assets/{index-CEuerbGa.js → index-BaQyqQF-.js} +1 -1
- package/dist/client/assets/{index-DH5YV3Rc.js → index-BdR6LNyh.js} +1 -1
- package/dist/client/assets/{index-B6SVRi7N.js → index-C13QaLdF.js} +1 -1
- package/dist/client/assets/{index-BjKnuEDd.js → index-CVLOGr5B.js} +1 -1
- package/dist/client/assets/{index-DKA5Ly4T.js → index-ChfkzyhC.js} +3 -3
- package/dist/client/assets/{index-C5H0Wt50.js → index-D6gxSs-5.js} +1 -1
- package/dist/client/assets/{index-6Ue7sPGM.js → index-DAYXa7zL.js} +1 -1
- package/dist/client/assets/{index-BDybMsIS.js → index-DCOsLpC6.js} +1 -1
- package/dist/client/assets/{index-8f_vFFVa.js → index-DEQvnIsm.js} +6 -6
- package/dist/client/assets/{index-CYl6IUJL.js → index-DZLfyA8t.js} +1 -1
- package/dist/client/assets/{index-DZi1rH7e.js → index-DtysKpnb.js} +1 -1
- package/dist/client/assets/{index-D4devard.js → index-JvhyBpMR.js} +1 -1
- package/dist/client/assets/{index-CZ5aoytF.js → index-a-46Uqqs.js} +1 -1
- package/dist/client/assets/{index-CvDeki2h.js → index-mh7U_AKI.js} +1 -1
- package/dist/client/assets/{index-redirect-DJJ4lwhG.js → index-redirect-dS_ROPu1.js} +1 -1
- package/dist/client/assets/{index-CaC0mBls.js → index-wkvFsHpn.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DUxIIdhP.js → infiniteQueryObserver-BnP8vr6V.js} +1 -1
- package/dist/client/assets/{infra-billing-kH_OZb0R.js → infra-billing-BeLfFWAD.js} +1 -1
- package/dist/client/assets/{input-BhCR1Dvt.js → input-Brhdhig1.js} +7 -7
- package/dist/client/assets/{input-CTTf6mSe.js → input-Bu2Qzwzh.js} +1 -1
- package/dist/client/assets/{integration-icon-CjUkpUFA.js → integration-icon-Bysyldtc.js} +1 -1
- package/dist/client/assets/{jira-icon-BV6Nhy1J.js → jira-icon-DJANnyLA.js} +1 -1
- package/dist/client/assets/{label-DTdw4ToM.js → label-Cf2Qy475.js} +1 -1
- package/dist/client/assets/{layout-CRHpNA-L.js → layout-CQ47j80U.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-WWlJLiCC.js → legacy-agents-deep-BdSVZFZL.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-xsE3RuJ6.js → legacy-main-redirect-BaYQkGoI.js} +1 -1
- package/dist/client/assets/library-DTps1LzJ.js +1 -0
- package/dist/client/assets/{library-tab-BHuSO7Qk.js → library-tab-C2aU1qmT.js} +1 -1
- package/dist/client/assets/{login-B1XLhTh8.js → login-BCT_8F_z.js} +1 -1
- package/dist/client/assets/{markdown-gIWrkm71.js → markdown-DgDY2QmE.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Cx5_Cgu7.js → mcp-app-renderer-pDbHkuXF.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DJLJ4jjk.js → mcp-oauth-C_-ZUSLH.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BCVDfjxS.js → mcp-oauth-aX1L4mRw.js} +1 -1
- package/dist/client/assets/{members-IeYYyp52.js → members-DNkbLBWU.js} +1 -1
- package/dist/client/assets/{memory-8PEu9ts-.js → memory-CWT1ZdIC.js} +1 -1
- package/dist/client/assets/{mini-report-page-zQ3aWwnQ.js → mini-report-page-aWQFmVFz.js} +1 -1
- package/dist/client/assets/{mock-board-BCunCtVN.js → mock-board-DWNU2n2-.js} +1 -1
- package/dist/client/assets/{monaco-editor-DKn4Wqed.js → monaco-editor-DDuHJmyY.js} +1 -1
- package/dist/client/assets/monitoring-Cvbt9Za_.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-3Jmtoo1S.js → monitoring-stats-row-DyiPtUKv.js} +1 -1
- package/dist/client/assets/{multi-select-CGJa6-FA.js → multi-select-CfDYfsZ-.js} +1 -1
- package/dist/client/assets/{mustache-4NqYiukY.js → mustache-DrIjKpei.js} +1 -1
- package/dist/client/assets/{new-project-dialog-7fKdzYQ0.js → new-project-dialog-DKeFr4C7.js} +1 -1
- package/dist/client/assets/{oauth-callback-Ux7KLfo6.js → oauth-callback-B1G7saOE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BHpLfzCW.js → oauth-callback-ai-provider-mNgeHhki.js} +1 -1
- package/dist/client/assets/{onboarding-Bxi7_FIG.js → onboarding-kCa3Jkpy.js} +1 -1
- package/dist/client/assets/{openai-conversation-_BlnoTN9.js → openai-conversation-CLgg2Qod.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Bq6xThGH.js → optimistic-project-sidebar-views-BaDUYmKF.js} +1 -1
- package/dist/client/assets/{order-monitor-day-B-gorx4b.js → order-monitor-day-C_yvKTz5.js} +1 -1
- package/dist/client/assets/{organization-choice-u2ufM7LR.js → organization-choice-BpI-_S8p.js} +1 -1
- package/dist/client/assets/{orgs-Q_88vgEa.js → orgs-BEJlYBbK.js} +1 -1
- package/dist/client/assets/{page-seo-form-CUUspMT0.js → page-seo-form-N1KKSZaU.js} +1 -1
- package/dist/client/assets/{pair-Da1JuUQW.js → pair-ByV0vAAs.js} +1 -1
- package/dist/client/assets/plan-BtuC_TCe.js +1 -0
- package/dist/client/assets/{plan-ladder--KlfKV0O.js → plan-ladder-CFysCUYy.js} +1 -1
- package/dist/client/assets/{popover-DkjgCDyk.js → popover-CjfUWaC0.js} +1 -1
- package/dist/client/assets/{post-calendar-CzWgDY6o.js → post-calendar-Bk6dx49G.js} +1 -1
- package/dist/client/assets/{post-editor-uOMVUWIp.js → post-editor-BUlsS3rc.js} +1 -1
- package/dist/client/assets/{preview-content-D6DnhkDr.js → preview-content-UW33EMCo.js} +1 -1
- package/dist/client/assets/{preview-dialog-Cz0QjPnU.js → preview-dialog-DWW9xaMT.js} +1 -1
- package/dist/client/assets/{preview-panel-D860QFoB.js → preview-panel-C2ZH3x01.js} +1 -1
- package/dist/client/assets/{preview-tab-BqXweaop.js → preview-tab-DsWFy6nY.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BzRtZ0Xh.js → product-picker-dialog-ERcYwJUp.js} +1 -1
- package/dist/client/assets/{profile-CaSyUNvq.js → profile-BxA_I2_7.js} +1 -1
- package/dist/client/assets/{project-app-view-DSjmraQa.js → project-app-view-D-3K5nUJ.js} +1 -1
- package/dist/client/assets/{project-apps-BNzfntH4.js → project-apps-D50B5nYg.js} +1 -1
- package/dist/client/assets/{project-feed-sOra10wH.js → project-feed-zQus1O7R.js} +1 -1
- package/dist/client/assets/{project-icon-DDLQLFHN.js → project-icon-ChTT5o1a.js} +1 -1
- package/dist/client/assets/project-reports-B3JoeeH6.js +1 -0
- package/dist/client/assets/project-tasks-UglBCJxC.js +1 -0
- package/dist/client/assets/{projects-DSQkMTlh.js → projects-CKCvSpxg.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CgcVDMN1.js → projects-empty-state-SWDBQkN4.js} +1 -1
- package/dist/client/assets/{prompts-LsFvKrUX.js → prompts-oa8BoX1i.js} +1 -1
- package/dist/client/assets/record-editor-C4fMBCCz.js +1 -0
- package/dist/client/assets/{redirect-editor-js4vnIyF.js → redirect-editor-vQorNOA7.js} +1 -1
- package/dist/client/assets/reports-BTilnVW5.js +1 -0
- package/dist/client/assets/{reports-YZ_jyIpk.js → reports-BsyMPz_z.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CD-oYnDP.js → reports-onboarding-PNNHl11L.js} +1 -1
- package/dist/client/assets/{reports-tab-BQ5w_NLe.js → reports-tab-DA_8UL9O.js} +2 -2
- package/dist/client/assets/repositories-BNK48Uq5.js +1 -0
- package/dist/client/assets/{repositories-AUaQi6Lg.js → repositories-BpTNBXai.js} +1 -1
- package/dist/client/assets/{repository-binding-DbCSIQ25.js → repository-binding-DpSh0bkT.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BNXAK2-d.js → repository-import-picker-CmGbASze.js} +1 -1
- package/dist/client/assets/{repository-picker-DdXZfSFi.js → repository-picker-C86kcY-U.js} +1 -1
- package/dist/client/assets/{require-capability-KC9Pz6jZ.js → require-capability-D4dR1lZc.js} +1 -1
- package/dist/client/assets/{required-auth-layout-yR_GLYbd.js → required-auth-layout-RW5dOh2c.js} +1 -1
- package/dist/client/assets/{reset-password-BdTHHMoh.js → reset-password-lP2OGZgV.js} +1 -1
- package/dist/client/assets/{resizable-CZG2RiqM.js → resizable-DueLEUEm.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CjkK_zYj.js → resolve-tab-icon-B66mDW53.js} +1 -1
- package/dist/client/assets/{review-settings-DqAJTW90.js → review-settings-JhWFefH3.js} +1 -1
- package/dist/client/assets/{roles-sjKQ_yFr.js → roles-CT2aKtzc.js} +1 -1
- package/dist/client/assets/{route-BFrqyY7M.js → route-C6Ybfjjx.js} +1 -1
- package/dist/client/assets/route-CQTsC5_0.js +1 -0
- package/dist/client/assets/{route-02oV_rQq.js → route-K-xr6t6Y.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DR_2NQXy.js → sandbox-lifecycle-context-BIf8-4ZY.js} +1 -1
- package/dist/client/assets/{schema-DqvEKlh8.js → schema-Bcb37BRV.js} +1 -1
- package/dist/client/assets/{schema-B0rKeG_L.js → schema-BzqS-kNt.js} +1 -1
- package/dist/client/assets/{scroll-area-CxMQI3lN.js → scroll-area-CIRLWlOA.js} +1 -1
- package/dist/client/assets/{search-input-CUDMkzW3.js → search-input-Br9i_Ft5.js} +1 -1
- package/dist/client/assets/{search-toggle-DQNLDkeN.js → search-toggle-Dj92h38-.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-Cwn7ogUH.js → secret-ciphertext-6VBjcV3b.js} +1 -1
- package/dist/client/assets/{secret-picker-DB8u6Egh.js → secret-picker-NhuvO0ke.js} +1 -1
- package/dist/client/assets/{secrets-5Kc02H3G.js → secrets-D4GRsD5W.js} +1 -1
- package/dist/client/assets/{sections-DrN4NbyG.js → sections-DzoS45qS.js} +1 -1
- package/dist/client/assets/{sections-editor-DNUBhdzI.js → sections-editor-C_iMM594.js} +1 -1
- package/dist/client/assets/{select-CD39mfCB.js → select-ChqJI0MI.js} +1 -1
- package/dist/client/assets/{select-model-nIvZx6mv.js → select-model-CzvrFpf6.js} +1 -1
- package/dist/client/assets/{seo-editor-DJq3zWnQ.js → seo-editor-DUiWy8Gm.js} +1 -1
- package/dist/client/assets/{separator-G8XO4ZVv.js → separator-5oK4b-Mi.js} +1 -1
- package/dist/client/assets/settings-tab-C1pr-l9r.js +1 -0
- package/dist/client/assets/{sheet-EnE9wqRk.js → sheet-CzJFx6b-.js} +1 -1
- package/dist/client/assets/{shell-layout-BPP608jE.js → shell-layout-DKGS0yWx.js} +1 -1
- package/dist/client/assets/site-editor-Bl1xnqtg.js +1 -0
- package/dist/client/assets/{site-editor-toast-D3wQqSbx.js → site-editor-toast-CmNIWnCw.js} +1 -1
- package/dist/client/assets/{skills-CiOFCiY2.js → skills-DEb_PUzK.js} +1 -1
- package/dist/client/assets/{slider-CUo-tkVk.js → slider-BBmtNfbs.js} +1 -1
- package/dist/client/assets/{sortable.esm-CVfxAykx.js → sortable.esm-BuCSUlOk.js} +1 -1
- package/dist/client/assets/{sso-D5Sp0hWe.js → sso-DX8PZk1N.js} +1 -1
- package/dist/client/assets/{suggestion-DoQ2WmJO.js → suggestion-DRP05M3-.js} +1 -1
- package/dist/client/assets/{switch-CnVsSUQF.js → switch-CJc_fIEE.js} +1 -1
- package/dist/client/assets/{symbol-DoarKbx_.js → symbol-C1zrmwNF.js} +1 -1
- package/dist/client/assets/{synced-repos-Cg3chrWr.js → synced-repos-GT8waIWj.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Bo6d63je.js → tab-icon-glyph-D6mZxF_9.js} +1 -1
- package/dist/client/assets/{table-BRoMxHYw.js → table-CltsOK_0.js} +1 -1
- package/dist/client/assets/{tabs-DRVG225q.js → tabs-D0oiuUhC.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-CQcT6saR.js → task-assignee-avatar-BfUNDI59.js} +1 -1
- package/dist/client/assets/{task-board-CYLfSrEW.js → task-board-DUTGhEiC.js} +1 -1
- package/dist/client/assets/{task-route-vO53W0Ko.js → task-route-BpmTIbg4.js} +1 -1
- package/dist/client/assets/{task-status-F4H3Ga9G.js → task-status-C72thlpO.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DG4Zz1H_.js +1 -0
- package/dist/client/assets/{tasks-Bt9wXPlt.js → tasks-Cf4EZXG5.js} +1 -1
- package/dist/client/assets/tasks-D-91kNhg.js +1 -0
- package/dist/client/assets/{textarea-CKgIiSeB.js → textarea-CWgoXXnV.js} +1 -1
- package/dist/client/assets/{thread-analytics-or-g-yCI.js → thread-analytics-BjWUFe-q.js} +1 -1
- package/dist/client/assets/{thread-intent-pizqUsAw.js → thread-intent-8kpZLcDE.js} +1 -1
- package/dist/client/assets/{thread-route-RN7dQnhv.js → thread-route-B_SMytnm.js} +1 -1
- package/dist/client/assets/{thread-route-qt3bqNNd.js → thread-route-DTbE-Col.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CNNUBoOL.js → thread-sheet-body-OnJZloqZ.js} +1 -1
- package/dist/client/assets/{time-range-picker-Do6bf1fb.js → time-range-picker-BJ8aJbM7.js} +1 -1
- package/dist/client/assets/{toggle-group-BflgkGO4.js → toggle-group-BWQRN38D.js} +1 -1
- package/dist/client/assets/{tool-namespace-C8V5CWK9.js → tool-namespace-CTeV292R.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BKf8C7rk.js → toolbar-icon-button-BypH-a8F.js} +1 -1
- package/dist/client/assets/{tooltip-UP0IE2Tr.js → tooltip-B6NbTX5P.js} +1 -1
- package/dist/client/assets/{tooltipContext-Cp5fQVar.js → tooltipContext-DNlXAkZZ.js} +1 -1
- package/dist/client/assets/{track-B3_MOgCa.js → track-B0UUbkCz.js} +1 -1
- package/dist/client/assets/{types-ODqpEiLj.js → types-m1Dsi5sG.js} +1 -1
- package/dist/client/assets/{url-slug-D457Gzas.js → url-slug-CYvqbzge.js} +1 -1
- package/dist/client/assets/{usage-stats-BJ2G_LxU.js → usage-stats-BH4bqLoE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CNozmlYS.js → use-ai-providers-W2Q5vYCk.js} +1 -1
- package/dist/client/assets/{use-automations-SYapFBvC.js → use-automations-Q-O37R-p.js} +1 -1
- package/dist/client/assets/{use-autosave-7cTC6S23.js → use-autosave-BWJWTtk0.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CS60364s.js → use-chat-layout-state-C-XHZ0Dd.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bn5JCPrV.js → use-clock-tick-xpCK7CUB.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Bpzill-_.js → use-connect-companion-DJ8vj1p7.js} +1 -1
- package/dist/client/assets/{use-connection-Dbx4XQH4.js → use-connection-Cqf7M1G6.js} +1 -1
- package/dist/client/assets/{use-content-sync-CXWC9odL.js → use-content-sync-D6XyiV7H.js} +1 -1
- package/dist/client/assets/{use-copy-BcbcC4Wz.js → use-copy-Dkgb0DtI.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-XIxu-PVm.js → use-create-virtual-mcp-BZx-8s-I.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BPuP1KRV.js → use-date-fns-locale-B1aPt2Gv.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DJFJgv7S.js → use-debounced-autosave-Qji0VG0D.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BcnQYbv8.js → use-debounced-value-vhgvmVq4.js} +1 -1
- package/dist/client/assets/{use-deco-credits-sH8JcXii.js → use-deco-credits-k0aTLB-T.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DnweVhcO.js → use-decopilot-events-Czwn8ZVj.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DkV3GtTv.js → use-delete-connection-DbRA1FXb.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CeuCnmzX.js → use-deployment-admin-BrGfiqwj.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-DCSsD6mp.js → use-ensure-project-folder-BvOs3JKp.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Bm81iT9U.js → use-fast-preview-draft-url-oDwhtnfP.js} +1 -1
- package/dist/client/assets/{use-file-configs-DBaPVWpT.js → use-file-configs-BIHMmAjW.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BpXgn0oj.js → use-inbox-feed-SkFacTLx.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C3Owd_r6.js → use-infinite-scroll-B9sczgXI.js} +1 -1
- package/dist/client/assets/{use-join-requests-mMEcdIqR.js → use-join-requests-DALj-BO-.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BPcXXbeG.js → use-main-panel-tabs-Cv3Ydqwx.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-DQ3Tp7hb.js → use-main-schema-v8-Jzc_7tOC.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-HN52RbO4.js → use-mcp-auth-status-BKawZyTw.js} +1 -1
- package/dist/client/assets/{use-mcp-client-GXi3d-TN.js → use-mcp-client-CAdgJ_QT.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DYr_PMFD.js → use-mcp-prompts-D1rnFTSb.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-1_L9lL6N.js → use-mcp-tools-CPGj7A6a.js} +1 -1
- package/dist/client/assets/{use-members-C4hziWH9.js → use-members-D-L919KG.js} +1 -1
- package/dist/client/assets/{use-mobile-7XbQJiX0.js → use-mobile-CSFJ-mhK.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bh1luKWv.js → use-navigate-to-agent-B-QlLf3R.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CbfiZ6nK.js → use-open-billing-url-DWsw6Alp.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CXEz66O9.js → use-org-auth-client-Co_fa5Pp.js} +1 -1
- package/dist/client/assets/{use-org-fs-BdAqd8Rv.js → use-org-fs-CAwgni1d.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-uQXeH0Jz.js → use-org-repo-syncs-Cxt6puu1.js} +1 -1
- package/dist/client/assets/{use-org-sso-CAhUTOPh.js → use-org-sso-BhMczCH6.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BuYemyb5.js → use-organization-roles-DZJHfOlV.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Toq_f_Mz.js → use-organization-settings-BtOReG0H.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CLNhl3ki.js → use-panel-navigate-BwwjvhNB.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-B7KEsCj_.js → use-project-native-view-presence-D4pR1T7b.js} +1 -1
- package/dist/client/assets/{use-project-scope-IOK1T5p5.js → use-project-scope-Dn4doId4.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DyohzVX8.js → use-recent-apps-B_BFFpi_.js} +1 -1
- package/dist/client/assets/{use-releases-yUP6RI_5.js → use-releases-DoIKvYCz.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Dx09lDp9.js → use-reports-diagnostic-COAemppC.js} +1 -1
- package/dist/client/assets/{use-secrets-CwVJb7xf.js → use-secrets-CA-kSu-4.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C21P5QN6.js → use-section-preview-base-DAksxTnD.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CA2jDAa-.js → use-sidebar-collapsed-Dv10z2iu.js} +1 -1
- package/dist/client/assets/{use-tags-B6X9pJd5.js → use-tags-CUZ9CIka.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-RsYdGMIC.js → use-task-board-analytics-34pQYq8w.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DphBWYih.js → use-task-board-events-CmYlpSMI.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-wBGqnWKt.js → use-task-board-item-prs-Cu4afbvW.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BKurahZz.js → use-task-metadata-C0A64pXU.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DCrr7FKS.js → use-thread-analytics-DXbq3gl0.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CIGWCWtQ.js → use-thread-outputs-BUN4R0HD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bo5dbMM_.js +1 -0
- package/dist/client/assets/{useQueries-CSpn2OpV.js → useQueries-DNx9dZks.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CcFcpWuM.js +1 -0
- package/dist/client/assets/{users-CEoww2_1.js → users-DWxowv8y.js} +1 -1
- package/dist/client/assets/{utils-2rl9BEeu.js → utils-D-52h1Lf.js} +1 -1
- package/dist/client/assets/{variant-calendar-D-cEXz9T.js → variant-calendar-BQESjgmt.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-yGSVhJlH.js → variant-draft-pointer-BY7yWri4.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-UGzYIEFg.js → view-mode-toggle-Bgum-rnB.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DJrUra0R.js → virtual-mcp-CPoLjKOt.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BF6OquCU.js → watch-sse-pool-C7xRCtu5.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BpE-oLAW.js +0 -1
- package/dist/client/assets/agent-deck-BLI_AFXm.js +0 -1
- package/dist/client/assets/agent-file-Cdh_qco_.js +0 -1
- package/dist/client/assets/agent-library--bem7YGi.js +0 -1
- package/dist/client/assets/agent-library-file-CkXwnu9_.js +0 -1
- package/dist/client/assets/agent-settings-Dd_ntOEj.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CNBje50_.js +0 -2
- package/dist/client/assets/agent-site-editor-content-ClbNQtwa.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DwLqOSDR.js +0 -1
- package/dist/client/assets/agent-view-AVtmtnDB.js +0 -1
- package/dist/client/assets/api-keys-Bl6Bc96G.js +0 -1
- package/dist/client/assets/cms-settings-editor-bH28Cwco.js +0 -1
- package/dist/client/assets/flat-project-B8clA1X9.js +0 -1
- package/dist/client/assets/library-DKPNWFrQ.js +0 -1
- package/dist/client/assets/monitoring-COl6Otnm.js +0 -1
- package/dist/client/assets/plan-DTu4f1lM.js +0 -1
- package/dist/client/assets/project-reports-BRXQTs8U.js +0 -1
- package/dist/client/assets/project-tasks-C1jXBWPU.js +0 -1
- package/dist/client/assets/record-editor-DNnWgGZk.js +0 -1
- package/dist/client/assets/reports-BRc7lcn2.js +0 -1
- package/dist/client/assets/repositories-BeYoVJCK.js +0 -1
- package/dist/client/assets/route-BQjTTZG2.js +0 -1
- package/dist/client/assets/settings-tab-CjHjlnds.js +0 -1
- package/dist/client/assets/site-editor-CDy9Dqbl.js +0 -1
- package/dist/client/assets/taskboard-analytics-B2r791B3.js +0 -1
- package/dist/client/assets/tasks-DOI54OO2.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Z2Fpq8_2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BK8FDRCQ.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-
|
|
2
|
-
import{c as le,j as o,o as Uo,e as Go,K as Pn,b as Ne,l as ve,r as L,h as ft,s as us,v as Yt,I as bt,B as Re,w as ps,q as qt,D as Wt,aM as Kn,t as xe,an as hi,aS as os,a$ as es,T as Ls,aT as io,V as Is,X as Ks,aX as Fn,aN as xi,U as Ze,av as Fs,ag as bn,aq as bi,a2 as yi,u as Ho,aZ as He}from"./index-8f_vFFVa.js";import{a as Mn}from"./use-organization-settings-Toq_f_Mz.js";import{u as ms,c as zn}from"./chat-context-0V74JN43.js";import{i as rs}from"./AlertCircle-DGyqrcs1.js";import{a2 as Yo,E as ro,a3 as qo,a4 as Vn,a5 as Wo,a6 as vi,b as Ms,Y as Jo,a7 as ki,a8 as Si,a9 as ji,aa as wi,ab as Tn,n as Ci,ac as Xo,ad as Ni,ae as _i,af as Pi,k as lo,ag as Ti,a1 as Qo}from"./agent-icon-DtUVrwO-.js";import{a as Zo,s as zs,i as Un,e as Ai,f as co}from"./UserSquare-4I8cSrJU.js";import{b as ea,i as ta}from"./ZoomOut-Clz13c-y.js";import{c as sa,i as Ei}from"./SwitchHorizontal01-CeUNJpHb.js";import{s as Gn}from"./Plus-BqeqBPMZ.js";import{t as na}from"./Users01-BNiwpGyg.js";import{f as Di,e as Bi,b as Oi,A as $i,a as Ri,d as Li,c as Ii,g as Ki}from"./alert-dialog-C884MJiU.js";import{S as tn}from"./scroll-area-CxMQI3lN.js";import{T as qe,a as We,c as Je}from"./tooltip-UP0IE2Tr.js";import{M as oa,c as Hn,X as aa,Y as ia,j as ra,Z as Fi,N as Vs,_ as Us,u as Yn,w as Mi,$ as zi,a0 as Vi,a1 as Ui,K as la,P as Gi,J as Hi,L as Yi,b as qi}from"./site-editor-toast-D3wQqSbx.js";import{n as yn,k as Wi,c as Ji,g as ca,B as vn,P as Xi,o as Qi,q as da,s as Zi,t as er,v as tr,L as sr,u as sn,l as nr,w as or,R as ar,x as ua,r as ir,y as rr,a as pa,z as lr,A as cr,D as ma,E as dr,M as ur,j as pr,F as mr,p as fr,G as gr,H as hr,i as xr,d as br,b as yr,f as vr,C as kr,S as Sr,I as uo,N as jr}from"./blocks-tab-states-CbP4bRnZ.js";import{x as qn,y as wr,i as Cr,z as Nr,A as _r,B as fa,n as Os,v as Pr,E as Tr,F as Ar,e as Er,G as Dr,H as Wn,g as Br,I as Or,q as po,J as mo,K as $r,r as Rr,M as Lr,o as Ir,O as ga,u as Kr,P as Fr,Q as Mr,T as zr}from"./secret-ciphertext-Cwn7ogUH.js";import{u as Vr,P as Ur}from"./mustache-4NqYiukY.js";import{u as Gr}from"./use-content-sync-CXWC9odL.js";import{t as ha}from"./sandbox-git-api-CRxdlhrN.js";import{a as nn}from"./input-BhCR1Dvt.js";import{b as Gs}from"./sandbox-url-D3mC8qhT.js";import{a as An}from"./utils-2rl9BEeu.js";import{a as xa,c as ba}from"./repository-binding-DbCSIQ25.js";import{n as ya}from"./ShoppingBag01-DZQO7QtG.js";import{t as ls}from"./ChevronUp-COqs90Hs.js";import{C as Hr,a as Yr,b as qr}from"./collapsible-BaAUa-uq.js";import{u as Wr}from"./index-6Ue7sPGM.js";import{b as Jr}from"./sandbox-lifecycle-context-DR_2NQXy.js";import{C as on}from"./checkbox-FJR9GBSz.js";import{L as mt}from"./label-DTdw4ToM.js";import{c as Xr,b as Qr,a as Zr,d as el,S as tl}from"./select-CD39mfCB.js";import{s as sl}from"./thread-intent-pizqUsAw.js";import{i as nl}from"./CheckCircle-CqYnJPRs.js";import{a as Jn}from"./Copy01-CgH6S_M4.js";import{s as Xn}from"./Trash01-DeYkLyg0.js";import{i as kn}from"./Upload01-zDvi7WnN.js";import{B as Qn}from"./badge-Bmk8ti5E.js";import{E as ol}from"./empty-state-t0TjoYVp.js";import{u as al}from"./use-ai-providers-CNozmlYS.js";import{T as fo}from"./textarea-CKgIiSeB.js";import{u as il}from"./use-file-configs-DBaPVWpT.js";import{MonacoCodeEditor as va}from"./monaco-editor-DKn4Wqed.js";import"./core.esm-CpQIzrUC.js";import"./sortable.esm-CVfxAykx.js";import{b as rl}from"./Tool01-BgkFSAcX.js";import{a as go}from"./use-main-schema-v8-DQ3Tp7hb.js";import{E as ll}from"./empty-state-D0xYsV2u.js";import{G as ho}from"./repository-picker-DdXZfSFi.js";import{R as cl}from"./repository-import-picker-BNXAK2-d.js";function ka(){return Mn("blog_ai_enabled")}function dl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([n])=>!e.includes(n)));return Object.keys(s).length>0?{...t,properties:s}:t}function ul(t,e,s){return typeof t!="string"?null:dl(qn(t,e),s)}function Sa(t,e,s){if(!e||typeof t!="string")return!1;const n=ul(t,e,s);return!!n&&Object.keys(n.properties??{}).length>0}const xo="CMS",En="cms-settings";function pl(t){const e=t?.manifest?.blocks??{};return Object.values(e).some(s=>!!s&&Object.hasOwn(s,En))}function fm(t){const e=Object.hasOwn(t,xo)?t[xo]:void 0;if(e==null)return{kind:"absent",block:{__resolveType:En}};const s=typeof e=="object"&&!Array.isArray(e)?e.__resolveType:void 0;return s!==En?{kind:"conflict",resolveType:typeof s=="string"?s:""}:{kind:"saved",block:e}}const ml=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"Loaders, actions and workflows for adding VTEX Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png"},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Loaders, actions and workflows for adding Shopify Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png"},{blockKey:"deco-vnda",vendor:"deco",app:"vnda",title:"VNDA",description:"Loaders, actions and workflows for adding VNDA Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vnda/logo.png"},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Loaders, actions and workflows for adding Wake Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png"},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Loaders, actions and workflows for adding Nuvemshop Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png"},{blockKey:"deco-linx",vendor:"deco",app:"linx",title:"Linx",description:"Loaders, actions and workflows for adding Linx Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/linx.png"},{blockKey:"deco-wap",vendor:"deco",app:"wap",title:"Uappi",description:"Loaders, actions and workflows for adding Uappi Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/uappi.png"},{blockKey:"deco-sap",vendor:"deco",app:"sap",title:"SAP Commerce",description:"Loaders, actions and workflows for adding SAP Commerce Platform to your website.",category:"Ecommerce",logo:"https://decoims.com/decocms/389b8d9b-e102-4ee7-9e9b-9c81c433581a/Sap_fav.png"},{blockKey:"deco-streamshop",vendor:"deco",app:"streamshop",title:"Streamshop",description:"Incorporate videos into your eCommerce. Boost sales significantly with Video Commerce Streamshop.",category:"Ecommerce"},{blockKey:"deco-algolia",vendor:"deco",app:"algolia",title:"Algolia",description:"Product search & discovery that increases conversions at scale.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/algolia/logo.png"},{blockKey:"deco-typesense",vendor:"deco",app:"typesense",title:"TypeSense",description:"Open source search engine meticulously engineered for performance & ease-of-use.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/typesense/logo.png"},{blockKey:"deco-smarthint",vendor:"deco",app:"smarthint",title:"SmartHint",description:"Smart search and product recommendation to improve your eCommerce customer experience.",category:"Search",logo:"https://github.com/deco-cx/apps/blob/main/smarthint/logo.png?raw=true"},{blockKey:"deco-linx-impulse",vendor:"deco",app:"linx-impulse",title:"Linx Impulse",description:"Build, manage and deliver B2B, B2C and Marketplace commerce experiences.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/linx-impulse/logo.png"},{blockKey:"deco-verified-reviews",vendor:"deco",app:"verified-reviews",title:"Verified Reviews",description:"A specialized solution in the collection of customer reviews",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/verified-reviews/logo.png"},{blockKey:"deco-power-reviews",vendor:"deco",app:"power-reviews",title:"Power Reviews",description:"Collect more and better Ratings & Reviews and other UGC. Create UGC displays that convert. Analyze to enhance product experience and positioning.",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/power-reviews/logo.png"},{blockKey:"deco-konfidency",vendor:"deco",app:"konfidency",title:"Konfidency",description:"Product reviews and store reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/konfidency.png"},{blockKey:"deco-ra-trustvox",vendor:"deco",app:"ra-trustvox",title:"RA Trustvox",description:"RA Trustvox reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/ra-trustvox.png"},{blockKey:"deco-analytics",vendor:"deco",app:"analytics",title:"Deco Analytics",description:"Measure your site traffic at a glance in a simple and modern web analytics dashboard.",category:"Analytics",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/analytics/logo.png"},{blockKey:"deco-posthog",vendor:"deco",app:"posthog",title:"PostHog",description:"All-in-one platform for product analytics, feature flags, session replays, experiments, and surveys, built for developers.",category:"Analytics",logo:"https://decoims.com/decocms/cb17e9dc-8772-4873-8dae-f5a9f99694d4/posthog-icon-logo-png_seeklogo-483563.png"},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Resend is an email platform that helps developers build and send transactional and marketing emails.",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png"},{blockKey:"deco-mailchimp",vendor:"deco",app:"mailchimp",title:"Mailchimp",description:"Email and marketing automations platform for growing businesses.",category:"Email",logo:"https://assets.decocache.com/admin/094cf93f-f1cb-4ef1-b993-9d9785b3cd0c/channels4_profile-(1).jpg"},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Deco Blog",description:"Manage your posts.",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"},{blockKey:"deco-weather",vendor:"deco",app:"weather",title:"Weather",description:"Vary your content based on the current weather of your visitors.",category:"Tool",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"}],fl=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"VTEX IO commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png",npm:{name:"@decocms/apps-vtex",registryExport:"VTEX_REGISTRY_ENTRY"}},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Shopify Storefront API commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png",npm:{name:"@decocms/apps-shopify",registryExport:"SHOPIFY_REGISTRY_ENTRY"}},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Wake Commerce (Storefront API) integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png",npm:{name:"@decocms/apps-wake",registryExport:"WAKE_REGISTRY_ENTRY"}},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Nuvemshop (Tiendanube) Storefront API commerce integration",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png",npm:{name:"@decocms/apps-nuvemshop",registryExport:"NUVEMSHOP_REGISTRY_ENTRY"}},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Transactional email via Resend",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png",npm:{name:"@decocms/apps-resend",registryExport:"RESEND_REGISTRY_ENTRY"}},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Blog",description:"Blog posts, categories, and authors from CMS collections",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png",npm:{name:"@decocms/apps-blog",registryExport:"BLOG_REGISTRY_ENTRY"}}];function an(t,e){return`${t}-${e}`}function Zn(t,e){return`site/apps/${t}/${e}.ts`}const gl="@decocms/",hl=["@decocms/blocks","@decocms/tanstack","@decocms/blocks-admin"];function xl(t){switch(t){case"deno":return"deno";case"bun":case"npm":case"pnpm":case"yarn":return"tanstack";default:return null}}const bl={"tanstack-start":"tanstack"};function yl(t){return t?bl[t]??null:"deno"}function ja(t){if(!t)return null;try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}function wa(t){const e={};for(const s of["dependencies","devDependencies"]){const n=t[s];if(!(!n||typeof n!="object"||Array.isArray(n)))for(const[a,i]of Object.entries(n))typeof i=="string"&&!(a in e)&&(e[a]=i)}return e}const vl=/^(?:workspace|catalog|link|file|portal|npm|git|github):/;function Ca(t){return vl.test(t)}function kl(t){const e=ja(t);if(!e)return null;const s=wa(e),n=[...hl,...Object.keys(s).filter(i=>i.startsWith(gl)).sort()];let a=null;for(const i of n){const r=s[i];if(r){if(!Ca(r))return r;a??=r}}return a}function Sl(t,e){const s=ja(t);return s?wa(s)[e]??null:null}function jl(t){return t.denoJson!==null?{technology:"deno",decocmsVersion:null}:t.packageJson!==null?{technology:"tanstack",decocmsVersion:kl(t.packageJson)}:null}class Ke extends Error{constructor(e){super(e),this.name="SiteAppInstallError"}}function wl(t){const s=t.replace(/[-_.]+(.)/g,(n,a)=>a.toUpperCase()).replace(/[^A-Za-z0-9$_]/g,"");return`${/^[0-9]/.test(s)?`app${s}`:s}Mod`}function Cl(t){const e=`apps/${t.app}/mod.ts`;return{path:`apps/${t.vendor}/${t.app}.ts`,content:`export { default } from "${e}";
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-Cio5Pq66.js","assets/index-DEQvnIsm.js","assets/index-pFm7t22i.css","assets/chat-context-Dv2E4fnf.js","assets/use-panel-navigate-BwwjvhNB.js","assets/thread-route-DTbE-Col.js","assets/use-project-scope-Dn4doId4.js","assets/repository-binding-DpSh0bkT.js","assets/use-mcp-client-CAdgJ_QT.js","assets/auth-BVkTFTOt.js","assets/autosend-CL2OZPvg.js","assets/thread-intent-8kpZLcDE.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-C7xRCtu5.js","assets/task-board-DUTGhEiC.js","assets/schema-BzqS-kNt.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-Czwn8ZVj.js","assets/use-ai-providers-W2Q5vYCk.js","assets/location-BjlyegC2.js","assets/use-organization-settings-BtOReG0H.js","assets/scroll-area-CIRLWlOA.js","assets/index-BdQq_4o_.js","assets/use-section-preview-base-DAksxTnD.js","assets/UserSquare-cdWcOBLL.js","assets/agent-icon-D6wS7rd0.js","assets/AlertCircle-Q16nTVAa.js","assets/Tool01-Bp-TbrXi.js","assets/ArrowUp--4P0C-xl.js","assets/ArrowLeft-C_dTX_8N.js","assets/LinkBroken01-DmmKNgpp.js","assets/ShoppingBag01-B7gta_qY.js","assets/ZoomOut-B3s5275g.js","assets/Building02-Gub-pr-8.js","assets/CheckCircle-CQxu_pm9.js","assets/ChevronUp-DK-Gvyk8.js","assets/ChevronSelectorVertical-GBLm8Zpl.js","assets/Copy01-EWitDFCf.js","assets/CreditCard01-wx_z4Iiz.js","assets/DotsVertical-DIT5hu2b.js","assets/Image01-BfGAREA7.js","assets/Globe04-B45_cBRN.js","assets/SwitchHorizontal01-BJyDDPw9.js","assets/Key01-BV7tzZs6.js","assets/Link01-9civFIb9.js","assets/Monitor01-BoSs_8gg.js","assets/Sun-BfjJa3ru.js","assets/Play-CleWZLOG.js","assets/Plus-DQf-jm_3.js","assets/SearchMd-D0zp0uee.js","assets/Trash01-Dlk_Sh-H.js","assets/Upload01-DlF9Jqso.js","assets/User01-BcekHhAV.js","assets/Users01-BIP-PxGt.js","assets/XClose-L_GNViCD.js","assets/blocks-tab-states-BjRnBrj4.js","assets/site-editor-toast-CmNIWnCw.js","assets/input-Brhdhig1.js","assets/usage-stats-BH4bqLoE.js","assets/tool-namespace-CTeV292R.js","assets/form-DNjk4sZI.js","assets/label-Cf2Qy475.js","assets/utils-CVEq3hMx.js","assets/markdown-DgDY2QmE.js","assets/use-copy-Dkgb0DtI.js","assets/use-mobile-CSFJ-mhK.js","assets/tooltip-B6NbTX5P.js","assets/index-BaQyqQF-.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-WP5IJTs8.js","assets/file-type-icon-HF5UcaS2.js","assets/shell-layout-DKGS0yWx.js","assets/avatar-LfY3dprD.js","assets/use-clock-tick-xpCK7CUB.js","assets/command-KXg0ZuU-.js","assets/index-B9qNCJbx.js","assets/integration-icon-Bysyldtc.js","assets/project-icon-ChTT5o1a.js","assets/new-project-dialog-DKeFr4C7.js","assets/repository-import-picker-CmGbASze.js","assets/use-navigate-to-agent-B-QlLf3R.js","assets/repository-picker-C86kcY-U.js","assets/useInfiniteQuery-Bo5dbMM_.js","assets/infiniteQueryObserver-BnP8vr6V.js","assets/collection-search-Dcze6ySb.js","assets/use-debounced-value-vhgvmVq4.js","assets/required-auth-layout-RW5dOh2c.js","assets/use-org-sso-BhMczCH6.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-X1dGJc2x.js","assets/select-ChqJI0MI.js","assets/tabs-D0oiuUhC.js","assets/use-deco-credits-k0aTLB-T.js","assets/toggle-group-BWQRN38D.js","assets/use-open-billing-url-DWsw6Alp.js","assets/index-DZLfyA8t.js","assets/checkbox-CaUezNgL.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-CjfUWaC0.js","assets/drawer-DL0G-oy-.js","assets/input-Bu2Qzwzh.js","assets/suggestion-DRP05M3-.js","assets/use-mcp-prompts-D1rnFTSb.js","assets/use-org-fs-CAwgni1d.js","assets/question-004-sINsf4GQ.js","assets/use-members-D-L919KG.js","assets/use-org-auth-client-Co_fa5Pp.js","assets/feature-paywall-BSXK-EmV.js","assets/plan-ladder-CFysCUYy.js","assets/add-connection-dialog-DwDvS8Uw.js","assets/extract-connection-data-BlmKelwb.js","assets/metadata-D72DunRR.js","assets/connection-CEK3iDim.js","assets/url-slug-CYvqbzge.js","assets/connection-card-Zhg6xn7V.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CWgoXXnV.js","assets/use-connection-Cqf7M1G6.js","assets/schema-Bcb37BRV.js","assets/connection-form-helpers-DAFP702a.js","assets/authenticate-and-persist-oauth-POYqGagt.js","assets/mcp-oauth-C_-ZUSLH.js","assets/mcp-oauth-aX1L4mRw.js","assets/collection-tabs-yg6VVFu9.js","assets/badge-CyDHDRPg.js","assets/use-infinite-scroll-B9sczgXI.js","assets/useSuspenseInfiniteQuery-CcFcpWuM.js","assets/use-task-board-events-CmYlpSMI.js","assets/use-chat-layout-state-C-XHZ0Dd.js","assets/input-Bwd_JSM8.css","assets/use-main-schema-v8-Jzc_7tOC.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-D-52h1Lf.js","assets/index-DAYXa7zL.js","assets/pair-ByV0vAAs.js","assets/collapsible-DHXUZre4.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-pDbHkuXF.js","assets/types-m1Dsi5sG.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-CzJFx6b-.js","assets/use-thread-outputs-BUN4R0HD.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-6VBjcV3b.js","assets/alert-PPdejvI2.js","assets/switch-CJc_fIEE.js","assets/monaco-editor-DDuHJmyY.js","assets/editor-B62-XQRE.js","assets/calendar-sxNtZ9wG.js","assets/editor-classes-BAKuqcj0.js","assets/core.esm-BO316fgf.js","assets/sortable.esm-BuCSUlOk.js","assets/view-mode-toggle-Bgum-rnB.js","assets/combobox-B5xPQiKP.js","assets/alert-dialog-ygFmYcOa.js","assets/search-input-Br9i_Ft5.js","assets/use-file-configs-BIHMmAjW.js","assets/asset-utils-Duz2qYol.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/empty-state-JTI0oLk7.js","assets/section-preview-url-7zfngvgW.js","assets/mustache-DrIjKpei.js","assets/use-content-sync-D6XyiV7H.js","assets/sandbox-lifecycle-context-BIf8-4ZY.js","assets/empty-state-lzzC-d42.js","assets/cms-settings-editor-C_3APl39.js","assets/post-editor-BUlsS3rc.js","assets/multi-select-CfDYfsZ-.js","assets/block-document-Di6OpT4O.js","assets/product-picker-dialog-ERcYwJUp.js","assets/index-D6gxSs-5.js","assets/blog-schema-C2heOfy2.js","assets/use-fast-preview-draft-url-oDwhtnfP.js","assets/use-autosave-BWJWTtk0.js","assets/record-editor-C4fMBCCz.js","assets/context-Bfj5rpO_.js","assets/index-DCOsLpC6.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-D_K2FWTB.js","assets/sections-editor-C_iMM594.js","assets/page-seo-form-N1KKSZaU.js","assets/variant-draft-pointer-BY7yWri4.js","assets/seo-editor-DUiWy8Gm.js","assets/variant-calendar-BQESjgmt.js","assets/post-calendar-Bk6dx49G.js","assets/redirect-editor-vQorNOA7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as le,j as o,o as Uo,e as Go,K as Pn,b as Ne,l as ve,r as L,h as ft,s as us,v as Yt,I as bt,B as Re,w as ps,q as qt,D as Wt,aM as Kn,t as xe,an as hi,aS as os,a$ as es,T as Ls,aT as io,V as Is,X as Ks,aX as Fn,aN as xi,U as Ze,av as Fs,ag as bn,aq as bi,a2 as yi,u as Ho,aZ as He}from"./index-DEQvnIsm.js";import{a as Mn}from"./use-organization-settings-BtOReG0H.js";import{u as ms,c as zn}from"./chat-context-Dv2E4fnf.js";import{i as rs}from"./AlertCircle-Q16nTVAa.js";import{a2 as Yo,E as ro,a3 as qo,a4 as Vn,a5 as Wo,a6 as vi,b as Ms,Y as Jo,a7 as ki,a8 as Si,a9 as ji,aa as wi,ab as Tn,n as Ci,ac as Xo,ad as Ni,ae as _i,af as Pi,k as lo,ag as Ti,a1 as Qo}from"./agent-icon-D6wS7rd0.js";import{a as Zo,s as zs,i as Un,e as Ai,f as co}from"./UserSquare-cdWcOBLL.js";import{b as ea,i as ta}from"./ZoomOut-B3s5275g.js";import{c as sa,i as Ei}from"./SwitchHorizontal01-BJyDDPw9.js";import{s as Gn}from"./Plus-DQf-jm_3.js";import{t as na}from"./Users01-BIP-PxGt.js";import{f as Di,e as Bi,b as Oi,A as $i,a as Ri,d as Li,c as Ii,g as Ki}from"./alert-dialog-ygFmYcOa.js";import{S as tn}from"./scroll-area-CIRLWlOA.js";import{T as qe,a as We,c as Je}from"./tooltip-B6NbTX5P.js";import{M as oa,c as Hn,X as aa,Y as ia,j as ra,Z as Fi,N as Vs,_ as Us,u as Yn,w as Mi,$ as zi,a0 as Vi,a1 as Ui,K as la,P as Gi,J as Hi,L as Yi,b as qi}from"./site-editor-toast-CmNIWnCw.js";import{n as yn,k as Wi,c as Ji,g as ca,B as vn,P as Xi,o as Qi,q as da,s as Zi,t as er,v as tr,L as sr,u as sn,l as nr,w as or,R as ar,x as ua,r as ir,y as rr,a as pa,z as lr,A as cr,D as ma,E as dr,M as ur,j as pr,F as mr,p as fr,G as gr,H as hr,i as xr,d as br,b as yr,f as vr,C as kr,S as Sr,I as uo,N as jr}from"./blocks-tab-states-BjRnBrj4.js";import{x as qn,y as wr,i as Cr,z as Nr,A as _r,B as fa,n as Os,v as Pr,E as Tr,F as Ar,e as Er,G as Dr,H as Wn,g as Br,I as Or,q as po,J as mo,K as $r,r as Rr,M as Lr,o as Ir,O as ga,u as Kr,P as Fr,Q as Mr,T as zr}from"./secret-ciphertext-6VBjcV3b.js";import{u as Vr,P as Ur}from"./mustache-DrIjKpei.js";import{u as Gr}from"./use-content-sync-D6XyiV7H.js";import{t as ha}from"./sandbox-git-api-CRxdlhrN.js";import{a as nn}from"./input-Brhdhig1.js";import{b as Gs}from"./sandbox-url-D3mC8qhT.js";import{a as An}from"./utils-D-52h1Lf.js";import{a as xa,c as ba}from"./repository-binding-DpSh0bkT.js";import{n as ya}from"./ShoppingBag01-B7gta_qY.js";import{t as ls}from"./ChevronUp-DK-Gvyk8.js";import{C as Hr,a as Yr,b as qr}from"./collapsible-DHXUZre4.js";import{u as Wr}from"./index-DAYXa7zL.js";import{b as Jr}from"./sandbox-lifecycle-context-BIf8-4ZY.js";import{C as on}from"./checkbox-CaUezNgL.js";import{L as mt}from"./label-Cf2Qy475.js";import{c as Xr,b as Qr,a as Zr,d as el,S as tl}from"./select-ChqJI0MI.js";import{s as sl}from"./thread-intent-8kpZLcDE.js";import{i as nl}from"./CheckCircle-CQxu_pm9.js";import{a as Jn}from"./Copy01-EWitDFCf.js";import{s as Xn}from"./Trash01-Dlk_Sh-H.js";import{i as kn}from"./Upload01-DlF9Jqso.js";import{B as Qn}from"./badge-CyDHDRPg.js";import{E as ol}from"./empty-state-lzzC-d42.js";import{u as al}from"./use-ai-providers-W2Q5vYCk.js";import{T as fo}from"./textarea-CWgoXXnV.js";import{u as il}from"./use-file-configs-BIHMmAjW.js";import{MonacoCodeEditor as va}from"./monaco-editor-DDuHJmyY.js";import"./core.esm-BO316fgf.js";import"./sortable.esm-BuCSUlOk.js";import{b as rl}from"./Tool01-Bp-TbrXi.js";import{a as go}from"./use-main-schema-v8-Jzc_7tOC.js";import{E as ll}from"./empty-state-JTI0oLk7.js";import{G as ho}from"./repository-picker-C86kcY-U.js";import{R as cl}from"./repository-import-picker-CmGbASze.js";function ka(){return Mn("blog_ai_enabled")}function dl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([n])=>!e.includes(n)));return Object.keys(s).length>0?{...t,properties:s}:t}function ul(t,e,s){return typeof t!="string"?null:dl(qn(t,e),s)}function Sa(t,e,s){if(!e||typeof t!="string")return!1;const n=ul(t,e,s);return!!n&&Object.keys(n.properties??{}).length>0}const xo="CMS",En="cms-settings";function pl(t){const e=t?.manifest?.blocks??{};return Object.values(e).some(s=>!!s&&Object.hasOwn(s,En))}function fm(t){const e=Object.hasOwn(t,xo)?t[xo]:void 0;if(e==null)return{kind:"absent",block:{__resolveType:En}};const s=typeof e=="object"&&!Array.isArray(e)?e.__resolveType:void 0;return s!==En?{kind:"conflict",resolveType:typeof s=="string"?s:""}:{kind:"saved",block:e}}const ml=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"Loaders, actions and workflows for adding VTEX Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png"},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Loaders, actions and workflows for adding Shopify Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png"},{blockKey:"deco-vnda",vendor:"deco",app:"vnda",title:"VNDA",description:"Loaders, actions and workflows for adding VNDA Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vnda/logo.png"},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Loaders, actions and workflows for adding Wake Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png"},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Loaders, actions and workflows for adding Nuvemshop Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png"},{blockKey:"deco-linx",vendor:"deco",app:"linx",title:"Linx",description:"Loaders, actions and workflows for adding Linx Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/linx.png"},{blockKey:"deco-wap",vendor:"deco",app:"wap",title:"Uappi",description:"Loaders, actions and workflows for adding Uappi Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/uappi.png"},{blockKey:"deco-sap",vendor:"deco",app:"sap",title:"SAP Commerce",description:"Loaders, actions and workflows for adding SAP Commerce Platform to your website.",category:"Ecommerce",logo:"https://decoims.com/decocms/389b8d9b-e102-4ee7-9e9b-9c81c433581a/Sap_fav.png"},{blockKey:"deco-streamshop",vendor:"deco",app:"streamshop",title:"Streamshop",description:"Incorporate videos into your eCommerce. Boost sales significantly with Video Commerce Streamshop.",category:"Ecommerce"},{blockKey:"deco-algolia",vendor:"deco",app:"algolia",title:"Algolia",description:"Product search & discovery that increases conversions at scale.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/algolia/logo.png"},{blockKey:"deco-typesense",vendor:"deco",app:"typesense",title:"TypeSense",description:"Open source search engine meticulously engineered for performance & ease-of-use.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/typesense/logo.png"},{blockKey:"deco-smarthint",vendor:"deco",app:"smarthint",title:"SmartHint",description:"Smart search and product recommendation to improve your eCommerce customer experience.",category:"Search",logo:"https://github.com/deco-cx/apps/blob/main/smarthint/logo.png?raw=true"},{blockKey:"deco-linx-impulse",vendor:"deco",app:"linx-impulse",title:"Linx Impulse",description:"Build, manage and deliver B2B, B2C and Marketplace commerce experiences.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/linx-impulse/logo.png"},{blockKey:"deco-verified-reviews",vendor:"deco",app:"verified-reviews",title:"Verified Reviews",description:"A specialized solution in the collection of customer reviews",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/verified-reviews/logo.png"},{blockKey:"deco-power-reviews",vendor:"deco",app:"power-reviews",title:"Power Reviews",description:"Collect more and better Ratings & Reviews and other UGC. Create UGC displays that convert. Analyze to enhance product experience and positioning.",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/power-reviews/logo.png"},{blockKey:"deco-konfidency",vendor:"deco",app:"konfidency",title:"Konfidency",description:"Product reviews and store reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/konfidency.png"},{blockKey:"deco-ra-trustvox",vendor:"deco",app:"ra-trustvox",title:"RA Trustvox",description:"RA Trustvox reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/ra-trustvox.png"},{blockKey:"deco-analytics",vendor:"deco",app:"analytics",title:"Deco Analytics",description:"Measure your site traffic at a glance in a simple and modern web analytics dashboard.",category:"Analytics",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/analytics/logo.png"},{blockKey:"deco-posthog",vendor:"deco",app:"posthog",title:"PostHog",description:"All-in-one platform for product analytics, feature flags, session replays, experiments, and surveys, built for developers.",category:"Analytics",logo:"https://decoims.com/decocms/cb17e9dc-8772-4873-8dae-f5a9f99694d4/posthog-icon-logo-png_seeklogo-483563.png"},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Resend is an email platform that helps developers build and send transactional and marketing emails.",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png"},{blockKey:"deco-mailchimp",vendor:"deco",app:"mailchimp",title:"Mailchimp",description:"Email and marketing automations platform for growing businesses.",category:"Email",logo:"https://assets.decocache.com/admin/094cf93f-f1cb-4ef1-b993-9d9785b3cd0c/channels4_profile-(1).jpg"},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Deco Blog",description:"Manage your posts.",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"},{blockKey:"deco-weather",vendor:"deco",app:"weather",title:"Weather",description:"Vary your content based on the current weather of your visitors.",category:"Tool",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"}],fl=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"VTEX IO commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png",npm:{name:"@decocms/apps-vtex",registryExport:"VTEX_REGISTRY_ENTRY"}},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Shopify Storefront API commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png",npm:{name:"@decocms/apps-shopify",registryExport:"SHOPIFY_REGISTRY_ENTRY"}},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Wake Commerce (Storefront API) integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png",npm:{name:"@decocms/apps-wake",registryExport:"WAKE_REGISTRY_ENTRY"}},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Nuvemshop (Tiendanube) Storefront API commerce integration",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png",npm:{name:"@decocms/apps-nuvemshop",registryExport:"NUVEMSHOP_REGISTRY_ENTRY"}},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Transactional email via Resend",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png",npm:{name:"@decocms/apps-resend",registryExport:"RESEND_REGISTRY_ENTRY"}},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Blog",description:"Blog posts, categories, and authors from CMS collections",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png",npm:{name:"@decocms/apps-blog",registryExport:"BLOG_REGISTRY_ENTRY"}}];function an(t,e){return`${t}-${e}`}function Zn(t,e){return`site/apps/${t}/${e}.ts`}const gl="@decocms/",hl=["@decocms/blocks","@decocms/tanstack","@decocms/blocks-admin"];function xl(t){switch(t){case"deno":return"deno";case"bun":case"npm":case"pnpm":case"yarn":return"tanstack";default:return null}}const bl={"tanstack-start":"tanstack"};function yl(t){return t?bl[t]??null:"deno"}function ja(t){if(!t)return null;try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}function wa(t){const e={};for(const s of["dependencies","devDependencies"]){const n=t[s];if(!(!n||typeof n!="object"||Array.isArray(n)))for(const[a,i]of Object.entries(n))typeof i=="string"&&!(a in e)&&(e[a]=i)}return e}const vl=/^(?:workspace|catalog|link|file|portal|npm|git|github):/;function Ca(t){return vl.test(t)}function kl(t){const e=ja(t);if(!e)return null;const s=wa(e),n=[...hl,...Object.keys(s).filter(i=>i.startsWith(gl)).sort()];let a=null;for(const i of n){const r=s[i];if(r){if(!Ca(r))return r;a??=r}}return a}function Sl(t,e){const s=ja(t);return s?wa(s)[e]??null:null}function jl(t){return t.denoJson!==null?{technology:"deno",decocmsVersion:null}:t.packageJson!==null?{technology:"tanstack",decocmsVersion:kl(t.packageJson)}:null}class Ke extends Error{constructor(e){super(e),this.name="SiteAppInstallError"}}function wl(t){const s=t.replace(/[-_.]+(.)/g,(n,a)=>a.toUpperCase()).replace(/[^A-Za-z0-9$_]/g,"");return`${/^[0-9]/.test(s)?`app${s}`:s}Mod`}function Cl(t){const e=`apps/${t.app}/mod.ts`;return{path:`apps/${t.vendor}/${t.app}.ts`,content:`export { default } from "${e}";
|
|
3
3
|
export * from "${e}";
|
|
4
4
|
`}}function Nl(t,e){return{path:`src/apps/${t.vendor}/${t.app}.ts`,content:`export * from "${e}/mod";
|
|
5
5
|
`}}function _l(t,e){let s=0,n=null;for(let a=e;a<t.length;a++){const i=t[a];if(n){i==="\\"?a++:i===n&&(n=null);continue}if(i==='"'||i==="'")n=i;else if(i==="{")s++;else if(i==="}"&&--s===0)return a}throw new Ke("package.json: unbalanced braces")}function bo(t,e){let s=e;for(;s<t.length&&` \r
|
|
@@ -19,4 +19,4 @@ ${m.replace(/^\s*\]/,"]")}`:m].join("")}function Bl(t){const{entry:e,technology:
|
|
|
19
19
|
<strong>Gaveta HortiNatura:</strong> frescor por duas vezes mais tempo;`,style:"unordered"},BlockImage:{url:"https://cdn.exemplo.com/2026/10/mochila.webp",alt:"Mochila escolar azul apoiada em uma cadeira de sala de aula",size:"full"},Video:{url:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",caption:"Como medir a capacidade da mala"},Divider:{},Cta:{text:"Ver toda a linha Escolar",href:"/escolar"},Callout:{title:"VOCÊ SABIA?",body:"Pediatras recomendam que a mochila carregada não passe de 10% do peso da criança.",variant:"tip"},Code:{code:"const total = itens.length;",language:"ts"},Stat:{value:"30%",label:"menos desperdício",description:"Comparado ao modelo anterior da mesma linha."},StatGroup:{stats:'[{"value":"30%","label":"menos desperdício"},{"value":"2x","label":"mais frescor"}]'},CardGroup:{cards:'[{"title":"Pré-escola","body":"Pouco material, mochila pequena."},{"title":"Fundamental","body":"Cadernos e livros pesam; considere rodinhas."}]'},Checklist:{title:"Antes de comprar, confira",items:'["Capacidade em litros","Alças acolchoadas","Compartimento para notebook"]'},Steps:{title:"Como medir",steps:'[{"title":"Meça a altura","description":"Da base ao topo, sem as alças."},{"title":"Some a profundidade"}]'},Comparison:{left:'{"title":"Com rodinhas","items":["Poupa a coluna","Mais pesada vazia"]}',right:'{"title":"De costas","items":["Mais leve","Exige ajuste das alças"]}'},Table:{headers:'["Modelo","Capacidade","Preço"]',rows:'[["Bordo","38L","R$ 399"],["Média","68L","R$ 599"]]'}},wd=600;function Cd(t,e){for(const{payload:s}of Ge(e,"posts"))for(const n of ze(s.sections)){const a=ke(n);if(!a||a.__resolveType!==t)continue;const{__resolveType:i,...r}=a;if(Object.keys(r).length!==0&&!(JSON.stringify(r).length>wd))return r}}function Nd(t,e,s,n){const a=ud(e,n),i=so(e,n),r=new Set(Xa(t.value,i)),l=a.filter(g=>r.has(g.resolveType)),c=l.length>0?l:a,d=new Set,m=[];for(const g of c){if(d.has(g.name)||i[g.name]!==g.resolveType)continue;d.add(g.name);const f=Cd(g.resolveType,s)??jd[g.name];m.push({name:g.name,title:g.title,description:g.description??"",schema:Sd(vd(g.resolveType,e),f),example:f})}return m}function so(t,e){const s={};for(const n of Ga(t,e)){const a=cn(n.resolveType);a in s||(s[a]=n.resolveType)}return s}function _d(t,e,s={}){const n=[];for(const a of t){const i=e[a.type];if(!i)continue;const r=Ad(a.props,a.productIds??[],s[a.type]);n.push({__resolveType:i,...r})}return n}const Pd=["product","products"];function Td(t){const e=ke(t);return e?Pd.find(s=>s in e)??null:null}function Ad(t,e,s){const n=e.filter(Boolean),a=Td(s);if(n.length===0||!a)return t;const i=s[a];return{...t,[a]:Cc(i,n)}}const no=80;function ti(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,no)}function Rm(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,no)}function To(t,e){const s=no-e.length-1;return`${t.slice(0,s).replace(/-+$/,"")}-${e}`}function si(t,e,s){const n=ti(t)||`${s}-${Jt(6)}`,a=new Set(e);if(!a.has(n))return n;for(let i=2;i<100;i++){const r=To(n,String(i));if(!a.has(r))return r}return To(n,Jt(4))}function ni(t,e){return si(t,e,"post")}function Ed(t,e){return si(t,e,"category")}function Dd({draft:t,resolveTypes:e,productShapes:s,categories:n,authors:a,planning:i,takenSlugs:r,now:l}){const c=new Set(t.categorySlugs),d=new Set(t.authorEmails),m={title:t.title,slug:ni(t.title,r),date:l.toISOString().slice(0,10),excerpt:t.excerpt,image:t.cover.url,alt:t.cover.alt,authors:a.filter(g=>d.has(g.email)),categories:n.filter(g=>c.has(g.slug)),seo:{title:t.seo.title,description:t.seo.description,image:t.cover.url},sections:_d(t.sections,e,s),planning:i??{}};return Hs(m,"awaiting_review",l)}const Lm=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Im=["January","February","March","April","May","June","July","August","September","October","November","December"],oi=1440*60*1e3;function xt(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Km(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Fm(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Js(t,e){const s=new Date(t);return s.setDate(s.getDate()+e),s}function Ln(t,e){return Math.round((xt(t).getTime()-xt(e).getTime())/oi)}function Bd(t){const e=(t.getTime()-xt(t).getTime())/oi;return Math.min(Math.max(e,0),1)}function Ao(t,e){return Ln(t,e)+Bd(t)}function Mm(t){const e=Js(t,-t.getDay()),s=[];for(let n=0;n<6;n++){const a=[];for(let i=0;i<7;i++)a.push(Js(e,n*7+i));s.push(a)}for(;s.length>0&&s[s.length-1].every(n=>n.getMonth()!==t.getMonth());)s.pop();return s}function zm(t,e){const s=xt(t[0]),n=Js(s,7),a=s.getTime(),i=n.getTime(),r=[];for(const d of e){const m=xt(d.start),g=xt(d.end);if(g.getTime()<s.getTime()||m.getTime()>=n.getTime())continue;const f=m.getTime()<s.getTime()?s:m,u=g.getTime()>=n.getTime()?Js(n,-1):g,p=Ln(f,s),h=Ln(u,f)+1;if(h<=0)continue;const S=Math.max(d.start.getTime(),a),C=Math.min(d.end.getTime(),i),k=Ao(new Date(S),s),x=Math.max(Ao(new Date(C),s)-k,0);x<=0||r.push({variant:d,startCol:p,span:h,leftUnits:k,widthUnits:x})}r.sort((d,m)=>d.startCol-m.startCol||m.span-d.span||d.variant.blockKey.localeCompare(m.variant.blockKey));const l=[],c=[];for(const d of r){let m=l.findIndex(g=>g<=d.startCol);m===-1&&(m=l.length,l.push(0)),l[m]=d.startCol+d.span,c.push({...d,lane:m})}return c}function Xs(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const ai=/^(\d{4})-(\d{2})-(\d{2})$/;function Qs(t){const e=t.trim();if(!e)return null;const s=ai.exec(e);if(s){const a=Number(s[1]),i=Number(s[2])-1,r=Number(s[3]),l=new Date(a,i,r);return l.getMonth()===i&&l.getDate()===r?l:null}const n=new Date(e);return Number.isNaN(n.getTime())?null:xt(n)}function Od(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),Ra);return{...Va("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Xs(t)}}function $d(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(ai.test(e))return Qs(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function Rd(t,e){const s=$d(t.scheduledDatetime);if(!s)return null;const n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:n.toISOString()};return(typeof t.date=="string"?t.date:"")===Xs(s)&&(a.date=Xs(n)),a}function Ld(t){return Qs(t.scheduledDatetime)??Qs(t.date)}function Vm(t){const e=new Map,s=[];for(const a of t){const i={post:a,scheduled:Qs(a.scheduledDatetime)!==null},r=Ld(a);if(!r){s.push(i);continue}const l=Xs(r),c=e.get(l);c?c.push(i):e.set(l,[i])}const n=(a,i)=>Number(i.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(i.post.title);for(const a of e.values())a.sort(n);return s.sort(n),{byDay:e,undated:s}}function Id(t){const e=le.c(50),{orgSlug:s,virtualMcpId:n,branch:a}=t,i=Uo(),r=ms()?.taskId??null,l=oa(n),c=nn(n).runtime==="cms",{url:d}=Hn(n),m=Yn(n,a),g=m.kind==="protocol"?m:null;let f;e[0]!==a||e[1]!==s||e[2]!==n?(f={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=f):f=e[3];const u=Mi(f);let p;e[4]!==u?(p=Pn.decofile(u),e[4]=u,e[5]=p):p=e[5];const h=p;let S;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==s||e[10]!==l||e[11]!==i||e[12]!==r||e[13]!==n?(S=async(T,D)=>{if(d)return{ok:!0};if(c){const B=await zi({orgSlug:s,virtualMcpId:n,branch:a},{set:T,delete:D});return Vi(i,{orgSlug:s,virtualMcpId:n,branch:a},B),await i.invalidateQueries({queryKey:ha({orgSlug:s,virtualMcpId:n,branch:a,threadId:r})}),B}const A={orgSlug:s,virtualMcpId:n,branch:a,threadId:r};for(const[B,w]of Object.entries(T)){const $=await fetch(Gs(A,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Vs(l,An(B)),content:JSON.stringify(w,null,2)})});if(!$.ok)return Us($,"Write")}for(const B of D){const w=await fetch(Gs(A,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Vs(l,An(B))})});if(!w.ok)return Us(w,"Delete")}return{ok:!0}},e[6]=a,e[7]=c,e[8]=d,e[9]=s,e[10]=l,e[11]=i,e[12]=r,e[13]=n,e[14]=S):S=e[14];const C=S;let k;e[15]!==a||e[16]!==s||e[17]!==n?(k=ia(s,n,a),e[15]=a,e[16]=s,e[17]=n,e[18]=k):k=e[18];let x;e[19]!==a||e[20]!==s||e[21]!==n?(x=aa(s,n,a),e[19]=a,e[20]=s,e[21]=n,e[22]=x):x=e[22];let b;e[23]!==m||e[24]!==a||e[25]!==u||e[26]!==C||e[27]!==s||e[28]!==g||e[29]!==i||e[30]!==n?(b=async T=>{const{writes:D,deletes:A}=T,B=Dr(D);return g?Ui(i,g,{orgSlug:s,virtualMcpId:n,branch:a},u,{set:B,delete:A.filter(w=>!(w in B))}):ra({queryClient:i,orgSlug:s,virtualMcpId:n,branch:a,backend:m,cacheKey:u},{kind:"edit",write:()=>C(B,A)})},e[23]=m,e[24]=a,e[25]=u,e[26]=C,e[27]=s,e[28]=g,e[29]=i,e[30]=n,e[31]=b):b=e[31];let j;e[32]!==a||e[33]!==s||e[34]!==i||e[35]!==n?(j=()=>{i.invalidateQueries({queryKey:Pn.liveMeta(s,n,a)})},e[32]=a,e[33]=s,e[34]=i,e[35]=n,e[36]=j):j=e[36];let P;e[37]!==k||e[38]!==x||e[39]!==b||e[40]!==j?(P={mutationKey:k,scope:x,mutationFn:b,onSuccess:j},e[37]=k,e[38]=x,e[39]=b,e[40]=j,e[41]=P):P=e[41];const N=Go(P);let v;e[42]!==N||e[43]!==i||e[44]!==h?(v=async T=>{const D=[...Object.keys(T.writes),...T.deletes],A=i.getQueryData(h),B=new Map;for(const w of D)A&&w in A&&B.set(w,A[w]);i.setQueryData(h,w=>Kd(w,T)),i.cancelQueries({queryKey:h});try{return await N.mutateAsync(T)}catch(w){const $=w;throw i.setQueryData(h,V=>{if(!V)return V;const F={...V};for(const q of D)B.has(q)?F[q]=B.get(q):delete F[q];return F}),$}},e[42]=N,e[43]=i,e[44]=h,e[45]=v):v=e[45];const E=v;let O;return e[46]!==E||e[47]!==N.isError||e[48]!==N.isPending?(O={move:E,isPending:N.isPending,isError:N.isError},e[46]=E,e[47]=N.isError,e[48]=N.isPending,e[49]=O):O=e[49],O}function Kd(t,{writes:e,deletes:s}){const n={...t??{},...e};for(const a of s)a in e||delete n[a];return n}const Zs={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function Fd({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,onMoved:a}){const i=Ne(),r=Id({orgSlug:t,virtualMcpId:e,branch:s}),[l,c]=L.useState(new Set),d=u=>gt(n[u],"posts"),m=(u,p,h=d(u))=>p==="generating"?{kind:"not-a-target"}:l.has(is(u))?{kind:"in-flight"}:Rc(h,p)?{kind:"incomplete"}:null,g=u=>{switch(u.kind){case"incomplete":return i("sandbox.postBoard.moveBlocked");case"in-flight":return i("sandbox.postBoard.moveInFlight");case"not-a-target":return i("sandbox.postBoard.moveNotATarget");default:return String(u)}};return{apply:async(u,p,h)=>{const S=h??d(u);if(Xt(S)===p)return null;const C=m(u,p,S);if(C)return C.kind!=="in-flight"&&xe.error(g(C)),null;const k=is(u);c(j=>new Set(j).add(k));const x=zc({key:u,payload:S},p,new Date),b=Object.keys(x.writes)[0]??u;b!==u&&a?.(u,b);try{return await r.move(x),b}catch(j){return b!==u&&a?.(b,u),xe.error(j instanceof Error?j.message:i("sandbox.postBoard.moveFailed")),null}finally{c(j=>{const P=new Set(j);return P.delete(k),P})}},refuse:m,reasonText:g,isMoving:u=>l.has(is(u))}}function ii(){return Mn("hide_default_blog_blocks")}function Md(t){const e=le.c(15),{value:s,onChange:n,placeholder:a,className:i,onFocus:r,onBlur:l,onKeyDown:c,spellCheck:d,readOnly:m,inputRef:g}=t,f=d===void 0?!0:d;let u;e[0]!==n?(u=S=>n(S.target.value),e[0]=n,e[1]=u):u=e[1];let p;e[2]!==i?(p=ve("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",i),e[2]=i,e[3]=p):p=e[3];let h;return e[4]!==g||e[5]!==l||e[6]!==r||e[7]!==c||e[8]!==a||e[9]!==m||e[10]!==f||e[11]!==u||e[12]!==p||e[13]!==s?(h=o.jsx("textarea",{ref:g,value:s,onChange:u,onInput:zd,onFocus:r,onBlur:l,onKeyDown:c,placeholder:a,spellCheck:f,readOnly:m,rows:1,className:p}),e[4]=g,e[5]=l,e[6]=r,e[7]=c,e[8]=a,e[9]=m,e[10]=f,e[11]=u,e[12]=p,e[13]=s,e[14]=h):h=e[14],h}function zd(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function Ue(t){return typeof t=="string"?t:""}function Um(t){const e=le.c(11);let s,n;e[0]!==t?({className:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=ve(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let i;e[5]!==n||e[6]!==a?(i=o.jsx(Md,{...n,className:a}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Si,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=r):r=e[8];let l;return e[9]!==i?(l=o.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[i,r]}),e[9]=i,e[10]=l):l=e[10],l}function Gm(t){const e=le.c(5),{label:s,onClick:n,disabled:a}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Gn,{size:13}),e[0]=i):i=e[0];let r;return e[1]!==a||e[2]!==s||e[3]!==n?(r=o.jsxs("button",{type:"button",onClick:n,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[i,s]}),e[1]=a,e[2]=s,e[3]=n,e[4]=r):r=e[4],r}function Hm(t){const e=le.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Xn,{size:13}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function Ym(t){const e=le.c(2),{children:s}=t;let n;return e[0]!==s?(n=o.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:s}),e[0]=s,e[1]=n):n=e[1],n}function qm(t){if(Array.isArray(t))return t;if(typeof t!="string"||t.trim()==="")return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}function Eo(t){const e=le.c(14),{options:s,value:n,emptyLabel:a,onChange:i}=t;let r;e[0]!==a||e[1]!==i||e[2]!==n?(r=a&&o.jsx(Do,{active:!n,onClick:()=>i(""),children:a}),e[0]=a,e[1]=i,e[2]=n,e[3]=r):r=e[3];let l;if(e[4]!==i||e[5]!==s||e[6]!==n){let d;e[8]!==i||e[9]!==n?(d=m=>o.jsx(Do,{active:m===n,onClick:()=>i(m),children:m},m),e[8]=i,e[9]=n,e[10]=d):d=e[10],l=s.filter(Boolean).map(d),e[4]=i,e[5]=s,e[6]=n,e[7]=l}else l=e[7];let c;return e[11]!==r||e[12]!==l?(c=o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r,l]}),e[11]=r,e[12]=l,e[13]=c):c=e[13],c}function Do(t){const e=le.c(7),{active:s,onClick:n,children:a}=t,i=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let r;e[0]!==i?(r=ve("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=r):r=e[1];let l;return e[2]!==s||e[3]!==a||e[4]!==n||e[5]!==r?(l=o.jsx("button",{type:"button","aria-pressed":s,onClick:n,className:r,children:a}),e[2]=s,e[3]=a,e[4]=n,e[5]=r,e[6]=l):l=e[6],l}function Wm(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const As=[{id:"campaign",label:"sandbox.generatePost.stepCampaign"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Vd=[1,2,3],Ud={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Gd({open:t,onOpenChange:e,decofile:s,hasAi:n,onGenerate:a}){const i=Ne(),r=il(),[l,c]=L.useState("campaign"),[d,m]=L.useState(""),[g,f]=L.useState(""),[u,p]=L.useState(""),[h,S]=L.useState(""),[C,k]=L.useState(1),{merged:x}=qa(s),b=fd(x),j=ld(s).filter(w=>w.status!=="finished"),P=j.find(w=>w.key===d),N=s[cd],v=Me(Fe(N?.formats)),E=()=>{c("campaign"),m(""),f(""),p(""),S(""),k(1)},O=w=>{e(w),w||E()},T=As.findIndex(w=>w.id===l),D=l==="campaign"?!!P:l==="format"?g.trim().length>0&&u.trim().length>0:!0,A=l==="extra",B=()=>{P&&(a({campaign:P,format:{name:g.trim(),value:u.trim()},extraInstructions:h.trim()||void 0,count:C,fileConfigId:tr(r.data?.configs??[],null,typeof window<"u"?window.localStorage.getItem(sr):null)??void 0}),O(!1))};return o.jsx(Wt,{open:t,onOpenChange:O,children:o.jsxs(qt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[o.jsxs(us,{children:[o.jsx(Yt,{children:i("sandbox.generatePost.title")}),o.jsx(Kn,{children:i("sandbox.generatePost.subtitle")})]}),b.length>0?o.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:b.map(w=>i(Ud[w])).join(", ")})}):o.jsxs(o.Fragment,{children:[o.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:As.map((w,$)=>o.jsx("li",{className:ve("rounded-md px-2 py-1",$===T?"bg-primary text-primary-foreground":$<T?"text-foreground":"text-muted-foreground"),children:i(w.label)},w.id))}),o.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[l==="campaign"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.campaignHint")}),j.length===0?o.jsx("p",{className:"rounded-lg border border-dashed px-3 py-6 text-center text-sm text-muted-foreground",children:i("sandbox.generatePost.noCampaigns")}):o.jsx(Hd,{campaigns:j,chosen:d,onChoose:m})]}),l==="format"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),o.jsx(Eo,{options:v.map(w=>w.name),value:g,onChange:w=>{f(w),p(v.find($=>$.name===w)?.value??"")}}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(mt,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),o.jsx(bt,{id:"generate-format-name",value:g,onChange:w=>f(w.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(mt,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),o.jsx(fo,{id:"generate-format-value",value:u,onChange:w=>p(w.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatBlocksHint")})]}),l==="extra"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(mt,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),o.jsx(fo,{id:"generate-extra",value:h,onChange:w=>S(w.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:4})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(mt,{children:i("sandbox.generatePost.countLabel")}),o.jsx(Eo,{options:Vd.map(String),value:String(C),onChange:w=>k(Number(w)||1)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.countHint")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.coverHint")})]})]}),o.jsxs(ps,{className:"shrink-0 sm:justify-between",children:[o.jsx(Re,{type:"button",variant:"outline",disabled:T===0,onClick:()=>c(As[T-1].id),children:i("sandbox.generatePost.back")}),A?o.jsxs(Re,{type:"button",disabled:!n,onClick:B,children:[o.jsx(zs,{size:14}),i("sandbox.generatePost.generate",{count:String(C)})]}):o.jsx(Re,{type:"button",disabled:!D,onClick:()=>c(As[T+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function Hd(t){const e=le.c(11),{campaigns:s,chosen:n,onChoose:a}=t,i=Ne();let r;if(e[0]!==s||e[1]!==n||e[2]!==a||e[3]!==i){let c;e[5]!==n||e[6]!==a||e[7]!==i?(c=d=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>a(d.key),className:ve("w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",n===d.key&&"border-primary"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:d.name||i("sandbox.campaigns.untitled")}),o.jsx(Qn,{variant:"outline",className:"shrink-0 text-[10px]",children:d.intent.products.length>0?i("sandbox.generatePost.campaignProducts",{count:String(d.intent.products.length)}):i("sandbox.generatePost.campaignNoProducts")})]}),d.trigger.note&&o.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:d.trigger.note})]})},d.key),e[5]=n,e[6]=a,e[7]=i,e[8]=c):c=e[8],r=s.map(c),e[0]=s,e[1]=n,e[2]=a,e[3]=i,e[4]=r}else r=e[4];let l;return e[9]!==r?(l=o.jsx("ul",{className:"space-y-1.5",children:r}),e[9]=r,e[10]=l):l=e[10],l}function Yd(t){const e=[];for(let s=0;e.length<So;s+=1){const n=e.length;for(const a of t){const i=a.images?.[s];if(i&&(e.push(i),e.length>=So))return e}if(e.length===n)break}return e}const qd={"no-store-data":"sandbox.generatePost.gapNoStoreData","sections-dropped":"sandbox.generatePost.gapSectionsDropped","no-bucket":"sandbox.generatePost.gapNoBucket","no-image-model":"sandbox.generatePost.gapNoImageModel","images-failed":"sandbox.generatePost.gapImagesFailed","drafts-failed":"sandbox.generatePost.gapDraftsFailed"};function Wd({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,meta:a,onStarted:i}){const r=Ne(),l=hi(),c=ii(),d=sn({orgSlug:t,virtualMcpId:e,branch:s});return async m=>{const g={campaignKey:m.campaign.key,format:m.format,brief:m.campaign.trigger.note},f=Hs(Fa({title:m.campaign.name,planning:g,now:new Date}),"generating",new Date),u=Array.from({length:m.count},()=>Ys(On())),{merged:p}=qa(n),h=td(p),S=Ge(n,"categories").map(({payload:v})=>({name:Ue(v.name),slug:Ue(v.slug)})).filter(v=>v.slug),C=Bc(n),k=Nd(m.format,a,n,{hideDefaults:c}),x=Object.fromEntries(k.map(v=>[v.name,v.example])),b=async(v,E=u.length)=>{for(const O of u.slice(v,E))try{await d.mutateAsync({blockKey:O,data:ht(O,Hs(f,"draft",new Date))})}catch(T){console.warn("[generatePost] could not reset a card",T)}},j=async(v,E)=>{if(!E.fileConfigId||v.length===0)return new Map;try{const O=await l.call("BLOG_POST_ILLUSTRATE",{requests:v.map((T,D)=>({id:String(D),prompt:T.cover.prompt,alt:T.cover.alt})),productImages:Yd(E.campaign.intent.products),companyName:h.companyName??"",fileConfigId:E.fileConfigId});return new Map(O.images.map(T=>[T.id,T.url]))}catch(O){return console.warn("[generatePost] illustrating failed",O),new Map}};let P=0;try{for(const v of u)await d.mutateAsync({blockKey:v,data:ht(v,f)}),P+=1}catch(v){await b(0,P),xe.error(v instanceof Error?v.message:r("sandbox.generatePost.failed"));return}i?.(u);let N=0;try{const v=await l.call("BLOG_SITE_GROUND",{virtualMcpId:e,purpose:"post",focus:`${m.campaign.name}: ${m.campaign.trigger.note}`,language:h.language}).catch(A=>{console.warn("[generatePost] grounding failed",A)}),E=await l.call("BLOG_POST_DRAFT",{virtualMcpId:e,grounding:v?{report:v.report,outcome:v.outcome}:void 0,brand:{companyName:h.companyName,description:h.description,language:h.language,storeUrl:h.storeUrl,targetAudience:h.targetAudience,tone:h.tone,dos:h.dos,avoid:h.avoid,vocabulary:h.vocabulary,voiceExamples:h.voiceExamples},campaign:{name:m.campaign.name,period:m.campaign.period,trigger:m.campaign.trigger,intent:{objective:m.campaign.intent.objective,targets:m.campaign.intent.targets,products:m.campaign.intent.products,keywords:m.campaign.intent.keywords},guardrails:m.campaign.guardrails},format:m.format,blocks:k,categories:S,authors:C.map(({name:A,email:B})=>({name:A,email:B})),extraInstructions:m.extraInstructions?.trim()||void 0,count:m.count}),O=await j(E.posts,m),T=so(a,{hideDefaults:c}),D=La(n).map(A=>A.slug);for(const[A,B]of E.posts.entries()){const w=u[A];if(!w)break;const $=Dd({draft:{...B,cover:{...B.cover,url:O.get(String(A))??""}},resolveTypes:T,productShapes:x,categories:S,authors:C,planning:g,takenSlugs:D,now:new Date});D.push(Ue($.slug)),await d.mutateAsync({blockKey:w,data:ht(w,$)}),N=A+1}await b(N),E.posts.length>0&&xe.success(r("sandbox.generatePost.done",{count:String(E.posts.length)}));for(const A of E.gaps)xe.warning(r(qd[A.code],{count:A.count??0}))}catch(v){await b(N),xe.error(v instanceof Error?v.message:r("sandbox.generatePost.failed"))}}}const Jd=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function ri(t){return Jd.test(t)}function Xd(t){const e=t.trim();return e?ri(e)?au(e):ru(e):{title:"",sections:[]}}function oo(t){return t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/�?39;|'/gi,"'").replace(/&/gi,"&")}function ns(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return oo(e).replace(/\s+/g," ").trim()}function Qd(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function Zd(t){let e=t,s;do s=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==s);return e}function li(t){let e=t,s;do s=e,e=Zd(Qd(e));while(e!==s);return e}const eu=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function en(t){let e="";for(const s of t)s.charCodeAt(0)>31&&(e+=s);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function tu(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}const su=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function nu(t,e,s){const n=e.toLowerCase();if(!eu.test(n))return"";if(t.startsWith("</"))return`</${n}>`;if(n!=="a")return`<${n}>`;const a=oo(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return en(a)&&a?`<a href="${tu(a)}">`:"<a>"}function ci(t){const e=li(t);let s="",n=0;for(;n<e.length;){const a=e.indexOf("<",n);if(a===-1){s+=e.slice(n);break}s+=e.slice(n,a);const i=su.exec(e.slice(a));if(!i){s+="<",n=a+1;continue}s+=nu(i[0],i[1]??"",i[2]??""),n=a+i[0].length}return s}function Es(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?oo(s[1]):""}const ou=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function au(t){const e=li(t);let s="";const n=[];for(const a of e.matchAll(ou)){const i=a[1]?.toLowerCase(),r=a[2]??"",l=a[0];if(!i){if(/^<img/i.test(l)){const c=Es(l,"src");c&&en(c)&&n.push({kind:"image",url:c,alt:Es(l,"alt"),caption:""})}else n.push({kind:"divider"});continue}if(/^h[1-6]$/.test(i)){const c=ns(r);if(!c)continue;if(i==="h1"&&!s){s=c;continue}n.push({kind:"heading",text:c,level:i.slice(1)})}else if(i==="p"){const c=ci(r.trim());ns(c)&&n.push({kind:"paragraph",html:c})}else if(i==="ul"||i==="ol"){const c=[...r.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>ns(d[1]??"")).filter(Boolean);c.length&&n.push({kind:"list",items:c,ordered:i==="ol"})}else if(i==="blockquote"){const c=ns(r);c&&n.push({kind:"quote",text:c})}else if(i==="figure"){const c=r.match(/<img\b[^>]*>/i)?.[0],d=c?Es(c,"src"):"",m=ns(r.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&en(d)&&n.push({kind:"image",url:d,alt:c?Es(c,"alt"):"",caption:m})}}return{title:s,sections:n}}function iu(t){return t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function ru(t){const e=t.replace(/\r\n?/g,`
|
|
20
20
|
`).split(`
|
|
21
21
|
`);let s="";const n=[];let a=[],i=null,r=[];const l=()=>{a.length&&(n.push({kind:"paragraph",html:ci(iu(a.join(" ")))}),a=[])},c=()=>{i&&(n.push({kind:"list",items:i.items,ordered:i.ordered}),i=null)},d=()=>{r.length&&(n.push({kind:"quote",text:r.join(" ")}),r=[])},m=()=>{l(),c(),d()};for(const g of e){const f=g.trimEnd(),u=f.match(/^(#{1,6})\s+(.*)$/),p=f.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),h=f.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),S=/^\s*\d+\./.test(f),C=f.match(/^>\s?(.*)$/);if(!f.trim())m();else if(u){m();const k=u[2]?.trim()??"",x=String(u[1]?.length??1);x==="1"&&!s?s=k:k&&n.push({kind:"heading",text:k,level:x})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(f.trim()))m(),n.push({kind:"divider"});else if(p){m();const k=p[2]??"";en(k)&&n.push({kind:"image",url:k,alt:p[1]??"",caption:""})}else h?(l(),d(),i||(i={items:[],ordered:S}),i.items.push(h[1]?.trim()??"")):C?(l(),c(),r.push(C[1]?.trim()??"")):(c(),d(),a.push(f.trim()))}return m(),{title:s,sections:n}}const lu={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function cu(t,e){const s=[];for(const n of t){const a=e[lu[n.kind]];if(a)switch(n.kind){case"heading":s.push({__resolveType:a,text:n.text,level:n.level});break;case"paragraph":s.push({__resolveType:a,html:n.html});break;case"list":s.push({__resolveType:a,items:n.items.join(`
|
|
22
|
-
`),style:n.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:n.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:n.url,alt:n.alt,caption:n.caption,size:"normal"});break}}return s}function du({title:t,blocks:e,takenSlugs:s,now:n}){const a=t.trim();return{title:a,slug:a?ni(a,s):ti(""),date:n.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const Bo="__all__",Oo={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},uu={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},$o="status:";function Ro(t){if(!t.startsWith($o))return null;const e=t.slice($o.length);return to.includes(e)?e:null}const Lo=L.forwardRef(function(e,s){const n=le.c(20);let a,i,r,l,c;n[0]!==e?({icon:a,active:i,value:c,className:r,...l}=e,n[0]=e,n[1]=a,n[2]=i,n[3]=r,n[4]=l,n[5]=c):(a=n[1],i=n[2],r=n[3],l=n[4],c=n[5]);const d=i?"text-foreground":"text-muted-foreground";let m;n[6]!==r||n[7]!==d?(m=ve("h-7 gap-1 px-1.5 text-xs",d,r),n[6]=r,n[7]=d,n[8]=m):m=n[8];let g;n[9]!==a?(g=o.jsx(a,{size:14,className:"shrink-0"}),n[9]=a,n[10]=g):g=n[10];let f;n[11]!==c?(f=c&&o.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),n[11]=c,n[12]=f):f=n[12];let u;n[13]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(ls,{size:12,className:"shrink-0 opacity-60"}),n[13]=u):u=n[13];let p;return n[14]!==l||n[15]!==s||n[16]!==m||n[17]!==g||n[18]!==f?(p=o.jsxs(Re,{ref:s,type:"button",variant:"ghost",size:"sm",className:m,...l,children:[g,f,u]}),n[14]=l,n[15]=s,n[16]=m,n[17]=g,n[18]=f,n[19]=p):p=n[19],p});function ao(t){const e=le.c(2),{count:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function pu(t){const e=le.c(19),{value:s,onChange:n}=t,a=Ne();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=i):i=e[0];let r;e[1]!==n?(r=f=>n(f.target.value),e[1]=n,e[2]=r):r=e[2];let l;e[3]!==a?(l=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=l):l=e[4];let c;e[5]!==a?(c=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=c):c=e[6];let d;e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==s?(d=o.jsx("input",{type:"text",value:s,onChange:r,placeholder:l,"aria-label":c,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=r,e[8]=l,e[9]=c,e[10]=s,e[11]=d):d=e[11];let m;e[12]!==n||e[13]!==a||e[14]!==s?(m=s&&o.jsx(di,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=a,e[14]=s,e[15]=m):m=e[15];let g;return e[16]!==d||e[17]!==m?(g=o.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[i,d,m]}),e[16]=d,e[17]=m,e[18]=g):g=e[18],g}function mu(t){const e=le.c(100),{categories:s,authors:n,statusCounts:a,categoryFilter:i,authorFilter:r,statusFilter:l,sort:c,onCategoryFilterChange:d,onAuthorFilterChange:m,onStatusFilterChange:g,onSortChange:f}=t,u=Ne();let p;if(e[0]!==s||e[1]!==i){let X;e[3]!==i?(X=te=>te.slug===i,e[3]=i,e[4]=X):X=e[4],p=s.find(X),e[0]=s,e[1]=i,e[2]=p}else p=e[2];const h=p;let S;if(e[5]!==r||e[6]!==n){let X;e[8]!==r?(X=te=>te.email===r,e[8]=r,e[9]=X):X=e[9],S=n.find(X),e[5]=r,e[6]=n,e[7]=S}else S=e[7];const C=S,k=!!(i||r||l);let x;e[10]!==C?.name||e[11]!==h?.name||e[12]!==l||e[13]!==u?(x=h?.name??C?.name??u(l?Zs[l]:"sandbox.postToolbar.filterLabel"),e[10]=C?.name,e[11]=h?.name,e[12]=l,e[13]=u,e[14]=x):x=e[14];const b=x,j=i?`cat:${i}`:r?`author:${r}`:l?`status:${l}`:Bo;let P;e[15]!==m||e[16]!==d||e[17]!==g?(P=()=>{d(null),m(null),g(null)},e[15]=m,e[16]=d,e[17]=g,e[18]=P):P=e[18];const N=P;let v;e[19]!==N||e[20]!==m||e[21]!==d||e[22]!==g?(v=X=>{X.startsWith("cat:")?(m(null),g(null),d(X.slice(4))):X.startsWith("author:")?(d(null),g(null),m(X.slice(7))):Ro(X)?(d(null),m(null),g(Ro(X))):N()},e[19]=N,e[20]=m,e[21]=d,e[22]=g,e[23]=v):v=e[23];const E=v;let O;e[24]!==b||e[25]!==k?(O=o.jsx(Ls,{asChild:!0,children:o.jsx(Lo,{icon:ji,active:k,value:b,className:"min-w-0 shrink"})}),e[24]=b,e[25]=k,e[26]=O):O=e[26];let T;e[27]!==u?(T=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=T):T=e[28];let D;e[29]!==T?(D=o.jsx(es,{children:T}),e[29]=T,e[30]=D):D=e[30];let A;e[31]!==u?(A=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=A):A=e[32];let B;e[33]!==A?(B=o.jsx(os,{value:Bo,children:A}),e[33]=A,e[34]=B):B=e[34];let w;e[35]!==u?(w=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=w):w=e[36];let $;e[37]!==w?($=o.jsx(es,{className:"text-muted-foreground/70",children:w}),e[37]=w,e[38]=$):$=e[38];let V;e[39]!==a||e[40]!==u?(V=to.map(X=>o.jsxs(os,{value:`status:${X}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(Zs[X])}),o.jsx(ao,{count:a[X]??0})]},`status:${X}`)),e[39]=a,e[40]=u,e[41]=V):V=e[41];let F;e[42]!==s.length||e[43]!==u?(F=s.length>0&&o.jsx(es,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=F):F=e[44];let q;e[45]!==s?(q=s.map(gu),e[45]=s,e[46]=q):q=e[46];let H;e[47]!==n.length||e[48]!==u?(H=n.length>0&&o.jsx(es,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=u,e[49]=H):H=e[49];let I;e[50]!==n?(I=n.map(fu),e[50]=n,e[51]=I):I=e[51];let G;e[52]!==j||e[53]!==E||e[54]!==B||e[55]!==$||e[56]!==V||e[57]!==F||e[58]!==q||e[59]!==H||e[60]!==I?(G=o.jsxs(io,{value:j,onValueChange:E,children:[B,$,V,F,q,H,I]}),e[52]=j,e[53]=E,e[54]=B,e[55]=$,e[56]=V,e[57]=F,e[58]=q,e[59]=H,e[60]=I,e[61]=G):G=e[61];let W;e[62]!==G||e[63]!==D?(W=o.jsxs(Is,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,G]}),e[62]=G,e[63]=D,e[64]=W):W=e[64];let M;e[65]!==W||e[66]!==O?(M=o.jsxs(Ks,{children:[O,W]}),e[65]=W,e[66]=O,e[67]=M):M=e[67];let Q;e[68]!==N||e[69]!==k||e[70]!==u?(Q=k&&o.jsx(di,{label:u("sandbox.postToolbar.clearFilter"),onClick:N}),e[68]=N,e[69]=k,e[70]=u,e[71]=Q):Q=e[71];const ce=uu[c];let fe;e[72]!==u||e[73]!==ce?(fe=u(ce),e[72]=u,e[73]=ce,e[74]=fe):fe=e[74];let ue;e[75]!==fe?(ue=o.jsx(Ls,{asChild:!0,children:o.jsx(Lo,{icon:wi,active:!0,value:fe})}),e[75]=fe,e[76]=ue):ue=e[76];let J;e[77]!==u?(J=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=J):J=e[78];let me;e[79]!==J?(me=o.jsx(es,{children:J}),e[79]=J,e[80]=me):me=e[80];let de;e[81]!==f?(de=X=>f(X),e[81]=f,e[82]=de):de=e[82];let ie;e[83]===Symbol.for("react.memo_cache_sentinel")?(ie=Object.keys(Oo),e[83]=ie):ie=e[83];let ee;e[84]!==u?(ee=ie.map(X=>o.jsx(os,{value:X,children:u(Oo[X])},X)),e[84]=u,e[85]=ee):ee=e[85];let ge;e[86]!==c||e[87]!==de||e[88]!==ee?(ge=o.jsx(io,{value:c,onValueChange:de,children:ee}),e[86]=c,e[87]=de,e[88]=ee,e[89]=ge):ge=e[89];let ne;e[90]!==me||e[91]!==ge?(ne=o.jsxs(Is,{align:"end",className:"w-44",children:[me,ge]}),e[90]=me,e[91]=ge,e[92]=ne):ne=e[92];let pe;e[93]!==ue||e[94]!==ne?(pe=o.jsx("div",{className:"ml-auto shrink-0",children:o.jsxs(Ks,{children:[ue,ne]})}),e[93]=ue,e[94]=ne,e[95]=pe):pe=e[95];let oe;return e[96]!==M||e[97]!==Q||e[98]!==pe?(oe=o.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[M,Q,pe]}),e[96]=M,e[97]=Q,e[98]=pe,e[99]=oe):oe=e[99],oe}function fu(t){return o.jsxs(os,{value:`author:${t.email}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(ao,{count:t.count})]},`author:${t.email}`)}function gu(t){return o.jsxs(os,{value:`cat:${t.slug}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(ao,{count:t.count})]},`cat:${t.slug}`)}function di(t){const e=le.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Fn,{size:12}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function hu(t){const e=le.c(18),{checked:s,disabled:n,onToggle:a}=t,i=Ne();let r;e[0]!==a?(r=()=>a(),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==s||e[3]!==i?(l=i(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=i,e[4]=l):l=e[4];let c;e[5]!==s||e[6]!==n||e[7]!==r||e[8]!==l?(c=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:xu,children:o.jsx(on,{checked:s,disabled:n,onCheckedChange:r,"aria-label":l})})}),e[5]=s,e[6]=n,e[7]=r,e[8]=l,e[9]=c):c=e[9];let d;e[10]!==s||e[11]!==i?(d=i(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=i,e[12]=d):d=e[12];let m;e[13]!==d?(m=o.jsx(We,{side:"bottom",children:d}),e[13]=d,e[14]=m):m=e[14];let g;return e[15]!==c||e[16]!==m?(g=o.jsxs(Je,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=g):g=e[17],g}function xu(t){return t.stopPropagation()}function bu(t){const e=le.c(42),{count:s,allSelected:n,onToggleSelectAll:a,onArchive:i,onExit:r}=t,l=Ne();let c;e[0]!==n||e[1]!==a?(c=o.jsx(hu,{checked:n,onToggle:a}),e[0]=n,e[1]=a,e[2]=c):c=e[2];let d;e[3]!==s||e[4]!==l?(d=l("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=l,e[5]=d):d=e[5];let m;e[6]!==d?(m=o.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=m):m=e[7];const g=s===0;let f;e[8]!==l?(f=l("sandbox.postToolbar.archiveSelectedPosts"),e[8]=l,e[9]=f):f=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(xi,{size:14}),e[10]=u):u=e[10];let p;e[11]!==i||e[12]!==g||e[13]!==f?(p=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:g,onClick:i,"aria-label":f,children:u})}),e[11]=i,e[12]=g,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==l?(h=l("sandbox.postToolbar.archiveSelected"),e[15]=l,e[16]=h):h=e[16];let S;e[17]!==h?(S=o.jsx(We,{side:"bottom",children:h}),e[17]=h,e[18]=S):S=e[18];let C;e[19]!==p||e[20]!==S?(C=o.jsxs(Je,{children:[p,S]}),e[19]=p,e[20]=S,e[21]=C):C=e[21];let k;e[22]!==l?(k=l("sandbox.postToolbar.exitSelection"),e[22]=l,e[23]=k):k=e[23];let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fn,{size:14}),e[24]=x):x=e[24];let b;e[25]!==r||e[26]!==k?(b=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,"aria-label":k,children:x})}),e[25]=r,e[26]=k,e[27]=b):b=e[27];let j;e[28]!==l?(j=l("sandbox.postToolbar.exitSelection"),e[28]=l,e[29]=j):j=e[29];let P;e[30]!==j?(P=o.jsx(We,{side:"bottom",children:j}),e[30]=j,e[31]=P):P=e[31];let N;e[32]!==b||e[33]!==P?(N=o.jsxs(Je,{children:[b,P]}),e[32]=b,e[33]=P,e[34]=N):N=e[34];let v;e[35]!==C||e[36]!==N?(v=o.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[C,N]}),e[35]=C,e[36]=N,e[37]=v):v=e[37];let E;return e[38]!==c||e[39]!==v||e[40]!==m?(E=o.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[c,m,v]}),e[38]=c,e[39]=v,e[40]=m,e[41]=E):E=e[41],E}const yu={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},In="generating",vu=[In,...to.filter(t=>t!==In)],Io=t=>t.scheduledDatetime||t.date||"",ku=(t,e)=>Io(e).localeCompare(Io(t)),Su=t=>t==="scheduled"||t==="published",ui="application/x-post-key";function ju(t){const e=le.c(165),{orgSlug:s,virtualMcpId:n,branch:a,decofile:i,view:r,selectedKey:l,onViewChange:c,onOpen:d,onClose:m,move:g,meta:f,renderDetail:u}=t,p=Ne();let h;e[0]!==a||e[1]!==s||e[2]!==n?(h={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=h):h=e[3];const S=sn(h),C=al().length>0,k=ka(),x=ii(),[b,j]=L.useState(null),[P,N]=L.useState(!1),[v,E]=L.useState(!1),[O,T]=L.useState(!1),[D,A]=L.useState(""),B=L.useRef(null);let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={},e[4]=w):w=e[4];const[$,V]=L.useState(w);let F;e[5]!==$?(F=(K,ae)=>$[K]??ae,e[5]=$,e[6]=F):F=e[6];const q=F;let H;e[7]===Symbol.for("react.memo_cache_sentinel")?(H=(K,ae)=>V(Be=>({...Be,[K]:ae})),e[7]=H):H=e[7];const I=H;let G;e[8]!==d?(G=K=>{const ae=K[0];ae&&d(ae)},e[8]=d,e[9]=G):G=e[9];let W;e[10]!==a||e[11]!==i||e[12]!==f||e[13]!==s||e[14]!==G||e[15]!==n?(W={orgSlug:s,virtualMcpId:n,branch:a,decofile:i,meta:f,onStarted:G},e[10]=a,e[11]=i,e[12]=f,e[13]=s,e[14]=G,e[15]=n,e[16]=W):W=e[16];const M=Wd(W),Q=Mc(i);let ce;e[17]!==i?(ce=K=>gt(i[K],"posts"),e[17]=i,e[18]=ce):ce=e[18];const fe=ce,ue=l&&Q.some(K=>K.key===l)?l:Q[0]?.key??null;let J;e[19]!==g||e[20]!==p?(J=async K=>{await g.apply(K.key,"archived")&&xe.success(p("sandbox.postBoard.archived"))},e[19]=g,e[20]=p,e[21]=J):J=e[21];const me=J,[de,ie]=L.useState(null),[ee,ge]=L.useState(null),[ne,pe]=L.useState(null),[oe,X]=L.useState("date-desc"),[te,_]=L.useState("");let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=new Set,e[22]=Y):Y=e[22];const[Z,he]=L.useState(Y),Te=Q.reduce(Pu,{}),_e=K=>{const ae=new Map;for(const Be of Q)for(const ut of K(Be))ae.set(ut,(ae.get(ut)??0)+1);return ae},Oe=_e(_u),we=_e(Nu),Ee=Ge(i,"categories").map(K=>{const{payload:ae}=K;return{slug:Ue(ae.slug),name:Ue(ae.name)||Ue(ae.slug),count:Oe.get(Ue(ae.slug))??0}}),Ae=Ge(i,"authors").map(K=>{const{payload:ae}=K;return{email:Ue(ae.email),name:Ue(ae.name)||Ue(ae.email),count:we.get(Ue(ae.email))??0}}),be=te.trim().toLowerCase();let Ce;e[23]!==de?(Ce=K=>!de||K.categorySlugs.includes(de),e[23]=de,e[24]=Ce):Ce=e[24];let De;e[25]!==ee?(De=K=>!ee||K.authorEmails.includes(ee),e[25]=ee,e[26]=De):De=e[26];let U;e[27]!==ne?(U=K=>!ne||K.status===ne,e[27]=ne,e[28]=U):U=e[28];let ye;e[29]!==oe?(ye=(K,ae)=>{if(oe==="az")return K.title.localeCompare(ae.title);if(oe==="za")return ae.title.localeCompare(K.title);const Be=(K.scheduledDatetime||K.date).localeCompare(ae.scheduledDatetime||ae.date);return oe==="date-asc"?Be:-Be},e[29]=oe,e[30]=ye):ye=e[30];const je=Q.filter(Ce).filter(De).filter(U).filter(K=>!be||K.title.toLowerCase().includes(be)||K.slug.toLowerCase().includes(be)).sort(ye),$e=Z.size>0;let yt;e[31]===Symbol.for("react.memo_cache_sentinel")?(yt=K=>he(ae=>{const Be=new Set(ae);return Be.delete(K)||Be.add(K),Be}),e[31]=yt):yt=e[31];const pn=yt,fs=()=>he(K=>je.every(ae=>K.has(ae.key))?new Set:new Set(je.map(Cu)));let vt;e[32]!==g||e[33]!==Z||e[34]!==p?(vt=async()=>{let K=0;for(const ae of Z)await g.apply(ae,"archived")&&(K=K+1);he(new Set),K>0&&xe.success(p("sandbox.postBoard.archived"))},e[32]=g,e[33]=Z,e[34]=p,e[35]=vt):vt=e[35];const mn=vt;let kt;e[36]!==g?(kt=(K,ae)=>{j(null),g.apply(ae,K)},e[36]=g,e[37]=kt):kt=e[37];const fn=kt;let St;e[38]!==d||e[39]!==S?(St=()=>{const K=Ys(On()),ae=Fa({title:"",now:new Date});S.mutate({blockKey:K,data:ht(K,ae)}),d(K)},e[38]=d,e[39]=S,e[40]=St):St=e[40];const jt=St,gn=()=>{const K=Xd(D),ae=cu(K.sections,so(f,{hideDefaults:x}));if(ae.length===0&&!K.title.trim()){xe.error(p("sandbox.postBoard.importEmpty"));return}const Be=Ys(On()),ut=du({title:K.title,blocks:ae,takenSlugs:Q.map(wu).filter(Boolean),now:new Date});S.mutate({blockKey:Be,data:ht(Be,ut)}),T(!1),A(""),xe.success(p("sandbox.postBoard.imported")),d(Be)},Qt=r==="list";let st;e[41]!==c?(st=()=>c("list"),e[41]=c,e[42]=st):st=e[42];let wt;e[43]===Symbol.for("react.memo_cache_sentinel")?(wt=o.jsx(Ei,{size:14}),e[43]=wt):wt=e[43];let nt;e[44]!==p?(nt=p("sandbox.postBoard.viewList"),e[44]=p,e[45]=nt):nt=e[45];let ot;e[46]!==Qt||e[47]!==st||e[48]!==nt?(ot=o.jsx(Ko,{active:Qt,onClick:st,icon:wt,label:nt}),e[46]=Qt,e[47]=st,e[48]=nt,e[49]=ot):ot=e[49];const Zt=r==="board";let at;e[50]!==c?(at=()=>c("board"),e[50]=c,e[51]=at):at=e[51];let Ct;e[52]===Symbol.for("react.memo_cache_sentinel")?(Ct=o.jsx(Ci,{size:14}),e[52]=Ct):Ct=e[52];let it;e[53]!==p?(it=p("sandbox.postBoard.viewBoard"),e[53]=p,e[54]=it):it=e[54];let rt;e[55]!==Zt||e[56]!==at||e[57]!==it?(rt=o.jsx(Ko,{active:Zt,onClick:at,icon:Ct,label:it}),e[55]=Zt,e[56]=at,e[57]=it,e[58]=rt):rt=e[58];let Nt;e[59]!==ot||e[60]!==rt?(Nt=o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[ot,rt]})}),e[59]=ot,e[60]=rt,e[61]=Nt):Nt=e[61];let _t;e[62]===Symbol.for("react.memo_cache_sentinel")?(_t=o.jsx(Gn,{size:14}),e[62]=_t):_t=e[62];let lt;e[63]!==p?(lt=p("sandbox.postBoard.newPost"),e[63]=p,e[64]=lt):lt=e[64];let Xe;e[65]===Symbol.for("react.memo_cache_sentinel")?(Xe=o.jsx(ls,{size:14}),e[65]=Xe):Xe=e[65];let ct;e[66]!==lt?(ct=o.jsx(Ls,{asChild:!0,children:o.jsxs(Re,{type:"button",size:"sm",children:[_t,lt,Xe]})}),e[66]=lt,e[67]=ct):ct=e[67];let y;e[68]!==k||e[69]!==p?(y=k&&o.jsxs(Ze,{onClick:()=>E(!0),children:[o.jsx(zs,{size:14}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:p("sandbox.postBoard.newPostGenerate")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:p("sandbox.postBoard.newPostGenerateHint")})]})]}),e[68]=k,e[69]=p,e[70]=y):y=e[70];let z;e[71]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(Ai,{size:14}),e[71]=z):z=e[71];let se;e[72]!==p?(se=p("sandbox.postBoard.newPostWrite"),e[72]=p,e[73]=se):se=e[73];let re;e[74]!==se?(re=o.jsx("span",{children:se}),e[74]=se,e[75]=re):re=e[75];let Se;e[76]!==p?(Se=p("sandbox.postBoard.newPostWriteHint"),e[76]=p,e[77]=Se):Se=e[77];let Pe;e[78]!==Se?(Pe=o.jsx("span",{className:"text-xs text-muted-foreground",children:Se}),e[78]=Se,e[79]=Pe):Pe=e[79];let Ve;e[80]!==re||e[81]!==Pe?(Ve=o.jsxs("div",{className:"flex flex-col",children:[re,Pe]}),e[80]=re,e[81]=Pe,e[82]=Ve):Ve=e[82];let Qe;e[83]!==Ve||e[84]!==jt?(Qe=o.jsxs(Ze,{onClick:jt,children:[z,Ve]}),e[83]=Ve,e[84]=jt,e[85]=Qe):Qe=e[85];let gs,hs;e[86]===Symbol.for("react.memo_cache_sentinel")?(gs=()=>T(!0),hs=o.jsx(kn,{size:14}),e[86]=gs,e[87]=hs):(gs=e[86],hs=e[87]);let Pt;e[88]!==p?(Pt=p("sandbox.postBoard.importContent"),e[88]=p,e[89]=Pt):Pt=e[89];let Tt;e[90]!==Pt?(Tt=o.jsx("span",{children:Pt}),e[90]=Pt,e[91]=Tt):Tt=e[91];let At;e[92]!==p?(At=p("sandbox.postBoard.importContentHint"),e[92]=p,e[93]=At):At=e[93];let Et;e[94]!==At?(Et=o.jsx("span",{className:"text-xs text-muted-foreground",children:At}),e[94]=At,e[95]=Et):Et=e[95];let Dt;e[96]!==Tt||e[97]!==Et?(Dt=o.jsxs(Ze,{onClick:gs,children:[hs,o.jsxs("div",{className:"flex flex-col",children:[Tt,Et]})]}),e[96]=Tt,e[97]=Et,e[98]=Dt):Dt=e[98];let Bt;e[99]!==y||e[100]!==Qe||e[101]!==Dt?(Bt=o.jsxs(Is,{align:"end",className:"w-56",children:[y,Qe,Dt]}),e[99]=y,e[100]=Qe,e[101]=Dt,e[102]=Bt):Bt=e[102];let xs;e[103]!==ct||e[104]!==Bt?(xs=o.jsxs(Ks,{children:[ct,Bt]}),e[103]=ct,e[104]=Bt,e[105]=xs):xs=e[105];let bs;e[106]!==k||e[107]!==i||e[108]!==v||e[109]!==M||e[110]!==C?(bs=k&&o.jsx(Gd,{open:v,onOpenChange:E,decofile:i,hasAi:C,onGenerate:K=>{M(K)}}),e[106]=k,e[107]=i,e[108]=v,e[109]=M,e[110]=C,e[111]=bs):bs=e[111];let Ot;e[112]!==p?(Ot=p("sandbox.postBoard.importTitle"),e[112]=p,e[113]=Ot):Ot=e[113];let $t;e[114]!==Ot?($t=o.jsx(Yt,{children:Ot}),e[114]=Ot,e[115]=$t):$t=e[115];let Rt;e[116]!==p?(Rt=p("sandbox.postBoard.importDescription"),e[116]=p,e[117]=Rt):Rt=e[117];let Lt;e[118]!==Rt?(Lt=o.jsx(Kn,{children:Rt}),e[118]=Rt,e[119]=Lt):Lt=e[119];let ys;e[120]!==$t||e[121]!==Lt?(ys=o.jsxs(us,{children:[$t,Lt]}),e[120]=$t,e[121]=Lt,e[122]=ys):ys=e[122];const hn=ri(D)?"html":"markdown";let vs;e[123]===Symbol.for("react.memo_cache_sentinel")?(vs=K=>A(K??""),e[123]=vs):vs=e[123];let It;e[124]!==D||e[125]!==hn?(It=o.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:o.jsx(va,{code:D,language:hn,height:"100%",autoFocus:!0,onChange:vs})}),e[124]=D,e[125]=hn,e[126]=It):It=e[126];let ks;e[127]===Symbol.for("react.memo_cache_sentinel")?(ks=o.jsx("input",{ref:B,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async K=>{const ae=K.target.files?.[0];ae&&A(await ae.text()),K.target.value=""}}),e[127]=ks):ks=e[127];let Ss,js;e[128]===Symbol.for("react.memo_cache_sentinel")?(Ss=()=>B.current?.click(),js=o.jsx(kn,{size:14}),e[128]=Ss,e[129]=js):(Ss=e[128],js=e[129]);let Kt;e[130]!==p?(Kt=p("sandbox.postBoard.importUpload"),e[130]=p,e[131]=Kt):Kt=e[131];let Ft;e[132]!==Kt?(Ft=o.jsxs(Re,{type:"button",variant:"outline",size:"sm",onClick:Ss,children:[js,Kt]}),e[132]=Kt,e[133]=Ft):Ft=e[133];let ws;e[134]!==It||e[135]!==Ft?(ws=o.jsxs("div",{className:"space-y-3",children:[It,ks,Ft]}),e[134]=It,e[135]=Ft,e[136]=ws):ws=e[136];let Cs;e[137]!==D?(Cs=D.trim(),e[137]=D,e[138]=Cs):Cs=e[138];let Ns;e[139]===Symbol.for("react.memo_cache_sentinel")?(Ns=o.jsx(kn,{size:14}),e[139]=Ns):Ns=e[139];let _s;e[140]!==p?(_s=p("sandbox.postBoard.importRun"),e[140]=p,e[141]=_s):_s=e[141];let Ps;e[142]!==P||e[143]!==m||e[144]!==u||e[145]!==l||e[146]!==r?(Ps=r==="board"&&l&&P&&u&&o.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(l,{expanded:!0,onToggleExpand:()=>N(!1),onClose:()=>{N(!1),m?.()}})}),e[142]=P,e[143]=m,e[144]=u,e[145]=l,e[146]=r,e[147]=Ps):Ps=e[147];const xn=r==="board"&&!!l&&!P;let Mt;e[148]!==m?(Mt=K=>{K||(N(!1),m?.())},e[148]=m,e[149]=Mt):Mt=e[149];let zt;e[150]!==p?(zt=p("sandbox.collectionsSidebar.posts"),e[150]=p,e[151]=zt):zt=e[151];let Vt;e[152]!==zt?(Vt=o.jsx(Yt,{className:"sr-only",children:zt}),e[152]=zt,e[153]=Vt):Vt=e[153];let Ut;e[154]!==m||e[155]!==u||e[156]!==l?(Ut=l&&u?o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Tn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(l,{expanded:!1,onToggleExpand:()=>N(!0),onClose:()=>m?.()})}):null,e[154]=m,e[155]=u,e[156]=l,e[157]=Ut):Ut=e[157];let Gt;e[158]!==Vt||e[159]!==Ut?(Gt=o.jsxs(qt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[Vt,Ut]}),e[158]=Vt,e[159]=Ut,e[160]=Gt):Gt=e[160];let Ts;return e[161]!==xn||e[162]!==Mt||e[163]!==Gt?(Ts=o.jsx(Wt,{open:xn,onOpenChange:Mt,children:Gt}),e[161]=xn,e[162]=Mt,e[163]=Gt,e[164]=Ts):Ts=e[164],o.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[Nt,o.jsxs("div",{className:"flex items-center gap-2",children:[xs,bs,o.jsx(Wt,{open:O,onOpenChange:T,children:o.jsxs(qt,{className:"max-h-[85vh] sm:max-w-2xl",children:[ys,ws,o.jsx(ps,{children:o.jsxs(Re,{type:"button",disabled:!Cs,onClick:gn,children:[Ns,_s]})})]})})]})]}),Q.length===0?o.jsx(ol,{className:"flex-1",icon:o.jsx(zs,{size:22}),title:p("sandbox.postBoard.emptyTitle"),description:p("sandbox.postBoard.emptyDescription"),buttonProps:{children:p("sandbox.postBoard.newPost"),onClick:jt}}):r==="board"?o.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:vu.map(K=>{const ae=p(Zs[K]),Be=Q.filter(Le=>Le.status===K);Su(K)&&Be.sort(ku);const ut=q(K,Be.length===0);return o.jsxs(L.Fragment,{children:[o.jsx("div",{onDragOver:Le=>{Le.preventDefault(),j(K)},onDragLeave:()=>j(Le=>Le===K?null:Le),onDrop:Le=>{Le.preventDefault(),fn(K,Le.dataTransfer.getData(ui))},className:ve("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",ut?"w-11":"w-72",b===K&&"border-primary bg-primary/5"),children:ut?o.jsxs("button",{type:"button",onClick:()=>I(K,!1),"aria-label":p("sandbox.postBoard.expandLane",{lane:ae}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[o.jsx(Fs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"text-xs tabular-nums",children:Be.length}),o.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:ae})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[o.jsxs("button",{type:"button",onClick:()=>I(K,!0),"aria-label":p("sandbox.postBoard.collapseLane",{lane:ae}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[o.jsx(ls,{size:14,className:"shrink-0"}),o.jsx("span",{className:"truncate",children:ae})]}),o.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Be.length})]}),o.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Be.length===0?o.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.postBoard.laneEmpty")}):Be.map(Le=>o.jsx(Eu,{post:Le,payload:fe(Le.key),moving:g.isMoving(Le.key),onOpen:()=>d(Le.key),onArchive:Le.status==="archived"?void 0:()=>{me(Le)}},Le.key))})]})}),K===In&&o.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},K)})}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[o.jsx(pu,{value:te,onChange:_}),$e?o.jsx(bu,{count:Z.size,allSelected:je.length>0&&je.every(K=>Z.has(K.key)),onToggleSelectAll:fs,onArchive:()=>{mn()},onExit:()=>he(new Set)}):o.jsx(mu,{categories:Ee,authors:Ae,statusCounts:Te,categoryFilter:de,authorFilter:ee,statusFilter:ne,sort:oe,onCategoryFilterChange:ie,onAuthorFilterChange:ge,onStatusFilterChange:pe,onSortChange:X}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Tu,{posts:je,selectedKey:ue,selectionActive:$e,selectedKeys:Z,onToggleSelect:pn,onOpen:d,isMoving:g.isMoving,onArchive:K=>{me(K)}})})]}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ue&&u?o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Tn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(ue)}):o.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:p("sandbox.postBoard.selectPrompt")})})]}),Ps,Ts]})}function wu(t){return t.slug}function Cu(t){return t.key}function Nu(t){return t.authorEmails}function _u(t){return t.categorySlugs}function Pu(t,e){return t[e.status]=(t[e.status]??0)+1,t}function Ko(t){const e=le.c(7),{active:s,onClick:n,icon:a,label:i}=t,r=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let l;e[0]!==r?(l=ve("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r),e[0]=r,e[1]=l):l=e[1];let c;return e[2]!==a||e[3]!==i||e[4]!==n||e[5]!==l?(c=o.jsxs("button",{type:"button",onClick:n,className:l,children:[a,i]}),e[2]=a,e[3]=i,e[4]=n,e[5]=l,e[6]=c):c=e[6],c}function Tu(t){const e=le.c(23),{posts:s,selectedKey:n,selectionActive:a,selectedKeys:i,onToggleSelect:r,onOpen:l,isMoving:c,onArchive:d}=t,m=Ne();if(s.length===0){let u;e[0]!==m?(u=m("sandbox.postList.noMatches"),e[0]=m,e[1]=u):u=e[1];let p;return e[2]!==u?(p=o.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=p):p=e[3],p}let g;if(e[4]!==c||e[5]!==d||e[6]!==l||e[7]!==r||e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==a){let u;e[13]!==c||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==n||e[18]!==i||e[19]!==a?(u=p=>o.jsx(Au,{post:p,selected:p.key===n,selectionActive:a,checked:i.has(p.key),onToggleSelect:()=>r(p.key),moving:c(p.key),onOpen:()=>l(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=c,e[14]=d,e[15]=l,e[16]=r,e[17]=n,e[18]=i,e[19]=a,e[20]=u):u=e[20],g=s.map(u),e[4]=c,e[5]=d,e[6]=l,e[7]=r,e[8]=s,e[9]=n,e[10]=i,e[11]=a,e[12]=g}else g=e[12];let f;return e[21]!==g?(f=o.jsx("ul",{className:"divide-y",children:g}),e[21]=g,e[22]=f):f=e[22],f}function Au(t){const e=le.c(60),{post:s,selected:n,selectionActive:a,checked:i,onToggleSelect:r,moving:l,onOpen:c,onArchive:d}=t,m=Ne(),g=s.status==="awaiting_review"&&s.missing.length>0,f=s.status==="scheduled"||s.status==="published",u=a||i?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==u?(p=ve("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=p):p=e[1];let h;e[2]!==r?(h=()=>r(),e[2]=r,e[3]=h):h=e[3];let S;e[4]!==s.title||e[5]!==m?(S=s.title||m("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=m,e[6]=S):S=e[6];let C;e[7]!==i||e[8]!==h||e[9]!==S?(C=o.jsx(on,{checked:i,onCheckedChange:h,"aria-label":S}),e[7]=i,e[8]=h,e[9]=S,e[10]=C):C=e[10];let k;e[11]!==p||e[12]!==C?(k=o.jsx("span",{className:p,children:C}),e[11]=p,e[12]=C,e[13]=k):k=e[13];let x;e[14]!==l||e[15]!==d||e[16]!==a?(x=d&&!a&&o.jsx(pi,{onArchive:d,disabled:l,className:"top-2.5"}),e[14]=l,e[15]=d,e[16]=a,e[17]=x):x=e[17];let b;e[18]!==c||e[19]!==r||e[20]!==a?(b=()=>a?r():c(),e[18]=c,e[19]=r,e[20]=a,e[21]=b):b=e[21];const j=n?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let P;e[22]!==j?(P=ve("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",j),e[22]=j,e[23]=P):P=e[23];let N;e[24]!==s.title||e[25]!==m?(N=s.title||m("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=m,e[26]=N):N=e[26];let v;e[27]!==N?(v=o.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:N}),e[27]=N,e[28]=v):v=e[28];const E=yu[s.status],O=Zs[s.status];let T;e[29]!==m||e[30]!==O?(T=m(O),e[29]=m,e[30]=O,e[31]=T):T=e[31];let D;e[32]!==E||e[33]!==T?(D=o.jsx(Qn,{variant:E,className:"shrink-0",children:T}),e[32]=E,e[33]=T,e[34]=D):D=e[34];let A;e[35]!==g||e[36]!==s.missing?(A=g&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(rs,{size:12}),s.missing.length]}),e[35]=g,e[36]=s.missing,e[37]=A):A=e[37];let B;e[38]!==s.duplicateTitle||e[39]!==m?(B=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:m("sandbox.postBoard.duplicateTitle"),children:[o.jsx(Jn,{size:12,"aria-hidden":!0}),o.jsx("span",{className:"sr-only",children:m("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=m,e[40]=B):B=e[40];let w;e[41]!==f||e[42]!==s.date||e[43]!==s.scheduledDatetime?(w=f&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[o.jsx(Vn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=f,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=w):w=e[44];let $;e[45]!==D||e[46]!==A||e[47]!==B||e[48]!==w?($=o.jsxs("div",{className:"flex items-center gap-2",children:[D,A,B,w]}),e[45]=D,e[46]=A,e[47]=B,e[48]=w,e[49]=$):$=e[49];let V;e[50]!==n||e[51]!==P||e[52]!==v||e[53]!==$||e[54]!==b?(V=o.jsxs("button",{type:"button",onClick:b,"aria-current":n,className:P,children:[v,$]}),e[50]=n,e[51]=P,e[52]=v,e[53]=$,e[54]=b,e[55]=V):V=e[55];let F;return e[56]!==V||e[57]!==k||e[58]!==x?(F=o.jsxs("li",{className:"group/row relative",children:[k,x,V]}),e[56]=V,e[57]=k,e[58]=x,e[59]=F):F=e[59],F}function Eu(t){const e=le.c(50),{post:s,payload:n,moving:a,onOpen:i,onArchive:r}=t,l=Ne(),c=s.status!=="generating"&&!a;let d;e[0]!==n?(d=Kc(n),e[0]=n,e[1]=d):d=e[1];const m=d,g=!c&&"opacity-80";let f;e[2]!==g?(f=ve("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",g),e[2]=g,e[3]=f):f=e[3];let u;e[4]!==a||e[5]!==r?(u=r&&o.jsx(pi,{onArchive:r,disabled:a,className:"top-2"}),e[4]=a,e[5]=r,e[6]=u):u=e[6];let p;e[7]!==s.key?(p=T=>T.dataTransfer.setData(ui,s.key),e[7]=s.key,e[8]=p):p=e[8];const h=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let S;e[9]!==h?(S=ve("block w-full p-3 text-left",h),e[9]=h,e[10]=S):S=e[10];let C;e[11]!==s.title||e[12]!==l?(C=s.title||l("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=l,e[13]=C):C=e[13];let k;e[14]!==C?(k=o.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:C}),e[14]=C,e[15]=k):k=e[15];let x;e[16]!==m||e[17]!==s.status?(x=s.status==="draft"&&m.format?.name&&o.jsx(Qn,{variant:"outline",className:"max-w-full truncate",children:m.format.name}),e[16]=m,e[17]=s.status,e[18]=x):x=e[18];let b;e[19]!==s.status||e[20]!==l?(b=s.status==="generating"&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Tn,{size:12,className:"animate-spin"}),l("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=l,e[21]=b):b=e[21];let j;e[22]!==s.missing||e[23]!==s.status||e[24]!==l?(j=s.status==="awaiting_review"&&(s.missing.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(rs,{size:12}),l("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[o.jsx(nl,{size:12}),l("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=l,e[25]=j):j=e[25];let P;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(P=(s.status==="scheduled"||s.status==="published")&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(Vn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=P):P=e[29];let N;e[30]!==s.duplicateTitle||e[31]!==l?(N=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(Jn,{size:12,"aria-hidden":!0}),l("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=l,e[32]=N):N=e[32];let v;e[33]!==x||e[34]!==b||e[35]!==j||e[36]!==P||e[37]!==N?(v=o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[x,b,j,P,N]}),e[33]=x,e[34]=b,e[35]=j,e[36]=P,e[37]=N,e[38]=v):v=e[38];let E;e[39]!==c||e[40]!==i||e[41]!==v||e[42]!==p||e[43]!==S||e[44]!==k?(E=o.jsxs("button",{type:"button",draggable:c,onDragStart:p,onClick:i,className:S,children:[k,v]}),e[39]=c,e[40]=i,e[41]=v,e[42]=p,e[43]=S,e[44]=k,e[45]=E):E=e[45];let O;return e[46]!==E||e[47]!==f||e[48]!==u?(O=o.jsxs("div",{className:f,children:[u,E]}),e[46]=E,e[47]=f,e[48]=u,e[49]=O):O=e[49],O}function pi(t){const e=le.c(13),{label:s,onArchive:n,disabled:a,className:i}=t,r=Ne();let l;e[0]!==s||e[1]!==r?(l=s??r("sandbox.postBoard.delete"),e[0]=s,e[1]=r,e[2]=l):l=e[2];const c=l;let d;e[3]!==n?(d=u=>{u.stopPropagation(),n()},e[3]=n,e[4]=d):d=e[4];let m;e[5]!==i?(m=ve("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",i),e[5]=i,e[6]=m):m=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Xn,{size:13}),e[7]=g):g=e[7];let f;return e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==c?(f=o.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:m,children:g}),e[8]=a,e[9]=d,e[10]=m,e[11]=c,e[12]=f):f=e[12],f}function Ye(t){const e=le.c(54),{icon:s,logoUrl:n,title:a,subtitle:i,active:r,accent:l,variantCount:c,trailing:d,selectable:m,selectionActive:g,selected:f,invalid:u,invalidReason:p,warning:h,warningReason:S,onToggleSelect:C,onClick:k,menu:x}=t,b=Ne(),j=l==="global";let P;e[0]!==s||e[1]!==r||e[2]!==j||e[3]!==n?(P=n?o.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):o.jsx("span",{className:ve("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:o.jsx(s,{size:16,className:ve("shrink-0",!j&&(r?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Wn}:void 0})}),e[0]=s,e[1]=r,e[2]=j,e[3]=n,e[4]=P):P=e[4];const N=P,v=r?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let E;e[5]!==v?(E=ve("group relative flex min-w-0 items-center rounded-md transition-colors",v),e[5]=v,e[6]=E):E=e[6];let O;e[7]!==C||e[8]!==m||e[9]!==f||e[10]!==g||e[11]!==b||e[12]!==a?(O=m&&o.jsx("span",{className:ve("flex shrink-0 items-center pl-2.5 transition-opacity",f||g?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Du,children:o.jsx(on,{checked:f,onCheckedChange:()=>C?.(),"aria-label":b("sandbox.itemRow.selectItem",{title:a})})}),e[7]=C,e[8]=m,e[9]=f,e[10]=g,e[11]=b,e[12]=a,e[13]=O):O=e[13];const T=u&&!r&&"text-destructive";let D;e[14]!==T?(D=ve("block truncate text-sm font-medium",T),e[14]=T,e[15]=D):D=e[15];let A;e[16]!==D||e[17]!==a?(A=o.jsx("span",{className:D,children:a}),e[16]=D,e[17]=a,e[18]=A):A=e[18];const B=r?"text-accent-foreground/70":"text-muted-foreground";let w;e[19]!==B?(w=ve("block truncate text-xs",B),e[19]=B,e[20]=w):w=e[20];let $;e[21]!==i||e[22]!==w?($=o.jsx("span",{className:w,children:i}),e[21]=i,e[22]=w,e[23]=$):$=e[23];let V;e[24]!==$||e[25]!==A?(V=o.jsxs("span",{className:"min-w-0 flex-1",children:[A,$]}),e[24]=$,e[25]=A,e[26]=V):V=e[26];let F;e[27]!==r||e[28]!==b||e[29]!==c?(F=c!==void 0&&c>1&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsxs("span",{className:ve("flex shrink-0 items-center gap-1 text-xs font-medium",r?"text-accent-foreground/70":"text-muted-foreground"),children:[o.jsx(Xo,{size:14}),c]})}),o.jsx(We,{side:"bottom",children:b("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=r,e[28]=b,e[29]=c,e[30]=F):F=e[30];let q;e[31]!==h||e[32]!==S?(q=h&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center text-warning",children:o.jsx(rs,{size:14})})}),S&&o.jsx(We,{side:"bottom",children:S})]}),e[31]=h,e[32]=S,e[33]=q):q=e[33];let H;e[34]!==r||e[35]!==u||e[36]!==p?(H=u&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:ve("flex shrink-0 items-center",r?"text-accent-foreground":"text-destructive"),children:o.jsx(rs,{size:14})})}),p&&o.jsx(We,{side:"bottom",children:p})]}),e[34]=r,e[35]=u,e[36]=p,e[37]=H):H=e[37];let I;e[38]!==k||e[39]!==N||e[40]!==V||e[41]!==F||e[42]!==q||e[43]!==H||e[44]!==d?(I=o.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[N,V,F,q,H,d]}),e[38]=k,e[39]=N,e[40]=V,e[41]=F,e[42]=q,e[43]=H,e[44]=d,e[45]=I):I=e[45];let G;e[46]!==r||e[47]!==x?(G=x&&o.jsx("div",{className:ve("pr-1 opacity-0 transition-opacity group-hover:opacity-100",r&&"opacity-100"),children:x}),e[46]=r,e[47]=x,e[48]=G):G=e[48];let W;return e[49]!==I||e[50]!==G||e[51]!==E||e[52]!==O?(W=o.jsxs("div",{className:E,children:[O,I,G]}),e[49]=I,e[50]=G,e[51]=E,e[52]=O,e[53]=W):W=e[53],W}function Du(t){return t.stopPropagation()}function dt(t){const e=le.c(10),{icon:s,title:n,description:a}=t;let i;e[0]!==s?(i=s&&o.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==n?(r=o.jsx("div",{children:n}),e[2]=n,e[3]=r):r=e[3];let l;e[4]!==a?(l=a&&o.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==i||e[7]!==r||e[8]!==l?(c=o.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:[i,r,l]}),e[6]=i,e[7]=r,e[8]=l,e[9]=c):c=e[9],c}const Bu={loaders:Jo,actions:ta},Ou={loaders:"Loaders",actions:"Actions"},$u={analytics:Pi,blog:ya,commerce:_i,site:Ni,website:Ms};function Ru(t,e){return e===0?$u[t.toLowerCase()]??lo:lo}function Ds(t,e){return e===0?rr(t):t}function Lu(t){const e=le.c(98),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,kind:c}=t,d=Ne();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[0]=m):m=e[0];const[g,f]=L.useState(m),[u,p]=L.useState(null),[h,S]=L.useState(""),[C,k]=L.useState(Gu),[x,b]=L.useState(c);x!==c&&(b(c),f([]),p(null),S(""),k(new Set));let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=M=>{k(Q=>{const ce=new Set(Q);return ce.has(M)?ce.delete(M):ce.add(M),ce})},e[1]=j):j=e[1];const P=j;let N;e[2]!==a||e[3]!==s||e[4]!==n?(N={orgSlug:s,virtualMcpId:n,branch:a},e[2]=a,e[3]=s,e[4]=n,e[5]=N):N=e[5];const v=sn(N);let E;e[6]!==v?(E=pa((M,Q)=>v.mutate({blockKey:M,data:Q})),e[6]=v,e[7]=E):E=e[7];const O=E;let T;e[8]!==c?(T=lr(c),e[8]=c,e[9]=T):T=e[9];const D=T,A=Bu[c];let B,w,$,V,F,q,H;if(e[10]!==A||e[11]!==a||e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==C||e[16]!==s||e[17]!==g||e[18]!==i||e[19]!==v||e[20]!==O||e[21]!==h||e[22]!==u||e[23]!==D||e[24]!==d||e[25]!==n){$=Symbol.for("react.early_return_sentinel");e:{const M=[...nr(r,l,c).map(Uu),...or(r,c).map(Vu)],Q=h.trim().toLowerCase(),ce=Q.length>0,fe=ce?M.filter(U=>U.title.toLowerCase().includes(Q)||U.resolveType.toLowerCase().includes(Q)):[],ue=new Map,J=[],me=new Map;if(!ce){for(const U of M){const ye=U.folderPath;if(!(ye.length<g.length)&&g.every((je,$e)=>ye[$e]===je))if(ye.length===g.length)if(U.savedKey!==void 0){const je=me.get(U.resolveType);je?je.push(U):me.set(U.resolveType,[U])}else J.push(U);else{const je=ye[g.length],$e=ue.get(je)??{count:0,savedCount:0};U.savedKey!==void 0?$e.savedCount=$e.savedCount+1:$e.count=$e.count+1,ue.set(je,$e)}}J.sort(zu);for(const U of me.values())U.sort(Mu)}const de=[...me.entries()].filter(U=>{const[ye]=U;return!J.some(je=>je.resolveType===ye)}).flatMap(Fu).sort(Ku);let ie;e[33]!==g?(ie=(U,ye)=>Ds(U.name,g.length).localeCompare(Ds(ye.name,g.length)),e[33]=g,e[34]=ie):ie=e[34];const ee=[...ue.entries()].map(Iu).sort(ie);let ge;e[35]===Symbol.for("react.memo_cache_sentinel")?(ge=U=>{p(U.savedKey!==void 0?{mode:"saved",key:U.savedKey}:{mode:"available",resolveType:U.resolveType,title:U.title})},e[35]=ge):ge=e[35];const ne=ge;let pe;e[36]!==v||e[37]!==D||e[38]!==d?(pe=async(U,ye)=>{await v.mutateAsync({blockKey:U,data:ye}),xe.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:U})),p({mode:"saved",key:U})},e[36]=v,e[37]=D,e[38]=d,e[39]=pe):pe=e[39];const oe=pe;let X;e[40]!==l||e[41]!==u?(X=Hu(u,l),e[40]=l,e[41]=u,e[42]=X):X=e[42];const te=X;if(te){const U=`${te.mode}:${te.mode==="saved"?te.blockKey:te.resolveType}`;let ye;e[43]===Symbol.for("react.memo_cache_sentinel")?(ye=()=>p(null),e[43]=ye):ye=e[43];let je;e[44]!==a||e[45]!==l||e[46]!==oe||e[47]!==c||e[48]!==r||e[49]!==s||e[50]!==i||e[51]!==v.isPending||e[52]!==O||e[53]!==U||e[54]!==te.editorTarget||e[55]!==te.initialValue||e[56]!==n?(je=o.jsx(ar,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,kind:c,target:te.editorTarget,initialValue:te.initialValue,isCreating:v.isPending,onCreate:oe,onSaveReferencedBlock:O,onBack:ye},U),e[44]=a,e[45]=l,e[46]=oe,e[47]=c,e[48]=r,e[49]=s,e[50]=i,e[51]=v.isPending,e[52]=O,e[53]=U,e[54]=te.editorTarget,e[55]=te.initialValue,e[56]=n,e[57]=je):je=e[57],$=je;break e}H="flex h-full w-full min-w-0 flex-col";let _;e[58]!==d?(_=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=_):_=e[59];let Y;e[60]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>f([]),e[60]=Y):Y=e[60];const Z=g.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==Z?(he=ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Z),e[61]=Z,e[62]=he):he=e[62];const Te=Ou[c];let _e;e[63]!==he||e[64]!==Te?(_e=o.jsx("button",{type:"button",onClick:Y,className:he,children:Te}),e[63]=he,e[64]=Te,e[65]=_e):_e=e[65];let Oe;e[66]!==g?(Oe=g.map((U,ye)=>{const je=ye===g.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o.jsx(Fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>f(g.slice(0,ye+1)),className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je?"font-medium text-foreground":"text-muted-foreground"),children:Ds(U,ye)})]},`${U}-${ye}`)}),e[66]=g,e[67]=Oe):Oe=e[67];let we;e[68]!==_||e[69]!==_e||e[70]!==Oe?(we=o.jsxs("nav",{"aria-label":_,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[_e,Oe]}),e[68]=_,e[69]=_e,e[70]=Oe,e[71]=we):we=e[71];let Ee;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ee=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ee):Ee=e[72];let Ae;e[73]===Symbol.for("react.memo_cache_sentinel")?(Ae=U=>S(U.target.value),e[73]=Ae):Ae=e[73];let be;e[74]!==c||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=be):be=e[76];let Ce;e[77]!==c||e[78]!==d?(Ce=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Ce):Ce=e[79];let De;e[80]!==h||e[81]!==be||e[82]!==Ce?(De=o.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ee,o.jsx("input",{type:"text",value:h,onChange:Ae,placeholder:be,"aria-label":Ce,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=h,e[81]=be,e[82]=Ce,e[83]=De):De=e[83],e[84]!==we||e[85]!==De?(w=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,De]}),e[84]=we,e[85]=De,e[86]=w):w=e[86],B=tn,q="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",F=ce?fe.length===0?o.jsx(dt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:h.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):o.jsx("div",{className:"flex flex-col gap-1",children:fe.map(U=>o.jsx(Ye,{icon:A,accent:U.savedKey!==void 0?"global":void 0,title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)},U.savedKey??U.resolveType))}):ee.length===0&&J.length===0&&de.length===0?o.jsx(dt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:g.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):o.jsxs(o.Fragment,{children:[ee.length>0&&o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:ee.map(U=>{const ye=Ru(U.name,g.length);return o.jsxs("button",{type:"button",onClick:()=>f([...g,U.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:[o.jsx(ye,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:Ds(U.name,g.length)}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[U.count," ",U.count===1?D:c,U.savedCount>0&&o.jsxs(o.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:U.savedCount})]})]})]})]},U.name)})}),(J.length>0||de.length>0)&&o.jsxs("div",{className:ve("flex flex-col gap-1",ee.length>0&&"mt-4"),children:[J.map(U=>{const ye=me.get(U.resolveType)??[],je=C.has(U.resolveType);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(Ye,{icon:A,title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)}),ye.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>P(U.resolveType),"aria-expanded":je,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Wn},children:[je?o.jsx(ls,{size:12,className:"shrink-0"}):o.jsx(Fs,{size:12,className:"shrink-0"}),d(je?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ye.length,")"]}),je&&o.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ye.map($e=>o.jsx(Ye,{icon:A,accent:"global",title:$e.title,subtitle:$e.resolveType,active:!1,onClick:()=>ne($e)},$e.savedKey))})]})]},U.resolveType)}),de.map(U=>o.jsx(Ye,{icon:A,accent:"global",title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)},U.savedKey))]})]})}e[10]=A,e[11]=a,e[12]=l,e[13]=c,e[14]=r,e[15]=C,e[16]=s,e[17]=g,e[18]=i,e[19]=v,e[20]=O,e[21]=h,e[22]=u,e[23]=D,e[24]=d,e[25]=n,e[26]=B,e[27]=w,e[28]=$,e[29]=V,e[30]=F,e[31]=q,e[32]=H}else B=e[26],w=e[27],$=e[28],V=e[29],F=e[30],q=e[31],H=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let I;e[87]!==V||e[88]!==F?(I=o.jsx("div",{className:V,children:F}),e[87]=V,e[88]=F,e[89]=I):I=e[89];let G;e[90]!==B||e[91]!==I||e[92]!==q?(G=o.jsx(B,{className:q,children:I}),e[90]=B,e[91]=I,e[92]=q,e[93]=G):G=e[93];let W;return e[94]!==w||e[95]!==G||e[96]!==H?(W=o.jsxs("div",{className:H,children:[w,G]}),e[94]=w,e[95]=G,e[96]=H,e[97]=W):W=e[97],W}function Iu(t){const[e,s]=t;return{name:e,...s}}function Ku(t,e){return t.title.localeCompare(e.title)}function Fu(t){const[,e]=t;return e}function Mu(t,e){return t.title.localeCompare(e.title)}function zu(t,e){return t.title.localeCompare(e.title)}function Vu(t){return{resolveType:t.resolveType,title:t.title,folderPath:ua(t.resolveType)}}function Uu(t){return{resolveType:t.resolveType,title:t.title,folderPath:ua(t.resolveType),savedKey:t.key}}function Gu(){return new Set}function Hu(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:s,props:n,title:a}=ir(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:n}}function Yu(t){const e=le.c(106),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,resolveType:c,title:d,defaultBlockId:m,isCreating:g,onCreate:f,onSaveReferencedBlock:u}=t,p=Ne(),h=ms(),S=h?.virtualMcpId,k=ba(S===n?n:null)?.metadata?.siteSlug??null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];const[b,j]=L.useState(x);let P;e[1]===Symbol.for("react.memo_cache_sentinel")?(P=[],e[1]=P):P=e[1];const[N,v]=L.useState(P),[E,O]=L.useState(0),[T,D]=L.useState(!1);let A;e[2]!==r||e[3]!==c?(A=qn(c,r),e[2]=r,e[3]=c,e[4]=A):A=e[4];const B=A;let w,$,V,F,q,H,I,G;if(e[5]!==k||e[6]!==a||e[7]!==l||e[8]!==N||e[9]!==b||e[10]!==g||e[11]!==f||e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==p||e[16]!==h?.taskId||e[17]!==d||e[18]!==n){const J=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,me=h?.taskId??null,de=i??void 0;let ie;e[27]!==k||e[28]!==a||e[29]!==s||e[30]!==de||e[31]!==me||e[32]!==n?(ie={orgSlug:s,virtualMcpId:n,branch:a,threadId:me,previewUrl:de,siteSlug:k},e[27]=k,e[28]=a,e[29]=s,e[30]=de,e[31]=me,e[32]=n,e[33]=ie):ie=e[33],$=ie;let ee,ge,ne,pe;if(e[34]!==l||e[35]!==N||e[36]!==b||e[37]!==f||e[38]!==p||e[39]!==d){const _e=[d,...N],Oe=Ee=>{v(N.slice(0,Ee)),O(qu)};let we;e[48]!==l||e[49]!==b||e[50]!==f?(we=async Ee=>{const Ae=dr(Ee,l);if(Ae){xe.error(Ae);return}await f(Ee,b),D(!1)},e[48]=l,e[49]=b,e[50]=f,e[51]=we):we=e[51],w=we,G="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",q="shrink-0 border-b px-3 py-2.5",pe="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(ee=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=ee):ee=e[53],ge="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ne=_e.map((Ee,Ae)=>{const be=Ae===_e.length-1,Ce=cr(Ee);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Ae>0&&o.jsx(Fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>Oe(Ae),title:Ce,className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Ce})]},`${Ce}-${Ae}`)}),e[34]=l,e[35]=N,e[36]=b,e[37]=f,e[38]=p,e[39]=d,e[40]=w,e[41]=ee,e[42]=ge,e[43]=ne,e[44]=pe,e[45]=q,e[46]=I,e[47]=G}else w=e[40],ee=e[41],ge=e[42],ne=e[43],pe=e[44],q=e[45],I=e[46],G=e[47];let oe;e[54]!==ee||e[55]!==ge||e[56]!==ne?(oe=o.jsx("nav",{"aria-label":ee,className:ge,children:ne}),e[54]=ee,e[55]=ge,e[56]=ne,e[57]=oe):oe=e[57];let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=()=>D(!0),e[58]=X):X=e[58];let te;e[59]!==p?(te=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=te):te=e[60];let _;e[61]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Ti,{size:14}),e[61]=_):_=e[61];let Y;e[62]!==g||e[63]!==te?(Y=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{size:"icon",className:"size-8 shrink-0",disabled:g,onClick:X,"aria-label":te,children:_})}),e[62]=g,e[63]=te,e[64]=Y):Y=e[64];let Z;e[65]!==p?(Z=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=Z):Z=e[66];let he;e[67]!==Z?(he=o.jsx(We,{side:"bottom",children:Z}),e[67]=Z,e[68]=he):he=e[68];let Te;e[69]!==Y||e[70]!==he?(Te=o.jsxs(Je,{children:[Y,he]}),e[69]=Y,e[70]=he,e[71]=Te):Te=e[71],e[72]!==pe||e[73]!==oe||e[74]!==Te?(H=o.jsxs("div",{className:pe,children:[oe,Te]}),e[72]=pe,e[73]=oe,e[74]=Te,e[75]=H):H=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",F=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:J}),e[5]=k,e[6]=a,e[7]=l,e[8]=N,e[9]=b,e[10]=g,e[11]=f,e[12]=s,e[13]=i,e[14]=c,e[15]=p,e[16]=h?.taskId,e[17]=d,e[18]=n,e[19]=w,e[20]=$,e[21]=V,e[22]=F,e[23]=q,e[24]=H,e[25]=I,e[26]=G}else w=e[19],$=e[20],V=e[21],F=e[22],q=e[23],H=e[24],I=e[25],G=e[26];let W;e[76]!==V||e[77]!==F?(W=o.jsx("p",{className:V,children:F}),e[76]=V,e[77]=F,e[78]=W):W=e[78];let M;e[79]!==W||e[80]!==q||e[81]!==H?(M=o.jsxs("div",{className:q,children:[H,W]}),e[79]=W,e[80]=q,e[81]=H,e[82]=M):M=e[82];let Q;e[83]!==l||e[84]!==N||e[85]!==E||e[86]!==b||e[87]!==r||e[88]!==u||e[89]!==$||e[90]!==B||e[91]!==p?(Q=o.jsx(tn,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:B?o.jsx(ma,{schema:B,value:b,onChange:J=>j(J),basePath:"",breadcrumbPath:N,onBreadcrumbChange:v,meta:r,decofile:l,onSaveReferencedBlock:u,sandbox:$},E):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=l,e[84]=N,e[85]=E,e[86]=b,e[87]=r,e[88]=u,e[89]=$,e[90]=B,e[91]=p,e[92]=Q):Q=e[92];let ce;e[93]!==M||e[94]!==Q||e[95]!==I?(ce=o.jsxs("div",{className:I,children:[M,Q]}),e[93]=M,e[94]=Q,e[95]=I,e[96]=ce):ce=e[96];let fe;e[97]!==m||e[98]!==w||e[99]!==g||e[100]!==T?(fe=o.jsx(ur,{open:T,onOpenChange:D,defaultBlockId:m,isPending:g,onSubmit:w}),e[97]=m,e[98]=w,e[99]=g,e[100]=T,e[101]=fe):fe=e[101];let ue;return e[102]!==ce||e[103]!==fe||e[104]!==G?(ue=o.jsxs("div",{className:G,children:[ce,fe]}),e[102]=ce,e[103]=fe,e[104]=G,e[105]=ue):ue=e[105],ue}function qu(t){return t+1}function Wu(t,e){const s={__resolveType:t},n=fr([s],e)[0];return n?gr(s,n,e):null}function Ju({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:a,decofile:i,blockKey:r,onSaveReferencedBlock:l}){const c=Ne(),d=ms(),m=d?.virtualMcpId,f=ba(m===e?e:null)?.metadata?.siteSlug??null,[u]=L.useState(()=>Wu(r,i)),[p,h]=L.useState(u?.data??{}),[S,C]=L.useState([]),[k,x]=L.useState(0),[b,j]=L.useState(!1),[P,N]=L.useState(null),v=P!==null,{save:E,flush:O}=pr({orgSlug:t,virtualMcpId:e,branch:s}),T=u?.resolveType?qn(u.resolveType,a):null,D=i[r],A=D?Br(r,D):r,B=d?.taskId??null,w={orgSlug:t,virtualMcpId:e,branch:s,threadId:B,previewUrl:n??void 0,siteSlug:f},$=I=>{h(I),E(r,I)},V=()=>{v?(N(null),j(!1),x(I=>I+1)):N(JSON.stringify(p,null,2))},F=I=>{const G=I??"";try{const W=JSON.parse(G);if(W&&typeof W=="object"&&!Array.isArray(W)){j(!1),$(W);return}j(!0)}catch{j(!0)}},q=[A,...S],H=I=>{C(S.slice(0,I)),x(G=>G+1)};return o.jsx("div",{className:"flex h-full w-full min-w-0",children:o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx(mr,{crumbs:q,onSelect:H}),o.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Wn},"aria-hidden":!0}),o.jsx("div",{className:"flex-1"}),o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Re,{variant:v?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":v,children:v?o.jsx(Fn,{size:14}):o.jsx(Qo,{size:14})})}),o.jsx(We,{side:"bottom",children:c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),o.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),o.jsxs("div",{className:"relative min-h-0 flex-1",children:[o.jsx(tn,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:T?o.jsx(ma,{schema:T,value:p,onChange:I=>$(I),basePath:"",breadcrumbPath:S,onBreadcrumbChange:C,meta:a,decofile:i,onSaveReferencedBlock:l,sandbox:w},k):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),P!==null&&o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[b&&o.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(va,{language:"json",height:"100%",code:P,onChange:F,onSave:I=>{F(I),O()}})})]})]})]})})}function Xu(t){const e=le.c(36),{selection:s,orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,isCreating:d,onCreateAvailable:m,onSaveReferencedBlock:g}=t,f=Ne();if(!s){let h;e[0]!==f?(h=f("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=f,e[1]=h):h=e[1];let S;e[2]!==f?(S=f("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=f,e[3]=S):S=e[3];let C;return e[4]!==h||e[5]!==S?(C=o.jsx(dt,{title:h,description:S}),e[4]=h,e[5]=S,e[6]=C):C=e[6],C}if(s.collection==="available-section"){const h=`available:${s.resolveType}`,S=s.resolveType,C=s.title;let k;e[7]!==s.title?(k=hr(s.title),e[7]=s.title,e[8]=k):k=e[8];let x;e[9]!==m||e[10]!==s.resolveType?(x=(j,P)=>m(s.resolveType,j,P),e[9]=m,e[10]=s.resolveType,e[11]=x):x=e[11];let b;return e[12]!==i||e[13]!==c||e[14]!==d||e[15]!==l||e[16]!==g||e[17]!==n||e[18]!==r||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==h||e[22]!==k||e[23]!==x||e[24]!==a?(b=o.jsx(Yu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,resolveType:S,title:C,defaultBlockId:k,isCreating:d,onCreate:x,onSaveReferencedBlock:g},h),e[12]=i,e[13]=c,e[14]=d,e[15]=l,e[16]=g,e[17]=n,e[18]=r,e[19]=s.resolveType,e[20]=s.title,e[21]=h,e[22]=k,e[23]=x,e[24]=a,e[25]=b):b=e[25],b}const u=`saved:${s.key}`;let p;return e[26]!==i||e[27]!==c||e[28]!==l||e[29]!==g||e[30]!==n||e[31]!==r||e[32]!==s.key||e[33]!==u||e[34]!==a?(p=o.jsx(Ju,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,blockKey:s.key,onSaveReferencedBlock:g},u),e[26]=i,e[27]=c,e[28]=l,e[29]=g,e[30]=n,e[31]=r,e[32]=s.key,e[33]=u,e[34]=a,e[35]=p):p=e[35],p}function Bs(t){const e=le.c(34),{onDuplicate:s,onRename:n,onAddVariant:a,onEditSeo:i,onViewJson:r,onDelete:l}=t,c=Ne();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(bi,{size:14}),e[2]=m):m=e[2];let g;e[3]!==d?(g=o.jsx(Ls,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Qu,children:m})}),e[3]=d,e[4]=g):g=e[4];let f;e[5]!==n||e[6]!==c?(f=n&&o.jsxs(Ze,{onClick:n,children:[o.jsx(rl,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=n,e[6]=c,e[7]=f):f=e[7];let u;e[8]!==s||e[9]!==c?(u=s&&o.jsxs(Ze,{onClick:s,children:[o.jsx(Jn,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=c,e[10]=u):u=e[10];let p;e[11]!==a||e[12]!==c?(p=a&&o.jsxs(o.Fragment,{children:[o.jsx(bn,{}),o.jsxs(Ze,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[o.jsx(Xo,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=p):p=e[13];let h;e[14]!==i||e[15]!==r||e[16]!==c?(h=(i||r)&&o.jsxs(o.Fragment,{children:[o.jsx(bn,{}),i&&o.jsxs(Ze,{onClick:i,children:[o.jsx(Wo,{size:14}),c("sandbox.itemActions.editSeo")]}),r&&o.jsxs(Ze,{onClick:r,children:[o.jsx(Qo,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=i,e[15]=r,e[16]=c,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(bn,{}),e[18]=S):S=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Xn,{size:14}),e[19]=C):C=e[19];let k;e[20]!==c?(k=c("sandbox.itemActions.delete"),e[20]=c,e[21]=k):k=e[21];let x;e[22]!==l||e[23]!==k?(x=o.jsxs(Ze,{onClick:l,className:"text-destructive focus:text-destructive",children:[C,k]}),e[22]=l,e[23]=k,e[24]=x):x=e[24];let b;e[25]!==x||e[26]!==f||e[27]!==u||e[28]!==p||e[29]!==h?(b=o.jsxs(Is,{align:"end",className:"w-44",children:[f,u,p,h,S,x]}),e[25]=x,e[26]=f,e[27]=u,e[28]=p,e[29]=h,e[30]=b):b=e[30];let j;return e[31]!==b||e[32]!==g?(j=o.jsxs(Ks,{children:[g,b]}),e[31]=b,e[32]=g,e[33]=j):j=e[33],j}function Qu(t){return t.stopPropagation()}const mi=4;function dn(t){const e=new Map;for(const s of t)s.slug&&!e.has(s.slug)&&e.set(s.slug,s);return e}function un(t,e){const s=t.parentSlug;if(!t.slug||!s||s===t.slug)return;const n=e.get(s);return n===t?void 0:n}function fi(t,e){const s=dn(e),n=[],a=new Set;let i=s.get(t);for(;i&&!a.has(i.slug??"")&&(a.add(i.slug??""),n.push(i),!(n.length>=mi));)i=un(i,s);return n.reverse()}function gi(t,e){const s=new Map;for(const n of t){const a=un(n,e);if(!a?.slug)continue;const i=s.get(a);i?i.push(n):s.set(a,[n])}for(const n of s.values())n.sort((a,i)=>a.label.localeCompare(i.label));return s}function Jm(t,e){const s=dn(e),n=gi(e,s),a=new Set([t]),i=s.get(t);let r=i?[i]:[];for(;r.length;){const l=[];for(const c of r)for(const d of n.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),l.push(d));r=l}return a.delete(t),a}function Xm(t,e){if(!t)return[];const s=dn(e),n=fi(t,e),a=n[0];return!a||un(a,s)?[t]:n.map(i=>i.slug??"")}function Zu(t){const e=dn(t),s=gi(t,e),n=new Set,a=[],i=(l,c)=>{if(!n.has(l)&&(n.add(l),a.push({entry:l,depth:c}),!(c+1>=mi)))for(const d of s.get(l)??[])i(d,c+1)},r=t.filter(l=>!un(l,e)).sort((l,c)=>l.label.localeCompare(c.label));for(const l of r)i(l,0);for(const l of t)i(l,0);return a}function ep(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function tp(t){const e=new Map;for(const s of t){const n=ep(s.resolveType),a=e.get(n);a?a.push(s):e.set(n,[s])}return[...e.entries()].map(([s,n])=>({label:s,sections:n})).sort((s,n)=>s.label.localeCompare(n.label))}function Fo(t){const e=le.c(8),{icon:s,label:n,className:a}=t;let i;e[0]!==a?(i=ve("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=i):i=e[1];let r;e[2]!==s?(r=o.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=r):r=e[3];let l;return e[4]!==n||e[5]!==i||e[6]!==r?(l=o.jsxs("div",{className:i,children:[r,n]}),e[4]=n,e[5]=i,e[6]=r,e[7]=l):l=e[7],l}const Mo=L.lazy(()=>He(()=>import("./app-editor-D1Yz0-KZ.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])).then(t=>({default:t.AppEditor}))),sp=L.lazy(()=>He(()=>import("./cms-settings-editor-bH28Cwco.js"),__vite__mapDeps([168,1,2,27,26,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,63,64,65,20,66,4,5,6,7,8,9,67,68,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,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,0,22,24,56,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167])).then(t=>({default:t.CmsSettingsEditor}))),np=L.lazy(()=>He(()=>import("./post-editor-uOMVUWIp.js"),__vite__mapDeps([169,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,27,26,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,157,62,170,126,98,76,77,100,93,148,118,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,94,95,96,97,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,119,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,22,149,150,151,152,153,154,155,156,158,159,160,161,162,171,163,172,173,174,164,175,176,165,166,167])).then(t=>({default:t.PostEditor}))),op=L.lazy(()=>He(()=>import("./record-editor-DNnWgGZk.js"),__vite__mapDeps([177,1,2,62,92,23,68,36,118,56,57,58,59,60,61,63,64,65,38,33,20,66,4,5,6,7,8,9,67,26,27,28,29,30,31,32,34,35,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,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,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,174,176,164,165,166,167])).then(t=>({default:t.RecordEditor}))),ap=L.lazy(()=>He(()=>import("./context-C-E2WXON.js"),__vite__mapDeps([178,1,2,11,8,9,12,13,14,15,16,17,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,126,62,148,118,100,19,56,57,58,59,60,61,63,64,65,20,66,4,5,6,7,67,68,69,70,18,3,10,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,93,94,95,96,97,98,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,119,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,176,179,173,180,164,172,165,166,167])).then(t=>({default:t.BlogContext}))),ip=L.lazy(()=>He(()=>import("./category-editor-BbN07orU.js"),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,27,31,33,25,157,62,92,23,68,36,174,26,28,29,30,32,34,35,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,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,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,22,149,150,151,152,153,154,155,156,158,159,160,161,162,171,163,172,173,175,176,164,165,166,167])).then(t=>({default:t.CategoryEditor}))),rp=L.lazy(()=>He(()=>import("./sections-editor-DNUBhdzI.js"),__vite__mapDeps([182,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,56,57,58,59,60,61,62,63,64,65,38,33,66,67,68,26,27,28,29,30,31,32,34,35,36,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,24,163,183,184])).then(t=>({default:t.SectionsEditor}))),lp=L.lazy(()=>He(()=>import("./seo-editor-DJq3zWnQ.js"),__vite__mapDeps([185,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,22,23,56,57,58,59,60,61,62,63,64,65,20,66,4,5,6,7,8,9,67,68,69,70,18,11,12,13,14,15,16,17,3,10,19,21,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,183])).then(t=>({default:t.SeoEditor}))),cp=L.lazy(()=>He(()=>import("./variant-calendar-D-cEXz9T.js"),__vite__mapDeps([186,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,62,22,23,148,67,68,155,21,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,157,57,58,59,60,61,63,64,65,66,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,56,145,146,147,149,150,151,152,153,154,156,158,159,160,161,162,164,165,166,167])).then(t=>({default:t.VariantCalendar}))),dp=L.lazy(()=>He(()=>import("./post-calendar-CzWgDY6o.js"),__vite__mapDeps([187,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,22,23,21,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,157,67,68,57,58,59,60,61,62,63,64,65,66,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,56,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,164,165,166,167])).then(t=>({default:t.PostCalendar}))),up=L.lazy(()=>He(()=>import("./redirect-editor-js4vnIyF.js"),__vite__mapDeps([188,1,2,98,62,92,23,68,36,56,57,58,59,60,61,63,64,65,38,33,20,66,4,5,6,7,8,9,67,26,27,28,29,30,31,32,34,35,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,95,96,97,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,176])).then(t=>({default:t.RedirectEditor})));function pp(t,e){return t==="context"&&!e?"posts":t}function mp(t){const e=le.c(30),{deepLinkPage:s}=t,{currentBranch:n,virtualMcpId:a}=zn(),{org:i}=yi(),r=Wr(),l=Jr(),{runtime:c,previewServerUrl:d}=nn(a),m=c==="cms",g=Yn(a,n);let f,u;e[0]!==g||e[1]!==m||e[2]!==l.previewState||e[3]!==r.lifecycle.phase?(f=la(g),u=Zl({fastPreviewActive:m||f,previewState:l.previewState,lifecyclePhase:r.lifecycle.phase}),e[0]=g,e[1]=m,e[2]=l.previewState,e[3]=r.lifecycle.phase,e[4]=f,e[5]=u):(f=e[4],u=e[5]);const p=u;if(p.kind==="sandbox-card"){const k=`/${i.slug}/settings/connections`;let x;return e[6]!==p.state||e[7]!==l.start||e[8]!==k||e[9]!==r.lifecycle||e[10]!==r.phase?(x=o.jsx(Xl,{state:p.state,claimPhase:r.phase,lifecycle:r.lifecycle,onStart:l.start,connectionsHref:k}),e[6]=p.state,e[7]=l.start,e[8]=k,e[9]=r.lifecycle,e[10]=r.phase,e[11]=x):x=e[11],x}if(!a||!n){let k;return e[12]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(dt,{title:"Waiting for sandbox context…"}),e[12]=k):k=e[12],k}if(xr(g)){let k;return e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(vr,{}),e[13]=k):k=e[13],k}if(g.kind==="pending"){let k;return e[14]!==g?(k=o.jsx(kr,{backend:g}),e[14]=g,e[15]=k):k=e[15],k}const h=f?null:l.previewUrl;let S;e[16]!==g||e[17]!==m||e[18]!==l.previewUrl||e[19]!==d?(S=g.kind==="protocol"&&g.source==="local"?Gi(g):m?d:l.previewUrl,e[16]=g,e[17]=m,e[18]=l.previewUrl,e[19]=d,e[20]=S):S=e[20];let C;return e[21]!==n||e[22]!==s||e[23]!==p.devServerReady||e[24]!==p.sandboxWarming||e[25]!==i.slug||e[26]!==h||e[27]!==S||e[28]!==a?(C=o.jsx(gp,{orgSlug:i.slug,virtualMcpId:a,branch:n,previewUrl:h,sitePreviewUrl:S,deepLinkPage:s,devServerReady:p.devServerReady,sandboxWarming:p.sandboxWarming}),e[21]=n,e[22]=s,e[23]=p.devServerReady,e[24]=p.sandboxWarming,e[25]=i.slug,e[26]=h,e[27]=S,e[28]=a,e[29]=C):C=e[29],C}const zo=2e3,fp=15;function Vo(t,e,s,n){return typeof e!="string"||s&&(Sa(e,s,n)||t.state.dataUpdateCount>=fp)?!1:zo}function gp({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,sitePreviewUrl:a,deepLinkPage:i,devServerReady:r,sandboxWarming:l}){const c=Ne(),d=ms()?.taskId??null,m={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:n},g=!la(Yn(e,s)),f=br()===void 0,{data:u,isLoading:p}=Hi(m,{fetchEnabled:r}),h=Ho({strict:!1}),[S,C]=L.useState(()=>h.contentCollection&&pt(h.contentCollection)&&h.contentCollection||"pages"),k=ka(),x=pp(S,k),[b,j]=L.useState(()=>h.contentItem&&pt(x)?{collection:x,key:h.contentItem}:null),[P,N]=L.useState(null),{data:v,isLoading:E,isFetching:O}=yr(m,{fetchEnabled:r,refetchInterval:y=>{const z=y.state.data;if(x==="apps"&&b&&b.collection==="apps"){const se=u?.[b.key];return Vo(y,typeof se?.__resolveType=="string"?se.__resolveType:void 0,z)}if(x==="site"&&u){const se=z?mo(u,z):null,re=u.site,Se=se?.resolveType??(typeof re?.__resolveType=="string"?re.__resolveType:void 0);return Vo(y,Se,z,["seo"])}return!1}}),T=!!(i?.pageId||i?.path||i?.pathTemplate),[D,A]=L.useState(!1);if(T&&!D&&b===null&&u&&!E){A(!0);const y=Or(po(u,v),i??{});y&&(C("pages"),j({collection:"pages",key:y.key,path:y.path}))}const[B,w]=L.useState(""),[$,V]=L.useState("list"),F=y=>{j(y),N(null)},[q,H]=L.useState(x);q!==x&&(H(x),w(""));const I=(y,z)=>!Sa(y,v,z)&&(E||O),{createTask:G}=zn(),W=nn(e),M=Hl(e,v??void 0),Q=Hn(e).url,ce=Mn("site_apps_install_enabled")&&M!==null&&!Q,fe=v&&u?Ml(M?_a(M):[],v,u):[],ue=Vl({orgSlug:t,virtualMcpId:e,branch:s}),J=sn(m),me=Vr(m),de=Fd({orgSlug:t,virtualMcpId:e,branch:s,decofile:u??{},onMoved:(y,z)=>j(se=>se?.collection==="posts"&&se.key===y?{collection:"posts",key:z}:se)}),[ie,ee]=L.useState(null),[ge,ne]=L.useState(),[pe,oe]=L.useState(!1),[X,te]=L.useState(),[_,Y]=L.useState(null),[Z,he]=L.useState(null),[Te,_e]=L.useState(null),Oe=!u||!v;if(p||E||f||Oe&&l)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(ft,{className:"size-5 text-muted-foreground"})});if(Oe)return o.jsx(dt,{title:"Could not load site data."});if(Yi(v))return o.jsx(Sr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u});const we=po(u,v).sort((y,z)=>y.name.localeCompare(z.name)),Ee=$r(u).sort((y,z)=>y.from.localeCompare(z.from)),Ae=Rr(u,v),be=x==="sections"?Lr(v):[],Ce=mo(u,v),De=Oa(u),U=eo.some(y=>De[y].length>0),ye=pt(x)?De[x]:[],je=uo(v,"loaders"),$e=uo(v,"actions"),yt=g?["settings"]:["apps",...Ce?[]:["site"],...$e===0?["actions"]:[],...pl(v)?[]:["settings"]];if(!Ir(u,v)&&!U&&je===0&&$e===0)return o.jsx(dt,{icon:rs,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const pn={pages:we.length,sections:Ae.length,apps:g?fe.length:0,loaders:je,actions:$e,redirects:Ee.length,posts:De.posts.length,authors:De.authors.length,categories:De.categories.length},fs=new Set(we.map(y=>Os(y.path))),vt=new Set(we.map(y=>y.name)),mn=new Set(Ae.map(y=>y.name)),kt=async y=>{const z=u[y.key];if(!z)return;const se=ga(u,y.key),re=Kr(u,y.key,Math.max(0,se-1)),Se=Fr(z.sections,re);if(Se)try{await J.mutateAsync({blockKey:y.key,data:{...z,sections:Se}}),xe.success(`Variant added to "${y.name}"`),j({collection:"pages",key:y.key,path:y.path})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:"Could not add variant")}},fn=()=>{ne(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},St=y=>{ne(void 0),ee({mode:"duplicate",sourceKey:y.key,initialName:vo(vt,y.name),initialPath:ec(fs,y.path)})},jt=y=>{ne(void 0),ee({mode:"rename",sourceKey:y.key,initialName:y.name,initialPath:y.path})},gn=async y=>{if(!ie)return;const{mode:z,sourceKey:se}=ie;try{if(z==="create"){let re;if(y.templateKey){const Pe=u[y.templateKey];if(!Pe)throw new Error("Selected template no longer exists.");re={...Pe,name:y.name,path:y.path}}else re=nc(y.name,y.path);const Se=ac(u,y.name);await J.mutateAsync({blockKey:Se,data:re}),xe.success(`Created "${y.name}"`),j({collection:"pages",key:Se,path:y.path})}else if(z==="duplicate"&&se){const re=u[se];if(!re)throw new Error("Source page not found");const{key:Se,data:Pe}=sc({source:re,pages:we,newName:y.name,newPath:y.path});await J.mutateAsync({blockKey:Se,data:Pe}),xe.success(`Duplicated as "${y.name}"`),j({collection:"pages",key:Se,path:y.path})}else if(z==="rename"&&se){const re=u[se];if(!re)throw new Error("Page not found");const Se={...re,name:y.name,path:y.path};await J.mutateAsync({blockKey:se,data:Se}),xe.success("Page updated"),b?.collection==="pages"&&b.key===se&&j({collection:"pages",key:se,path:y.path})}ee(null)}catch(re){ne(re instanceof Error?re.message:"Save failed")}},Qt=({path:y})=>{if(!ie)return null;const z=Os(y);return(ie.mode==="rename"?Os(ie.initialPath):null)!==z&&fs.has(z)?`A page with path "${y}" already exists.`:null},st=async(y,z,se)=>{await J.mutateAsync({blockKey:z,data:{...se,name:z,__resolveType:y}}),xe.success(c("sandbox.contentBrowser.createdSection",{name:z})),j({collection:"sections",key:z})},wt=pa((y,z)=>J.mutate({blockKey:y,data:z})),nt=async y=>{const z=u[y.key];if(!z){xe.error(c("sandbox.contentBrowser.sectionNotFound"));return}const se=tc(u,y.key),re=vo(mn,y.name),Se={...z,name:re};try{await J.mutateAsync({blockKey:se,data:Se}),xe.success(c("sandbox.contentBrowser.duplicatedSection",{name:y.name})),j({collection:"sections",key:se})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:c("sandbox.contentBrowser.duplicateFailed"))}},ot=async y=>{if(!_)return;const z=u[_];if(!z){xe.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await J.mutateAsync({blockKey:_,data:{...z,name:y}}),xe.success(c("sandbox.contentBrowser.sectionRenamed")),Y(null)}catch(se){xe.error(se instanceof Error?se.message:c("sandbox.contentBrowser.renameFailed"))}},Zt=()=>{te(void 0),oe(!0)},at=async y=>{const z=Mr(u,y.from),se=zr(y);try{await J.mutateAsync({blockKey:z,data:se}),xe.success("Created redirect"),oe(!1),j({collection:"redirects",key:z})}catch(re){te(re instanceof Error?re.message:"Could not create redirect")}},Ct=async y=>{const z=_n(u,y),se=Ht(z,y,Va(y));try{await J.mutateAsync({blockKey:z,data:se}),xe.success(`Created ${as[y]}`),j({collection:y,key:z})}catch(re){xe.error(re instanceof Error?re.message:"Could not create")}},it=async y=>{const z=_n(u,"posts"),se=Ht(z,"posts",Od(y));try{await J.mutateAsync({blockKey:z,data:se}),xe.success(c("sandbox.postCalendar.createdScheduledPost")),C("posts"),H("posts"),j({collection:"posts",key:z}),N(null)}catch(re){xe.error(re instanceof Error?re.message:c("sandbox.postCalendar.couldNotCreate"))}},rt=async(y,z)=>{const se=u[y],re=se?Rd(gt(se,"posts"),z):null;if(!re){xe.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await J.mutateAsync({blockKey:y,data:Ht(y,"posts",re)})}catch(Se){xe.error(Se instanceof Error?Se.message:c("sandbox.postCalendar.couldNotReschedule"))}},Nt=async y=>{const z=u[y.key];if(!z){xe.error("Record not found.");return}const se=_n(u,y.kind),re=y.kind==="posts"?"title":"name",Se={...structuredClone(gt(z,y.kind)),[re]:`${y.label} (copy)`};if(y.kind==="categories"){const Pe=De.categories.map(Ve=>Ve.slug??"").filter(Boolean);Se.slug=Ed(String(Se.slug??""),Pe)}try{await J.mutateAsync({blockKey:se,data:Ht(se,y.kind,Se)}),xe.success(`Duplicated "${y.label}"`),j({collection:y.kind,key:se})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:"Duplicate failed")}},_t=()=>{C("posts"),H("posts"),j(null),N(null),w("")},lt=async()=>{if(Z)try{const{kind:y,key:z,label:se}=Z;if(y==="blog"){if(Z.blogKind==="categories"){const re=gt(u[z],"categories").slug,Se=typeof re=="string"?re:"";if(Se)for(const{key:Pe,payload:Ve}of za(u)){const Qe=Uc(Ve,Se);Qe!==Ve&&await J.mutateAsync({blockKey:Pe,data:Fc(Pe,Gc(Qe))})}}await me.mutateAsync({blockKey:z})}else await me.mutateAsync({blockKey:z});xe.success(`Deleted "${se}"`),b&&b.collection!=="available-section"&&b.key===z&&j(null),he(null)}catch(y){xe.error(y instanceof Error?y.message:"Delete failed")}},Xe=me.isPending||J.isPending,ct=Z?.kind==="blog"?as[Z.blogKind]:Z?.kind??"item";return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx(Wl,{active:x,counts:pn,hidden:yt,showBlog:U,showContext:k,onSelect:y=>{C(y),j(null),N(null)}}),x!=="seo"&&x!=="site"&&x!=="settings"&&x!=="context"&&x!=="calendar"&&x!=="post-schedule"&&x!=="posts"&&x!=="loaders"&&x!=="actions"&&o.jsx(hp,{activeCollection:x,pages:we,redirects:Ee,sections:Ae,availableSections:be,appCatalog:fe,canInstallApps:ce,installingAppId:ue.isPending?ue.variables?.blockKey??null:null,onInstallApp:y=>{if(W.resolved){if(W.runtime==="cms"){xe.error(c("sandbox.appEditor.installNeedsCodingSession"),{action:{label:c("chat.fastPreview.startCodingSession"),onClick:()=>G({runtime:"sandbox"})}});return}ue.mutate({blockKey:y.id},{onSuccess:z=>F({collection:"apps",key:z.key}),onError:z=>xe.error(z.message)})}},blogEntries:ye,decofile:u,searchQuery:B,onSearchChange:w,selection:b,onSelect:F,onCreate:()=>{x==="pages"?fn():x==="redirects"?Zt():pt(x)&&Ct(x)},onDuplicatePage:St,onRenamePage:jt,onAddPageVariant:kt,onDeletePage:y=>he({kind:"page",key:y.key,label:y.name}),onEditPageSeo:y=>{const z={collection:"pages",key:y.key,path:y.path};j(z),N(y.key)},onViewPageJson:y=>_e(y.key),onDuplicateSection:nt,onRenameSection:y=>Y(y.key),onDeleteSection:y=>he({kind:"section",key:y.key,label:y.name}),onDeleteRedirect:y=>he({kind:"redirect",key:y.key,label:y.from||y.key}),onDuplicateBlog:Nt,onDeleteBlog:y=>he({kind:"blog",blogKind:y.kind,key:y.key,label:y.label})}),o.jsx("div",{className:"flex-1 min-w-0",children:x==="loaders"||x==="actions"?o.jsx(Lu,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,kind:x}):o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(ft,{className:"size-5 text-muted-foreground"})}),children:x==="calendar"?o.jsx(cp,{decofile:u}):x==="post-schedule"?o.jsx(dp,{decofile:u,isCreating:J.isPending,onCreate:y=>{it(y)},onReschedule:(y,z)=>{rt(y,z)},onSelect:y=>{C("posts"),H("posts"),j({collection:"posts",key:y}),N(null)}}):x==="site"?Ce?o.jsx(Mo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:Ce.key,block:u[Ce.key],decofile:u,meta:v,title:"Site",excludeFields:["seo"],schemaPending:I(Ce.resolveType,["seo"]),previewBaseUrl:n},`site:${Ce.key}`):o.jsx(dt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):x==="settings"?o.jsx(sp,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):x==="context"?o.jsx(ap,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):x==="seo"?o.jsx(lp,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v,target:{kind:"site"},previewBaseUrl:a}):x==="sections"?o.jsx(Xu,{selection:b?.collection==="sections"||b?.collection==="available-section"?b:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,isCreating:J.isPending,onCreateAvailable:st,onSaveReferencedBlock:wt}):x==="posts"?o.jsx(ju,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,view:$,selectedKey:b?.collection==="posts"?b.key:null,onViewChange:y=>{V(y),j(null)},onClose:()=>j(null),onOpen:y=>{j({collection:"posts",key:y}),N(null)},move:de,meta:v,renderDetail:(y,z)=>o.jsx(np,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:y,block:u[y],decofile:u,meta:v,previewBaseUrl:a,move:de,onClose:z?.onClose,expanded:z?.expanded,onToggleExpand:z?.onToggleExpand},`post:${is(y)}`)}):b&&b.collection!=="available-section"?b.collection==="apps"?o.jsx(Mo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key],decofile:u,meta:v,previewBaseUrl:n,schemaPending:I(typeof u[b.key]?.__resolveType=="string"?String(u[b.key].__resolveType):void 0)},`app:${b.key}`):b.collection==="categories"?o.jsx(ip,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key],decofile:u,meta:v,onManagePosts:()=>_t(),onOpenPost:y=>{C("posts"),H("posts"),j({collection:"posts",key:y}),N(null)},previewBaseUrl:a},`category:${b.key}`):b.collection==="authors"?o.jsx(op,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:b.key,block:u[b.key],meta:v,decofile:u},`authors:${b.key}`):b.collection==="redirects"?o.jsx(up,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key]},`redirect:${b.key}`):o.jsx(rp,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:n??void 0,currentPath:b.collection==="pages"?b.path:"/",activePageBlockKey:b.collection==="pages"?b.key:null,activeGlobalBlockKey:b.collection==="sections"?b.key:null,initialEditSeo:b.collection==="pages"&&P===b.key,onExitSeo:()=>N(null),onSelectRoot:()=>{j(null),N(null)}},b.collection==="pages"?`page:${b.key}`:`section:${b.key}`):o.jsx(dt,{title:`Select ${pt(x)?`a ${as[x]}`:x==="pages"?"a page":x==="apps"?"an app":x==="redirects"?"a redirect":"a section"} to edit`,description:x==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),ie&&o.jsx(cc,{open:!!ie,mode:ie.mode,initialName:ie.initialName,initialPath:ie.initialPath,isPending:J.isPending,error:ge,templates:we,validate:Qt,onSubmit:gn,onOpenChange:y=>{y||(ee(null),ne(void 0))}}),o.jsx(uc,{open:pe,isPending:J.isPending,error:X,onSubmit:at,onOpenChange:y=>{y||(oe(!1),te(void 0))}}),_&&o.jsx(pc,{open:!!_,blockKey:_,initialName:Ae.find(y=>y.key===_)?.name??_,isPending:J.isPending,onSubmit:ot,onOpenChange:y=>{y||Y(null)}}),Te&&o.jsx(Ur,{open:!!Te,onOpenChange:y=>{y||_e(null)},pageKey:Te,decofile:u,onSave:y=>J.mutateAsync({blockKey:Te,data:y})}),o.jsx(Di,{open:!!Z,onOpenChange:y=>{!y&&!Xe&&he(null)},children:o.jsxs(Bi,{children:[o.jsxs(Oi,{children:[o.jsx($i,{children:c("sandbox.contentBrowser.deleteDialog.title",{noun:ct})}),o.jsx(Ri,{children:Z?.kind==="section"?c("sandbox.contentBrowser.deleteDialog.descriptionSection",{label:Z.label}):Z?c("sandbox.contentBrowser.deleteDialog.descriptionPermanent",{label:Z.label}):null})]}),o.jsxs(Li,{children:[o.jsx(Ii,{disabled:Xe,children:c("sandbox.contentBrowser.deleteDialog.cancel")}),o.jsx(Ki,{onClick:y=>{y.preventDefault(),lt()},disabled:Xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Xe?o.jsxs(o.Fragment,{children:[o.jsx(ft,{className:"size-3.5"}),c("sandbox.contentBrowser.deleteDialog.deleting")]}):c("sandbox.contentBrowser.deleteDialog.delete")})]})]})})]})}function hp(t){const e=le.c(60),{activeCollection:s,pages:n,redirects:a,sections:i,availableSections:r,appCatalog:l,canInstallApps:c,installingAppId:d,onInstallApp:m,blogEntries:g,decofile:f,searchQuery:u,onSearchChange:p,selection:h,onSelect:S,onCreate:C,onDuplicatePage:k,onRenamePage:x,onAddPageVariant:b,onDeletePage:j,onEditPageSeo:P,onViewPageJson:N,onDuplicateSection:v,onRenameSection:E,onDeleteSection:O,onDeleteRedirect:T,onDuplicateBlog:D,onDeleteBlog:A}=t,B=Ne();let w,$,V,F,q,H;if(e[0]!==s||e[1]!==l||e[2]!==r||e[3]!==g||e[4]!==c||e[5]!==f||e[6]!==d||e[7]!==b||e[8]!==C||e[9]!==A||e[10]!==j||e[11]!==T||e[12]!==O||e[13]!==D||e[14]!==k||e[15]!==v||e[16]!==P||e[17]!==m||e[18]!==x||e[19]!==E||e[20]!==p||e[21]!==S||e[22]!==N||e[23]!==n||e[24]!==a||e[25]!==u||e[26]!==i||e[27]!==h||e[28]!==B){const M=u.toLowerCase(),Q=n.filter(_=>!M||_.name.toLowerCase().includes(M)||_.path.toLowerCase().includes(M)),ce=a.filter(_=>!M||_.from.toLowerCase().includes(M)||_.to.toLowerCase().includes(M)),fe=i.filter(_=>!M||_.name.toLowerCase().includes(M)||_.key.toLowerCase().includes(M)||_.resolveType.toLowerCase().includes(M)),ue=r.filter(_=>!M||_.title.toLowerCase().includes(M)||_.resolveType.toLowerCase().includes(M)||(_.description?.toLowerCase().includes(M)??!1)),J=tp(fe),me=l.filter(_=>!M||_.title.toLowerCase().includes(M)||_.app.toLowerCase().includes(M)||_.vendor.toLowerCase().includes(M)||_.category.toLowerCase().includes(M)),de=g.filter(_=>!M||_.label.toLowerCase().includes(M)||_.subtitle.toLowerCase().includes(M)),ie=s==="categories"&&!M?Zu(de):de.map(bp),ee=`Search ${s}…`,ge=pt(s)?`Create new ${as[s]}`:s==="redirects"?"Create new redirect":"Create new page",ne=s!=="apps"&&s!=="sections";q="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let pe;e[35]===Symbol.for("react.memo_cache_sentinel")?(pe=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[35]=pe):pe=e[35];let oe;e[36]!==p?(oe=_=>p(_.target.value),e[36]=p,e[37]=oe):oe=e[37];let X;e[38]!==ee||e[39]!==u||e[40]!==oe?(X=o.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[pe,o.jsx("input",{type:"text",value:u,onChange:oe,placeholder:ee,"aria-label":ee,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[38]=ee,e[39]=u,e[40]=oe,e[41]=X):X=e[41];let te;e[42]!==ge||e[43]!==C||e[44]!==ne?(te=ne&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Re,{variant:"ghost",size:"icon",onClick:C,"aria-label":ge,children:o.jsx(Gn,{size:14})})}),o.jsx(We,{side:"bottom",children:ge})]}),e[42]=ge,e[43]=C,e[44]=ne,e[45]=te):te=e[45],e[46]!==X||e[47]!==te?(H=o.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[X,te]}),e[46]=X,e[47]=te,e[48]=H):H=e[48],w=tn,F="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",$="flex flex-col gap-1 p-1.5",V=s==="pages"?Q.length===0?o.jsx(ts,{hasItems:n.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):Q.map(_=>{const Y=h?.collection==="pages"&&h.key===_.key,Z=ga(f,_.key);return o.jsx(Ye,{icon:Zo,title:_.name,subtitle:_.path,active:Y,variantCount:Z,onClick:()=>S({collection:"pages",key:_.key,path:_.path}),menu:o.jsx(Bs,{onDuplicate:()=>k(_),onRename:()=>x(_),onAddVariant:()=>b(_),onEditSeo:()=>P(_),onViewJson:()=>N(_),onDelete:()=>j(_)})},_.key)}):s==="sections"?fe.length===0&&ue.length===0?o.jsx(ts,{hasItems:i.length>0||r.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):o.jsxs(o.Fragment,{children:[J.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fo,{icon:Ms,label:"Saved sections"}),J.map(_=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:_.label}),_.sections.map(Y=>{const Z=h?.collection==="sections"&&h.key===Y.key;return o.jsx(Ye,{icon:Ms,accent:"global",title:Y.name,subtitle:_.label,active:Z,onClick:()=>S({collection:"sections",key:Y.key}),menu:o.jsx(Bs,{onDuplicate:()=>v(Y),onRename:()=>E(Y),onDelete:()=>O(Y)})},Y.key)})]},_.label))]}),ue.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fo,{icon:co,label:"Available sections",className:ve(J.length>0&&"mt-3")}),ue.map(_=>{const Y=h?.collection==="available-section"&&h.resolveType===_.resolveType,Z=_.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return o.jsx(Ye,{icon:co,title:_.title,subtitle:Z??_.resolveType,active:Y,onClick:()=>S({collection:"available-section",resolveType:_.resolveType,title:_.title})},_.resolveType)})]})]}):s==="apps"?me.length===0?o.jsx(ts,{hasItems:l.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):me.map(_=>{const Y=h?.collection==="apps"&&_.blockKey!==null&&h.key===_.blockKey,Z=d===_.id;return o.jsx(Ye,{icon:sa,logoUrl:_.logo,title:_.title,subtitle:_.category,active:Y,trailing:_.installed?o.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):Z?o.jsx(ft,{className:"size-3.5 shrink-0 text-muted-foreground"}):_.installable&&c?o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Install"}):void 0,onClick:()=>{if(_.installed&&_.blockKey){S({collection:"apps",key:_.blockKey});return}if(!_.installable||!c){xe.message(`${_.title} is not installed on this site.`);return}d===null&&m(_)}},_.id)}):s==="redirects"?ce.length===0?o.jsx(ts,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):ce.map(_=>o.jsx(Ye,{icon:Yo,title:_.from||"(no source)",subtitle:`→ ${_.to||"(no target)"}`,active:h?.collection==="redirects"&&h.key===_.key,trailing:o.jsx(mc,{redirect:_}),onClick:()=>S({collection:"redirects",key:_.key}),menu:o.jsx(Bs,{onDelete:()=>T(_)})},_.key)):de.length===0?o.jsx(ts,{hasItems:g.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${pt(s)?as[s]:"item"}.`}):ie.map(_=>{const{entry:Y,depth:Z}=_,he=h?.collection===Y.kind&&h.key===Y.key;return o.jsx("div",{style:{paddingLeft:Z*16},children:o.jsx(Ye,{icon:Y.kind==="posts"?ea:Y.kind==="authors"?na:qo,title:Y.label,invalid:Y.missing.length>0,invalidReason:Y.missing.length>0?B("sandbox.itemRow.missingFields",{fields:$c(Y.missing,B)}):void 0,warning:Y.duplicateName,warningReason:B("sandbox.itemRow.duplicateName"),subtitle:Z>0?fi(Y.slug??"",de).map(xp).join(" / "):Y.subtitle,active:he,onClick:()=>S({collection:Y.kind,key:Y.key}),menu:o.jsx(Bs,{onDuplicate:()=>D(Y),onDelete:()=>A(Y)})})},Y.key)}),e[0]=s,e[1]=l,e[2]=r,e[3]=g,e[4]=c,e[5]=f,e[6]=d,e[7]=b,e[8]=C,e[9]=A,e[10]=j,e[11]=T,e[12]=O,e[13]=D,e[14]=k,e[15]=v,e[16]=P,e[17]=m,e[18]=x,e[19]=E,e[20]=p,e[21]=S,e[22]=N,e[23]=n,e[24]=a,e[25]=u,e[26]=i,e[27]=h,e[28]=B,e[29]=w,e[30]=$,e[31]=V,e[32]=F,e[33]=q,e[34]=H}else w=e[29],$=e[30],V=e[31],F=e[32],q=e[33],H=e[34];let I;e[49]!==$||e[50]!==V?(I=o.jsx("div",{className:$,children:V}),e[49]=$,e[50]=V,e[51]=I):I=e[51];let G;e[52]!==w||e[53]!==F||e[54]!==I?(G=o.jsx(w,{className:F,children:I}),e[52]=w,e[53]=F,e[54]=I,e[55]=G):G=e[55];let W;return e[56]!==q||e[57]!==H||e[58]!==G?(W=o.jsxs("div",{className:q,children:[H,G]}),e[56]=q,e[57]=H,e[58]=G,e[59]=W):W=e[59],W}function xp(t){return t.slug}function bp(t){return{entry:t,depth:0}}function Qm(t){const e=le.c(25),{virtualMcpId:s}=t,n=Ne(),[a,i]=L.useState(!1),r=xa(s),{connection:l}=qi(s),{activeTask:c}=zn();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[0]=d):d=e[0];const m=Ho(d);if(!(go(r?.metadata)||go(c?.metadata))&&!l){let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:o.jsx(ho,{className:"size-7 text-foreground"})}),e[1]=u):u=e[1];let p;e[2]!==n?(p=n("mainPanelTabs.contentTab.noContentToEdit"),e[2]=n,e[3]=p):p=e[3];let h;e[4]!==n?(h=n("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=n,e[5]=h):h=e[5];let S,C;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=()=>i(!0),C=o.jsx(ho,{className:"size-4"}),e[6]=S,e[7]=C):(S=e[6],C=e[7]);let k;e[8]!==n?(k=n("mainPanelTabs.previewTab.connectGithub"),e[8]=n,e[9]=k):k=e[9];let x;e[10]!==k?(x=o.jsxs(Re,{onClick:S,children:[C,k]}),e[10]=k,e[11]=x):x=e[11];let b;e[12]!==p||e[13]!==h||e[14]!==x?(b=o.jsx(ll,{className:"h-full",image:u,title:p,description:h,actions:x}),e[12]=p,e[13]=h,e[14]=x,e[15]=b):b=e[15];let j;e[16]!==a?(j=o.jsx(cl,{open:a,onOpenChange:i,mode:"agent"}),e[16]=a,e[17]=j):j=e[17];let P;return e[18]!==j||e[19]!==b?(P=o.jsxs(o.Fragment,{children:[b,j]}),e[18]=j,e[19]=b,e[20]=P):P=e[20],P}let f;return e[21]!==m.contentPageId||e[22]!==m.contentPath||e[23]!==m.contentPathTemplate?(f=o.jsx(jr,{children:o.jsx(mp,{deepLinkPage:{pageId:m.contentPageId,path:m.contentPath,pathTemplate:m.contentPathTemplate}})}),e[21]=m.contentPageId,e[22]=m.contentPath,e[23]=m.contentPathTemplate,e[24]=f):f=e[24],f}export{hc as $,Gm as A,qm as B,Qm as C,gm as D,dt as E,Ym as F,Cc as G,Wc as H,Md as I,Xc as J,Wm as K,ii as L,Ga as M,Ba as N,Ht as O,to as P,Tm as Q,Hm as R,ld as S,td as T,Am as U,_m as V,rn as W,ad as X,rd as Y,fc as Z,gc as _,fm as a,Eo as a0,xc as a1,Fe as a2,bc as a3,Cm as a4,wm as a5,Nm as a6,Pm as a7,vm as a8,Qc as a9,bm as aA,ym as aB,Im as aC,Km as aD,Mm as aE,xt as aF,zm as aG,Fm as aH,Lm as aI,Vm as aJ,Xs as aK,Zc as aa,cd as ab,ud as ac,so as ad,jm as ae,Ha as af,Ya as ag,Me as ah,Dm as ai,km as aj,qs as ak,Sm as al,Em as am,cs as an,$n as ao,Ws as ap,Bm as aq,Om as ar,Id as as,Mc as at,Jm as au,Zu as av,mi as aw,Vc as ax,Ed as ay,za as az,xo as b,cn as c,Fc as d,Ue as e,xm as f,gt as g,$m as h,$c as i,Um as j,hm as k,La as l,ln as m,tc as n,Ge as o,Xt as p,ti as q,ul as r,Gc as s,ni as t,ka as u,Rm as v,Zs as w,Oa as x,Xm as y,qa as z};
|
|
22
|
+
`),style:n.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:n.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:n.url,alt:n.alt,caption:n.caption,size:"normal"});break}}return s}function du({title:t,blocks:e,takenSlugs:s,now:n}){const a=t.trim();return{title:a,slug:a?ni(a,s):ti(""),date:n.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const Bo="__all__",Oo={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},uu={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},$o="status:";function Ro(t){if(!t.startsWith($o))return null;const e=t.slice($o.length);return to.includes(e)?e:null}const Lo=L.forwardRef(function(e,s){const n=le.c(20);let a,i,r,l,c;n[0]!==e?({icon:a,active:i,value:c,className:r,...l}=e,n[0]=e,n[1]=a,n[2]=i,n[3]=r,n[4]=l,n[5]=c):(a=n[1],i=n[2],r=n[3],l=n[4],c=n[5]);const d=i?"text-foreground":"text-muted-foreground";let m;n[6]!==r||n[7]!==d?(m=ve("h-7 gap-1 px-1.5 text-xs",d,r),n[6]=r,n[7]=d,n[8]=m):m=n[8];let g;n[9]!==a?(g=o.jsx(a,{size:14,className:"shrink-0"}),n[9]=a,n[10]=g):g=n[10];let f;n[11]!==c?(f=c&&o.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),n[11]=c,n[12]=f):f=n[12];let u;n[13]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(ls,{size:12,className:"shrink-0 opacity-60"}),n[13]=u):u=n[13];let p;return n[14]!==l||n[15]!==s||n[16]!==m||n[17]!==g||n[18]!==f?(p=o.jsxs(Re,{ref:s,type:"button",variant:"ghost",size:"sm",className:m,...l,children:[g,f,u]}),n[14]=l,n[15]=s,n[16]=m,n[17]=g,n[18]=f,n[19]=p):p=n[19],p});function ao(t){const e=le.c(2),{count:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function pu(t){const e=le.c(19),{value:s,onChange:n}=t,a=Ne();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=i):i=e[0];let r;e[1]!==n?(r=f=>n(f.target.value),e[1]=n,e[2]=r):r=e[2];let l;e[3]!==a?(l=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=l):l=e[4];let c;e[5]!==a?(c=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=c):c=e[6];let d;e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==s?(d=o.jsx("input",{type:"text",value:s,onChange:r,placeholder:l,"aria-label":c,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=r,e[8]=l,e[9]=c,e[10]=s,e[11]=d):d=e[11];let m;e[12]!==n||e[13]!==a||e[14]!==s?(m=s&&o.jsx(di,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=a,e[14]=s,e[15]=m):m=e[15];let g;return e[16]!==d||e[17]!==m?(g=o.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[i,d,m]}),e[16]=d,e[17]=m,e[18]=g):g=e[18],g}function mu(t){const e=le.c(100),{categories:s,authors:n,statusCounts:a,categoryFilter:i,authorFilter:r,statusFilter:l,sort:c,onCategoryFilterChange:d,onAuthorFilterChange:m,onStatusFilterChange:g,onSortChange:f}=t,u=Ne();let p;if(e[0]!==s||e[1]!==i){let X;e[3]!==i?(X=te=>te.slug===i,e[3]=i,e[4]=X):X=e[4],p=s.find(X),e[0]=s,e[1]=i,e[2]=p}else p=e[2];const h=p;let S;if(e[5]!==r||e[6]!==n){let X;e[8]!==r?(X=te=>te.email===r,e[8]=r,e[9]=X):X=e[9],S=n.find(X),e[5]=r,e[6]=n,e[7]=S}else S=e[7];const C=S,k=!!(i||r||l);let x;e[10]!==C?.name||e[11]!==h?.name||e[12]!==l||e[13]!==u?(x=h?.name??C?.name??u(l?Zs[l]:"sandbox.postToolbar.filterLabel"),e[10]=C?.name,e[11]=h?.name,e[12]=l,e[13]=u,e[14]=x):x=e[14];const b=x,j=i?`cat:${i}`:r?`author:${r}`:l?`status:${l}`:Bo;let P;e[15]!==m||e[16]!==d||e[17]!==g?(P=()=>{d(null),m(null),g(null)},e[15]=m,e[16]=d,e[17]=g,e[18]=P):P=e[18];const N=P;let v;e[19]!==N||e[20]!==m||e[21]!==d||e[22]!==g?(v=X=>{X.startsWith("cat:")?(m(null),g(null),d(X.slice(4))):X.startsWith("author:")?(d(null),g(null),m(X.slice(7))):Ro(X)?(d(null),m(null),g(Ro(X))):N()},e[19]=N,e[20]=m,e[21]=d,e[22]=g,e[23]=v):v=e[23];const E=v;let O;e[24]!==b||e[25]!==k?(O=o.jsx(Ls,{asChild:!0,children:o.jsx(Lo,{icon:ji,active:k,value:b,className:"min-w-0 shrink"})}),e[24]=b,e[25]=k,e[26]=O):O=e[26];let T;e[27]!==u?(T=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=T):T=e[28];let D;e[29]!==T?(D=o.jsx(es,{children:T}),e[29]=T,e[30]=D):D=e[30];let A;e[31]!==u?(A=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=A):A=e[32];let B;e[33]!==A?(B=o.jsx(os,{value:Bo,children:A}),e[33]=A,e[34]=B):B=e[34];let w;e[35]!==u?(w=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=w):w=e[36];let $;e[37]!==w?($=o.jsx(es,{className:"text-muted-foreground/70",children:w}),e[37]=w,e[38]=$):$=e[38];let V;e[39]!==a||e[40]!==u?(V=to.map(X=>o.jsxs(os,{value:`status:${X}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(Zs[X])}),o.jsx(ao,{count:a[X]??0})]},`status:${X}`)),e[39]=a,e[40]=u,e[41]=V):V=e[41];let F;e[42]!==s.length||e[43]!==u?(F=s.length>0&&o.jsx(es,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=F):F=e[44];let q;e[45]!==s?(q=s.map(gu),e[45]=s,e[46]=q):q=e[46];let H;e[47]!==n.length||e[48]!==u?(H=n.length>0&&o.jsx(es,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=u,e[49]=H):H=e[49];let I;e[50]!==n?(I=n.map(fu),e[50]=n,e[51]=I):I=e[51];let G;e[52]!==j||e[53]!==E||e[54]!==B||e[55]!==$||e[56]!==V||e[57]!==F||e[58]!==q||e[59]!==H||e[60]!==I?(G=o.jsxs(io,{value:j,onValueChange:E,children:[B,$,V,F,q,H,I]}),e[52]=j,e[53]=E,e[54]=B,e[55]=$,e[56]=V,e[57]=F,e[58]=q,e[59]=H,e[60]=I,e[61]=G):G=e[61];let W;e[62]!==G||e[63]!==D?(W=o.jsxs(Is,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,G]}),e[62]=G,e[63]=D,e[64]=W):W=e[64];let M;e[65]!==W||e[66]!==O?(M=o.jsxs(Ks,{children:[O,W]}),e[65]=W,e[66]=O,e[67]=M):M=e[67];let Q;e[68]!==N||e[69]!==k||e[70]!==u?(Q=k&&o.jsx(di,{label:u("sandbox.postToolbar.clearFilter"),onClick:N}),e[68]=N,e[69]=k,e[70]=u,e[71]=Q):Q=e[71];const ce=uu[c];let fe;e[72]!==u||e[73]!==ce?(fe=u(ce),e[72]=u,e[73]=ce,e[74]=fe):fe=e[74];let ue;e[75]!==fe?(ue=o.jsx(Ls,{asChild:!0,children:o.jsx(Lo,{icon:wi,active:!0,value:fe})}),e[75]=fe,e[76]=ue):ue=e[76];let J;e[77]!==u?(J=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=J):J=e[78];let me;e[79]!==J?(me=o.jsx(es,{children:J}),e[79]=J,e[80]=me):me=e[80];let de;e[81]!==f?(de=X=>f(X),e[81]=f,e[82]=de):de=e[82];let ie;e[83]===Symbol.for("react.memo_cache_sentinel")?(ie=Object.keys(Oo),e[83]=ie):ie=e[83];let ee;e[84]!==u?(ee=ie.map(X=>o.jsx(os,{value:X,children:u(Oo[X])},X)),e[84]=u,e[85]=ee):ee=e[85];let ge;e[86]!==c||e[87]!==de||e[88]!==ee?(ge=o.jsx(io,{value:c,onValueChange:de,children:ee}),e[86]=c,e[87]=de,e[88]=ee,e[89]=ge):ge=e[89];let ne;e[90]!==me||e[91]!==ge?(ne=o.jsxs(Is,{align:"end",className:"w-44",children:[me,ge]}),e[90]=me,e[91]=ge,e[92]=ne):ne=e[92];let pe;e[93]!==ue||e[94]!==ne?(pe=o.jsx("div",{className:"ml-auto shrink-0",children:o.jsxs(Ks,{children:[ue,ne]})}),e[93]=ue,e[94]=ne,e[95]=pe):pe=e[95];let oe;return e[96]!==M||e[97]!==Q||e[98]!==pe?(oe=o.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[M,Q,pe]}),e[96]=M,e[97]=Q,e[98]=pe,e[99]=oe):oe=e[99],oe}function fu(t){return o.jsxs(os,{value:`author:${t.email}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(ao,{count:t.count})]},`author:${t.email}`)}function gu(t){return o.jsxs(os,{value:`cat:${t.slug}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(ao,{count:t.count})]},`cat:${t.slug}`)}function di(t){const e=le.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Fn,{size:12}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function hu(t){const e=le.c(18),{checked:s,disabled:n,onToggle:a}=t,i=Ne();let r;e[0]!==a?(r=()=>a(),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==s||e[3]!==i?(l=i(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=i,e[4]=l):l=e[4];let c;e[5]!==s||e[6]!==n||e[7]!==r||e[8]!==l?(c=o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:xu,children:o.jsx(on,{checked:s,disabled:n,onCheckedChange:r,"aria-label":l})})}),e[5]=s,e[6]=n,e[7]=r,e[8]=l,e[9]=c):c=e[9];let d;e[10]!==s||e[11]!==i?(d=i(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=i,e[12]=d):d=e[12];let m;e[13]!==d?(m=o.jsx(We,{side:"bottom",children:d}),e[13]=d,e[14]=m):m=e[14];let g;return e[15]!==c||e[16]!==m?(g=o.jsxs(Je,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=g):g=e[17],g}function xu(t){return t.stopPropagation()}function bu(t){const e=le.c(42),{count:s,allSelected:n,onToggleSelectAll:a,onArchive:i,onExit:r}=t,l=Ne();let c;e[0]!==n||e[1]!==a?(c=o.jsx(hu,{checked:n,onToggle:a}),e[0]=n,e[1]=a,e[2]=c):c=e[2];let d;e[3]!==s||e[4]!==l?(d=l("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=l,e[5]=d):d=e[5];let m;e[6]!==d?(m=o.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=m):m=e[7];const g=s===0;let f;e[8]!==l?(f=l("sandbox.postToolbar.archiveSelectedPosts"),e[8]=l,e[9]=f):f=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(xi,{size:14}),e[10]=u):u=e[10];let p;e[11]!==i||e[12]!==g||e[13]!==f?(p=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:g,onClick:i,"aria-label":f,children:u})}),e[11]=i,e[12]=g,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==l?(h=l("sandbox.postToolbar.archiveSelected"),e[15]=l,e[16]=h):h=e[16];let S;e[17]!==h?(S=o.jsx(We,{side:"bottom",children:h}),e[17]=h,e[18]=S):S=e[18];let C;e[19]!==p||e[20]!==S?(C=o.jsxs(Je,{children:[p,S]}),e[19]=p,e[20]=S,e[21]=C):C=e[21];let k;e[22]!==l?(k=l("sandbox.postToolbar.exitSelection"),e[22]=l,e[23]=k):k=e[23];let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fn,{size:14}),e[24]=x):x=e[24];let b;e[25]!==r||e[26]!==k?(b=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,"aria-label":k,children:x})}),e[25]=r,e[26]=k,e[27]=b):b=e[27];let j;e[28]!==l?(j=l("sandbox.postToolbar.exitSelection"),e[28]=l,e[29]=j):j=e[29];let P;e[30]!==j?(P=o.jsx(We,{side:"bottom",children:j}),e[30]=j,e[31]=P):P=e[31];let N;e[32]!==b||e[33]!==P?(N=o.jsxs(Je,{children:[b,P]}),e[32]=b,e[33]=P,e[34]=N):N=e[34];let v;e[35]!==C||e[36]!==N?(v=o.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[C,N]}),e[35]=C,e[36]=N,e[37]=v):v=e[37];let E;return e[38]!==c||e[39]!==v||e[40]!==m?(E=o.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[c,m,v]}),e[38]=c,e[39]=v,e[40]=m,e[41]=E):E=e[41],E}const yu={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},In="generating",vu=[In,...to.filter(t=>t!==In)],Io=t=>t.scheduledDatetime||t.date||"",ku=(t,e)=>Io(e).localeCompare(Io(t)),Su=t=>t==="scheduled"||t==="published",ui="application/x-post-key";function ju(t){const e=le.c(165),{orgSlug:s,virtualMcpId:n,branch:a,decofile:i,view:r,selectedKey:l,onViewChange:c,onOpen:d,onClose:m,move:g,meta:f,renderDetail:u}=t,p=Ne();let h;e[0]!==a||e[1]!==s||e[2]!==n?(h={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=h):h=e[3];const S=sn(h),C=al().length>0,k=ka(),x=ii(),[b,j]=L.useState(null),[P,N]=L.useState(!1),[v,E]=L.useState(!1),[O,T]=L.useState(!1),[D,A]=L.useState(""),B=L.useRef(null);let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={},e[4]=w):w=e[4];const[$,V]=L.useState(w);let F;e[5]!==$?(F=(K,ae)=>$[K]??ae,e[5]=$,e[6]=F):F=e[6];const q=F;let H;e[7]===Symbol.for("react.memo_cache_sentinel")?(H=(K,ae)=>V(Be=>({...Be,[K]:ae})),e[7]=H):H=e[7];const I=H;let G;e[8]!==d?(G=K=>{const ae=K[0];ae&&d(ae)},e[8]=d,e[9]=G):G=e[9];let W;e[10]!==a||e[11]!==i||e[12]!==f||e[13]!==s||e[14]!==G||e[15]!==n?(W={orgSlug:s,virtualMcpId:n,branch:a,decofile:i,meta:f,onStarted:G},e[10]=a,e[11]=i,e[12]=f,e[13]=s,e[14]=G,e[15]=n,e[16]=W):W=e[16];const M=Wd(W),Q=Mc(i);let ce;e[17]!==i?(ce=K=>gt(i[K],"posts"),e[17]=i,e[18]=ce):ce=e[18];const fe=ce,ue=l&&Q.some(K=>K.key===l)?l:Q[0]?.key??null;let J;e[19]!==g||e[20]!==p?(J=async K=>{await g.apply(K.key,"archived")&&xe.success(p("sandbox.postBoard.archived"))},e[19]=g,e[20]=p,e[21]=J):J=e[21];const me=J,[de,ie]=L.useState(null),[ee,ge]=L.useState(null),[ne,pe]=L.useState(null),[oe,X]=L.useState("date-desc"),[te,_]=L.useState("");let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=new Set,e[22]=Y):Y=e[22];const[Z,he]=L.useState(Y),Te=Q.reduce(Pu,{}),_e=K=>{const ae=new Map;for(const Be of Q)for(const ut of K(Be))ae.set(ut,(ae.get(ut)??0)+1);return ae},Oe=_e(_u),we=_e(Nu),Ee=Ge(i,"categories").map(K=>{const{payload:ae}=K;return{slug:Ue(ae.slug),name:Ue(ae.name)||Ue(ae.slug),count:Oe.get(Ue(ae.slug))??0}}),Ae=Ge(i,"authors").map(K=>{const{payload:ae}=K;return{email:Ue(ae.email),name:Ue(ae.name)||Ue(ae.email),count:we.get(Ue(ae.email))??0}}),be=te.trim().toLowerCase();let Ce;e[23]!==de?(Ce=K=>!de||K.categorySlugs.includes(de),e[23]=de,e[24]=Ce):Ce=e[24];let De;e[25]!==ee?(De=K=>!ee||K.authorEmails.includes(ee),e[25]=ee,e[26]=De):De=e[26];let U;e[27]!==ne?(U=K=>!ne||K.status===ne,e[27]=ne,e[28]=U):U=e[28];let ye;e[29]!==oe?(ye=(K,ae)=>{if(oe==="az")return K.title.localeCompare(ae.title);if(oe==="za")return ae.title.localeCompare(K.title);const Be=(K.scheduledDatetime||K.date).localeCompare(ae.scheduledDatetime||ae.date);return oe==="date-asc"?Be:-Be},e[29]=oe,e[30]=ye):ye=e[30];const je=Q.filter(Ce).filter(De).filter(U).filter(K=>!be||K.title.toLowerCase().includes(be)||K.slug.toLowerCase().includes(be)).sort(ye),$e=Z.size>0;let yt;e[31]===Symbol.for("react.memo_cache_sentinel")?(yt=K=>he(ae=>{const Be=new Set(ae);return Be.delete(K)||Be.add(K),Be}),e[31]=yt):yt=e[31];const pn=yt,fs=()=>he(K=>je.every(ae=>K.has(ae.key))?new Set:new Set(je.map(Cu)));let vt;e[32]!==g||e[33]!==Z||e[34]!==p?(vt=async()=>{let K=0;for(const ae of Z)await g.apply(ae,"archived")&&(K=K+1);he(new Set),K>0&&xe.success(p("sandbox.postBoard.archived"))},e[32]=g,e[33]=Z,e[34]=p,e[35]=vt):vt=e[35];const mn=vt;let kt;e[36]!==g?(kt=(K,ae)=>{j(null),g.apply(ae,K)},e[36]=g,e[37]=kt):kt=e[37];const fn=kt;let St;e[38]!==d||e[39]!==S?(St=()=>{const K=Ys(On()),ae=Fa({title:"",now:new Date});S.mutate({blockKey:K,data:ht(K,ae)}),d(K)},e[38]=d,e[39]=S,e[40]=St):St=e[40];const jt=St,gn=()=>{const K=Xd(D),ae=cu(K.sections,so(f,{hideDefaults:x}));if(ae.length===0&&!K.title.trim()){xe.error(p("sandbox.postBoard.importEmpty"));return}const Be=Ys(On()),ut=du({title:K.title,blocks:ae,takenSlugs:Q.map(wu).filter(Boolean),now:new Date});S.mutate({blockKey:Be,data:ht(Be,ut)}),T(!1),A(""),xe.success(p("sandbox.postBoard.imported")),d(Be)},Qt=r==="list";let st;e[41]!==c?(st=()=>c("list"),e[41]=c,e[42]=st):st=e[42];let wt;e[43]===Symbol.for("react.memo_cache_sentinel")?(wt=o.jsx(Ei,{size:14}),e[43]=wt):wt=e[43];let nt;e[44]!==p?(nt=p("sandbox.postBoard.viewList"),e[44]=p,e[45]=nt):nt=e[45];let ot;e[46]!==Qt||e[47]!==st||e[48]!==nt?(ot=o.jsx(Ko,{active:Qt,onClick:st,icon:wt,label:nt}),e[46]=Qt,e[47]=st,e[48]=nt,e[49]=ot):ot=e[49];const Zt=r==="board";let at;e[50]!==c?(at=()=>c("board"),e[50]=c,e[51]=at):at=e[51];let Ct;e[52]===Symbol.for("react.memo_cache_sentinel")?(Ct=o.jsx(Ci,{size:14}),e[52]=Ct):Ct=e[52];let it;e[53]!==p?(it=p("sandbox.postBoard.viewBoard"),e[53]=p,e[54]=it):it=e[54];let rt;e[55]!==Zt||e[56]!==at||e[57]!==it?(rt=o.jsx(Ko,{active:Zt,onClick:at,icon:Ct,label:it}),e[55]=Zt,e[56]=at,e[57]=it,e[58]=rt):rt=e[58];let Nt;e[59]!==ot||e[60]!==rt?(Nt=o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[ot,rt]})}),e[59]=ot,e[60]=rt,e[61]=Nt):Nt=e[61];let _t;e[62]===Symbol.for("react.memo_cache_sentinel")?(_t=o.jsx(Gn,{size:14}),e[62]=_t):_t=e[62];let lt;e[63]!==p?(lt=p("sandbox.postBoard.newPost"),e[63]=p,e[64]=lt):lt=e[64];let Xe;e[65]===Symbol.for("react.memo_cache_sentinel")?(Xe=o.jsx(ls,{size:14}),e[65]=Xe):Xe=e[65];let ct;e[66]!==lt?(ct=o.jsx(Ls,{asChild:!0,children:o.jsxs(Re,{type:"button",size:"sm",children:[_t,lt,Xe]})}),e[66]=lt,e[67]=ct):ct=e[67];let y;e[68]!==k||e[69]!==p?(y=k&&o.jsxs(Ze,{onClick:()=>E(!0),children:[o.jsx(zs,{size:14}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:p("sandbox.postBoard.newPostGenerate")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:p("sandbox.postBoard.newPostGenerateHint")})]})]}),e[68]=k,e[69]=p,e[70]=y):y=e[70];let z;e[71]===Symbol.for("react.memo_cache_sentinel")?(z=o.jsx(Ai,{size:14}),e[71]=z):z=e[71];let se;e[72]!==p?(se=p("sandbox.postBoard.newPostWrite"),e[72]=p,e[73]=se):se=e[73];let re;e[74]!==se?(re=o.jsx("span",{children:se}),e[74]=se,e[75]=re):re=e[75];let Se;e[76]!==p?(Se=p("sandbox.postBoard.newPostWriteHint"),e[76]=p,e[77]=Se):Se=e[77];let Pe;e[78]!==Se?(Pe=o.jsx("span",{className:"text-xs text-muted-foreground",children:Se}),e[78]=Se,e[79]=Pe):Pe=e[79];let Ve;e[80]!==re||e[81]!==Pe?(Ve=o.jsxs("div",{className:"flex flex-col",children:[re,Pe]}),e[80]=re,e[81]=Pe,e[82]=Ve):Ve=e[82];let Qe;e[83]!==Ve||e[84]!==jt?(Qe=o.jsxs(Ze,{onClick:jt,children:[z,Ve]}),e[83]=Ve,e[84]=jt,e[85]=Qe):Qe=e[85];let gs,hs;e[86]===Symbol.for("react.memo_cache_sentinel")?(gs=()=>T(!0),hs=o.jsx(kn,{size:14}),e[86]=gs,e[87]=hs):(gs=e[86],hs=e[87]);let Pt;e[88]!==p?(Pt=p("sandbox.postBoard.importContent"),e[88]=p,e[89]=Pt):Pt=e[89];let Tt;e[90]!==Pt?(Tt=o.jsx("span",{children:Pt}),e[90]=Pt,e[91]=Tt):Tt=e[91];let At;e[92]!==p?(At=p("sandbox.postBoard.importContentHint"),e[92]=p,e[93]=At):At=e[93];let Et;e[94]!==At?(Et=o.jsx("span",{className:"text-xs text-muted-foreground",children:At}),e[94]=At,e[95]=Et):Et=e[95];let Dt;e[96]!==Tt||e[97]!==Et?(Dt=o.jsxs(Ze,{onClick:gs,children:[hs,o.jsxs("div",{className:"flex flex-col",children:[Tt,Et]})]}),e[96]=Tt,e[97]=Et,e[98]=Dt):Dt=e[98];let Bt;e[99]!==y||e[100]!==Qe||e[101]!==Dt?(Bt=o.jsxs(Is,{align:"end",className:"w-56",children:[y,Qe,Dt]}),e[99]=y,e[100]=Qe,e[101]=Dt,e[102]=Bt):Bt=e[102];let xs;e[103]!==ct||e[104]!==Bt?(xs=o.jsxs(Ks,{children:[ct,Bt]}),e[103]=ct,e[104]=Bt,e[105]=xs):xs=e[105];let bs;e[106]!==k||e[107]!==i||e[108]!==v||e[109]!==M||e[110]!==C?(bs=k&&o.jsx(Gd,{open:v,onOpenChange:E,decofile:i,hasAi:C,onGenerate:K=>{M(K)}}),e[106]=k,e[107]=i,e[108]=v,e[109]=M,e[110]=C,e[111]=bs):bs=e[111];let Ot;e[112]!==p?(Ot=p("sandbox.postBoard.importTitle"),e[112]=p,e[113]=Ot):Ot=e[113];let $t;e[114]!==Ot?($t=o.jsx(Yt,{children:Ot}),e[114]=Ot,e[115]=$t):$t=e[115];let Rt;e[116]!==p?(Rt=p("sandbox.postBoard.importDescription"),e[116]=p,e[117]=Rt):Rt=e[117];let Lt;e[118]!==Rt?(Lt=o.jsx(Kn,{children:Rt}),e[118]=Rt,e[119]=Lt):Lt=e[119];let ys;e[120]!==$t||e[121]!==Lt?(ys=o.jsxs(us,{children:[$t,Lt]}),e[120]=$t,e[121]=Lt,e[122]=ys):ys=e[122];const hn=ri(D)?"html":"markdown";let vs;e[123]===Symbol.for("react.memo_cache_sentinel")?(vs=K=>A(K??""),e[123]=vs):vs=e[123];let It;e[124]!==D||e[125]!==hn?(It=o.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:o.jsx(va,{code:D,language:hn,height:"100%",autoFocus:!0,onChange:vs})}),e[124]=D,e[125]=hn,e[126]=It):It=e[126];let ks;e[127]===Symbol.for("react.memo_cache_sentinel")?(ks=o.jsx("input",{ref:B,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async K=>{const ae=K.target.files?.[0];ae&&A(await ae.text()),K.target.value=""}}),e[127]=ks):ks=e[127];let Ss,js;e[128]===Symbol.for("react.memo_cache_sentinel")?(Ss=()=>B.current?.click(),js=o.jsx(kn,{size:14}),e[128]=Ss,e[129]=js):(Ss=e[128],js=e[129]);let Kt;e[130]!==p?(Kt=p("sandbox.postBoard.importUpload"),e[130]=p,e[131]=Kt):Kt=e[131];let Ft;e[132]!==Kt?(Ft=o.jsxs(Re,{type:"button",variant:"outline",size:"sm",onClick:Ss,children:[js,Kt]}),e[132]=Kt,e[133]=Ft):Ft=e[133];let ws;e[134]!==It||e[135]!==Ft?(ws=o.jsxs("div",{className:"space-y-3",children:[It,ks,Ft]}),e[134]=It,e[135]=Ft,e[136]=ws):ws=e[136];let Cs;e[137]!==D?(Cs=D.trim(),e[137]=D,e[138]=Cs):Cs=e[138];let Ns;e[139]===Symbol.for("react.memo_cache_sentinel")?(Ns=o.jsx(kn,{size:14}),e[139]=Ns):Ns=e[139];let _s;e[140]!==p?(_s=p("sandbox.postBoard.importRun"),e[140]=p,e[141]=_s):_s=e[141];let Ps;e[142]!==P||e[143]!==m||e[144]!==u||e[145]!==l||e[146]!==r?(Ps=r==="board"&&l&&P&&u&&o.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(l,{expanded:!0,onToggleExpand:()=>N(!1),onClose:()=>{N(!1),m?.()}})}),e[142]=P,e[143]=m,e[144]=u,e[145]=l,e[146]=r,e[147]=Ps):Ps=e[147];const xn=r==="board"&&!!l&&!P;let Mt;e[148]!==m?(Mt=K=>{K||(N(!1),m?.())},e[148]=m,e[149]=Mt):Mt=e[149];let zt;e[150]!==p?(zt=p("sandbox.collectionsSidebar.posts"),e[150]=p,e[151]=zt):zt=e[151];let Vt;e[152]!==zt?(Vt=o.jsx(Yt,{className:"sr-only",children:zt}),e[152]=zt,e[153]=Vt):Vt=e[153];let Ut;e[154]!==m||e[155]!==u||e[156]!==l?(Ut=l&&u?o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Tn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(l,{expanded:!1,onToggleExpand:()=>N(!0),onClose:()=>m?.()})}):null,e[154]=m,e[155]=u,e[156]=l,e[157]=Ut):Ut=e[157];let Gt;e[158]!==Vt||e[159]!==Ut?(Gt=o.jsxs(qt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[Vt,Ut]}),e[158]=Vt,e[159]=Ut,e[160]=Gt):Gt=e[160];let Ts;return e[161]!==xn||e[162]!==Mt||e[163]!==Gt?(Ts=o.jsx(Wt,{open:xn,onOpenChange:Mt,children:Gt}),e[161]=xn,e[162]=Mt,e[163]=Gt,e[164]=Ts):Ts=e[164],o.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[Nt,o.jsxs("div",{className:"flex items-center gap-2",children:[xs,bs,o.jsx(Wt,{open:O,onOpenChange:T,children:o.jsxs(qt,{className:"max-h-[85vh] sm:max-w-2xl",children:[ys,ws,o.jsx(ps,{children:o.jsxs(Re,{type:"button",disabled:!Cs,onClick:gn,children:[Ns,_s]})})]})})]})]}),Q.length===0?o.jsx(ol,{className:"flex-1",icon:o.jsx(zs,{size:22}),title:p("sandbox.postBoard.emptyTitle"),description:p("sandbox.postBoard.emptyDescription"),buttonProps:{children:p("sandbox.postBoard.newPost"),onClick:jt}}):r==="board"?o.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:vu.map(K=>{const ae=p(Zs[K]),Be=Q.filter(Le=>Le.status===K);Su(K)&&Be.sort(ku);const ut=q(K,Be.length===0);return o.jsxs(L.Fragment,{children:[o.jsx("div",{onDragOver:Le=>{Le.preventDefault(),j(K)},onDragLeave:()=>j(Le=>Le===K?null:Le),onDrop:Le=>{Le.preventDefault(),fn(K,Le.dataTransfer.getData(ui))},className:ve("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",ut?"w-11":"w-72",b===K&&"border-primary bg-primary/5"),children:ut?o.jsxs("button",{type:"button",onClick:()=>I(K,!1),"aria-label":p("sandbox.postBoard.expandLane",{lane:ae}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[o.jsx(Fs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"text-xs tabular-nums",children:Be.length}),o.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:ae})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[o.jsxs("button",{type:"button",onClick:()=>I(K,!0),"aria-label":p("sandbox.postBoard.collapseLane",{lane:ae}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[o.jsx(ls,{size:14,className:"shrink-0"}),o.jsx("span",{className:"truncate",children:ae})]}),o.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Be.length})]}),o.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Be.length===0?o.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.postBoard.laneEmpty")}):Be.map(Le=>o.jsx(Eu,{post:Le,payload:fe(Le.key),moving:g.isMoving(Le.key),onOpen:()=>d(Le.key),onArchive:Le.status==="archived"?void 0:()=>{me(Le)}},Le.key))})]})}),K===In&&o.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},K)})}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[o.jsx(pu,{value:te,onChange:_}),$e?o.jsx(bu,{count:Z.size,allSelected:je.length>0&&je.every(K=>Z.has(K.key)),onToggleSelectAll:fs,onArchive:()=>{mn()},onExit:()=>he(new Set)}):o.jsx(mu,{categories:Ee,authors:Ae,statusCounts:Te,categoryFilter:de,authorFilter:ee,statusFilter:ne,sort:oe,onCategoryFilterChange:ie,onAuthorFilterChange:ge,onStatusFilterChange:pe,onSortChange:X}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Tu,{posts:je,selectedKey:ue,selectionActive:$e,selectedKeys:Z,onToggleSelect:pn,onOpen:d,isMoving:g.isMoving,onArchive:K=>{me(K)}})})]}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:ue&&u?o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Tn,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(ue)}):o.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:p("sandbox.postBoard.selectPrompt")})})]}),Ps,Ts]})}function wu(t){return t.slug}function Cu(t){return t.key}function Nu(t){return t.authorEmails}function _u(t){return t.categorySlugs}function Pu(t,e){return t[e.status]=(t[e.status]??0)+1,t}function Ko(t){const e=le.c(7),{active:s,onClick:n,icon:a,label:i}=t,r=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let l;e[0]!==r?(l=ve("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r),e[0]=r,e[1]=l):l=e[1];let c;return e[2]!==a||e[3]!==i||e[4]!==n||e[5]!==l?(c=o.jsxs("button",{type:"button",onClick:n,className:l,children:[a,i]}),e[2]=a,e[3]=i,e[4]=n,e[5]=l,e[6]=c):c=e[6],c}function Tu(t){const e=le.c(23),{posts:s,selectedKey:n,selectionActive:a,selectedKeys:i,onToggleSelect:r,onOpen:l,isMoving:c,onArchive:d}=t,m=Ne();if(s.length===0){let u;e[0]!==m?(u=m("sandbox.postList.noMatches"),e[0]=m,e[1]=u):u=e[1];let p;return e[2]!==u?(p=o.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=p):p=e[3],p}let g;if(e[4]!==c||e[5]!==d||e[6]!==l||e[7]!==r||e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==a){let u;e[13]!==c||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==n||e[18]!==i||e[19]!==a?(u=p=>o.jsx(Au,{post:p,selected:p.key===n,selectionActive:a,checked:i.has(p.key),onToggleSelect:()=>r(p.key),moving:c(p.key),onOpen:()=>l(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=c,e[14]=d,e[15]=l,e[16]=r,e[17]=n,e[18]=i,e[19]=a,e[20]=u):u=e[20],g=s.map(u),e[4]=c,e[5]=d,e[6]=l,e[7]=r,e[8]=s,e[9]=n,e[10]=i,e[11]=a,e[12]=g}else g=e[12];let f;return e[21]!==g?(f=o.jsx("ul",{className:"divide-y",children:g}),e[21]=g,e[22]=f):f=e[22],f}function Au(t){const e=le.c(60),{post:s,selected:n,selectionActive:a,checked:i,onToggleSelect:r,moving:l,onOpen:c,onArchive:d}=t,m=Ne(),g=s.status==="awaiting_review"&&s.missing.length>0,f=s.status==="scheduled"||s.status==="published",u=a||i?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==u?(p=ve("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=p):p=e[1];let h;e[2]!==r?(h=()=>r(),e[2]=r,e[3]=h):h=e[3];let S;e[4]!==s.title||e[5]!==m?(S=s.title||m("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=m,e[6]=S):S=e[6];let C;e[7]!==i||e[8]!==h||e[9]!==S?(C=o.jsx(on,{checked:i,onCheckedChange:h,"aria-label":S}),e[7]=i,e[8]=h,e[9]=S,e[10]=C):C=e[10];let k;e[11]!==p||e[12]!==C?(k=o.jsx("span",{className:p,children:C}),e[11]=p,e[12]=C,e[13]=k):k=e[13];let x;e[14]!==l||e[15]!==d||e[16]!==a?(x=d&&!a&&o.jsx(pi,{onArchive:d,disabled:l,className:"top-2.5"}),e[14]=l,e[15]=d,e[16]=a,e[17]=x):x=e[17];let b;e[18]!==c||e[19]!==r||e[20]!==a?(b=()=>a?r():c(),e[18]=c,e[19]=r,e[20]=a,e[21]=b):b=e[21];const j=n?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let P;e[22]!==j?(P=ve("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",j),e[22]=j,e[23]=P):P=e[23];let N;e[24]!==s.title||e[25]!==m?(N=s.title||m("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=m,e[26]=N):N=e[26];let v;e[27]!==N?(v=o.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:N}),e[27]=N,e[28]=v):v=e[28];const E=yu[s.status],O=Zs[s.status];let T;e[29]!==m||e[30]!==O?(T=m(O),e[29]=m,e[30]=O,e[31]=T):T=e[31];let D;e[32]!==E||e[33]!==T?(D=o.jsx(Qn,{variant:E,className:"shrink-0",children:T}),e[32]=E,e[33]=T,e[34]=D):D=e[34];let A;e[35]!==g||e[36]!==s.missing?(A=g&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(rs,{size:12}),s.missing.length]}),e[35]=g,e[36]=s.missing,e[37]=A):A=e[37];let B;e[38]!==s.duplicateTitle||e[39]!==m?(B=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:m("sandbox.postBoard.duplicateTitle"),children:[o.jsx(Jn,{size:12,"aria-hidden":!0}),o.jsx("span",{className:"sr-only",children:m("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=m,e[40]=B):B=e[40];let w;e[41]!==f||e[42]!==s.date||e[43]!==s.scheduledDatetime?(w=f&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[o.jsx(Vn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=f,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=w):w=e[44];let $;e[45]!==D||e[46]!==A||e[47]!==B||e[48]!==w?($=o.jsxs("div",{className:"flex items-center gap-2",children:[D,A,B,w]}),e[45]=D,e[46]=A,e[47]=B,e[48]=w,e[49]=$):$=e[49];let V;e[50]!==n||e[51]!==P||e[52]!==v||e[53]!==$||e[54]!==b?(V=o.jsxs("button",{type:"button",onClick:b,"aria-current":n,className:P,children:[v,$]}),e[50]=n,e[51]=P,e[52]=v,e[53]=$,e[54]=b,e[55]=V):V=e[55];let F;return e[56]!==V||e[57]!==k||e[58]!==x?(F=o.jsxs("li",{className:"group/row relative",children:[k,x,V]}),e[56]=V,e[57]=k,e[58]=x,e[59]=F):F=e[59],F}function Eu(t){const e=le.c(50),{post:s,payload:n,moving:a,onOpen:i,onArchive:r}=t,l=Ne(),c=s.status!=="generating"&&!a;let d;e[0]!==n?(d=Kc(n),e[0]=n,e[1]=d):d=e[1];const m=d,g=!c&&"opacity-80";let f;e[2]!==g?(f=ve("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",g),e[2]=g,e[3]=f):f=e[3];let u;e[4]!==a||e[5]!==r?(u=r&&o.jsx(pi,{onArchive:r,disabled:a,className:"top-2"}),e[4]=a,e[5]=r,e[6]=u):u=e[6];let p;e[7]!==s.key?(p=T=>T.dataTransfer.setData(ui,s.key),e[7]=s.key,e[8]=p):p=e[8];const h=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let S;e[9]!==h?(S=ve("block w-full p-3 text-left",h),e[9]=h,e[10]=S):S=e[10];let C;e[11]!==s.title||e[12]!==l?(C=s.title||l("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=l,e[13]=C):C=e[13];let k;e[14]!==C?(k=o.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:C}),e[14]=C,e[15]=k):k=e[15];let x;e[16]!==m||e[17]!==s.status?(x=s.status==="draft"&&m.format?.name&&o.jsx(Qn,{variant:"outline",className:"max-w-full truncate",children:m.format.name}),e[16]=m,e[17]=s.status,e[18]=x):x=e[18];let b;e[19]!==s.status||e[20]!==l?(b=s.status==="generating"&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Tn,{size:12,className:"animate-spin"}),l("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=l,e[21]=b):b=e[21];let j;e[22]!==s.missing||e[23]!==s.status||e[24]!==l?(j=s.status==="awaiting_review"&&(s.missing.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(rs,{size:12}),l("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[o.jsx(nl,{size:12}),l("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=l,e[25]=j):j=e[25];let P;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(P=(s.status==="scheduled"||s.status==="published")&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(Vn,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=P):P=e[29];let N;e[30]!==s.duplicateTitle||e[31]!==l?(N=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(Jn,{size:12,"aria-hidden":!0}),l("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=l,e[32]=N):N=e[32];let v;e[33]!==x||e[34]!==b||e[35]!==j||e[36]!==P||e[37]!==N?(v=o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[x,b,j,P,N]}),e[33]=x,e[34]=b,e[35]=j,e[36]=P,e[37]=N,e[38]=v):v=e[38];let E;e[39]!==c||e[40]!==i||e[41]!==v||e[42]!==p||e[43]!==S||e[44]!==k?(E=o.jsxs("button",{type:"button",draggable:c,onDragStart:p,onClick:i,className:S,children:[k,v]}),e[39]=c,e[40]=i,e[41]=v,e[42]=p,e[43]=S,e[44]=k,e[45]=E):E=e[45];let O;return e[46]!==E||e[47]!==f||e[48]!==u?(O=o.jsxs("div",{className:f,children:[u,E]}),e[46]=E,e[47]=f,e[48]=u,e[49]=O):O=e[49],O}function pi(t){const e=le.c(13),{label:s,onArchive:n,disabled:a,className:i}=t,r=Ne();let l;e[0]!==s||e[1]!==r?(l=s??r("sandbox.postBoard.delete"),e[0]=s,e[1]=r,e[2]=l):l=e[2];const c=l;let d;e[3]!==n?(d=u=>{u.stopPropagation(),n()},e[3]=n,e[4]=d):d=e[4];let m;e[5]!==i?(m=ve("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",i),e[5]=i,e[6]=m):m=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Xn,{size:13}),e[7]=g):g=e[7];let f;return e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==c?(f=o.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:m,children:g}),e[8]=a,e[9]=d,e[10]=m,e[11]=c,e[12]=f):f=e[12],f}function Ye(t){const e=le.c(54),{icon:s,logoUrl:n,title:a,subtitle:i,active:r,accent:l,variantCount:c,trailing:d,selectable:m,selectionActive:g,selected:f,invalid:u,invalidReason:p,warning:h,warningReason:S,onToggleSelect:C,onClick:k,menu:x}=t,b=Ne(),j=l==="global";let P;e[0]!==s||e[1]!==r||e[2]!==j||e[3]!==n?(P=n?o.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):o.jsx("span",{className:ve("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:o.jsx(s,{size:16,className:ve("shrink-0",!j&&(r?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Wn}:void 0})}),e[0]=s,e[1]=r,e[2]=j,e[3]=n,e[4]=P):P=e[4];const N=P,v=r?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let E;e[5]!==v?(E=ve("group relative flex min-w-0 items-center rounded-md transition-colors",v),e[5]=v,e[6]=E):E=e[6];let O;e[7]!==C||e[8]!==m||e[9]!==f||e[10]!==g||e[11]!==b||e[12]!==a?(O=m&&o.jsx("span",{className:ve("flex shrink-0 items-center pl-2.5 transition-opacity",f||g?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Du,children:o.jsx(on,{checked:f,onCheckedChange:()=>C?.(),"aria-label":b("sandbox.itemRow.selectItem",{title:a})})}),e[7]=C,e[8]=m,e[9]=f,e[10]=g,e[11]=b,e[12]=a,e[13]=O):O=e[13];const T=u&&!r&&"text-destructive";let D;e[14]!==T?(D=ve("block truncate text-sm font-medium",T),e[14]=T,e[15]=D):D=e[15];let A;e[16]!==D||e[17]!==a?(A=o.jsx("span",{className:D,children:a}),e[16]=D,e[17]=a,e[18]=A):A=e[18];const B=r?"text-accent-foreground/70":"text-muted-foreground";let w;e[19]!==B?(w=ve("block truncate text-xs",B),e[19]=B,e[20]=w):w=e[20];let $;e[21]!==i||e[22]!==w?($=o.jsx("span",{className:w,children:i}),e[21]=i,e[22]=w,e[23]=$):$=e[23];let V;e[24]!==$||e[25]!==A?(V=o.jsxs("span",{className:"min-w-0 flex-1",children:[A,$]}),e[24]=$,e[25]=A,e[26]=V):V=e[26];let F;e[27]!==r||e[28]!==b||e[29]!==c?(F=c!==void 0&&c>1&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsxs("span",{className:ve("flex shrink-0 items-center gap-1 text-xs font-medium",r?"text-accent-foreground/70":"text-muted-foreground"),children:[o.jsx(Xo,{size:14}),c]})}),o.jsx(We,{side:"bottom",children:b("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=r,e[28]=b,e[29]=c,e[30]=F):F=e[30];let q;e[31]!==h||e[32]!==S?(q=h&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center text-warning",children:o.jsx(rs,{size:14})})}),S&&o.jsx(We,{side:"bottom",children:S})]}),e[31]=h,e[32]=S,e[33]=q):q=e[33];let H;e[34]!==r||e[35]!==u||e[36]!==p?(H=u&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx("span",{className:ve("flex shrink-0 items-center",r?"text-accent-foreground":"text-destructive"),children:o.jsx(rs,{size:14})})}),p&&o.jsx(We,{side:"bottom",children:p})]}),e[34]=r,e[35]=u,e[36]=p,e[37]=H):H=e[37];let I;e[38]!==k||e[39]!==N||e[40]!==V||e[41]!==F||e[42]!==q||e[43]!==H||e[44]!==d?(I=o.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[N,V,F,q,H,d]}),e[38]=k,e[39]=N,e[40]=V,e[41]=F,e[42]=q,e[43]=H,e[44]=d,e[45]=I):I=e[45];let G;e[46]!==r||e[47]!==x?(G=x&&o.jsx("div",{className:ve("pr-1 opacity-0 transition-opacity group-hover:opacity-100",r&&"opacity-100"),children:x}),e[46]=r,e[47]=x,e[48]=G):G=e[48];let W;return e[49]!==I||e[50]!==G||e[51]!==E||e[52]!==O?(W=o.jsxs("div",{className:E,children:[O,I,G]}),e[49]=I,e[50]=G,e[51]=E,e[52]=O,e[53]=W):W=e[53],W}function Du(t){return t.stopPropagation()}function dt(t){const e=le.c(10),{icon:s,title:n,description:a}=t;let i;e[0]!==s?(i=s&&o.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==n?(r=o.jsx("div",{children:n}),e[2]=n,e[3]=r):r=e[3];let l;e[4]!==a?(l=a&&o.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==i||e[7]!==r||e[8]!==l?(c=o.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:[i,r,l]}),e[6]=i,e[7]=r,e[8]=l,e[9]=c):c=e[9],c}const Bu={loaders:Jo,actions:ta},Ou={loaders:"Loaders",actions:"Actions"},$u={analytics:Pi,blog:ya,commerce:_i,site:Ni,website:Ms};function Ru(t,e){return e===0?$u[t.toLowerCase()]??lo:lo}function Ds(t,e){return e===0?rr(t):t}function Lu(t){const e=le.c(98),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,kind:c}=t,d=Ne();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[0]=m):m=e[0];const[g,f]=L.useState(m),[u,p]=L.useState(null),[h,S]=L.useState(""),[C,k]=L.useState(Gu),[x,b]=L.useState(c);x!==c&&(b(c),f([]),p(null),S(""),k(new Set));let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=M=>{k(Q=>{const ce=new Set(Q);return ce.has(M)?ce.delete(M):ce.add(M),ce})},e[1]=j):j=e[1];const P=j;let N;e[2]!==a||e[3]!==s||e[4]!==n?(N={orgSlug:s,virtualMcpId:n,branch:a},e[2]=a,e[3]=s,e[4]=n,e[5]=N):N=e[5];const v=sn(N);let E;e[6]!==v?(E=pa((M,Q)=>v.mutate({blockKey:M,data:Q})),e[6]=v,e[7]=E):E=e[7];const O=E;let T;e[8]!==c?(T=lr(c),e[8]=c,e[9]=T):T=e[9];const D=T,A=Bu[c];let B,w,$,V,F,q,H;if(e[10]!==A||e[11]!==a||e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==C||e[16]!==s||e[17]!==g||e[18]!==i||e[19]!==v||e[20]!==O||e[21]!==h||e[22]!==u||e[23]!==D||e[24]!==d||e[25]!==n){$=Symbol.for("react.early_return_sentinel");e:{const M=[...nr(r,l,c).map(Uu),...or(r,c).map(Vu)],Q=h.trim().toLowerCase(),ce=Q.length>0,fe=ce?M.filter(U=>U.title.toLowerCase().includes(Q)||U.resolveType.toLowerCase().includes(Q)):[],ue=new Map,J=[],me=new Map;if(!ce){for(const U of M){const ye=U.folderPath;if(!(ye.length<g.length)&&g.every((je,$e)=>ye[$e]===je))if(ye.length===g.length)if(U.savedKey!==void 0){const je=me.get(U.resolveType);je?je.push(U):me.set(U.resolveType,[U])}else J.push(U);else{const je=ye[g.length],$e=ue.get(je)??{count:0,savedCount:0};U.savedKey!==void 0?$e.savedCount=$e.savedCount+1:$e.count=$e.count+1,ue.set(je,$e)}}J.sort(zu);for(const U of me.values())U.sort(Mu)}const de=[...me.entries()].filter(U=>{const[ye]=U;return!J.some(je=>je.resolveType===ye)}).flatMap(Fu).sort(Ku);let ie;e[33]!==g?(ie=(U,ye)=>Ds(U.name,g.length).localeCompare(Ds(ye.name,g.length)),e[33]=g,e[34]=ie):ie=e[34];const ee=[...ue.entries()].map(Iu).sort(ie);let ge;e[35]===Symbol.for("react.memo_cache_sentinel")?(ge=U=>{p(U.savedKey!==void 0?{mode:"saved",key:U.savedKey}:{mode:"available",resolveType:U.resolveType,title:U.title})},e[35]=ge):ge=e[35];const ne=ge;let pe;e[36]!==v||e[37]!==D||e[38]!==d?(pe=async(U,ye)=>{await v.mutateAsync({blockKey:U,data:ye}),xe.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:U})),p({mode:"saved",key:U})},e[36]=v,e[37]=D,e[38]=d,e[39]=pe):pe=e[39];const oe=pe;let X;e[40]!==l||e[41]!==u?(X=Hu(u,l),e[40]=l,e[41]=u,e[42]=X):X=e[42];const te=X;if(te){const U=`${te.mode}:${te.mode==="saved"?te.blockKey:te.resolveType}`;let ye;e[43]===Symbol.for("react.memo_cache_sentinel")?(ye=()=>p(null),e[43]=ye):ye=e[43];let je;e[44]!==a||e[45]!==l||e[46]!==oe||e[47]!==c||e[48]!==r||e[49]!==s||e[50]!==i||e[51]!==v.isPending||e[52]!==O||e[53]!==U||e[54]!==te.editorTarget||e[55]!==te.initialValue||e[56]!==n?(je=o.jsx(ar,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,kind:c,target:te.editorTarget,initialValue:te.initialValue,isCreating:v.isPending,onCreate:oe,onSaveReferencedBlock:O,onBack:ye},U),e[44]=a,e[45]=l,e[46]=oe,e[47]=c,e[48]=r,e[49]=s,e[50]=i,e[51]=v.isPending,e[52]=O,e[53]=U,e[54]=te.editorTarget,e[55]=te.initialValue,e[56]=n,e[57]=je):je=e[57],$=je;break e}H="flex h-full w-full min-w-0 flex-col";let _;e[58]!==d?(_=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=_):_=e[59];let Y;e[60]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>f([]),e[60]=Y):Y=e[60];const Z=g.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==Z?(he=ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Z),e[61]=Z,e[62]=he):he=e[62];const Te=Ou[c];let _e;e[63]!==he||e[64]!==Te?(_e=o.jsx("button",{type:"button",onClick:Y,className:he,children:Te}),e[63]=he,e[64]=Te,e[65]=_e):_e=e[65];let Oe;e[66]!==g?(Oe=g.map((U,ye)=>{const je=ye===g.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o.jsx(Fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>f(g.slice(0,ye+1)),className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je?"font-medium text-foreground":"text-muted-foreground"),children:Ds(U,ye)})]},`${U}-${ye}`)}),e[66]=g,e[67]=Oe):Oe=e[67];let we;e[68]!==_||e[69]!==_e||e[70]!==Oe?(we=o.jsxs("nav",{"aria-label":_,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[_e,Oe]}),e[68]=_,e[69]=_e,e[70]=Oe,e[71]=we):we=e[71];let Ee;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ee=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ee):Ee=e[72];let Ae;e[73]===Symbol.for("react.memo_cache_sentinel")?(Ae=U=>S(U.target.value),e[73]=Ae):Ae=e[73];let be;e[74]!==c||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=be):be=e[76];let Ce;e[77]!==c||e[78]!==d?(Ce=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Ce):Ce=e[79];let De;e[80]!==h||e[81]!==be||e[82]!==Ce?(De=o.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ee,o.jsx("input",{type:"text",value:h,onChange:Ae,placeholder:be,"aria-label":Ce,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=h,e[81]=be,e[82]=Ce,e[83]=De):De=e[83],e[84]!==we||e[85]!==De?(w=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,De]}),e[84]=we,e[85]=De,e[86]=w):w=e[86],B=tn,q="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",F=ce?fe.length===0?o.jsx(dt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:h.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):o.jsx("div",{className:"flex flex-col gap-1",children:fe.map(U=>o.jsx(Ye,{icon:A,accent:U.savedKey!==void 0?"global":void 0,title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)},U.savedKey??U.resolveType))}):ee.length===0&&J.length===0&&de.length===0?o.jsx(dt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:g.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):o.jsxs(o.Fragment,{children:[ee.length>0&&o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:ee.map(U=>{const ye=Ru(U.name,g.length);return o.jsxs("button",{type:"button",onClick:()=>f([...g,U.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:[o.jsx(ye,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:Ds(U.name,g.length)}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[U.count," ",U.count===1?D:c,U.savedCount>0&&o.jsxs(o.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:U.savedCount})]})]})]})]},U.name)})}),(J.length>0||de.length>0)&&o.jsxs("div",{className:ve("flex flex-col gap-1",ee.length>0&&"mt-4"),children:[J.map(U=>{const ye=me.get(U.resolveType)??[],je=C.has(U.resolveType);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(Ye,{icon:A,title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)}),ye.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>P(U.resolveType),"aria-expanded":je,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Wn},children:[je?o.jsx(ls,{size:12,className:"shrink-0"}):o.jsx(Fs,{size:12,className:"shrink-0"}),d(je?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ye.length,")"]}),je&&o.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ye.map($e=>o.jsx(Ye,{icon:A,accent:"global",title:$e.title,subtitle:$e.resolveType,active:!1,onClick:()=>ne($e)},$e.savedKey))})]})]},U.resolveType)}),de.map(U=>o.jsx(Ye,{icon:A,accent:"global",title:U.title,subtitle:U.resolveType,active:!1,onClick:()=>ne(U)},U.savedKey))]})]})}e[10]=A,e[11]=a,e[12]=l,e[13]=c,e[14]=r,e[15]=C,e[16]=s,e[17]=g,e[18]=i,e[19]=v,e[20]=O,e[21]=h,e[22]=u,e[23]=D,e[24]=d,e[25]=n,e[26]=B,e[27]=w,e[28]=$,e[29]=V,e[30]=F,e[31]=q,e[32]=H}else B=e[26],w=e[27],$=e[28],V=e[29],F=e[30],q=e[31],H=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let I;e[87]!==V||e[88]!==F?(I=o.jsx("div",{className:V,children:F}),e[87]=V,e[88]=F,e[89]=I):I=e[89];let G;e[90]!==B||e[91]!==I||e[92]!==q?(G=o.jsx(B,{className:q,children:I}),e[90]=B,e[91]=I,e[92]=q,e[93]=G):G=e[93];let W;return e[94]!==w||e[95]!==G||e[96]!==H?(W=o.jsxs("div",{className:H,children:[w,G]}),e[94]=w,e[95]=G,e[96]=H,e[97]=W):W=e[97],W}function Iu(t){const[e,s]=t;return{name:e,...s}}function Ku(t,e){return t.title.localeCompare(e.title)}function Fu(t){const[,e]=t;return e}function Mu(t,e){return t.title.localeCompare(e.title)}function zu(t,e){return t.title.localeCompare(e.title)}function Vu(t){return{resolveType:t.resolveType,title:t.title,folderPath:ua(t.resolveType)}}function Uu(t){return{resolveType:t.resolveType,title:t.title,folderPath:ua(t.resolveType),savedKey:t.key}}function Gu(){return new Set}function Hu(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:s,props:n,title:a}=ir(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:n}}function Yu(t){const e=le.c(106),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:l,resolveType:c,title:d,defaultBlockId:m,isCreating:g,onCreate:f,onSaveReferencedBlock:u}=t,p=Ne(),h=ms(),S=h?.virtualMcpId,k=ba(S===n?n:null)?.metadata?.siteSlug??null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];const[b,j]=L.useState(x);let P;e[1]===Symbol.for("react.memo_cache_sentinel")?(P=[],e[1]=P):P=e[1];const[N,v]=L.useState(P),[E,O]=L.useState(0),[T,D]=L.useState(!1);let A;e[2]!==r||e[3]!==c?(A=qn(c,r),e[2]=r,e[3]=c,e[4]=A):A=e[4];const B=A;let w,$,V,F,q,H,I,G;if(e[5]!==k||e[6]!==a||e[7]!==l||e[8]!==N||e[9]!==b||e[10]!==g||e[11]!==f||e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==p||e[16]!==h?.taskId||e[17]!==d||e[18]!==n){const J=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,me=h?.taskId??null,de=i??void 0;let ie;e[27]!==k||e[28]!==a||e[29]!==s||e[30]!==de||e[31]!==me||e[32]!==n?(ie={orgSlug:s,virtualMcpId:n,branch:a,threadId:me,previewUrl:de,siteSlug:k},e[27]=k,e[28]=a,e[29]=s,e[30]=de,e[31]=me,e[32]=n,e[33]=ie):ie=e[33],$=ie;let ee,ge,ne,pe;if(e[34]!==l||e[35]!==N||e[36]!==b||e[37]!==f||e[38]!==p||e[39]!==d){const _e=[d,...N],Oe=Ee=>{v(N.slice(0,Ee)),O(qu)};let we;e[48]!==l||e[49]!==b||e[50]!==f?(we=async Ee=>{const Ae=dr(Ee,l);if(Ae){xe.error(Ae);return}await f(Ee,b),D(!1)},e[48]=l,e[49]=b,e[50]=f,e[51]=we):we=e[51],w=we,G="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",q="shrink-0 border-b px-3 py-2.5",pe="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(ee=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=ee):ee=e[53],ge="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ne=_e.map((Ee,Ae)=>{const be=Ae===_e.length-1,Ce=cr(Ee);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Ae>0&&o.jsx(Fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>Oe(Ae),title:Ce,className:ve("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Ce})]},`${Ce}-${Ae}`)}),e[34]=l,e[35]=N,e[36]=b,e[37]=f,e[38]=p,e[39]=d,e[40]=w,e[41]=ee,e[42]=ge,e[43]=ne,e[44]=pe,e[45]=q,e[46]=I,e[47]=G}else w=e[40],ee=e[41],ge=e[42],ne=e[43],pe=e[44],q=e[45],I=e[46],G=e[47];let oe;e[54]!==ee||e[55]!==ge||e[56]!==ne?(oe=o.jsx("nav",{"aria-label":ee,className:ge,children:ne}),e[54]=ee,e[55]=ge,e[56]=ne,e[57]=oe):oe=e[57];let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=()=>D(!0),e[58]=X):X=e[58];let te;e[59]!==p?(te=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=te):te=e[60];let _;e[61]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Ti,{size:14}),e[61]=_):_=e[61];let Y;e[62]!==g||e[63]!==te?(Y=o.jsx(qe,{asChild:!0,children:o.jsx(Re,{size:"icon",className:"size-8 shrink-0",disabled:g,onClick:X,"aria-label":te,children:_})}),e[62]=g,e[63]=te,e[64]=Y):Y=e[64];let Z;e[65]!==p?(Z=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=Z):Z=e[66];let he;e[67]!==Z?(he=o.jsx(We,{side:"bottom",children:Z}),e[67]=Z,e[68]=he):he=e[68];let Te;e[69]!==Y||e[70]!==he?(Te=o.jsxs(Je,{children:[Y,he]}),e[69]=Y,e[70]=he,e[71]=Te):Te=e[71],e[72]!==pe||e[73]!==oe||e[74]!==Te?(H=o.jsxs("div",{className:pe,children:[oe,Te]}),e[72]=pe,e[73]=oe,e[74]=Te,e[75]=H):H=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",F=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:J}),e[5]=k,e[6]=a,e[7]=l,e[8]=N,e[9]=b,e[10]=g,e[11]=f,e[12]=s,e[13]=i,e[14]=c,e[15]=p,e[16]=h?.taskId,e[17]=d,e[18]=n,e[19]=w,e[20]=$,e[21]=V,e[22]=F,e[23]=q,e[24]=H,e[25]=I,e[26]=G}else w=e[19],$=e[20],V=e[21],F=e[22],q=e[23],H=e[24],I=e[25],G=e[26];let W;e[76]!==V||e[77]!==F?(W=o.jsx("p",{className:V,children:F}),e[76]=V,e[77]=F,e[78]=W):W=e[78];let M;e[79]!==W||e[80]!==q||e[81]!==H?(M=o.jsxs("div",{className:q,children:[H,W]}),e[79]=W,e[80]=q,e[81]=H,e[82]=M):M=e[82];let Q;e[83]!==l||e[84]!==N||e[85]!==E||e[86]!==b||e[87]!==r||e[88]!==u||e[89]!==$||e[90]!==B||e[91]!==p?(Q=o.jsx(tn,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:B?o.jsx(ma,{schema:B,value:b,onChange:J=>j(J),basePath:"",breadcrumbPath:N,onBreadcrumbChange:v,meta:r,decofile:l,onSaveReferencedBlock:u,sandbox:$},E):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=l,e[84]=N,e[85]=E,e[86]=b,e[87]=r,e[88]=u,e[89]=$,e[90]=B,e[91]=p,e[92]=Q):Q=e[92];let ce;e[93]!==M||e[94]!==Q||e[95]!==I?(ce=o.jsxs("div",{className:I,children:[M,Q]}),e[93]=M,e[94]=Q,e[95]=I,e[96]=ce):ce=e[96];let fe;e[97]!==m||e[98]!==w||e[99]!==g||e[100]!==T?(fe=o.jsx(ur,{open:T,onOpenChange:D,defaultBlockId:m,isPending:g,onSubmit:w}),e[97]=m,e[98]=w,e[99]=g,e[100]=T,e[101]=fe):fe=e[101];let ue;return e[102]!==ce||e[103]!==fe||e[104]!==G?(ue=o.jsxs("div",{className:G,children:[ce,fe]}),e[102]=ce,e[103]=fe,e[104]=G,e[105]=ue):ue=e[105],ue}function qu(t){return t+1}function Wu(t,e){const s={__resolveType:t},n=fr([s],e)[0];return n?gr(s,n,e):null}function Ju({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:a,decofile:i,blockKey:r,onSaveReferencedBlock:l}){const c=Ne(),d=ms(),m=d?.virtualMcpId,f=ba(m===e?e:null)?.metadata?.siteSlug??null,[u]=L.useState(()=>Wu(r,i)),[p,h]=L.useState(u?.data??{}),[S,C]=L.useState([]),[k,x]=L.useState(0),[b,j]=L.useState(!1),[P,N]=L.useState(null),v=P!==null,{save:E,flush:O}=pr({orgSlug:t,virtualMcpId:e,branch:s}),T=u?.resolveType?qn(u.resolveType,a):null,D=i[r],A=D?Br(r,D):r,B=d?.taskId??null,w={orgSlug:t,virtualMcpId:e,branch:s,threadId:B,previewUrl:n??void 0,siteSlug:f},$=I=>{h(I),E(r,I)},V=()=>{v?(N(null),j(!1),x(I=>I+1)):N(JSON.stringify(p,null,2))},F=I=>{const G=I??"";try{const W=JSON.parse(G);if(W&&typeof W=="object"&&!Array.isArray(W)){j(!1),$(W);return}j(!0)}catch{j(!0)}},q=[A,...S],H=I=>{C(S.slice(0,I)),x(G=>G+1)};return o.jsx("div",{className:"flex h-full w-full min-w-0",children:o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx(mr,{crumbs:q,onSelect:H}),o.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Wn},"aria-hidden":!0}),o.jsx("div",{className:"flex-1"}),o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Re,{variant:v?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":v,children:v?o.jsx(Fn,{size:14}):o.jsx(Qo,{size:14})})}),o.jsx(We,{side:"bottom",children:c(v?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),o.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),o.jsxs("div",{className:"relative min-h-0 flex-1",children:[o.jsx(tn,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:T?o.jsx(ma,{schema:T,value:p,onChange:I=>$(I),basePath:"",breadcrumbPath:S,onBreadcrumbChange:C,meta:a,decofile:i,onSaveReferencedBlock:l,sandbox:w},k):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),P!==null&&o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[b&&o.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(va,{language:"json",height:"100%",code:P,onChange:F,onSave:I=>{F(I),O()}})})]})]})]})})}function Xu(t){const e=le.c(36),{selection:s,orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,isCreating:d,onCreateAvailable:m,onSaveReferencedBlock:g}=t,f=Ne();if(!s){let h;e[0]!==f?(h=f("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=f,e[1]=h):h=e[1];let S;e[2]!==f?(S=f("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=f,e[3]=S):S=e[3];let C;return e[4]!==h||e[5]!==S?(C=o.jsx(dt,{title:h,description:S}),e[4]=h,e[5]=S,e[6]=C):C=e[6],C}if(s.collection==="available-section"){const h=`available:${s.resolveType}`,S=s.resolveType,C=s.title;let k;e[7]!==s.title?(k=hr(s.title),e[7]=s.title,e[8]=k):k=e[8];let x;e[9]!==m||e[10]!==s.resolveType?(x=(j,P)=>m(s.resolveType,j,P),e[9]=m,e[10]=s.resolveType,e[11]=x):x=e[11];let b;return e[12]!==i||e[13]!==c||e[14]!==d||e[15]!==l||e[16]!==g||e[17]!==n||e[18]!==r||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==h||e[22]!==k||e[23]!==x||e[24]!==a?(b=o.jsx(Yu,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,resolveType:S,title:C,defaultBlockId:k,isCreating:d,onCreate:x,onSaveReferencedBlock:g},h),e[12]=i,e[13]=c,e[14]=d,e[15]=l,e[16]=g,e[17]=n,e[18]=r,e[19]=s.resolveType,e[20]=s.title,e[21]=h,e[22]=k,e[23]=x,e[24]=a,e[25]=b):b=e[25],b}const u=`saved:${s.key}`;let p;return e[26]!==i||e[27]!==c||e[28]!==l||e[29]!==g||e[30]!==n||e[31]!==r||e[32]!==s.key||e[33]!==u||e[34]!==a?(p=o.jsx(Ju,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:l,decofile:c,blockKey:s.key,onSaveReferencedBlock:g},u),e[26]=i,e[27]=c,e[28]=l,e[29]=g,e[30]=n,e[31]=r,e[32]=s.key,e[33]=u,e[34]=a,e[35]=p):p=e[35],p}function Bs(t){const e=le.c(34),{onDuplicate:s,onRename:n,onAddVariant:a,onEditSeo:i,onViewJson:r,onDelete:l}=t,c=Ne();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(bi,{size:14}),e[2]=m):m=e[2];let g;e[3]!==d?(g=o.jsx(Ls,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Qu,children:m})}),e[3]=d,e[4]=g):g=e[4];let f;e[5]!==n||e[6]!==c?(f=n&&o.jsxs(Ze,{onClick:n,children:[o.jsx(rl,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=n,e[6]=c,e[7]=f):f=e[7];let u;e[8]!==s||e[9]!==c?(u=s&&o.jsxs(Ze,{onClick:s,children:[o.jsx(Jn,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=c,e[10]=u):u=e[10];let p;e[11]!==a||e[12]!==c?(p=a&&o.jsxs(o.Fragment,{children:[o.jsx(bn,{}),o.jsxs(Ze,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[o.jsx(Xo,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=p):p=e[13];let h;e[14]!==i||e[15]!==r||e[16]!==c?(h=(i||r)&&o.jsxs(o.Fragment,{children:[o.jsx(bn,{}),i&&o.jsxs(Ze,{onClick:i,children:[o.jsx(Wo,{size:14}),c("sandbox.itemActions.editSeo")]}),r&&o.jsxs(Ze,{onClick:r,children:[o.jsx(Qo,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=i,e[15]=r,e[16]=c,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(bn,{}),e[18]=S):S=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Xn,{size:14}),e[19]=C):C=e[19];let k;e[20]!==c?(k=c("sandbox.itemActions.delete"),e[20]=c,e[21]=k):k=e[21];let x;e[22]!==l||e[23]!==k?(x=o.jsxs(Ze,{onClick:l,className:"text-destructive focus:text-destructive",children:[C,k]}),e[22]=l,e[23]=k,e[24]=x):x=e[24];let b;e[25]!==x||e[26]!==f||e[27]!==u||e[28]!==p||e[29]!==h?(b=o.jsxs(Is,{align:"end",className:"w-44",children:[f,u,p,h,S,x]}),e[25]=x,e[26]=f,e[27]=u,e[28]=p,e[29]=h,e[30]=b):b=e[30];let j;return e[31]!==b||e[32]!==g?(j=o.jsxs(Ks,{children:[g,b]}),e[31]=b,e[32]=g,e[33]=j):j=e[33],j}function Qu(t){return t.stopPropagation()}const mi=4;function dn(t){const e=new Map;for(const s of t)s.slug&&!e.has(s.slug)&&e.set(s.slug,s);return e}function un(t,e){const s=t.parentSlug;if(!t.slug||!s||s===t.slug)return;const n=e.get(s);return n===t?void 0:n}function fi(t,e){const s=dn(e),n=[],a=new Set;let i=s.get(t);for(;i&&!a.has(i.slug??"")&&(a.add(i.slug??""),n.push(i),!(n.length>=mi));)i=un(i,s);return n.reverse()}function gi(t,e){const s=new Map;for(const n of t){const a=un(n,e);if(!a?.slug)continue;const i=s.get(a);i?i.push(n):s.set(a,[n])}for(const n of s.values())n.sort((a,i)=>a.label.localeCompare(i.label));return s}function Jm(t,e){const s=dn(e),n=gi(e,s),a=new Set([t]),i=s.get(t);let r=i?[i]:[];for(;r.length;){const l=[];for(const c of r)for(const d of n.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),l.push(d));r=l}return a.delete(t),a}function Xm(t,e){if(!t)return[];const s=dn(e),n=fi(t,e),a=n[0];return!a||un(a,s)?[t]:n.map(i=>i.slug??"")}function Zu(t){const e=dn(t),s=gi(t,e),n=new Set,a=[],i=(l,c)=>{if(!n.has(l)&&(n.add(l),a.push({entry:l,depth:c}),!(c+1>=mi)))for(const d of s.get(l)??[])i(d,c+1)},r=t.filter(l=>!un(l,e)).sort((l,c)=>l.label.localeCompare(c.label));for(const l of r)i(l,0);for(const l of t)i(l,0);return a}function ep(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function tp(t){const e=new Map;for(const s of t){const n=ep(s.resolveType),a=e.get(n);a?a.push(s):e.set(n,[s])}return[...e.entries()].map(([s,n])=>({label:s,sections:n})).sort((s,n)=>s.label.localeCompare(n.label))}function Fo(t){const e=le.c(8),{icon:s,label:n,className:a}=t;let i;e[0]!==a?(i=ve("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=i):i=e[1];let r;e[2]!==s?(r=o.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=r):r=e[3];let l;return e[4]!==n||e[5]!==i||e[6]!==r?(l=o.jsxs("div",{className:i,children:[r,n]}),e[4]=n,e[5]=i,e[6]=r,e[7]=l):l=e[7],l}const Mo=L.lazy(()=>He(()=>import("./app-editor-Cio5Pq66.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])).then(t=>({default:t.AppEditor}))),sp=L.lazy(()=>He(()=>import("./cms-settings-editor-C_3APl39.js"),__vite__mapDeps([168,1,2,27,26,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,63,64,65,20,66,4,5,6,7,8,9,67,68,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,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,0,22,24,56,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167])).then(t=>({default:t.CmsSettingsEditor}))),np=L.lazy(()=>He(()=>import("./post-editor-BUlsS3rc.js"),__vite__mapDeps([169,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,27,26,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,157,62,170,126,98,76,77,100,93,148,118,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,94,95,96,97,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,119,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,22,149,150,151,152,153,154,155,156,158,159,160,161,162,171,163,172,173,174,164,175,176,165,166,167])).then(t=>({default:t.PostEditor}))),op=L.lazy(()=>He(()=>import("./record-editor-C4fMBCCz.js"),__vite__mapDeps([177,1,2,62,92,23,68,36,118,56,57,58,59,60,61,63,64,65,38,33,20,66,4,5,6,7,8,9,67,26,27,28,29,30,31,32,34,35,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,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,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,174,176,164,165,166,167])).then(t=>({default:t.RecordEditor}))),ap=L.lazy(()=>He(()=>import("./context-Bfj5rpO_.js"),__vite__mapDeps([178,1,2,11,8,9,12,13,14,15,16,17,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,126,62,148,118,100,19,56,57,58,59,60,61,63,64,65,20,66,4,5,6,7,67,68,69,70,18,3,10,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,93,94,95,96,97,98,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,119,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,176,179,173,180,164,172,165,166,167])).then(t=>({default:t.BlogContext}))),ip=L.lazy(()=>He(()=>import("./category-editor-D_K2FWTB.js"),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,27,31,33,25,157,62,92,23,68,36,174,26,28,29,30,32,34,35,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,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,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,22,149,150,151,152,153,154,155,156,158,159,160,161,162,171,163,172,173,175,176,164,165,166,167])).then(t=>({default:t.CategoryEditor}))),rp=L.lazy(()=>He(()=>import("./sections-editor-C_iMM594.js"),__vite__mapDeps([182,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,56,57,58,59,60,61,62,63,64,65,38,33,66,67,68,26,27,28,29,30,31,32,34,35,36,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,23,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,24,163,183,184])).then(t=>({default:t.SectionsEditor}))),lp=L.lazy(()=>He(()=>import("./seo-editor-DUiWy8Gm.js"),__vite__mapDeps([185,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,22,23,56,57,58,59,60,61,62,63,64,65,20,66,4,5,6,7,8,9,67,68,69,70,18,11,12,13,14,15,16,17,3,10,19,21,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,183])).then(t=>({default:t.SeoEditor}))),cp=L.lazy(()=>He(()=>import("./variant-calendar-BQESjgmt.js"),__vite__mapDeps([186,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,62,22,23,148,67,68,155,21,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,157,57,58,59,60,61,63,64,65,66,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,56,145,146,147,149,150,151,152,153,154,156,158,159,160,161,162,164,165,166,167])).then(t=>({default:t.VariantCalendar}))),dp=L.lazy(()=>He(()=>import("./post-calendar-Bk6dx49G.js"),__vite__mapDeps([187,1,2,26,27,28,29,30,31,32,33,34,35,36,37,25,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,22,23,21,16,15,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,157,67,68,57,58,59,60,61,62,63,64,65,66,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,56,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,164,165,166,167])).then(t=>({default:t.PostCalendar}))),up=L.lazy(()=>He(()=>import("./redirect-editor-vQorNOA7.js"),__vite__mapDeps([188,1,2,98,62,92,23,68,36,56,57,58,59,60,61,63,64,65,38,33,20,66,4,5,6,7,8,9,67,26,27,28,29,30,31,32,34,35,37,25,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,69,70,18,11,12,13,14,15,16,17,3,10,19,21,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,95,96,97,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,22,149,150,151,152,153,154,155,156,157,158,159,160,161,162,176])).then(t=>({default:t.RedirectEditor})));function pp(t,e){return t==="context"&&!e?"posts":t}function mp(t){const e=le.c(30),{deepLinkPage:s}=t,{currentBranch:n,virtualMcpId:a}=zn(),{org:i}=yi(),r=Wr(),l=Jr(),{runtime:c,previewServerUrl:d}=nn(a),m=c==="cms",g=Yn(a,n);let f,u;e[0]!==g||e[1]!==m||e[2]!==l.previewState||e[3]!==r.lifecycle.phase?(f=la(g),u=Zl({fastPreviewActive:m||f,previewState:l.previewState,lifecyclePhase:r.lifecycle.phase}),e[0]=g,e[1]=m,e[2]=l.previewState,e[3]=r.lifecycle.phase,e[4]=f,e[5]=u):(f=e[4],u=e[5]);const p=u;if(p.kind==="sandbox-card"){const k=`/${i.slug}/settings/connections`;let x;return e[6]!==p.state||e[7]!==l.start||e[8]!==k||e[9]!==r.lifecycle||e[10]!==r.phase?(x=o.jsx(Xl,{state:p.state,claimPhase:r.phase,lifecycle:r.lifecycle,onStart:l.start,connectionsHref:k}),e[6]=p.state,e[7]=l.start,e[8]=k,e[9]=r.lifecycle,e[10]=r.phase,e[11]=x):x=e[11],x}if(!a||!n){let k;return e[12]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(dt,{title:"Waiting for sandbox context…"}),e[12]=k):k=e[12],k}if(xr(g)){let k;return e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(vr,{}),e[13]=k):k=e[13],k}if(g.kind==="pending"){let k;return e[14]!==g?(k=o.jsx(kr,{backend:g}),e[14]=g,e[15]=k):k=e[15],k}const h=f?null:l.previewUrl;let S;e[16]!==g||e[17]!==m||e[18]!==l.previewUrl||e[19]!==d?(S=g.kind==="protocol"&&g.source==="local"?Gi(g):m?d:l.previewUrl,e[16]=g,e[17]=m,e[18]=l.previewUrl,e[19]=d,e[20]=S):S=e[20];let C;return e[21]!==n||e[22]!==s||e[23]!==p.devServerReady||e[24]!==p.sandboxWarming||e[25]!==i.slug||e[26]!==h||e[27]!==S||e[28]!==a?(C=o.jsx(gp,{orgSlug:i.slug,virtualMcpId:a,branch:n,previewUrl:h,sitePreviewUrl:S,deepLinkPage:s,devServerReady:p.devServerReady,sandboxWarming:p.sandboxWarming}),e[21]=n,e[22]=s,e[23]=p.devServerReady,e[24]=p.sandboxWarming,e[25]=i.slug,e[26]=h,e[27]=S,e[28]=a,e[29]=C):C=e[29],C}const zo=2e3,fp=15;function Vo(t,e,s,n){return typeof e!="string"||s&&(Sa(e,s,n)||t.state.dataUpdateCount>=fp)?!1:zo}function gp({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,sitePreviewUrl:a,deepLinkPage:i,devServerReady:r,sandboxWarming:l}){const c=Ne(),d=ms()?.taskId??null,m={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:n},g=!la(Yn(e,s)),f=br()===void 0,{data:u,isLoading:p}=Hi(m,{fetchEnabled:r}),h=Ho({strict:!1}),[S,C]=L.useState(()=>h.contentCollection&&pt(h.contentCollection)&&h.contentCollection||"pages"),k=ka(),x=pp(S,k),[b,j]=L.useState(()=>h.contentItem&&pt(x)?{collection:x,key:h.contentItem}:null),[P,N]=L.useState(null),{data:v,isLoading:E,isFetching:O}=yr(m,{fetchEnabled:r,refetchInterval:y=>{const z=y.state.data;if(x==="apps"&&b&&b.collection==="apps"){const se=u?.[b.key];return Vo(y,typeof se?.__resolveType=="string"?se.__resolveType:void 0,z)}if(x==="site"&&u){const se=z?mo(u,z):null,re=u.site,Se=se?.resolveType??(typeof re?.__resolveType=="string"?re.__resolveType:void 0);return Vo(y,Se,z,["seo"])}return!1}}),T=!!(i?.pageId||i?.path||i?.pathTemplate),[D,A]=L.useState(!1);if(T&&!D&&b===null&&u&&!E){A(!0);const y=Or(po(u,v),i??{});y&&(C("pages"),j({collection:"pages",key:y.key,path:y.path}))}const[B,w]=L.useState(""),[$,V]=L.useState("list"),F=y=>{j(y),N(null)},[q,H]=L.useState(x);q!==x&&(H(x),w(""));const I=(y,z)=>!Sa(y,v,z)&&(E||O),{createTask:G}=zn(),W=nn(e),M=Hl(e,v??void 0),Q=Hn(e).url,ce=Mn("site_apps_install_enabled")&&M!==null&&!Q,fe=v&&u?Ml(M?_a(M):[],v,u):[],ue=Vl({orgSlug:t,virtualMcpId:e,branch:s}),J=sn(m),me=Vr(m),de=Fd({orgSlug:t,virtualMcpId:e,branch:s,decofile:u??{},onMoved:(y,z)=>j(se=>se?.collection==="posts"&&se.key===y?{collection:"posts",key:z}:se)}),[ie,ee]=L.useState(null),[ge,ne]=L.useState(),[pe,oe]=L.useState(!1),[X,te]=L.useState(),[_,Y]=L.useState(null),[Z,he]=L.useState(null),[Te,_e]=L.useState(null),Oe=!u||!v;if(p||E||f||Oe&&l)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(ft,{className:"size-5 text-muted-foreground"})});if(Oe)return o.jsx(dt,{title:"Could not load site data."});if(Yi(v))return o.jsx(Sr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u});const we=po(u,v).sort((y,z)=>y.name.localeCompare(z.name)),Ee=$r(u).sort((y,z)=>y.from.localeCompare(z.from)),Ae=Rr(u,v),be=x==="sections"?Lr(v):[],Ce=mo(u,v),De=Oa(u),U=eo.some(y=>De[y].length>0),ye=pt(x)?De[x]:[],je=uo(v,"loaders"),$e=uo(v,"actions"),yt=g?["settings"]:["apps",...Ce?[]:["site"],...$e===0?["actions"]:[],...pl(v)?[]:["settings"]];if(!Ir(u,v)&&!U&&je===0&&$e===0)return o.jsx(dt,{icon:rs,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const pn={pages:we.length,sections:Ae.length,apps:g?fe.length:0,loaders:je,actions:$e,redirects:Ee.length,posts:De.posts.length,authors:De.authors.length,categories:De.categories.length},fs=new Set(we.map(y=>Os(y.path))),vt=new Set(we.map(y=>y.name)),mn=new Set(Ae.map(y=>y.name)),kt=async y=>{const z=u[y.key];if(!z)return;const se=ga(u,y.key),re=Kr(u,y.key,Math.max(0,se-1)),Se=Fr(z.sections,re);if(Se)try{await J.mutateAsync({blockKey:y.key,data:{...z,sections:Se}}),xe.success(`Variant added to "${y.name}"`),j({collection:"pages",key:y.key,path:y.path})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:"Could not add variant")}},fn=()=>{ne(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},St=y=>{ne(void 0),ee({mode:"duplicate",sourceKey:y.key,initialName:vo(vt,y.name),initialPath:ec(fs,y.path)})},jt=y=>{ne(void 0),ee({mode:"rename",sourceKey:y.key,initialName:y.name,initialPath:y.path})},gn=async y=>{if(!ie)return;const{mode:z,sourceKey:se}=ie;try{if(z==="create"){let re;if(y.templateKey){const Pe=u[y.templateKey];if(!Pe)throw new Error("Selected template no longer exists.");re={...Pe,name:y.name,path:y.path}}else re=nc(y.name,y.path);const Se=ac(u,y.name);await J.mutateAsync({blockKey:Se,data:re}),xe.success(`Created "${y.name}"`),j({collection:"pages",key:Se,path:y.path})}else if(z==="duplicate"&&se){const re=u[se];if(!re)throw new Error("Source page not found");const{key:Se,data:Pe}=sc({source:re,pages:we,newName:y.name,newPath:y.path});await J.mutateAsync({blockKey:Se,data:Pe}),xe.success(`Duplicated as "${y.name}"`),j({collection:"pages",key:Se,path:y.path})}else if(z==="rename"&&se){const re=u[se];if(!re)throw new Error("Page not found");const Se={...re,name:y.name,path:y.path};await J.mutateAsync({blockKey:se,data:Se}),xe.success("Page updated"),b?.collection==="pages"&&b.key===se&&j({collection:"pages",key:se,path:y.path})}ee(null)}catch(re){ne(re instanceof Error?re.message:"Save failed")}},Qt=({path:y})=>{if(!ie)return null;const z=Os(y);return(ie.mode==="rename"?Os(ie.initialPath):null)!==z&&fs.has(z)?`A page with path "${y}" already exists.`:null},st=async(y,z,se)=>{await J.mutateAsync({blockKey:z,data:{...se,name:z,__resolveType:y}}),xe.success(c("sandbox.contentBrowser.createdSection",{name:z})),j({collection:"sections",key:z})},wt=pa((y,z)=>J.mutate({blockKey:y,data:z})),nt=async y=>{const z=u[y.key];if(!z){xe.error(c("sandbox.contentBrowser.sectionNotFound"));return}const se=tc(u,y.key),re=vo(mn,y.name),Se={...z,name:re};try{await J.mutateAsync({blockKey:se,data:Se}),xe.success(c("sandbox.contentBrowser.duplicatedSection",{name:y.name})),j({collection:"sections",key:se})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:c("sandbox.contentBrowser.duplicateFailed"))}},ot=async y=>{if(!_)return;const z=u[_];if(!z){xe.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await J.mutateAsync({blockKey:_,data:{...z,name:y}}),xe.success(c("sandbox.contentBrowser.sectionRenamed")),Y(null)}catch(se){xe.error(se instanceof Error?se.message:c("sandbox.contentBrowser.renameFailed"))}},Zt=()=>{te(void 0),oe(!0)},at=async y=>{const z=Mr(u,y.from),se=zr(y);try{await J.mutateAsync({blockKey:z,data:se}),xe.success("Created redirect"),oe(!1),j({collection:"redirects",key:z})}catch(re){te(re instanceof Error?re.message:"Could not create redirect")}},Ct=async y=>{const z=_n(u,y),se=Ht(z,y,Va(y));try{await J.mutateAsync({blockKey:z,data:se}),xe.success(`Created ${as[y]}`),j({collection:y,key:z})}catch(re){xe.error(re instanceof Error?re.message:"Could not create")}},it=async y=>{const z=_n(u,"posts"),se=Ht(z,"posts",Od(y));try{await J.mutateAsync({blockKey:z,data:se}),xe.success(c("sandbox.postCalendar.createdScheduledPost")),C("posts"),H("posts"),j({collection:"posts",key:z}),N(null)}catch(re){xe.error(re instanceof Error?re.message:c("sandbox.postCalendar.couldNotCreate"))}},rt=async(y,z)=>{const se=u[y],re=se?Rd(gt(se,"posts"),z):null;if(!re){xe.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await J.mutateAsync({blockKey:y,data:Ht(y,"posts",re)})}catch(Se){xe.error(Se instanceof Error?Se.message:c("sandbox.postCalendar.couldNotReschedule"))}},Nt=async y=>{const z=u[y.key];if(!z){xe.error("Record not found.");return}const se=_n(u,y.kind),re=y.kind==="posts"?"title":"name",Se={...structuredClone(gt(z,y.kind)),[re]:`${y.label} (copy)`};if(y.kind==="categories"){const Pe=De.categories.map(Ve=>Ve.slug??"").filter(Boolean);Se.slug=Ed(String(Se.slug??""),Pe)}try{await J.mutateAsync({blockKey:se,data:Ht(se,y.kind,Se)}),xe.success(`Duplicated "${y.label}"`),j({collection:y.kind,key:se})}catch(Pe){xe.error(Pe instanceof Error?Pe.message:"Duplicate failed")}},_t=()=>{C("posts"),H("posts"),j(null),N(null),w("")},lt=async()=>{if(Z)try{const{kind:y,key:z,label:se}=Z;if(y==="blog"){if(Z.blogKind==="categories"){const re=gt(u[z],"categories").slug,Se=typeof re=="string"?re:"";if(Se)for(const{key:Pe,payload:Ve}of za(u)){const Qe=Uc(Ve,Se);Qe!==Ve&&await J.mutateAsync({blockKey:Pe,data:Fc(Pe,Gc(Qe))})}}await me.mutateAsync({blockKey:z})}else await me.mutateAsync({blockKey:z});xe.success(`Deleted "${se}"`),b&&b.collection!=="available-section"&&b.key===z&&j(null),he(null)}catch(y){xe.error(y instanceof Error?y.message:"Delete failed")}},Xe=me.isPending||J.isPending,ct=Z?.kind==="blog"?as[Z.blogKind]:Z?.kind??"item";return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx(Wl,{active:x,counts:pn,hidden:yt,showBlog:U,showContext:k,onSelect:y=>{C(y),j(null),N(null)}}),x!=="seo"&&x!=="site"&&x!=="settings"&&x!=="context"&&x!=="calendar"&&x!=="post-schedule"&&x!=="posts"&&x!=="loaders"&&x!=="actions"&&o.jsx(hp,{activeCollection:x,pages:we,redirects:Ee,sections:Ae,availableSections:be,appCatalog:fe,canInstallApps:ce,installingAppId:ue.isPending?ue.variables?.blockKey??null:null,onInstallApp:y=>{if(W.resolved){if(W.runtime==="cms"){xe.error(c("sandbox.appEditor.installNeedsCodingSession"),{action:{label:c("chat.fastPreview.startCodingSession"),onClick:()=>G({runtime:"sandbox"})}});return}ue.mutate({blockKey:y.id},{onSuccess:z=>F({collection:"apps",key:z.key}),onError:z=>xe.error(z.message)})}},blogEntries:ye,decofile:u,searchQuery:B,onSearchChange:w,selection:b,onSelect:F,onCreate:()=>{x==="pages"?fn():x==="redirects"?Zt():pt(x)&&Ct(x)},onDuplicatePage:St,onRenamePage:jt,onAddPageVariant:kt,onDeletePage:y=>he({kind:"page",key:y.key,label:y.name}),onEditPageSeo:y=>{const z={collection:"pages",key:y.key,path:y.path};j(z),N(y.key)},onViewPageJson:y=>_e(y.key),onDuplicateSection:nt,onRenameSection:y=>Y(y.key),onDeleteSection:y=>he({kind:"section",key:y.key,label:y.name}),onDeleteRedirect:y=>he({kind:"redirect",key:y.key,label:y.from||y.key}),onDuplicateBlog:Nt,onDeleteBlog:y=>he({kind:"blog",blogKind:y.kind,key:y.key,label:y.label})}),o.jsx("div",{className:"flex-1 min-w-0",children:x==="loaders"||x==="actions"?o.jsx(Lu,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,kind:x}):o.jsx(L.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(ft,{className:"size-5 text-muted-foreground"})}),children:x==="calendar"?o.jsx(cp,{decofile:u}):x==="post-schedule"?o.jsx(dp,{decofile:u,isCreating:J.isPending,onCreate:y=>{it(y)},onReschedule:(y,z)=>{rt(y,z)},onSelect:y=>{C("posts"),H("posts"),j({collection:"posts",key:y}),N(null)}}):x==="site"?Ce?o.jsx(Mo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:Ce.key,block:u[Ce.key],decofile:u,meta:v,title:"Site",excludeFields:["seo"],schemaPending:I(Ce.resolveType,["seo"]),previewBaseUrl:n},`site:${Ce.key}`):o.jsx(dt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):x==="settings"?o.jsx(sp,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):x==="context"?o.jsx(ap,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v}):x==="seo"?o.jsx(lp,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,meta:v,target:{kind:"site"},previewBaseUrl:a}):x==="sections"?o.jsx(Xu,{selection:b?.collection==="sections"||b?.collection==="available-section"?b:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:v,decofile:u,isCreating:J.isPending,onCreateAvailable:st,onSaveReferencedBlock:wt}):x==="posts"?o.jsx(ju,{orgSlug:t,virtualMcpId:e,branch:s,decofile:u,view:$,selectedKey:b?.collection==="posts"?b.key:null,onViewChange:y=>{V(y),j(null)},onClose:()=>j(null),onOpen:y=>{j({collection:"posts",key:y}),N(null)},move:de,meta:v,renderDetail:(y,z)=>o.jsx(np,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:y,block:u[y],decofile:u,meta:v,previewBaseUrl:a,move:de,onClose:z?.onClose,expanded:z?.expanded,onToggleExpand:z?.onToggleExpand},`post:${is(y)}`)}):b&&b.collection!=="available-section"?b.collection==="apps"?o.jsx(Mo,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key],decofile:u,meta:v,previewBaseUrl:n,schemaPending:I(typeof u[b.key]?.__resolveType=="string"?String(u[b.key].__resolveType):void 0)},`app:${b.key}`):b.collection==="categories"?o.jsx(ip,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key],decofile:u,meta:v,onManagePosts:()=>_t(),onOpenPost:y=>{C("posts"),H("posts"),j({collection:"posts",key:y}),N(null)},previewBaseUrl:a},`category:${b.key}`):b.collection==="authors"?o.jsx(op,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:b.key,block:u[b.key],meta:v,decofile:u},`authors:${b.key}`):b.collection==="redirects"?o.jsx(up,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b.key,block:u[b.key]},`redirect:${b.key}`):o.jsx(rp,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:n??void 0,currentPath:b.collection==="pages"?b.path:"/",activePageBlockKey:b.collection==="pages"?b.key:null,activeGlobalBlockKey:b.collection==="sections"?b.key:null,initialEditSeo:b.collection==="pages"&&P===b.key,onExitSeo:()=>N(null),onSelectRoot:()=>{j(null),N(null)}},b.collection==="pages"?`page:${b.key}`:`section:${b.key}`):o.jsx(dt,{title:`Select ${pt(x)?`a ${as[x]}`:x==="pages"?"a page":x==="apps"?"an app":x==="redirects"?"a redirect":"a section"} to edit`,description:x==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),ie&&o.jsx(cc,{open:!!ie,mode:ie.mode,initialName:ie.initialName,initialPath:ie.initialPath,isPending:J.isPending,error:ge,templates:we,validate:Qt,onSubmit:gn,onOpenChange:y=>{y||(ee(null),ne(void 0))}}),o.jsx(uc,{open:pe,isPending:J.isPending,error:X,onSubmit:at,onOpenChange:y=>{y||(oe(!1),te(void 0))}}),_&&o.jsx(pc,{open:!!_,blockKey:_,initialName:Ae.find(y=>y.key===_)?.name??_,isPending:J.isPending,onSubmit:ot,onOpenChange:y=>{y||Y(null)}}),Te&&o.jsx(Ur,{open:!!Te,onOpenChange:y=>{y||_e(null)},pageKey:Te,decofile:u,onSave:y=>J.mutateAsync({blockKey:Te,data:y})}),o.jsx(Di,{open:!!Z,onOpenChange:y=>{!y&&!Xe&&he(null)},children:o.jsxs(Bi,{children:[o.jsxs(Oi,{children:[o.jsx($i,{children:c("sandbox.contentBrowser.deleteDialog.title",{noun:ct})}),o.jsx(Ri,{children:Z?.kind==="section"?c("sandbox.contentBrowser.deleteDialog.descriptionSection",{label:Z.label}):Z?c("sandbox.contentBrowser.deleteDialog.descriptionPermanent",{label:Z.label}):null})]}),o.jsxs(Li,{children:[o.jsx(Ii,{disabled:Xe,children:c("sandbox.contentBrowser.deleteDialog.cancel")}),o.jsx(Ki,{onClick:y=>{y.preventDefault(),lt()},disabled:Xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Xe?o.jsxs(o.Fragment,{children:[o.jsx(ft,{className:"size-3.5"}),c("sandbox.contentBrowser.deleteDialog.deleting")]}):c("sandbox.contentBrowser.deleteDialog.delete")})]})]})})]})}function hp(t){const e=le.c(60),{activeCollection:s,pages:n,redirects:a,sections:i,availableSections:r,appCatalog:l,canInstallApps:c,installingAppId:d,onInstallApp:m,blogEntries:g,decofile:f,searchQuery:u,onSearchChange:p,selection:h,onSelect:S,onCreate:C,onDuplicatePage:k,onRenamePage:x,onAddPageVariant:b,onDeletePage:j,onEditPageSeo:P,onViewPageJson:N,onDuplicateSection:v,onRenameSection:E,onDeleteSection:O,onDeleteRedirect:T,onDuplicateBlog:D,onDeleteBlog:A}=t,B=Ne();let w,$,V,F,q,H;if(e[0]!==s||e[1]!==l||e[2]!==r||e[3]!==g||e[4]!==c||e[5]!==f||e[6]!==d||e[7]!==b||e[8]!==C||e[9]!==A||e[10]!==j||e[11]!==T||e[12]!==O||e[13]!==D||e[14]!==k||e[15]!==v||e[16]!==P||e[17]!==m||e[18]!==x||e[19]!==E||e[20]!==p||e[21]!==S||e[22]!==N||e[23]!==n||e[24]!==a||e[25]!==u||e[26]!==i||e[27]!==h||e[28]!==B){const M=u.toLowerCase(),Q=n.filter(_=>!M||_.name.toLowerCase().includes(M)||_.path.toLowerCase().includes(M)),ce=a.filter(_=>!M||_.from.toLowerCase().includes(M)||_.to.toLowerCase().includes(M)),fe=i.filter(_=>!M||_.name.toLowerCase().includes(M)||_.key.toLowerCase().includes(M)||_.resolveType.toLowerCase().includes(M)),ue=r.filter(_=>!M||_.title.toLowerCase().includes(M)||_.resolveType.toLowerCase().includes(M)||(_.description?.toLowerCase().includes(M)??!1)),J=tp(fe),me=l.filter(_=>!M||_.title.toLowerCase().includes(M)||_.app.toLowerCase().includes(M)||_.vendor.toLowerCase().includes(M)||_.category.toLowerCase().includes(M)),de=g.filter(_=>!M||_.label.toLowerCase().includes(M)||_.subtitle.toLowerCase().includes(M)),ie=s==="categories"&&!M?Zu(de):de.map(bp),ee=`Search ${s}…`,ge=pt(s)?`Create new ${as[s]}`:s==="redirects"?"Create new redirect":"Create new page",ne=s!=="apps"&&s!=="sections";q="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let pe;e[35]===Symbol.for("react.memo_cache_sentinel")?(pe=o.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[35]=pe):pe=e[35];let oe;e[36]!==p?(oe=_=>p(_.target.value),e[36]=p,e[37]=oe):oe=e[37];let X;e[38]!==ee||e[39]!==u||e[40]!==oe?(X=o.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[pe,o.jsx("input",{type:"text",value:u,onChange:oe,placeholder:ee,"aria-label":ee,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[38]=ee,e[39]=u,e[40]=oe,e[41]=X):X=e[41];let te;e[42]!==ge||e[43]!==C||e[44]!==ne?(te=ne&&o.jsxs(Je,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(Re,{variant:"ghost",size:"icon",onClick:C,"aria-label":ge,children:o.jsx(Gn,{size:14})})}),o.jsx(We,{side:"bottom",children:ge})]}),e[42]=ge,e[43]=C,e[44]=ne,e[45]=te):te=e[45],e[46]!==X||e[47]!==te?(H=o.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[X,te]}),e[46]=X,e[47]=te,e[48]=H):H=e[48],w=tn,F="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",$="flex flex-col gap-1 p-1.5",V=s==="pages"?Q.length===0?o.jsx(ts,{hasItems:n.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):Q.map(_=>{const Y=h?.collection==="pages"&&h.key===_.key,Z=ga(f,_.key);return o.jsx(Ye,{icon:Zo,title:_.name,subtitle:_.path,active:Y,variantCount:Z,onClick:()=>S({collection:"pages",key:_.key,path:_.path}),menu:o.jsx(Bs,{onDuplicate:()=>k(_),onRename:()=>x(_),onAddVariant:()=>b(_),onEditSeo:()=>P(_),onViewJson:()=>N(_),onDelete:()=>j(_)})},_.key)}):s==="sections"?fe.length===0&&ue.length===0?o.jsx(ts,{hasItems:i.length>0||r.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):o.jsxs(o.Fragment,{children:[J.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fo,{icon:Ms,label:"Saved sections"}),J.map(_=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:_.label}),_.sections.map(Y=>{const Z=h?.collection==="sections"&&h.key===Y.key;return o.jsx(Ye,{icon:Ms,accent:"global",title:Y.name,subtitle:_.label,active:Z,onClick:()=>S({collection:"sections",key:Y.key}),menu:o.jsx(Bs,{onDuplicate:()=>v(Y),onRename:()=>E(Y),onDelete:()=>O(Y)})},Y.key)})]},_.label))]}),ue.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Fo,{icon:co,label:"Available sections",className:ve(J.length>0&&"mt-3")}),ue.map(_=>{const Y=h?.collection==="available-section"&&h.resolveType===_.resolveType,Z=_.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return o.jsx(Ye,{icon:co,title:_.title,subtitle:Z??_.resolveType,active:Y,onClick:()=>S({collection:"available-section",resolveType:_.resolveType,title:_.title})},_.resolveType)})]})]}):s==="apps"?me.length===0?o.jsx(ts,{hasItems:l.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):me.map(_=>{const Y=h?.collection==="apps"&&_.blockKey!==null&&h.key===_.blockKey,Z=d===_.id;return o.jsx(Ye,{icon:sa,logoUrl:_.logo,title:_.title,subtitle:_.category,active:Y,trailing:_.installed?o.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):Z?o.jsx(ft,{className:"size-3.5 shrink-0 text-muted-foreground"}):_.installable&&c?o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Install"}):void 0,onClick:()=>{if(_.installed&&_.blockKey){S({collection:"apps",key:_.blockKey});return}if(!_.installable||!c){xe.message(`${_.title} is not installed on this site.`);return}d===null&&m(_)}},_.id)}):s==="redirects"?ce.length===0?o.jsx(ts,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):ce.map(_=>o.jsx(Ye,{icon:Yo,title:_.from||"(no source)",subtitle:`→ ${_.to||"(no target)"}`,active:h?.collection==="redirects"&&h.key===_.key,trailing:o.jsx(mc,{redirect:_}),onClick:()=>S({collection:"redirects",key:_.key}),menu:o.jsx(Bs,{onDelete:()=>T(_)})},_.key)):de.length===0?o.jsx(ts,{hasItems:g.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${pt(s)?as[s]:"item"}.`}):ie.map(_=>{const{entry:Y,depth:Z}=_,he=h?.collection===Y.kind&&h.key===Y.key;return o.jsx("div",{style:{paddingLeft:Z*16},children:o.jsx(Ye,{icon:Y.kind==="posts"?ea:Y.kind==="authors"?na:qo,title:Y.label,invalid:Y.missing.length>0,invalidReason:Y.missing.length>0?B("sandbox.itemRow.missingFields",{fields:$c(Y.missing,B)}):void 0,warning:Y.duplicateName,warningReason:B("sandbox.itemRow.duplicateName"),subtitle:Z>0?fi(Y.slug??"",de).map(xp).join(" / "):Y.subtitle,active:he,onClick:()=>S({collection:Y.kind,key:Y.key}),menu:o.jsx(Bs,{onDuplicate:()=>D(Y),onDelete:()=>A(Y)})})},Y.key)}),e[0]=s,e[1]=l,e[2]=r,e[3]=g,e[4]=c,e[5]=f,e[6]=d,e[7]=b,e[8]=C,e[9]=A,e[10]=j,e[11]=T,e[12]=O,e[13]=D,e[14]=k,e[15]=v,e[16]=P,e[17]=m,e[18]=x,e[19]=E,e[20]=p,e[21]=S,e[22]=N,e[23]=n,e[24]=a,e[25]=u,e[26]=i,e[27]=h,e[28]=B,e[29]=w,e[30]=$,e[31]=V,e[32]=F,e[33]=q,e[34]=H}else w=e[29],$=e[30],V=e[31],F=e[32],q=e[33],H=e[34];let I;e[49]!==$||e[50]!==V?(I=o.jsx("div",{className:$,children:V}),e[49]=$,e[50]=V,e[51]=I):I=e[51];let G;e[52]!==w||e[53]!==F||e[54]!==I?(G=o.jsx(w,{className:F,children:I}),e[52]=w,e[53]=F,e[54]=I,e[55]=G):G=e[55];let W;return e[56]!==q||e[57]!==H||e[58]!==G?(W=o.jsxs("div",{className:q,children:[H,G]}),e[56]=q,e[57]=H,e[58]=G,e[59]=W):W=e[59],W}function xp(t){return t.slug}function bp(t){return{entry:t,depth:0}}function Qm(t){const e=le.c(25),{virtualMcpId:s}=t,n=Ne(),[a,i]=L.useState(!1),r=xa(s),{connection:l}=qi(s),{activeTask:c}=zn();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[0]=d):d=e[0];const m=Ho(d);if(!(go(r?.metadata)||go(c?.metadata))&&!l){let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:o.jsx(ho,{className:"size-7 text-foreground"})}),e[1]=u):u=e[1];let p;e[2]!==n?(p=n("mainPanelTabs.contentTab.noContentToEdit"),e[2]=n,e[3]=p):p=e[3];let h;e[4]!==n?(h=n("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=n,e[5]=h):h=e[5];let S,C;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=()=>i(!0),C=o.jsx(ho,{className:"size-4"}),e[6]=S,e[7]=C):(S=e[6],C=e[7]);let k;e[8]!==n?(k=n("mainPanelTabs.previewTab.connectGithub"),e[8]=n,e[9]=k):k=e[9];let x;e[10]!==k?(x=o.jsxs(Re,{onClick:S,children:[C,k]}),e[10]=k,e[11]=x):x=e[11];let b;e[12]!==p||e[13]!==h||e[14]!==x?(b=o.jsx(ll,{className:"h-full",image:u,title:p,description:h,actions:x}),e[12]=p,e[13]=h,e[14]=x,e[15]=b):b=e[15];let j;e[16]!==a?(j=o.jsx(cl,{open:a,onOpenChange:i,mode:"agent"}),e[16]=a,e[17]=j):j=e[17];let P;return e[18]!==j||e[19]!==b?(P=o.jsxs(o.Fragment,{children:[b,j]}),e[18]=j,e[19]=b,e[20]=P):P=e[20],P}let f;return e[21]!==m.contentPageId||e[22]!==m.contentPath||e[23]!==m.contentPathTemplate?(f=o.jsx(jr,{children:o.jsx(mp,{deepLinkPage:{pageId:m.contentPageId,path:m.contentPath,pathTemplate:m.contentPathTemplate}})}),e[21]=m.contentPageId,e[22]=m.contentPath,e[23]=m.contentPathTemplate,e[24]=f):f=e[24],f}export{hc as $,Gm as A,qm as B,Qm as C,gm as D,dt as E,Ym as F,Cc as G,Wc as H,Md as I,Xc as J,Wm as K,ii as L,Ga as M,Ba as N,Ht as O,to as P,Tm as Q,Hm as R,ld as S,td as T,Am as U,_m as V,rn as W,ad as X,rd as Y,fc as Z,gc as _,fm as a,Eo as a0,xc as a1,Fe as a2,bc as a3,Cm as a4,wm as a5,Nm as a6,Pm as a7,vm as a8,Qc as a9,bm as aA,ym as aB,Im as aC,Km as aD,Mm as aE,xt as aF,zm as aG,Fm as aH,Lm as aI,Vm as aJ,Xs as aK,Zc as aa,cd as ab,ud as ac,so as ad,jm as ae,Ha as af,Ya as ag,Me as ah,Dm as ai,km as aj,qs as ak,Sm as al,Em as am,cs as an,$n as ao,Ws as ap,Bm as aq,Om as ar,Id as as,Mc as at,Jm as au,Zu as av,mi as aw,Vc as ax,Ed as ay,za as az,xo as b,cn as c,Fc as d,Ue as e,xm as f,gt as g,$m as h,$c as i,Um as j,hm as k,La as l,ln as m,tc as n,Ge as o,Xt as p,ti as q,ul as r,Gc as s,ni as t,ka as u,Rm as v,Zs as w,Oa as x,Xm as y,qa as z};
|