decocms 4.500.0 → 4.500.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-CHPU_j8T.js → ActiveShapeUtils-CeZzOoVf.js} +1 -1
- package/dist/client/assets/{AlertCircle-CgfWDsMW.js → AlertCircle-D4iOZ3Bs.js} +1 -1
- package/dist/client/assets/{AreaChart-CZuIkHuk.js → AreaChart-CUWmFHwI.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BkyozCr0.js → ArrowLeft-iygYSRbQ.js} +1 -1
- package/dist/client/assets/{ArrowUp-C0O7U47F.js → ArrowUp-KCSPs-fi.js} +1 -1
- package/dist/client/assets/{BarChart-D_Vp8_nk.js → BarChart-gbo6r8aY.js} +1 -1
- package/dist/client/assets/{Building02-C5UvSZSt.js → Building02-EbX1A23K.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CYT1jRTo.js → CategoricalChart-DbqLrstZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-B1cLRmIj.js → CheckCircle-CoJfU94i.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-bEeSv3mr.js → ChevronSelectorVertical-DqpRXMOM.js} +1 -1
- package/dist/client/assets/{ChevronUp-D_qU7VrJ.js → ChevronUp-BSm7AtSf.js} +1 -1
- package/dist/client/assets/{Copy01-CT_cEqll.js → Copy01-DlA26aBh.js} +1 -1
- package/dist/client/assets/{CreditCard01-DFGzM4td.js → CreditCard01-CXGPcE51.js} +1 -1
- package/dist/client/assets/{DotsVertical-CGu7Zbqo.js → DotsVertical-CTugBooH.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BOQmu79L.js → ErrorBarContext-CJdWK23B.js} +1 -1
- package/dist/client/assets/{Globe04-DtoCZsmb.js → Globe04-DDiW2Onm.js} +1 -1
- package/dist/client/assets/{Image01-CyU1b2Nz.js → Image01-BjUHwjIr.js} +1 -1
- package/dist/client/assets/{Key01-CV4MPPMx.js → Key01-DMnhMxC3.js} +1 -1
- package/dist/client/assets/{Link01-BL0KHGWk.js → Link01-DKypA3Uf.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CImL6HGl.js → LinkBroken01-Cjxu7rCw.js} +1 -1
- package/dist/client/assets/{Monitor01-jDiltU3l.js → Monitor01-CTL-UG2p.js} +1 -1
- package/dist/client/assets/{Play-HeD-LWQ6.js → Play-NZWCLDah.js} +1 -1
- package/dist/client/assets/{Plus-BzLmRH_e.js → Plus-DLTeBarI.js} +1 -1
- package/dist/client/assets/{SearchMd-X-m-ot0f.js → SearchMd-BsNWsFDv.js} +1 -1
- package/dist/client/assets/{Sector-Dk1WFIe-.js → Sector-BRgBibA6.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-C30WMfg1.js → ShoppingBag01-CWlRU3Ye.js} +1 -1
- package/dist/client/assets/{Sun-D5cuTnns.js → Sun-DhZMu2lN.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-iT36Ixqz.js → SwitchHorizontal01-DZEm8csq.js} +1 -1
- package/dist/client/assets/{Tool01-BLdqmAM-.js → Tool01-o_nJ7Y1x.js} +1 -1
- package/dist/client/assets/{Trash01-DkcAHDGj.js → Trash01-JZaZB0vu.js} +1 -1
- package/dist/client/assets/{Upload01-CJxfk4_B.js → Upload01-CpEePL13.js} +1 -1
- package/dist/client/assets/{User01-CuJbE_Yd.js → User01-BGOQS9vx.js} +1 -1
- package/dist/client/assets/{UserSquare-BlSFjBrQ.js → UserSquare-BFlEW2x5.js} +1 -1
- package/dist/client/assets/{Users01-CgCEjxiR.js → Users01-C9dOtgmV.js} +1 -1
- package/dist/client/assets/{XAxis-B6hTknR7.js → XAxis-4jP2_ps6.js} +1 -1
- package/dist/client/assets/{XClose-BcQlXPoY.js → XClose-DO008B8R.js} +1 -1
- package/dist/client/assets/{ZoomOut-C_NtAfgt.js → ZoomOut-DA1sRe95.js} +1 -1
- package/dist/client/assets/{access-gate-0Qu33vtT.js → access-gate-DsVMqwjM.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CmVGiYmi.js → add-connection-dialog-BTQ6Snbx.js} +1 -1
- package/dist/client/assets/{agent-analytics-DbQCZ1PQ.js → agent-analytics-CpGEVH02.js} +1 -1
- package/dist/client/assets/agent-app-fS8AS09U.js +1 -0
- package/dist/client/assets/{agent-assets-B-t0qw5_.js → agent-assets-D1AunKzQ.js} +1 -1
- package/dist/client/assets/{agent-automation-AdWBGK9-.js → agent-automation-Ds-y1bNp.js} +1 -1
- package/dist/client/assets/{agent-automations-x2lM3jDX.js → agent-automations-Bhv6Y5Fg.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DygiFIri.js → agent-connect-sources-BWYssaAs.js} +1 -1
- package/dist/client/assets/agent-deck-BSKZhX9C.js +1 -0
- package/dist/client/assets/{agent-e2e-CDURPj47.js → agent-e2e-mBRBGP-4.js} +1 -1
- package/dist/client/assets/{agent-experiments-BIa2lB5Q.js → agent-experiments-aivx3wKk.js} +1 -1
- package/dist/client/assets/{agent-file-BKXQWZUy.js → agent-file-p8VPN5Ls.js} +1 -1
- package/dist/client/assets/{agent-hosting-BYQZVYMZ.js → agent-hosting-BLydMzz1.js} +1 -1
- package/dist/client/assets/{agent-icon-CsQzAnP1.js → agent-icon-DDBSTxwl.js} +1 -1
- package/dist/client/assets/agent-library-BORVKAKi.js +1 -0
- package/dist/client/assets/agent-library-file-CQVtmhou.js +1 -0
- package/dist/client/assets/{agent-monitor-CCT32NKJ.js → agent-monitor-DwF-OeKx.js} +1 -1
- package/dist/client/assets/{agent-overview-dfgPX_7d.js → agent-overview-PzlD3Gdw.js} +1 -1
- package/dist/client/assets/agent-settings-CP8WaMNS.js +1 -0
- package/dist/client/assets/{agent-site-editor-CG3fYjTa.js → agent-site-editor-BpVIjbEo.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DBqdRzpW.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-5eCWHoNS.js → agent-site-editor-content-UkRK2sPZ.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-uwuaRHqi.js → agent-site-editor-preview-CMWo8Jpl.js} +3 -3
- package/dist/client/assets/agent-view-BHgh3Lxp.js +1 -0
- package/dist/client/assets/{agent-view-guard-e44iAytb.js → agent-view-guard-CNj-ECwU.js} +1 -1
- package/dist/client/assets/{agents-list-C2x26zj4.js → agents-list-DIvEheHR.js} +1 -1
- package/dist/client/assets/{ai-providers-DwXqL2iz.js → ai-providers-Bv4VnLS0.js} +1 -1
- package/dist/client/assets/{alert-DYD14Lxr.js → alert-DYBIxnQj.js} +1 -1
- package/dist/client/assets/{alert-dialog-D2yDyccd.js → alert-dialog-DpmCpPBI.js} +1 -1
- package/dist/client/assets/{analytics-sections-CYXgA9AC.js → analytics-sections-Dv6tHtpt.js} +1 -1
- package/dist/client/assets/{api-keys-BtQl5Awe.js → api-keys-BpociG2u.js} +1 -1
- package/dist/client/assets/api-keys-DLMcrFXL.js +1 -0
- package/dist/client/assets/app-editor-CJc6hCJ6.js +1 -0
- package/dist/client/assets/{asset-utils-cuI-wo7N.js → asset-utils-BUihGB_o.js} +1 -1
- package/dist/client/assets/{auth-CsAAW7Ar.js → auth-D1PkW9Uj.js} +1 -1
- package/dist/client/assets/{auth-catchall-CDMks_Rc.js → auth-catchall-xah8Rp3j.js} +1 -1
- package/dist/client/assets/{auth-entry-Cwn8f6E3.js → auth-entry-VLEYf8tT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DFsDNY_O.js → auth-split-layout-HBBBJTJB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-HfpfV8ZS.js → authenticate-and-persist-oauth-BfNR0joU.js} +1 -1
- package/dist/client/assets/{automation-list-row-Bgtl2dei.js → automation-list-row-IGsRC78W.js} +1 -1
- package/dist/client/assets/{automation-runs-CBT3E_fm.js → automation-runs-C60W3bGo.js} +1 -1
- package/dist/client/assets/{automations-BSD8vInf.js → automations-CaS6shwH.js} +1 -1
- package/dist/client/assets/{autosend-8ZqTuUx9.js → autosend-D3KZZhDs.js} +1 -1
- package/dist/client/assets/{avatar-Da-P84-z.js → avatar-Brh_8d7a.js} +1 -1
- package/dist/client/assets/{badge-CJ5q8uJu.js → badge-Dp13ql_I.js} +1 -1
- package/dist/client/assets/{block-document-Drzpg_bb.js → block-document-Cxj1MUpK.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CJnlWxc-.js → blocks-preview-workspace-context-D7M7BwP7.js} +1 -1
- package/dist/client/assets/{blog-schema-WI1e8zgj.js → blog-schema-G4wBIdc6.js} +1 -1
- package/dist/client/assets/{board-analytics-Cla3ZHOc.js → board-analytics-DO-wkHdX.js} +1 -1
- package/dist/client/assets/{buckets-BO0Sw74J.js → buckets-C5bRLlmM.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BWoapP6S.js → build-improve-prompt-doc-DHL2uEEa.js} +1 -1
- package/dist/client/assets/{calendar-DKYy6uOJ.js → calendar-DEB-AUfC.js} +1 -1
- package/dist/client/assets/{capability-load-error-DGJphxbe.js → capability-load-error-CR2FG7xy.js} +1 -1
- package/dist/client/assets/{category-editor-C6uMv0OA.js → category-editor-DfXKd-cd.js} +1 -1
- package/dist/client/assets/{chart-CUhY88so.js → chart-CXoR26LQ.js} +1 -1
- package/dist/client/assets/{chat-context-y8u3K9Tq.js → chat-context-BR-PmAJg.js} +1 -1
- package/dist/client/assets/{chat-draft-RqSOe2VX.js → chat-draft-CWFQi3-d.js} +1 -1
- package/dist/client/assets/{checkbox-cuQOxwwj.js → checkbox-CGTvhz0x.js} +1 -1
- package/dist/client/assets/{choose-editor-DVY0m-0N.js → choose-editor-DBCIeCbR.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-kSJ81npa.js → claim-phase-copy-C0pvoElR.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BNNiQ0ff.js → cli-auth-success-Nd2PZ9ox.js} +1 -1
- package/dist/client/assets/{client-icons-k3K_Wm7m.js → client-icons-BI4heyKD.js} +1 -1
- package/dist/client/assets/{collapsible-DEfXG6Ht.js → collapsible-Cq1aFrCg.js} +1 -1
- package/dist/client/assets/{collection-detail-CUR7b1nw.js → collection-detail-ClkMaErn.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bii74DZw.js → collection-display-button-BjwUZtSd.js} +1 -1
- package/dist/client/assets/{collection-search-C-3HPALa.js → collection-search-Cp82h57b.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BI9XAUwm.js → collection-table-wrapper-BmpUFI8T.js} +1 -1
- package/dist/client/assets/{collection-tabs-BNpEfqyd.js → collection-tabs-C6HP7d51.js} +1 -1
- package/dist/client/assets/{column-rules-B7pcw_Gh.js → column-rules-CJ4d_g8W.js} +1 -1
- package/dist/client/assets/{combobox-ylZ1_mxm.js → combobox-CF6B9Wmt.js} +1 -1
- package/dist/client/assets/{command-d2fvY4gQ.js → command-BfXTTBD9.js} +1 -1
- package/dist/client/assets/{companion-mcps-section--NCFPgCd.js → companion-mcps-section-BLJLcZpb.js} +1 -1
- package/dist/client/assets/{config-BDYRd6Wk.js → config-BZYNAwT6.js} +1 -1
- package/dist/client/assets/{connect-CKDAuMYC.js → connect-FZH1ks7l.js} +1 -1
- package/dist/client/assets/{connect-layout-Ca1Vr3vz.js → connect-layout-BbzklNPm.js} +1 -1
- package/dist/client/assets/{connection-DGqqVA7M.js → connection-BTT1rt_2.js} +1 -1
- package/dist/client/assets/{connection-card-gIhz0wdg.js → connection-card-CsIFgDe8.js} +1 -1
- package/dist/client/assets/{connection-detail-B9omyXwb.js → connection-detail-BSkgGFWF.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-A2MriNrX.js → connection-form-helpers-Bg3g47y2.js} +1 -1
- package/dist/client/assets/{connections-Dh4JuodF.js → connections-BcHX4l-p.js} +1 -1
- package/dist/client/assets/{context-BnF04rBC.js → context-D9dob61q.js} +1 -1
- package/dist/client/assets/{context-menu-BD-010iM.js → context-menu-DPNtSYt0.js} +1 -1
- package/dist/client/assets/{core.esm-BH3HyyF2.js → core.esm-C90YQIGJ.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DjZlmVnS.js → create-organization-dialog-BoHINOyM.js} +1 -1
- package/dist/client/assets/{daily-pulse-BXDtpJQU.js → daily-pulse-tLPif3nO.js} +1 -1
- package/dist/client/assets/{device-hint-CN2khPPs.js → device-hint-ClxhQWtk.js} +1 -1
- package/dist/client/assets/{discover-C-mYnXQB.js → discover-BGUAZcdZ.js} +1 -1
- package/dist/client/assets/{domain-settings-BEwECWE8.js → domain-settings-C1KL1CIp.js} +1 -1
- package/dist/client/assets/{drawer-DybzZn1x.js → drawer-20Gv7XN0.js} +1 -1
- package/dist/client/assets/{editor-CBqQFFb9.js → editor-CklcmkgZ.js} +1 -1
- package/dist/client/assets/{empty-state-B4qRMioD.js → empty-state-BWSdqiOv.js} +1 -1
- package/dist/client/assets/{empty-state-b6tRqzU8.js → empty-state-CsVqjGqu.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CIO9f-TD.js → extract-connection-data-C8Idk1Oj.js} +1 -1
- package/dist/client/assets/{feature-gate-ChDRcm7b.js → feature-gate-Brul-7Vc.js} +1 -1
- package/dist/client/assets/{feature-paywall-BN5FphJ8.js → feature-paywall-B1-Kq6zS.js} +1 -1
- package/dist/client/assets/{file-explorer-DCd1-8-d.js → file-explorer-0AwiXzsI.js} +1 -1
- package/dist/client/assets/{file-preview-CNp5DdHM.js → file-preview-BTrgY74n.js} +1 -1
- package/dist/client/assets/{file-share-button-DOQq6Wrq.js → file-share-button-kQh5APqr.js} +1 -1
- package/dist/client/assets/{file-type-icon-ClWl2ykw.js → file-type-icon-Dbuavq5L.js} +1 -1
- package/dist/client/assets/flat-project-YGEAxpJq.js +1 -0
- package/dist/client/assets/{folder-icon-BO5Hlc-b.js → folder-icon-D1xnfwm_.js} +1 -1
- package/dist/client/assets/{form-Dm1N7Fdz.js → form-BZ1i_2GJ.js} +1 -1
- package/dist/client/assets/{general-CszMiv7n.js → general-C8gjvVqx.js} +1 -1
- package/dist/client/assets/{home-DT4jq_ad.js → home-BnDlnEHu.js} +1 -1
- package/dist/client/assets/{icon-button-UzqZkmgc.js → icon-button-BDbIWVW3.js} +1 -1
- package/dist/client/assets/{index-D984WV3U.js → index-4XFLhK7S.js} +2 -2
- package/dist/client/assets/{index-B4rQ5Ej9.js → index-Bs_Ow9qj.js} +1 -1
- package/dist/client/assets/{index-BkaImz4P.js → index-C0n7mPS1.js} +1 -1
- package/dist/client/assets/{index-DXSiv_GM.js → index-C8VO6rJ2.js} +3 -3
- package/dist/client/assets/{index-z9lysifj.js → index-CN8TQhg6.js} +1 -1
- package/dist/client/assets/{index-ClN0hPjk.js → index-COd_qFje.js} +1 -1
- package/dist/client/assets/{index-QP5dyfS7.js → index-CWl9v4eu.js} +1 -1
- package/dist/client/assets/{index-Dq9ehfIf.js → index-D94af8m5.js} +1 -1
- package/dist/client/assets/{index-ba_EB2Zw.js → index-DVVx4F0i.js} +1 -1
- package/dist/client/assets/{index-DiGKvbHH.js → index-DlsOrQnt.js} +1 -1
- package/dist/client/assets/{index-BA22z-aT.js → index-DrIzKTur.js} +1 -1
- package/dist/client/assets/{index-ChAMt2d-.js → index-DujNp8wX.js} +1 -1
- package/dist/client/assets/{index-CeuDCj_w.js → index-pEr2eE8n.js} +1 -1
- package/dist/client/assets/{index-redirect-8HspsPDC.js → index-redirect-BQGkKPeS.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Bmwf-SCt.js → infiniteQueryObserver-DLzEnjM8.js} +1 -1
- package/dist/client/assets/{infra-billing-DlP3vLBN.js → infra-billing-Df_WNbOe.js} +1 -1
- package/dist/client/assets/{input-C_t2NUbp.js → input-BzdgO_dK.js} +3 -3
- package/dist/client/assets/{input-CG0PFhS0.js → input-DQtH0um6.js} +1 -1
- package/dist/client/assets/{integration-icon-B4EO_1fi.js → integration-icon-BqsHjS-b.js} +1 -1
- package/dist/client/assets/{jira-icon-DAy3a9S9.js → jira-icon-CG6W0SJT.js} +1 -1
- package/dist/client/assets/{label-BszVxI8j.js → label-ByKoWpTn.js} +1 -1
- package/dist/client/assets/{layout-BsHSUbxL.js → layout-Ih9F7QDG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DCBghYlF.js → legacy-agents-deep-D4aZSj1S.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-C_9Fyd8e.js → legacy-main-redirect-CawnT8bs.js} +1 -1
- package/dist/client/assets/library-BIKWwK0_.js +1 -0
- package/dist/client/assets/{library-tab-CZxlOQVR.js → library-tab-CWnL_FfR.js} +1 -1
- package/dist/client/assets/{login-CoP-xpgM.js → login-BV5vcG2Q.js} +1 -1
- package/dist/client/assets/{markdown-C8b2SRJt.js → markdown-BW2GJSHC.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-qrtR9Z1h.js → mcp-app-renderer-fDcax7T2.js} +1 -1
- package/dist/client/assets/{mcp-oauth--_7bIOac.js → mcp-oauth-BjHElKzR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BIr9y8Ow.js → mcp-oauth-CVI2AkSu.js} +1 -1
- package/dist/client/assets/{members-DX1jVu8f.js → members-f-Grp_Zc.js} +1 -1
- package/dist/client/assets/{memory-DGqh7MMN.js → memory-CYDtZWEC.js} +1 -1
- package/dist/client/assets/{mini-report-page-DeT726Qz.js → mini-report-page-BvYGpq5f.js} +1 -1
- package/dist/client/assets/{mock-board-DiXeO9l9.js → mock-board-hNRrDjvq.js} +1 -1
- package/dist/client/assets/{monaco-editor-BmtkWb9u.js → monaco-editor-DkahnDKS.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CROD4XJo.js → monitoring-stats-row-Cx7S4sFz.js} +1 -1
- package/dist/client/assets/{multi-select-COcK2vp_.js → multi-select-BsYgOBGm.js} +1 -1
- package/dist/client/assets/{mustache-B3B0mlPh.js → mustache-D7UTScQH.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CQomS8HX.js → new-project-dialog-DdG-RgMO.js} +1 -1
- package/dist/client/assets/{oauth-callback-BAjl2hrI.js → oauth-callback-GzdTg9VJ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Dfitdf7t.js → oauth-callback-ai-provider-BANi9OcB.js} +1 -1
- package/dist/client/assets/{onboarding-DuW4ryZs.js → onboarding-w2z3NDRW.js} +1 -1
- package/dist/client/assets/{openai-conversation-klLH_0HC.js → openai-conversation-C7TUEjal.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CaTvAXwY.js → optimistic-project-sidebar-views-7fDRNM1p.js} +1 -1
- package/dist/client/assets/{organization-choice-DtdFVbBZ.js → organization-choice-DRyD5yII.js} +1 -1
- package/dist/client/assets/{orgs-BBq2qsW_.js → orgs-EvyltNU-.js} +1 -1
- package/dist/client/assets/{page-seo-form-BJN0O5_N.js → page-seo-form-0-tAzxyW.js} +1 -1
- package/dist/client/assets/{pair-D3dg1naQ.js → pair-Cm6oR2ES.js} +1 -1
- package/dist/client/assets/{plan-ladder-DUQWM1mB.js → plan-ladder-D4-VvMwX.js} +1 -1
- package/dist/client/assets/{popover-9tPVAoH5.js → popover-DGVyEQ9q.js} +1 -1
- package/dist/client/assets/{post-calendar-D9oVrQhS.js → post-calendar-CGDOG4Ay.js} +1 -1
- package/dist/client/assets/{post-editor-C2tsxtV4.js → post-editor-BFSJ6I4d.js} +1 -1
- package/dist/client/assets/{preview-content-BIpDQXJu.js → preview-content-KcSZme5m.js} +1 -1
- package/dist/client/assets/{preview-dialog-CH8GibCu.js → preview-dialog-DHH8biYM.js} +1 -1
- package/dist/client/assets/{preview-panel-CCFjojUE.js → preview-panel-CMlsnFlv.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-BoGvkEwe.js → product-picker-dialog-Bz7bVPFI.js} +1 -1
- package/dist/client/assets/{profile-BKpvrH_P.js → profile-be5NkG2U.js} +1 -1
- package/dist/client/assets/{project-app-view-0HH2t56F.js → project-app-view-BV4H0rEJ.js} +1 -1
- package/dist/client/assets/{project-feed-d2kKPzOq.js → project-feed-Dly67hgE.js} +1 -1
- package/dist/client/assets/{project-icon-DeUPWsC_.js → project-icon-CMe6LZd9.js} +1 -1
- package/dist/client/assets/project-reports-BqyykKm5.js +1 -0
- package/dist/client/assets/project-tasks-DHxi49Je.js +1 -0
- package/dist/client/assets/{projects-dI6btB5J.js → projects-CDscJwj7.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DAa4wzAP.js → projects-empty-state-VFtNQKgJ.js} +1 -1
- package/dist/client/assets/{prompts-D3LKfm14.js → prompts-CG--DGsd.js} +1 -1
- package/dist/client/assets/record-editor-CQTy2--L.js +1 -0
- package/dist/client/assets/redirect-editor-Diq4Tlsx.js +1 -0
- package/dist/client/assets/reports-Bew0urwY.js +1 -0
- package/dist/client/assets/{reports-B5aLNQGc.js → reports-CODPKkJO.js} +1 -1
- package/dist/client/assets/{reports-onboarding-D7Nsv0TX.js → reports-onboarding-D0Irch0-.js} +1 -1
- package/dist/client/assets/{reports-tab-bgB5WodW.js → reports-tab-NvqzpdHL.js} +2 -2
- package/dist/client/assets/{repositories-Du_yi0rf.js → repositories-xZsmQvzi.js} +1 -1
- package/dist/client/assets/{repository-binding-CrIQbyJh.js → repository-binding-C_InVumU.js} +1 -1
- package/dist/client/assets/{repository-import-picker-n3EYoF9U.js → repository-import-picker-Bixi7zBc.js} +1 -1
- package/dist/client/assets/{repository-picker-CjDs0ici.js → repository-picker-BHgNNGrn.js} +1 -1
- package/dist/client/assets/{require-capability-BDLtPaM5.js → require-capability-D49j17CD.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CTKRCLps.js → required-auth-layout-CxaLcttO.js} +1 -1
- package/dist/client/assets/{reset-password-XiFYESJ5.js → reset-password-Bg3-bOJi.js} +1 -1
- package/dist/client/assets/{resizable-C3INc4c7.js → resizable-sj2QiDEc.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DuWtsFCw.js → resolve-tab-icon-Benn2iaL.js} +1 -1
- package/dist/client/assets/{review-settings-BCvIwiTZ.js → review-settings-DjIYcWCV.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B2KML_yp.js → rich-text-link-control-C2ryIXD3.js} +1 -1
- package/dist/client/assets/{roles-B5KIhtIL.js → roles-8gcvGZJw.js} +1 -1
- package/dist/client/assets/{route-BwivpFZQ.js → route-C0mgkpSg.js} +1 -1
- package/dist/client/assets/route-DQYAyMBI.js +1 -0
- package/dist/client/assets/{route-nHlGvnBX.js → route-DyDxvrHS.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-v2diysES.js → runnable-block-editor-dTVVXX5v.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CtphXAh2.js → sandbox-lifecycle-context-DzcFvw1G.js} +1 -1
- package/dist/client/assets/{schema-BMqZTcjW.js → schema-DyLXU88M.js} +1 -1
- package/dist/client/assets/{scroll-area-B9YHNZjL.js → scroll-area-DYybJ63r.js} +1 -1
- package/dist/client/assets/{search-input-BJ-xb_6w.js → search-input-DJwYl_zW.js} +1 -1
- package/dist/client/assets/{search-toggle-DviE2KK7.js → search-toggle-DOVOYril.js} +1 -1
- package/dist/client/assets/{secret-picker-MDfAhcKZ.js → secret-picker-C40fL6uP.js} +1 -1
- package/dist/client/assets/{secrets-BWXZ9ADR.js → secrets-Kq6gwxOB.js} +1 -1
- package/dist/client/assets/{sections-editor-DRPdyBr7.js → sections-editor-5-gvD3vu.js} +1 -1
- package/dist/client/assets/{select-Cmhyur65.js → select-CEirlFRV.js} +1 -1
- package/dist/client/assets/{select-model-DlhjRyXh.js → select-model-5mFHKpuo.js} +1 -1
- package/dist/client/assets/{seo-editor-Cslo5GyR.js → seo-editor-DHTxrlCs.js} +1 -1
- package/dist/client/assets/{separator-XBrskDk1.js → separator-E-ZvgvRL.js} +1 -1
- package/dist/client/assets/{settings-tab-Bhjq-v1u.js → settings-tab-C9ihpTae.js} +1 -1
- package/dist/client/assets/{sheet-bMLuzpcl.js → sheet-Bs1jJD9o.js} +1 -1
- package/dist/client/assets/{shell-layout-CX2kb4As.js → shell-layout-DZBrJWAA.js} +1 -1
- package/dist/client/assets/{skills-smEsZOyf.js → skills-7xwa1ol9.js} +1 -1
- package/dist/client/assets/{slider-xDThp8gG.js → slider-ki239RUG.js} +1 -1
- package/dist/client/assets/{sortable.esm-C4yl7HRk.js → sortable.esm-Dvqn6rnz.js} +1 -1
- package/dist/client/assets/{sso-D5XcZRGg.js → sso-n5eUQ_Xy.js} +1 -1
- package/dist/client/assets/{suggestion-B9eDgKDC.js → suggestion-DHADwupQ.js} +1 -1
- package/dist/client/assets/{switch-D6SJRikA.js → switch-BD8_vvWq.js} +1 -1
- package/dist/client/assets/{symbol-8pL_EbyE.js → symbol-Dx-KpnN7.js} +1 -1
- package/dist/client/assets/{synced-repos-CvOi5sDr.js → synced-repos-B-5rRFwb.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-B5Fq5S50.js → tab-icon-glyph-B9KZAh18.js} +1 -1
- package/dist/client/assets/{table-BVuWDAYC.js → table-B1C2ctbL.js} +1 -1
- package/dist/client/assets/{tabs-CJiVz1UY.js → tabs-tkvg_YSq.js} +1 -1
- package/dist/client/assets/{task-board-BypYXBtD.js → task-board-DcolQ15W.js} +1 -1
- package/dist/client/assets/{task-route-CxLDxVTy.js → task-route-Dp4TtKUe.js} +1 -1
- package/dist/client/assets/{task-status-DR_ZGtmT.js → task-status-CF9KSEEA.js} +1 -1
- package/dist/client/assets/taskboard-analytics-C_zsZRzy.js +1 -0
- package/dist/client/assets/{tasks-pRlF9aKa.js → tasks-B6gqzeMQ.js} +1 -1
- package/dist/client/assets/tasks-O62NX5lN.js +1 -0
- package/dist/client/assets/{textarea-C3QvYVs6.js → textarea-BpBHfDQd.js} +1 -1
- package/dist/client/assets/{thread-analytics-CVYD56Lv.js → thread-analytics-DfV1z1-8.js} +1 -1
- package/dist/client/assets/{thread-button-Dnwv5gXz.js → thread-button-BNBHV_Wu.js} +1 -1
- package/dist/client/assets/{thread-intent-BouO_OhM.js → thread-intent-DqexYQAC.js} +1 -1
- package/dist/client/assets/{thread-route-Dp3ppEkH.js → thread-route-B-yx1tFW.js} +1 -1
- package/dist/client/assets/{thread-route-CzzxiajL.js → thread-route-BXR-ufCz.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Z8jKG5ht.js → thread-sheet-body-Bgp-QwJy.js} +1 -1
- package/dist/client/assets/{time-range-picker-DE7fkhif.js → time-range-picker-DILwkH82.js} +1 -1
- package/dist/client/assets/{toggle-group-BxPPN08u.js → toggle-group-SSpwI-zE.js} +1 -1
- package/dist/client/assets/{tool-namespace-C5Z8tVC2.js → tool-namespace-CsdkV2uo.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-539CZpjb.js → toolbar-icon-button-CIXm0pyl.js} +1 -1
- package/dist/client/assets/{tooltip-CfH7_UR9.js → tooltip-CUk78XFR.js} +1 -1
- package/dist/client/assets/{tooltipContext-Dt4926A5.js → tooltipContext-BY8Qgc3U.js} +1 -1
- package/dist/client/assets/{track-D8kXLyAV.js → track-DDd4x4-Y.js} +1 -1
- package/dist/client/assets/{types-PjheW3sm.js → types-DPbXDbOS.js} +1 -1
- package/dist/client/assets/{url-slug-D7hdnLPq.js → url-slug-CFKzH8Z4.js} +1 -1
- package/dist/client/assets/{usage-stats-BcmMK-YO.js → usage-stats-wClM7TZ-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CeHzBmwD.js → use-ai-providers-CAEoYJwC.js} +1 -1
- package/dist/client/assets/{use-automations-DLk4Zq7Y.js → use-automations-DXjaaH0T.js} +1 -1
- package/dist/client/assets/{use-autosave-5IDmaWA6.js → use-autosave-BOlmY_xu.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-C4y1ngrz.js → use-chat-layout-state-BYcPLpFV.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-pwxRnoh5.js → use-chat-navigation-CKcbdotk.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DcGl_y28.js → use-clock-tick-CwQv-OCe.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DmQTaaXP.js → use-connect-companion-PBAraKBj.js} +1 -1
- package/dist/client/assets/{use-connection-B96BwbcD.js → use-connection-DldRXuvq.js} +1 -1
- package/dist/client/assets/{use-copy-COXbZ1Gm.js → use-copy-BC3Fmh27.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BuymUE2O.js → use-create-virtual-mcp-D8P6CVcB.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-D2o3Y11s.js → use-date-fns-locale-DquxgLdE.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Yq56G4iL.js → use-debounced-autosave-mYSK51JG.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BZK5uiHm.js → use-debounced-value-CNkuXNOW.js} +1 -1
- package/dist/client/assets/{use-deco-credits-COvQvXnV.js → use-deco-credits-DKtKOwIN.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BDPMNEXz.js → use-decopilot-events-DH5jig6y.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DT6vWhGX.js → use-delete-connection-Dzg9cQZm.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CoVHfZYT.js → use-deployment-admin-CyBWrUgL.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-peTgVhMP.js → use-ensure-project-folder-CdHM_a-9.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BDHxUOYh.js → use-fast-preview-draft-url-Cuacxxyo.js} +1 -1
- package/dist/client/assets/{use-file-configs-DoW1VYTz.js → use-file-configs-DsMQGho1.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-1WuTfkvL.js → use-infinite-scroll-C0Ths8NM.js} +1 -1
- package/dist/client/assets/{use-join-requests-uEHIq-wW.js → use-join-requests-CoVXbvos.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-eZgXms3O.js → use-main-panel-tabs-DlD2zr1g.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-GSONXJ6Y.js → use-mcp-auth-status-B2t4xmcR.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D8-rDWEf.js → use-mcp-client-C5uLw7Lc.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-9xOCFCVM.js → use-mcp-prompts-Dxu80Ack.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BYNW1IvH.js → use-mcp-tools-Cm9CvYn6.js} +1 -1
- package/dist/client/assets/{use-members-DuiAoVt0.js → use-members-C9_S9nP9.js} +1 -1
- package/dist/client/assets/{use-mobile-Cz-N6vVG.js → use-mobile-Buz9Esa_.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CWPsHr0w.js → use-navigate-to-agent-C41zpB_Z.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-DuP8uKZj.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CHALVI7F.js → use-open-billing-url-C1VukQDg.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DQ6vSNUo.js → use-org-auth-client-DjRiIxwH.js} +1 -1
- package/dist/client/assets/{use-org-fs-UdNnQzcG.js → use-org-fs-DqhUUlbQ.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CE9Yx0AE.js → use-org-repo-syncs-cx9r2nZl.js} +1 -1
- package/dist/client/assets/{use-org-sso-BRZ2xqKg.js → use-org-sso-DVCQNBfN.js} +1 -1
- package/dist/client/assets/{use-organization-roles-5fHLGM-_.js → use-organization-roles-Bp0RCVOK.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BEUCQxuY.js → use-organization-settings-B0rQmLIX.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-B348HV-V.js → use-panel-navigate-DOyxnt44.js} +1 -1
- package/dist/client/assets/{use-project-scope-CJSvss5q.js → use-project-scope-DJTJDi3A.js} +1 -1
- package/dist/client/assets/{use-releases-DRDEblSZ.js → use-releases-BXUiPgUU.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BQoNp5Lt.js → use-reports-diagnostic-frCP_UW9.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-afI4fSp9.js → use-sandbox-events-Clj9v6On.js} +1 -1
- package/dist/client/assets/{use-secrets-6NdpjMzr.js → use-secrets-CIfBnw6x.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Du6Z-MWu.js → use-section-preview-base-BYZSxM0z.js} +1 -1
- package/dist/client/assets/{use-tags-Dkeb0fZQ.js → use-tags-Blq5AODj.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BsZ5fOsz.js → use-task-board-analytics-D09WT40p.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BZPWVwkQ.js → use-task-board-events-Bx8_k4aV.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-6pzJEXZH.js → use-task-board-item-prs-Bsgf-2Zm.js} +1 -1
- package/dist/client/assets/{use-task-board-items-DDExwWH5.js → use-task-board-items-CIYsbBEM.js} +1 -1
- package/dist/client/assets/{use-task-metadata-QX8Xm3F2.js → use-task-metadata-DDV_r81k.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-4YJ0wSzW.js → use-thread-analytics-BuosijZj.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BaagK6yF.js → use-thread-outputs-D13C6fsy.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3MUNCKJ.js +1 -0
- package/dist/client/assets/{useQueries-BeM3koNG.js → useQueries-DZMzH0ea.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPTWpcSJ.js +1 -0
- package/dist/client/assets/{users-DA2VVqSS.js → users-CE3WLjUJ.js} +1 -1
- package/dist/client/assets/{utils-DGIwcQET.js → utils-qUv9_Hyk.js} +1 -1
- package/dist/client/assets/{variant-calendar-B2z-zkHQ.js → variant-calendar-B604PCFx.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-WuIO8MOW.js → variant-matcher-override-CgF3ujB9.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DA847UFd.js → view-mode-toggle-BaZ1kmhW.js} +1 -1
- package/dist/client/assets/{virtual-mcp-ySkvJvwZ.js → virtual-mcp-CWsV4-pi.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-jwr9yBFo.js → watch-sse-pool-BjTl5yOD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +87 -87
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BExNHlBs.js +0 -1
- package/dist/client/assets/agent-deck-GAA8uH06.js +0 -1
- package/dist/client/assets/agent-library-CJXihsv5.js +0 -1
- package/dist/client/assets/agent-library-file-Cnv04MVV.js +0 -1
- package/dist/client/assets/agent-settings-BTMD0j_l.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Crxw0pRq.js +0 -2
- package/dist/client/assets/agent-view-DVbx7Not.js +0 -1
- package/dist/client/assets/api-keys-B_VU2t2_.js +0 -1
- package/dist/client/assets/app-editor-fWZMbht-.js +0 -1
- package/dist/client/assets/flat-project-DPnFbnmE.js +0 -1
- package/dist/client/assets/library-C2ZRDo2P.js +0 -1
- package/dist/client/assets/project-reports-7r3buXCO.js +0 -1
- package/dist/client/assets/project-tasks-Dp-gjCz7.js +0 -1
- package/dist/client/assets/record-editor-BDN9ztWf.js +0 -1
- package/dist/client/assets/redirect-editor-DBLjC8Z9.js +0 -1
- package/dist/client/assets/reports-CvKnRIKX.js +0 -1
- package/dist/client/assets/route-Fylk_TVt.js +0 -1
- package/dist/client/assets/taskboard-analytics-B5tiovFi.js +0 -1
- package/dist/client/assets/tasks-C5eWHl6J.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-B5DYqQrS.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BgN51nwo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DnCmqaG2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as s,bS as e,aE as o,bT as d,bU as l}from"./index-
|
|
1
|
+
import{aD as s,bS as e,aE as o,bT as d,bU as l}from"./index-4XFLhK7S.js";const a=500;s({title:o().max(a),url:o().max(a),icon:o().max(a)});const t=s({keyId:o().max(a),modelId:o().max(a),title:o().max(a).optional()}).nullable();d(["fast","smart","thinking","image","web_search","deep_research"]);d(["fast","smart","thinking"]);const b=s({tiers:s({fast:t,smart:t,thinking:t,image:t,web_search:t,deep_research:t})});s({tiers:s({fast:t.optional(),smart:t.optional(),thinking:t.optional()})});const f=50,c=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;s({host:o().min(1).max(a).regex(c).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:o().min(1).max(a).describe("Vault secret id holding the PAT used to authenticate this host.")});s({ids:l(o().max(a)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const u=s({voice_mode:e().optional(),home_task_intake_enabled:e().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:e().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:e().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:e().optional().describe("Run the Reviewer on a task's pull request when the card reaches In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:e().optional().describe("When a card reaches Ready for Deployment, merge its pull request automatically instead of waiting for someone to press Ship."),auto_resolve_conflicts:e().optional().describe("When a pull request in Ready for Deployment can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:e().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:e().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:e().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),chat_harness_codex:e().optional().describe("Use Codex for new sandbox chats. Off by default; requires hosted sandboxes and a ChatGPT subscription or Responses API provider. Existing chats keep their pinned runtime."),chat_harness_sandbox_only:e().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),sandbox_repo_snapshots:e().optional().describe("Keep a Freestyle snapshot of each project repo at its default branch's head, with its dependencies installed and its dev server running, so a new sandbox for that repo starts already serving. Off by default: each push to a default branch costs a snapshot build the next time a sandbox starts."),auto_assign_report_tasks_to_super_agent:e().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:e().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:e().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:e().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:e().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),experiments_v2_enabled:e().optional().describe("Rebuilt Experiments tab: describe the test in prose and an agent drafts it, plus inline editing and the implement/preview tools that write the split into the site. Off by default — an org without it keeps the table-and-dialog tab, which only records experiment metadata. Requires `experiments_enabled`, which still decides whether the tab exists at all."),monitor_enabled:e().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:e().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),new_blocks_editor:e().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),blog_ai_enabled:e().optional().describe("The blog's brand context tab and its agentic generation — campaigns, post drafting and link suggestions. Off by default; with it off the blog is written by hand and every BLOG_* tool refuses, over MCP and in the app alike, so an agent cannot spend the organization's credits on a feature it turned off."),hide_default_blog_blocks:e().optional().describe("Hide the `deco-cms/blog` built-in post blocks everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),h=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function g(i,n){const r=i?.[n];return h.has(n)?r!==!1:r===!0}function m(i){const n=i?.auto_resolve_conflicts;return typeof n=="boolean"?n:i?.auto_merge===!0}export{h as D,f as G,u as O,b as S,m as a,c as b,g as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,by as A,bu as ce,j as b,bA as _,bN as ae,dl as O,bB as C,bH as P,bC as ie,c as F,l as $}from"./index-D984WV3U.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,by as A,bu as ce,j as b,bA as _,bN as ae,dl as O,bB as C,bH as P,bC as ie,c as F,l as $}from"./index-4XFLhK7S.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,h as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,h as j}from"./index-4XFLhK7S.js";import{i as v}from"./SearchMd-BsNWsFDv.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,l as z,j as a,aV as M}from"./index-
|
|
1
|
+
import{c as K,r as C,l as z,j as a,aV as M}from"./index-4XFLhK7S.js";import{i as B}from"./SearchMd-BsNWsFDv.js";import{I as O}from"./icon-button-BDbIWVW3.js";function G(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[I,p]=C.useState(t!==""),[L,V]=C.useState(!1),[R,$]=C.useState(t);if(t!==R&&($(t),t===""&&!L&&p(!1)),!I&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(B,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=z("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(B,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>V(!0),e[10]=h):h=e[10];let c;e[11]!==t?(c=()=>{V(!1),t===""&&p(!1)},e[11]=t,e[12]=c):c=e[12];let i;e[13]!==s?(i=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=i):i=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=z("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==c||e[19]!==i||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:c,onKeyDown:i,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=c,e[19]=i,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{G as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as d,j as l}from"./index-
|
|
1
|
+
import{c as x,b as d,j as l}from"./index-4XFLhK7S.js";import{s as j}from"./User01-BGOQS9vx.js";import{t as E}from"./Users01-C9dOtgmV.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,n as C,fG as E,H as F,r as N,b2 as L,B as D,af as T,D as O,q as B,s as A,v as R,aK as q,I as _,w as I,t as z}from"./index-
|
|
1
|
+
import{c as j,b as y,j as s,n as C,fG as E,H as F,r as N,b2 as L,B as D,af as T,D as O,q as B,s as A,v as R,aK as q,I as _,w as I,t as z}from"./index-4XFLhK7S.js";import{i as H}from"./AlertCircle-D4iOZ3Bs.js";import{s as V}from"./Plus-DLTeBarI.js";import{s as G}from"./User01-BGOQS9vx.js";import{t as K}from"./Users01-C9dOtgmV.js";import{L as w}from"./label-ByKoWpTn.js";import{S as J,b as M,a as Q,d as U,c as P}from"./select-CEirlFRV.js";import{T as W}from"./textarea-BpBHfDQd.js";import{u as X,a as Y}from"./use-secrets-CIfBnw6x.js";import{R as Z}from"./require-capability-D49j17CD.js";import"./index-BdQq_4o_.js";import"./index-DujNp8wX.js";import"./ChevronUp-BSm7AtSf.js";import"./access-gate-DsVMqwjM.js";import"./capability-load-error-CR2FG7xy.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(H,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?G:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(T,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(B,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(R,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(J,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(_,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(_,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(I,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(V,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx($,{secret:t},t.id)}function ie(t){return s.jsx($,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(E,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function we(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{we as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as tn,b as nn,r as E,l as oe,j as s,b1 as Ta,B as Mt,U as zt,au as Na,X as Aa,V as Ma,o as Ca,h as Pa,t as V,K as Da}from"./index-D984WV3U.js";import{u as Ka}from"./chat-context-y8u3K9Tq.js";import{u as En}from"./use-new-blocks-editor-B5DYqQrS.js";import{J as Ba,K as Fa,N as Ia,O as La,Q as Oa,T as za,U as $a,V as Ha,W as Ga,X as Js,Y as qa,Z as Wa,_ as Ct,G as pt,$ as lt,H as yn,E as bn,e as Ua,f as Ja,j as Ya,u as Qa,a0 as Ys,o as Xa,a1 as Za,q as er,n as tr,a2 as nr,p as gn,a3 as sr,a4 as or,C as Qs,a5 as ar,a6 as rr,a7 as vn,a8 as Xs,a9 as Zs,aa as eo,ab as Hn,ac as ir,ad as lr,F as cr,ae as to,af as ur,ag as no,ah as so,M as dr,ai as oo,d as mr,aj as Xt,ak as fr,al as pr,am as Gn,an as hr,ao as gr,ap as vr}from"./runnable-block-editor-v2diysES.js";import{c as Sr}from"./repository-binding-CrIQbyJh.js";import{n as yr,t as br}from"./ChevronUp-D_qU7VrJ.js";import{a6 as So,d as _n,ak as xr,C as _r,$ as ao,K as ro}from"./agent-icon-CsQzAnP1.js";import{S as $t}from"./scroll-area-B9YHNZjL.js";import{b as ht,T as gt,a as vt}from"./tooltip-CfH7_UR9.js";import{m as Er,u as jr,P as kr}from"./mustache-B3B0mlPh.js";import{as as yo,c as es,at as bo,G as wr,au as it,av as Un,aw as xo,ai as At,a6 as Jn,ax as Yn,aj as jt,a7 as Ht,j as Rr,l as Vr,g as Tr,r as Sn,am as Nr,ah as Zt,a8 as qn,ag as Et,af as en,ay as Ar,K as Mr,az as Cr,ak as io,a0 as lo,aA as Pr,aB as Nt,aC as Dr,aD as Kr,aE as Br,aF as co,aG as Fr,aH as Ir,aI as Lr,ae as Or,aJ as zr,aK as $r,aL as Hr,V as Gr,aM as qr,ad as Wr,aN as Ur}from"./claim-phase-copy-kSJ81npa.js";import{a as Jr}from"./Copy01-CT_cEqll.js";import{a as Qn,e as _o}from"./UserSquare-BlSFjBrQ.js";import{i as uo}from"./Tool01-BLdqmAM-.js";import{s as mo}from"./Image01-CyU1b2Nz.js";import{s as Yr}from"./Plus-BzLmRH_e.js";import{s as Qr}from"./Trash01-DkcAHDGj.js";import{i as Xn}from"./ZoomOut-C_NtAfgt.js";import{u as Xr,a as fo,K as Zr,P as ei,b as ti,C as ni,D as si,c as oi}from"./core.esm-BH3HyyF2.js";import{u as ai,s as ri,a as xn,S as ii,v as li}from"./sortable.esm-C4yl7HRk.js";import{a as ci,P as po,b as ui}from"./page-seo-form-BJN0O5_N.js";import{u as di,A as mi}from"./use-section-preview-base-Du6Z-MWu.js";import{b as ho,a as fi}from"./variant-matcher-override-WuIO8MOW.js";import"./use-panel-navigate-B348HV-V.js";import"./thread-route-Dp3ppEkH.js";import"./use-project-scope-CJSvss5q.js";import"./autosend-8ZqTuUx9.js";import"./thread-intent-BouO_OhM.js";import"./use-mcp-client-D8-rDWEf.js";import"./auth-CsAAW7Ar.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-jwr9yBFo.js";import"./task-board-BypYXBtD.js";import"./schema-BMqZTcjW.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-BDPMNEXz.js";import"./use-ai-providers-CeHzBmwD.js";import"./use-chat-navigation-pwxRnoh5.js";import"./location-BjlyegC2.js";import"./use-organization-settings-BEUCQxuY.js";import"./input-C_t2NUbp.js";import"./usage-stats-BcmMK-YO.js";import"./tool-namespace-C5Z8tVC2.js";import"./form-Dm1N7Fdz.js";import"./label-BszVxI8j.js";import"./utils-CVEq3hMx.js";import"./markdown-C8b2SRJt.js";import"./use-copy-COXbZ1Gm.js";import"./use-mobile-Cz-N6vVG.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-BcQlXPoY.js";import"./icon-button-UzqZkmgc.js";import"./file-type-icon-ClWl2ykw.js";import"./shell-layout-CX2kb4As.js";import"./avatar-Da-P84-z.js";import"./User01-CuJbE_Yd.js";import"./Building02-C5UvSZSt.js";import"./CheckCircle-B1cLRmIj.js";import"./Monitor01-jDiltU3l.js";import"./use-clock-tick-DcGl_y28.js";import"./command-d2fvY4gQ.js";import"./index-ba_EB2Zw.js";import"./SearchMd-X-m-ot0f.js";import"./integration-icon-B4EO_1fi.js";import"./LinkBroken01-CImL6HGl.js";import"./project-icon-DeUPWsC_.js";import"./new-project-dialog-CQomS8HX.js";import"./ArrowLeft-BkyozCr0.js";import"./repository-import-picker-n3EYoF9U.js";import"./use-navigate-to-agent-CWPsHr0w.js";import"./repository-picker-CjDs0ici.js";import"./useInfiniteQuery-BgN51nwo.js";import"./infiniteQueryObserver-Bmwf-SCt.js";import"./collection-search-C-3HPALa.js";import"./ShoppingBag01-C30WMfg1.js";import"./use-debounced-value-BZK5uiHm.js";import"./required-auth-layout-CTKRCLps.js";import"./use-org-sso-BRZ2xqKg.js";import"./chat-draft-RqSOe2VX.js";import"./ArrowUp-C0O7U47F.js";import"./Upload01-CJxfk4_B.js";import"./AlertCircle-CgfWDsMW.js";import"./select-Cmhyur65.js";import"./index-BdQq_4o_.js";import"./index-ChAMt2d-.js";import"./tabs-CJiVz1UY.js";import"./use-deco-credits-COvQvXnV.js";import"./toggle-group-BxPPN08u.js";import"./use-open-billing-url-CHALVI7F.js";import"./index-CeuDCj_w.js";import"./checkbox-cuQOxwwj.js";import"./ChevronSelectorVertical-bEeSv3mr.js";import"./Key01-CV4MPPMx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-9tPVAoH5.js";import"./drawer-DybzZn1x.js";import"./input-CG0PFhS0.js";import"./suggestion-B9eDgKDC.js";import"./use-chat-layout-state-C4y1ngrz.js";import"./use-file-configs-DoW1VYTz.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-9xOCFCVM.js";import"./use-org-fs-UdNnQzcG.js";import"./Link01-BL0KHGWk.js";import"./question-004-sINsf4GQ.js";import"./use-members-DuiAoVt0.js";import"./use-org-auth-client-DQ6vSNUo.js";import"./feature-paywall-BN5FphJ8.js";import"./plan-ladder-DUQWM1mB.js";import"./add-connection-dialog-CmVGiYmi.js";import"./extract-connection-data-CIO9f-TD.js";import"./metadata-D72DunRR.js";import"./connection-DGqqVA7M.js";import"./url-slug-D7hdnLPq.js";import"./connection-card-gIhz0wdg.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-C3QvYVs6.js";import"./use-connection-B96BwbcD.js";import"./connection-form-helpers-A2MriNrX.js";import"./authenticate-and-persist-oauth-HfpfV8ZS.js";import"./mcp-oauth--_7bIOac.js";import"./mcp-oauth-BIr9y8Ow.js";import"./collection-tabs-BNpEfqyd.js";import"./badge-CJ5q8uJu.js";import"./use-infinite-scroll-1WuTfkvL.js";import"./useSuspenseInfiniteQuery-DnCmqaG2.js";import"./use-task-board-events-BZPWVwkQ.js";import"./Play-HeD-LWQ6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-D3dg1naQ.js";import"./collapsible-DEfXG6Ht.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-qrtR9Z1h.js";import"./types-PjheW3sm.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-bMLuzpcl.js";import"./use-thread-outputs-BaagK6yF.js";import"./utils-DGIwcQET.js";import"./monaco-editor-BmtkWb9u.js";import"./editor-CBqQFFb9.js";import"./calendar-DKYy6uOJ.js";import"./SwitchHorizontal01-iT36Ixqz.js";import"./rich-text-link-control-B2KML_yp.js";import"./switch-D6SJRikA.js";import"./view-mode-toggle-DA847UFd.js";import"./combobox-ylZ1_mxm.js";import"./alert-dialog-D2yDyccd.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-CGu7Zbqo.js";import"./search-input-BJ-xb_6w.js";import"./asset-utils-cuI-wo7N.js";import"./sandbox-git-api-C7JbVL7R.js";import"./CreditCard01-DFGzM4td.js";import"./Globe04-DtoCZsmb.js";import"./Sun-D5cuTnns.js";import"./Users01-CgCEjxiR.js";import"./section-preview-url-7zfngvgW.js";function pi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Eo(d,e){const c=pi(e),h=c[btoa(d)];if(!h)return[];const g=[h];if(Array.isArray(h.allOf)){const b=h.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof b=="string"){const j=c[b.replace("#/definitions/","")];j&&g.push(j)}}return g}function hi(d,e){for(const c of Eo(d,e)){const h=typeof c.image=="string"?c.image:void 0;if(h?.includes("{{{"))return h}}function gi(d,e){if(!e)return;const c=yo(d);if(!c)return;const h=hi(c.resolveType,e);if(!h)return;const g=Ba(h,c.data);if(g)return Fa(g)}const vi={escape:Ia};function Si(d,e){for(const c of Eo(d,e)){const h=typeof c.title=="string"?c.title:void 0;if(h?.includes("{{"))return h}}function yi(d,e){if(!e)return;const c=yo(d);if(c)try{const h=Si(c.resolveType,e);return h&&Er.render(h,c.data,{},vi).trim()||void 0}catch{return}}function bi(d){const e=tn.c(13),{icon:c,label:h,className:g}=d;let b;e[0]!==g?(b=oe("size-3.5",g),e[0]=g,e[1]=b):b=e[1];let j;e[2]!==c||e[3]!==b?(j=s.jsx(c,{className:b}),e[2]=c,e[3]=b,e[4]=j):j=e[4];let S;e[5]!==h||e[6]!==j?(S=s.jsx(gt,{asChild:!0,children:s.jsx("span",{role:"img","aria-label":h,className:"shrink-0 cursor-help",children:j})}),e[5]=h,e[6]=j,e[7]=S):S=e[7];let N;e[8]!==h?(N=s.jsx(vt,{className:"max-w-56",children:h}),e[8]=h,e[9]=N):N=e[9];let _;return e[10]!==S||e[11]!==N?(_=s.jsxs(ht,{children:[S,N]}),e[10]=S,e[11]=N,e[12]=_):_=e[12],_}const xi="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 go(d){return Array.from({length:d},(e,c)=>({id:crypto.randomUUID(),index:c}))}function jo(d){return d.map((e,c)=>({...e,index:c}))}function _i(d,e){if(e===d.length)return d;if(e<d.length)return jo(d.slice(0,e));const c=Array.from({length:e-d.length},(h,g)=>({id:crypto.randomUUID(),index:d.length+g}));return[...d,...c]}function ko(d){const e=tn.c(44),{section:c,raw:h,meta:g,decofile:b}=d,j=nn(),S=En(),N=c.isSavedBlock===!0,_=c.isMultivariate===!0;let Q;e[0]!==g||e[1]!==h?(Q=h&&g?gi(h,g):void 0,e[0]=g,e[1]=h,e[2]=Q):Q=e[2];const me=Q;let $e;e[3]!==g||e[4]!==_||e[5]!==h||e[6]!==N?($e=h&&g&&!N&&!_?yi(h,g):void 0,e[3]=g,e[4]=_,e[5]=h,e[6]=N,e[7]=$e):$e=e[7];const He=$e;let Pe;e[8]!==b||e[9]!==g||e[10]!==h||e[11]!==c?(Pe=Ga(h,c,b,g),e[8]=b,e[9]=g,e[10]=h,e[11]=c,e[12]=Pe):Pe=e[12];const ae=Pe;let r;e[13]!==_||e[14]!==h?.__resolveType?(r=!_&&es(h?.__resolveType??""),e[13]=_,e[14]=h?.__resolveType,e[15]=r):r=e[15];const T=r,Se=N?_n:_?So:_o;let H;e[16]!==_||e[17]!==N?(H=N?{color:wr}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=_,e[17]=N,e[18]=H):H=e[18];const m=H;let z;e[19]!==Se||e[20]!==S?(z=S?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(Se,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),s.jsx(Wa,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(xr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Se,e[20]=S,e[21]=z):z=e[21];let u;e[22]!==me?(u=me&&s.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=u):u=e[23];let U;e[24]!==S||e[25]!==m?(U=!S&&s.jsx(Qn,{className:"h-4 w-4 shrink-0",style:m}),e[24]=S,e[25]=m,e[26]=U):U=e[26];const q=S?"shrink":"flex-1",Re=c.isHidden&&"line-through opacity-50";let De;e[27]!==Re||e[28]!==q?(De=oe("min-w-0 truncate text-sm font-medium",q,Re),e[27]=Re,e[28]=q,e[29]=De):De=e[29];const Ze=He??c.label;let je;e[30]!==De||e[31]!==Ze?(je=s.jsx("span",{className:De,children:Ze}),e[30]=De,e[31]=Ze,e[32]=je):je=e[32];let f;e[33]!==T||e[34]!==S||e[35]!==ae||e[36]!==j?(f=S?s.jsxs(s.Fragment,{children:[T&&s.jsx(bi,{icon:Xn,label:j("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&s.jsx(Js,{}),s.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&s.jsx(Js,{className:"absolute -right-0.5 -top-0.5"}),e[33]=T,e[34]=S,e[35]=ae,e[36]=j,e[37]=f):f=e[37];let M;return e[38]!==je||e[39]!==f||e[40]!==z||e[41]!==u||e[42]!==U?(M=s.jsxs(s.Fragment,{children:[z,u,U,je,f]}),e[38]=je,e[39]=f,e[40]=z,e[41]=u,e[42]=U,e[43]=M):M=e[43],M}const Ei="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ji="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 wo(d,e,c){if(c)return qa({selected:e});const h=d.isSavedBlock===!0,g=d.isMultivariate===!0;return oe("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":h?Ei:g?ji:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Wn(d,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":d?"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 ki(d){const e=tn.c(90),{section:c,raw:h,meta:g,decofile:b,sortableId:j,selected:S,onSelect:N,onDelete:_,onDuplicate:Q,onMakeReusable:me,onToggleHidden:$e,onToggleLazy:He,onAddVariant:Pe,onDetach:ae}=d,r=nn(),T=En(),Se=h?es(h.__resolveType??""):!1,H=c.isHidden===!0,m=Se||H;let z;e[0]!==c?(z=bo(c),e[0]=c,e[1]=z):z=e[1];const u=z;let U;e[2]!==j?(U={id:j,animateLayoutChanges:Vi},e[2]=j,e[3]=U):U=e[3];const{attributes:q,listeners:Re,setNodeRef:De,transform:Ze,isDragging:je}=ai(U);let f;e[4]!==Ze?(f=ni.Transform.toString(Ze?{...Ze,x:0}:null),e[4]=Ze,e[5]=f):f=e[5];const M=je?0:void 0;let Ue;e[6]!==f||e[7]!==M?(Ue={transform:f,opacity:M},e[6]=f,e[7]=M,e[8]=Ue):Ue=e[8];const C=Ue;let et;e[9]!==c?(et=Oa(c),e[9]=c,e[10]=et):et=e[10];const I=et,St="button",fe=0;let Je;e[11]!==N?(Je=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),N())},e[11]=N,e[12]=Je):Je=e[12];const kt=je?"cursor-grabbing":"cursor-pointer";let Ge;e[13]!==T||e[14]!==c||e[15]!==S||e[16]!==kt?(Ge=oe("touch-none transition-colors",kt,wo(c,S,T)),e[13]=T,e[14]=c,e[15]=S,e[16]=kt,e[17]=Ge):Ge=e[17];let re;e[18]!==b||e[19]!==g||e[20]!==h||e[21]!==c?(re=s.jsx(ko,{section:c,raw:h,meta:g,decofile:b}),e[18]=b,e[19]=g,e[20]=h,e[21]=c,e[22]=re):re=e[22];const ie=!T&&!c.isMultivariate&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Wn(m,Se)),onClick:P=>{P.stopPropagation(),He()},onPointerDown:Ri,children:s.jsx(Xn,{className:oe("h-3.5 w-3.5",Se&&"text-warning")})})}),s.jsx(vt,{side:"bottom",children:r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ke=T?s.jsx(za,{label:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:H,onToggle:$e,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})}):s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Wn(m,H)),onClick:P=>{P.stopPropagation(),$e()},onPointerDown:wi,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})})}),s.jsx(vt,{side:"bottom",children:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),F=Aa,A=$a;let le;e[23]!==r?(le=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=le):le=e[24];const Ve=oe(Wn(m,!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 Be;e[25]!==A||e[26]!==le||e[27]!==Ve?(Be=s.jsx(A,{label:le,classicClassName:Ve}),e[25]=A,e[26]=le,e[27]=Ve,e[28]=Be):Be=e[28];let Te;e[29]!==T||e[30]!==Se||e[31]!==He||e[32]!==c.isMultivariate||e[33]!==r?(Te=T&&!c.isMultivariate&&s.jsxs(s.Fragment,{children:[s.jsxs(zt,{onClick:P=>{P.stopPropagation(),He()},children:[s.jsx(Xn,{className:"h-4 w-4"}),r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),s.jsx(Na,{})]}),e[29]=T,e[30]=Se,e[31]=He,e[32]=c.isMultivariate,e[33]=r,e[34]=Te):Te=e[34];let $;e[35]!==Q?($=P=>{P.stopPropagation(),Q()},e[35]=Q,e[36]=$):$=e[36];let ce;e[37]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(Jr,{className:"h-4 w-4"}),e[37]=ce):ce=e[37];let ke;e[38]!==r?(ke=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=ke):ke=e[39];let pe;e[40]!==$||e[41]!==ke?(pe=s.jsxs(zt,{onClick:$,children:[ce,ke]}),e[40]=$,e[41]=ke,e[42]=pe):pe=e[42];let ne;e[43]!==T||e[44]!==u||e[45]!==Pe||e[46]!==r?(ne=u&&s.jsxs(zt,{className:oe(!T&&Ha),onClick:P=>{P.stopPropagation(),Pe()},children:[s.jsx(So,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=T,e[44]=u,e[45]=Pe,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==T||e[49]!==I||e[50]!==me||e[51]!==r?(he=I&&s.jsxs(zt,{className:oe(!T&&xi),onClick:P=>{P.stopPropagation(),me()},children:[T?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=T,e[49]=I,e[50]=me,e[51]=r,e[52]=he):he=e[52];let se;e[53]!==T||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&s.jsxs(zt,{onClick:P=>{P.stopPropagation(),ae()},children:[T?s.jsx(_o,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=T,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Fe;e[59]!==_?(Fe=P=>{P.stopPropagation(),_()},e[59]=_,e[60]=Fe):Fe=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Qr,{className:"h-4 w-4"}),e[61]=ye):ye=e[61];let Ne;e[62]!==r?(Ne=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ne):Ne=e[63];let we;e[64]!==Fe||e[65]!==Ne?(we=s.jsxs(zt,{variant:"destructive",onClick:Fe,children:[ye,Ne]}),e[64]=Fe,e[65]=Ne,e[66]=we):we=e[66];let be;e[67]!==Te||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==se||e[72]!==we?(be=s.jsxs(Ma,{align:"end",className:"w-44",children:[Te,pe,ne,he,se,we]}),e[67]=Te,e[68]=pe,e[69]=ne,e[70]=he,e[71]=se,e[72]=we,e[73]=be):be=e[73];let xe;e[74]!==F||e[75]!==Be||e[76]!==be?(xe=s.jsxs(F,{children:[Be,be]}),e[74]=F,e[75]=Be,e[76]=be,e[77]=xe):xe=e[77];let Ye;return e[78]!==q||e[79]!==Re||e[80]!==N||e[81]!==De||e[82]!==C||e[83]!==Ge||e[84]!==re||e[85]!==ie||e[86]!==Ke||e[87]!==xe||e[88]!==Je?(Ye=s.jsxs("div",{ref:De,style:C,...q,...Re,role:St,tabIndex:fe,onClick:N,onKeyDown:Je,className:Ge,children:[re,ie,Ke,xe]}),e[78]=q,e[79]=Re,e[80]=N,e[81]=De,e[82]=C,e[83]=Ge,e[84]=re,e[85]=ie,e[86]=Ke,e[87]=xe,e[88]=Je,e[89]=Ye):Ye=e[89],Ye}function wi(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function Vi(){return!1}function Zn(d){const e=tn.c(11),{canAddSection:c,onAddSection:h,className:g,size:b}=d,j=nn();let S;e[0]!==g?(S=oe("w-full",g),e[0]=g,e[1]=S):S=e[1];const N=!c;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Yr,{size:14}),e[2]=_):_=e[2];let Q;e[3]!==j?(Q=j("sectionsEditor.sectionList.addSectionButton"),e[3]=j,e[4]=Q):Q=e[4];let me;return e[5]!==h||e[6]!==b||e[7]!==S||e[8]!==N||e[9]!==Q?(me=s.jsxs(Mt,{type:"button",variant:"outline",size:b,className:S,disabled:N,onClick:h,children:[_,Q]}),e[5]=h,e[6]=b,e[7]=S,e[8]=N,e[9]=Q,e[10]=me):me=e[10],me}function Ti(d){const e=tn.c(101),{listKey:c,rawSections:h,sections:g,meta:b,decofile:j,selectedIndex:S,onSelect:N,onReorder:_,onDelete:Q,onDuplicate:me,onMakeReusable:$e,onToggleHidden:He,onToggleLazy:Pe,onAddVariant:ae,onDetach:r,onAddSection:T,canAddSection:Se}=d,H=Se===void 0?!0:Se,m=nn(),z=En();let u;e[0]!==g.length?(u=()=>go(g.length),e[0]=g.length,e[1]=u):u=e[1];const[U,q]=E.useState(u),[Re,De]=E.useState(null),[Ze,je]=E.useState(c),[f,M]=E.useState(g.length),Ue=E.useRef(!1);Ze!==c?(je(c),M(g.length),q(go(g.length))):f!==g.length&&(M(g.length),q(Ie=>_i(Ie,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let et;e[3]===Symbol.for("react.memo_cache_sentinel")?(et={coordinateGetter:ri},e[3]=et):et=e[3];const I=Xr(fo(ei,C),fo(Zr,et));let St;e[4]!==U?(St=U.map(Ni),e[4]=U,e[5]=St):St=e[5];const fe=St;let Je;e[6]===Symbol.for("react.memo_cache_sentinel")?(Je=Ie=>{De(String(Ie.active.id))},e[6]=Je):Je=e[6];const kt=Je;let Ge;e[7]!==fe||e[8]!==_?(Ge=Ie=>{De(null);const{active:L,over:B}=Ie;if(!B||L.id===B.id)return;const qe=fe.indexOf(String(L.id)),ot=fe.indexOf(String(B.id));qe===-1||ot===-1||(q(ut=>jo(xn([...ut],qe,ot))),Ue.current=!0,requestAnimationFrame(()=>{Ue.current=!1}),_?.(qe,ot))},e[7]=fe,e[8]=_,e[9]=Ge):Ge=e[9];const re=Ge;let ie;e[10]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{De(null)},e[10]=ie):ie=e[10];const Ke=ie;let F,A,le,Ve,Be,Te,$,ce,ke,pe,ne,he,se,Fe,ye;if(e[11]!==Re||e[12]!==H||e[13]!==z||e[14]!==j||e[15]!==U||e[16]!==fe||e[17]!==re||e[18]!==b||e[19]!==T||e[20]!==ae||e[21]!==Q||e[22]!==r||e[23]!==me||e[24]!==$e||e[25]!==N||e[26]!==He||e[27]!==Pe||e[28]!==h||e[29]!==g||e[30]!==S||e[31]!==I||e[32]!==m){Fe=Symbol.for("react.early_return_sentinel");e:{const Ie=L=>{Ue.current||N(L)};if(e[48]!==Re||e[49]!==H||e[50]!==z||e[51]!==U||e[52]!==T||e[53]!==h||e[54]!==g||e[55]!==m){const L=Re?U.find(B=>B.id===Re):null;if(Ve=L!=null?g[L.index]:null,le=L!=null?h[L.index]:void 0,U.length===0){let B;e[59]!==m?(B=m("sectionsEditor.sectionList.noSections"),e[59]=m,e[60]=B):B=e[60];let qe;e[61]!==B?(qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[61]=B,e[62]=qe):qe=e[62];const ot=qe;let ut;e[63]!==H||e[64]!==z||e[65]!==ot||e[66]!==T?(ut=z?ot:s.jsxs("div",{className:"space-y-2",children:[ot,s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm"})]}),e[63]=H,e[64]=z,e[65]=ot,e[66]=T,e[67]=ut):ut=e[67],Fe=ut;break e}se=oe(L&&"cursor-grabbing"),e[48]=Re,e[49]=H,e[50]=z,e[51]=U,e[52]=T,e[53]=h,e[54]=g,e[55]=m,e[56]=le,e[57]=Ve,e[58]=se}else le=e[56],Ve=e[57],se=e[58];A=si,ce=I,ke=oi,pe=kt,ne=re,he=Ke,F=ii,Te=fe,$=li,ye="space-y-1",Be=U.map(L=>{const B=g[L.index];return B?s.jsx(ki,{sortableId:L.id,section:B,raw:h[L.index],meta:b,decofile:j,selected:S===L.index,onSelect:()=>Ie(L.index),onDelete:()=>Q(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>$e(L.index),onToggleHidden:()=>He(L.index),onToggleLazy:()=>Pe(L.index),onAddVariant:()=>ae(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=Re,e[12]=H,e[13]=z,e[14]=j,e[15]=U,e[16]=fe,e[17]=re,e[18]=b,e[19]=T,e[20]=ae,e[21]=Q,e[22]=r,e[23]=me,e[24]=$e,e[25]=N,e[26]=He,e[27]=Pe,e[28]=h,e[29]=g,e[30]=S,e[31]=I,e[32]=m,e[33]=F,e[34]=A,e[35]=le,e[36]=Ve,e[37]=Be,e[38]=Te,e[39]=$,e[40]=ce,e[41]=ke,e[42]=pe,e[43]=ne,e[44]=he,e[45]=se,e[46]=Fe,e[47]=ye}else F=e[33],A=e[34],le=e[35],Ve=e[36],Be=e[37],Te=e[38],$=e[39],ce=e[40],ke=e[41],pe=e[42],ne=e[43],he=e[44],se=e[45],Fe=e[46],ye=e[47];if(Fe!==Symbol.for("react.early_return_sentinel"))return Fe;let Ne;e[68]!==Be||e[69]!==ye?(Ne=s.jsx("div",{className:ye,children:Be}),e[68]=Be,e[69]=ye,e[70]=Ne):Ne=e[70];let we;e[71]!==F||e[72]!==Te||e[73]!==$||e[74]!==Ne?(we=s.jsx(F,{items:Te,strategy:$,children:Ne}),e[71]=F,e[72]=Te,e[73]=$,e[74]=Ne,e[75]=we):we=e[75];let be;e[76]!==le||e[77]!==Ve||e[78]!==z||e[79]!==j||e[80]!==b?(be=Ve?s.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",wo(Ve,!1,z)),children:s.jsx(ko,{section:Ve,raw:le,meta:b,decofile:j})}):null,e[76]=le,e[77]=Ve,e[78]=z,e[79]=j,e[80]=b,e[81]=be):be=e[81];let xe;e[82]!==be?(xe=Ta.createPortal(s.jsx(ti,{dropAnimation:La,children:be}),document.body),e[82]=be,e[83]=xe):xe=e[83];let Ye;e[84]!==A||e[85]!==ce||e[86]!==ke||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==we||e[91]!==xe?(Ye=s.jsxs(A,{sensors:ce,collisionDetection:ke,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[we,xe]}),e[84]=A,e[85]=ce,e[86]=ke,e[87]=pe,e[88]=ne,e[89]=he,e[90]=we,e[91]=xe,e[92]=Ye):Ye=e[92];let P;e[93]!==H||e[94]!==z||e[95]!==T?(P=!z&&s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm",className:"mt-2"}),e[93]=H,e[94]=z,e[95]=T,e[96]=P):P=e[96];let ct;return e[97]!==se||e[98]!==Ye||e[99]!==P?(ct=s.jsxs("div",{className:se,children:[Ye,P]}),e[97]=se,e[98]=Ye,e[99]=P,e[100]=ct):ct=e[100],ct}function Ni(d){return d.id}function vo(d,e,c,h){if(!d||!e)return null;if(!e.isMultivariate)return pt(d,e,h)?.data??null;const g=it(d,e),b=g?Un(g,lt)[c]:void 0;return b?xo(b.value,h)?.data??null:null}const Ai=50;function Mi(d,e){d.own.push(Ct(e)),d.own.length>Ai&&d.own.shift()}function Ci(d,e){return d.own.includes(Ct(e))}function Pi(d,e){const{sectionIndex:c,variantIndex:h,shown:g,next:b,sectionCount:j}=e;return d&&d.sectionIndex===c&&d.variantIndex===h&&d.emitted===g?(d.emitted=b,d):g?{sectionIndex:c,variantIndex:h,base:g,emitted:b,sectionCount:j,own:[Ct(g)]}:null}function Di(d,e){return e!==null&&Ct(d)!==Ct(e)}function Ki(d,e){return d.__resolveType!==e.__resolveType}function Bi(d,e,c,h){if(e.length===h)return"here";const g=Ct(d),b=e.flatMap((j,S)=>S!==c&&j!==null&&Ct(j)===g?[S]:[]);return b.length===1?b[0]:"unknown"}function Fi(d,e,c,h){if(!d||typeof d!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return At(d,c,h)?{kind:"inline",blockKey:d.__resolveType??"",inlinedRule:Jn(d,c,h)}:{kind:"noop"};const b=Yn(d,c,h);if(!b)return{kind:"error",reason:"unreadable-rule"};if(b.blockKey)return{kind:"updateBlock",blockKey:b.blockKey,blockData:jt(b.resolveType,b.data,g)};const j=yn(g),S=bn(j,c);return S?{kind:"error",reason:"invalid-block-id",message:S}:{kind:"createBlock",blockId:j,blockData:jt(b.resolveType,b.data,g),reference:Ht(j)}}const Ii=3,Li=1e3;function Lu({orgSlug:d,virtualMcpId:e,branch:c,previewReady:h=!0,previewUrl:g,currentPath:b,activePageBlockKey:j=null,activeGlobalBlockKey:S=null,externalSelection:N,onSaved:_,initialEditSeo:Q=!1,onExitSeo:me,onSelectRoot:$e,onViewJsonFile:He,onFocusedBlockChange:Pe,onVariantPreviewOverride:ae}){const r=nn(),T=Ka(),Se=T?.taskId??null,H=h?{orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g}:null,{data:m,isLoading:z}=Ua(H),{data:u,isLoading:U}=Ja(H),q=En(),Re=T?.virtualMcpId,Ze=Sr(Re===e?e:null)?.metadata?.siteSlug??null,je=di({virtualMcpId:e,sandboxUrl:g}),[f,M]=E.useState(null),[Ue,C]=E.useState(null),[et,I]=E.useState(null),[St,fe]=E.useState(0),[Je,kt]=E.useState(void 0),[Ge,re]=E.useState(null),[ie,Ke]=E.useState(null),[F,A]=E.useState([]),le=E.useRef(null),[Ve,Be]=E.useState(F.length);Ve!==F.length&&(Be(F.length),requestAnimationFrame(()=>{le.current&&(le.current.scrollTop=0)}));const[Te,$]=E.useState(0),[ce,ke]=E.useState(null),[pe,ne]=E.useState(null),[he,se]=E.useState(null),[Fe,ye]=E.useState(!1),[Ne,we]=E.useState(!1),be=E.useRef(null),[xe,Ye]=E.useState(!0),[P,ct]=E.useState(!1),[Ie,L]=E.useState(!1),[B,qe]=E.useState(Q),[ot,ut]=E.useState(Q);Q&&!ot&&(ut(!0),qe(!0),M(null),C(null),I(null),A([])),!Q&&ot&&ut(!1);const[Ro,sn]=E.useState(null),[ts,jn]=E.useState(void 0),[ns,wt]=E.useState([]),[ss,Gt]=E.useState(0),[Le,tt]=E.useState(0),[Vo,Oe]=E.useState(null),[Pt,We]=E.useState(null),[os,as]=E.useState(null),To=Ca(),No=`${d}/${e}/${c}`,on=Ya({orgSlug:d,virtualMcpId:e,branch:c}),[Ao,Mo]=E.useState(b),[Co,Po]=E.useState(j),[Do,Ko]=E.useState(S);(Ao!==b||Co!==j||Do!==S)&&(queueMicrotask(()=>on.flush()),Mo(b),Po(j),Ko(S),M(null),C(null),I(null),fe(0),re(null),Ke(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1));const J=Qa({orgSlug:d,virtualMcpId:e,branch:c}),qt=mr((t,n)=>{J.mutate({blockKey:t,data:n},{onSuccess:()=>_?.(),onError:o=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),an=jr({orgSlug:d,virtualMcpId:e,branch:c}),[Dt,Kt]=E.useState(!1),O=E.useRef(null),kn=E.useRef(null),dt=E.useRef(null),mt=E.useRef(null),wn=E.useRef({}),rn=E.useRef(null),Ae=E.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[rs,Bo]=E.useState(0),[Fo,Io]=E.useState(0),[Lo,Oo]=E.useState(null);if(!h||z||U)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Pa,{className:"size-5 text-muted-foreground"})});if(!m||!u)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const zo=Rr(m),Y=!!S,X=Y?null:Vr(zo,b,j),v=Y?S:X?.key??null,Rn=Y&&S?m[S]:void 0,is=Y&&S&&Rn?Tr(S,Rn):Y&&S?S:"",Wt=!Y&&v&&m[v]?m[v]:null,Vn=B&&m&&u&&v&&X?Ys(m,{kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},u):null,$o=B?Wt?.seo:void 0,ln=ts!==void 0?ts:$o,Ho=B?Xa(ln):void 0,ls=Vn?.seoTypeOptions??[],cs=B&&u?Za(u):"",Tn=Ro??Ho??{},cn=B&&Vn?ci(Tn,Vn):null,us=B&&cn&&er(ln)?Sn(cn,u):null,ds=B?tr(m,u)?.seoData:void 0,ue=Y?[{label:"Default",sections:[{__resolveType:S}]}]:nr(Wt?.sections,m??{}),at=ue.length>1,Z=Math.min(St,ue.length-1),Qe=ue[Z],D=Qe?.sections??[],ge=gn(D,m),Nn=!Y&&Nr(Wt?.sections);if(Y&&S&&os!==S){as(S);const t=D[0],n=ge[0];if(t&&n){M(0),tt(0),A([]);const o=pt(t,n,m);o&&(C(o.data),I(o.resolveType),We(null),Oe(null))}}!Y&&os!==null&&as(null),Ae.current={rawSections:D,parsedSections:ge,decofile:m??{},activePageKey:v,pageVariants:ue,variantIndex:Z,sectionVariantIndex:Le,selectedSectionIndex:f};const Go=()=>({multivariate:Nn,index:Z,variants:ue.map(t=>({rule:t.rule}))}),An=(t,n)=>{if(!ae)return;if(!v||!Nn||t.length<=1){ae(null);return}const o=ho(v,{multivariate:!0,index:n,variants:t},m,u);ae(o.length>0?o:null)},Mn=ae&&v&&Nn&&at&&!z&&!U?v:null;if(Mn!==Lo&&(Oo(Mn),Mn)){const t=ue.map(o=>({rule:o.rule})),n=Z;queueMicrotask(()=>An(t,n))}const Bt=(t,n,o)=>{if(!ae)return;if(!v){ae(null);return}const a=Go(),l=ho(v,a,m,u);if(!t||n<0){ae(l.length>0?l:null);return}const i=fi({pageKey:v,page:a,sectionIndex:n,sectionLazy:ge[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:m,meta:u}),p=[...l,...i];ae(p.length>0?p:null)},ft=(t,n,o,a=f??-1,l=!1)=>{const i=it(t,n);if(!i){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const x=Un(i,lt)[o];if(!x){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const R=xo(x.value,m);C(R?.data??null),I(R?.resolveType??null);const{resolveType:y,formValue:k}=Zt(x.rule,m,u??void 0);We(y),Oe(k),l&&Bt(i,a,o)},Ut=N?.index;if(N!==void 0&&(N?.seq??null)!==Je&&(kt(N?.seq??null),typeof Ut=="number")){const t=D[Ut],n=ge[Ut];if(t&&n)if(M(Ut),tt(0),A([]),$(o=>o+1),n.isMultivariate)ft(t,n,0,Ut);else{const o=pt(t,n,m);o?(C(o.data),I(o.resolveType)):(C(null),I(null)),We(null),Oe(null)}}if(rs!==Fo){Io(rs);const t=f!==null?D[f]:null,n=f!==null?ge[f]:null;if(t&&n&&f!==null)if(A([]),$(o=>o+1),n.isMultivariate)ft(t,n,Le,f);else{const o=pt(t,n,m??{});C(o?.data??null),I(o?.resolveType??null)}}const Jt={orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g??void 0,siteSlug:Ze},Cn=et&&u?Sn(et,u):null,nt=(t,n)=>{if(!v)return;O.current&&(clearTimeout(O.current),O.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null);const o=Xt(m,v,t,Z,ue);J.mutate({blockKey:v,data:o},{onSuccess:()=>n?.onSuccess?.()??_?.(),onError:a=>{n?.onError?.(),V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))}})},Rt=()=>{Pe?.(null),M(null),L(!1),C(null),I(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1)},Pn=(t=r("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{O.current&&(clearTimeout(O.current),O.current=null),kn.current=null,V.error(t),Bo(n=>n+1)},Dn=(t,n,o=0)=>{const a=Ae.current.sectionVariantIndex,l=rn.current,i=l?.sectionIndex===n&&l.variantIndex===a?l:null,p=kn.current;O.current&&(clearTimeout(O.current),O.current=null,p&&(p.sectionIndex!==n||p.sectionVariantIndex!==a)&&p.write());const x=()=>{const{rawSections:R,parsedSections:y,decofile:k,activePageKey:w,pageVariants:ve,variantIndex:ee}=Ae.current,G=R[n];if(!G)return;const W=y[n];if(!W)return;const te=i?.base,K=vo(G,W,a,k),ze=!!te&&!!K&&Di(te,K)&&!(i&&Ci(i,K));if(ze&&te&&K){if(Ki(te,K)){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const de=W.isSavedBlock?"here":Bi(te,R.map((Ee,Ot)=>vo(Ee,y[Ot],a,k)),n,i?.sectionCount??R.length);if(de==="unknown"){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof de=="number"&&i){i.sectionCount=R.length,i.sectionIndex=de,M(de),Dn(t,de,o);return}}const Xe=[],Me=ze&&te&&K?hr(te,t,K,{prefer:"theirs",conflicts:Xe}):null,Ce=Me??t,rt=!!Me&&rn.current===i&&i?.emitted===t;Xe.length>0?V.warning(r("sectionsEditor.sectionsEditor.formFieldsKeptFromStored",{fields:gr(Xe)})):Me&&V.info(r("sectionsEditor.sectionsEditor.blockMergedWithOthers")),rt&&i&&(i.emitted=Me,C(Me));const Lt=rt||!Me?Ce:t;i&&(i.base=Lt,i.sectionCount=R.length,Mi(i,Lt));const pn={onSuccess:()=>_?.(),onError:de=>{if(i?.base===Lt&&te&&(i.base=te),de instanceof Gr){o<Ii?setTimeout(()=>{const Ee=i?.emitted;Dn(Ee&&typeof Ee=="object"?Ee:t,n,o+1)},Li*2**o):Pn();return}V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))}};if(W.isSavedBlock){const de=vr(G,W);if(!de)return;J.mutate({blockKey:de,data:Ce,...te?{base:{value:Me?K:te}}:{},rebaseOnConflict:!1},pn);return}if(!w)return;const hn={...k[w]},Tt=[...R];if(W.isMultivariate){const de=it(G,W);if(!de||!w)return;const Ee=Hr(de,a,Ce);Tt[n]=Nt(G,W,Ee)}else if(W.isHidden){const de=es(G.__resolveType),Ee=de?{...G.section}:{...G},Ot=Array.isArray(Ee.variants)?[...Ee.variants]:[];Ot[0]&&(Ot[0]={...Ot[0],value:Ce}),Ee.variants=Ot,de?Tt[n]={...G,section:Ee}:Tt[n]=Ee}else W.isLazy?Tt[n]={...G,section:Ce}:Tt[n]=Ce;if(ve.length>1){const de=hn.sections,Ee=[...de?.variants??[]];Ee[ee]&&(Ee[ee]={...Ee[ee],value:Tt}),hn.sections={...de,variants:Ee}}else hn.sections=Tt;J.mutate({blockKey:w,data:hn,rebaseOnConflict:!1},pn)};kn.current={sectionIndex:n,sectionVariantIndex:a,write:x},O.current=setTimeout(()=>{O.current=null,x()},Gn)},qo=t=>{M(t),tt(0),A([]),$(l=>l+1);const n=D[t],o=ge[t];if(Pe?.(o?.isSavedBlock?o.resolveType??null:null),!n||!o)return;if(o.isMultivariate){ft(n,o,0,t);return}const a=pt(n,o,m);if(!a){C(null),I(null),We(null),Oe(null),Bt(null,t,0);return}C(a.data),I(a.resolveType),We(null),Oe(null),Bt(null,t,0)},ms=t=>{const n=t;f!==null&&(rn.current=Pi(rn.current,{sectionIndex:f,variantIndex:Ae.current.sectionVariantIndex,shown:Ue,next:n,sectionCount:Ae.current.rawSections.length})),C(n),f!==null&&Dn(n,f)},Kn=t=>{if(!v||!m||!u||!X)return;const n={kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},o=Ys(m,n,u);o&&on.save(v,()=>{const a=To.getQueryData(Da.decofile(No))?.[v];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const l={...a,...wn.current};return wn.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?ui(n,o,l,t.inner):l})},fs=(t,n)=>{v&&(wn.current[t]=n,Kn())},Wo=(t,n)=>{if(!v)return;const o=xn([...D],t,n);f!==null&&(f===t?M(n):t<f&&n>=f?M(f-1):t>f&&n<=f&&M(f+1)),nt(o)},Uo=t=>{if(!v)return;const n=D.filter((o,a)=>a!==t);f===t?Rt():f!==null&&f>t&&M(f-1),nt(n)},Jo=t=>{if(!v)return;const n=D[t];if(!n)return;const o=[...D];o.splice(t+1,0,fr(n)),f!==null&&f>t&&M(f+1),nt(o)},Yo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o)return;const a=o.isHidden?Ir(n):Lr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Qo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o||o.isMultivariate)return;const a=Fr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Xo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o?.isSavedBlock)return;const a=pt(n,o,m);if(!a?.data)return;const{name:l,...i}=a.data,p=[...D];o.isLazy?p[t]={...n,section:i}:p[t]=i,f===t&&Rt(),nt(p)},Zo=t=>{if(!v)return;const n=[...D,{__resolveType:t.resolveType}],o=n.length-1;nt(n,{onError:()=>{Ae.current.selectedSectionIndex===o&&Rt()}}),ye(!1),M(o),tt(0),A([]),$(p=>p+1);const a=n[o],l=gn(n,m)[o];if(!a||!l)return;if(l.isMultivariate){ft(a,l,0);return}const i=pt(a,l,m);if(!i){C(null),I(null),We(null),Oe(null);return}C(i.data),I(i.resolveType),We(null),Oe(null)},ps=t=>{be.current=t.append,ye(!0)},ea=t=>{const n=be.current;if(!n){Zo(t);return}n({__resolveType:t.resolveType}),ye(!1),be.current=null},hs=t=>{if(f===null)return;const n=D[f],o=ge[f];!n||!o?.isMultivariate||(tt(t),A([]),$(a=>a+1),ft(n,o,t,f,!0))},ta=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Kr(a,t);if(!l){V.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...D];i[f]=Nt(n,o,l);const p=l.variants;let x=Le;t===Le?x=Math.min(t,p.length-1):t<Le&&(x=Le-1),tt(x),A([]),$(R=>R+1),ft(i[f],o,x),nt(i)},na=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Br(a,t),i=[...D];i[f]=Nt(n,o,l);const p=t+1;tt(p),A([]),$(x=>x+1),ft(i[f],o,p),nt(i)},sa=(t,n)=>{if(f===null||!v||t===n)return;const o=D[f],a=ge[f];if(!o||!a?.isMultivariate)return;const l=it(o,a);if(!l)return;const i=Pr(l,t,n),p=[...D];p[f]=Nt(o,a,i);let x=Le;Le===t?x=n:t<Le&&n>=Le?x=Le-1:t>Le&&n<=Le&&(x=Le+1),tt(x),ft(p[f],a,x),nt(p)},Yt=t=>{const n=t??f;if(n===null||!v)return;const o=D[n],a=ge[n];if(!o||!a)return;const l=Ar(o,a);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...D];i[n]=l.section;const p=gn(i,m)[n];if(!p?.isMultivariate){V.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(n),tt(l.newVariantIndex),A([]),$(x=>x+1),ft(l.section,p,l.newVariantIndex,n),nt(i)},gs=()=>{if(f===null||!v)return;const t=D[f],n=ge[f];if(!t||!n?.isMultivariate)return;const o=it(t,n);if(!o)return;const a=Dr(t,n,o);if(!a){V.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...D];l[f]=a;const i=gn(l,m)[f];if(!i)return;tt(0),We(null),Oe(null),A([]),$(x=>x+1);const p=pt(a,i,m);p?(C(p.data),I(p.resolveType)):(C(null),I(null)),Bt(null,f,0),nt(l)},oa=async t=>{if(ce===null||!v)return;const n=bn(t,m);if(n){V.error(n);return}const o=D[ce],a=ge[ce];if(!o||!a)return;const l=pt(o,a,m);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...l.data,name:t};try{await J.mutateAsync({blockKey:t,data:i});const p=[...D];p[ce]={__resolveType:t},await J.mutateAsync({blockKey:v,data:Xt(m,v,p,Z,ue)}),f===ce&&Rt(),ke(null),V.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),_?.()}catch(p){V.error(p instanceof Error?p.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},vs=Qe?.rule;if(at&&f===null&&ie===null&&vs){const{resolveType:t,formValue:n}=Zt(vs,m??{},u??void 0);Ke(t),re(n)}const Ft=u?sr(u):[],Bn=u&&m?or(u,m):[],Ss=!Y&&!!(je&&u&&m),ys=ie&&u?Sn(ie,u):null,yt=()=>{dt.current&&(clearTimeout(dt.current),dt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null)},Vt=async(t,n)=>{if(!($r(n,t,u)>0))try{await an.mutateAsync({blockKey:t})}catch(o){V.error(o instanceof Error?o.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},bs=t=>{dt.current&&clearTimeout(dt.current),dt.current=setTimeout(()=>{const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l={...o[n]},i={...l.sections},p=[...i.variants??[]],x=p[a],R=x?.rule;if(At(R,o,u)){const y=R?.__resolveType??"",k=o[y],w=typeof k?.name=="string"?k.name:y,{__resolveType:ve,...ee}=t;J.mutate({blockKey:y,data:jt(ve??"",ee,w)},{onSuccess:()=>_?.(),onError:G=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}x&&(p[a]={...x,rule:t}),l.sections={...i,variants:p},J.mutate({blockKey:n,data:l},{onSuccess:()=>_?.(),onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},Gn)},xs=t=>{Ke(t);const n=t?io(t,u):{__resolveType:lo};re(t?n:{}),bs(n)},_s=t=>{const n=t;re(n);const o=ie?{__resolveType:ie,...n}:{...n};bs(o)},Es=async t=>{yt();const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l=o[n],i=l?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[a];if(!R)return;const y=Et(R.rule,o,u),k=Ht(t);x[a]={...R,rule:k};const w={...o,[n]:{...l,sections:{...p,variants:x}}},{resolveType:ve,formValue:ee}=Zt(k,w,u??void 0);Ke(ve),re(ee);try{await J.mutateAsync({blockKey:n,data:w[n]}),y&&y!==t&&await Vt(y,w),_?.()}catch(G){V.error(G instanceof Error?G.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{mt.current&&clearTimeout(mt.current);const{selectedSectionIndex:n,sectionVariantIndex:o}=Ae.current;n!==null&&(mt.current=setTimeout(()=>{const{rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ee=(w.variants??[])[o]?.rule;if(At(ee,i,u)){const K=ee?.__resolveType??"",ze=i[K],Xe=typeof ze?.name=="string"?ze.name:K,{__resolveType:Me,...Ce}=t;J.mutate({blockKey:K,data:jt(Me??"",Ce,Xe)},{onSuccess:()=>_?.(),onError:rt=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:rt.message}))});return}const G=co(w,o,t),W=[...a];W[n]=Nt(y,k,G);const te=Xt(i,p,W,R,x);J.mutate({blockKey:p,data:te},{onSuccess:()=>_?.(),onError:K=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},Gn))},aa=t=>{We(t);const n=t?io(t,u):{__resolveType:lo};Oe(t?n:{}),js(n)},ra=t=>{const n=t;Oe(n);const o=Pt?{__resolveType:Pt,...n}:{...n};js(o)},ia=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(n===null||!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=Et(ve[o]?.rule,i,u),G=Ht(t),W=co(w,o,G),te=[...a];te[n]=Nt(y,k,W);const K=Xt(i,p,te,R,x),ze={...i,[p]:K},{resolveType:Xe,formValue:Me}=Zt(G,ze,u??void 0);We(Xe),Oe(Me);try{await J.mutateAsync({blockKey:p,data:K}),ee&&ee!==t&&await Vt(ee,ze),_?.()}catch(Ce){V.error(Ce instanceof Error?Ce.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!X)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Y&&!Rn)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const _e=f!==null?ge[f]??null:null,ks=f!==null?D[f]:null,ws=ks&&_e?.isMultivariate?it(ks,_e):null,bt=ws?Un(ws,lt):[],un=Math.min(Le,Math.max(bt.length-1,0)),It=bt[un]??null,xt=_e?.isMultivariate===!0,Fn=f!==null&&_e!==null,_t=Fn&&(xt||!!(Cn&&Ue)),la=_t&&!Y&&_e?.isSavedBlock===!0,st=Y||la,Rs=Y?is:_e?.label??"",ca=Pt&&u?Sn(Pt,u):null,Vs=(t,n)=>n&&q?`${t} · ${n}`:t,Ts=_e?_e.variantOf??_e.label:"",ua=(()=>{const t=xt&&It?It.label:null;return t?q?[Vs(Ts,t)]:[_e.label,t]:[_e?.label??""]})(),In=Vs(X?.name??"",at?Qe?.label:null),dn=_t&&(!Y||F.length>0)?Y?[is,...F]:[In,...ua,...F]:[],Ns=B&&X?[X.name,"SEO",...ns]:[],As=r("sectionsEditor.pageVariantTabs.variantsLabel"),Ms=P&&X?[X.name,As]:Ie&&X&&_e?[In,Ts,As]:[],mn=Ms.length>0?Ms:Ns.length>0?Ns:st?dn.length>0?dn:[Rs]:dn.length>0?dn:[In],Cs=Fn&&!xt&&!_e?.isHidden&&!!v,da=st||!Y&&at&&!!Qe||Cs,ma=Fn&&!xt&&!Y&&F.length===0&&!!_e&&bo(_e)&&!!v,fa=q&&_t&&!Ie&&xt&&F.length===0&&!!It,Ps=q&&F.length>0?Qs(F[F.length-1]):null,pa=F.length>1?Qs(F[F.length-2]):null,Ds=st?Rs:_t?_e?.label??"":X?.name??"",ha=P||Ie?r("sectionsEditor.pageVariantTabs.variantsLabel"):B?r("sectionsEditor.panelSections.seo"):Ps??Ds,Ks=Ie?_e?.variantOf??_e?.label??"":P||B?X?.name??"":Ps?pa??Ds:st?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):_t?X?.name??"":X?.path??"",Ln=!P&&!Ie&&!B&&!_t&&!st,ga=!q&&!B&&!Y&&xt&&F.length===0,Qt=()=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const t=m[v],n=Mr(t.sections,D);if(!n)return;const o=Cr(n);J.mutate({blockKey:v,data:{...t,sections:n}},{onSuccess:()=>{fe(o),M(null),C(null),I(null),A([]),re(null),Ke(null)},onError:a=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})},fn=(t,n,o)=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const a=m[v],l=a.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const i=l;if(!Array.isArray(i.variants))return;const p=t([...i.variants]);if(!p)return;const x=zr(i,p),R={...m,[v]:{...a,sections:x}};J.mutate({blockKey:v,data:R[v]},{onSuccess:()=>{n?.();const y=typeof o=="string"?[o]:o??[];(async()=>{for(const k of y)await Vt(k,R)})()},onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},On=t=>{ne(null),fe(t),M(null),C(null),I(null),A([]);const n=ue[t]?.rule,{resolveType:o,formValue:a}=Zt(n,m??{},u??void 0);Ke(o),re(a),An(ue.map(l=>({rule:l.rule})),t)},Bs=(t,n)=>{if(t===n)return;let o=Z;Z===t?o=n:t<Z&&n>=Z?o=Z-1:t>Z&&n<=Z&&(o=Z+1),fe(o);const a=xn(ue.map(l=>({rule:l.rule})),t,n);An(a,o),fn(l=>xn(l,t,n))},Fs=t=>{const n=ue[t]?.rule,o=Et(n,m??{},u??void 0);fn(a=>a.length<=1?null:(a.splice(t,1),a),()=>{ue.length-1===1?fe(0):t<Z?fe(Z-1):t===Z&&fe(Math.max(0,t-1)),M(null),C(null),I(null),A([]),re(null),Ke(null)},o)},va=()=>{const t=ue.map((n,o)=>({variant:n,index:o})).filter(({variant:n})=>!Or(n.rule)).map(({variant:n})=>Et(n.rule,m??{},u??void 0)).filter(n=>!!n);fn(n=>{const o=qr({variants:n}),a=n[o];return a?[{...a,rule:Wr()}]:null},()=>{fe(0),M(null),C(null),I(null),A([]),re(null),Ke(null),ct(!1)},t)},Is=t=>{fn(n=>Ur(n,t),()=>{fe(t+1),M(null),C(null),I(null),A([]),re(null),Ke(null)})},Sa=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const o=Ae.current.activePageKey,a=Ae.current.decofile;if(!o)return;const l=a[o],i=l.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const y=R.rule,k=n.trim();Kt(!0);try{if(!k){if(!At(y,a,u)){ne(null);return}const te=y.__resolveType??"";x[t]={...R,rule:Jn(y,a,u)};const K={...a,[o]:{...l,sections:{...p,variants:x}}};await J.mutateAsync({blockKey:o,data:K[o]}),await Vt(te,K),ne(null),_?.();return}const w=Yn(y,a,u);if(!w){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await J.mutateAsync({blockKey:w.blockKey,data:jt(w.resolveType,w.data,k)}),ne(null),_?.();return}const ve=yn(k),ee=bn(ve,a);if(ee){V.error(ee);return}const G=jt(w.resolveType,w.data,k);let W=null;try{await J.mutateAsync({blockKey:ve,data:G}),W=ve,x[t]={...R,rule:Ht(ve)},await J.mutateAsync({blockKey:o,data:{...l,sections:{...p,variants:x}}}),W=null}catch(te){throw W&&await an.mutateAsync({blockKey:W}).catch(()=>{}),te}ne(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:k})),_?.()}catch(w){V.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},ya=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{selectedSectionIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(o===null||!p)return;const y=a[o],k=l[o];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=ve[t];if(!ee?.rule||typeof ee.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=ee.rule,W=n.trim();Kt(!0);const te=async K=>{const ze={...w,variants:K},Xe=[...a];Xe[o]=Nt(y,k,ze);const Me=Xt(i,p,Xe,R,x);return await J.mutateAsync({blockKey:p,data:Me}),{...i,[p]:Me}};try{if(!W){if(!At(G,i,u)){se(null);return}const rt=G.__resolveType??"",Lt=[...ve];Lt[t]={...ee,rule:Jn(G,i,u)};const pn=await te(Lt);await Vt(rt,pn),se(null),_?.();return}const K=Yn(G,i,u);if(!K){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(K.blockKey){await J.mutateAsync({blockKey:K.blockKey,data:jt(K.resolveType,K.data,W)}),se(null),_?.();return}const ze=yn(W),Xe=bn(ze,i);if(Xe){V.error(Xe);return}const Me=jt(K.resolveType,K.data,W);let Ce=null;try{await J.mutateAsync({blockKey:ze,data:Me}),Ce=ze;const rt=[...ve];rt[t]={...ee,rule:Ht(ze)},await te(rt),Ce=null}catch(rt){throw Ce&&await an.mutateAsync({blockKey:Ce}).catch(()=>{}),rt}se(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:W})),_?.()}catch(K){V.error(K instanceof Error?K.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Ls=async(t,n,o)=>{C(o);try{await J.mutateAsync({blockKey:t,data:o})}catch(a){throw C(l=>l===o?n:l),a}},ba={rename:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n],x=p?.rule&&typeof p.rule=="object"?p.rule:void 0,R=async k=>{const w={...t,variants:k};return await Ls(a,t,w),{...l,[a]:w}},y=Fi(x,o,l,u);if(y.kind!=="noop"){if(y.kind==="error"){V.error(y.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):y.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):y.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Kt(!0);try{if(y.kind==="inline"){const w=[...i];w[n]={...p,rule:y.inlinedRule};const ve=await R(w);await Vt(y.blockKey,ve),_?.();return}if(y.kind==="updateBlock"){await J.mutateAsync({blockKey:y.blockKey,data:y.blockData}),_?.();return}let k=null;try{await J.mutateAsync({blockKey:y.blockId,data:y.blockData}),k=y.blockId;const w=[...i];w[n]={...p,rule:y.reference},await R(w),k=null}catch(w){throw k&&await an.mutateAsync({blockKey:k}).catch(()=>{}),w}V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:o.trim()})),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}}},selectGlobal:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n];if(!p)return;const x=Et(p.rule,l,u);i[n]={...p,rule:Ht(o)};const R={...t,variants:i},y={...l,[a]:R};try{await Ls(a,t,R),x&&x!==o&&await Vt(x,y),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Os=()=>{Rt()},zs=t=>{sn(t),Kn({inner:t})},$s=t=>{jn(t),Kn({raw:t})},Hs=()=>{sn(null),wt([])},Gs=()=>Gt(t=>t+1),qs=()=>{on.flush(),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1),me?.()},xa=()=>{ct(!1),L(!1),M(null),qe(!0)},_a=()=>{B&&qs(),M(null),ct(!0)},Ea=()=>L(!0),zn=t=>{if(P&&t===0){ct(!1);return}if(Ie&&t<2){L(!1),t===0&&M(null);return}if(B){if(t===0){qs();return}if(t===1){wt([]),Gt(o=>o+1);return}wt(ns.slice(0,t-1)),Gt(o=>o+1);return}if(Y){A(F.slice(0,t)),$(o=>o+1);return}if(t===0){Os();return}if(t===1){A([]),$(o=>o+1);return}const n=!q&&xt&&It?1:0;if(n===1&&t===2){A([]),$(o=>o+1);return}A(F.slice(0,t-1-n))},$n=mn.length>1?s.jsx("button",{type:"button",onClick:()=>zn(pr(mn.length,{isMultivariateSectionTop:ga})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(_r,{className:"size-4"})}):null,ja=st||_t||B?da&&s.jsxs("div",{className:oe("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Y&&at&&Qe&&s.jsxs("button",{type:"button",onClick:Os,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Qe.label}),className:oe("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",rr),children:[s.jsx(ar,{rule:qn(Qe.rule,m??{},u??void 0),matchers:Ft}),s.jsx("span",{className:"max-w-[160px] truncate",children:Qe.label})]}),s.jsx("div",{className:"flex-1"}),st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cs&&s.jsx(vn,{onClick:()=>Yt()})]}),st&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs,variant:"header"})}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>qe(!0),children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>He&&v?He():we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(vn,{onClick:Qt})]}),ka=s.jsxs(s.Fragment,{children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsx(eo,{className:"mt-3",children:s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})})]}),Ws=s.jsxs(s.Fragment,{children:[s.jsx(ir,{listKey:`${v??""}:${f??""}`,variants:bt.map((t,n)=>({index:n,label:t.label})),selectedIndex:un,onSelect:hs,onRename:se,onDuplicate:na,onDelete:ta,onRemoveAll:gs,onReorder:sa,onAdd:()=>Yt()}),s.jsx(eo,{children:s.jsx(Hn,{currentRt:Pt??"",currentLabel:en(It?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(It?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:aa,onSelectGlobal:ia,schema:ca,formValue:Vo,onChange:ra,formKey:`${f??"none"}:${un}:${Pt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us=s.jsx("div",{className:oe(q?"px-2":"p-2 pt-3"),children:s.jsx(Ti,{listKey:`${v??""}-${Z}`,rawSections:D,sections:ge,meta:u,decofile:m,selectedIndex:f,onSelect:qo,onReorder:Wo,onDelete:Uo,onDuplicate:Jo,onMakeReusable:ke,onToggleHidden:Yo,onToggleLazy:Qo,onAddVariant:Yt,onDetach:Xo,onAddSection:()=>ye(!0),canAddSection:Ss})}),wa=s.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&X&&s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs}),Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Ra=s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Va=s.jsxs($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsxs("div",{className:oe("px-3 border-b",xe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>Ye(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":xe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),xe?s.jsx(yr,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),xe&&s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us]},"editor-section-list");return s.jsx(lr,{children:s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&$n&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:$n}),(q||mn.length>1)&&s.jsx(cr,{crumbs:mn,onSelect:zn,onSelectRoot:()=>{on.flush(),$e?$e():zn(0)}}),s.jsx("div",{className:"shrink-0",children:q?s.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&$n,st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:ha}),Ks&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ks})]}),Ln&&at&&Qe&&s.jsx(to,{variants:ue,activeIndex:Z,onSelect:On,onManage:_a,onRemoveAll:va}),fa&&s.jsx(to,{variants:bt,activeIndex:un,onSelect:hs,onManage:Ea,onRemoveAll:gs}),Ln&&!at&&s.jsx(vn,{onClick:Qt}),ma&&s.jsx(vn,{onClick:()=>Yt()}),s.jsx(ur,{}),Ln&&s.jsxs(s.Fragment,{children:[s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:xa,children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!He&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):ja}),Ie?s.jsx(no,{onAdd:()=>Yt(),children:Ws},"editor-section-variants"):_t?s.jsxs($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&xt&&bt.length>0&&F.length===0&&Ws,s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps,onVariantMatcherOp:Y?ba:void 0})]},"editor-section-form"):Y?s.jsx($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps})},"editor-global-block"):B?q?s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"p-3",children:wa})},"editor-seo"):Ra:P?s.jsx(no,{onAdd:Qt,children:ka},"editor-variants"):q?s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"py-2",children:Us})}),s.jsx("div",{className:"shrink-0 border-t p-2",children:s.jsx(Zn,{canAddSection:Ss,onAddSection:()=>ye(!0)})})]},"editor-section-list"):Va,s.jsx(dr,{open:ce!==null,onOpenChange:t=>{t||ke(null)},defaultBlockId:ce!==null?yn(ge[ce]?.label??""):"",isPending:J.isPending,onSubmit:oa}),je&&s.jsx(mi,{open:Fe,onOpenChange:t=>{ye(t),t||(be.current=null)},meta:u,decofile:m,previewBaseUrl:je,onSelect:ea}),Ne&&v&&m&&s.jsx(kr,{open:Ne,onOpenChange:we,pageKey:v,decofile:m}),pe!==null&&s.jsx(oo,{open:!0,initialName:At(ue[pe]?.rule,m??{},u??void 0)?en(ue[pe]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(ue[pe]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await Sa(pe,t)},onOpenChange:t=>{!t&&!Dt&&ne(null)}}),he!==null&&s.jsx(oo,{open:!0,initialName:At(bt[he]?.rule,m??{},u??void 0)?en(bt[he]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(bt[he]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await ya(he,t)},onOpenChange:t=>{!t&&!Dt&&se(null)}})]})})}export{Lu as SectionsEditor};
|
|
1
|
+
import{c as tn,b as nn,r as E,l as oe,j as s,b1 as Ta,B as Mt,U as zt,au as Na,X as Aa,V as Ma,o as Ca,h as Pa,t as V,K as Da}from"./index-4XFLhK7S.js";import{u as Ka}from"./chat-context-BR-PmAJg.js";import{u as En}from"./use-new-blocks-editor-DuP8uKZj.js";import{J as Ba,K as Fa,N as Ia,O as La,Q as Oa,T as za,U as $a,V as Ha,W as Ga,X as Js,Y as qa,Z as Wa,_ as Ct,G as pt,$ as lt,H as yn,E as bn,e as Ua,f as Ja,j as Ya,u as Qa,a0 as Ys,o as Xa,a1 as Za,q as er,n as tr,a2 as nr,p as gn,a3 as sr,a4 as or,C as Qs,a5 as ar,a6 as rr,a7 as vn,a8 as Xs,a9 as Zs,aa as eo,ab as Hn,ac as ir,ad as lr,F as cr,ae as to,af as ur,ag as no,ah as so,M as dr,ai as oo,d as mr,aj as Xt,ak as fr,al as pr,am as Gn,an as hr,ao as gr,ap as vr}from"./runnable-block-editor-dTVVXX5v.js";import{c as Sr}from"./repository-binding-C_InVumU.js";import{n as yr,t as br}from"./ChevronUp-BSm7AtSf.js";import{a6 as So,d as _n,ak as xr,C as _r,$ as ao,K as ro}from"./agent-icon-DDBSTxwl.js";import{S as $t}from"./scroll-area-DYybJ63r.js";import{b as ht,T as gt,a as vt}from"./tooltip-CUk78XFR.js";import{m as Er,u as jr,P as kr}from"./mustache-D7UTScQH.js";import{as as yo,c as es,at as bo,G as wr,au as it,av as Un,aw as xo,ai as At,a6 as Jn,ax as Yn,aj as jt,a7 as Ht,j as Rr,l as Vr,g as Tr,r as Sn,am as Nr,ah as Zt,a8 as qn,ag as Et,af as en,ay as Ar,K as Mr,az as Cr,ak as io,a0 as lo,aA as Pr,aB as Nt,aC as Dr,aD as Kr,aE as Br,aF as co,aG as Fr,aH as Ir,aI as Lr,ae as Or,aJ as zr,aK as $r,aL as Hr,V as Gr,aM as qr,ad as Wr,aN as Ur}from"./claim-phase-copy-C0pvoElR.js";import{a as Jr}from"./Copy01-DlA26aBh.js";import{a as Qn,e as _o}from"./UserSquare-BFlEW2x5.js";import{i as uo}from"./Tool01-o_nJ7Y1x.js";import{s as mo}from"./Image01-BjUHwjIr.js";import{s as Yr}from"./Plus-DLTeBarI.js";import{s as Qr}from"./Trash01-JZaZB0vu.js";import{i as Xn}from"./ZoomOut-DA1sRe95.js";import{u as Xr,a as fo,K as Zr,P as ei,b as ti,C as ni,D as si,c as oi}from"./core.esm-C90YQIGJ.js";import{u as ai,s as ri,a as xn,S as ii,v as li}from"./sortable.esm-Dvqn6rnz.js";import{a as ci,P as po,b as ui}from"./page-seo-form-0-tAzxyW.js";import{u as di,A as mi}from"./use-section-preview-base-BYZSxM0z.js";import{b as ho,a as fi}from"./variant-matcher-override-CgF3ujB9.js";import"./use-panel-navigate-DOyxnt44.js";import"./thread-route-B-yx1tFW.js";import"./use-project-scope-DJTJDi3A.js";import"./autosend-D3KZZhDs.js";import"./thread-intent-DqexYQAC.js";import"./use-mcp-client-C5uLw7Lc.js";import"./auth-D1PkW9Uj.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BjTl5yOD.js";import"./task-board-DcolQ15W.js";import"./schema-DyLXU88M.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DH5jig6y.js";import"./use-ai-providers-CAEoYJwC.js";import"./use-chat-navigation-CKcbdotk.js";import"./location-BjlyegC2.js";import"./use-organization-settings-B0rQmLIX.js";import"./input-BzdgO_dK.js";import"./usage-stats-wClM7TZ-.js";import"./tool-namespace-CsdkV2uo.js";import"./form-BZ1i_2GJ.js";import"./label-ByKoWpTn.js";import"./utils-CVEq3hMx.js";import"./markdown-BW2GJSHC.js";import"./use-copy-BC3Fmh27.js";import"./use-mobile-Buz9Esa_.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-DO008B8R.js";import"./icon-button-BDbIWVW3.js";import"./file-type-icon-Dbuavq5L.js";import"./shell-layout-DZBrJWAA.js";import"./avatar-Brh_8d7a.js";import"./User01-BGOQS9vx.js";import"./Building02-EbX1A23K.js";import"./CheckCircle-CoJfU94i.js";import"./Monitor01-CTL-UG2p.js";import"./use-clock-tick-CwQv-OCe.js";import"./command-BfXTTBD9.js";import"./index-DVVx4F0i.js";import"./SearchMd-BsNWsFDv.js";import"./integration-icon-BqsHjS-b.js";import"./LinkBroken01-Cjxu7rCw.js";import"./project-icon-CMe6LZd9.js";import"./new-project-dialog-DdG-RgMO.js";import"./ArrowLeft-iygYSRbQ.js";import"./repository-import-picker-Bixi7zBc.js";import"./use-navigate-to-agent-C41zpB_Z.js";import"./repository-picker-BHgNNGrn.js";import"./useInfiniteQuery-B3MUNCKJ.js";import"./infiniteQueryObserver-DLzEnjM8.js";import"./collection-search-Cp82h57b.js";import"./ShoppingBag01-CWlRU3Ye.js";import"./use-debounced-value-CNkuXNOW.js";import"./required-auth-layout-CxaLcttO.js";import"./use-org-sso-DVCQNBfN.js";import"./chat-draft-CWFQi3-d.js";import"./ArrowUp-KCSPs-fi.js";import"./Upload01-CpEePL13.js";import"./AlertCircle-D4iOZ3Bs.js";import"./select-CEirlFRV.js";import"./index-BdQq_4o_.js";import"./index-DujNp8wX.js";import"./tabs-tkvg_YSq.js";import"./use-deco-credits-DKtKOwIN.js";import"./toggle-group-SSpwI-zE.js";import"./use-open-billing-url-C1VukQDg.js";import"./index-pEr2eE8n.js";import"./checkbox-CGTvhz0x.js";import"./ChevronSelectorVertical-DqpRXMOM.js";import"./Key01-DMnhMxC3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DGVyEQ9q.js";import"./drawer-20Gv7XN0.js";import"./input-DQtH0um6.js";import"./suggestion-DHADwupQ.js";import"./use-chat-layout-state-BYcPLpFV.js";import"./use-file-configs-DsMQGho1.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-Dxu80Ack.js";import"./use-org-fs-DqhUUlbQ.js";import"./Link01-DKypA3Uf.js";import"./question-004-sINsf4GQ.js";import"./use-members-C9_S9nP9.js";import"./use-org-auth-client-DjRiIxwH.js";import"./feature-paywall-B1-Kq6zS.js";import"./plan-ladder-D4-VvMwX.js";import"./add-connection-dialog-BTQ6Snbx.js";import"./extract-connection-data-C8Idk1Oj.js";import"./metadata-D72DunRR.js";import"./connection-BTT1rt_2.js";import"./url-slug-CFKzH8Z4.js";import"./connection-card-CsIFgDe8.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BpBHfDQd.js";import"./use-connection-DldRXuvq.js";import"./connection-form-helpers-Bg3g47y2.js";import"./authenticate-and-persist-oauth-BfNR0joU.js";import"./mcp-oauth-BjHElKzR.js";import"./mcp-oauth-CVI2AkSu.js";import"./collection-tabs-C6HP7d51.js";import"./badge-Dp13ql_I.js";import"./use-infinite-scroll-C0Ths8NM.js";import"./useSuspenseInfiniteQuery-DPTWpcSJ.js";import"./use-task-board-events-Bx8_k4aV.js";import"./Play-NZWCLDah.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Cm6oR2ES.js";import"./collapsible-Cq1aFrCg.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fDcax7T2.js";import"./types-DPbXDbOS.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-Bs1jJD9o.js";import"./use-thread-outputs-D13C6fsy.js";import"./utils-qUv9_Hyk.js";import"./monaco-editor-DkahnDKS.js";import"./editor-CklcmkgZ.js";import"./calendar-DEB-AUfC.js";import"./SwitchHorizontal01-DZEm8csq.js";import"./rich-text-link-control-C2ryIXD3.js";import"./switch-BD8_vvWq.js";import"./view-mode-toggle-BaZ1kmhW.js";import"./combobox-CF6B9Wmt.js";import"./alert-dialog-DpmCpPBI.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-CTugBooH.js";import"./search-input-DJwYl_zW.js";import"./asset-utils-BUihGB_o.js";import"./sandbox-git-api-C7JbVL7R.js";import"./CreditCard01-CXGPcE51.js";import"./Globe04-DDiW2Onm.js";import"./Sun-DhZMu2lN.js";import"./Users01-C9dOtgmV.js";import"./section-preview-url-7zfngvgW.js";function pi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Eo(d,e){const c=pi(e),h=c[btoa(d)];if(!h)return[];const g=[h];if(Array.isArray(h.allOf)){const b=h.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof b=="string"){const j=c[b.replace("#/definitions/","")];j&&g.push(j)}}return g}function hi(d,e){for(const c of Eo(d,e)){const h=typeof c.image=="string"?c.image:void 0;if(h?.includes("{{{"))return h}}function gi(d,e){if(!e)return;const c=yo(d);if(!c)return;const h=hi(c.resolveType,e);if(!h)return;const g=Ba(h,c.data);if(g)return Fa(g)}const vi={escape:Ia};function Si(d,e){for(const c of Eo(d,e)){const h=typeof c.title=="string"?c.title:void 0;if(h?.includes("{{"))return h}}function yi(d,e){if(!e)return;const c=yo(d);if(c)try{const h=Si(c.resolveType,e);return h&&Er.render(h,c.data,{},vi).trim()||void 0}catch{return}}function bi(d){const e=tn.c(13),{icon:c,label:h,className:g}=d;let b;e[0]!==g?(b=oe("size-3.5",g),e[0]=g,e[1]=b):b=e[1];let j;e[2]!==c||e[3]!==b?(j=s.jsx(c,{className:b}),e[2]=c,e[3]=b,e[4]=j):j=e[4];let S;e[5]!==h||e[6]!==j?(S=s.jsx(gt,{asChild:!0,children:s.jsx("span",{role:"img","aria-label":h,className:"shrink-0 cursor-help",children:j})}),e[5]=h,e[6]=j,e[7]=S):S=e[7];let N;e[8]!==h?(N=s.jsx(vt,{className:"max-w-56",children:h}),e[8]=h,e[9]=N):N=e[9];let _;return e[10]!==S||e[11]!==N?(_=s.jsxs(ht,{children:[S,N]}),e[10]=S,e[11]=N,e[12]=_):_=e[12],_}const xi="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 go(d){return Array.from({length:d},(e,c)=>({id:crypto.randomUUID(),index:c}))}function jo(d){return d.map((e,c)=>({...e,index:c}))}function _i(d,e){if(e===d.length)return d;if(e<d.length)return jo(d.slice(0,e));const c=Array.from({length:e-d.length},(h,g)=>({id:crypto.randomUUID(),index:d.length+g}));return[...d,...c]}function ko(d){const e=tn.c(44),{section:c,raw:h,meta:g,decofile:b}=d,j=nn(),S=En(),N=c.isSavedBlock===!0,_=c.isMultivariate===!0;let Q;e[0]!==g||e[1]!==h?(Q=h&&g?gi(h,g):void 0,e[0]=g,e[1]=h,e[2]=Q):Q=e[2];const me=Q;let $e;e[3]!==g||e[4]!==_||e[5]!==h||e[6]!==N?($e=h&&g&&!N&&!_?yi(h,g):void 0,e[3]=g,e[4]=_,e[5]=h,e[6]=N,e[7]=$e):$e=e[7];const He=$e;let Pe;e[8]!==b||e[9]!==g||e[10]!==h||e[11]!==c?(Pe=Ga(h,c,b,g),e[8]=b,e[9]=g,e[10]=h,e[11]=c,e[12]=Pe):Pe=e[12];const ae=Pe;let r;e[13]!==_||e[14]!==h?.__resolveType?(r=!_&&es(h?.__resolveType??""),e[13]=_,e[14]=h?.__resolveType,e[15]=r):r=e[15];const T=r,Se=N?_n:_?So:_o;let H;e[16]!==_||e[17]!==N?(H=N?{color:wr}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=_,e[17]=N,e[18]=H):H=e[18];const m=H;let z;e[19]!==Se||e[20]!==S?(z=S?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(Se,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),s.jsx(Wa,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(xr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Se,e[20]=S,e[21]=z):z=e[21];let u;e[22]!==me?(u=me&&s.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=u):u=e[23];let U;e[24]!==S||e[25]!==m?(U=!S&&s.jsx(Qn,{className:"h-4 w-4 shrink-0",style:m}),e[24]=S,e[25]=m,e[26]=U):U=e[26];const q=S?"shrink":"flex-1",Re=c.isHidden&&"line-through opacity-50";let De;e[27]!==Re||e[28]!==q?(De=oe("min-w-0 truncate text-sm font-medium",q,Re),e[27]=Re,e[28]=q,e[29]=De):De=e[29];const Ze=He??c.label;let je;e[30]!==De||e[31]!==Ze?(je=s.jsx("span",{className:De,children:Ze}),e[30]=De,e[31]=Ze,e[32]=je):je=e[32];let f;e[33]!==T||e[34]!==S||e[35]!==ae||e[36]!==j?(f=S?s.jsxs(s.Fragment,{children:[T&&s.jsx(bi,{icon:Xn,label:j("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&s.jsx(Js,{}),s.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&s.jsx(Js,{className:"absolute -right-0.5 -top-0.5"}),e[33]=T,e[34]=S,e[35]=ae,e[36]=j,e[37]=f):f=e[37];let M;return e[38]!==je||e[39]!==f||e[40]!==z||e[41]!==u||e[42]!==U?(M=s.jsxs(s.Fragment,{children:[z,u,U,je,f]}),e[38]=je,e[39]=f,e[40]=z,e[41]=u,e[42]=U,e[43]=M):M=e[43],M}const Ei="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ji="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 wo(d,e,c){if(c)return qa({selected:e});const h=d.isSavedBlock===!0,g=d.isMultivariate===!0;return oe("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":h?Ei:g?ji:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Wn(d,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":d?"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 ki(d){const e=tn.c(90),{section:c,raw:h,meta:g,decofile:b,sortableId:j,selected:S,onSelect:N,onDelete:_,onDuplicate:Q,onMakeReusable:me,onToggleHidden:$e,onToggleLazy:He,onAddVariant:Pe,onDetach:ae}=d,r=nn(),T=En(),Se=h?es(h.__resolveType??""):!1,H=c.isHidden===!0,m=Se||H;let z;e[0]!==c?(z=bo(c),e[0]=c,e[1]=z):z=e[1];const u=z;let U;e[2]!==j?(U={id:j,animateLayoutChanges:Vi},e[2]=j,e[3]=U):U=e[3];const{attributes:q,listeners:Re,setNodeRef:De,transform:Ze,isDragging:je}=ai(U);let f;e[4]!==Ze?(f=ni.Transform.toString(Ze?{...Ze,x:0}:null),e[4]=Ze,e[5]=f):f=e[5];const M=je?0:void 0;let Ue;e[6]!==f||e[7]!==M?(Ue={transform:f,opacity:M},e[6]=f,e[7]=M,e[8]=Ue):Ue=e[8];const C=Ue;let et;e[9]!==c?(et=Oa(c),e[9]=c,e[10]=et):et=e[10];const I=et,St="button",fe=0;let Je;e[11]!==N?(Je=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),N())},e[11]=N,e[12]=Je):Je=e[12];const kt=je?"cursor-grabbing":"cursor-pointer";let Ge;e[13]!==T||e[14]!==c||e[15]!==S||e[16]!==kt?(Ge=oe("touch-none transition-colors",kt,wo(c,S,T)),e[13]=T,e[14]=c,e[15]=S,e[16]=kt,e[17]=Ge):Ge=e[17];let re;e[18]!==b||e[19]!==g||e[20]!==h||e[21]!==c?(re=s.jsx(ko,{section:c,raw:h,meta:g,decofile:b}),e[18]=b,e[19]=g,e[20]=h,e[21]=c,e[22]=re):re=e[22];const ie=!T&&!c.isMultivariate&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Wn(m,Se)),onClick:P=>{P.stopPropagation(),He()},onPointerDown:Ri,children:s.jsx(Xn,{className:oe("h-3.5 w-3.5",Se&&"text-warning")})})}),s.jsx(vt,{side:"bottom",children:r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ke=T?s.jsx(za,{label:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:H,onToggle:$e,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})}):s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Wn(m,H)),onClick:P=>{P.stopPropagation(),$e()},onPointerDown:wi,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})})}),s.jsx(vt,{side:"bottom",children:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),F=Aa,A=$a;let le;e[23]!==r?(le=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=le):le=e[24];const Ve=oe(Wn(m,!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 Be;e[25]!==A||e[26]!==le||e[27]!==Ve?(Be=s.jsx(A,{label:le,classicClassName:Ve}),e[25]=A,e[26]=le,e[27]=Ve,e[28]=Be):Be=e[28];let Te;e[29]!==T||e[30]!==Se||e[31]!==He||e[32]!==c.isMultivariate||e[33]!==r?(Te=T&&!c.isMultivariate&&s.jsxs(s.Fragment,{children:[s.jsxs(zt,{onClick:P=>{P.stopPropagation(),He()},children:[s.jsx(Xn,{className:"h-4 w-4"}),r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),s.jsx(Na,{})]}),e[29]=T,e[30]=Se,e[31]=He,e[32]=c.isMultivariate,e[33]=r,e[34]=Te):Te=e[34];let $;e[35]!==Q?($=P=>{P.stopPropagation(),Q()},e[35]=Q,e[36]=$):$=e[36];let ce;e[37]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(Jr,{className:"h-4 w-4"}),e[37]=ce):ce=e[37];let ke;e[38]!==r?(ke=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=ke):ke=e[39];let pe;e[40]!==$||e[41]!==ke?(pe=s.jsxs(zt,{onClick:$,children:[ce,ke]}),e[40]=$,e[41]=ke,e[42]=pe):pe=e[42];let ne;e[43]!==T||e[44]!==u||e[45]!==Pe||e[46]!==r?(ne=u&&s.jsxs(zt,{className:oe(!T&&Ha),onClick:P=>{P.stopPropagation(),Pe()},children:[s.jsx(So,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=T,e[44]=u,e[45]=Pe,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==T||e[49]!==I||e[50]!==me||e[51]!==r?(he=I&&s.jsxs(zt,{className:oe(!T&&xi),onClick:P=>{P.stopPropagation(),me()},children:[T?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=T,e[49]=I,e[50]=me,e[51]=r,e[52]=he):he=e[52];let se;e[53]!==T||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&s.jsxs(zt,{onClick:P=>{P.stopPropagation(),ae()},children:[T?s.jsx(_o,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=T,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Fe;e[59]!==_?(Fe=P=>{P.stopPropagation(),_()},e[59]=_,e[60]=Fe):Fe=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Qr,{className:"h-4 w-4"}),e[61]=ye):ye=e[61];let Ne;e[62]!==r?(Ne=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ne):Ne=e[63];let we;e[64]!==Fe||e[65]!==Ne?(we=s.jsxs(zt,{variant:"destructive",onClick:Fe,children:[ye,Ne]}),e[64]=Fe,e[65]=Ne,e[66]=we):we=e[66];let be;e[67]!==Te||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==se||e[72]!==we?(be=s.jsxs(Ma,{align:"end",className:"w-44",children:[Te,pe,ne,he,se,we]}),e[67]=Te,e[68]=pe,e[69]=ne,e[70]=he,e[71]=se,e[72]=we,e[73]=be):be=e[73];let xe;e[74]!==F||e[75]!==Be||e[76]!==be?(xe=s.jsxs(F,{children:[Be,be]}),e[74]=F,e[75]=Be,e[76]=be,e[77]=xe):xe=e[77];let Ye;return e[78]!==q||e[79]!==Re||e[80]!==N||e[81]!==De||e[82]!==C||e[83]!==Ge||e[84]!==re||e[85]!==ie||e[86]!==Ke||e[87]!==xe||e[88]!==Je?(Ye=s.jsxs("div",{ref:De,style:C,...q,...Re,role:St,tabIndex:fe,onClick:N,onKeyDown:Je,className:Ge,children:[re,ie,Ke,xe]}),e[78]=q,e[79]=Re,e[80]=N,e[81]=De,e[82]=C,e[83]=Ge,e[84]=re,e[85]=ie,e[86]=Ke,e[87]=xe,e[88]=Je,e[89]=Ye):Ye=e[89],Ye}function wi(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function Vi(){return!1}function Zn(d){const e=tn.c(11),{canAddSection:c,onAddSection:h,className:g,size:b}=d,j=nn();let S;e[0]!==g?(S=oe("w-full",g),e[0]=g,e[1]=S):S=e[1];const N=!c;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Yr,{size:14}),e[2]=_):_=e[2];let Q;e[3]!==j?(Q=j("sectionsEditor.sectionList.addSectionButton"),e[3]=j,e[4]=Q):Q=e[4];let me;return e[5]!==h||e[6]!==b||e[7]!==S||e[8]!==N||e[9]!==Q?(me=s.jsxs(Mt,{type:"button",variant:"outline",size:b,className:S,disabled:N,onClick:h,children:[_,Q]}),e[5]=h,e[6]=b,e[7]=S,e[8]=N,e[9]=Q,e[10]=me):me=e[10],me}function Ti(d){const e=tn.c(101),{listKey:c,rawSections:h,sections:g,meta:b,decofile:j,selectedIndex:S,onSelect:N,onReorder:_,onDelete:Q,onDuplicate:me,onMakeReusable:$e,onToggleHidden:He,onToggleLazy:Pe,onAddVariant:ae,onDetach:r,onAddSection:T,canAddSection:Se}=d,H=Se===void 0?!0:Se,m=nn(),z=En();let u;e[0]!==g.length?(u=()=>go(g.length),e[0]=g.length,e[1]=u):u=e[1];const[U,q]=E.useState(u),[Re,De]=E.useState(null),[Ze,je]=E.useState(c),[f,M]=E.useState(g.length),Ue=E.useRef(!1);Ze!==c?(je(c),M(g.length),q(go(g.length))):f!==g.length&&(M(g.length),q(Ie=>_i(Ie,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let et;e[3]===Symbol.for("react.memo_cache_sentinel")?(et={coordinateGetter:ri},e[3]=et):et=e[3];const I=Xr(fo(ei,C),fo(Zr,et));let St;e[4]!==U?(St=U.map(Ni),e[4]=U,e[5]=St):St=e[5];const fe=St;let Je;e[6]===Symbol.for("react.memo_cache_sentinel")?(Je=Ie=>{De(String(Ie.active.id))},e[6]=Je):Je=e[6];const kt=Je;let Ge;e[7]!==fe||e[8]!==_?(Ge=Ie=>{De(null);const{active:L,over:B}=Ie;if(!B||L.id===B.id)return;const qe=fe.indexOf(String(L.id)),ot=fe.indexOf(String(B.id));qe===-1||ot===-1||(q(ut=>jo(xn([...ut],qe,ot))),Ue.current=!0,requestAnimationFrame(()=>{Ue.current=!1}),_?.(qe,ot))},e[7]=fe,e[8]=_,e[9]=Ge):Ge=e[9];const re=Ge;let ie;e[10]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{De(null)},e[10]=ie):ie=e[10];const Ke=ie;let F,A,le,Ve,Be,Te,$,ce,ke,pe,ne,he,se,Fe,ye;if(e[11]!==Re||e[12]!==H||e[13]!==z||e[14]!==j||e[15]!==U||e[16]!==fe||e[17]!==re||e[18]!==b||e[19]!==T||e[20]!==ae||e[21]!==Q||e[22]!==r||e[23]!==me||e[24]!==$e||e[25]!==N||e[26]!==He||e[27]!==Pe||e[28]!==h||e[29]!==g||e[30]!==S||e[31]!==I||e[32]!==m){Fe=Symbol.for("react.early_return_sentinel");e:{const Ie=L=>{Ue.current||N(L)};if(e[48]!==Re||e[49]!==H||e[50]!==z||e[51]!==U||e[52]!==T||e[53]!==h||e[54]!==g||e[55]!==m){const L=Re?U.find(B=>B.id===Re):null;if(Ve=L!=null?g[L.index]:null,le=L!=null?h[L.index]:void 0,U.length===0){let B;e[59]!==m?(B=m("sectionsEditor.sectionList.noSections"),e[59]=m,e[60]=B):B=e[60];let qe;e[61]!==B?(qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[61]=B,e[62]=qe):qe=e[62];const ot=qe;let ut;e[63]!==H||e[64]!==z||e[65]!==ot||e[66]!==T?(ut=z?ot:s.jsxs("div",{className:"space-y-2",children:[ot,s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm"})]}),e[63]=H,e[64]=z,e[65]=ot,e[66]=T,e[67]=ut):ut=e[67],Fe=ut;break e}se=oe(L&&"cursor-grabbing"),e[48]=Re,e[49]=H,e[50]=z,e[51]=U,e[52]=T,e[53]=h,e[54]=g,e[55]=m,e[56]=le,e[57]=Ve,e[58]=se}else le=e[56],Ve=e[57],se=e[58];A=si,ce=I,ke=oi,pe=kt,ne=re,he=Ke,F=ii,Te=fe,$=li,ye="space-y-1",Be=U.map(L=>{const B=g[L.index];return B?s.jsx(ki,{sortableId:L.id,section:B,raw:h[L.index],meta:b,decofile:j,selected:S===L.index,onSelect:()=>Ie(L.index),onDelete:()=>Q(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>$e(L.index),onToggleHidden:()=>He(L.index),onToggleLazy:()=>Pe(L.index),onAddVariant:()=>ae(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=Re,e[12]=H,e[13]=z,e[14]=j,e[15]=U,e[16]=fe,e[17]=re,e[18]=b,e[19]=T,e[20]=ae,e[21]=Q,e[22]=r,e[23]=me,e[24]=$e,e[25]=N,e[26]=He,e[27]=Pe,e[28]=h,e[29]=g,e[30]=S,e[31]=I,e[32]=m,e[33]=F,e[34]=A,e[35]=le,e[36]=Ve,e[37]=Be,e[38]=Te,e[39]=$,e[40]=ce,e[41]=ke,e[42]=pe,e[43]=ne,e[44]=he,e[45]=se,e[46]=Fe,e[47]=ye}else F=e[33],A=e[34],le=e[35],Ve=e[36],Be=e[37],Te=e[38],$=e[39],ce=e[40],ke=e[41],pe=e[42],ne=e[43],he=e[44],se=e[45],Fe=e[46],ye=e[47];if(Fe!==Symbol.for("react.early_return_sentinel"))return Fe;let Ne;e[68]!==Be||e[69]!==ye?(Ne=s.jsx("div",{className:ye,children:Be}),e[68]=Be,e[69]=ye,e[70]=Ne):Ne=e[70];let we;e[71]!==F||e[72]!==Te||e[73]!==$||e[74]!==Ne?(we=s.jsx(F,{items:Te,strategy:$,children:Ne}),e[71]=F,e[72]=Te,e[73]=$,e[74]=Ne,e[75]=we):we=e[75];let be;e[76]!==le||e[77]!==Ve||e[78]!==z||e[79]!==j||e[80]!==b?(be=Ve?s.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",wo(Ve,!1,z)),children:s.jsx(ko,{section:Ve,raw:le,meta:b,decofile:j})}):null,e[76]=le,e[77]=Ve,e[78]=z,e[79]=j,e[80]=b,e[81]=be):be=e[81];let xe;e[82]!==be?(xe=Ta.createPortal(s.jsx(ti,{dropAnimation:La,children:be}),document.body),e[82]=be,e[83]=xe):xe=e[83];let Ye;e[84]!==A||e[85]!==ce||e[86]!==ke||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==we||e[91]!==xe?(Ye=s.jsxs(A,{sensors:ce,collisionDetection:ke,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[we,xe]}),e[84]=A,e[85]=ce,e[86]=ke,e[87]=pe,e[88]=ne,e[89]=he,e[90]=we,e[91]=xe,e[92]=Ye):Ye=e[92];let P;e[93]!==H||e[94]!==z||e[95]!==T?(P=!z&&s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm",className:"mt-2"}),e[93]=H,e[94]=z,e[95]=T,e[96]=P):P=e[96];let ct;return e[97]!==se||e[98]!==Ye||e[99]!==P?(ct=s.jsxs("div",{className:se,children:[Ye,P]}),e[97]=se,e[98]=Ye,e[99]=P,e[100]=ct):ct=e[100],ct}function Ni(d){return d.id}function vo(d,e,c,h){if(!d||!e)return null;if(!e.isMultivariate)return pt(d,e,h)?.data??null;const g=it(d,e),b=g?Un(g,lt)[c]:void 0;return b?xo(b.value,h)?.data??null:null}const Ai=50;function Mi(d,e){d.own.push(Ct(e)),d.own.length>Ai&&d.own.shift()}function Ci(d,e){return d.own.includes(Ct(e))}function Pi(d,e){const{sectionIndex:c,variantIndex:h,shown:g,next:b,sectionCount:j}=e;return d&&d.sectionIndex===c&&d.variantIndex===h&&d.emitted===g?(d.emitted=b,d):g?{sectionIndex:c,variantIndex:h,base:g,emitted:b,sectionCount:j,own:[Ct(g)]}:null}function Di(d,e){return e!==null&&Ct(d)!==Ct(e)}function Ki(d,e){return d.__resolveType!==e.__resolveType}function Bi(d,e,c,h){if(e.length===h)return"here";const g=Ct(d),b=e.flatMap((j,S)=>S!==c&&j!==null&&Ct(j)===g?[S]:[]);return b.length===1?b[0]:"unknown"}function Fi(d,e,c,h){if(!d||typeof d!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return At(d,c,h)?{kind:"inline",blockKey:d.__resolveType??"",inlinedRule:Jn(d,c,h)}:{kind:"noop"};const b=Yn(d,c,h);if(!b)return{kind:"error",reason:"unreadable-rule"};if(b.blockKey)return{kind:"updateBlock",blockKey:b.blockKey,blockData:jt(b.resolveType,b.data,g)};const j=yn(g),S=bn(j,c);return S?{kind:"error",reason:"invalid-block-id",message:S}:{kind:"createBlock",blockId:j,blockData:jt(b.resolveType,b.data,g),reference:Ht(j)}}const Ii=3,Li=1e3;function Lu({orgSlug:d,virtualMcpId:e,branch:c,previewReady:h=!0,previewUrl:g,currentPath:b,activePageBlockKey:j=null,activeGlobalBlockKey:S=null,externalSelection:N,onSaved:_,initialEditSeo:Q=!1,onExitSeo:me,onSelectRoot:$e,onViewJsonFile:He,onFocusedBlockChange:Pe,onVariantPreviewOverride:ae}){const r=nn(),T=Ka(),Se=T?.taskId??null,H=h?{orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g}:null,{data:m,isLoading:z}=Ua(H),{data:u,isLoading:U}=Ja(H),q=En(),Re=T?.virtualMcpId,Ze=Sr(Re===e?e:null)?.metadata?.siteSlug??null,je=di({virtualMcpId:e,sandboxUrl:g}),[f,M]=E.useState(null),[Ue,C]=E.useState(null),[et,I]=E.useState(null),[St,fe]=E.useState(0),[Je,kt]=E.useState(void 0),[Ge,re]=E.useState(null),[ie,Ke]=E.useState(null),[F,A]=E.useState([]),le=E.useRef(null),[Ve,Be]=E.useState(F.length);Ve!==F.length&&(Be(F.length),requestAnimationFrame(()=>{le.current&&(le.current.scrollTop=0)}));const[Te,$]=E.useState(0),[ce,ke]=E.useState(null),[pe,ne]=E.useState(null),[he,se]=E.useState(null),[Fe,ye]=E.useState(!1),[Ne,we]=E.useState(!1),be=E.useRef(null),[xe,Ye]=E.useState(!0),[P,ct]=E.useState(!1),[Ie,L]=E.useState(!1),[B,qe]=E.useState(Q),[ot,ut]=E.useState(Q);Q&&!ot&&(ut(!0),qe(!0),M(null),C(null),I(null),A([])),!Q&&ot&&ut(!1);const[Ro,sn]=E.useState(null),[ts,jn]=E.useState(void 0),[ns,wt]=E.useState([]),[ss,Gt]=E.useState(0),[Le,tt]=E.useState(0),[Vo,Oe]=E.useState(null),[Pt,We]=E.useState(null),[os,as]=E.useState(null),To=Ca(),No=`${d}/${e}/${c}`,on=Ya({orgSlug:d,virtualMcpId:e,branch:c}),[Ao,Mo]=E.useState(b),[Co,Po]=E.useState(j),[Do,Ko]=E.useState(S);(Ao!==b||Co!==j||Do!==S)&&(queueMicrotask(()=>on.flush()),Mo(b),Po(j),Ko(S),M(null),C(null),I(null),fe(0),re(null),Ke(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1));const J=Qa({orgSlug:d,virtualMcpId:e,branch:c}),qt=mr((t,n)=>{J.mutate({blockKey:t,data:n},{onSuccess:()=>_?.(),onError:o=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),an=jr({orgSlug:d,virtualMcpId:e,branch:c}),[Dt,Kt]=E.useState(!1),O=E.useRef(null),kn=E.useRef(null),dt=E.useRef(null),mt=E.useRef(null),wn=E.useRef({}),rn=E.useRef(null),Ae=E.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[rs,Bo]=E.useState(0),[Fo,Io]=E.useState(0),[Lo,Oo]=E.useState(null);if(!h||z||U)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Pa,{className:"size-5 text-muted-foreground"})});if(!m||!u)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const zo=Rr(m),Y=!!S,X=Y?null:Vr(zo,b,j),v=Y?S:X?.key??null,Rn=Y&&S?m[S]:void 0,is=Y&&S&&Rn?Tr(S,Rn):Y&&S?S:"",Wt=!Y&&v&&m[v]?m[v]:null,Vn=B&&m&&u&&v&&X?Ys(m,{kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},u):null,$o=B?Wt?.seo:void 0,ln=ts!==void 0?ts:$o,Ho=B?Xa(ln):void 0,ls=Vn?.seoTypeOptions??[],cs=B&&u?Za(u):"",Tn=Ro??Ho??{},cn=B&&Vn?ci(Tn,Vn):null,us=B&&cn&&er(ln)?Sn(cn,u):null,ds=B?tr(m,u)?.seoData:void 0,ue=Y?[{label:"Default",sections:[{__resolveType:S}]}]:nr(Wt?.sections,m??{}),at=ue.length>1,Z=Math.min(St,ue.length-1),Qe=ue[Z],D=Qe?.sections??[],ge=gn(D,m),Nn=!Y&&Nr(Wt?.sections);if(Y&&S&&os!==S){as(S);const t=D[0],n=ge[0];if(t&&n){M(0),tt(0),A([]);const o=pt(t,n,m);o&&(C(o.data),I(o.resolveType),We(null),Oe(null))}}!Y&&os!==null&&as(null),Ae.current={rawSections:D,parsedSections:ge,decofile:m??{},activePageKey:v,pageVariants:ue,variantIndex:Z,sectionVariantIndex:Le,selectedSectionIndex:f};const Go=()=>({multivariate:Nn,index:Z,variants:ue.map(t=>({rule:t.rule}))}),An=(t,n)=>{if(!ae)return;if(!v||!Nn||t.length<=1){ae(null);return}const o=ho(v,{multivariate:!0,index:n,variants:t},m,u);ae(o.length>0?o:null)},Mn=ae&&v&&Nn&&at&&!z&&!U?v:null;if(Mn!==Lo&&(Oo(Mn),Mn)){const t=ue.map(o=>({rule:o.rule})),n=Z;queueMicrotask(()=>An(t,n))}const Bt=(t,n,o)=>{if(!ae)return;if(!v){ae(null);return}const a=Go(),l=ho(v,a,m,u);if(!t||n<0){ae(l.length>0?l:null);return}const i=fi({pageKey:v,page:a,sectionIndex:n,sectionLazy:ge[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:m,meta:u}),p=[...l,...i];ae(p.length>0?p:null)},ft=(t,n,o,a=f??-1,l=!1)=>{const i=it(t,n);if(!i){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const x=Un(i,lt)[o];if(!x){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const R=xo(x.value,m);C(R?.data??null),I(R?.resolveType??null);const{resolveType:y,formValue:k}=Zt(x.rule,m,u??void 0);We(y),Oe(k),l&&Bt(i,a,o)},Ut=N?.index;if(N!==void 0&&(N?.seq??null)!==Je&&(kt(N?.seq??null),typeof Ut=="number")){const t=D[Ut],n=ge[Ut];if(t&&n)if(M(Ut),tt(0),A([]),$(o=>o+1),n.isMultivariate)ft(t,n,0,Ut);else{const o=pt(t,n,m);o?(C(o.data),I(o.resolveType)):(C(null),I(null)),We(null),Oe(null)}}if(rs!==Fo){Io(rs);const t=f!==null?D[f]:null,n=f!==null?ge[f]:null;if(t&&n&&f!==null)if(A([]),$(o=>o+1),n.isMultivariate)ft(t,n,Le,f);else{const o=pt(t,n,m??{});C(o?.data??null),I(o?.resolveType??null)}}const Jt={orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g??void 0,siteSlug:Ze},Cn=et&&u?Sn(et,u):null,nt=(t,n)=>{if(!v)return;O.current&&(clearTimeout(O.current),O.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null);const o=Xt(m,v,t,Z,ue);J.mutate({blockKey:v,data:o},{onSuccess:()=>n?.onSuccess?.()??_?.(),onError:a=>{n?.onError?.(),V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))}})},Rt=()=>{Pe?.(null),M(null),L(!1),C(null),I(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1)},Pn=(t=r("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{O.current&&(clearTimeout(O.current),O.current=null),kn.current=null,V.error(t),Bo(n=>n+1)},Dn=(t,n,o=0)=>{const a=Ae.current.sectionVariantIndex,l=rn.current,i=l?.sectionIndex===n&&l.variantIndex===a?l:null,p=kn.current;O.current&&(clearTimeout(O.current),O.current=null,p&&(p.sectionIndex!==n||p.sectionVariantIndex!==a)&&p.write());const x=()=>{const{rawSections:R,parsedSections:y,decofile:k,activePageKey:w,pageVariants:ve,variantIndex:ee}=Ae.current,G=R[n];if(!G)return;const W=y[n];if(!W)return;const te=i?.base,K=vo(G,W,a,k),ze=!!te&&!!K&&Di(te,K)&&!(i&&Ci(i,K));if(ze&&te&&K){if(Ki(te,K)){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const de=W.isSavedBlock?"here":Bi(te,R.map((Ee,Ot)=>vo(Ee,y[Ot],a,k)),n,i?.sectionCount??R.length);if(de==="unknown"){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof de=="number"&&i){i.sectionCount=R.length,i.sectionIndex=de,M(de),Dn(t,de,o);return}}const Xe=[],Me=ze&&te&&K?hr(te,t,K,{prefer:"theirs",conflicts:Xe}):null,Ce=Me??t,rt=!!Me&&rn.current===i&&i?.emitted===t;Xe.length>0?V.warning(r("sectionsEditor.sectionsEditor.formFieldsKeptFromStored",{fields:gr(Xe)})):Me&&V.info(r("sectionsEditor.sectionsEditor.blockMergedWithOthers")),rt&&i&&(i.emitted=Me,C(Me));const Lt=rt||!Me?Ce:t;i&&(i.base=Lt,i.sectionCount=R.length,Mi(i,Lt));const pn={onSuccess:()=>_?.(),onError:de=>{if(i?.base===Lt&&te&&(i.base=te),de instanceof Gr){o<Ii?setTimeout(()=>{const Ee=i?.emitted;Dn(Ee&&typeof Ee=="object"?Ee:t,n,o+1)},Li*2**o):Pn();return}V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))}};if(W.isSavedBlock){const de=vr(G,W);if(!de)return;J.mutate({blockKey:de,data:Ce,...te?{base:{value:Me?K:te}}:{},rebaseOnConflict:!1},pn);return}if(!w)return;const hn={...k[w]},Tt=[...R];if(W.isMultivariate){const de=it(G,W);if(!de||!w)return;const Ee=Hr(de,a,Ce);Tt[n]=Nt(G,W,Ee)}else if(W.isHidden){const de=es(G.__resolveType),Ee=de?{...G.section}:{...G},Ot=Array.isArray(Ee.variants)?[...Ee.variants]:[];Ot[0]&&(Ot[0]={...Ot[0],value:Ce}),Ee.variants=Ot,de?Tt[n]={...G,section:Ee}:Tt[n]=Ee}else W.isLazy?Tt[n]={...G,section:Ce}:Tt[n]=Ce;if(ve.length>1){const de=hn.sections,Ee=[...de?.variants??[]];Ee[ee]&&(Ee[ee]={...Ee[ee],value:Tt}),hn.sections={...de,variants:Ee}}else hn.sections=Tt;J.mutate({blockKey:w,data:hn,rebaseOnConflict:!1},pn)};kn.current={sectionIndex:n,sectionVariantIndex:a,write:x},O.current=setTimeout(()=>{O.current=null,x()},Gn)},qo=t=>{M(t),tt(0),A([]),$(l=>l+1);const n=D[t],o=ge[t];if(Pe?.(o?.isSavedBlock?o.resolveType??null:null),!n||!o)return;if(o.isMultivariate){ft(n,o,0,t);return}const a=pt(n,o,m);if(!a){C(null),I(null),We(null),Oe(null),Bt(null,t,0);return}C(a.data),I(a.resolveType),We(null),Oe(null),Bt(null,t,0)},ms=t=>{const n=t;f!==null&&(rn.current=Pi(rn.current,{sectionIndex:f,variantIndex:Ae.current.sectionVariantIndex,shown:Ue,next:n,sectionCount:Ae.current.rawSections.length})),C(n),f!==null&&Dn(n,f)},Kn=t=>{if(!v||!m||!u||!X)return;const n={kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},o=Ys(m,n,u);o&&on.save(v,()=>{const a=To.getQueryData(Da.decofile(No))?.[v];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const l={...a,...wn.current};return wn.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?ui(n,o,l,t.inner):l})},fs=(t,n)=>{v&&(wn.current[t]=n,Kn())},Wo=(t,n)=>{if(!v)return;const o=xn([...D],t,n);f!==null&&(f===t?M(n):t<f&&n>=f?M(f-1):t>f&&n<=f&&M(f+1)),nt(o)},Uo=t=>{if(!v)return;const n=D.filter((o,a)=>a!==t);f===t?Rt():f!==null&&f>t&&M(f-1),nt(n)},Jo=t=>{if(!v)return;const n=D[t];if(!n)return;const o=[...D];o.splice(t+1,0,fr(n)),f!==null&&f>t&&M(f+1),nt(o)},Yo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o)return;const a=o.isHidden?Ir(n):Lr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Qo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o||o.isMultivariate)return;const a=Fr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Xo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o?.isSavedBlock)return;const a=pt(n,o,m);if(!a?.data)return;const{name:l,...i}=a.data,p=[...D];o.isLazy?p[t]={...n,section:i}:p[t]=i,f===t&&Rt(),nt(p)},Zo=t=>{if(!v)return;const n=[...D,{__resolveType:t.resolveType}],o=n.length-1;nt(n,{onError:()=>{Ae.current.selectedSectionIndex===o&&Rt()}}),ye(!1),M(o),tt(0),A([]),$(p=>p+1);const a=n[o],l=gn(n,m)[o];if(!a||!l)return;if(l.isMultivariate){ft(a,l,0);return}const i=pt(a,l,m);if(!i){C(null),I(null),We(null),Oe(null);return}C(i.data),I(i.resolveType),We(null),Oe(null)},ps=t=>{be.current=t.append,ye(!0)},ea=t=>{const n=be.current;if(!n){Zo(t);return}n({__resolveType:t.resolveType}),ye(!1),be.current=null},hs=t=>{if(f===null)return;const n=D[f],o=ge[f];!n||!o?.isMultivariate||(tt(t),A([]),$(a=>a+1),ft(n,o,t,f,!0))},ta=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Kr(a,t);if(!l){V.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...D];i[f]=Nt(n,o,l);const p=l.variants;let x=Le;t===Le?x=Math.min(t,p.length-1):t<Le&&(x=Le-1),tt(x),A([]),$(R=>R+1),ft(i[f],o,x),nt(i)},na=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Br(a,t),i=[...D];i[f]=Nt(n,o,l);const p=t+1;tt(p),A([]),$(x=>x+1),ft(i[f],o,p),nt(i)},sa=(t,n)=>{if(f===null||!v||t===n)return;const o=D[f],a=ge[f];if(!o||!a?.isMultivariate)return;const l=it(o,a);if(!l)return;const i=Pr(l,t,n),p=[...D];p[f]=Nt(o,a,i);let x=Le;Le===t?x=n:t<Le&&n>=Le?x=Le-1:t>Le&&n<=Le&&(x=Le+1),tt(x),ft(p[f],a,x),nt(p)},Yt=t=>{const n=t??f;if(n===null||!v)return;const o=D[n],a=ge[n];if(!o||!a)return;const l=Ar(o,a);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...D];i[n]=l.section;const p=gn(i,m)[n];if(!p?.isMultivariate){V.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(n),tt(l.newVariantIndex),A([]),$(x=>x+1),ft(l.section,p,l.newVariantIndex,n),nt(i)},gs=()=>{if(f===null||!v)return;const t=D[f],n=ge[f];if(!t||!n?.isMultivariate)return;const o=it(t,n);if(!o)return;const a=Dr(t,n,o);if(!a){V.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...D];l[f]=a;const i=gn(l,m)[f];if(!i)return;tt(0),We(null),Oe(null),A([]),$(x=>x+1);const p=pt(a,i,m);p?(C(p.data),I(p.resolveType)):(C(null),I(null)),Bt(null,f,0),nt(l)},oa=async t=>{if(ce===null||!v)return;const n=bn(t,m);if(n){V.error(n);return}const o=D[ce],a=ge[ce];if(!o||!a)return;const l=pt(o,a,m);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...l.data,name:t};try{await J.mutateAsync({blockKey:t,data:i});const p=[...D];p[ce]={__resolveType:t},await J.mutateAsync({blockKey:v,data:Xt(m,v,p,Z,ue)}),f===ce&&Rt(),ke(null),V.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),_?.()}catch(p){V.error(p instanceof Error?p.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},vs=Qe?.rule;if(at&&f===null&&ie===null&&vs){const{resolveType:t,formValue:n}=Zt(vs,m??{},u??void 0);Ke(t),re(n)}const Ft=u?sr(u):[],Bn=u&&m?or(u,m):[],Ss=!Y&&!!(je&&u&&m),ys=ie&&u?Sn(ie,u):null,yt=()=>{dt.current&&(clearTimeout(dt.current),dt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null)},Vt=async(t,n)=>{if(!($r(n,t,u)>0))try{await an.mutateAsync({blockKey:t})}catch(o){V.error(o instanceof Error?o.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},bs=t=>{dt.current&&clearTimeout(dt.current),dt.current=setTimeout(()=>{const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l={...o[n]},i={...l.sections},p=[...i.variants??[]],x=p[a],R=x?.rule;if(At(R,o,u)){const y=R?.__resolveType??"",k=o[y],w=typeof k?.name=="string"?k.name:y,{__resolveType:ve,...ee}=t;J.mutate({blockKey:y,data:jt(ve??"",ee,w)},{onSuccess:()=>_?.(),onError:G=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}x&&(p[a]={...x,rule:t}),l.sections={...i,variants:p},J.mutate({blockKey:n,data:l},{onSuccess:()=>_?.(),onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},Gn)},xs=t=>{Ke(t);const n=t?io(t,u):{__resolveType:lo};re(t?n:{}),bs(n)},_s=t=>{const n=t;re(n);const o=ie?{__resolveType:ie,...n}:{...n};bs(o)},Es=async t=>{yt();const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l=o[n],i=l?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[a];if(!R)return;const y=Et(R.rule,o,u),k=Ht(t);x[a]={...R,rule:k};const w={...o,[n]:{...l,sections:{...p,variants:x}}},{resolveType:ve,formValue:ee}=Zt(k,w,u??void 0);Ke(ve),re(ee);try{await J.mutateAsync({blockKey:n,data:w[n]}),y&&y!==t&&await Vt(y,w),_?.()}catch(G){V.error(G instanceof Error?G.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{mt.current&&clearTimeout(mt.current);const{selectedSectionIndex:n,sectionVariantIndex:o}=Ae.current;n!==null&&(mt.current=setTimeout(()=>{const{rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ee=(w.variants??[])[o]?.rule;if(At(ee,i,u)){const K=ee?.__resolveType??"",ze=i[K],Xe=typeof ze?.name=="string"?ze.name:K,{__resolveType:Me,...Ce}=t;J.mutate({blockKey:K,data:jt(Me??"",Ce,Xe)},{onSuccess:()=>_?.(),onError:rt=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:rt.message}))});return}const G=co(w,o,t),W=[...a];W[n]=Nt(y,k,G);const te=Xt(i,p,W,R,x);J.mutate({blockKey:p,data:te},{onSuccess:()=>_?.(),onError:K=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},Gn))},aa=t=>{We(t);const n=t?io(t,u):{__resolveType:lo};Oe(t?n:{}),js(n)},ra=t=>{const n=t;Oe(n);const o=Pt?{__resolveType:Pt,...n}:{...n};js(o)},ia=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(n===null||!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=Et(ve[o]?.rule,i,u),G=Ht(t),W=co(w,o,G),te=[...a];te[n]=Nt(y,k,W);const K=Xt(i,p,te,R,x),ze={...i,[p]:K},{resolveType:Xe,formValue:Me}=Zt(G,ze,u??void 0);We(Xe),Oe(Me);try{await J.mutateAsync({blockKey:p,data:K}),ee&&ee!==t&&await Vt(ee,ze),_?.()}catch(Ce){V.error(Ce instanceof Error?Ce.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!X)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Y&&!Rn)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const _e=f!==null?ge[f]??null:null,ks=f!==null?D[f]:null,ws=ks&&_e?.isMultivariate?it(ks,_e):null,bt=ws?Un(ws,lt):[],un=Math.min(Le,Math.max(bt.length-1,0)),It=bt[un]??null,xt=_e?.isMultivariate===!0,Fn=f!==null&&_e!==null,_t=Fn&&(xt||!!(Cn&&Ue)),la=_t&&!Y&&_e?.isSavedBlock===!0,st=Y||la,Rs=Y?is:_e?.label??"",ca=Pt&&u?Sn(Pt,u):null,Vs=(t,n)=>n&&q?`${t} · ${n}`:t,Ts=_e?_e.variantOf??_e.label:"",ua=(()=>{const t=xt&&It?It.label:null;return t?q?[Vs(Ts,t)]:[_e.label,t]:[_e?.label??""]})(),In=Vs(X?.name??"",at?Qe?.label:null),dn=_t&&(!Y||F.length>0)?Y?[is,...F]:[In,...ua,...F]:[],Ns=B&&X?[X.name,"SEO",...ns]:[],As=r("sectionsEditor.pageVariantTabs.variantsLabel"),Ms=P&&X?[X.name,As]:Ie&&X&&_e?[In,Ts,As]:[],mn=Ms.length>0?Ms:Ns.length>0?Ns:st?dn.length>0?dn:[Rs]:dn.length>0?dn:[In],Cs=Fn&&!xt&&!_e?.isHidden&&!!v,da=st||!Y&&at&&!!Qe||Cs,ma=Fn&&!xt&&!Y&&F.length===0&&!!_e&&bo(_e)&&!!v,fa=q&&_t&&!Ie&&xt&&F.length===0&&!!It,Ps=q&&F.length>0?Qs(F[F.length-1]):null,pa=F.length>1?Qs(F[F.length-2]):null,Ds=st?Rs:_t?_e?.label??"":X?.name??"",ha=P||Ie?r("sectionsEditor.pageVariantTabs.variantsLabel"):B?r("sectionsEditor.panelSections.seo"):Ps??Ds,Ks=Ie?_e?.variantOf??_e?.label??"":P||B?X?.name??"":Ps?pa??Ds:st?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):_t?X?.name??"":X?.path??"",Ln=!P&&!Ie&&!B&&!_t&&!st,ga=!q&&!B&&!Y&&xt&&F.length===0,Qt=()=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const t=m[v],n=Mr(t.sections,D);if(!n)return;const o=Cr(n);J.mutate({blockKey:v,data:{...t,sections:n}},{onSuccess:()=>{fe(o),M(null),C(null),I(null),A([]),re(null),Ke(null)},onError:a=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})},fn=(t,n,o)=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const a=m[v],l=a.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const i=l;if(!Array.isArray(i.variants))return;const p=t([...i.variants]);if(!p)return;const x=zr(i,p),R={...m,[v]:{...a,sections:x}};J.mutate({blockKey:v,data:R[v]},{onSuccess:()=>{n?.();const y=typeof o=="string"?[o]:o??[];(async()=>{for(const k of y)await Vt(k,R)})()},onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},On=t=>{ne(null),fe(t),M(null),C(null),I(null),A([]);const n=ue[t]?.rule,{resolveType:o,formValue:a}=Zt(n,m??{},u??void 0);Ke(o),re(a),An(ue.map(l=>({rule:l.rule})),t)},Bs=(t,n)=>{if(t===n)return;let o=Z;Z===t?o=n:t<Z&&n>=Z?o=Z-1:t>Z&&n<=Z&&(o=Z+1),fe(o);const a=xn(ue.map(l=>({rule:l.rule})),t,n);An(a,o),fn(l=>xn(l,t,n))},Fs=t=>{const n=ue[t]?.rule,o=Et(n,m??{},u??void 0);fn(a=>a.length<=1?null:(a.splice(t,1),a),()=>{ue.length-1===1?fe(0):t<Z?fe(Z-1):t===Z&&fe(Math.max(0,t-1)),M(null),C(null),I(null),A([]),re(null),Ke(null)},o)},va=()=>{const t=ue.map((n,o)=>({variant:n,index:o})).filter(({variant:n})=>!Or(n.rule)).map(({variant:n})=>Et(n.rule,m??{},u??void 0)).filter(n=>!!n);fn(n=>{const o=qr({variants:n}),a=n[o];return a?[{...a,rule:Wr()}]:null},()=>{fe(0),M(null),C(null),I(null),A([]),re(null),Ke(null),ct(!1)},t)},Is=t=>{fn(n=>Ur(n,t),()=>{fe(t+1),M(null),C(null),I(null),A([]),re(null),Ke(null)})},Sa=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const o=Ae.current.activePageKey,a=Ae.current.decofile;if(!o)return;const l=a[o],i=l.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const y=R.rule,k=n.trim();Kt(!0);try{if(!k){if(!At(y,a,u)){ne(null);return}const te=y.__resolveType??"";x[t]={...R,rule:Jn(y,a,u)};const K={...a,[o]:{...l,sections:{...p,variants:x}}};await J.mutateAsync({blockKey:o,data:K[o]}),await Vt(te,K),ne(null),_?.();return}const w=Yn(y,a,u);if(!w){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await J.mutateAsync({blockKey:w.blockKey,data:jt(w.resolveType,w.data,k)}),ne(null),_?.();return}const ve=yn(k),ee=bn(ve,a);if(ee){V.error(ee);return}const G=jt(w.resolveType,w.data,k);let W=null;try{await J.mutateAsync({blockKey:ve,data:G}),W=ve,x[t]={...R,rule:Ht(ve)},await J.mutateAsync({blockKey:o,data:{...l,sections:{...p,variants:x}}}),W=null}catch(te){throw W&&await an.mutateAsync({blockKey:W}).catch(()=>{}),te}ne(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:k})),_?.()}catch(w){V.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},ya=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{selectedSectionIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(o===null||!p)return;const y=a[o],k=l[o];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=ve[t];if(!ee?.rule||typeof ee.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=ee.rule,W=n.trim();Kt(!0);const te=async K=>{const ze={...w,variants:K},Xe=[...a];Xe[o]=Nt(y,k,ze);const Me=Xt(i,p,Xe,R,x);return await J.mutateAsync({blockKey:p,data:Me}),{...i,[p]:Me}};try{if(!W){if(!At(G,i,u)){se(null);return}const rt=G.__resolveType??"",Lt=[...ve];Lt[t]={...ee,rule:Jn(G,i,u)};const pn=await te(Lt);await Vt(rt,pn),se(null),_?.();return}const K=Yn(G,i,u);if(!K){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(K.blockKey){await J.mutateAsync({blockKey:K.blockKey,data:jt(K.resolveType,K.data,W)}),se(null),_?.();return}const ze=yn(W),Xe=bn(ze,i);if(Xe){V.error(Xe);return}const Me=jt(K.resolveType,K.data,W);let Ce=null;try{await J.mutateAsync({blockKey:ze,data:Me}),Ce=ze;const rt=[...ve];rt[t]={...ee,rule:Ht(ze)},await te(rt),Ce=null}catch(rt){throw Ce&&await an.mutateAsync({blockKey:Ce}).catch(()=>{}),rt}se(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:W})),_?.()}catch(K){V.error(K instanceof Error?K.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Ls=async(t,n,o)=>{C(o);try{await J.mutateAsync({blockKey:t,data:o})}catch(a){throw C(l=>l===o?n:l),a}},ba={rename:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n],x=p?.rule&&typeof p.rule=="object"?p.rule:void 0,R=async k=>{const w={...t,variants:k};return await Ls(a,t,w),{...l,[a]:w}},y=Fi(x,o,l,u);if(y.kind!=="noop"){if(y.kind==="error"){V.error(y.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):y.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):y.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Kt(!0);try{if(y.kind==="inline"){const w=[...i];w[n]={...p,rule:y.inlinedRule};const ve=await R(w);await Vt(y.blockKey,ve),_?.();return}if(y.kind==="updateBlock"){await J.mutateAsync({blockKey:y.blockKey,data:y.blockData}),_?.();return}let k=null;try{await J.mutateAsync({blockKey:y.blockId,data:y.blockData}),k=y.blockId;const w=[...i];w[n]={...p,rule:y.reference},await R(w),k=null}catch(w){throw k&&await an.mutateAsync({blockKey:k}).catch(()=>{}),w}V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:o.trim()})),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}}},selectGlobal:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n];if(!p)return;const x=Et(p.rule,l,u);i[n]={...p,rule:Ht(o)};const R={...t,variants:i},y={...l,[a]:R};try{await Ls(a,t,R),x&&x!==o&&await Vt(x,y),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Os=()=>{Rt()},zs=t=>{sn(t),Kn({inner:t})},$s=t=>{jn(t),Kn({raw:t})},Hs=()=>{sn(null),wt([])},Gs=()=>Gt(t=>t+1),qs=()=>{on.flush(),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1),me?.()},xa=()=>{ct(!1),L(!1),M(null),qe(!0)},_a=()=>{B&&qs(),M(null),ct(!0)},Ea=()=>L(!0),zn=t=>{if(P&&t===0){ct(!1);return}if(Ie&&t<2){L(!1),t===0&&M(null);return}if(B){if(t===0){qs();return}if(t===1){wt([]),Gt(o=>o+1);return}wt(ns.slice(0,t-1)),Gt(o=>o+1);return}if(Y){A(F.slice(0,t)),$(o=>o+1);return}if(t===0){Os();return}if(t===1){A([]),$(o=>o+1);return}const n=!q&&xt&&It?1:0;if(n===1&&t===2){A([]),$(o=>o+1);return}A(F.slice(0,t-1-n))},$n=mn.length>1?s.jsx("button",{type:"button",onClick:()=>zn(pr(mn.length,{isMultivariateSectionTop:ga})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(_r,{className:"size-4"})}):null,ja=st||_t||B?da&&s.jsxs("div",{className:oe("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Y&&at&&Qe&&s.jsxs("button",{type:"button",onClick:Os,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Qe.label}),className:oe("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",rr),children:[s.jsx(ar,{rule:qn(Qe.rule,m??{},u??void 0),matchers:Ft}),s.jsx("span",{className:"max-w-[160px] truncate",children:Qe.label})]}),s.jsx("div",{className:"flex-1"}),st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cs&&s.jsx(vn,{onClick:()=>Yt()})]}),st&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs,variant:"header"})}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>qe(!0),children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>He&&v?He():we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(vn,{onClick:Qt})]}),ka=s.jsxs(s.Fragment,{children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsx(eo,{className:"mt-3",children:s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})})]}),Ws=s.jsxs(s.Fragment,{children:[s.jsx(ir,{listKey:`${v??""}:${f??""}`,variants:bt.map((t,n)=>({index:n,label:t.label})),selectedIndex:un,onSelect:hs,onRename:se,onDuplicate:na,onDelete:ta,onRemoveAll:gs,onReorder:sa,onAdd:()=>Yt()}),s.jsx(eo,{children:s.jsx(Hn,{currentRt:Pt??"",currentLabel:en(It?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(It?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:aa,onSelectGlobal:ia,schema:ca,formValue:Vo,onChange:ra,formKey:`${f??"none"}:${un}:${Pt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us=s.jsx("div",{className:oe(q?"px-2":"p-2 pt-3"),children:s.jsx(Ti,{listKey:`${v??""}-${Z}`,rawSections:D,sections:ge,meta:u,decofile:m,selectedIndex:f,onSelect:qo,onReorder:Wo,onDelete:Uo,onDuplicate:Jo,onMakeReusable:ke,onToggleHidden:Yo,onToggleLazy:Qo,onAddVariant:Yt,onDetach:Xo,onAddSection:()=>ye(!0),canAddSection:Ss})}),wa=s.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&X&&s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs}),Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Ra=s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Va=s.jsxs($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsxs("div",{className:oe("px-3 border-b",xe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>Ye(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":xe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),xe?s.jsx(yr,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),xe&&s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us]},"editor-section-list");return s.jsx(lr,{children:s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&$n&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:$n}),(q||mn.length>1)&&s.jsx(cr,{crumbs:mn,onSelect:zn,onSelectRoot:()=>{on.flush(),$e?$e():zn(0)}}),s.jsx("div",{className:"shrink-0",children:q?s.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&$n,st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:ha}),Ks&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ks})]}),Ln&&at&&Qe&&s.jsx(to,{variants:ue,activeIndex:Z,onSelect:On,onManage:_a,onRemoveAll:va}),fa&&s.jsx(to,{variants:bt,activeIndex:un,onSelect:hs,onManage:Ea,onRemoveAll:gs}),Ln&&!at&&s.jsx(vn,{onClick:Qt}),ma&&s.jsx(vn,{onClick:()=>Yt()}),s.jsx(ur,{}),Ln&&s.jsxs(s.Fragment,{children:[s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:xa,children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!He&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):ja}),Ie?s.jsx(no,{onAdd:()=>Yt(),children:Ws},"editor-section-variants"):_t?s.jsxs($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&xt&&bt.length>0&&F.length===0&&Ws,s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps,onVariantMatcherOp:Y?ba:void 0})]},"editor-section-form"):Y?s.jsx($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps})},"editor-global-block"):B?q?s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"p-3",children:wa})},"editor-seo"):Ra:P?s.jsx(no,{onAdd:Qt,children:ka},"editor-variants"):q?s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"py-2",children:Us})}),s.jsx("div",{className:"shrink-0 border-t p-2",children:s.jsx(Zn,{canAddSection:Ss,onAddSection:()=>ye(!0)})})]},"editor-section-list"):Va,s.jsx(dr,{open:ce!==null,onOpenChange:t=>{t||ke(null)},defaultBlockId:ce!==null?yn(ge[ce]?.label??""):"",isPending:J.isPending,onSubmit:oa}),je&&s.jsx(mi,{open:Fe,onOpenChange:t=>{ye(t),t||(be.current=null)},meta:u,decofile:m,previewBaseUrl:je,onSelect:ea}),Ne&&v&&m&&s.jsx(kr,{open:Ne,onOpenChange:we,pageKey:v,decofile:m}),pe!==null&&s.jsx(oo,{open:!0,initialName:At(ue[pe]?.rule,m??{},u??void 0)?en(ue[pe]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(ue[pe]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await Sa(pe,t)},onOpenChange:t=>{!t&&!Dt&&ne(null)}}),he!==null&&s.jsx(oo,{open:!0,initialName:At(bt[he]?.rule,m??{},u??void 0)?en(bt[he]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(bt[he]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await ya(he,t)},onOpenChange:t=>{!t&&!Dt&&se(null)}})]})})}export{Lu as SectionsEditor};
|