decocms 4.500.7 → 4.501.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-DHLjYBHG.js → ActiveShapeUtils-D-fL_h7g.js} +1 -1
- package/dist/client/assets/{AlertCircle-BILwGqjV.js → AlertCircle-D3bAofoi.js} +1 -1
- package/dist/client/assets/{AreaChart-MBaQ2sXA.js → AreaChart-BkD3ldvt.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DlRqrbst.js → ArrowLeft-Cdobx1UV.js} +1 -1
- package/dist/client/assets/{ArrowUp-CFc2wNu3.js → ArrowUp-D_3dn5Sd.js} +1 -1
- package/dist/client/assets/{BarChart-ip63zVKP.js → BarChart-DdPh9tNP.js} +1 -1
- package/dist/client/assets/{Building02-QB_UI3sB.js → Building02-Bh6iwr2R.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CD4E_XC5.js → CategoricalChart-tLM_K2Lc.js} +1 -1
- package/dist/client/assets/{CheckCircle-CG1RvCMD.js → CheckCircle-BQiYUYV1.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-23OZgHQl.js → ChevronSelectorVertical-CpMmf6o-.js} +1 -1
- package/dist/client/assets/{ChevronUp-BrMcnDd0.js → ChevronUp-CfnfCq3M.js} +1 -1
- package/dist/client/assets/{Copy01-QpufVNbj.js → Copy01-CKF8jrEa.js} +1 -1
- package/dist/client/assets/{CreditCard01-W1zS1W7o.js → CreditCard01-B4jz404y.js} +1 -1
- package/dist/client/assets/{DotsVertical-E-CAHxZx.js → DotsVertical-BVuRRGqu.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DoXCMhKl.js → ErrorBarContext-D3QRg5_X.js} +1 -1
- package/dist/client/assets/{Globe04-C2IFbCwJ.js → Globe04-CfnS-Tur.js} +1 -1
- package/dist/client/assets/{Image01-D8Dg78Ju.js → Image01-C6EZAhw4.js} +1 -1
- package/dist/client/assets/{Key01-CCpcNn9J.js → Key01-C3bTgL7y.js} +1 -1
- package/dist/client/assets/{Link01-Dw-VkUVV.js → Link01-Bb9ZHTO8.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BBYM52IU.js → LinkBroken01-BbLhCJ9C.js} +1 -1
- package/dist/client/assets/{Monitor01-596xyLh3.js → Monitor01-BT48-O3V.js} +1 -1
- package/dist/client/assets/{Play-CIe1tupB.js → Play-DlM8u9Zn.js} +1 -1
- package/dist/client/assets/{Plus-DTyq8wfJ.js → Plus-h-7fG8-i.js} +1 -1
- package/dist/client/assets/{SearchMd-DnZ_sK_U.js → SearchMd-DdAgg3kt.js} +1 -1
- package/dist/client/assets/{Sector-iSjEHRg-.js → Sector-udGfVqY9.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Brrt7Bh6.js → ShoppingBag01-gtt6oc_g.js} +1 -1
- package/dist/client/assets/{Sun-BmhcFIJl.js → Sun-D0bMmBqD.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B5sfCWHV.js → SwitchHorizontal01-mzV8h1Yb.js} +1 -1
- package/dist/client/assets/{Tool01-BSpg9N8Q.js → Tool01-BOGFE1PW.js} +1 -1
- package/dist/client/assets/{Trash01-uPItCfKQ.js → Trash01-BKZKll81.js} +1 -1
- package/dist/client/assets/{Upload01-ClSeM0gf.js → Upload01-ClJbirSb.js} +1 -1
- package/dist/client/assets/{User01-DabbLHAZ.js → User01-jcmfLZ4a.js} +1 -1
- package/dist/client/assets/{UserSquare-BXjBRbTF.js → UserSquare-Dnl3alN_.js} +1 -1
- package/dist/client/assets/{Users01-Dt36FENA.js → Users01-DBt3BOu-.js} +1 -1
- package/dist/client/assets/{XAxis-BQtU7n4v.js → XAxis-DWTEKRSO.js} +1 -1
- package/dist/client/assets/{XClose-BMDlg-34.js → XClose-DtCD4hEo.js} +1 -1
- package/dist/client/assets/{ZoomOut-Bnst3wtU.js → ZoomOut-C-oiWFtM.js} +1 -1
- package/dist/client/assets/{access-gate-BnarIuC9.js → access-gate-Bs83GnN9.js} +1 -1
- package/dist/client/assets/add-connection-dialog-CkfM8RAE.js +1 -0
- package/dist/client/assets/agent-analytics-PkbYclRB.js +2 -0
- package/dist/client/assets/agent-app-Dq_KNzND.js +1 -0
- package/dist/client/assets/agent-assets-BSNQs1Q4.js +1 -0
- package/dist/client/assets/agent-automation-CYLhaLQV.js +20 -0
- package/dist/client/assets/agent-automations-CylXZmQz.js +1 -0
- package/dist/client/assets/agent-connect-sources-gehkSGol.js +1 -0
- package/dist/client/assets/agent-deck-CB0RXEGe.js +1 -0
- package/dist/client/assets/agent-e2e-gcrRg7hM.js +1 -0
- package/dist/client/assets/agent-experiments-CMJUnUoe.js +1 -0
- package/dist/client/assets/agent-file-JLVKcoj6.js +1 -0
- package/dist/client/assets/agent-hosting-AV1ldWsd.js +1 -0
- package/dist/client/assets/{agent-icon-BdZdLCky.js → agent-icon-D1bIPwJ9.js} +1 -1
- package/dist/client/assets/agent-library-ChYqVk94.js +1 -0
- package/dist/client/assets/agent-library-file-5NiMKcJU.js +1 -0
- package/dist/client/assets/agent-monitor-DCEK-_YE.js +1 -0
- package/dist/client/assets/agent-overview-Bq6iylVc.js +1 -0
- package/dist/client/assets/agent-releases-0JQ-pNIw.js +2 -0
- package/dist/client/assets/agent-settings-DutqpeLT.js +1 -0
- package/dist/client/assets/agent-site-editor-DUVPLgUJ.js +27 -0
- package/dist/client/assets/agent-site-editor-code-Bs5iWgah.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DG0PHKu_.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-IbSFpbgz.js +1 -0
- package/dist/client/assets/agent-view-BMSjk6sE.js +1 -0
- package/dist/client/assets/agent-view-guard-B0ssprgS.js +1 -0
- package/dist/client/assets/{agents-list-qSpN3sGU.js → agents-list-CL_HbBRx.js} +1 -1
- package/dist/client/assets/{ai-providers-DwrXOrzh.js → ai-providers-mazNpep3.js} +1 -1
- package/dist/client/assets/{alert-Tk2m0Iz_.js → alert-Bo4bO9Yj.js} +1 -1
- package/dist/client/assets/{alert-dialog-By0HRTrM.js → alert-dialog-BEUBWKqO.js} +2 -2
- package/dist/client/assets/{analytics-sections-BjYHHt7V.js → analytics-sections-DM3YuBYq.js} +1 -1
- package/dist/client/assets/api-keys-BfQZh5eV.js +1 -0
- package/dist/client/assets/{api-keys-DaMqNdv1.js → api-keys-DVwB6mPs.js} +1 -1
- package/dist/client/assets/app-editor-6HFiMwKn.js +1 -0
- package/dist/client/assets/{asset-utils-Cne_zeGQ.js → asset-utils-f7af-ti1.js} +1 -1
- package/dist/client/assets/{auth-CTn9OsYL.js → auth-CpMllKKy.js} +1 -1
- package/dist/client/assets/{auth-catchall-CMbAfThb.js → auth-catchall-s5AR8jnh.js} +1 -1
- package/dist/client/assets/auth-entry-DhhGCuwo.js +1 -0
- package/dist/client/assets/{auth-split-layout--aU7QLNo.js → auth-split-layout-CVNIUCsf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-bcqFV5Ih.js → authenticate-and-persist-oauth-B45I3cgI.js} +1 -1
- package/dist/client/assets/{automation-list-row-3u6JAmgN.js → automation-list-row-sOJZ4uwa.js} +1 -1
- package/dist/client/assets/{automation-runs-Cy2qWf8T.js → automation-runs-CR9XH4Bt.js} +1 -1
- package/dist/client/assets/{automations-B06cv6_Q.js → automations-KO9N3LUU.js} +1 -1
- package/dist/client/assets/{autosend-Cr5TlS-x.js → autosend-BPCdEy8S.js} +1 -1
- package/dist/client/assets/{avatar-DNs314ny.js → avatar-BwGV1yBo.js} +1 -1
- package/dist/client/assets/{badge-BDMYkxf_.js → badge-DZi2puxG.js} +1 -1
- package/dist/client/assets/{block-document-BkfPgGlg.js → block-document-DKS5cj35.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-D5JWaTS4.js → blocks-preview-workspace-context-CDjfxqPx.js} +1 -1
- package/dist/client/assets/blocks-tab-states-CdRfYXjG.js +20 -0
- package/dist/client/assets/blog-schema-DQu9FHji.js +1 -0
- package/dist/client/assets/{board-analytics-B8AHF8AB.js → board-analytics-Br92I9NK.js} +1 -1
- package/dist/client/assets/{buckets-CUa7QjX3.js → buckets-BJOMOAgi.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-l6jHAadC.js → build-improve-prompt-doc-DrFz7LF_.js} +1 -1
- package/dist/client/assets/{calendar-9HE_r4Hw.js → calendar-evfJy3uJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-DVDKy7cm.js → capability-load-error-vW3f0aqj.js} +1 -1
- package/dist/client/assets/category-editor-QytvoXKo.js +1 -0
- package/dist/client/assets/{chart-n7qVLeZu.js → chart-yXoVtu1q.js} +1 -1
- package/dist/client/assets/chat-context-lAP9vX1C.js +39 -0
- package/dist/client/assets/{chat-draft-Bi-CpEK_.js → chat-draft-DVJc17WV.js} +1 -1
- package/dist/client/assets/{checkbox-jukyyas4.js → checkbox-DcDvQwKW.js} +1 -1
- package/dist/client/assets/{choose-editor-BpukaXWx.js → choose-editor-B0ViIXN7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-ZwkiiHM_.js → cli-auth-success-CKu92ul9.js} +1 -1
- package/dist/client/assets/{client-icons-CI6qGlDq.js → client-icons-DV_DZLb3.js} +1 -1
- package/dist/client/assets/cms-settings-editor-Cz5yTS8J.js +1 -0
- package/dist/client/assets/{collapsible-CSMgVqT4.js → collapsible-BvvJbkUN.js} +1 -1
- package/dist/client/assets/collection-detail-gDWElNf6.js +1 -0
- package/dist/client/assets/{collection-display-button-DfzaspAg.js → collection-display-button-CX9hkCzp.js} +1 -1
- package/dist/client/assets/{collection-search-q0ogFMFh.js → collection-search-ChJFrp7I.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dnaf2KFs.js → collection-table-wrapper-S14li0ck.js} +1 -1
- package/dist/client/assets/{collection-tabs-CYgVG041.js → collection-tabs-CSxs3D41.js} +1 -1
- package/dist/client/assets/{column-rules-BDs9HTxP.js → column-rules-GXfmm3XY.js} +2 -2
- package/dist/client/assets/{combobox-BTfHieW4.js → combobox-C7I8ANxO.js} +1 -1
- package/dist/client/assets/{command-DFd1c5Z5.js → command-3UFu4XzT.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-4lkaw_O0.js → companion-mcps-section-B4r6rXjT.js} +1 -1
- package/dist/client/assets/{config-CtmGoERx.js → config-CXc91so8.js} +1 -1
- package/dist/client/assets/{connect-CmDZNw9R.js → connect-CyItQRMN.js} +3 -3
- package/dist/client/assets/{connect-layout-CC9olkOl.js → connect-layout-C_C_fSz7.js} +1 -1
- package/dist/client/assets/{connection-DSkv8Cg1.js → connection-C37KtOpn.js} +1 -1
- package/dist/client/assets/{connection-card-C7Yq5GHs.js → connection-card-BZTmMkIC.js} +1 -1
- package/dist/client/assets/connection-detail-D0FXWtUX.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BsU6F-s_.js → connection-form-helpers-DxBwDmAB.js} +1 -1
- package/dist/client/assets/connections-D-s5sSvb.js +1 -0
- package/dist/client/assets/content-tab-zP6Y355z.js +8 -0
- package/dist/client/assets/context-CXih-hDd.js +1 -0
- package/dist/client/assets/{context-menu-CYa4PKRJ.js → context-menu-BVwispbr.js} +1 -1
- package/dist/client/assets/{core.esm-lZvNzlYc.js → core.esm-CmRvLUZs.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-D-9YlOhY.js → create-organization-dialog-MkYGLytC.js} +1 -1
- package/dist/client/assets/daily-pulse-C5ZpC1Ja.js +1 -0
- package/dist/client/assets/device-hint-SeLRi17j.js +1 -0
- package/dist/client/assets/discover-CnNtsI6p.js +1 -0
- package/dist/client/assets/{domain-settings-BDouaDKh.js → domain-settings-C-ul_GpW.js} +1 -1
- package/dist/client/assets/{drawer-UzGeZrmC.js → drawer-BnxsVk9h.js} +1 -1
- package/dist/client/assets/{editor-KeKsFC14.js → editor-BcMzCvWI.js} +1 -1
- package/dist/client/assets/editor-classes-qOc25VDM.js +1 -0
- package/dist/client/assets/{empty-state-CvDYWxOG.js → empty-state-CLULH17h.js} +1 -1
- package/dist/client/assets/{empty-state-DdJZ_leg.js → empty-state-Csd3ZQCl.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CJhjAx3s.js → extract-connection-data-QezQYJtA.js} +1 -1
- package/dist/client/assets/{feature-gate-D5KGpIQ3.js → feature-gate-X9j31WTs.js} +1 -1
- package/dist/client/assets/{feature-paywall-nTUHasXJ.js → feature-paywall-CVHEJqfB.js} +1 -1
- package/dist/client/assets/{file-explorer-CcZkMQK3.js → file-explorer-CzlgH02W.js} +2 -2
- package/dist/client/assets/{file-preview-Ct2165jc.js → file-preview-Ddg0WJAM.js} +1 -1
- package/dist/client/assets/{file-share-button-DnzCcmZ2.js → file-share-button-D2qOTxL8.js} +2 -2
- package/dist/client/assets/{file-type-icon-C-_1hLql.js → file-type-icon-Bqf9C4DT.js} +1 -1
- package/dist/client/assets/flat-project-EkkB9kye.js +1 -0
- package/dist/client/assets/{folder-icon-CksigScx.js → folder-icon-CktDjbyx.js} +2 -2
- package/dist/client/assets/{form-D6DHFxsw.js → form-BLRuutWX.js} +1 -1
- package/dist/client/assets/format-time-CAj8AQXM.js +1 -0
- package/dist/client/assets/general-DAKv-uYe.js +1 -0
- package/dist/client/assets/home-BtntFMXr.js +1 -0
- package/dist/client/assets/hosted-publish-feedback-DnbP_2C-.js +1 -0
- package/dist/client/assets/{icon-button-d9uOvdxM.js → icon-button-08xWmNqW.js} +1 -1
- package/dist/client/assets/{index-BGz-w6Gg.js → index-3um-0YWE.js} +1 -1
- package/dist/client/assets/index-3yvbELIe.js +1 -0
- package/dist/client/assets/{index-COV2t6Wc.js → index-9WXzzgOS.js} +2 -2
- package/dist/client/assets/{index-MZuRM-ap.js → index-BOjNGNvg.js} +1 -1
- package/dist/client/assets/index-BgxfZN5I.js +243 -0
- package/dist/client/assets/index-BiU97Vx4.js +1 -0
- package/dist/client/assets/index-BvCsVc8L.js +2 -0
- package/dist/client/assets/{index-B0rouRMk.js → index-Ct9bVcsr.js} +1 -1
- package/dist/client/assets/{index-DCmQGiOV.js → index-DIK8YZFn.js} +2 -2
- package/dist/client/assets/{index-Dhdyv2s0.js → index-DJTmuPQQ.js} +1 -1
- package/dist/client/assets/{index-Cw6J2Hl5.js → index-DT37BMIF.js} +5 -5
- package/dist/client/assets/{index-JuyO8Sz3.js → index-Dhveikge.js} +1 -1
- package/dist/client/assets/index-Dss8yn2Y.js +1 -0
- package/dist/client/assets/{index-DyaBZBxm.js → index-DyeE93ho.js} +14 -14
- package/dist/client/assets/{index-B5IA1qMq.js → index-lUChgCue.js} +1 -1
- package/dist/client/assets/index-m9hX09uY.css +1 -0
- package/dist/client/assets/{index-redirect-CdLcLUA4.js → index-redirect-CHE6u4Cv.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-rUCOtzeA.js → infiniteQueryObserver-ClCiPTXN.js} +1 -1
- package/dist/client/assets/{infra-billing-CNFpdYUt.js → infra-billing-ChfVikin.js} +1 -1
- package/dist/client/assets/input-BSxNJ_GL.js +17 -0
- package/dist/client/assets/input-BwymrIPS.js +1 -0
- package/dist/client/assets/{integration-icon-DogZfPWq.js → integration-icon-DmnIXoLv.js} +1 -1
- package/dist/client/assets/{jira-icon-Bkx-ixmo.js → jira-icon-BLL3j9jm.js} +1 -1
- package/dist/client/assets/{label-Bqj_xjz9.js → label-CXUY_vfR.js} +1 -1
- package/dist/client/assets/{layout-z7Pz7phr.js → layout-DIeTUTU5.js} +1 -1
- package/dist/client/assets/legacy-agents-deep-BKyQMU33.js +1 -0
- package/dist/client/assets/legacy-main-redirect-BsoX6iN0.js +1 -0
- package/dist/client/assets/library-j3CGQ36X.js +1 -0
- package/dist/client/assets/{library-tab-0FXiesZx.js → library-tab-D2qgQui6.js} +4 -4
- package/dist/client/assets/{login-B4wTb5ls.js → login-E4QHNGwe.js} +1 -1
- package/dist/client/assets/{markdown-5DzLzA6E.js → markdown-b3WNjA4d.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DuGbCe-D.js → mcp-app-renderer-Cn4aCsu6.js} +2 -2
- package/dist/client/assets/{mcp-oauth-D_oaXY6E.js → mcp-oauth-C3NWluK_.js} +1 -1
- package/dist/client/assets/{mcp-oauth-tCidCN-u.js → mcp-oauth-RicpD0nY.js} +1 -1
- package/dist/client/assets/{members-CDM-83p9.js → members-BxD5PzHF.js} +1 -1
- package/dist/client/assets/{memory-0faJ-8hP.js → memory-C9XODnnD.js} +2 -2
- package/dist/client/assets/{mini-report-page-CrKZ4okq.js → mini-report-page-BIc8DpQB.js} +1 -1
- package/dist/client/assets/{mock-board-N392Vku2.js → mock-board-ohQUjnsi.js} +1 -1
- package/dist/client/assets/{monaco-editor-2Ci5R71u.js → monaco-editor-sh4I5RUd.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-BbxkYAB2.js → monitoring-stats-row-DV6G65vc.js} +1 -1
- package/dist/client/assets/{multi-select-CNHwKIXn.js → multi-select-B-4k-Bqg.js} +1 -1
- package/dist/client/assets/mustache-Ds0VW1db.js +4 -0
- package/dist/client/assets/{new-project-dialog-C5lJfUJ3.js → new-project-dialog-B1YWyUQY.js} +1 -1
- package/dist/client/assets/{oauth-callback-DGtqmz9D.js → oauth-callback-Dk0amXzl.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bhuh08e8.js → oauth-callback-ai-provider-yxTXgHsL.js} +1 -1
- package/dist/client/assets/{onboarding-D55kfuiq.js → onboarding-WAcQlT34.js} +1 -1
- package/dist/client/assets/openai-conversation-DdRGYa72.js +3 -0
- package/dist/client/assets/optimistic-project-sidebar-views-CX9xIBGl.js +1 -0
- package/dist/client/assets/{organization-choice-CUxHZSL3.js → organization-choice-ByF9jLiX.js} +1 -1
- package/dist/client/assets/{orgs-CPCdS87I.js → orgs-BQHW_eGH.js} +1 -1
- package/dist/client/assets/page-seo-form-CHn8Xad5.js +1 -0
- package/dist/client/assets/{pair-DjM6V7aG.js → pair-CUEfObr7.js} +8 -8
- package/dist/client/assets/{plan-ladder-gwROOTzi.js → plan-ladder-DCjrzFrn.js} +1 -1
- package/dist/client/assets/{popover-MLSOZysn.js → popover-C7Cokk1g.js} +1 -1
- package/dist/client/assets/post-calendar-8u0J9Dxw.js +1 -0
- package/dist/client/assets/post-editor-BzyUnSeO.js +2 -0
- package/dist/client/assets/{preview-content-Cuq13S1x.js → preview-content-DvIKkdby.js} +1 -1
- package/dist/client/assets/{preview-dialog-CP7wwQxY.js → preview-dialog-l7y7EMMl.js} +1 -1
- package/dist/client/assets/{preview-panel-DFRYD57I.js → preview-panel-BVF8JvLU.js} +1 -1
- package/dist/client/assets/preview-source-BsRLGWUP.js +1 -0
- package/dist/client/assets/preview-tab-DSXQiNWB.js +551 -0
- package/dist/client/assets/product-picker-dialog-D1HSCZY-.js +1 -0
- package/dist/client/assets/{profile-E9E7lNqo.js → profile-DLHHp5WU.js} +1 -1
- package/dist/client/assets/{project-app-view-CqnnpjCc.js → project-app-view-BwoWS8NM.js} +1 -1
- package/dist/client/assets/{project-feed-DI26nV5j.js → project-feed-Bb_IIsXz.js} +1 -1
- package/dist/client/assets/{project-icon-DsUbDdQC.js → project-icon-Dgrl5qpw.js} +1 -1
- package/dist/client/assets/project-reports-C-bRcSvJ.js +1 -0
- package/dist/client/assets/project-tasks-DDJFKuGl.js +1 -0
- package/dist/client/assets/{projects-CdLu99l3.js → projects-DRVKv_2I.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CO-mNXLv.js → projects-empty-state-CtZ_2AQk.js} +1 -1
- package/dist/client/assets/{prompts-CGIibyOn.js → prompts-BeeaQU8h.js} +1 -1
- package/dist/client/assets/record-editor-5RvQSHc4.js +1 -0
- package/dist/client/assets/redirect-editor-B1Nkj9GS.js +1 -0
- package/dist/client/assets/reports-BGfmbbJs.js +1 -0
- package/dist/client/assets/{reports-CKJQ8Zdg.js → reports-C5l1V9UL.js} +1 -1
- package/dist/client/assets/{reports-onboarding-UAs51Fs-.js → reports-onboarding-DP7Vd0T2.js} +1 -1
- package/dist/client/assets/{reports-tab-D-UL6Cu0.js → reports-tab-CtVbVcib.js} +2 -2
- package/dist/client/assets/{repositories-8LjwXVAZ.js → repositories-CbAg-Btm.js} +1 -1
- package/dist/client/assets/repository-binding-BFm9AVly.js +1 -0
- package/dist/client/assets/{repository-import-picker-D5xDiyD_.js → repository-import-picker-EyjACjb3.js} +1 -1
- package/dist/client/assets/{repository-picker-DExxlkis.js → repository-picker-CIkU8AaT.js} +1 -1
- package/dist/client/assets/{require-capability-DJr1iBd_.js → require-capability-BHXvQx1F.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dzef4Ao1.js → required-auth-layout-BWy4wi63.js} +1 -1
- package/dist/client/assets/{reset-password-CWozFngH.js → reset-password-BmnWobO1.js} +1 -1
- package/dist/client/assets/{resizable-UTJFKDGm.js → resizable-ojZdlQ3J.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CQA14gzS.js +1 -0
- package/dist/client/assets/review-settings-HBrPojjW.js +1 -0
- package/dist/client/assets/{roles-D_wIHL0X.js → roles-Dtyn_BZq.js} +1 -1
- package/dist/client/assets/route-BnPcnvQE.js +1 -0
- package/dist/client/assets/route-FIzJ_P0a.js +1 -0
- package/dist/client/assets/route-tGmKNjFY.js +1 -0
- package/dist/client/assets/sandbox-git-api-CRxdlhrN.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-BiADnqP0.js +1 -0
- package/dist/client/assets/{schema-kVE-1hbs.js → schema-C2wKusx1.js} +1 -1
- package/dist/client/assets/{schema-BKM3gR2B.js → schema-CP7YDlC2.js} +1 -1
- package/dist/client/assets/{scroll-area-1S72VGW0.js → scroll-area-eDDZTCNn.js} +1 -1
- package/dist/client/assets/{search-input-pTAwOtCG.js → search-input-Uw0JKwfe.js} +1 -1
- package/dist/client/assets/{search-toggle-DAU6nVmU.js → search-toggle-sm1qzFKh.js} +1 -1
- package/dist/client/assets/secret-ciphertext-CONJpmu9.js +1 -0
- package/dist/client/assets/{secret-picker-CDYFp1fc.js → secret-picker-60Shu074.js} +1 -1
- package/dist/client/assets/{secrets-B0srIKJq.js → secrets-BoqLiEya.js} +1 -1
- package/dist/client/assets/sections-editor-vaJsT4Ye.js +4 -0
- package/dist/client/assets/{select-WviNHwZD.js → select-BFEZcGSl.js} +1 -1
- package/dist/client/assets/{select-model-cTObTD6V.js → select-model-DqlWeDem.js} +1 -1
- package/dist/client/assets/seo-editor-CH8U1dHr.js +1 -0
- package/dist/client/assets/{separator-DHqK6uc1.js → separator-B8-QmvpR.js} +1 -1
- package/dist/client/assets/settings-tab-CKwbS1hi.js +4 -0
- package/dist/client/assets/{sheet-CZiDNUQZ.js → sheet-Nq7jp8TZ.js} +1 -1
- package/dist/client/assets/shell-layout-D6cRROrP.js +1 -0
- package/dist/client/assets/site-editor-BZvWDg3I.js +1 -0
- package/dist/client/assets/site-editor-toast-DKv6_ydN.js +1 -0
- package/dist/client/assets/{skills-Bhf5PJUl.js → skills-D12rIMUM.js} +1 -1
- package/dist/client/assets/{slider-gvEbcdOp.js → slider-DDXbeLEV.js} +1 -1
- package/dist/client/assets/{sortable.esm-h3AYG-u7.js → sortable.esm-B6I_GSlr.js} +1 -1
- package/dist/client/assets/{sso-B6q4MTEL.js → sso-BlG3mIxu.js} +1 -1
- package/dist/client/assets/{suggestion-C591DFAx.js → suggestion-BDdps7f5.js} +2 -2
- package/dist/client/assets/{switch-CUK4V52q.js → switch-fTPKFxtt.js} +1 -1
- package/dist/client/assets/{symbol-BQaHJ_MF.js → symbol-DzslO63t.js} +1 -1
- package/dist/client/assets/{synced-repos-BbxE1rvi.js → synced-repos-BoksOfkS.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-D8Um0oDf.js → tab-icon-glyph-B_Nx9b90.js} +1 -1
- package/dist/client/assets/{table-Dsl6wBVe.js → table-DM6c5ztx.js} +1 -1
- package/dist/client/assets/{tabs-BXhvcQgN.js → tabs-_ffnq5EI.js} +1 -1
- package/dist/client/assets/{task-board-kbcRVMI1.js → task-board-3mxTKXc4.js} +1 -1
- package/dist/client/assets/{task-route-BPrIj9mX.js → task-route-Bd7_oRze.js} +1 -1
- package/dist/client/assets/{task-status-codqNsI7.js → task-status-DobFUFUP.js} +1 -1
- package/dist/client/assets/taskboard-analytics-BqoskKtI.js +1 -0
- package/dist/client/assets/{tasks-J75byAMf.js → tasks-8erS0IrD.js} +3 -3
- package/dist/client/assets/tasks-SfkUPw6i.js +1 -0
- package/dist/client/assets/{textarea-DvoMwt1e.js → textarea-DuXoEX68.js} +1 -1
- package/dist/client/assets/thread-analytics-DRN0lWXv.js +1 -0
- package/dist/client/assets/{thread-intent-CG-CCDLs.js → thread-intent-CNERxhpd.js} +6 -6
- package/dist/client/assets/{thread-route-DvTW6luy.js → thread-route-B1yKR26I.js} +1 -1
- package/dist/client/assets/{thread-route-CR0TIP8s.js → thread-route-Ctf783T8.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BAmHmw0m.js → thread-sheet-body-BOzE-wDr.js} +1 -1
- package/dist/client/assets/{time-range-picker-CPMdzMas.js → time-range-picker-CTRRThMq.js} +1 -1
- package/dist/client/assets/{toggle-group-Q9SREgL7.js → toggle-group-Cfs_-SSG.js} +1 -1
- package/dist/client/assets/{tool-namespace-uRsPbj-p.js → tool-namespace-D2ik4cAJ.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Djr5zvaV.js → toolbar-icon-button-CPspdKt4.js} +1 -1
- package/dist/client/assets/{tooltip-COqLwkid.js → tooltip-IZurjemL.js} +1 -1
- package/dist/client/assets/{tooltipContext-DDD6cP5q.js → tooltipContext-D100ISAz.js} +1 -1
- package/dist/client/assets/{track-DG4JP_WA.js → track-Dgx71QRR.js} +1 -1
- package/dist/client/assets/{types-C5SQt0XZ.js → types-BE1SardL.js} +10 -10
- package/dist/client/assets/{url-slug-CUhgOgGc.js → url-slug-CwNPw3b4.js} +1 -1
- package/dist/client/assets/{usage-stats-CAukzrpg.js → usage-stats-CG9oV0kb.js} +34 -34
- package/dist/client/assets/{use-ai-providers-IjG3zzka.js → use-ai-providers-CPzOGdQy.js} +1 -1
- package/dist/client/assets/use-app-takeover-l9YncUZ0.js +1 -0
- package/dist/client/assets/{use-automations-Dt8Ypk0g.js → use-automations-B6o4Nbzc.js} +1 -1
- package/dist/client/assets/{use-autosave-CiBl7wSO.js → use-autosave-DPNBZc_p.js} +1 -1
- package/dist/client/assets/use-chat-navigation-Do_KkN8I.js +1 -0
- package/dist/client/assets/{use-clock-tick-zaL95TTy.js → use-clock-tick-BnfclhFE.js} +1 -1
- package/dist/client/assets/{use-connect-companion-CRI0nNcp.js → use-connect-companion-BPMXolOl.js} +1 -1
- package/dist/client/assets/{use-connection-gMb_8zEe.js → use-connection-DS1VAR5N.js} +1 -1
- package/dist/client/assets/{use-copy-2j0k06rN.js → use-copy-C8TWXH-H.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bz6TE2Qz.js → use-create-virtual-mcp-CeEuYNMP.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BPq8VLDt.js → use-date-fns-locale-D3qFWxxv.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CMA_1eXM.js → use-debounced-autosave-DsoI68di.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Dju-tMu1.js → use-debounced-value-KpwtUdsd.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BtvhFk4m.js → use-deco-credits-DscUzXq9.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D8zpT0sX.js → use-decopilot-events-D8UIooCs.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BXDiC_mk.js → use-delete-connection-Dnzv3Wbz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CXT7CFHy.js → use-deployment-admin-P_SogPj1.js} +1 -1
- package/dist/client/assets/use-ensure-project-folder-Dom2nmkC.js +1 -0
- package/dist/client/assets/use-fast-preview-draft-url-DnHFw81T.js +1 -0
- package/dist/client/assets/use-file-configs-Cv2mXUdp.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-CtScOz_h.js → use-infinite-scroll-CuKgvt7b.js} +1 -1
- package/dist/client/assets/{use-join-requests-CccLwL3-.js → use-join-requests-cLAvpRra.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-B0dFgvCE.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-Is2pR00q.js → use-mcp-auth-status-DaPeILTX.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DuTNn1dc.js → use-mcp-client-CU2kDBXP.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-3vLSpQqZ.js → use-mcp-prompts-CdDXQMlf.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CA6Ri5UK.js → use-mcp-tools-CyHq-JFp.js} +1 -1
- package/dist/client/assets/{use-members-BqWTpMNp.js → use-members-CkpNHwM6.js} +1 -1
- package/dist/client/assets/{use-mobile-Di3PCVWm.js → use-mobile-DNDEd3kt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cu9cZhs8.js → use-navigate-to-agent-JTDphVE0.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-sjDwQSEM.js → use-open-billing-url-2Iqpie3T.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DIUzAE5u.js → use-org-auth-client-Bwzj9WuC.js} +1 -1
- package/dist/client/assets/{use-org-fs-DOu4nQSr.js → use-org-fs-Cg7EJCYS.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BhJEcVcm.js → use-org-repo-syncs-D4j72pCa.js} +1 -1
- package/dist/client/assets/{use-org-sso-B57pfGVG.js → use-org-sso-CMfwXvs9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DDnFx_jd.js → use-organization-roles-DPDTJ01F.js} +1 -1
- package/dist/client/assets/use-organization-settings-BMIqQlbM.js +1 -0
- package/dist/client/assets/{use-panel-navigate-c5H4a21L.js → use-panel-navigate-CL5hztR3.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-CBbSdoTE.js +1 -0
- package/dist/client/assets/{use-project-scope-A4YCdR4N.js → use-project-scope-DqbIN7fa.js} +1 -1
- package/dist/client/assets/use-recent-apps-Beu6vFHw.js +1 -0
- package/dist/client/assets/use-releases-Bfs5MNEe.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-Dw_QzpEb.js → use-reports-diagnostic-QSfTgm94.js} +1 -1
- package/dist/client/assets/{use-secrets-BwPjhWC0.js → use-secrets-BaG_Hkwz.js} +1 -1
- package/dist/client/assets/use-section-preview-base-DUXeQAGw.js +1 -0
- package/dist/client/assets/{use-tags-Ce3D-sM7.js → use-tags-BWRD1El7.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BR7NSR26.js → use-task-board-analytics-Bkf73btp.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BBlz-cBe.js → use-task-board-events-CLNIzDoN.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BzAFAQp8.js → use-task-board-item-prs-Bh5krZjb.js} +1 -1
- package/dist/client/assets/{use-task-board-items-DTbT7rEp.js → use-task-board-items-zobNU9xE.js} +1 -1
- package/dist/client/assets/use-task-metadata-Bsl_Cezz.js +1 -0
- package/dist/client/assets/{use-thread-analytics-CeuE3odS.js → use-thread-analytics-CdWNwDDd.js} +1 -1
- package/dist/client/assets/use-thread-outputs-BkgKa2EX.js +1 -0
- package/dist/client/assets/useInfiniteQuery-pEq0vd9s.js +1 -0
- package/dist/client/assets/{useQueries-BliyNTtT.js → useQueries-E-2AGLRt.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BQsEFgzv.js +1 -0
- package/dist/client/assets/{users-CsvLtEUJ.js → users-L9Rh2Jo7.js} +1 -1
- package/dist/client/assets/{utils-DHYRJNUn.js → utils-Dx9iFvKJ.js} +1 -1
- package/dist/client/assets/variant-calendar-CkKYqTGY.js +1 -0
- package/dist/client/assets/variant-draft-pointer-CSAndyah.js +1 -0
- package/dist/client/assets/{view-mode-toggle-B55pxnK_.js → view-mode-toggle-DxuIXC_C.js} +1 -1
- package/dist/client/assets/virtual-mcp-D7evpUlE.js +1 -0
- package/dist/client/assets/{watch-sse-pool-B66Eygyb.js → watch-sse-pool-Bs34dRKl.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/migrate-dbos.js +1 -1
- package/dist/server/migrate.js +42 -42
- package/dist/server/server.js +777 -737
- package/package.json +2 -1
- package/dist/client/assets/add-connection-dialog-BB_zBu7s.js +0 -1
- package/dist/client/assets/agent-analytics-DJ6OqUua.js +0 -2
- package/dist/client/assets/agent-app-6ZZFFR6d.js +0 -1
- package/dist/client/assets/agent-assets-BHKSbhmH.js +0 -1
- package/dist/client/assets/agent-automation-BEmy5bSr.js +0 -20
- package/dist/client/assets/agent-automations-p8P_f3PC.js +0 -1
- package/dist/client/assets/agent-connect-sources-DHxXXvzx.js +0 -1
- package/dist/client/assets/agent-deck-kxbwQZGK.js +0 -1
- package/dist/client/assets/agent-e2e-BPE2bY36.js +0 -1
- package/dist/client/assets/agent-experiments-ChC-SJXX.js +0 -1
- package/dist/client/assets/agent-file-BFxmR6QX.js +0 -1
- package/dist/client/assets/agent-hosting-BV7C2pVl.js +0 -1
- package/dist/client/assets/agent-library-dgFnuWrg.js +0 -1
- package/dist/client/assets/agent-library-file-LGRVpT_Z.js +0 -1
- package/dist/client/assets/agent-monitor-CbF33zT0.js +0 -1
- package/dist/client/assets/agent-overview-CiiRxzYe.js +0 -1
- package/dist/client/assets/agent-settings-CFC23BeV.js +0 -1
- package/dist/client/assets/agent-site-editor-Dq16bHz8.js +0 -25
- package/dist/client/assets/agent-site-editor-code-B3URMZgm.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CbMNndHb.js +0 -8
- package/dist/client/assets/agent-site-editor-preview-Dy_HN_0a.js +0 -551
- package/dist/client/assets/agent-view-AaYNRrLl.js +0 -1
- package/dist/client/assets/agent-view-guard-CShYlKBB.js +0 -1
- package/dist/client/assets/api-keys-CvurWoww.js +0 -1
- package/dist/client/assets/app-editor-Dtvslmpt.js +0 -1
- package/dist/client/assets/auth-entry-CcnG-745.js +0 -1
- package/dist/client/assets/blog-schema-Qz918NIm.js +0 -1
- package/dist/client/assets/category-editor-w7_HM15g.js +0 -1
- package/dist/client/assets/chat-context-DszOftwV.js +0 -39
- package/dist/client/assets/claim-phase-copy-gKkPnPW4.js +0 -1
- package/dist/client/assets/collection-detail-D7Eq0q0A.js +0 -1
- package/dist/client/assets/connection-detail-DVH9ilyh.js +0 -1
- package/dist/client/assets/connections-BMBv6B3A.js +0 -1
- package/dist/client/assets/context-B_2GuX3F.js +0 -1
- package/dist/client/assets/daily-pulse-CSM9zceR.js +0 -1
- package/dist/client/assets/device-hint-DPN31B5L.js +0 -1
- package/dist/client/assets/discover-DvrfCZMt.js +0 -1
- package/dist/client/assets/flat-project-Dhd407Mb.js +0 -1
- package/dist/client/assets/format-time-CjIPQhCN.js +0 -1
- package/dist/client/assets/general-CeTNWbSz.js +0 -1
- package/dist/client/assets/home-B3luwcfX.js +0 -1
- package/dist/client/assets/index-DHd9v6HB.js +0 -1
- package/dist/client/assets/index-DQO0lnZr.css +0 -1
- package/dist/client/assets/index-bl_DQ3mH.js +0 -243
- package/dist/client/assets/index-zYf8hP69.js +0 -1
- package/dist/client/assets/input-B6YAOx07.js +0 -17
- package/dist/client/assets/input-C1msyAUz.js +0 -1
- package/dist/client/assets/legacy-agents-deep-fygb-JNd.js +0 -1
- package/dist/client/assets/legacy-main-redirect-BKIEGtd4.js +0 -1
- package/dist/client/assets/library-BgLLAz_1.js +0 -1
- package/dist/client/assets/mustache-B7TZyK91.js +0 -4
- package/dist/client/assets/openai-conversation-C4Qt6S-l.js +0 -3
- package/dist/client/assets/optimistic-project-sidebar-views-CoZosNmn.js +0 -1
- package/dist/client/assets/page-seo-form-DdXyS1MG.js +0 -1
- package/dist/client/assets/post-calendar-Dr7XWigd.js +0 -1
- package/dist/client/assets/post-editor-CKCVg_my.js +0 -2
- package/dist/client/assets/product-picker-dialog-DuFOtAE-.js +0 -1
- package/dist/client/assets/project-reports-UVwSbHHJ.js +0 -1
- package/dist/client/assets/project-tasks-DuMsfpY5.js +0 -1
- package/dist/client/assets/record-editor-ceYt0p4C.js +0 -1
- package/dist/client/assets/redirect-editor-Ca575ToY.js +0 -1
- package/dist/client/assets/reports-y_yDpDn4.js +0 -1
- package/dist/client/assets/repository-binding-BTsmo_dA.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DqCiaIA7.js +0 -1
- package/dist/client/assets/review-settings-THwrc5M3.js +0 -1
- package/dist/client/assets/rich-text-link-control-CNQ92nZ4.js +0 -1
- package/dist/client/assets/route-CfEJDbbT.js +0 -1
- package/dist/client/assets/route-DD4978oF.js +0 -1
- package/dist/client/assets/route-e2YuR4Xl.js +0 -1
- package/dist/client/assets/runnable-block-editor-fWbFWGvz.js +0 -17
- package/dist/client/assets/sandbox-git-api-C7JbVL7R.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-C25F7mSK.js +0 -1
- package/dist/client/assets/sections-editor-B5MFR1yl.js +0 -4
- package/dist/client/assets/seo-editor-DCKDCOQr.js +0 -1
- package/dist/client/assets/settings-tab-fdKZYnq9.js +0 -4
- package/dist/client/assets/shell-layout-Bk6uPKMe.js +0 -1
- package/dist/client/assets/taskboard-analytics-xeHAgwnO.js +0 -1
- package/dist/client/assets/tasks-Ba-oyyIK.js +0 -1
- package/dist/client/assets/thread-analytics-C0BM4p9K.js +0 -1
- package/dist/client/assets/thread-button-DKjUerzt.js +0 -1
- package/dist/client/assets/use-chat-layout-state-CVkPEEUs.js +0 -1
- package/dist/client/assets/use-chat-navigation-DLnmXNT9.js +0 -1
- package/dist/client/assets/use-ensure-project-folder-CqaPdVz-.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-DlLnA8PJ.js +0 -1
- package/dist/client/assets/use-file-configs-BSnoYr1R.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-O3Jy3Qh8.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-D9sV9o2T.js +0 -1
- package/dist/client/assets/use-organization-settings-BOGRgJjV.js +0 -1
- package/dist/client/assets/use-releases-BmeSCMgM.js +0 -1
- package/dist/client/assets/use-sandbox-events-hhwp2IWJ.js +0 -2
- package/dist/client/assets/use-section-preview-base-B7bjCuOw.js +0 -1
- package/dist/client/assets/use-task-metadata-CBQ5Muu5.js +0 -1
- package/dist/client/assets/use-thread-outputs-c6b1HaAz.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DeMEFTdd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CUkGf5w6.js +0 -1
- package/dist/client/assets/variant-calendar-CKqGYdH4.js +0 -1
- package/dist/client/assets/variant-matcher-override-uklREcGs.js +0 -1
- package/dist/client/assets/virtual-mcp-DFjD0qBz.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./sandbox-url-D3mC8qhT.js";function i(e,n){return y(e,`git/${n}`)}class u extends Error{constructor(n,t){super(n),this.status=t,this.name="SandboxGitError"}status}function R(e){return e instanceof u&&(e.status===503||e.status===410||e.status===404)}function b(e,n){return n instanceof u&&n.status===429?!1:e<1}async function s(e){let n;try{n=await e.json()}catch{throw new u(`Request failed (${e.status})`,e.status)}if(!e.ok)throw new u(typeof n.error=="string"?n.error:`Request failed (${e.status})`,e.status);return n}function o(e,n){return fetch(e,{cache:"no-store",...n})}async function m(e){const n=await o(i(e,"status"),void 0);return s(n)}async function l(e,n){const t=await o(i(e,"diff"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...n?.base?{base:n.base}:{},...n?.headSha?{headSha:n.headSha}:{}})});return s(t)}function S(e){const n={};for(const[t,r]of Object.entries(e.diffs))c(t)||f(t)||(n[t]=r);return{...e,diffs:n}}async function J(e,n){const t=await o(i(e,"publish"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:n})});await s(t)}async function W(e,n){const t=await o(i(e,"rebase"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({base:n})});await s(t)}function c(e){return e==="blocks.gen.json"||e.endsWith("/blocks.gen.json")}function f(e){return e==="static/tailwind.css"||e.endsWith("/static/tailwind.css")}function O(e){return c(e)||f(e)||e.endsWith("generate.digests.json")||e.endsWith("meta.gen.json")}function P(e){return e?e.conflicted.length>0||e.renamed.length>0?!0:[...e.modified,...e.created,...e.deleted,...e.not_added,...e.staged].some(n=>!O(n)):!1}function q(e){return e?!P(e)&&(e.aheadOfBase??0)===0&&(e.unpushed??0)===0:!1}function G(e){return e===".deco"||e.endsWith("/.deco")||e.startsWith(".deco/")||e.includes("/.deco/")}function d(e){return e.length===0?!1:e.every(n=>G(n)||c(n)||f(n))}function h(e){return e?d(Object.keys(e.diffs)):!1}const p="smart";function A(e){return e==="code-review"||e==="open"||e==="smart"?e:p}function C(e){let n=5381;const t=r=>{for(let a=0;a<r.length;a++)n=(n<<5)+n+r.charCodeAt(a)|0};for(const r of Object.keys(e.diffs).sort()){const a=e.diffs[r];t(r),t("\0from:"),t(a?.from??""),t("\0to:"),t(a?.to??""),t("\0\0")}return(n>>>0).toString(36)}async function E(e,n){const t=await o(i(e,"judge-review"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({status:n.status,diff:S(n.diff),...n.language?{language:n.language}:{}})});return s(t)}async function N(e,n){const t=await o(i(e,"discard"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({filepaths:n})});await s(t)}const j="current";function F(e){return e?.[j]??null}function T(e){return["sandbox-git-status",e.orgSlug,e.virtualMcpId,e.branch,e.threadId]}const x=5e3;function I(e){return{queryKey:T(e),queryFn:()=>m(e),staleTime:x,retry:b}}function D(e){return e?e.modified.length+e.created.length+e.deleted.length+e.not_added.length+e.renamed.length:0}function k(e){return e?D(e)>0||e.staged.length>0||e.conflicted.length>0:!1}function v(e,n){return{diffs:{...e?.diffs??{},...n?.diffs??{}},...e?.mergeBaseSha?{mergeBaseSha:e.mergeBaseSha}:{}}}function B(e){return e.aheadOfBase===void 0||e.aheadOfBase>0||e.ahead>0||(e.unpushed??0)>0}async function L(e,n,t,r){if(r?.fastPreview)return l(e,{base:t});const a=n.headSha?{base:t,headSha:n.headSha}:{base:t},[g,w]=await Promise.all([B(n)?l(e,a):null,k(n)?l(e):null]);return v(g,w)}function U(e,n="code-review"){return n==="open"?{allowed:!0,reason:null}:h(e)?{allowed:!0,reason:null}:{allowed:!1,reason:null}}function H(e,n){return e.length===0?{allowed:!1,reason:null}:n==="open"?{allowed:!0,reason:null}:d(e)?{allowed:!0,reason:null}:n==="smart"?{allowed:!1,reason:null,pending:!0}:{allowed:!1,reason:null}}function K(e,n){return n!=="smart"||!e||Object.keys(e.diffs).length===0?!1:!h(e)}function $(e,n){if(n)return{allowed:!1,reason:null,pending:!0};if(!e)return{allowed:!0,reason:null};if(!e.requiresReview)return{allowed:!0,reason:null};const t=e.reason?.trim();return{allowed:!1,reason:t||null}}export{L as a,W as b,R as c,N as d,E as e,m as f,H as g,k as h,O as i,U as j,$ as k,F as l,B as m,K as n,P as o,J as p,A as q,C as r,I as s,T as t,q as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as b,r as i,b4 as ie,b5 as ce,e as le,b6 as j,c as de,a2 as fe,J as Se,j as me}from"./index-bl_DQ3mH.js";import{u as pe}from"./use-mcp-client-DuTNn1dc.js";import{a as ye}from"./input-B6YAOx07.js";import{b as Ee,u as he}from"./chat-context-DszOftwV.js";import{u as Re}from"./thread-intent-CG-CCDLs.js";import{e as xe}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-hhwp2IWJ.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=b(t);return be({filters:{...e,status:"pending"}},n).length}function X(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function be(e={},t){const n=b(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=X(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(u=>n.subscribe(()=>{const a=ie(s.current,X(n,r.current));s.current!==a&&(s.current=a,ce.schedule(u))}),[n]),()=>s.current,()=>s.current)}async function Pe(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const q=["SANDBOX_START"],w=new Map,Ce=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),U=new Set,g={mark:(e,t)=>U.add(`${e}::${t}`),clear:(e,t)=>U.delete(`${e}::${t}`),isStopped:(e,t)=>U.has(`${e}::${t}`)};function _e(e,t){const n=b();return le({mutationKey:q,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>xe(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=Ce(r),u=w.get(s);if(u)return u;const a=(async()=>(await Pe(e,"SANDBOX_START",r)).structuredContent)();w.set(s,a);try{return await a}finally{w.get(s)===a&&w.delete(s)}},onSuccess:()=>{j(n),t?.onStarted?.()}})}function Me(e,t){const n=de.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:q,predicate:u=>{if(!e)return!1;const a=u.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function ge(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function We(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function De(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function ze(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,u=e.ownerId??r;if(!r||!u||!s)return t;const a=n?.[u]?.[s];return a?{...t??{},[r]:{...t?.[r]??{},[s]:a}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Y=2,Le=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return Le.has(e)}function Oe(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Y&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const $e={branch:null,count:0,handled:!1};function Be(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Ve(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function Q(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:Q(n,t.branch??r),url:t.previewUrl})}const Ne={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},M=i.createContext(Ne);function Ge(){return i.use(M)}function Ze({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:u,threadId:a,children:D}){const{org:L}=fe(),{setCurrentTaskBranch:l}=Ee(),W=Re(),p=we(),z=b(),O=ye(t),G=O.resolved?O.runtime:null,d=he()?.taskId??null,$=pe({connectionId:Se,orgId:L.id,orgSlug:L.slug}),c=_e($,{onStarted:()=>{a&&W?.refreshThreadMetadata(a)}}),{mutate:f,reset:Z}=c,[ee,S]=i.useState(null),P=i.useRef(new Set),C=i.useRef(null),[B,R]=i.useState($e),E=Be(B,n);E!==B&&R(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:u,seeded:y?null:ee,key:Q(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),te=p.status.state==="paused",ne=!y||!J(y.reason)||E.count>=Y,re=Ve({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:ne}),F=Ue({previewUrl:V,appPaused:te,userStopped:h,startError:re}),se=Fe(F),k=n??"",oe=P.current.has(k),v=ge({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:u,userStopped:h,isPending:c.isPending,attempted:oe,sessionRuntime:G});i.useEffect(()=>{if(!v||!t)return;P.current.add(k);const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] auto-start failed:",o)}})},[v,k,n,t,d,f,l,S]);const x=p.notFound?u?.sandboxHandle??null:null,N=De({executionEnabled:e,notFound:p.notFound,deadVmId:x,lastDeadVmId:C.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!N||!x||!t)return;C.current=x;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] self-heal failed:",o)}})},[N,x,t,n,d,f,l,S]);const I=Oe({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){R(o=>o.handled?{...o,handled:!1}:o);return}if(!I||!t)return;R(o=>({...o,handled:!0,count:o.count+1}));const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",o)}})},[y,I,t,n,d,f,l,S]);const _=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] user start failed:",o)}})},K=async()=>{if(!(!e||!t||!n)&&u){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}j(z)}},ae=async()=>{await K(),_()},H=()=>{P.current=new Set,C.current=null,R({branch:n,count:0,handled:!1}),Z(),_()},ue={branch:n,previewState:F,status:se,vmEntry:u,previewUrl:V,userStopped:h,start:_,stop:K,restart:ae,retry:H,resume:H};return me.jsx(M,{value:ue,children:D})}export{Ze as S,_e as a,Ge as b,Te as c,ze as o,We as s,Me as u};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as ft,b as Dt,r as w,l as le,j as o,b1 as _i,B as xt,U as Qt,au as ki,X as Ei,V as Ri,a as Ai,o as Ni,h as Ci,t as z,K as Ti}from"./index-bl_DQ3mH.js";import{u as Vi}from"./chat-context-DszOftwV.js";import{u as In}from"./use-new-blocks-editor-D9sV9o2T.js";import{J as Mi,K as Di,N as Pi,O as Ki,Q as Ii,T as Bi,U as Fi,V as Li,W as Oi,X as kr,Y as $i,Z as zi,G as jt,_ as vt,$ as ze,a0 as Hi,H as Tn,E as Vn,e as Wi,f as Gi,j as qi,u as Ui,a1 as Er,o as Yi,a2 as Ji,q as Qi,n as Xi,a3 as to,p as vn,a4 as Zi,a5 as ea,C as Rr,a6 as ta,a7 as na,a8 as Nn,a9 as Ar,aa as Nr,ab as Cr,ac as ss,ad as sa,ae as ra,F as oa,af as Tr,ag as ia,ah as Vr,ai as Mr,M as aa,aj as Dr,d as la,ak as mn,al as ca,am as ua,an as pn,ao as da}from"./runnable-block-editor-fWbFWGvz.js";import{c as fa}from"./repository-binding-BTsmo_dA.js";import{n as ma,t as pa}from"./ChevronUp-BrMcnDd0.js";import{a6 as no,d as Pn,ak as ha,C as ga,$ as Pr,K as Kr}from"./agent-icon-BdZdLCky.js";import{S as Xt}from"./scroll-area-1S72VGW0.js";import{b as wt,T as _t,a as kt}from"./tooltip-COqLwkid.js";import{m as va,u as xa,P as ya}from"./mustache-B7TZyK91.js";import{au as so,c as xs,av as ro,G as ba,aw as pt,ax as ls,ay as oo,ak as Ot,a8 as cs,az as us,al as Mt,a9 as Zt,j as Sa,l as ja,g as wa,r as Cn,ao as _a,aj as hn,aa as rs,ai as Vt,ah as gn,aA as ka,K as Ea,aB as Ra,am as Ir,a2 as Br,aC as Aa,aD as Lt,aE as Na,aF as Ca,aG as Ta,aH as Fr,aI as Va,aJ as Ma,aK as Da,ag as Pa,aL as Ka,aM as Ia,aN as Ba,X as Fa,aO as La,af as Oa,aP as $a}from"./claim-phase-copy-gKkPnPW4.js";import{a as za}from"./Copy01-QpufVNbj.js";import{a as ds,e as io}from"./UserSquare-BXjBRbTF.js";import{i as Lr}from"./Tool01-BSpg9N8Q.js";import{s as Or}from"./Image01-D8Dg78Ju.js";import{s as Ha}from"./Plus-DTyq8wfJ.js";import{s as Wa}from"./Trash01-uPItCfKQ.js";import{i as fs}from"./ZoomOut-Bnst3wtU.js";import{u as Ga,a as $r,K as qa,P as Ua,b as Ya,C as Ja,D as Qa,c as Xa}from"./core.esm-lZvNzlYc.js";import{u as Za,s as el,a as Mn,S as tl,v as nl}from"./sortable.esm-h3AYG-u7.js";import{A as zr}from"./avatar-DNs314ny.js";import{e as sl,d as Hr,b as rl,A as ol,a as il,f as al}from"./alert-dialog-By0HRTrM.js";import{d as ll}from"./shell-layout-Bk6uPKMe.js";import{a as cl,P as Wr,b as ul}from"./page-seo-form-DdXyS1MG.js";import{u as dl,A as fl}from"./use-section-preview-base-B7bjCuOw.js";import{b as Gr,a as ml}from"./variant-matcher-override-uklREcGs.js";import"./use-panel-navigate-c5H4a21L.js";import"./thread-route-CR0TIP8s.js";import"./use-project-scope-A4YCdR4N.js";import"./autosend-Cr5TlS-x.js";import"./thread-intent-CG-CCDLs.js";import"./use-mcp-client-DuTNn1dc.js";import"./auth-CTn9OsYL.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-B66Eygyb.js";import"./task-board-kbcRVMI1.js";import"./schema-kVE-1hbs.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-D8zpT0sX.js";import"./use-ai-providers-IjG3zzka.js";import"./use-chat-navigation-DLnmXNT9.js";import"./location-BjlyegC2.js";import"./use-organization-settings-BOGRgJjV.js";import"./input-B6YAOx07.js";import"./usage-stats-CAukzrpg.js";import"./tool-namespace-uRsPbj-p.js";import"./form-D6DHFxsw.js";import"./label-Bqj_xjz9.js";import"./utils-CVEq3hMx.js";import"./markdown-5DzLzA6E.js";import"./use-copy-2j0k06rN.js";import"./use-mobile-Di3PCVWm.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-BMDlg-34.js";import"./icon-button-d9uOvdxM.js";import"./file-type-icon-C-_1hLql.js";import"./chat-draft-Bi-CpEK_.js";import"./LinkBroken01-BBYM52IU.js";import"./ArrowUp-CFc2wNu3.js";import"./ShoppingBag01-Brrt7Bh6.js";import"./Upload01-ClSeM0gf.js";import"./AlertCircle-BILwGqjV.js";import"./select-WviNHwZD.js";import"./index-BdQq_4o_.js";import"./index-B5IA1qMq.js";import"./ArrowLeft-DlRqrbst.js";import"./tabs-BXhvcQgN.js";import"./use-deco-credits-BtvhFk4m.js";import"./toggle-group-Q9SREgL7.js";import"./use-open-billing-url-sjDwQSEM.js";import"./index-DCmQGiOV.js";import"./checkbox-jukyyas4.js";import"./ChevronSelectorVertical-23OZgHQl.js";import"./Key01-CCpcNn9J.js";import"./SearchMd-DnZ_sK_U.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-596xyLh3.js";import"./popover-MLSOZysn.js";import"./drawer-UzGeZrmC.js";import"./input-C1msyAUz.js";import"./suggestion-C591DFAx.js";import"./use-chat-layout-state-CVkPEEUs.js";import"./use-file-configs-BSnoYr1R.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-3vLSpQqZ.js";import"./use-org-fs-DOu4nQSr.js";import"./useInfiniteQuery-DeMEFTdd.js";import"./infiniteQueryObserver-rUCOtzeA.js";import"./Link01-Dw-VkUVV.js";import"./question-004-sINsf4GQ.js";import"./use-members-BqWTpMNp.js";import"./use-org-auth-client-DIUzAE5u.js";import"./feature-paywall-nTUHasXJ.js";import"./plan-ladder-gwROOTzi.js";import"./add-connection-dialog-BB_zBu7s.js";import"./collection-search-q0ogFMFh.js";import"./extract-connection-data-CJhjAx3s.js";import"./metadata-D72DunRR.js";import"./connection-DSkv8Cg1.js";import"./url-slug-CUhgOgGc.js";import"./connection-card-C7Yq5GHs.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-DogZfPWq.js";import"./textarea-DvoMwt1e.js";import"./use-connection-gMb_8zEe.js";import"./schema-BKM3gR2B.js";import"./connection-form-helpers-BsU6F-s_.js";import"./authenticate-and-persist-oauth-bcqFV5Ih.js";import"./mcp-oauth-D_oaXY6E.js";import"./mcp-oauth-tCidCN-u.js";import"./collection-tabs-CYgVG041.js";import"./badge-BDMYkxf_.js";import"./use-infinite-scroll-CtScOz_h.js";import"./useSuspenseInfiniteQuery-CUkGf5w6.js";import"./use-task-board-events-BBlz-cBe.js";import"./Play-CIe1tupB.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DjM6V7aG.js";import"./collapsible-CSMgVqT4.js";import"./use-clock-tick-zaL95TTy.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DuGbCe-D.js";import"./types-C5SQt0XZ.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-CZiDNUQZ.js";import"./use-navigate-to-agent-Cu9cZhs8.js";import"./use-thread-outputs-c6b1HaAz.js";import"./command-DFd1c5Z5.js";import"./index-Dhdyv2s0.js";import"./utils-DHYRJNUn.js";import"./monaco-editor-2Ci5R71u.js";import"./editor-KeKsFC14.js";import"./calendar-9HE_r4Hw.js";import"./SwitchHorizontal01-B5sfCWHV.js";import"./rich-text-link-control-CNQ92nZ4.js";import"./switch-CUK4V52q.js";import"./view-mode-toggle-B55pxnK_.js";import"./combobox-BTfHieW4.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-E-CAHxZx.js";import"./search-input-pTAwOtCG.js";import"./use-debounced-value-Dju-tMu1.js";import"./asset-utils-Cne_zeGQ.js";import"./sandbox-git-api-C7JbVL7R.js";import"./Building02-QB_UI3sB.js";import"./CheckCircle-CG1RvCMD.js";import"./CreditCard01-W1zS1W7o.js";import"./Globe04-C2IFbCwJ.js";import"./Sun-BmhcFIJl.js";import"./User01-DabbLHAZ.js";import"./Users01-Dt36FENA.js";import"./project-icon-DsUbDdQC.js";import"./new-project-dialog-C5lJfUJ3.js";import"./repository-import-picker-D5xDiyD_.js";import"./repository-picker-DExxlkis.js";import"./required-auth-layout-Dzef4Ao1.js";import"./use-org-sso-B57pfGVG.js";import"./section-preview-url-7zfngvgW.js";function pl(n){return n.schema?.definitions??n.schema?.$defs??{}}function ao(n,e){const s=pl(e),i=s[btoa(n)];if(!i)return[];const l=[i];if(Array.isArray(i.allOf)){const d=i.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof d=="string"){const h=s[d.replace("#/definitions/","")];h&&l.push(h)}}return l}function hl(n,e){for(const s of ao(n,e)){const i=typeof s.image=="string"?s.image:void 0;if(i?.includes("{{{"))return i}}function gl(n,e){if(!e)return;const s=so(n);if(!s)return;const i=hl(s.resolveType,e);if(!i)return;const l=Mi(i,s.data);if(l)return Di(l)}const vl={escape:Pi};function xl(n,e){for(const s of ao(n,e)){const i=typeof s.title=="string"?s.title:void 0;if(i?.includes("{{"))return i}}function yl(n,e){if(!e)return;const s=so(n);if(s)try{const i=xl(s.resolveType,e);return i&&va.render(i,s.data,{},vl).trim()||void 0}catch{return}}function bl(n){const e=ft.c(13),{icon:s,label:i,className:l}=n;let d;e[0]!==l?(d=le("size-3.5",l),e[0]=l,e[1]=d):d=e[1];let h;e[2]!==s||e[3]!==d?(h=o.jsx(s,{className:d}),e[2]=s,e[3]=d,e[4]=h):h=e[4];let u;e[5]!==i||e[6]!==h?(u=o.jsx(_t,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":i,className:"shrink-0 cursor-help",children:h})}),e[5]=i,e[6]=h,e[7]=u):u=e[7];let b;e[8]!==i?(b=o.jsx(kt,{className:"max-w-56",children:i}),e[8]=i,e[9]=b):b=e[9];let g;return e[10]!==u||e[11]!==b?(g=o.jsxs(wt,{children:[u,b]}),e[10]=u,e[11]=b,e[12]=g):g=e[12],g}const Sl="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function qr(n){return Array.from({length:n},(e,s)=>({id:crypto.randomUUID(),index:s}))}function lo(n){return n.map((e,s)=>({...e,index:s}))}function jl(n,e){if(e===n.length)return n;if(e<n.length)return lo(n.slice(0,e));const s=Array.from({length:e-n.length},(i,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...s]}function co(n){const e=ft.c(44),{section:s,raw:i,meta:l,decofile:d}=n,h=Dt(),u=In(),b=s.isSavedBlock===!0,g=s.isMultivariate===!0;let k;e[0]!==l||e[1]!==i?(k=i&&l?gl(i,l):void 0,e[0]=l,e[1]=i,e[2]=k):k=e[2];const E=k;let U;e[3]!==l||e[4]!==g||e[5]!==i||e[6]!==b?(U=i&&l&&!b&&!g?yl(i,l):void 0,e[3]=l,e[4]=g,e[5]=i,e[6]=b,e[7]=U):U=e[7];const X=U;let F;e[8]!==d||e[9]!==l||e[10]!==i||e[11]!==s?(F=Oi(i,s,d,l),e[8]=d,e[9]=l,e[10]=i,e[11]=s,e[12]=F):F=e[12];const L=F;let f;e[13]!==g||e[14]!==i?.__resolveType?(f=!g&&xs(i?.__resolveType??""),e[13]=g,e[14]=i?.__resolveType,e[15]=f):f=e[15];const A=f,Y=b?Pn:g?no:io;let j;e[16]!==g||e[17]!==b?(j=b?{color:ba}:g?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=g,e[17]=b,e[18]=j):j=e[18];const H=j;let V;e[19]!==Y||e[20]!==u?(V=u?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(Y,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(zi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(ha,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Y,e[20]=u,e[21]=V):V=e[21];let v;e[22]!==E?(v=E&&o.jsx("img",{src:E,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=E,e[23]=v):v=e[23];let C;e[24]!==u||e[25]!==H?(C=!u&&o.jsx(ds,{className:"h-4 w-4 shrink-0",style:H}),e[24]=u,e[25]=H,e[26]=C):C=e[26];const x=u?"shrink":"flex-1",re=s.isHidden&&"line-through opacity-50";let P;e[27]!==re||e[28]!==x?(P=le("min-w-0 truncate text-sm font-medium",x,re),e[27]=re,e[28]=x,e[29]=P):P=e[29];const oe=X??s.label;let de;e[30]!==P||e[31]!==oe?(de=o.jsx("span",{className:P,children:oe}),e[30]=P,e[31]=oe,e[32]=de):de=e[32];let Z;e[33]!==A||e[34]!==u||e[35]!==L||e[36]!==h?(Z=u?o.jsxs(o.Fragment,{children:[A&&o.jsx(bl,{icon:fs,label:h("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),L&&o.jsx(kr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):L&&o.jsx(kr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=A,e[34]=u,e[35]=L,e[36]=h,e[37]=Z):Z=e[37];let te;return e[38]!==de||e[39]!==Z||e[40]!==V||e[41]!==v||e[42]!==C?(te=o.jsxs(o.Fragment,{children:[V,v,C,de,Z]}),e[38]=de,e[39]=Z,e[40]=V,e[41]=v,e[42]=C,e[43]=te):te=e[43],te}const wl="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_l="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function uo(n,e,s){if(s)return $i({selected:e});const i=n.isSavedBlock===!0,l=n.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":i?wl:l?_l:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function os(n,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function kl(n){const e=ft.c(90),{section:s,raw:i,meta:l,decofile:d,sortableId:h,selected:u,onSelect:b,onDelete:g,onDuplicate:k,onMakeReusable:E,onToggleHidden:U,onToggleLazy:X,onAddVariant:F,onDetach:L}=n,f=Dt(),A=In(),Y=i?xs(i.__resolveType??""):!1,j=s.isHidden===!0,H=Y||j;let V;e[0]!==s?(V=ro(s),e[0]=s,e[1]=V):V=e[1];const v=V;let C;e[2]!==h?(C={id:h,animateLayoutChanges:Al},e[2]=h,e[3]=C):C=e[3];const{attributes:x,listeners:re,setNodeRef:P,transform:oe,isDragging:de}=Za(C);let Z;e[4]!==oe?(Z=Ja.Transform.toString(oe?{...oe,x:0}:null),e[4]=oe,e[5]=Z):Z=e[5];const te=de?0:void 0;let S;e[6]!==Z||e[7]!==te?(S={transform:Z,opacity:te},e[6]=Z,e[7]=te,e[8]=S):S=e[8];const W=S;let je;e[9]!==s?(je=Ii(s),e[9]=s,e[10]=je):je=e[10];const K=je,He="button",G=0;let Ee;e[11]!==b?(Ee=ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),b())},e[11]=b,e[12]=Ee):Ee=e[12];const xe=de?"cursor-grabbing":"cursor-pointer";let Re;e[13]!==A||e[14]!==s||e[15]!==u||e[16]!==xe?(Re=le("touch-none transition-colors",xe,uo(s,u,A)),e[13]=A,e[14]=s,e[15]=u,e[16]=xe,e[17]=Re):Re=e[17];let Be;e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==s?(Be=o.jsx(co,{section:s,raw:i,meta:l,decofile:d}),e[18]=d,e[19]=l,e[20]=i,e[21]=s,e[22]=Be):Be=e[22];const we=!A&&!s.isMultivariate&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(os(H,Y)),onClick:ee=>{ee.stopPropagation(),X()},onPointerDown:Rl,children:o.jsx(fs,{className:le("h-3.5 w-3.5",Y&&"text-warning")})})}),o.jsx(kt,{side:"bottom",children:f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ie=A?o.jsx(Bi,{label:f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:j,onToggle:U,children:j?o.jsx(Lr,{className:"h-3.5 w-3.5"}):o.jsx(Or,{className:"h-3.5 w-3.5"})}):o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(os(H,j)),onClick:ee=>{ee.stopPropagation(),U()},onPointerDown:El,children:j?o.jsx(Lr,{className:"h-3.5 w-3.5"}):o.jsx(Or,{className:"h-3.5 w-3.5"})})}),o.jsx(kt,{side:"bottom",children:f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=Ei,O=Fi;let I;e[23]!==f?(I=f("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=f,e[24]=I):I=e[24];const D=le(os(H,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ce;e[25]!==O||e[26]!==I||e[27]!==D?(Ce=o.jsx(O,{label:I,classicClassName:D}),e[25]=O,e[26]=I,e[27]=D,e[28]=Ce):Ce=e[28];let Ye;e[29]!==A||e[30]!==Y||e[31]!==X||e[32]!==s.isMultivariate||e[33]!==f?(Ye=A&&!s.isMultivariate&&o.jsxs(o.Fragment,{children:[o.jsxs(Qt,{onClick:ee=>{ee.stopPropagation(),X()},children:[o.jsx(fs,{className:"h-4 w-4"}),f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ki,{})]}),e[29]=A,e[30]=Y,e[31]=X,e[32]=s.isMultivariate,e[33]=f,e[34]=Ye):Ye=e[34];let Je;e[35]!==k?(Je=ee=>{ee.stopPropagation(),k()},e[35]=k,e[36]=Je):Je=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=o.jsx(za,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let ne;e[38]!==f?(ne=f("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=f,e[39]=ne):ne=e[39];let ye;e[40]!==Je||e[41]!==ne?(ye=o.jsxs(Qt,{onClick:Je,children:[tt,ne]}),e[40]=Je,e[41]=ne,e[42]=ye):ye=e[42];let Fe;e[43]!==A||e[44]!==v||e[45]!==F||e[46]!==f?(Fe=v&&o.jsxs(Qt,{className:le(!A&&Li),onClick:ee=>{ee.stopPropagation(),F()},children:[o.jsx(no,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=A,e[44]=v,e[45]=F,e[46]=f,e[47]=Fe):Fe=e[47];let Te;e[48]!==A||e[49]!==K||e[50]!==E||e[51]!==f?(Te=K&&o.jsxs(Qt,{className:le(!A&&Sl),onClick:ee=>{ee.stopPropagation(),E()},children:[A?o.jsx(Pn,{className:"h-4 w-4"}):o.jsx(ds,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=A,e[49]=K,e[50]=E,e[51]=f,e[52]=Te):Te=e[52];let fe;e[53]!==A||e[54]!==L||e[55]!==s.isMultivariate||e[56]!==s.isSavedBlock||e[57]!==f?(fe=s.isSavedBlock===!0&&!s.isMultivariate&&o.jsxs(Qt,{onClick:ee=>{ee.stopPropagation(),L()},children:[A?o.jsx(io,{className:"h-4 w-4"}):o.jsx(ds,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=A,e[54]=L,e[55]=s.isMultivariate,e[56]=s.isSavedBlock,e[57]=f,e[58]=fe):fe=e[58];let Ve;e[59]!==g?(Ve=ee=>{ee.stopPropagation(),g()},e[59]=g,e[60]=Ve):Ve=e[60];let Pe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Pe=o.jsx(Wa,{className:"h-4 w-4"}),e[61]=Pe):Pe=e[61];let Qe;e[62]!==f?(Qe=f("sectionsEditor.sectionList.deleteMenuItem"),e[62]=f,e[63]=Qe):Qe=e[63];let Ae;e[64]!==Ve||e[65]!==Qe?(Ae=o.jsxs(Qt,{variant:"destructive",onClick:Ve,children:[Pe,Qe]}),e[64]=Ve,e[65]=Qe,e[66]=Ae):Ae=e[66];let We;e[67]!==Ye||e[68]!==ye||e[69]!==Fe||e[70]!==Te||e[71]!==fe||e[72]!==Ae?(We=o.jsxs(Ri,{align:"end",className:"w-44",children:[Ye,ye,Fe,Te,fe,Ae]}),e[67]=Ye,e[68]=ye,e[69]=Fe,e[70]=Te,e[71]=fe,e[72]=Ae,e[73]=We):We=e[73];let Le;e[74]!==B||e[75]!==Ce||e[76]!==We?(Le=o.jsxs(B,{children:[Ce,We]}),e[74]=B,e[75]=Ce,e[76]=We,e[77]=Le):Le=e[77];let Ge;return e[78]!==x||e[79]!==re||e[80]!==b||e[81]!==P||e[82]!==W||e[83]!==Re||e[84]!==Be||e[85]!==we||e[86]!==ie||e[87]!==Le||e[88]!==Ee?(Ge=o.jsxs("div",{ref:P,style:W,...x,...re,role:He,tabIndex:G,onClick:b,onKeyDown:Ee,className:Re,children:[Be,we,ie,Le]}),e[78]=x,e[79]=re,e[80]=b,e[81]=P,e[82]=W,e[83]=Re,e[84]=Be,e[85]=we,e[86]=ie,e[87]=Le,e[88]=Ee,e[89]=Ge):Ge=e[89],Ge}function El(n){return n.stopPropagation()}function Rl(n){return n.stopPropagation()}function Al(){return!1}function ms(n){const e=ft.c(11),{canAddSection:s,onAddSection:i,className:l,size:d}=n,h=Dt();let u;e[0]!==l?(u=le("w-full",l),e[0]=l,e[1]=u):u=e[1];const b=!s;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Ha,{size:14}),e[2]=g):g=e[2];let k;e[3]!==h?(k=h("sectionsEditor.sectionList.addSectionButton"),e[3]=h,e[4]=k):k=e[4];let E;return e[5]!==i||e[6]!==d||e[7]!==u||e[8]!==b||e[9]!==k?(E=o.jsxs(xt,{type:"button",variant:"outline",size:d,className:u,disabled:b,onClick:i,children:[g,k]}),e[5]=i,e[6]=d,e[7]=u,e[8]=b,e[9]=k,e[10]=E):E=e[10],E}function Nl(n){const e=ft.c(101),{listKey:s,rawSections:i,sections:l,meta:d,decofile:h,selectedIndex:u,onSelect:b,onReorder:g,onDelete:k,onDuplicate:E,onMakeReusable:U,onToggleHidden:X,onToggleLazy:F,onAddVariant:L,onDetach:f,onAddSection:A,canAddSection:Y}=n,j=Y===void 0?!0:Y,H=Dt(),V=In();let v;e[0]!==l.length?(v=()=>qr(l.length),e[0]=l.length,e[1]=v):v=e[1];const[C,x]=w.useState(v),[re,P]=w.useState(null),[oe,de]=w.useState(s),[Z,te]=w.useState(l.length),S=w.useRef(!1);oe!==s?(de(s),te(l.length),x(qr(l.length))):Z!==l.length&&(te(l.length),x(nt=>jl(nt,l.length)));let W;e[2]===Symbol.for("react.memo_cache_sentinel")?(W={activationConstraint:{distance:8}},e[2]=W):W=e[2];let je;e[3]===Symbol.for("react.memo_cache_sentinel")?(je={coordinateGetter:el},e[3]=je):je=e[3];const K=Ga($r(Ua,W),$r(qa,je));let He;e[4]!==C?(He=C.map(Cl),e[4]=C,e[5]=He):He=e[5];const G=He;let Ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ee=nt=>{P(String(nt.active.id))},e[6]=Ee):Ee=e[6];const xe=Ee;let Re;e[7]!==G||e[8]!==g?(Re=nt=>{P(null);const{active:se,over:pe}=nt;if(!pe||se.id===pe.id)return;const rt=G.indexOf(String(se.id)),ce=G.indexOf(String(pe.id));rt===-1||ce===-1||(x(it=>lo(Mn([...it],rt,ce))),S.current=!0,requestAnimationFrame(()=>{S.current=!1}),g?.(rt,ce))},e[7]=G,e[8]=g,e[9]=Re):Re=e[9];const Be=Re;let we;e[10]===Symbol.for("react.memo_cache_sentinel")?(we=()=>{P(null)},e[10]=we):we=e[10];const ie=we;let B,O,I,D,Ce,Ye,Je,tt,ne,ye,Fe,Te,fe,Ve,Pe;if(e[11]!==re||e[12]!==j||e[13]!==V||e[14]!==h||e[15]!==C||e[16]!==G||e[17]!==Be||e[18]!==d||e[19]!==A||e[20]!==L||e[21]!==k||e[22]!==f||e[23]!==E||e[24]!==U||e[25]!==b||e[26]!==X||e[27]!==F||e[28]!==i||e[29]!==l||e[30]!==u||e[31]!==K||e[32]!==H){Ve=Symbol.for("react.early_return_sentinel");e:{const nt=se=>{S.current||b(se)};if(e[48]!==re||e[49]!==j||e[50]!==V||e[51]!==C||e[52]!==A||e[53]!==i||e[54]!==l||e[55]!==H){const se=re?C.find(pe=>pe.id===re):null;if(D=se!=null?l[se.index]:null,I=se!=null?i[se.index]:void 0,C.length===0){let pe;e[59]!==H?(pe=H("sectionsEditor.sectionList.noSections"),e[59]=H,e[60]=pe):pe=e[60];let rt;e[61]!==pe?(rt=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:pe}),e[61]=pe,e[62]=rt):rt=e[62];const ce=rt;let it;e[63]!==j||e[64]!==V||e[65]!==ce||e[66]!==A?(it=V?ce:o.jsxs("div",{className:"space-y-2",children:[ce,o.jsx(ms,{canAddSection:j,onAddSection:A,size:"sm"})]}),e[63]=j,e[64]=V,e[65]=ce,e[66]=A,e[67]=it):it=e[67],Ve=it;break e}fe=le(se&&"cursor-grabbing"),e[48]=re,e[49]=j,e[50]=V,e[51]=C,e[52]=A,e[53]=i,e[54]=l,e[55]=H,e[56]=I,e[57]=D,e[58]=fe}else I=e[56],D=e[57],fe=e[58];O=Qa,tt=K,ne=Xa,ye=xe,Fe=Be,Te=ie,B=tl,Ye=G,Je=nl,Pe="space-y-1",Ce=C.map(se=>{const pe=l[se.index];return pe?o.jsx(kl,{sortableId:se.id,section:pe,raw:i[se.index],meta:d,decofile:h,selected:u===se.index,onSelect:()=>nt(se.index),onDelete:()=>k(se.index),onDuplicate:()=>E(se.index),onMakeReusable:()=>U(se.index),onToggleHidden:()=>X(se.index),onToggleLazy:()=>F(se.index),onAddVariant:()=>L(se.index),onDetach:()=>f(se.index)},se.id):null})}e[11]=re,e[12]=j,e[13]=V,e[14]=h,e[15]=C,e[16]=G,e[17]=Be,e[18]=d,e[19]=A,e[20]=L,e[21]=k,e[22]=f,e[23]=E,e[24]=U,e[25]=b,e[26]=X,e[27]=F,e[28]=i,e[29]=l,e[30]=u,e[31]=K,e[32]=H,e[33]=B,e[34]=O,e[35]=I,e[36]=D,e[37]=Ce,e[38]=Ye,e[39]=Je,e[40]=tt,e[41]=ne,e[42]=ye,e[43]=Fe,e[44]=Te,e[45]=fe,e[46]=Ve,e[47]=Pe}else B=e[33],O=e[34],I=e[35],D=e[36],Ce=e[37],Ye=e[38],Je=e[39],tt=e[40],ne=e[41],ye=e[42],Fe=e[43],Te=e[44],fe=e[45],Ve=e[46],Pe=e[47];if(Ve!==Symbol.for("react.early_return_sentinel"))return Ve;let Qe;e[68]!==Ce||e[69]!==Pe?(Qe=o.jsx("div",{className:Pe,children:Ce}),e[68]=Ce,e[69]=Pe,e[70]=Qe):Qe=e[70];let Ae;e[71]!==B||e[72]!==Ye||e[73]!==Je||e[74]!==Qe?(Ae=o.jsx(B,{items:Ye,strategy:Je,children:Qe}),e[71]=B,e[72]=Ye,e[73]=Je,e[74]=Qe,e[75]=Ae):Ae=e[75];let We;e[76]!==I||e[77]!==D||e[78]!==V||e[79]!==h||e[80]!==d?(We=D?o.jsx("div",{className:le("cursor-grabbing shadow-lg ring-1 ring-border/60",uo(D,!1,V)),children:o.jsx(co,{section:D,raw:I,meta:d,decofile:h})}):null,e[76]=I,e[77]=D,e[78]=V,e[79]=h,e[80]=d,e[81]=We):We=e[81];let Le;e[82]!==We?(Le=_i.createPortal(o.jsx(Ya,{dropAnimation:Ki,children:We}),document.body),e[82]=We,e[83]=Le):Le=e[83];let Ge;e[84]!==O||e[85]!==tt||e[86]!==ne||e[87]!==ye||e[88]!==Fe||e[89]!==Te||e[90]!==Ae||e[91]!==Le?(Ge=o.jsxs(O,{sensors:tt,collisionDetection:ne,onDragStart:ye,onDragEnd:Fe,onDragCancel:Te,children:[Ae,Le]}),e[84]=O,e[85]=tt,e[86]=ne,e[87]=ye,e[88]=Fe,e[89]=Te,e[90]=Ae,e[91]=Le,e[92]=Ge):Ge=e[92];let ee;e[93]!==j||e[94]!==V||e[95]!==A?(ee=!V&&o.jsx(ms,{canAddSection:j,onAddSection:A,size:"sm",className:"mt-2"}),e[93]=j,e[94]=V,e[95]=A,e[96]=ee):ee=e[96];let zt;return e[97]!==fe||e[98]!==Ge||e[99]!==ee?(zt=o.jsxs("div",{className:fe,children:[Ge,ee]}),e[97]=fe,e[98]=Ge,e[99]=ee,e[100]=zt):zt=e[100],zt}function Cl(n){return n.id}function is(n,e,s,i){if(!n||!e)return null;if(!e.isMultivariate)return jt(n,e,i)?.data??null;const l=pt(n,e),d=l?ls(l,vt)[s]:void 0;return d?oo(d.value,i)?.data??null:null}const Tl=50;function Vl(n,e){n.own.push(ze(e)),n.own.length>Tl&&n.own.shift()}function Ur(n,e){return n.own.includes(ze(e))}function Ml(n,e){const{sectionIndex:s,variantIndex:i,shown:l,next:d,sectionCount:h}=e;return n&&n.sectionIndex===s&&n.variantIndex===i&&n.emitted===l?(n.emitted=d,n):l?{sectionIndex:s,variantIndex:i,base:l,emitted:d,sectionCount:h,own:[ze(l)]}:null}function fo(n,e){return e!==null&&ze(n)!==ze(e)}function mo(n,e){return n.__resolveType!==e.__resolveType}function Dl(n,e,s,i){if(e.length===i)return"here";const l=ze(n),d=e.flatMap((h,u)=>u!==s&&h!==null&&ze(h)===l?[u]:[]);return d.length===1?d[0]:"unknown"}function Pl({merged:n,tracked:e,current:s,saved:i}){return!!n&&!!e&&s===e&&e.emitted===i}function Kl(n,e){return!!n&&!!e&&n.contains(e)}function ps(n){const e=[],s=hs("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:s,pointers:e}}function hs(n,e,s,i,l){const d=(h,u)=>ze(h)===ze(u);if(d(s,i)||d(e,i))return s;if(d(e,s))return i;if(as(s)&&as(i)){const h=as(e)?e:{},u={},b=[...Object.keys(s),...Object.keys(i).filter(g=>!(g in s))];for(const g of b){const k=hs(`${n}/${g.replaceAll("~","~0").replaceAll("/","~1")}`,h[g],s[g],i[g],l);k!==void 0&&(u[g]=k)}return u}return Array.isArray(e)&&Array.isArray(s)&&Array.isArray(i)&&s.length===e.length&&i.length===e.length?e.map((h,u)=>hs(`${n}/${u}`,h,s[u],i[u],l)):(l.push(n),i)}function as(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Il(n,e){let s=n.merged;for(const i of n.pointers)e[i]==="mine"&&(s=Ol(s,i,$t(n.mine,i)));return s}function Bl(n,e){return Object.fromEntries(n.pointers.map(s=>[s,e]))}function po(n){return Bl(n,"mine")}function gs(n,e,s){const i=po(s);for(const l of s.pointers){const d=e[l];if(!d||!n.pointers.includes(l))continue;["mine","theirs"].every(u=>ze($t(n[u],l))===ze($t(s[u],l)))&&(i[l]=d)}return i}function ho(n,e,s={}){const i=e.pointers.filter(l=>!n.pointers.includes(l)||ze($t(n.theirs,l))!==ze($t(e.theirs,l)));return i.length===0?s:{...s,...Object.fromEntries(i.map(l=>[l,(s[l]??0)+1]))}}function Fl(n,e,s){if(!e||mo(n.plan.ancestor,e)||!fo(n.plan.theirs,e)||s(e))return null;const i=ps({...n.plan,theirs:e});return i.pointers.length===0?null:{plan:i,choices:gs(n.plan,n.choices,i),fresh:ho(n.plan,i,n.fresh)}}function Ll(n,e){return n.pointers.map(s=>({pointer:s,label:Hi(s,e),mine:$t(n.mine,s),theirs:$t(n.theirs,s),schema:$l(e??null,s)}))}function ys(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function $t(n,e){let s=n;for(const i of ys(e))if(Array.isArray(s))s=s[Number(i)];else if(s&&typeof s=="object")s=s[i];else return;return s}function Ol(n,e,s){const i=ys(e),l=(d,h)=>{if(h===i.length)return s;const u=i[h];if(Array.isArray(d)){const k=[...d];return k[Number(u)]=l(d[Number(u)],h+1),k}const b=d&&typeof d=="object"?{...d}:{},g=l(b[u],h+1);return g===void 0?delete b[u]:b[u]=g,b};return l(n,0)}function $l(n,e){let s=n;for(const i of ys(e)){if(!s)return null;s=/^\d+$/.test(i)&&!s.properties?.[i]?s.items:s.properties?.[i]}return s??null}const zl=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,Yr=60,Hl=3;function go(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&zl.test(n)}function vs(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const i=n.replace(/<br\s*\/?>/gi,`
|
|
2
|
-
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|
|
3
|
-
`);return Gl(i).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
|
|
4
|
-
`).trim()}const Wl={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'"};function Gl(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let s="";s!==e;)s=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,s=>Wl[s]??s)}function Dn(n){const e=n.replace(/\s+/g," ").trim();return e.length>Yr?`${e.slice(0,Yr-1)}…`:e}function ql(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Kn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return go(n,e)?{kind:"image",src:n}:{kind:"text",text:vs(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const s=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,Hl).map(i=>Ul(i,s)??"")}}if(typeof n=="object"){const s=n;if("value"in s&&Object.keys(s).length<=2)return Kn(s.value,e?.properties?.value??e);const i=Object.entries(s).filter(([l,d])=>!l.startsWith("__")&&d!==void 0).flatMap(([l,d])=>{const h=e?.properties?.[l]??null,u=Kn(d,h);if(u.kind==="empty")return[];const b=u.kind==="text"?Dn(u.text):u.kind==="image"?ql(u.src):u.kind==="yesNo"?u.value?"✓":"✗":u.kind==="list"?`${u.count}`:"…";return[{label:h?.title?.trim()||l,text:b}]}).slice(0,4);return i.length>0?{kind:"fields",entries:i}:{kind:"empty"}}return{kind:"text",text:String(n)}}function Ul(n,e){if(typeof n=="string")return Dn(vs(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n,i=e?.titleBy,l=i?s[i]:void 0;if(typeof l=="string"&&l.trim())return Dn(l);for(const[d,h]of Object.entries(s))if(!(d.startsWith("__")||typeof h!="string"||!h.trim())&&!go(h,e?.properties?.[d]??null))return Dn(vs(h,null));return null}const Jr=1500;function Yl(n,e){const s=n.split(/(\s+)/).filter(k=>k!==""),i=e.split(/(\s+)/).filter(k=>k!=="");if(s.length>Jr||i.length>Jr)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const l=Array.from({length:s.length+1},()=>new Array(i.length+1).fill(0));for(let k=s.length-1;k>=0;k--)for(let E=i.length-1;E>=0;E--){const U=l[k];U[E]=s[k]===i[E]?l[k+1][E+1]+1:Math.max(l[k+1][E],U[E+1])}const d=[],h=[],u=(k,E,U)=>{const X=k.at(-1);X&&(X.kind===U||U==="same"&&!E.trim())?X.text+=E:k.push({text:E,kind:U})};let b=0,g=0;for(;b<s.length&&g<i.length;)s[b]===i[g]?(u(d,s[b],"same"),u(h,i[g],"same"),b++,g++):l[b+1][g]>=l[b][g+1]?(u(d,s[b],"changed"),b++):(u(h,i[g],"changed"),g++);for(;b<s.length;b++)u(d,s[b],"changed");for(;g<i.length;g++)u(h,i[g],"changed");return{mine:d,theirs:h}}function Jl(n){const e=ft.c(10);let s,i;e[0]!==n?({open:s,...i}=n,e[0]=n,e[1]=s,e[2]=i):(s=e[1],i=e[2]);const{data:l}=Ai.useSession();let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=le("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=d):d=e[3];const h=l?.user??null;let u;e[4]!==i||e[5]!==h?(u=o.jsx(sl,{className:d,"data-testid":"form-conflict-dialog",onEscapeKeyDown:Zl,onOpenAutoFocus:Xl,children:o.jsx(oc,{...i,viewer:h,heading:Ql})}),e[4]=i,e[5]=h,e[6]=u):u=e[6];let b;return e[7]!==s||e[8]!==u?(b=o.jsx(al,{open:s,children:u}),e[7]=s,e[8]=u,e[9]=b):b=e[9],b}function Ql(n,e){return o.jsxs(rl,{className:"text-left",children:[o.jsx(ol,{children:n}),o.jsx(il,{children:e})]})}function Xl(n){n.preventDefault(),n.currentTarget?.focus()}function Zl(n){return n.preventDefault()}const ec={},tc=(n,e)=>o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold",children:n}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function nc(n,e,s=0,i={}){const l=e[Math.min(s,e.length-1)],d={field:l?rc(l.label):"",label:l?.label??""};return e.length<=1?{title:n("sectionsEditor.formConflict.titleOne",d),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:n("sectionsEditor.formConflict.titleStep",d),description:s>=e.length-1?o.jsx(sc,{t:n,fields:e,choices:i}):n("sectionsEditor.formConflict.descriptionStep")}}function sc(n){const e=ft.c(9),{t:s,fields:i,choices:l}=n;let d;if(e[0]!==l||e[1]!==i||e[2]!==s){let u;e[4]!==l||e[5]!==s?(u=(b,g)=>o.jsxs(w.Fragment,{children:[g>0&&" · ",`${b.label}: `,o.jsx("span",{className:"font-medium text-foreground",children:s((l[b.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":"sectionsEditor.formConflict.summaryTheirs")})]},b.pointer),e[4]=l,e[5]=s,e[6]=u):u=e[6],d=i.map(u),e[0]=l,e[1]=i,e[2]=s,e[3]=d}else d=e[3];let h;return e[7]!==d?(h=o.jsx("span",{"data-testid":"form-conflict-summary",children:d}),e[7]=d,e[8]=h):h=e[8],h}function rc(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function oc(n){const e=ft.c(68),s=Dt(),{fields:i,choices:l,changedAgain:d,fresh:h,heading:u}=n,b=d===void 0?!1:d,g=h===void 0?ec:h,k=u===void 0?tc:u,E=i.length>1,[U,X]=w.useState(0),[F,L]=w.useState(ic);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];const[A,Y]=w.useState(f),j=Math.max(0,Math.min(U,i.length-1)),H=i[j],V=j===i.length-1;let v;e[1]!==j||e[2]!==i||e[3]!==g?(v=we=>{const ie=i[j],B=i[we];!ie||!B||we===j||(L(O=>new Set(O).add(ie.pointer)),Y(O=>({...O,[ie.pointer]:g[ie.pointer]??0,[B.pointer]:g[B.pointer]??0})),X(we))},e[1]=j,e[2]=i,e[3]=g,e[4]=v):v=e[4];const C=v;let x;e[5]!==j||e[6]!==C?(x=we=>{if(!we)return;const ie=B=>{const O={ArrowLeft:-1,ArrowRight:1}[B.key];!O||B.defaultPrevented||B.altKey||B.ctrlKey||B.metaKey||B.shiftKey||ll(B.target)||(B.preventDefault(),C(j+O))};return we.ownerDocument.addEventListener("keydown",ie),()=>we.ownerDocument.removeEventListener("keydown",ie)},e[5]=j,e[6]=C,e[7]=x):x=e[7];const re=x;if(!H)return null;let P,oe,de,Z,te;if(e[8]!==F||e[9]!==j||e[10]!==l||e[11]!==i||e[12]!==g||e[13]!==C||e[14]!==k||e[15]!==re||e[16]!==E||e[17]!==n||e[18]!==A||e[19]!==s){const{title:we,description:ie}=nc(s,i,j,l);let B;e[25]!==n?(B=O=>{O.detail>1||n.onApply()},e[25]=n,e[26]=B):B=e[26],P=B,oe=E?re:void 0,de="flex min-w-0 flex-col gap-3",e[27]!==F||e[28]!==j||e[29]!==i||e[30]!==g||e[31]!==C||e[32]!==E||e[33]!==A||e[34]!==s?(Z=E&&o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("div",{role:"group","aria-label":s("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:i.map((O,I)=>{const D=I!==j&&(g[O.pointer]??0)>(A[O.pointer]??0);return o.jsx("button",{type:"button","aria-label":D?s("sectionsEditor.formConflict.stepChangedAgain",{label:O.label}):O.label,"aria-current":I===j?"step":void 0,"data-answered":I!==j&&F.has(O.pointer)?"":void 0,"data-changed-again":D?"":void 0,onClick:()=>C(I),className:"group cursor-pointer rounded-full p-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:o.jsx("span",{className:le("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},O.pointer)})}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:s("sectionsEditor.formConflict.stepCount",{step:String(j+1),count:String(i.length)})})]}),e[27]=F,e[28]=j,e[29]=i,e[30]=g,e[31]=C,e[32]=E,e[33]=A,e[34]=s,e[35]=Z):Z=e[35],te=k(we,ie),e[8]=F,e[9]=j,e[10]=l,e[11]=i,e[12]=g,e[13]=C,e[14]=k,e[15]=re,e[16]=E,e[17]=n,e[18]=A,e[19]=s,e[20]=P,e[21]=oe,e[22]=de,e[23]=Z,e[24]=te}else P=e[20],oe=e[21],de=e[22],Z=e[23],te=e[24];let S;e[36]!==oe||e[37]!==de||e[38]!==Z||e[39]!==te?(S=o.jsxs("div",{ref:oe,className:de,children:[Z,te]}),e[36]=oe,e[37]=de,e[38]=Z,e[39]=te,e[40]=S):S=e[40];const W=!b&&"sr-only";let je;e[41]!==W?(je=le("text-sm text-muted-foreground",W),e[41]=W,e[42]=je):je=e[42];let K;e[43]!==b||e[44]!==E||e[45]!==s?(K=b?s(E?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=b,e[44]=E,e[45]=s,e[46]=K):K=e[46];let He;e[47]!==je||e[48]!==K?(He=o.jsx("p",{role:"status",className:je,children:K}),e[47]=je,e[48]=K,e[49]=He):He=e[49];const G=E?"vertical":"all";let Ee;e[50]!==H||e[51]!==n||e[52]!==G?(Ee=o.jsx(uc,{field:H,...n,arrows:G}),e[50]=H,e[51]=n,e[52]=G,e[53]=Ee):Ee=e[53];let xe;e[54]!==He||e[55]!==Ee?(xe=o.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[He,Ee]}),e[54]=He,e[55]=Ee,e[56]=xe):xe=e[56];let Re;e[57]!==P||e[58]!==j||e[59]!==C||e[60]!==V||e[61]!==E||e[62]!==s?(Re=E?o.jsxs(Hr,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[o.jsx(xt,{type:"button",variant:"outline","aria-disabled":j===0,onClick:()=>C(j-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:s("sectionsEditor.formConflict.back")}),o.jsx(xt,{type:"button","data-testid":"form-conflict-primary",onClick:V?P:()=>C(j+1),children:s(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):o.jsx(Hr,{className:"items-center gap-2",children:o.jsx(xt,{type:"button","data-testid":"form-conflict-primary",onClick:P,children:s("sectionsEditor.formConflict.ok")})}),e[57]=P,e[58]=j,e[59]=C,e[60]=V,e[61]=E,e[62]=s,e[63]=Re):Re=e[63];let Be;return e[64]!==S||e[65]!==xe||e[66]!==Re?(Be=o.jsxs(o.Fragment,{children:[S,xe,Re]}),e[64]=S,e[65]=xe,e[66]=Re,e[67]=Be):Be=e[67],Be}function ic(){return new Set}function ac(n){const e=Kn(n.mine,n.schema),s=Kn(n.theirs,n.schema),i=e.kind==="text"&&s.kind==="text"?Yl(e.text,s.text):null;return l=>i?o.jsx(fc,{parts:i[l]}):o.jsx(pc,{preview:l==="mine"?e:s})}const lc={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function cc(n,e){const s=lc[e][n.key];if(!s)return;const i=[...n.currentTarget.querySelectorAll('[role="radio"]')],l=i.indexOf(document.activeElement);if(l<0)return;n.preventDefault();const d=i[(l+s+i.length)%i.length];d?.focus(),d?.click()}function uc(n){const e=ft.c(59),{field:s,choices:i,viewer:l,onChoose:d,arrows:h}=n,u=Dt();let b,g,k,E,U,X,F,L,f,A,Y,j,H;if(e[0]!==h||e[1]!==i||e[2]!==s||e[3]!==d||e[4]!==u||e[5]!==l?.image||e[6]!==l?.name){const C=ac(s),x=i[s.pointer]??"mine";j="radiogroup",H=s.label,k="flex flex-col gap-2",e[20]!==h?(E=S=>cc(S,h),e[20]=h,e[21]=E):E=e[21];let re;e[22]!==s.pointer||e[23]!==d?(re=()=>d(s.pointer,"mine"),e[22]=s.pointer,e[23]=d,e[24]=re):re=e[24];const P=l?.image??void 0;let oe;e[25]!==u||e[26]!==l?.name?(oe=dc(l?.name)||u("sectionsEditor.formConflict.you"),e[25]=u,e[26]=l?.name,e[27]=oe):oe=e[27];let de;e[28]!==P||e[29]!==oe?(de=o.jsx(zr,{url:P,fallback:oe,shape:"circle",size:"sm",className:"text-xs"}),e[28]=P,e[29]=oe,e[30]=de):de=e[30];let Z;e[31]!==u?(Z=u("sectionsEditor.formConflict.you"),e[31]=u,e[32]=Z):Z=e[32];let te;e[33]!==u?(te=u("sectionsEditor.formConflict.yourVersionNotSaved"),e[33]=u,e[34]=te):te=e[34],U=o.jsx(Qr,{side:"mine",checked:x==="mine",onChoose:re,avatar:de,who:Z,meta:te,children:C("mine")}),b=Qr,g="theirs",X=x==="theirs",e[35]!==s.pointer||e[36]!==d?(F=()=>d(s.pointer,"theirs"),e[35]=s.pointer,e[36]=d,e[37]=F):F=e[37],e[38]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(zr,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[38]=L):L=e[38],e[39]!==u?(f=u("sectionsEditor.formConflict.someoneElse"),e[39]=u,e[40]=f):f=e[40],e[41]!==u?(A=u("sectionsEditor.formConflict.theirVersionSaved"),e[41]=u,e[42]=A):A=e[42],Y=C("theirs"),e[0]=h,e[1]=i,e[2]=s,e[3]=d,e[4]=u,e[5]=l?.image,e[6]=l?.name,e[7]=b,e[8]=g,e[9]=k,e[10]=E,e[11]=U,e[12]=X,e[13]=F,e[14]=L,e[15]=f,e[16]=A,e[17]=Y,e[18]=j,e[19]=H}else b=e[7],g=e[8],k=e[9],E=e[10],U=e[11],X=e[12],F=e[13],L=e[14],f=e[15],A=e[16],Y=e[17],j=e[18],H=e[19];let V;e[43]!==b||e[44]!==g||e[45]!==X||e[46]!==F||e[47]!==L||e[48]!==f||e[49]!==A||e[50]!==Y?(V=o.jsx(b,{side:g,checked:X,onChoose:F,avatar:L,who:f,meta:A,children:Y}),e[43]=b,e[44]=g,e[45]=X,e[46]=F,e[47]=L,e[48]=f,e[49]=A,e[50]=Y,e[51]=V):V=e[51];let v;return e[52]!==k||e[53]!==E||e[54]!==U||e[55]!==V||e[56]!==j||e[57]!==H?(v=o.jsxs("div",{role:j,"aria-label":H,className:k,onKeyDown:E,children:[U,V]}),e[52]=k,e[53]=E,e[54]=U,e[55]=V,e[56]=j,e[57]=H,e[58]=v):v=e[58],v}function dc(n){return(n??"").trim().split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join("")}function Qr(n){const e=ft.c(27),{side:s,checked:i,onChoose:l,avatar:d,who:h,meta:u,children:b}=n,g=w.useId(),k=`${g}-who`,E=`${g}-meta ${g}-value`,U=i?0:-1,X=i?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-muted/50";let F;e[0]!==X?(F=le("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] outline-none","focus-visible:ring-2 focus-visible:ring-ring/50",X),e[0]=X,e[1]=F):F=e[1];const L=`${g}-who`;let f;e[2]!==L||e[3]!==h?(f=o.jsx("span",{id:L,className:"text-sm font-medium text-foreground",children:h}),e[2]=L,e[3]=h,e[4]=f):f=e[4];const A=`${g}-meta`;let Y;e[5]!==u||e[6]!==A?(Y=o.jsx("span",{id:A,children:u}),e[5]=u,e[6]=A,e[7]=Y):Y=e[7];let j;e[8]!==f||e[9]!==Y?(j=o.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[f,Y]}),e[8]=f,e[9]=Y,e[10]=j):j=e[10];const H=`${g}-value`,V=`conflict-${s}`;let v;e[11]!==b||e[12]!==H||e[13]!==V?(v=o.jsx("span",{id:H,"data-testid":V,className:"min-w-0 text-sm",children:b}),e[11]=b,e[12]=H,e[13]=V,e[14]=v):v=e[14];let C;e[15]!==j||e[16]!==v?(C=o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[j,v]}),e[15]=j,e[16]=v,e[17]=C):C=e[17];let x;return e[18]!==d||e[19]!==i||e[20]!==l||e[21]!==k||e[22]!==C||e[23]!==E||e[24]!==U||e[25]!==F?(x=o.jsxs("button",{type:"button",role:"radio","aria-checked":i,"aria-labelledby":k,"aria-describedby":E,tabIndex:U,onClick:l,className:F,children:[d,C]}),e[18]=d,e[19]=i,e[20]=l,e[21]=k,e[22]=C,e[23]=E,e[24]=U,e[25]=F,e[26]=x):x=e[26],x}function fc(n){const e=ft.c(4),{parts:s}=n;let i;e[0]!==s?(i=s.map(mc),e[0]=s,e[1]=i):i=e[1];let l;return e[2]!==i?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:i}),e[2]=i,e[3]=l):l=e[3],l}function mc(n,e){return n.kind==="changed"?o.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):o.jsx("span",{children:n.text},e)}function pc(n){const e=ft.c(29),{preview:s}=n,i=Dt();switch(s.kind){case"empty":{let l;e[0]!==i?(l=i("sectionsEditor.formConflict.empty"),e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==l?(d=o.jsx("span",{className:"italic text-muted-foreground",children:l}),e[2]=l,e[3]=d):d=e[3],d}case"text":{let l;return e[4]!==s.text?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:s.text}),e[4]=s.text,e[5]=l):l=e[5],l}case"image":{let l;return e[6]!==s.src?(l=o.jsx("img",{src:s.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=s.src,e[7]=l):l=e[7],l}case"yesNo":{const l=s.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let d;e[8]!==i||e[9]!==l?(d=i(l),e[8]=i,e[9]=l,e[10]=d):d=e[10];let h;return e[11]!==d?(h=o.jsx("span",{children:d}),e[11]=d,e[12]=h):h=e[12],h}case"list":{const l=s.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",d=String(s.count);let h;e[13]!==i||e[14]!==l||e[15]!==d?(h=i(l,{count:d}),e[13]=i,e[14]=l,e[15]=d,e[16]=h):h=e[16];let u;e[17]!==h?(u=o.jsx("span",{className:"text-muted-foreground",children:h}),e[17]=h,e[18]=u):u=e[18];let b;e[19]!==s.count||e[20]!==s.items?(b=s.items.some(Boolean)&&o.jsxs("span",{className:"flex flex-col",children:[s.items.map(gc),s.count>s.items.length&&o.jsx("span",{children:"…"})]}),e[19]=s.count,e[20]=s.items,e[21]=b):b=e[21];let g;return e[22]!==u||e[23]!==b?(g=o.jsxs("span",{className:"flex flex-col gap-1",children:[u,b]}),e[22]=u,e[23]=b,e[24]=g):g=e[24],g}case"fields":{let l;e[25]!==s.entries?(l=s.entries.map(hc),e[25]=s.entries,e[26]=l):l=e[26];let d;return e[27]!==l?(d=o.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:l}),e[27]=l,e[28]=d):d=e[28],d}}}function hc(n){return o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-muted-foreground",children:n.label}),o.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function gc(n,e){return o.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function vc(n,e,s,i){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const l=e.trim();if(!l)return Ot(n,s,i)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:cs(n,s,i)}:{kind:"noop"};const d=us(n,s,i);if(!d)return{kind:"error",reason:"unreadable-rule"};if(d.blockKey)return{kind:"updateBlock",blockKey:d.blockKey,blockData:Mt(d.resolveType,d.data,l)};const h=Tn(l),u=Vn(h,s);return u?{kind:"error",reason:"invalid-block-id",message:u}:{kind:"createBlock",blockId:h,blockData:Mt(d.resolveType,d.data,l),reference:Zt(h)}}const Xr="section-form-stale-save",xc=3,yc=1e3;function Zr(n,e){const s=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:to(e.pageKey?n[e.pageKey]?.sections:void 0,n),i=Math.max(0,Math.min(e.pageVariantIndex,s.length-1)),l=s[i]?.sections??[];return{pageVariants:s,variantIndex:i,rawSections:l,parsedSections:vn(l,n)}}const eo=new WeakMap;let bc=0;function Sc(n){let e=eo.get(n);return e===void 0&&(e=++bc,eo.set(n,e)),e}function wf({orgSlug:n,virtualMcpId:e,branch:s,previewReady:i=!0,previewUrl:l,currentPath:d,activePageBlockKey:h=null,activeGlobalBlockKey:u=null,externalSelection:b,onSaved:g,initialEditSeo:k=!1,onExitSeo:E,onSelectRoot:U,onViewJsonFile:X,onFocusedBlockChange:F,onVariantPreviewOverride:L}){const f=Dt(),A=Vi(),Y=A?.taskId??null,j=i?{orgSlug:n,virtualMcpId:e,branch:s,threadId:Y,previewUrl:l}:null,[H,V]=w.useState([]),{data:v,isLoading:C}=Wi(j,{pollWhile:H.length>0}),{data:x,isLoading:re}=Gi(j),P=In(),oe=A?.virtualMcpId,Z=fa(oe===e?e:null)?.metadata?.siteSlug??null,te=dl({virtualMcpId:e,sandboxUrl:l}),[S,W]=w.useState(null),[je,K]=w.useState(null),[He,G]=w.useState(null),[Ee,xe]=w.useState(0),[Re,Be]=w.useState(void 0),[we,ie]=w.useState(null),[B,O]=w.useState(null),[I,D]=w.useState([]),Ce=w.useRef(null),[Ye,Je]=w.useState(I.length);Ye!==I.length&&(Je(I.length),requestAnimationFrame(()=>{Ce.current&&(Ce.current.scrollTop=0)}));const[tt,ne]=w.useState(0),[ye,Fe]=w.useState(null),[Te,fe]=w.useState(null),[Ve,Pe]=w.useState(null),[Qe,Ae]=w.useState(!1),[We,Le]=w.useState(!1),Ge=w.useRef(null),[ee,zt]=w.useState(!0),[nt,se]=w.useState(!1),[pe,rt]=w.useState(!1),[ce,it]=w.useState(k),[bs,Ss]=w.useState(k);k&&!bs&&(Ss(!0),it(!0),W(null),K(null),G(null),D([])),!k&&bs&&Ss(!1);const[vo,xn]=w.useState(null),[js,Bn]=w.useState(void 0),[ws,Pt]=w.useState([]),[_s,en]=w.useState(0),[Xe,at]=w.useState(0),[xo,Ze]=w.useState(null),[Ht,st]=w.useState(null),[ks,Es]=w.useState(null),yo=Ni(),bo=`${n}/${e}/${s}`,yn=qi({orgSlug:n,virtualMcpId:e,branch:s}),[So,jo]=w.useState(d),[wo,_o]=w.useState(h),[ko,Eo]=w.useState(u);(So!==d||wo!==h||ko!==u)&&(queueMicrotask(()=>yn.flush()),jo(d),_o(h),Eo(u),W(null),K(null),G(null),xe(0),ie(null),O(null),at(0),Ze(null),st(null),D([]),ne(t=>t+1),it(!1),xn(null),Bn(void 0),Pt([]),en(t=>t+1));const me=Ui({orgSlug:n,virtualMcpId:e,branch:s}),tn=la((t,r)=>{me.mutate({blockKey:t,data:r},{onSuccess:()=>g?.(),onError:a=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),bn=xa({orgSlug:n,virtualMcpId:e,branch:s}),[Wt,Gt]=w.useState(!1),J=w.useRef(null),qt=w.useRef(null),yt=w.useRef(null),bt=w.useRef(null),Fn=w.useRef({}),Kt=w.useRef(null),nn=w.useRef(!1),sn=w.useRef(!1),qe=w.useRef(new Map),rn=w.useRef(!1),ht=w.useRef([]),Ln=w.useRef(new WeakSet),Oe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Rs,As]=w.useState(0),[Ro,Ao]=w.useState(0),[No,Co]=w.useState(null);if(!i||C||re)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(Ci,{className:"size-5 text-muted-foreground"})});if(!v||!x)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const To=Sa(v),ae=!!u,he=ae?null:ja(To,d,h),_=ae?u:he?.key??null,On=ae&&u?v[u]:void 0,Ns=ae&&u&&On?wa(u,On):ae&&u?u:"",on=!ae&&_&&v[_]?v[_]:null,$n=ce&&v&&x&&_&&he?Er(v,{kind:"page",pageKey:_,pageName:String(he.name??""),path:String(he.path??"")},x):null,Vo=ce?on?.seo:void 0,Sn=js!==void 0?js:Vo,Mo=ce?Yi(Sn):void 0,Cs=$n?.seoTypeOptions??[],Ts=ce&&x?Ji(x):"",zn=vo??Mo??{},jn=ce&&$n?cl(zn,$n):null,Vs=ce&&jn&&Qi(Sn)?Cn(jn,x):null,Ms=ce?Xi(v,x)?.seoData:void 0,Ne=ae?[{label:"Default",sections:[{__resolveType:u}]}]:to(on?.sections,v??{}),mt=Ne.length>1,ge=Math.min(Ee,Ne.length-1),ot=Ne[ge],Q=ot?.sections??[],Me=vn(Q,v),Hn=!ae&&_a(on?.sections);if(ae&&u&&ks!==u){Es(u);const t=Q[0],r=Me[0];if(t&&r){W(0),at(0),D([]);const a=jt(t,r,v);a&&(K(a.data),G(a.resolveType),st(null),Ze(null))}}!ae&&ks!==null&&Es(null),Oe.current={rawSections:Q,parsedSections:Me,decofile:v??{},activePageKey:_,pageVariants:Ne,variantIndex:ge,sectionVariantIndex:Xe,selectedSectionIndex:S};const Do=()=>({multivariate:Hn,index:ge,variants:Ne.map(t=>({rule:t.rule}))}),Wn=(t,r)=>{if(!L)return;if(!_||!Hn||t.length<=1){L(null);return}const a=Gr(_,{multivariate:!0,index:r,variants:t},v,x);L(a.length>0?a:null)},Gn=L&&_&&Hn&&mt&&!C&&!re?_:null;if(Gn!==No&&(Co(Gn),Gn)){const t=Ne.map(a=>({rule:a.rule})),r=ge;queueMicrotask(()=>Wn(t,r))}const Ut=(t,r,a)=>{if(!L)return;if(!_){L(null);return}const c=Do(),m=Gr(_,c,v,x);if(!t||r<0){L(m.length>0?m:null);return}const y=ml({pageKey:_,page:c,sectionIndex:r,sectionLazy:Me[r]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:v,meta:x}),p=[...m,...y];L(p.length>0?p:null)},St=(t,r,a,c=S??-1,m=!1)=>{const y=pt(t,r);if(!y){K(null),G(null),st(null),Ze(null),m&&Ut(null,c,a);return}const R=ls(y,vt)[a];if(!R){K(null),G(null),st(null),Ze(null),m&&Ut(null,c,a);return}const $=oo(R.value,v);K($?.data??null),G($?.resolveType??null);const{resolveType:N,formValue:T}=hn(R.rule,v,x??void 0);st(N),Ze(T),m&&Ut(y,c,a)},an=b?.index;if(b!==void 0&&(b?.seq??null)!==Re&&(Be(b?.seq??null),typeof an=="number")){const t=Q[an],r=Me[an];if(t&&r)if(W(an),at(0),D([]),ne(a=>a+1),r.isMultivariate)St(t,r,0,an);else{const a=jt(t,r,v);a?(K(a.data),G(a.resolveType)):(K(null),G(null)),st(null),Ze(null)}}if(Rs!==Ro){Ao(Rs);const t=S!==null?Q[S]:null,r=S!==null?Me[S]:null;if(t&&r&&S!==null)if(D([]),ne(a=>a+1),r.isMultivariate)St(t,r,Xe,S);else{const a=jt(t,r,v??{});K(a?.data??null),G(a?.resolveType??null)}}const lt=H[0];if(lt){const{formBase:t,target:r}=lt,a=Zr(v,r),c=t.sectionIndex,m=a.rawSections.length===t.sectionCount?is(a.rawSections[c],a.parsedSections[c],r.sectionVariantIndex,v):null,y=Fl(lt,m,p=>Ur(t,p));if(y){const R=[{...lt,...y,changedAgain:!0},...H.slice(1)];ht.current=R,V(R)}}const ln={orgSlug:n,virtualMcpId:e,branch:s,threadId:Y,previewUrl:l??void 0,siteSlug:Z},wn=He&&x?Cn(He,x):null,ct=(t,r)=>{if(!_)return;J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear(),bt.current&&(clearTimeout(bt.current),bt.current=null),yt.current&&(clearTimeout(yt.current),yt.current=null);const a=mn(v,_,t,ge,Ne);me.mutate({blockKey:_,data:a},{onSuccess:()=>r?.onSuccess?.()??g?.(),onError:c=>{r?.onError?.(),z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))}})},It=()=>{F?.(null),W(null),rt(!1),K(null),G(null),at(0),Ze(null),st(null),D([]),ne(t=>t+1)},Ds=()=>Kl(Ce.current,document.activeElement),qn=(t=f("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear(),qt.current=null,z.error(t,{id:Xr}),Ds()){rn.current=!0;return}As(r=>r+1)},Ps=()=>{!rn.current||Ds()||ht.current.length>0||J.current!==null||nn.current||sn.current||qe.current.size>0||(rn.current=!1,As(t=>t+1))},Ks=()=>{rn.current&&setTimeout(Ps,0)},Is=t=>{qe.current.size!==0&&setTimeout(()=>{if(nn.current||sn.current)return;const r=[...qe.current.values()];qe.current.clear();for(const a of r)a()},t)},Po=t=>{const{activePageKey:r,variantIndex:a,sectionVariantIndex:c}=Oe.current,m=Kt.current;return{formBase:m?.sectionIndex===t&&m.variantIndex===c?m:null,pageKey:r,global:ae,pageVariantIndex:a,sectionVariantIndex:c,schema:wn}},cn=t=>{ht.current=t,V(t)},Ko=t=>{const r=ht.current,a=r.findIndex(y=>y.formBase===t.formBase),c=a>=0?r[a]:void 0,m=c?r.with(a,{...t,choices:gs(c.plan,c.choices,t.plan),fresh:ho(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||ze(c.plan.theirs)!==ze(t.plan.theirs)}):[...r,{...t,changedAgain:Ln.current.has(t.formBase)}];cn(m)},Bs=(t,r)=>{const a=ht.current,c=a.findIndex(p=>p.formBase===t),m=a[c];if(!m)return!1;if(ze(m.plan.mine)===ze(r))return!0;const y=ps({...m.plan,mine:r});if(y.pointers.length===0){const p=a.filter(R=>R!==m);return cn(p),!1}return cn(a.with(c,{...m,plan:y,choices:gs(m.plan,m.choices,y)})),!0},Io=t=>{const r=Oe.current;return r.selectedSectionIndex===t.formBase.sectionIndex&&r.activePageKey===t.target.pageKey&&r.variantIndex===t.target.pageVariantIndex&&r.sectionVariantIndex===t.target.sectionVariantIndex},Bo=()=>{const t=ht.current[0];if(!t)return null;const{formBase:r,target:a}=t;J.current&&qt.current?.sectionIndex===r.sectionIndex&&qt.current.sectionVariantIndex===a.sectionVariantIndex&&(clearTimeout(J.current),J.current=null,qt.current=null),qe.current.delete(`${a.pageKey}:${r.sectionIndex}:${a.sectionVariantIndex}`);const c=r.emitted;return c&&typeof c=="object"&&!Bs(r,c)&&un(c,r.sectionIndex,0,a),ht.current[0]??null},Fo=()=>{const t=ht.current[0],r=Bo();if(!r||!t||r.formBase!==t.formBase||r.plan.pointers.some(y=>!t.plan.pointers.includes(y)))return;const a=Il(r.plan,r.choices);cn(ht.current.slice(1));const{formBase:c,target:m}=r;c.base=r.plan.theirs,c.emitted=a,Ln.current.add(c),(Kt.current===c||Io(r))&&(Kt.current=c,K(a),ne(y=>y+1)),un(a,c.sectionIndex,0,m)},Lo=t=>{const[r,...a]=ht.current;r&&cn([{...r,choices:t},...a])},un=(t,r,a=0,c)=>{const m=c??Po(r),y=m.sectionVariantIndex,p=m.formBase,R=qt.current;J.current&&(clearTimeout(J.current),J.current=null,R&&(R.sectionIndex!==r||R.sectionVariantIndex!==y)&&R.write());const $=`${m.pageKey}:${r}:${y}`,N=()=>{if(nn.current||sn.current){qe.current.set($,N);return}const T=typeof t=="function"?t():t;if(p&&Bs(p,T))return;const M=Oe.current.decofile,{rawSections:ue,parsedSections:be,pageVariants:Ie,variantIndex:De}=Zr(M,m),Ue=m.pageKey,q=ue[r];if(!q)return;const ve=be[r];if(!ve)return;const _e=p?.base,$e=is(q,ve,y,M),dt=!!_e&&!!$e&&fo(_e,$e)&&!(p&&Ur(p,$e));if(dt&&_e&&$e){if(mo(_e,$e)){qn(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Se=ve.isSavedBlock?"here":Dl(_e,ue.map((ke,Tt)=>is(ke,be[Tt],y,M)),r,p?.sectionCount??ue.length);if(Se==="unknown"){qn(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Se=="number"&&p){p.sectionCount=ue.length,p.sectionIndex=Se,Kt.current===p&&W(Se),un(T,Se,a,m);return}}const et=dt&&_e&&$e?ps({ancestor:_e,mine:T,theirs:$e}):null;if(et&&et.pointers.length>0&&p){p.sectionCount=ue.length,Ko({plan:et,formBase:p,target:m,sectionIndex:r,choices:po(et),changedAgain:!1,fresh:{}});return}const gt=et?et.merged:null,Ct=gt??T,jr=Pl({merged:!!gt,tracked:p,current:Kt.current,saved:T});gt&&z.info(f("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Xr}),jr&&p&&(p.emitted=gt,K(gt));const ns=jr||!gt?Ct:T;p&&(p.base=ns,p.sectionCount=ue.length,Vl(p,ns));const wr={onSuccess:()=>{p&&Ln.current.delete(p),g?.()},onError:Se=>{if(p?.base===ns&&_e&&(p.base=_e),Se instanceof Fa){a<xc?(qe.current.delete($),sn.current=!0,setTimeout(()=>{sn.current=!1,un(()=>{const ke=p?.emitted;return ke&&typeof ke=="object"?ke:T},r,a+1,m),qe.current.delete($),Is(pn)},yc*2**a)):qn();return}z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))}},_r=Se=>{nn.current=!0;let ke=!1;me.mutateAsync(Se).then(()=>wr.onSuccess(),Tt=>{ke=!0,wr.onError(Tt)}).finally(()=>{nn.current=!1,Is(ke?pn:0),Ps()})};if(ve.isSavedBlock){const Se=da(q,ve);if(!Se)return;_r({blockKey:Se,data:Ct,..._e?{base:{value:gt?$e:_e}}:{},rebaseOnConflict:!1});return}if(!Ue)return;const An={...M[Ue]},Ft=[...ue];if(ve.isMultivariate){const Se=pt(q,ve);if(!Se||!Ue)return;const ke=Ba(Se,y,Ct);Ft[r]=Lt(q,ve,ke)}else if(ve.isHidden){const Se=xs(q.__resolveType),ke=Se?{...q.section}:{...q},Tt=Array.isArray(ke.variants)?[...ke.variants]:[];Tt[0]&&(Tt[0]={...Tt[0],value:Ct}),ke.variants=Tt,Se?Ft[r]={...q,section:ke}:Ft[r]=ke}else ve.isLazy?Ft[r]={...q,section:Ct}:Ft[r]=Ct;if(Ie.length>1){const Se=An.sections,ke=[...Se?.variants??[]];ke[De]&&(ke[De]={...ke[De],value:Ft}),An.sections={...Se,variants:ke}}else An.sections=Ft;_r({blockKey:Ue,data:An,rebaseOnConflict:!1})};qt.current={sectionIndex:r,sectionVariantIndex:y,write:N},J.current=setTimeout(()=>{J.current=null,N()},pn)},Oo=t=>{rn.current=!1,W(t),at(0),D([]),ne(m=>m+1);const r=Q[t],a=Me[t];if(F?.(a?.isSavedBlock?a.resolveType??null:null),!r||!a)return;if(a.isMultivariate){St(r,a,0,t);return}const c=jt(r,a,v);if(!c){K(null),G(null),st(null),Ze(null),Ut(null,t,0);return}K(c.data),G(c.resolveType),st(null),Ze(null),Ut(null,t,0)},Fs=t=>{const r=t;S!==null&&(Kt.current=Ml(Kt.current,{sectionIndex:S,variantIndex:Oe.current.sectionVariantIndex,shown:je,next:r,sectionCount:Oe.current.rawSections.length})),K(r),S!==null&&un(r,S)},Un=t=>{if(!_||!v||!x||!he)return;const r={kind:"page",pageKey:_,pageName:String(he.name??""),path:String(he.path??"")},a=Er(v,r,x);a&&yn.save(_,()=>{const c=yo.getQueryData(Ti.decofile(bo))?.[_];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const m={...c,...Fn.current};return Fn.current={},t?.raw!==void 0?{...m,seo:t.raw}:t?.inner!==void 0?ul(r,a,m,t.inner):m})},Ls=(t,r)=>{_&&(Fn.current[t]=r,Un())},$o=(t,r)=>{if(!_)return;const a=Mn([...Q],t,r);S!==null&&(S===t?W(r):t<S&&r>=S?W(S-1):t>S&&r<=S&&W(S+1)),ct(a)},zo=t=>{if(!_)return;const r=Q.filter((a,c)=>c!==t);S===t?It():S!==null&&S>t&&W(S-1),ct(r)},Ho=t=>{if(!_)return;const r=Q[t];if(!r)return;const a=[...Q];a.splice(t+1,0,ca(r)),S!==null&&S>t&&W(S+1),ct(a)},Wo=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a)return;const c=a.isHidden?Ma(r):Da(r);if(!c)return;const m=[...Q];m[t]=c,S===t&&It(),ct(m)},Go=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a||a.isMultivariate)return;const c=Va(r);if(!c)return;const m=[...Q];m[t]=c,S===t&&It(),ct(m)},qo=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a?.isSavedBlock)return;const c=jt(r,a,v);if(!c?.data)return;const{name:m,...y}=c.data,p=[...Q];a.isLazy?p[t]={...r,section:y}:p[t]=y,S===t&&It(),ct(p)},Uo=t=>{if(!_)return;const r=[...Q,{__resolveType:t.resolveType}],a=r.length-1;ct(r,{onError:()=>{Oe.current.selectedSectionIndex===a&&It()}}),Ae(!1),W(a),at(0),D([]),ne(p=>p+1);const c=r[a],m=vn(r,v)[a];if(!c||!m)return;if(m.isMultivariate){St(c,m,0);return}const y=jt(c,m,v);if(!y){K(null),G(null),st(null),Ze(null);return}K(y.data),G(y.resolveType),st(null),Ze(null)},Os=t=>{Ge.current=t.append,Ae(!0)},Yo=t=>{const r=Ge.current;if(!r){Uo(t);return}r({__resolveType:t.resolveType}),Ae(!1),Ge.current=null},$s=t=>{if(S===null)return;const r=Q[S],a=Me[S];!r||!a?.isMultivariate||(at(t),D([]),ne(c=>c+1),St(r,a,t,S,!0))},Jo=t=>{if(S===null||!_)return;const r=Q[S],a=Me[S];if(!r||!a?.isMultivariate)return;const c=pt(r,a);if(!c)return;const m=Ca(c,t);if(!m){z.error(f("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const y=[...Q];y[S]=Lt(r,a,m);const p=m.variants;let R=Xe;t===Xe?R=Math.min(t,p.length-1):t<Xe&&(R=Xe-1),at(R),D([]),ne($=>$+1),St(y[S],a,R),ct(y)},Qo=t=>{if(S===null||!_)return;const r=Q[S],a=Me[S];if(!r||!a?.isMultivariate)return;const c=pt(r,a);if(!c)return;const m=Ta(c,t),y=[...Q];y[S]=Lt(r,a,m);const p=t+1;at(p),D([]),ne(R=>R+1),St(y[S],a,p),ct(y)},Xo=(t,r)=>{if(S===null||!_||t===r)return;const a=Q[S],c=Me[S];if(!a||!c?.isMultivariate)return;const m=pt(a,c);if(!m)return;const y=Aa(m,t,r),p=[...Q];p[S]=Lt(a,c,y);let R=Xe;Xe===t?R=r:t<Xe&&r>=Xe?R=Xe-1:t>Xe&&r<=Xe&&(R=Xe+1),at(R),St(p[S],c,R),ct(p)},dn=t=>{const r=t??S;if(r===null||!_)return;const a=Q[r],c=Me[r];if(!a||!c)return;const m=ka(a,c);if(!m){z.error(f("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const y=[...Q];y[r]=m.section;const p=vn(y,v)[r];if(!p?.isMultivariate){z.error(f("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}W(r),at(m.newVariantIndex),D([]),ne(R=>R+1),St(m.section,p,m.newVariantIndex,r),ct(y)},zs=()=>{if(S===null||!_)return;const t=Q[S],r=Me[S];if(!t||!r?.isMultivariate)return;const a=pt(t,r);if(!a)return;const c=Na(t,r,a);if(!c){z.error(f("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const m=[...Q];m[S]=c;const y=vn(m,v)[S];if(!y)return;at(0),st(null),Ze(null),D([]),ne(R=>R+1);const p=jt(c,y,v);p?(K(p.data),G(p.resolveType)):(K(null),G(null)),Ut(null,S,0),ct(m)},Zo=async t=>{if(ye===null||!_)return;const r=Vn(t,v);if(r){z.error(r);return}const a=Q[ye],c=Me[ye];if(!a||!c)return;const m=jt(a,c,v);if(!m){z.error(f("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const y={...m.data,name:t};try{await me.mutateAsync({blockKey:t,data:y});const p=[...Q];p[ye]={__resolveType:t},await me.mutateAsync({blockKey:_,data:mn(v,_,p,ge,Ne)}),S===ye&&It(),Fe(null),z.success(f("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(p){z.error(p instanceof Error?p.message:f("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Hs=ot?.rule;if(mt&&S===null&&B===null&&Hs){const{resolveType:t,formValue:r}=hn(Hs,v??{},x??void 0);O(t),ie(r)}const Yt=x?Zi(x):[],Yn=x&&v?ea(x,v):[],Ws=!ae&&!!(te&&x&&v),Gs=B&&x?Cn(B,x):null,Et=()=>{yt.current&&(clearTimeout(yt.current),yt.current=null),bt.current&&(clearTimeout(bt.current),bt.current=null)},Bt=async(t,r)=>{if(!(Ia(r,t,x)>0))try{await bn.mutateAsync({blockKey:t})}catch(a){z.error(a instanceof Error?a.message:f("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},qs=t=>{yt.current&&clearTimeout(yt.current),yt.current=setTimeout(()=>{const{activePageKey:r,decofile:a,variantIndex:c}=Oe.current;if(!r)return;const m={...a[r]},y={...m.sections},p=[...y.variants??[]],R=p[c],$=R?.rule;if(Ot($,a,x)){const N=$?.__resolveType??"",T=a[N],M=typeof T?.name=="string"?T.name:N,{__resolveType:ue,...be}=t;me.mutate({blockKey:N,data:Mt(ue??"",be,M)},{onSuccess:()=>g?.(),onError:Ie=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Ie.message}))});return}R&&(p[c]={...R,rule:t}),m.sections={...y,variants:p},me.mutate({blockKey:r,data:m},{onSuccess:()=>g?.(),onError:N=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:N.message}))})},pn)},Us=t=>{O(t);const r=t?Ir(t,x):{__resolveType:Br};ie(t?r:{}),qs(r)},Ys=t=>{const r=t;ie(r);const a=B?{__resolveType:B,...r}:{...r};qs(a)},Js=async t=>{Et();const{activePageKey:r,decofile:a,variantIndex:c}=Oe.current;if(!r)return;const m=a[r],y=m?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const p=y;if(!Array.isArray(p.variants))return;const R=[...p.variants],$=R[c];if(!$)return;const N=Vt($.rule,a,x),T=Zt(t);R[c]={...$,rule:T};const M={...a,[r]:{...m,sections:{...p,variants:R}}},{resolveType:ue,formValue:be}=hn(T,M,x??void 0);O(ue),ie(be);try{await me.mutateAsync({blockKey:r,data:M[r]}),N&&N!==t&&await Bt(N,M),g?.()}catch(Ie){z.error(Ie instanceof Error?Ie.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Qs=t=>{bt.current&&clearTimeout(bt.current);const{selectedSectionIndex:r,sectionVariantIndex:a}=Oe.current;r!==null&&(bt.current=setTimeout(()=>{const{rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(!p)return;const N=c[r],T=m[r];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const be=(M.variants??[])[a]?.rule;if(Ot(be,y,x)){const q=be?.__resolveType??"",ve=y[q],_e=typeof ve?.name=="string"?ve.name:q,{__resolveType:$e,...dt}=t;me.mutate({blockKey:q,data:Mt($e??"",dt,_e)},{onSuccess:()=>g?.(),onError:et=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:et.message}))});return}const Ie=Fr(M,a,t),De=[...c];De[r]=Lt(N,T,Ie);const Ue=mn(y,p,De,$,R);me.mutate({blockKey:p,data:Ue},{onSuccess:()=>g?.(),onError:q=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},pn))},ei=t=>{st(t);const r=t?Ir(t,x):{__resolveType:Br};Ze(t?r:{}),Qs(r)},ti=t=>{const r=t;Ze(r);const a=Ht?{__resolveType:Ht,...r}:{...r};Qs(a)},ni=async t=>{Et();const{selectedSectionIndex:r,sectionVariantIndex:a,rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(r===null||!p)return;const N=c[r],T=m[r];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const ue=M.variants??[],be=Vt(ue[a]?.rule,y,x),Ie=Zt(t),De=Fr(M,a,Ie),Ue=[...c];Ue[r]=Lt(N,T,De);const q=mn(y,p,Ue,$,R),ve={...y,[p]:q},{resolveType:_e,formValue:$e}=hn(Ie,ve,x??void 0);st(_e),Ze($e);try{await me.mutateAsync({blockKey:p,data:q}),be&&be!==t&&await Bt(be,ve),g?.()}catch(dt){z.error(dt instanceof Error?dt.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!ae&&!he)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.noPageFound",{currentPath:d})});if(ae&&!On)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Ke=S!==null?Me[S]??null:null,Xs=S!==null?Q[S]:null,Zs=Xs&&Ke?.isMultivariate?pt(Xs,Ke):null,Rt=Zs?ls(Zs,vt):[],_n=Math.min(Xe,Math.max(Rt.length-1,0)),Jt=Rt[_n]??null,At=Ke?.isMultivariate===!0,Jn=S!==null&&Ke!==null,Nt=Jn&&(At||!!(wn&&je)),si=Nt&&!ae&&Ke?.isSavedBlock===!0,ut=ae||si,er=ae?Ns:Ke?.label??"",ri=Ht&&x?Cn(Ht,x):null,tr=(t,r)=>r&&P?`${t} · ${r}`:t,nr=Ke?Ke.variantOf??Ke.label:"",oi=(()=>{const t=At&&Jt?Jt.label:null;return t?P?[tr(nr,t)]:[Ke.label,t]:[Ke?.label??""]})(),Qn=tr(he?.name??"",mt?ot?.label:null),kn=Nt&&(!ae||I.length>0)?ae?[Ns,...I]:[Qn,...oi,...I]:[],sr=ce&&he?[he.name,"SEO",...ws]:[],rr=f("sectionsEditor.pageVariantTabs.variantsLabel"),or=nt&&he?[he.name,rr]:pe&&he&&Ke?[Qn,nr,rr]:[],En=or.length>0?or:sr.length>0?sr:ut?kn.length>0?kn:[er]:kn.length>0?kn:[Qn],ir=Jn&&!At&&!Ke?.isHidden&&!!_,ii=ut||!ae&&mt&&!!ot||ir,ai=Jn&&!At&&!ae&&I.length===0&&!!Ke&&ro(Ke)&&!!_,li=P&&Nt&&!pe&&At&&I.length===0&&!!Jt,ar=P&&I.length>0?Rr(I[I.length-1]):null,ci=I.length>1?Rr(I[I.length-2]):null,lr=ut?er:Nt?Ke?.label??"":he?.name??"",ui=nt||pe?f("sectionsEditor.pageVariantTabs.variantsLabel"):ce?f("sectionsEditor.panelSections.seo"):ar??lr,cr=pe?Ke?.variantOf??Ke?.label??"":nt||ce?he?.name??"":ar?ci??lr:ut?f("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Nt?he?.name??"":he?.path??"",Xn=!nt&&!pe&&!ce&&!Nt&&!ut,di=!P&&!ce&&!ae&&At&&I.length===0,fn=()=>{if(!_)return;Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const t=v[_],r=Ea(t.sections,Q);if(!r)return;const a=Ra(r);me.mutate({blockKey:_,data:{...t,sections:r}},{onSuccess:()=>{xe(a),W(null),K(null),G(null),D([]),ie(null),O(null)},onError:c=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},Rn=(t,r,a)=>{if(!_)return;Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const c=v[_],m=c.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const y=m;if(!Array.isArray(y.variants))return;const p=t([...y.variants]);if(!p)return;const R=Ka(y,p),$={...v,[_]:{...c,sections:R}};me.mutate({blockKey:_,data:$[_]},{onSuccess:()=>{r?.();const N=typeof a=="string"?[a]:a??[];(async()=>{for(const T of N)await Bt(T,$)})()},onError:N=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:N.message}))})},Zn=t=>{fe(null),xe(t),W(null),K(null),G(null),D([]);const r=Ne[t]?.rule,{resolveType:a,formValue:c}=hn(r,v??{},x??void 0);O(a),ie(c),Wn(Ne.map(m=>({rule:m.rule})),t)},ur=(t,r)=>{if(t===r)return;let a=ge;ge===t?a=r:t<ge&&r>=ge?a=ge-1:t>ge&&r<=ge&&(a=ge+1),xe(a);const c=Mn(Ne.map(m=>({rule:m.rule})),t,r);Wn(c,a),Rn(m=>Mn(m,t,r))},dr=t=>{const r=Ne[t]?.rule,a=Vt(r,v??{},x??void 0);Rn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{Ne.length-1===1?xe(0):t<ge?xe(ge-1):t===ge&&xe(Math.max(0,t-1)),W(null),K(null),G(null),D([]),ie(null),O(null)},a)},fi=()=>{const t=Ne.map((r,a)=>({variant:r,index:a})).filter(({variant:r})=>!Pa(r.rule)).map(({variant:r})=>Vt(r.rule,v??{},x??void 0)).filter(r=>!!r);Rn(r=>{const a=La({variants:r}),c=r[a];return c?[{...c,rule:Oa()}]:null},()=>{xe(0),W(null),K(null),G(null),D([]),ie(null),O(null),se(!1)},t)},fr=t=>{Rn(r=>$a(r,t),()=>{xe(t+1),W(null),K(null),G(null),D([]),ie(null),O(null)})},mi=async(t,r)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const a=Oe.current.activePageKey,c=Oe.current.decofile;if(!a)return;const m=c[a],y=m.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const p=y;if(!Array.isArray(p.variants))return;const R=[...p.variants],$=R[t];if(!$?.rule||typeof $.rule!="object"){z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const N=$.rule,T=r.trim();Gt(!0);try{if(!T){if(!Ot(N,c,x)){fe(null);return}const Ue=N.__resolveType??"";R[t]={...$,rule:cs(N,c,x)};const q={...c,[a]:{...m,sections:{...p,variants:R}}};await me.mutateAsync({blockKey:a,data:q[a]}),await Bt(Ue,q),fe(null),g?.();return}const M=us(N,c,x);if(!M){z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(M.blockKey){await me.mutateAsync({blockKey:M.blockKey,data:Mt(M.resolveType,M.data,T)}),fe(null),g?.();return}const ue=Tn(T),be=Vn(ue,c);if(be){z.error(be);return}const Ie=Mt(M.resolveType,M.data,T);let De=null;try{await me.mutateAsync({blockKey:ue,data:Ie}),De=ue,R[t]={...$,rule:Zt(ue)},await me.mutateAsync({blockKey:a,data:{...m,sections:{...p,variants:R}}}),De=null}catch(Ue){throw De&&await bn.mutateAsync({blockKey:De}).catch(()=>{}),Ue}fe(null),z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:T})),g?.()}catch(M){z.error(M instanceof Error?M.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}},pi=async(t,r)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{selectedSectionIndex:a,rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(a===null||!p)return;const N=c[a],T=m[a];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const ue=M.variants??[],be=ue[t];if(!be?.rule||typeof be.rule!="object"){z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Ie=be.rule,De=r.trim();Gt(!0);const Ue=async q=>{const ve={...M,variants:q},_e=[...c];_e[a]=Lt(N,T,ve);const $e=mn(y,p,_e,$,R);return await me.mutateAsync({blockKey:p,data:$e}),{...y,[p]:$e}};try{if(!De){if(!Ot(Ie,y,x)){Pe(null);return}const et=Ie.__resolveType??"",gt=[...ue];gt[t]={...be,rule:cs(Ie,y,x)};const Ct=await Ue(gt);await Bt(et,Ct),Pe(null),g?.();return}const q=us(Ie,y,x);if(!q){z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(q.blockKey){await me.mutateAsync({blockKey:q.blockKey,data:Mt(q.resolveType,q.data,De)}),Pe(null),g?.();return}const ve=Tn(De),_e=Vn(ve,y);if(_e){z.error(_e);return}const $e=Mt(q.resolveType,q.data,De);let dt=null;try{await me.mutateAsync({blockKey:ve,data:$e}),dt=ve;const et=[...ue];et[t]={...be,rule:Zt(ve)},await Ue(et),dt=null}catch(et){throw dt&&await bn.mutateAsync({blockKey:dt}).catch(()=>{}),et}Pe(null),z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:De})),g?.()}catch(q){z.error(q instanceof Error?q.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}},mr=async(t,r,a)=>{K(a);try{await me.mutateAsync({blockKey:t,data:a})}catch(c){throw K(m=>m===a?r:m),c}},hi={rename:async(t,r,a)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{activePageKey:c,decofile:m}=Oe.current;if(!c)return;const y=Array.isArray(t.variants)?[...t.variants]:[],p=y[r],R=p?.rule&&typeof p.rule=="object"?p.rule:void 0,$=async T=>{const M={...t,variants:T};return await mr(c,t,M),{...m,[c]:M}},N=vc(R,a,m,x);if(N.kind!=="noop"){if(N.kind==="error"){z.error(N.reason==="no-matcher-rule"?f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):N.reason==="unreadable-rule"?f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):N.message??f("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Gt(!0);try{if(N.kind==="inline"){const M=[...y];M[r]={...p,rule:N.inlinedRule};const ue=await $(M);await Bt(N.blockKey,ue),g?.();return}if(N.kind==="updateBlock"){await me.mutateAsync({blockKey:N.blockKey,data:N.blockData}),g?.();return}let T=null;try{await me.mutateAsync({blockKey:N.blockId,data:N.blockData}),T=N.blockId;const M=[...y];M[r]={...p,rule:N.reference},await $(M),T=null}catch(M){throw T&&await bn.mutateAsync({blockKey:T}).catch(()=>{}),M}z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),g?.()}catch(T){z.error(T instanceof Error?T.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}}},selectGlobal:async(t,r,a)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{activePageKey:c,decofile:m}=Oe.current;if(!c)return;const y=Array.isArray(t.variants)?[...t.variants]:[],p=y[r];if(!p)return;const R=Vt(p.rule,m,x);y[r]={...p,rule:Zt(a)};const $={...t,variants:y},N={...m,[c]:$};try{await mr(c,t,$),R&&R!==a&&await Bt(R,N),g?.()}catch(T){z.error(T instanceof Error?T.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},pr=()=>{It()},hr=t=>{xn(t),Un({inner:t})},gr=t=>{Bn(t),Un({raw:t})},vr=()=>{xn(null),Pt([])},xr=()=>en(t=>t+1),yr=()=>{yn.flush(),it(!1),xn(null),Bn(void 0),Pt([]),en(t=>t+1),E?.()},gi=()=>{se(!1),rt(!1),W(null),it(!0)},vi=()=>{ce&&yr(),W(null),se(!0)},xi=()=>rt(!0),es=t=>{if(nt&&t===0){se(!1);return}if(pe&&t<2){rt(!1),t===0&&W(null);return}if(ce){if(t===0){yr();return}if(t===1){Pt([]),en(a=>a+1);return}Pt(ws.slice(0,t-1)),en(a=>a+1);return}if(ae){D(I.slice(0,t)),ne(a=>a+1);return}if(t===0){pr();return}if(t===1){D([]),ne(a=>a+1);return}const r=!P&&At&&Jt?1:0;if(r===1&&t===2){D([]),ne(a=>a+1);return}D(I.slice(0,t-1-r))},ts=En.length>1?o.jsx("button",{type:"button",onClick:()=>es(ua(En.length,{isMultivariateSectionTop:di})),title:f("sectionsEditor.sectionsEditor.back"),"aria-label":f("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ut?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.jsx(ga,{className:"size-4"})}):null,yi=ut||Nt||ce?ii&&o.jsxs("div",{className:le("border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ae&&mt&&ot&&o.jsxs("button",{type:"button",onClick:pr,title:f("sectionsEditor.sectionsEditor.editingInVariant",{variant:ot.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",na),children:[o.jsx(ta,{rule:rs(ot.rule,v??{},x??void 0),matchers:Yt}),o.jsx("span",{className:"max-w-[160px] truncate",children:ot.label})]}),o.jsx("div",{className:"flex-1"}),ut&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Pn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(kt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),ir&&o.jsx(Nn,{onClick:()=>dn()})]}),ut&&o.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:f("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):o.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Ar,{pageKey:_,initialName:he.name,initialPath:he.path,onFieldChange:Ls,variant:"header"})}),o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>it(!0),children:o.jsx(Pr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>X&&_?X():Le(!0),children:o.jsx(Kr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]}),o.jsx(Nn,{onClick:fn})]}),bi=o.jsxs(o.Fragment,{children:[mt&&_&&o.jsx(Nr,{listKey:_,variants:Ne,activeIndex:ge,decofile:v??{},meta:x,matchers:Yt,onSelect:Zn,onReorder:ur,onRename:fe,onDuplicate:fr,onDelete:dr,onAdd:fn}),mt&&B!==null&&o.jsx(Cr,{className:"mt-3",children:o.jsx("div",{className:le("space-y-3",Wt&&"pointer-events-none opacity-50"),children:o.jsx(ss,{currentRt:B,currentLabel:gn(ot?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(ot?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:Us,onSelectGlobal:Js,schema:Gs,formValue:we,onChange:Ys,formKey:`${ge}:${B??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})})]}),br=o.jsxs(o.Fragment,{children:[o.jsx(sa,{listKey:`${_??""}:${S??""}`,variants:Rt.map((t,r)=>({index:r,label:t.label})),selectedIndex:_n,onSelect:$s,onRename:Pe,onDuplicate:Qo,onDelete:Jo,onRemoveAll:zs,onReorder:Xo,onAdd:()=>dn()}),o.jsx(Cr,{children:o.jsx(ss,{currentRt:Ht??"",currentLabel:gn(Jt?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(Jt?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:ei,onSelectGlobal:ni,schema:ri,formValue:xo,onChange:ti,formKey:`${S??"none"}:${_n}:${Ht??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})]}),Sr=o.jsx("div",{className:le(P?"px-2":"p-2 pt-3"),children:o.jsx(Nl,{listKey:`${_??""}-${ge}`,rawSections:Q,sections:Me,meta:x,decofile:v,selectedIndex:S,onSelect:Oo,onReorder:$o,onDelete:zo,onDuplicate:Ho,onMakeReusable:Fe,onToggleHidden:Wo,onToggleLazy:Go,onAddVariant:dn,onDetach:qo,onAddSection:()=>Ae(!0),canAddSection:Ws})}),Si=o.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[_&&he&&o.jsx(Ar,{pageKey:_,initialName:he.name,initialPath:he.path,onFieldChange:Ls}),on&&_?o.jsx(Wr,{rawSeo:Sn,innerSeo:zn,defaultResolveType:Ts,seoSchema:Vs,activeResolveType:jn,seoTypeOptions:Cs,formResetKey:_s,siteDefaultSeo:Ms,onBreadcrumbChange:Pt,onPersistRaw:gr,onInnerChange:hr,onClearForm:vr,onBumpFormKey:xr}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),ji=o.jsx(Xt,{className:"flex-1 min-h-0 [&_[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:on&&_?o.jsx(Wr,{rawSeo:Sn,innerSeo:zn,defaultResolveType:Ts,seoSchema:Vs,activeResolveType:jn,seoTypeOptions:Cs,formResetKey:_s,siteDefaultSeo:Ms,onBreadcrumbChange:Pt,onPersistRaw:gr,onInnerChange:hr,onClearForm:vr,onBumpFormKey:xr}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),wi=o.jsxs(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[mt&&_&&o.jsx(Nr,{listKey:_,variants:Ne,activeIndex:ge,decofile:v??{},meta:x,matchers:Yt,onSelect:Zn,onReorder:ur,onRename:fe,onDuplicate:fr,onDelete:dr,onAdd:fn}),mt&&B!==null&&o.jsxs("div",{className:le("px-3 border-b",ee?"pt-3 pb-5 space-y-3":"py-2"),children:[o.jsxs("button",{type:"button",onClick:()=>zt(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":ee,children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:f("sectionsEditor.sectionsEditor.variantRule")}),ee?o.jsx(ma,{className:"size-3.5 shrink-0 text-muted-foreground"}):o.jsx(pa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ee&&o.jsx("div",{className:le("space-y-3",Wt&&"pointer-events-none opacity-50"),children:o.jsx(ss,{currentRt:B,currentLabel:gn(ot?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(ot?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:Us,onSelectGlobal:Js,schema:Gs,formValue:we,onChange:Ys,formKey:`${ge}:${B??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})]}),Sr]},"editor-section-list");return o.jsx(ra,{children:o.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!P&&ts&&o.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ts}),(P||En.length>1)&&o.jsx(oa,{crumbs:En,onSelect:es,onSelectRoot:()=>{yn.flush(),U?U():es(0)}}),o.jsx("div",{className:"shrink-0",children:P?o.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[P&&ts,ut&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Pn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(kt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o.jsx("span",{className:"truncate text-sm font-semibold",children:ui}),cr&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:cr})]}),Xn&&mt&&ot&&o.jsx(Tr,{variants:Ne,activeIndex:ge,onSelect:Zn,onManage:vi,onRemoveAll:fi}),li&&o.jsx(Tr,{variants:Rt,activeIndex:_n,onSelect:$s,onManage:xi,onRemoveAll:zs}),Xn&&!mt&&o.jsx(Nn,{onClick:fn}),ai&&o.jsx(Nn,{onClick:()=>dn()}),o.jsx(ia,{}),Xn&&o.jsxs(o.Fragment,{children:[o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"outline",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:gi,children:o.jsx(Pr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),!X&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"outline",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Le(!0),children:o.jsx(Kr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):yi}),lt&&o.jsx(Jl,{open:!0,fields:Ll(lt.plan,lt.target.schema),choices:lt.choices,changedAgain:lt.changedAgain,fresh:lt.fresh,onChoose:(t,r)=>Lo({...lt.choices,[t]:r}),onApply:Fo},Sc(lt.formBase)),pe?o.jsx(Vr,{onAdd:()=>dn(),children:br},"editor-section-variants"):Nt?o.jsxs(Xt,{viewportRef:Ce,onBlur:Ks,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!P&&At&&Rt.length>0&&I.length===0&&br,o.jsx(Mr,{activeSchema:wn,formValue:je,formResetKey:tt,onFormChange:Fs,onBreadcrumbChange:D,breadcrumbPath:I,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:v,onSaveReferencedBlock:tn,sandbox:ln,previewBaseUrl:te,onRequestAddSection:Os,onVariantMatcherOp:ae?hi:void 0})]},"editor-section-form"):ae?o.jsx(Xt,{viewportRef:Ce,onBlur:Ks,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx(Mr,{activeSchema:wn,formValue:je,formResetKey:tt,onFormChange:Fs,onBreadcrumbChange:D,breadcrumbPath:I,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:v,onSaveReferencedBlock:tn,sandbox:ln,previewBaseUrl:te,onRequestAddSection:Os})},"editor-global-block"):ce?P?o.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"p-3",children:Si})},"editor-seo"):ji:nt?o.jsx(Vr,{onAdd:fn,children:bi},"editor-variants"):P?o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"py-2",children:Sr})}),o.jsx("div",{className:"shrink-0 border-t p-2",children:o.jsx(ms,{canAddSection:Ws,onAddSection:()=>Ae(!0)})})]},"editor-section-list"):wi,o.jsx(aa,{open:ye!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:ye!==null?Tn(Me[ye]?.label??""):"",isPending:me.isPending,onSubmit:Zo}),te&&o.jsx(fl,{open:Qe,onOpenChange:t=>{Ae(t),t||(Ge.current=null)},meta:x,decofile:v,previewBaseUrl:te,onSelect:Yo}),We&&_&&v&&o.jsx(ya,{open:We,onOpenChange:Le,pageKey:_,decofile:v}),Te!==null&&o.jsx(Dr,{open:!0,initialName:Ot(Ne[Te]?.rule,v??{},x??void 0)?gn(Ne[Te]?.rule,v??{},vt,x??void 0):"",autoLabel:vt(rs(Ne[Te]?.rule,v??{},x??void 0)),isPending:Wt,onSubmit:async t=>{await mi(Te,t)},onOpenChange:t=>{!t&&!Wt&&fe(null)}}),Ve!==null&&o.jsx(Dr,{open:!0,initialName:Ot(Rt[Ve]?.rule,v??{},x??void 0)?gn(Rt[Ve]?.rule,v??{},vt,x??void 0):"",autoLabel:vt(rs(Rt[Ve]?.rule,v??{},x??void 0)),isPending:Wt,onSubmit:async t=>{await pi(Ve,t)},onOpenChange:t=>{!t&&!Wt&&Pe(null)}})]})})}export{wf as SectionsEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,b as ve,j as o,r as ee,at as je,B as Se,h as ke}from"./index-bl_DQ3mH.js";import{$ as fe}from"./agent-icon-BdZdLCky.js";import{S as ue}from"./scroll-area-1S72VGW0.js";import{K as xe,a1 as Ne,o as we,q as _e,a2 as Ee,n as Pe,as as Te}from"./runnable-block-editor-fWbFWGvz.js";import{r as Fe}from"./claim-phase-copy-gKkPnPW4.js";import{u as Re,a as Ce,P as Ke}from"./page-seo-form-DdXyS1MG.js";import{a as ye}from"./Image01-D8Dg78Ju.js";import"./AlertCircle-BILwGqjV.js";import"./Tool01-BSpg9N8Q.js";import"./ArrowUp-CFc2wNu3.js";import"./ArrowLeft-DlRqrbst.js";import"./LinkBroken01-BBYM52IU.js";import"./ShoppingBag01-Brrt7Bh6.js";import"./ZoomOut-Bnst3wtU.js";import"./Building02-QB_UI3sB.js";import"./CheckCircle-CG1RvCMD.js";import"./ChevronUp-BrMcnDd0.js";import"./ChevronSelectorVertical-23OZgHQl.js";import"./UserSquare-BXjBRbTF.js";import"./Copy01-QpufVNbj.js";import"./CreditCard01-W1zS1W7o.js";import"./DotsVertical-E-CAHxZx.js";import"./Globe04-C2IFbCwJ.js";import"./SwitchHorizontal01-B5sfCWHV.js";import"./Key01-CCpcNn9J.js";import"./Link01-Dw-VkUVV.js";import"./Monitor01-596xyLh3.js";import"./Sun-BmhcFIJl.js";import"./Play-CIe1tupB.js";import"./Plus-DTyq8wfJ.js";import"./SearchMd-DnZ_sK_U.js";import"./Trash01-uPItCfKQ.js";import"./Upload01-ClSeM0gf.js";import"./User01-DabbLHAZ.js";import"./Users01-Dt36FENA.js";import"./XClose-BMDlg-34.js";import"./index-BdQq_4o_.js";import"./input-B6YAOx07.js";import"./usage-stats-CAukzrpg.js";import"./tool-namespace-uRsPbj-p.js";import"./form-D6DHFxsw.js";import"./label-Bqj_xjz9.js";import"./utils-CVEq3hMx.js";import"./markdown-5DzLzA6E.js";import"./use-copy-2j0k06rN.js";import"./location-BjlyegC2.js";import"./use-mobile-Di3PCVWm.js";import"./use-panel-navigate-c5H4a21L.js";import"./thread-route-CR0TIP8s.js";import"./use-project-scope-A4YCdR4N.js";import"./repository-binding-BTsmo_dA.js";import"./use-mcp-client-DuTNn1dc.js";import"./auth-CTn9OsYL.js";import"./tooltip-COqLwkid.js";import"./index-B5IA1qMq.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-D8zpT0sX.js";import"./thread-intent-CG-CCDLs.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-B66Eygyb.js";import"./task-board-kbcRVMI1.js";import"./schema-kVE-1hbs.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-DszOftwV.js";import"./autosend-Cr5TlS-x.js";import"./use-ai-providers-IjG3zzka.js";import"./use-chat-navigation-DLnmXNT9.js";import"./use-organization-settings-BOGRgJjV.js";import"./icon-button-d9uOvdxM.js";import"./file-type-icon-C-_1hLql.js";import"./shell-layout-Bk6uPKMe.js";import"./avatar-DNs314ny.js";import"./use-clock-tick-zaL95TTy.js";import"./command-DFd1c5Z5.js";import"./index-Dhdyv2s0.js";import"./integration-icon-DogZfPWq.js";import"./project-icon-DsUbDdQC.js";import"./new-project-dialog-C5lJfUJ3.js";import"./repository-import-picker-D5xDiyD_.js";import"./use-navigate-to-agent-Cu9cZhs8.js";import"./repository-picker-DExxlkis.js";import"./useInfiniteQuery-DeMEFTdd.js";import"./infiniteQueryObserver-rUCOtzeA.js";import"./collection-search-q0ogFMFh.js";import"./use-debounced-value-Dju-tMu1.js";import"./required-auth-layout-Dzef4Ao1.js";import"./use-org-sso-B57pfGVG.js";import"./chat-draft-Bi-CpEK_.js";import"./select-WviNHwZD.js";import"./tabs-BXhvcQgN.js";import"./use-deco-credits-BtvhFk4m.js";import"./toggle-group-Q9SREgL7.js";import"./use-open-billing-url-sjDwQSEM.js";import"./index-DCmQGiOV.js";import"./checkbox-jukyyas4.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-MLSOZysn.js";import"./drawer-UzGeZrmC.js";import"./input-C1msyAUz.js";import"./suggestion-C591DFAx.js";import"./use-chat-layout-state-CVkPEEUs.js";import"./use-file-configs-BSnoYr1R.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-3vLSpQqZ.js";import"./use-org-fs-DOu4nQSr.js";import"./question-004-sINsf4GQ.js";import"./use-members-BqWTpMNp.js";import"./use-org-auth-client-DIUzAE5u.js";import"./feature-paywall-nTUHasXJ.js";import"./plan-ladder-gwROOTzi.js";import"./add-connection-dialog-BB_zBu7s.js";import"./extract-connection-data-CJhjAx3s.js";import"./metadata-D72DunRR.js";import"./connection-DSkv8Cg1.js";import"./url-slug-CUhgOgGc.js";import"./connection-card-C7Yq5GHs.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DvoMwt1e.js";import"./use-connection-gMb_8zEe.js";import"./schema-BKM3gR2B.js";import"./connection-form-helpers-BsU6F-s_.js";import"./authenticate-and-persist-oauth-bcqFV5Ih.js";import"./mcp-oauth-D_oaXY6E.js";import"./mcp-oauth-tCidCN-u.js";import"./collection-tabs-CYgVG041.js";import"./badge-BDMYkxf_.js";import"./use-infinite-scroll-CtScOz_h.js";import"./useSuspenseInfiniteQuery-CUkGf5w6.js";import"./use-task-board-events-BBlz-cBe.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DjM6V7aG.js";import"./collapsible-CSMgVqT4.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DuGbCe-D.js";import"./types-C5SQt0XZ.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-CZiDNUQZ.js";import"./use-thread-outputs-c6b1HaAz.js";import"./utils-DHYRJNUn.js";import"./monaco-editor-2Ci5R71u.js";import"./editor-KeKsFC14.js";import"./calendar-9HE_r4Hw.js";import"./use-new-blocks-editor-D9sV9o2T.js";import"./rich-text-link-control-CNQ92nZ4.js";import"./switch-CUK4V52q.js";import"./core.esm-lZvNzlYc.js";import"./sortable.esm-h3AYG-u7.js";import"./view-mode-toggle-B55pxnK_.js";import"./combobox-BTfHieW4.js";import"./alert-dialog-By0HRTrM.js";import"./sandbox-url-D3mC8qhT.js";import"./search-input-pTAwOtCG.js";import"./asset-utils-Cne_zeGQ.js";import"./sandbox-git-api-C7JbVL7R.js";function A(d){return typeof d=="string"&&d.trim()?d:void 0}function he(d,e){if(d){if(e)try{const t=new URL(d,e).href;return xe(t)}catch{return}return xe(d)}}function ze(d){if(!d)return{};const e=A(d.title),t=A(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:A(d.description),image:A(d.image),favicon:A(d.favicon)}}function De(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const $e=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function de(d){const e=T.c(10),{src:t,className:c,iconSize:v}=d,l=v===void 0?20:v;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==c||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:c,style:m}),e[1]=c,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==l?(i=o.jsx(ye,{size:l}),e[5]=l,e[6]=i):i=e[6];let n;return e[7]!==c||e[8]!==i?(n=o.jsx("div",{className:c,style:s,children:i}),e[7]=c,e[8]=i,e[9]=n):n=e[9],n}function Ie(d){const e=T.c(33),{seo:t,host:c,path:v,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(ye,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==c?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:c}),e[5]=c,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let r;e[8]!==c||e[9]!==v?(r=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[c,v]}),e[8]=c,e[9]=v,e[10]=r):r=e[10];let a;e[11]!==p||e[12]!==r?(a=o.jsxs("div",{className:"min-w-0",children:[p,r]}),e[11]=p,e[12]=r,e[13]=a):a=e[13];let h;e[14]!==n||e[15]!==a?(h=o.jsxs("div",{className:"flex items-center gap-2",children:[n,a]}),e[14]=n,e[15]=a,e[16]=h):h=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let y;e[18]!==t.title||e[19]!==l?(y=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=l,e[20]=y):y=e[20];let x;e[21]!==y?(x=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:y}),e[21]=y,e[22]=x):x=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#4d5156"},e[23]=S):S=e[23];let g;e[24]!==t.description||e[25]!==l?(g=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=l,e[26]=g):g=e[26];let b;e[27]!==g?(b=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:S,children:g}),e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==x||e[30]!==b||e[31]!==h?(j=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[h,x,b]}),e[29]=x,e[30]=b,e[31]=h,e[32]=j):j=e[32],j}function Le(d){const e=T.c(26),{seo:t,host:c,t:v}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#fff",border:"1px solid #e2e8f0"},e[0]=l):l=e[0];let s;e[1]!==t.image?(s=o.jsx(de,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==c?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:c}),e[5]=c,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==v?(f=t.title??v("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=v,e[10]=f):f=e[10];let r;e[11]!==f?(r=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=r):r=e[12];let a;e[13]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#60666c"},e[13]=a):a=e[13];let h;e[14]!==t.description||e[15]!==v?(h=t.description??v("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=v,e[16]=h):h=e[16];let u;e[17]!==h?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:a,children:h}),e[17]=h,e[18]=u):u=e[18];let y;e[19]!==u||e[20]!==m||e[21]!==r?(y=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,r,u]}),e[19]=u,e[20]=m,e[21]=r,e[22]=y):y=e[22];let x;return e[23]!==y||e[24]!==s?(x=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:l,children:[s,y]}),e[23]=y,e[24]=s,e[25]=x):x=e[25],x}function Be(d){const e=T.c(36),{seo:t,host:c,accent:v,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==l?(n=l("sectionsEditor.seoPreview.chatCardHint"),e[2]=l,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${v}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let r;e[8]!==t.image?(r=o.jsx(de,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=r):r=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#1c2024"},e[10]=a):a=e[10];let h;e[11]!==t.title||e[12]!==l?(h=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=l,e[13]=h):h=e[13];let u;e[14]!==h?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:a,children:h}),e[14]=h,e[15]=u):u=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"#60666c"},e[16]=y):y=e[16];let x;e[17]!==t.description||e[18]!==l?(x=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=l,e[19]=x):x=e[19];let S;e[20]!==x?(S=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:y,children:x}),e[20]=x,e[21]=S):S=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#8a9099"},e[22]=g):g=e[22];let b;e[23]!==c?(b=o.jsx("div",{className:"mt-0.5 text-[10px]",style:g,children:c}),e[23]=c,e[24]=b):b=e[24];let j;e[25]!==u||e[26]!==S||e[27]!==b?(j=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,S,b]}),e[25]=u,e[26]=S,e[27]=b,e[28]=j):j=e[28];let k;e[29]!==j||e[30]!==f||e[31]!==r?(k=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[r,j]}),e[29]=j,e[30]=f,e[31]=r,e[32]=k):k=e[32];let N;return e[33]!==k||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,k]}),e[33]=k,e[34]=m,e[35]=N):N=e[35],N}function Oe(d){const e=T.c(39),{seo:t,host:c,accent:v,dark:l,t:s}=d,i=l?"#2b2d31":"#fff",n=l?"#00a8fc":"#1264a3",m=l?"#dbdee1":"#3b4045",p=l?"#949ba4":"#8a9099",f=l?"none":"1px solid #e2e8f0";let r;e[0]!==i||e[1]!==f?(r={background:i,border:f},e[0]=i,e[1]=f,e[2]=r):r=e[2];const a=`3px solid ${v}`;let h;e[3]!==a?(h={borderLeft:a,borderRadius:2},e[3]=a,e[4]=h):h=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let y;e[7]!==c||e[8]!==u?(y=o.jsx("div",{className:"text-[10px]",style:u,children:c}),e[7]=c,e[8]=u,e[9]=y):y=e[9];let x;e[10]!==n?(x={color:n},e[10]=n,e[11]=x):x=e[11];let S;e[12]!==t.title||e[13]!==s?(S=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=S):S=e[14];let g;e[15]!==x||e[16]!==S?(g=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:x,children:S}),e[15]=x,e[16]=S,e[17]=g):g=e[17];let b;e[18]!==m?(b={color:m},e[18]=m,e[19]=b):b=e[19];let j;e[20]!==t.description||e[21]!==s?(j=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=j):j=e[22];let k;e[23]!==b||e[24]!==j?(k=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:b,children:j}),e[23]=b,e[24]=j,e[25]=k):k=e[25];let N;e[26]!==k||e[27]!==y||e[28]!==g?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[y,g,k]}),e[26]=k,e[27]=y,e[28]=g,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(de,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==h?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:h,children:[N,w]}),e[32]=N,e[33]=w,e[34]=h,e[35]=_):_=e[35];let P;return e[36]!==_||e[37]!==r?(P=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:r,children:_}),e[36]=_,e[37]=r,e[38]=P):P=e[38],P}function Ue(d){const e=T.c(21),{platform:t,seo:c,host:v,path:l,t:s}=d;let i;e[0]!==v||e[1]!==l||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==c||e[6]!==s?(i=t.layout==="search"?o.jsx(Ie,{seo:c,host:v,path:l,t:s}):t.layout==="card"?o.jsx(Le,{seo:c,host:v,path:l,t:s}):t.layout==="chat"?o.jsx(Be,{seo:c,host:v,path:l,accent:t.color,t:s}):o.jsx(Oe,{seo:c,host:v,path:l,accent:t.color,dark:t.id==="discord",t:s}),e[0]=v,e[1]=l,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=c,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let r;e[15]!==m||e[16]!==f?(r=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=r):r=e[17];let a;return e[18]!==n||e[19]!==r?(a=o.jsxs("div",{children:[r,n]}),e[18]=n,e[19]=r,e[20]=a):a=e[20],a}function Ae(d){const e=T.c(18),{seo:t,url:c,path:v}=d,l=v===void 0?"/":v,s=ve();let i,n,m;if(e[0]!==t||e[1]!==c){const x=ze(t);i=x,n=he(x.image,c),m=he(x.favicon,c),e[0]=t,e[1]=c,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let r;e[9]!==c?(r=De(c),e[9]=c,e[10]=r):r=e[10];const a=r,h=l==="/"?"":l;let u;e[11]!==h||e[12]!==a||e[13]!==s||e[14]!==f?(u=$e.map(x=>o.jsx(Ue,{platform:x,seo:f,host:a,path:h,t:s},x.id)),e[11]=h,e[12]=a,e[13]=s,e[14]=f,e[15]=u):u=e[15];let y;return e[16]!==u?(y=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=y):y=e[17],y}function Ai(d){const e=T.c(70),{orgSlug:t,virtualMcpId:c,branch:v,decofile:l,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,r=ve(),a=Ne(l,i,s),h=a?.seoData,u=i.kind==="site"?"site":i.pageKey,[y,x]=ee.useState(u),[S,g]=ee.useState(null),[b,j]=ee.useState(0),[k,N]=ee.useState(void 0);y!==u&&(x(u),g(null),N(void 0),j(Ge));const{persistSeo:w,persistRawSeo:_,flush:P,isPending:te}=Re({orgSlug:t,virtualMcpId:c,branch:v,target:i,resolved:a,onSaved:m}),M=i.kind==="page",ge=M?a?.rawSeoData:void 0,U=k!==void 0?k:ge,be=M?we(U)??void 0:void 0,E=S??be??h??{},F=a?Ce(E,a):null,K=F&&(!M||_e(U))?Fe(F,s):null;let G;e[0]!==s?(G=Ee(s),e[0]=s,e[1]=G):G=e[1];const oe=G;let R,H;e[2]!==l||e[3]!==E||e[4]!==s||e[5]!==i.kind?(R=i.kind==="page"?Pe(l,s)?.seoData??{}:{},H=i.kind==="page"?Ve(R,E):E,e[2]=l,e[3]=E,e[4]=s,e[5]=i.kind,e[6]=R,e[7]=H):(R=e[6],H=e[7]);const ie=H;let V;e[8]!==w||e[9]!==a||e[10]!==g?(V=C=>{if(!a)return;const pe=C;g(pe),w(pe)},e[8]=w,e[9]=a,e[10]=g,e[11]=V):V=e[11];const se=V;let q;e[12]!==g?(q=()=>g(null),e[12]=g,e[13]=q):q=e[13];const re=q;let W;e[14]!==j?(W=()=>j(Me),e[14]=j,e[15]=W):W=e[15];const le=W;let J;e[16]!==P||e[17]!==f?(J=()=>{P(),f?.()},e[16]=P,e[17]=f,e[18]=J):J=e[18];const ae=J,z=i.kind==="page"?i.path:"/";let Q;e[19]!==z||e[20]!==n||e[21]!==i.kind?(Q=i.kind==="page"&&n?He(z,n):n??null,e[19]=z,e[20]=n,e[21]=i.kind,e[22]=Q):Q=e[22];const ce=Q;let X;e[23]!==a||e[24]!==r||e[25]!==i.kind?(X=i.kind==="site"?r("sectionsEditor.seoEditor.noSiteSeoBlock"):r(a?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[23]=a,e[24]=r,e[25]=i.kind,e[26]=X):X=e[26];const ne=X,Y=M&&a,me=i.kind==="site"&&a&&K;let D;e[27]!==ae||e[28]!==r||e[29]!==i.kind||e[30]!==i.pageName?(D=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:ae,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:r("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",r("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[27]=ae,e[28]=r,e[29]=i.kind,e[30]=i.pageName,e[31]=D):D=e[31];let $;e[32]!==te?($=te&&o.jsx(ke,{className:"size-3.5 text-muted-foreground"}),e[32]=te,e[33]=$):$=e[33];let I;e[34]!==p||e[35]!==r||e[36]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(Se,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(fe,{size:14}),r("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[34]=p,e[35]=r,e[36]=i.kind,e[37]=I):I=e[37];let L;e[38]!==$||e[39]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[$,I]}),e[38]=$,e[39]=I,e[40]=L):L=e[40];let B;e[41]!==L||e[42]!==D?(B=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[D,L]}),e[41]=L,e[42]=D,e[43]=B):B=e[43];let O;e[44]!==F||e[45]!==le||e[46]!==re||e[47]!==oe||e[48]!==U||e[49]!==E||e[50]!==ne||e[51]!==b||e[52]!==se||e[53]!==z||e[54]!==_||e[55]!==w||e[56]!==ie||e[57]!==ce||e[58]!==a||e[59]!==K||e[60]!==g||e[61]!==N||e[62]!==Y||e[63]!==me||e[64]!==R||e[65]!==r?(O=!a||!Y&&!me?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ne}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:r("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx(Ke,{rawSeo:U,innerSeo:E,defaultResolveType:oe,seoSchema:K,activeResolveType:F,seoTypeOptions:a.seoTypeOptions,formResetKey:b,siteDefaultSeo:R,onPersistRaw:C=>{N(C),_(C)},onInnerChange:C=>{g(C),w(C)},onClearForm:re,onBumpFormKey:le})]}):K&&F&&o.jsx(Te,{schema:K,resolveType:F,value:E,formResetKey:b,onChange:se})})}),o.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(Ae,{seo:ie,url:ce,path:z})})})]}),e[44]=F,e[45]=le,e[46]=re,e[47]=oe,e[48]=U,e[49]=E,e[50]=ne,e[51]=b,e[52]=se,e[53]=z,e[54]=_,e[55]=w,e[56]=ie,e[57]=ce,e[58]=a,e[59]=K,e[60]=g,e[61]=N,e[62]=Y,e[63]=me,e[64]=R,e[65]=r,e[66]=O):O=e[66];let Z;return e[67]!==B||e[68]!==O?(Z=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[B,O]}),e[67]=B,e[68]=O,e[69]=Z):Z=e[69],Z}function Me(d){return d+1}function Ge(d){return d+1}function He(d,e){try{return new URL(d,e).href}catch{return e}}function Ve(d,e){const t=e.__resolveType,c=d.__resolveType;if(typeof t=="string"&&typeof c=="string"&&t!==c)return{...e};const v={...d};for(const[l,s]of Object.entries(e))l!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(v[l]=s));return v}export{Ai as SeoEditor};
|