decocms 4.532.4 → 4.532.5
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-ChPJqGh0.js → ActiveShapeUtils-DBB_x8Gs.js} +1 -1
- package/dist/client/assets/{AlertCircle-BtpKz4PT.js → AlertCircle-BgO0RShT.js} +1 -1
- package/dist/client/assets/{AreaChart-DZmHXkAp.js → AreaChart-DKpy9mUx.js} +1 -1
- package/dist/client/assets/{ArrowLeft-ahbogFmz.js → ArrowLeft-CLIbFvcM.js} +1 -1
- package/dist/client/assets/{ArrowUp-DyCjG74a.js → ArrowUp-DGj1a1JQ.js} +1 -1
- package/dist/client/assets/{BarChart-CiE4pEf-.js → BarChart-D7kmxRhA.js} +1 -1
- package/dist/client/assets/{Building02-DxaGdtc9.js → Building02-DTlG5UDd.js} +1 -1
- package/dist/client/assets/{CartesianChart-cDuBYvE7.js → CartesianChart-BAgzcFkw.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DZHmxzzH.js → CategoricalChart-1w257zDj.js} +1 -1
- package/dist/client/assets/{CheckCircle-D-aNr7ni.js → CheckCircle-BoFFOiJR.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-JCtUtQXM.js → ChevronSelectorVertical-DYan7Eqw.js} +1 -1
- package/dist/client/assets/{ChevronUp-DI2ULEH1.js → ChevronUp-DQBYMpqT.js} +1 -1
- package/dist/client/assets/{Copy01-CVi-tdIV.js → Copy01-BPOEtZ0I.js} +1 -1
- package/dist/client/assets/{CreditCard01-C0r7pxEe.js → CreditCard01-BgcDg6Po.js} +1 -1
- package/dist/client/assets/{DotsVertical-BRA2E5SW.js → DotsVertical-bVrzKljT.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-C64evHjm.js → ErrorBarContext-F07hkAp5.js} +1 -1
- package/dist/client/assets/{Globe04-Cte1L_TC.js → Globe04-DROK8sB6.js} +1 -1
- package/dist/client/assets/{Image01-D1k8qTMT.js → Image01-CYMd4B2w.js} +1 -1
- package/dist/client/assets/{Key01-BpgHOWui.js → Key01-CcnI3N_J.js} +1 -1
- package/dist/client/assets/{Link01-DcuF2PJG.js → Link01-BaCE2stQ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CQNo32Ja.js → LinkBroken01-BCegKYMu.js} +1 -1
- package/dist/client/assets/{Minus-Dhc5_Uny.js → Minus-YbXjN_Ds.js} +1 -1
- package/dist/client/assets/{Monitor01-oUm4kh2W.js → Monitor01-aloCOxdR.js} +1 -1
- package/dist/client/assets/{Play-DxsyIVJU.js → Play-CKfAabLj.js} +1 -1
- package/dist/client/assets/{Plus-wcBLBnsy.js → Plus-DifrnWDP.js} +1 -1
- package/dist/client/assets/{ReferenceLine-Ba0KUpi7.js → ReferenceLine-BjTHivV7.js} +1 -1
- package/dist/client/assets/{SearchMd-Cd6S_AYP.js → SearchMd-OM6lL3Xq.js} +1 -1
- package/dist/client/assets/{Sector-Dx1I-dh1.js → Sector-aZQlOyVI.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-sYpo9zdq.js → ShoppingBag01-EO0f4EEB.js} +1 -1
- package/dist/client/assets/{Sun-DU3-MXlo.js → Sun-tqaV4Ycc.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BwIaA5sf.js → SwitchHorizontal01-VCz6eoXn.js} +1 -1
- package/dist/client/assets/{Tool01-BhJrBqSS.js → Tool01-CDUtHuFU.js} +1 -1
- package/dist/client/assets/{Trash01-Bl9OvMDc.js → Trash01-VJJht0QK.js} +1 -1
- package/dist/client/assets/{Upload01-CxLN401G.js → Upload01-Dxk-zD3u.js} +1 -1
- package/dist/client/assets/{UserSquare-BijqROcb.js → UserSquare-DoHQfmRI.js} +1 -1
- package/dist/client/assets/{Users01-D1Fzq2jH.js → Users01-CS7GcqAQ.js} +1 -1
- package/dist/client/assets/{XClose-DvAqSZdS.js → XClose-B88tJS8W.js} +1 -1
- package/dist/client/assets/{ZoomOut-Cp1NVjXu.js → ZoomOut-Dg4JYL36.js} +1 -1
- package/dist/client/assets/{access-gate-DKM36wx_.js → access-gate-DE8upkjE.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DE2gX_vu.js → add-connection-dialog-DxVAYgn3.js} +1 -1
- package/dist/client/assets/{agent-analytics-YzDARsvg.js → agent-analytics-CxXcJA46.js} +1 -1
- package/dist/client/assets/agent-app-C7973U1b.js +1 -0
- package/dist/client/assets/agent-assets-2QbtIHgO.js +1 -0
- package/dist/client/assets/{agent-automation-3AtSkd1J.js → agent-automation-Dw4OjqvF.js} +1 -1
- package/dist/client/assets/{agent-automations-CpuaAPmm.js → agent-automations-CZq7e0tO.js} +1 -1
- package/dist/client/assets/agent-calendar-CGPFAwP8.js +1 -0
- package/dist/client/assets/{agent-connect-sources-B8hXnUh-.js → agent-connect-sources-CwNcGkc9.js} +1 -1
- package/dist/client/assets/agent-deck-DO5ISfla.js +1 -0
- package/dist/client/assets/{agent-e2e-BI6_Y2Qm.js → agent-e2e-tTccsl2f.js} +1 -1
- package/dist/client/assets/agent-experiments-ZN8qK48q.js +1 -0
- package/dist/client/assets/{agent-file-SiqvdxDu.js → agent-file-BXmbhJ0A.js} +1 -1
- package/dist/client/assets/{agent-hosting-B2zNelvZ.js → agent-hosting-DFmxpM7m.js} +1 -1
- package/dist/client/assets/{agent-icon-BA0wSxVc.js → agent-icon-CA2ls6V4.js} +1 -1
- package/dist/client/assets/agent-library-CZ7enUY0.js +1 -0
- package/dist/client/assets/agent-library-file-Isa4z3AB.js +1 -0
- package/dist/client/assets/agent-monitor-C2K3A6Za.js +1 -0
- package/dist/client/assets/agent-overview-DMIGbWhh.js +1 -0
- package/dist/client/assets/agent-releases-TfhRok_k.js +2 -0
- package/dist/client/assets/agent-settings-ChMTEbgI.js +1 -0
- package/dist/client/assets/agent-site-editor-code-C_tlYT7V.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BacOmakn.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-WL-FCHY4.js +1 -0
- package/dist/client/assets/{agent-site-editor-CTyNCNF-.js → agent-site-editor-vIA92dqf.js} +2 -2
- package/dist/client/assets/agent-view-BkMQ3DXr.js +1 -0
- package/dist/client/assets/{agent-view-guard-BpSQOXQJ.js → agent-view-guard-CTViio6x.js} +1 -1
- package/dist/client/assets/{agents-list-DHHipu9N.js → agents-list-DF0DX580.js} +1 -1
- package/dist/client/assets/ai-providers-CQbH_x8n.js +6 -0
- package/dist/client/assets/{alert-BRAPjpyd.js → alert-D3Vs7Hmm.js} +1 -1
- package/dist/client/assets/{analytics-sections-BalaLoX8.js → analytics-sections-C4W8AGNp.js} +1 -1
- package/dist/client/assets/api-keys-BDj5b6nN.js +1 -0
- package/dist/client/assets/{api-keys-Cf4NzzlF.js → api-keys-CxMUc2ge.js} +1 -1
- package/dist/client/assets/{app-editor-CqYdTBdQ.js → app-editor-BmqQZaqc.js} +1 -1
- package/dist/client/assets/{asset-utils-DfcCDt_8.js → asset-utils-O6X_dwt-.js} +1 -1
- package/dist/client/assets/{auth-Cq02D4nn.js → auth-B2v1KOAc.js} +1 -1
- package/dist/client/assets/{auth-catchall-DSSPM0vv.js → auth-catchall-BGsoBMku.js} +1 -1
- package/dist/client/assets/{auth-entry-DnT8rRES.js → auth-entry-CAB8qpvf.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D4wlm7YR.js → auth-split-layout-Baxd24ro.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BBrRZnWN.js → authenticate-and-persist-oauth-UWCdGiT0.js} +1 -1
- package/dist/client/assets/{automation-list-row-CHZWDcvt.js → automation-list-row-DLHQbxMG.js} +1 -1
- package/dist/client/assets/{automation-runs-B6QZ0ROW.js → automation-runs-DUVVTfNU.js} +1 -1
- package/dist/client/assets/{automations-BcM3w1v2.js → automations-B9kCc45C.js} +1 -1
- package/dist/client/assets/{autosend-Co5xz8Gi.js → autosend-BUHDH46M.js} +1 -1
- package/dist/client/assets/{badge-gZsmT22J.js → badge-B275lbPZ.js} +1 -1
- package/dist/client/assets/{block-document-2K7R3kCf.js → block-document-Ud-Pjgh_.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Pg-1gGNK.js → blocks-preview-workspace-context-Cfqwt0fl.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BtE_pKjX.js → blocks-tab-states-DhPO3927.js} +1 -1
- package/dist/client/assets/{blog-schema-DPqkYVXa.js → blog-schema-CxYprLcJ.js} +1 -1
- package/dist/client/assets/{buckets-B6n9Srkv.js → buckets-Ctl6DyfN.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-COJilRIS.js → build-improve-prompt-doc-B1ctgI5i.js} +1 -1
- package/dist/client/assets/{calendar-XpraAwVM.js → calendar-BF6y0Z9x.js} +1 -1
- package/dist/client/assets/{capability-load-error-BWJxAmDU.js → capability-load-error-DLAPLAgw.js} +1 -1
- package/dist/client/assets/{category-editor-D9WstmCu.js → category-editor-BWhnsKFl.js} +1 -1
- package/dist/client/assets/{cdn-tab-CvUbabiJ.js → cdn-tab-DNzFiD5m.js} +1 -1
- package/dist/client/assets/{chart-CwYqQLKp.js → chart-BV2fH_6W.js} +1 -1
- package/dist/client/assets/{chat-context-CLLbJGXj.js → chat-context-CRAqcBEA.js} +1 -1
- package/dist/client/assets/chat-draft-D8MxxmMn.js +1 -0
- package/dist/client/assets/{checkbox-C9UULR8k.js → checkbox-z1yY0VbG.js} +1 -1
- package/dist/client/assets/{choose-editor-BbrK1J6q.js → choose-editor-BfJ_uy-r.js} +1 -1
- package/dist/client/assets/{cli-auth-success-017xXJSi.js → cli-auth-success-BXP6hdAw.js} +1 -1
- package/dist/client/assets/{client-icons-DC2uTuOI.js → client-icons-CZJL6jbw.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-Db-HeJmw.js → cms-settings-editor-CykKSUR_.js} +1 -1
- package/dist/client/assets/{collapsible-SvWPym8d.js → collapsible-TgXdzaTW.js} +1 -1
- package/dist/client/assets/{collection-detail-BlKohPLw.js → collection-detail-C50ZKf3h.js} +1 -1
- package/dist/client/assets/{collection-display-button-BywO1R2t.js → collection-display-button-C1BGad1J.js} +1 -1
- package/dist/client/assets/{collection-search-DtdoGA9K.js → collection-search-Dxv0FJfh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BrBXdd-g.js → collection-table-wrapper-BQz4wQv6.js} +1 -1
- package/dist/client/assets/{collection-tabs-CTyTx68t.js → collection-tabs-k2c4oB2_.js} +1 -1
- package/dist/client/assets/{column-rules-KE9740K5.js → column-rules-IZdAS5gT.js} +1 -1
- package/dist/client/assets/{combobox-CKuPCd5z.js → combobox-CXI3q8SD.js} +1 -1
- package/dist/client/assets/{command-p6B9RH3h.js → command-6ewscZzU.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BCMOAnvk.js → companion-mcps-section-DoFZott1.js} +1 -1
- package/dist/client/assets/{config-BpSR7fZ-.js → config-DvYJzFe4.js} +1 -1
- package/dist/client/assets/{connect-B8AXFjdY.js → connect-D2juww-N.js} +1 -1
- package/dist/client/assets/{connect-layout-6-TUS84W.js → connect-layout-DSU6EVHj.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-FYlss7nI.js → connect-source-dialog-BYzD_cCd.js} +1 -1
- package/dist/client/assets/{connection-B_vJ6T29.js → connection--HCyemnh.js} +1 -1
- package/dist/client/assets/{connection-card-DVkZvaM-.js → connection-card-CJzQ1R1a.js} +1 -1
- package/dist/client/assets/{connection-detail-Bzl_oJx2.js → connection-detail-DwxIR5Sg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-lSHy9dtX.js → connection-form-helpers-BhmC9tzU.js} +1 -1
- package/dist/client/assets/{connections-BvgIlAU9.js → connections-BbTMsfM2.js} +1 -1
- package/dist/client/assets/{content-tab-BVHV6dPn.js → content-tab-C4xTdHdc.js} +3 -3
- package/dist/client/assets/{context-DZ-o1G_r.js → context-BpAOIYxL.js} +1 -1
- package/dist/client/assets/{context-menu-4iKJivEI.js → context-menu-ClCy32tB.js} +1 -1
- package/dist/client/assets/{context-shell-D-Byl_hS.js → context-shell-AlLqYzkU.js} +3 -3
- package/dist/client/assets/{core.esm-DJ7xaMj8.js → core.esm-BXQfTZkM.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-upyyqwAS.js → create-organization-dialog-BY6IHR1p.js} +1 -1
- package/dist/client/assets/{daily-pulse-DBSqxt03.js → daily-pulse-BWeLPl82.js} +1 -1
- package/dist/client/assets/{discover-CPqRIc0t.js → discover-CCHDOxkE.js} +1 -1
- package/dist/client/assets/{domain-settings-DnbRmOHt.js → domain-settings-BrlbYDBP.js} +1 -1
- package/dist/client/assets/{drawer-Dp0r57Qp.js → drawer-C8pd-9h5.js} +1 -1
- package/dist/client/assets/{editor-BCBz6jsB.js → editor-BQUfQi3X.js} +1 -1
- package/dist/client/assets/{editor-classes-CUvsZ6TK.js → editor-classes-DeM_8BMv.js} +1 -1
- package/dist/client/assets/{empty-state-7LsTt5sL.js → empty-state-DnXn-oXP.js} +1 -1
- package/dist/client/assets/{empty-state-rcQuHhk6.js → empty-state-P8DRc5l5.js} +1 -1
- package/dist/client/assets/{experiments-tab-D7malH84.js → experiments-tab-Dj_UXlje.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DDomXBPA.js → experiments-tab-choice-CkKpewiH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BvfRDqC4.js → extract-connection-data-Bv4y_ppm.js} +1 -1
- package/dist/client/assets/{feature-gate-DdfwuiKB.js → feature-gate-CeySSZwi.js} +1 -1
- package/dist/client/assets/{feature-paywall-pnXia0J8.js → feature-paywall-DtZqXAFQ.js} +1 -1
- package/dist/client/assets/{file-explorer-CFF6fba5.js → file-explorer-CPhsOyRV.js} +1 -1
- package/dist/client/assets/{file-preview-Bj2kFfso.js → file-preview-B58y6F5R.js} +1 -1
- package/dist/client/assets/{file-share-button-DSVwr_sV.js → file-share-button-Cvb6TL3d.js} +1 -1
- package/dist/client/assets/{file-type-icon-tH_Br6Of.js → file-type-icon-qeWcetSB.js} +1 -1
- package/dist/client/assets/{folder-icon-BJ1ZRLFL.js → folder-icon-DN6fGLYE.js} +1 -1
- package/dist/client/assets/{form-CDBWVZmE.js → form-BIDT1Ue4.js} +1 -1
- package/dist/client/assets/{general-BTB_XY1d.js → general-D_xrCx6_.js} +1 -1
- package/dist/client/assets/{held-block-view-BYiRzwJw.js → held-block-view-DAPwji26.js} +3 -3
- package/dist/client/assets/home-BgI7ZNrl.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-BX6_-Epi.js → hosted-publish-feedback-BFYHRRPf.js} +1 -1
- package/dist/client/assets/{icon-button-DVmDp8lL.js → icon-button-DSMd1qL1.js} +1 -1
- package/dist/client/assets/{index-C1jnfnTx.js → index-B94uTMNH.js} +1 -1
- package/dist/client/assets/{index-Dw0ALa60.js → index-BCDmEpzR.js} +1 -1
- package/dist/client/assets/{index-DucOKncm.js → index-BDmPHxvf.js} +1 -1
- package/dist/client/assets/{index-DROH6MCH.js → index-BG1gU17W.js} +1 -1
- package/dist/client/assets/{index-nn0dWPfn.js → index-B_Vz7pw9.js} +1 -1
- package/dist/client/assets/{index-Ce_Co-9r.js → index-Bk9GYF9h.js} +1 -1
- package/dist/client/assets/{index-BHfNbC3J.js → index-BqutwFSm.js} +44 -44
- package/dist/client/assets/{index-C86JEmj3.js → index-BxQkdZTK.js} +1 -1
- package/dist/client/assets/index-CDXVQ_TQ.css +1 -0
- package/dist/client/assets/{index-CFx9VdIE.js → index-COUcDTIR.js} +1 -1
- package/dist/client/assets/{index-6TnHuNKo.js → index-CWPTQWeO.js} +1 -1
- package/dist/client/assets/{index-B9XczdNY.js → index-Cu6YVL4w.js} +1 -1
- package/dist/client/assets/{index-B6sjLnnC.js → index-DX3l6VgM.js} +1 -1
- package/dist/client/assets/{index-BIoURtql.js → index-H6qehDl6.js} +1 -1
- package/dist/client/assets/{index-CsZnvO4A.js → index-O_xtfziX.js} +1 -1
- package/dist/client/assets/{index-CeFLqtNb.js → index-oqricAgA.js} +1 -1
- package/dist/client/assets/{index-redirect-CkhmqmlO.js → index-redirect-Bt4gzxaD.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-V9LqyXQl.js → infiniteQueryObserver-DCWN2zRB.js} +1 -1
- package/dist/client/assets/{infra-billing-D1cg_G5x.js → infra-billing-ywaH9jxg.js} +1 -1
- package/dist/client/assets/{input-3ql30_TD.js → input-CpuPl1VL.js} +1 -1
- package/dist/client/assets/input-CsD5Q7QM.js +17 -0
- package/dist/client/assets/{integration-icon-B0-KqsSh.js → integration-icon-C_aSliEO.js} +1 -1
- package/dist/client/assets/{jira-icon-DBG6iiVj.js → jira-icon-CYte4ad8.js} +1 -1
- package/dist/client/assets/{label-DP4jFd6T.js → label-Ce-ZCIZn.js} +1 -1
- package/dist/client/assets/{layout-Cqr-RNfg.js → layout-BN3gCJyG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CbLdTgKM.js → legacy-agents-deep-mrP4uzb7.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-UaYyBO2R.js → legacy-main-redirect-skPOzTvI.js} +1 -1
- package/dist/client/assets/library-C8H8nQx2.js +1 -0
- package/dist/client/assets/{login-BF7XBFc4.js → login-Bqng4rrv.js} +1 -1
- package/dist/client/assets/{markdown-DOcKgQkI.js → markdown-Y9FReFEe.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D9gtw-L1.js → mcp-app-renderer-DrWXODkj.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CA0hjUdX.js → mcp-oauth-B1ojmT8l.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BcU5Vr1i.js → mcp-oauth-Mf3yN31G.js} +1 -1
- package/dist/client/assets/{members-BYa7_oFh.js → members-Bl1zRjVM.js} +1 -1
- package/dist/client/assets/{memory-D_LKKGXZ.js → memory-MKr86D-6.js} +1 -1
- package/dist/client/assets/{mini-report-page-DY5IFbuc.js → mini-report-page-CJr2XkWD.js} +1 -1
- package/dist/client/assets/mock-board-CtHapNeM.js +81 -0
- package/dist/client/assets/{monaco-editor-CT_wKOJZ.js → monaco-editor-fuZZsh6j.js} +1 -1
- package/dist/client/assets/{monitoring-B9KxDoyY.js → monitoring-CmKUhbQ7.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C0f3BIfr.js → monitoring-stats-row-CfiYSb9F.js} +1 -1
- package/dist/client/assets/{multi-select-CLYdfe2Y.js → multi-select-BqD525y_.js} +1 -1
- package/dist/client/assets/{mustache-C9_SXOP4.js → mustache-XoR-PEeZ.js} +1 -1
- package/dist/client/assets/{named-rule-uses-bPdRY20_.js → named-rule-uses-BbtWVVld.js} +1 -1
- package/dist/client/assets/{new-project-dialog-KevIoouL.js → new-project-dialog-BRBdOtjX.js} +1 -1
- package/dist/client/assets/{oauth-callback-CvHr64Gj.js → oauth-callback-CZuAW6K7.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Cpn9kidM.js → oauth-callback-ai-provider-6NJDakak.js} +1 -1
- package/dist/client/assets/{onboarding-BwWF1qci.js → onboarding-aHBbCiCh.js} +1 -1
- package/dist/client/assets/openai-conversation-Ds3XswsL.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-Cjk0pCBE.js → optimistic-project-sidebar-views-w9Ct7FMs.js} +1 -1
- package/dist/client/assets/{order-monitor-day-Cnmpuv9f.js → order-monitor-day-CA2fWj1y.js} +1 -1
- package/dist/client/assets/{organization-choice-d2BKN9Yu.js → organization-choice-D4aq2Nxu.js} +1 -1
- package/dist/client/assets/{orgs-B5jtYoeL.js → orgs-kp47NygQ.js} +1 -1
- package/dist/client/assets/{page-seo-form-CBz7r4kq.js → page-seo-form-C-3Oyqrm.js} +1 -1
- package/dist/client/assets/{pair-CPz7fX5d.js → pair-Dc1F6KjY.js} +1 -1
- package/dist/client/assets/{parse-sections-DTGij5pB.js → parse-sections-CRdFubPB.js} +1 -1
- package/dist/client/assets/{plan-Je9PR-gV.js → plan-CmzQmIDy.js} +1 -1
- package/dist/client/assets/{plan-ladder-C_QWsvUa.js → plan-ladder-Dqd8xMeE.js} +1 -1
- package/dist/client/assets/{popover-DHMsFNZO.js → popover-VBk0ee-p.js} +1 -1
- package/dist/client/assets/{post-calendar-DHdFzSXi.js → post-calendar-DwNGscjq.js} +1 -1
- package/dist/client/assets/{post-editor-CM8HHeAu.js → post-editor-BEoWoH05.js} +1 -1
- package/dist/client/assets/{preview-content-Dp2VvNmO.js → preview-content-DRmpsOLy.js} +1 -1
- package/dist/client/assets/{preview-dialog-B07lPMsZ.js → preview-dialog-dWAdST9o.js} +1 -1
- package/dist/client/assets/{preview-panel-CbVzeDkq.js → preview-panel-BJLsJJcg.js} +1 -1
- package/dist/client/assets/{preview-tab-Za6eM9ZE.js → preview-tab-DZ8ks1YP.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-dZwwYRcD.js → product-picker-dialog-MPHTgKXX.js} +1 -1
- package/dist/client/assets/{profile-BKmWx2G8.js → profile-Dd0_s4VG.js} +1 -1
- package/dist/client/assets/{project-app-view-OhNlFwLe.js → project-app-view-BtOq7ZWp.js} +1 -1
- package/dist/client/assets/{project-apps-ByR971WC.js → project-apps-CqjnVLMe.js} +1 -1
- package/dist/client/assets/{project-feed-Btx2WdF9.js → project-feed-CykWxmDT.js} +1 -1
- package/dist/client/assets/{project-icon-BRzC7xun.js → project-icon-DtQEqIYx.js} +1 -1
- package/dist/client/assets/project-reports-BMBo-hKU.js +1 -0
- package/dist/client/assets/project-tasks-DVakkLu4.js +1 -0
- package/dist/client/assets/{projects-Dx9YO4qB.js → projects-cYRTCGsM.js} +1 -1
- package/dist/client/assets/{projects-empty-state-Cwl_vLQO.js → projects-empty-state-CaYoBzMW.js} +1 -1
- package/dist/client/assets/{prompts-Dchn2MBF.js → prompts-Sb2iWGQw.js} +1 -1
- package/dist/client/assets/record-editor-B606zRBI.js +1 -0
- package/dist/client/assets/{redirect-editor-Boretiu3.js → redirect-editor-BG_05zsK.js} +1 -1
- package/dist/client/assets/{releases-api-CbLXrRtA.js → releases-api-RCTgo6g_.js} +1 -1
- package/dist/client/assets/reports-BsuVeMpD.js +1 -0
- package/dist/client/assets/{reports-C9BgQpmt.js → reports-CtmBtrB8.js} +1 -1
- package/dist/client/assets/{reports-onboarding-U9ww7IJw.js → reports-onboarding-BzWzS8Md.js} +1 -1
- package/dist/client/assets/{reports-tab-CcMOyz5E.js → reports-tab-BTBssl4Z.js} +2 -2
- package/dist/client/assets/{repositories-CZuNni9b.js → repositories-BKZPSNVR.js} +1 -1
- package/dist/client/assets/repositories-CNBPJbW9.js +1 -0
- package/dist/client/assets/{repository-binding-BQa5osxz.js → repository-binding-UPUU8iTD.js} +1 -1
- package/dist/client/assets/{repository-import-picker-bX-bkV1W.js → repository-import-picker-Cgqnl0_u.js} +1 -1
- package/dist/client/assets/{repository-picker-CosSYciA.js → repository-picker-BGNbJ5FK.js} +1 -1
- package/dist/client/assets/{require-capability-CEpjmn3B.js → require-capability-Fl7myTcy.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dc3A1ins.js → required-auth-layout-DGUYFPwh.js} +1 -1
- package/dist/client/assets/{reset-password-BdbuaRA3.js → reset-password-vxbjXaOx.js} +1 -1
- package/dist/client/assets/{resizable-B1cWqD6a.js → resizable-2wUgP6NM.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CKAqLX6_.js → resolve-tab-icon-CXm2cUKs.js} +1 -1
- package/dist/client/assets/{review-settings-BhoF6EAe.js → review-settings-BMj11lsi.js} +1 -1
- package/dist/client/assets/roles-D4Qgb0OR.js +1 -0
- package/dist/client/assets/route-B3dhLyR7.js +1 -0
- package/dist/client/assets/{route-Dr_Vx4mu.js → route-BhW-SwkC.js} +1 -1
- package/dist/client/assets/route-D6RbDGc3.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-CJ_lOQLz.js → sandbox-lifecycle-context-BrAJV0hd.js} +1 -1
- package/dist/client/assets/{schema-C9GQaQi3.js → schema-7_06wAgs.js} +1 -1
- package/dist/client/assets/{schema-BuKZ6x5v.js → schema-DHeACN0H.js} +1 -1
- package/dist/client/assets/{scroll-area-BANFTsxP.js → scroll-area-56TNtyKH.js} +1 -1
- package/dist/client/assets/{search-input-675T6lu5.js → search-input-Zdy1mSae.js} +1 -1
- package/dist/client/assets/{search-toggle-DIPbCLr7.js → search-toggle-DkaLKnSY.js} +1 -1
- package/dist/client/assets/{secret-picker-xGDtanwg.js → secret-picker-B5fM64mM.js} +1 -1
- package/dist/client/assets/{secrets-C5yk5Rf_.js → secrets-DyW2ssCW.js} +1 -1
- package/dist/client/assets/{section-array-field-DpS0YJzV.js → section-array-field-rBWQHh7r.js} +1 -1
- package/dist/client/assets/{sections-BpeDTv5B.js → sections-DlaCV9cl.js} +1 -1
- package/dist/client/assets/{sections-editor-DvvKQ5Ao.js → sections-editor-BDKjqTEY.js} +1 -1
- package/dist/client/assets/{select-model-flGcww1p.js → select-model-TCy_ghzu.js} +1 -1
- package/dist/client/assets/{select-DeUMpSJ9.js → select-qBldsuZB.js} +1 -1
- package/dist/client/assets/{seo-editor-BFG4AFCF.js → seo-editor-BLOTxVNW.js} +1 -1
- package/dist/client/assets/{separator-CMFiGe9c.js → separator-DZ0CgMqF.js} +1 -1
- package/dist/client/assets/settings-tab-DU-L5-CZ.js +1 -0
- package/dist/client/assets/{sheet-D6OsnI4Q.js → sheet-D-DL4PyF.js} +1 -1
- package/dist/client/assets/{shell-layout-v3SXhoC6.js → shell-layout-DKjamnSj.js} +1 -1
- package/dist/client/assets/{site-draft-actions-CExA5GRl.js → site-draft-actions-DQJmjCxq.js} +1 -1
- package/dist/client/assets/{site-draft-view-bCNdZjgN.js → site-draft-view-C5NGRcIz.js} +2 -2
- package/dist/client/assets/site-editor-BfXsVuJf.js +1 -0
- package/dist/client/assets/{site-editor-toast-KFvABq33.js → site-editor-toast-UJBsXoYS.js} +1 -1
- package/dist/client/assets/{skills-Dbf3rR0W.js → skills-De822NM4.js} +1 -1
- package/dist/client/assets/{slider-CY8f0V_U.js → slider-DKsnyXsn.js} +1 -1
- package/dist/client/assets/{sortable.esm-BySuc2kW.js → sortable.esm-BPDXfku7.js} +1 -1
- package/dist/client/assets/{sso-BikZKw53.js → sso-ClBwUtr5.js} +1 -1
- package/dist/client/assets/{suggestion-Dng1OvVu.js → suggestion-CgPYCK9k.js} +1 -1
- package/dist/client/assets/{switch-CRLlGWRm.js → switch-CZb-mYsM.js} +1 -1
- package/dist/client/assets/{symbol-IDB1a86s.js → symbol-CyQNqsns.js} +1 -1
- package/dist/client/assets/{synced-repos-DijY8Z0t.js → synced-repos-D4QeoEDp.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DqxS1W2O.js → tab-icon-glyph-DSl4L3DW.js} +1 -1
- package/dist/client/assets/{table-DURb9CvE.js → table-V2ahNRZT.js} +1 -1
- package/dist/client/assets/{tabs-BmUHuMh_.js → tabs-Cb1EEFWU.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-ETqhRnIl.js → task-assignee-avatar-Wqv60Mfs.js} +1 -1
- package/dist/client/assets/{task-board-C0HnttyI.js → task-board-Cp4gjjuc.js} +1 -1
- package/dist/client/assets/{task-route-DCdSOzRh.js → task-route-DKYWwLvg.js} +1 -1
- package/dist/client/assets/{task-status-B3vHcktz.js → task-status-Ne5UIAX6.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DmlxZ5Mf.js → taskboard-analytics-adljo_lT.js} +1 -1
- package/dist/client/assets/{tasks-CjGAgQXL.js → tasks--ex7OH66.js} +1 -1
- package/dist/client/assets/tasks-D4NYojIN.js +1 -0
- package/dist/client/assets/{textarea-D-M04FyU.js → textarea-DIMcwKj_.js} +1 -1
- package/dist/client/assets/{thread-analytics-D71NRRmc.js → thread-analytics-CqnVp9Hp.js} +1 -1
- package/dist/client/assets/{thread-intent-Cz3k9J0V.js → thread-intent-BdGEZQ5d.js} +1 -1
- package/dist/client/assets/{thread-route-WzhwdvG6.js → thread-route-BGD5ZDLj.js} +1 -1
- package/dist/client/assets/{thread-route-BZApRytK.js → thread-route-DPiunvH4.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-a_5G_x24.js → thread-sheet-body-DFdozxob.js} +1 -1
- package/dist/client/assets/{time-range-picker-By2VKq20.js → time-range-picker-CyphWImg.js} +1 -1
- package/dist/client/assets/{toggle-group-CuZdEcaQ.js → toggle-group-DQ8R6Md0.js} +1 -1
- package/dist/client/assets/{tool-namespace-BCjfmbIj.js → tool-namespace-BWBiQhUq.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CLfu4oc8.js → toolbar-icon-button-C7qFILLP.js} +1 -1
- package/dist/client/assets/{tooltip-BHKDYyNW.js → tooltip-RrBkgkDb.js} +1 -1
- package/dist/client/assets/{tooltipContext-CiCw0f_4.js → tooltipContext-C2tBhXWj.js} +1 -1
- package/dist/client/assets/{track-DapsK5NY.js → track-C7T3Q_NS.js} +1 -1
- package/dist/client/assets/{types-XXF2z162.js → types-CRdMnwkp.js} +1 -1
- package/dist/client/assets/{url-slug-DCBs2Iee.js → url-slug-DUBa3zVK.js} +1 -1
- package/dist/client/assets/{usage-stats-DyTGad0G.js → usage-stats-C9C7AU7H.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bx_YK4SP.js → use-ai-providers-DVBJIa-_.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-sn752YMP.js → use-apply-named-rule-CjRIJJWs.js} +1 -1
- package/dist/client/assets/{use-automations-Bn3XK6SO.js → use-automations-DIvmuRlE.js} +1 -1
- package/dist/client/assets/{use-autosave-BBFmGfRr.js → use-autosave-D0tBxxQ8.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-B_AOeaBZ.js → use-chat-layout-state-Aa4VqEQx.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CpFwzf-R.js → use-clock-tick-UQl4M1J5.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-cpjQhbMn.js → use-cms-publish-actions-c5y_nfEn.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B1v45-YA.js → use-connect-companion-BPn2REj-.js} +1 -1
- package/dist/client/assets/{use-connection-BHV4hlr5.js → use-connection-DVSix2AF.js} +1 -1
- package/dist/client/assets/{use-copy-FdbZaK00.js → use-copy-C6zGg71V.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CeFhyP52.js → use-create-virtual-mcp-5nIGXG87.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Cc5HqSt5.js → use-date-fns-locale-DS-Izx-9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D0OZ0z3L.js → use-debounced-autosave-DwOKfyXg.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CFShX-im.js → use-debounced-value-Chk6vawl.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Dj7f8XC0.js → use-deco-credits-B32-9i_a.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Ca_CO8xU.js → use-decopilot-events-B5qoi0Wr.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DoOw898x.js → use-delete-connection-DLjMAPog.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CCtkUNgJ.js → use-deployment-admin-CuHcgI6F.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DVMYcZ0S.js → use-fast-preview-draft-url-eu2nT6W8.js} +1 -1
- package/dist/client/assets/{use-file-configs-L_EIZykF.js → use-file-configs-Cr0gwmd8.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-SET_Qqr-.js → use-inbox-feed-D4K-P1LA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-ou4V9KG1.js → use-infinite-scroll-asA1-tf9.js} +1 -1
- package/dist/client/assets/{use-join-requests-chrt_1MF.js → use-join-requests-CkkZxs_r.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DIRjMqa3.js → use-main-panel-tabs-Dy-Y3oMc.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-z87-JiLY.js → use-mcp-auth-status-DqE0wx72.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Dkhr6mNw.js → use-mcp-client-liHKfpfj.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CIKYKwtF.js → use-mcp-prompts-cYDRO3Kp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BKhJVoW_.js → use-mcp-tools-iSL8qiEx.js} +1 -1
- package/dist/client/assets/{use-mobile-DI2FTIL0.js → use-mobile-XeH7HFdg.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B14_P9tC.js → use-move-blocks-Bkqfi8fY.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-6ltC9eW0.js → use-navigate-to-agent-Ba4TBBON.js} +1 -1
- package/dist/client/assets/{use-org-fs-CB3veWHZ.js → use-org-fs-DNlQgLUG.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-6J5O5qVp.js → use-org-repo-syncs-MkA3X0Ud.js} +1 -1
- package/dist/client/assets/{use-org-sso-DoYxVAf1.js → use-org-sso-ZqYOnTZ9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BDn2Q_fr.js → use-organization-roles-cbSQbTbx.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dkjdf4nA.js → use-organization-settings-C_uyrpUI.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BsaNinK5.js → use-panel-navigate-DIX895ki.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-COOx7x9i.js → use-project-native-view-presence-r0Gkk_5E.js} +1 -1
- package/dist/client/assets/{use-project-scope-DUjnfoFF.js → use-project-scope-C98g-M0M.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BZ1V26Xs.js → use-recent-apps-Bp9mI3Hn.js} +1 -1
- package/dist/client/assets/{use-releases-978ACBrZ.js → use-releases-RUoL1asP.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-GepFD608.js → use-reports-diagnostic-CJqF-DdT.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-tMbTFRNA.js → use-sandbox-events-COXHFEXL.js} +1 -1
- package/dist/client/assets/{use-secrets-22jE29ga.js → use-secrets-BLT_VvH0.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DoatuuwF.js → use-section-preview-base-BHeBUNI1.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DqV0h8GY.js → use-session-runtime-Cass8jgv.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DfprbLGc.js → use-sidebar-collapsed-DTxIOS-x.js} +1 -1
- package/dist/client/assets/{use-tags--xoooGVd.js → use-tags-CrjLMu_-.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-B0HvVIZ9.js → use-task-board-analytics-C2n2_51H.js} +1 -1
- package/dist/client/assets/{use-task-board-events-OAPO3lhD.js → use-task-board-events-D5XnGFaO.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-HXPEyO5q.js → use-task-board-item-prs-CSoHUx1b.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DiHVSC33.js → use-task-metadata-C7aK-HiB.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-w_rB9QIG.js → use-thread-analytics-u-QN-pcv.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DKCnoHd3.js → use-thread-outputs-BkxphpfI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BYZFn0Hg.js +1 -0
- package/dist/client/assets/{useQueries-KktKhtBK.js → useQueries-Rmt36TSN.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BjfsGxpD.js +1 -0
- package/dist/client/assets/{users-Ccz0EkLs.js → users-DaTm0LIa.js} +1 -1
- package/dist/client/assets/{utils-C-JscWIZ.js → utils-DF3h1YFq.js} +1 -1
- package/dist/client/assets/{variant-calendar-CIx6nlV_.js → variant-calendar-6x1UYIC-.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BS5Ktooo.js → variant-matcher-override-nKaBGWQ5.js} +1 -1
- package/dist/client/assets/{view-header-vhlXWyA_.js → view-header-DhqNDwWw.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DlFkWVPE.js → virtual-mcp-Bp27ph4n.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-WDeFSNQB.js → watch-sse-pool-62BerBh7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +36 -36
- package/dist/server/migrate-dbos.js +2 -2
- package/dist/server/migrate.js +154 -154
- package/dist/server/server.js +818 -818
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DCimJxt7.js +0 -1
- package/dist/client/assets/agent-assets-CKWKjJVe.js +0 -1
- package/dist/client/assets/agent-calendar-CvhUXQcR.js +0 -1
- package/dist/client/assets/agent-deck-lEVBCGON.js +0 -1
- package/dist/client/assets/agent-experiments-YQlAf7zr.js +0 -1
- package/dist/client/assets/agent-library-Ba6xxY0S.js +0 -1
- package/dist/client/assets/agent-library-file-C1MFH3K4.js +0 -1
- package/dist/client/assets/agent-monitor-CaemcP0H.js +0 -1
- package/dist/client/assets/agent-overview-DshioPXr.js +0 -1
- package/dist/client/assets/agent-releases-D5Z2vsLx.js +0 -2
- package/dist/client/assets/agent-settings-B_btYOUt.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dhb4M-7j.js +0 -2
- package/dist/client/assets/agent-site-editor-content-V5UD-MGZ.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CKQ1fN9d.js +0 -1
- package/dist/client/assets/agent-view-Bbabi60T.js +0 -1
- package/dist/client/assets/ai-providers-DZBGz0NB.js +0 -6
- package/dist/client/assets/api-keys-DZxhiAP3.js +0 -1
- package/dist/client/assets/chat-draft-BH6THiDR.js +0 -1
- package/dist/client/assets/home-Bww65mfc.js +0 -1
- package/dist/client/assets/index-DJP2Tw2D.css +0 -1
- package/dist/client/assets/input-BhtnU6ti.js +0 -17
- package/dist/client/assets/library-5HUi0FUB.js +0 -1
- package/dist/client/assets/mock-board-BTicfoXo.js +0 -81
- package/dist/client/assets/openai-conversation-CLJJf4OK.js +0 -3
- package/dist/client/assets/project-reports-C5YM8o57.js +0 -1
- package/dist/client/assets/project-tasks-C4GmnH0I.js +0 -1
- package/dist/client/assets/record-editor-qapMfvRB.js +0 -1
- package/dist/client/assets/reports-Ci3Di9K0.js +0 -1
- package/dist/client/assets/repositories-ByW6AQ1Z.js +0 -1
- package/dist/client/assets/roles-DBDcQxYx.js +0 -1
- package/dist/client/assets/route-BNotXZvh.js +0 -1
- package/dist/client/assets/route-DpwFAnDq.js +0 -1
- package/dist/client/assets/settings-tab-DOC7qZpo.js +0 -1
- package/dist/client/assets/site-editor-C78f9k6P.js +0 -1
- package/dist/client/assets/tasks-DbRJoDgD.js +0 -1
- package/dist/client/assets/use-open-billing-url-Cv0uvlPt.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BEMm4bHr.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-UxOXZxMu.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hM as Ho,bh as Wo,c as jn,b as Rn,r as S,l as ae,j as r,bQ as qo,bd as Vs,hN as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Zo,q as Jo,hm as Qo,hO as Xo,hP as ei,bp as xn,h as ti,bi as Rt,hQ as st,hR as Wr,hS as gs,hT as ni,hU as qr,hV as si,bw as ri,hW as ai,hX as Gr,hY as oi,t as q,bZ as Ur,hZ as ii,h_ as Kt,h$ as li,i0 as ci,i1 as ui,bY as Yr,i2 as vs,i3 as di,i4 as fi,i5 as mi,bW as pi,bx as hi,i6 as gi,i7 as vi,bT as Si,f7 as yi,K as bi,bu as Zr,i8 as Jr,i9 as xi,ia as _i,ib as ki,ic as Ss,id as wi,ie as ji,ig as Ri,ih as Ei,bR as Qr,ii as Vi,ij as Ti,ik as Xr,il as Ai,bV as Ni}from"./index-BHfNbC3J.js";import{u as Ci}from"./chat-context-CLLbJGXj.js";import{a2 as Pi,K as Qn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Hi,ad as Wi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Zi,ai as Ji,aj as Wn,ak as sa,al as ra,am as aa,an as ys,ao as Qi,D as Xi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-BYiRzwJw.js";import{c as il}from"./repository-binding-BQa5osxz.js";import{n as ll,t as cl}from"./ChevronUp-DI2ULEH1.js";import{a8 as Va,b as Jn,an as ul,H as dl,a2 as da,_ as fa}from"./agent-icon-BA0wSxVc.js";import{S as on}from"./scroll-area-BANFTsxP.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-BHKDYyNW.js";import{l as fl,u as ml,m as pl,D as hl,a1 as gl,B as vl,ac as Mt,ad as Bt,N as Sl,ay as ma,Q as yl,Z as bl}from"./site-editor-toast-KFvABq33.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-BtE_pKjX.js";import{m as jl,u as Rl,P as El}from"./mustache-C9_SXOP4.js";import{a0 as Gt,T as ks,az as ws,a1 as Dt,U as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a4 as Nl,_ as qt,V as xs,Z as bt,Y as kn,F as Cl,a2 as ha,$ as Pl,ai as Kl,ak as Ml,aA as Bl,aB as Dl,aC as Fl}from"./parse-sections-DTGij5pB.js";import{a as Il}from"./Copy01-CVi-tdIV.js";import{a as js,e as Ta}from"./UserSquare-BijqROcb.js";import{i as ga}from"./Tool01-BhJrBqSS.js";import{s as va}from"./Image01-D1k8qTMT.js";import{s as Ll}from"./Plus-wcBLBnsy.js";import{s as Ol}from"./Trash01-Bl9OvMDc.js";import{i as Rs}from"./ZoomOut-Cp1NVjXu.js";import{u as zl,a as Sa,K as $l,P as Hl,b as Wl,C as ql,D as Gl,c as Ul}from"./core.esm-DJ7xaMj8.js";import{u as Yl,s as Zl,a as Zn,S as Jl,v as Ql}from"./sortable.esm-BySuc2kW.js";import{s as Xl,g as ec,u as tc,A as nc}from"./use-section-preview-base-DoatuuwF.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-CBz7r4kq.js";import{u as oc}from"./use-apply-named-rule-sn752YMP.js";import{b as ba,a as ic}from"./variant-matcher-override-BS5Ktooo.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-BsaNinK5.js";import"./thread-route-BZApRytK.js";import"./use-project-scope-DUjnfoFF.js";import"./autosend-Co5xz8Gi.js";import"./thread-intent-Cz3k9J0V.js";import"./use-mcp-client-Dkhr6mNw.js";import"./auth-Cq02D4nn.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-WDeFSNQB.js";import"./task-board-C0HnttyI.js";import"./schema-BuKZ6x5v.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-Ca_CO8xU.js";import"./use-ai-providers-Bx_YK4SP.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-Dkjdf4nA.js";import"./utils-C-JscWIZ.js";import"./Play-DxsyIVJU.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CPz7fX5d.js";import"./LinkBroken01-CQNo32Ja.js";import"./collapsible-SvWPym8d.js";import"./use-copy-FdbZaK00.js";import"./usage-stats-DyTGad0G.js";import"./tool-namespace-BCjfmbIj.js";import"./form-CDBWVZmE.js";import"./label-DP4jFd6T.js";import"./utils-CVEq3hMx.js";import"./markdown-DOcKgQkI.js";import"./use-mobile-DI2FTIL0.js";import"./use-clock-tick-CpFwzf-R.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-D9gtw-L1.js";import"./types-XXF2z162.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-BtpKz4PT.js";import"./XClose-DvAqSZdS.js";import"./ShoppingBag01-sYpo9zdq.js";import"./SearchMd-Cd6S_AYP.js";import"./shell-layout-v3SXhoC6.js";import"./Building02-DxaGdtc9.js";import"./use-deployment-admin-CCtkUNgJ.js";import"./admin-fetch-BhTJlAsX.js";import"./CheckCircle-D-aNr7ni.js";import"./Monitor01-oUm4kh2W.js";import"./command-p6B9RH3h.js";import"./index-C1jnfnTx.js";import"./integration-icon-B0-KqsSh.js";import"./project-icon-BRzC7xun.js";import"./new-project-dialog-KevIoouL.js";import"./ArrowLeft-ahbogFmz.js";import"./repository-import-picker-bX-bkV1W.js";import"./use-navigate-to-agent-6ltC9eW0.js";import"./repository-picker-CosSYciA.js";import"./useInfiniteQuery-BEMm4bHr.js";import"./infiniteQueryObserver-V9LqyXQl.js";import"./collection-search-DtdoGA9K.js";import"./use-debounced-value-CFShX-im.js";import"./required-auth-layout-Dc3A1ins.js";import"./use-org-sso-DoYxVAf1.js";import"./sheet-D6OsnI4Q.js";import"./use-connection-BHV4hlr5.js";import"./Link01-DcuF2PJG.js";import"./use-mcp-prompts-CIKYKwtF.js";import"./use-thread-outputs-DKCnoHd3.js";import"./file-type-icon-tH_Br6Of.js";import"./section-array-field-DpS0YJzV.js";import"./alert-BRAPjpyd.js";import"./switch-CRLlGWRm.js";import"./textarea-D-M04FyU.js";import"./ChevronSelectorVertical-JCtUtQXM.js";import"./popover-DHMsFNZO.js";import"./monaco-editor-CT_wKOJZ.js";import"./editor-BCBz6jsB.js";import"./calendar-XpraAwVM.js";import"./SwitchHorizontal01-BwIaA5sf.js";import"./Minus-Dhc5_Uny.js";import"./select-DeUMpSJ9.js";import"./index-BdQq_4o_.js";import"./index-CeFLqtNb.js";import"./editor-classes-CUvsZ6TK.js";import"./toggle-group-CuZdEcaQ.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CKuPCd5z.js";import"./Upload01-CxLN401G.js";import"./DotsVertical-BRA2E5SW.js";import"./search-input-675T6lu5.js";import"./tabs-BmUHuMh_.js";import"./use-file-configs-L_EIZykF.js";import"./asset-utils-DfcCDt_8.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-DqV0h8GY.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-DyCjG74a.js";import"./CreditCard01-C0r7pxEe.js";import"./Globe04-Cte1L_TC.js";import"./Key01-BpgHOWui.js";import"./Sun-DU3-MXlo.js";import"./Users01-D1Fzq2jH.js";import"./experiments-tab-choice-DDomXBPA.js";import"./use-sandbox-events-tMbTFRNA.js";import"./slider-CY8f0V_U.js";import"./index-BIoURtql.js";import"./tooltipContext-CiCw0f_4.js";import"./CategoricalChart-DZHmxzzH.js";import"./index-Dw0ALa60.js";import"./ActiveShapeUtils-ChPJqGh0.js";import"./Sector-Dx1I-dh1.js";import"./symbol-IDB1a86s.js";import"./empty-state-rcQuHhk6.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-B14_P9tC.js";const uc={escape:Pi};function dc(v,e){for(const p of Xl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Ho(v,Wo(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="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 _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Qn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Q;e[0]!==b||e[1]!==y?(Q=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=Q):Q=e[2];const ge=Q;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Jn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const X=Oe??p.label;let $e;e[30]!==Re||e[31]!==X?($e=r.jsx("span",{className:Re,children:X}),e[30]=Re,e[31]=X,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="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 Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("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":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"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 Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:Q,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Qn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:X,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Ze=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!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 He;e[25]!==Ze||e[26]!==ve||e[27]!==ct?(He=r.jsx(Ze,{label:ve,classicClassName:ct}),e[25]=Ze,e[26]=ve,e[27]=ct,e[28]=He):He=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==Q?(Ke=T=>{T.stopPropagation(),Q()},e[35]=Q,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Jn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let Z;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(Z=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=Z):Z=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let We;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==Z||e[72]!==me?(We=r.jsxs(Zo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,Z,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=Z,e[72]=me,e[73]=We):We=e[73];let qe;e[74]!==fe||e[75]!==He||e[76]!==We?(qe=r.jsxs(fe,{children:[He,We]}),e[74]=fe,e[75]=He,e[76]=We,e[77]=qe):qe=e[77];let Je;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==X||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==lt||e[87]!==qe||e[88]!==L?(Je=r.jsxs("div",{ref:X,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,W,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=X,e[82]=_,e[83]=A,e[84]=Ye,e[85]=W,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Je):Je=e[89],Je}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let Q;e[3]!==B?(Q=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=Q):Q=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==Q?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,Q]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=Q,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:Q,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Qn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[X,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);X!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Zl},e[3]=_):_=e[3];const we=zl(Sa(Hl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Qe=it.indexOf(String(ie.id));Ve===-1||Qe===-1||(ze(nt=>Aa(Zn([...nt],Ve,Qe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Qe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const W=Ye;let lt,fe,Ze,ve,ct,He,Ee,Ke,tt,Me,Be,De,Y,Z,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==Q||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){Z=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Ze=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Qe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Qe||e[66]!==c?(nt=F?Qe:r.jsxs("div",{className:"space-y-2",children:[Qe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Qe,e[66]=c,e[67]=nt):nt=e[67],Z=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Ze,e[57]=ve,e[58]=Y}else Ze=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=W,lt=Jl,He=it,Ee=Ql,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>Q(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=Q,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Ze,e[36]=ve,e[37]=ct,e[38]=He,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=Z,e[47]=ee}else lt=e[33],fe=e[34],Ze=e[35],ve=e[36],ct=e[37],He=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],Z=e[46],ee=e[47];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==He||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:He,strategy:Ee,children:O}),e[71]=lt,e[72]=He,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Ze||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Ze,meta:V,decofile:B})}):null,e[76]=Ze,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let We;e[82]!==me?(We=qo.createPortal(r.jsx(Wl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=We):We=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==We?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,We]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=We,e[92]=qe):qe=e[92];let Je;e[93]!==U||e[94]!==F||e[95]!==c?(Je=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Je):Je=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Je?(T=r.jsxs("div",{className:Y,children:[qe,Je]}),e[97]=Y,e[98]=qe,e[99]=Je,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:Q=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),X=Qn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,W]=S.useState(null),[lt,fe]=S.useState(0),[Ze,ve]=S.useState(void 0),[ct,He]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(He(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[Z,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[We,qe]=S.useState(O.length);We!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Je,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Qe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Xn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Zt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(Q),[As,Ns]=S.useState(Q);Q&&!As&&(Ns(!0),cn(!0),L(null),A(null),W(null),N([])),!Q&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Jt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Qt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Jo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),W(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Ha]=S.useState(0),zs=Qo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Xo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Wa,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Hs=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Za=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Za,Ja=Te?Hi(Mn):void 0,Ws=ns?.seoTypeOptions??[],qs=Te&&u?Wi(u):"",ss=Ma??Ja??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,J=Math.min(lt,le.length-1),ye=le[J],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),W(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:J,sectionVariantIndex:Ie,selectedSectionIndex:m};const Qa=()=>({multivariate:Dn,index:J,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[J]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Wa&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=J;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Qa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),W(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),W(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),Ge(null),Le(null)}return!0},Zs=K?.index;if(K!==void 0&&(K?.seq??null)!==Ze&&(ve(K?.seq??null),typeof Zs=="number"&&Ys(Zs,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==J)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Wr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),W(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Jt(s=>s+1))}if(Ls!==$a){Ha(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),W(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,J,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),W(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Js=()=>Wr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Js()){tn.current=!0;return}Os(n=>n+1)},Qs=()=>{!tn.current||Js()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Xs=()=>{tn.current&&setTimeout(Qs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Xa=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Jr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Zr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Jr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Xa(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,H=P[n];if(!H)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(H,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Zr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(H,re):z,fresh:{}});return}const Xe=pt?pt.merged:null,Pt=Xe??j,zr=ji({merged:!!Xe,tracked:d,current:Lt.current,saved:j});Xe&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Xe,A(Xe));const hs=zr||!Xe?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Hr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Qs()})};if(re.isSavedBlock){const te=Ss(H,re);if(!te)return;Hr({blockKey:te,data:Pt,...he?{base:{value:Xe?Ae:he}}:{},rebaseOnConflict:!1,guard:Xr({formBase:d,rebased:!!Xe,versionOf:er})});return}if(!z)return;const Hn={...I[z]},Wt=[...P];if(re.isMultivariate){const te=st(H,re);if(!te||!z)return;const de=Ei(te,l,Pt);Wt[n]=Kt(H,re,de)}else if(re.isHidden){const te=Vs(H.__resolveType),de=te?{...H.section}:{...H},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Qr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Wt[n]={...H,section:de}:Wt[n]=de}else re.isLazy?Wt[n]={...H,section:Pt}:Wt[n]=Pt;if(ue.length>1){const te=Hn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Qr(te?.__resolveType,de[be],Wt)),Hn.sections={...te,variants:de}}else Hn.sections=Wt;Hr({blockKey:z,data:Hn,rebaseOnConflict:!1,guard:Xr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),W(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),W(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Zn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),W(null),Ge(null),Le(null);return}A(i.data),W(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,J,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&Z===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Ht=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Ht.length===0)return;const s=Pl(t);return{kinds:Ht,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=Z&&u?Gn(Z,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=Z?{__resolveType:Z,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Ht.length>0?{kinds:Ht,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",H=i[z],re=typeof H?.name=="string"?H.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Qt?{__resolveType:Qt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const H=[...a];return H[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,H,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),H={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,H,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,H),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Hs:je?.label??"",wo=Qt&&u?Gn(Qt,u):null,xr=(t,n)=>n&&X?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?X?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Hs,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Zt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=X&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=X&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Zt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Zt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Zt&&!Ft&&!Te&&!Ct&&!mt,No=!X&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),W(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=J;J===t?s=n:t<J&&n>=J?s=J-1:t>J&&n<=J&&(s=J+1),fe(s);const a=Zn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Zn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<J?fe(J-1):t===J&&fe(Math.max(0,t-1)),L(null),A(null),W(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),W(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),W(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const H={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:H[s]}),await kt(z,H),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const H={...j,variants:z},re=[...a];re[s]=Kt(h,x,H);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Xe=[...I];Xe[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Xe);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const H=Un(ue),re=Yn(H,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:H,data:he,create:!0});sn=qn(pt),Ae=sn?null:H;const Xe=[...I];Xe[t]={...P,rule:ln(H)},await be(Xe),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Jt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Zt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Jt(s=>s+1);return}It(Ps.slice(0,t-1)),Jt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!X&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("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",Ji),children:[r.jsx(Zi,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Wn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Qi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Qt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Ht),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Qt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(X?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${J}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(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-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Xi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(X||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:J,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Wn,{onClick:bn}),Eo&&r.jsx(Wn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?X?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Zt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Xn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Xt&&Ve(null)}}),Qe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Qe]?.rule,f??{},u??void 0)?kn(At[Qe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Qe]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Ko(Qe,t)},onOpenChange:t=>{!t&&!Xt&&nt(null)}})]})})})}export{uf as SectionsEditor};
|
|
1
|
+
import{hM as Ho,bh as Wo,c as jn,b as Rn,r as S,l as ae,j as r,bQ as qo,bd as Vs,hN as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Zo,q as Jo,hm as Qo,hO as Xo,hP as ei,bp as xn,h as ti,bi as Rt,hQ as st,hR as Wr,hS as gs,hT as ni,hU as qr,hV as si,bw as ri,hW as ai,hX as Gr,hY as oi,t as q,bZ as Ur,hZ as ii,h_ as Kt,h$ as li,i0 as ci,i1 as ui,bY as Yr,i2 as vs,i3 as di,i4 as fi,i5 as mi,bW as pi,bx as hi,i6 as gi,i7 as vi,bT as Si,f7 as yi,K as bi,bu as Zr,i8 as Jr,i9 as xi,ia as _i,ib as ki,ic as Ss,id as wi,ie as ji,ig as Ri,ih as Ei,bR as Qr,ii as Vi,ij as Ti,ik as Xr,il as Ai,bV as Ni}from"./index-BqutwFSm.js";import{u as Ci}from"./chat-context-CRAqcBEA.js";import{a2 as Pi,K as Qn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Hi,ad as Wi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Zi,ai as Ji,aj as Wn,ak as sa,al as ra,am as aa,an as ys,ao as Qi,D as Xi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-DAPwji26.js";import{c as il}from"./repository-binding-UPUU8iTD.js";import{n as ll,t as cl}from"./ChevronUp-DQBYMpqT.js";import{a8 as Va,b as Jn,an as ul,H as dl,a2 as da,_ as fa}from"./agent-icon-CA2ls6V4.js";import{S as on}from"./scroll-area-56TNtyKH.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-RrBkgkDb.js";import{l as fl,u as ml,m as pl,D as hl,a1 as gl,B as vl,ac as Mt,ad as Bt,N as Sl,ay as ma,Q as yl,Z as bl}from"./site-editor-toast-UJBsXoYS.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-DhPO3927.js";import{m as jl,u as Rl,P as El}from"./mustache-XoR-PEeZ.js";import{a0 as Gt,T as ks,az as ws,a1 as Dt,U as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a4 as Nl,_ as qt,V as xs,Z as bt,Y as kn,F as Cl,a2 as ha,$ as Pl,ai as Kl,ak as Ml,aA as Bl,aB as Dl,aC as Fl}from"./parse-sections-CRdFubPB.js";import{a as Il}from"./Copy01-BPOEtZ0I.js";import{a as js,e as Ta}from"./UserSquare-DoHQfmRI.js";import{i as ga}from"./Tool01-CDUtHuFU.js";import{s as va}from"./Image01-CYMd4B2w.js";import{s as Ll}from"./Plus-DifrnWDP.js";import{s as Ol}from"./Trash01-VJJht0QK.js";import{i as Rs}from"./ZoomOut-Dg4JYL36.js";import{u as zl,a as Sa,K as $l,P as Hl,b as Wl,C as ql,D as Gl,c as Ul}from"./core.esm-BXQfTZkM.js";import{u as Yl,s as Zl,a as Zn,S as Jl,v as Ql}from"./sortable.esm-BPDXfku7.js";import{s as Xl,g as ec,u as tc,A as nc}from"./use-section-preview-base-BHeBUNI1.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-C-3Oyqrm.js";import{u as oc}from"./use-apply-named-rule-CjRIJJWs.js";import{b as ba,a as ic}from"./variant-matcher-override-nKaBGWQ5.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-DIX895ki.js";import"./thread-route-DPiunvH4.js";import"./use-project-scope-C98g-M0M.js";import"./autosend-BUHDH46M.js";import"./thread-intent-BdGEZQ5d.js";import"./use-mcp-client-liHKfpfj.js";import"./auth-B2v1KOAc.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-62BerBh7.js";import"./task-board-Cp4gjjuc.js";import"./schema-DHeACN0H.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-B5qoi0Wr.js";import"./use-ai-providers-DVBJIa-_.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-C_uyrpUI.js";import"./utils-DF3h1YFq.js";import"./Play-CKfAabLj.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Dc1F6KjY.js";import"./LinkBroken01-BCegKYMu.js";import"./collapsible-TgXdzaTW.js";import"./use-copy-C6zGg71V.js";import"./usage-stats-C9C7AU7H.js";import"./tool-namespace-BWBiQhUq.js";import"./form-BIDT1Ue4.js";import"./label-Ce-ZCIZn.js";import"./utils-CVEq3hMx.js";import"./markdown-Y9FReFEe.js";import"./use-mobile-XeH7HFdg.js";import"./use-clock-tick-UQl4M1J5.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DrWXODkj.js";import"./types-CRdMnwkp.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-BgO0RShT.js";import"./XClose-B88tJS8W.js";import"./ShoppingBag01-EO0f4EEB.js";import"./SearchMd-OM6lL3Xq.js";import"./shell-layout-DKjamnSj.js";import"./Building02-DTlG5UDd.js";import"./use-deployment-admin-CuHcgI6F.js";import"./admin-fetch-BhTJlAsX.js";import"./CheckCircle-BoFFOiJR.js";import"./Monitor01-aloCOxdR.js";import"./command-6ewscZzU.js";import"./index-B94uTMNH.js";import"./integration-icon-C_aSliEO.js";import"./project-icon-DtQEqIYx.js";import"./new-project-dialog-BRBdOtjX.js";import"./ArrowLeft-CLIbFvcM.js";import"./repository-import-picker-Cgqnl0_u.js";import"./use-navigate-to-agent-Ba4TBBON.js";import"./repository-picker-BGNbJ5FK.js";import"./useInfiniteQuery-BYZFn0Hg.js";import"./infiniteQueryObserver-DCWN2zRB.js";import"./collection-search-Dxv0FJfh.js";import"./use-debounced-value-Chk6vawl.js";import"./required-auth-layout-DGUYFPwh.js";import"./use-org-sso-ZqYOnTZ9.js";import"./sheet-D-DL4PyF.js";import"./use-connection-DVSix2AF.js";import"./Link01-BaCE2stQ.js";import"./use-mcp-prompts-cYDRO3Kp.js";import"./use-thread-outputs-BkxphpfI.js";import"./file-type-icon-qeWcetSB.js";import"./section-array-field-rBWQHh7r.js";import"./alert-D3Vs7Hmm.js";import"./switch-CZb-mYsM.js";import"./textarea-DIMcwKj_.js";import"./ChevronSelectorVertical-DYan7Eqw.js";import"./popover-VBk0ee-p.js";import"./monaco-editor-fuZZsh6j.js";import"./editor-BQUfQi3X.js";import"./calendar-BF6y0Z9x.js";import"./SwitchHorizontal01-VCz6eoXn.js";import"./Minus-YbXjN_Ds.js";import"./select-qBldsuZB.js";import"./index-BdQq_4o_.js";import"./index-oqricAgA.js";import"./editor-classes-DeM_8BMv.js";import"./toggle-group-DQ8R6Md0.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CXI3q8SD.js";import"./Upload01-Dxk-zD3u.js";import"./DotsVertical-bVrzKljT.js";import"./search-input-Zdy1mSae.js";import"./tabs-Cb1EEFWU.js";import"./use-file-configs-Cr0gwmd8.js";import"./asset-utils-O6X_dwt-.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-Cass8jgv.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-DGj1a1JQ.js";import"./CreditCard01-BgcDg6Po.js";import"./Globe04-DROK8sB6.js";import"./Key01-CcnI3N_J.js";import"./Sun-tqaV4Ycc.js";import"./Users01-CS7GcqAQ.js";import"./experiments-tab-choice-CkKpewiH.js";import"./use-sandbox-events-COXHFEXL.js";import"./slider-DKsnyXsn.js";import"./index-H6qehDl6.js";import"./tooltipContext-C2tBhXWj.js";import"./CategoricalChart-1w257zDj.js";import"./index-BCDmEpzR.js";import"./ActiveShapeUtils-DBB_x8Gs.js";import"./Sector-aZQlOyVI.js";import"./symbol-CyQNqsns.js";import"./empty-state-P8DRc5l5.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-Bkqfi8fY.js";const uc={escape:Pi};function dc(v,e){for(const p of Xl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Ho(v,Wo(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="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 _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Qn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Q;e[0]!==b||e[1]!==y?(Q=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=Q):Q=e[2];const ge=Q;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Jn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const X=Oe??p.label;let $e;e[30]!==Re||e[31]!==X?($e=r.jsx("span",{className:Re,children:X}),e[30]=Re,e[31]=X,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="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 Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("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":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"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 Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:Q,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Qn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:X,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Ze=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!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 He;e[25]!==Ze||e[26]!==ve||e[27]!==ct?(He=r.jsx(Ze,{label:ve,classicClassName:ct}),e[25]=Ze,e[26]=ve,e[27]=ct,e[28]=He):He=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==Q?(Ke=T=>{T.stopPropagation(),Q()},e[35]=Q,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Jn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let Z;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(Z=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=Z):Z=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let We;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==Z||e[72]!==me?(We=r.jsxs(Zo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,Z,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=Z,e[72]=me,e[73]=We):We=e[73];let qe;e[74]!==fe||e[75]!==He||e[76]!==We?(qe=r.jsxs(fe,{children:[He,We]}),e[74]=fe,e[75]=He,e[76]=We,e[77]=qe):qe=e[77];let Je;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==X||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==lt||e[87]!==qe||e[88]!==L?(Je=r.jsxs("div",{ref:X,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,W,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=X,e[82]=_,e[83]=A,e[84]=Ye,e[85]=W,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Je):Je=e[89],Je}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let Q;e[3]!==B?(Q=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=Q):Q=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==Q?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,Q]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=Q,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:Q,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Qn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[X,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);X!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Zl},e[3]=_):_=e[3];const we=zl(Sa(Hl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Qe=it.indexOf(String(ie.id));Ve===-1||Qe===-1||(ze(nt=>Aa(Zn([...nt],Ve,Qe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Qe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const W=Ye;let lt,fe,Ze,ve,ct,He,Ee,Ke,tt,Me,Be,De,Y,Z,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==Q||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){Z=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Ze=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Qe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Qe||e[66]!==c?(nt=F?Qe:r.jsxs("div",{className:"space-y-2",children:[Qe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Qe,e[66]=c,e[67]=nt):nt=e[67],Z=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Ze,e[57]=ve,e[58]=Y}else Ze=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=W,lt=Jl,He=it,Ee=Ql,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>Q(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=Q,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Ze,e[36]=ve,e[37]=ct,e[38]=He,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=Z,e[47]=ee}else lt=e[33],fe=e[34],Ze=e[35],ve=e[36],ct=e[37],He=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],Z=e[46],ee=e[47];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==He||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:He,strategy:Ee,children:O}),e[71]=lt,e[72]=He,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Ze||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Ze,meta:V,decofile:B})}):null,e[76]=Ze,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let We;e[82]!==me?(We=qo.createPortal(r.jsx(Wl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=We):We=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==We?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,We]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=We,e[92]=qe):qe=e[92];let Je;e[93]!==U||e[94]!==F||e[95]!==c?(Je=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Je):Je=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Je?(T=r.jsxs("div",{className:Y,children:[qe,Je]}),e[97]=Y,e[98]=qe,e[99]=Je,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:Q=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),X=Qn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,W]=S.useState(null),[lt,fe]=S.useState(0),[Ze,ve]=S.useState(void 0),[ct,He]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(He(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[Z,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[We,qe]=S.useState(O.length);We!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Je,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Qe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Xn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Zt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(Q),[As,Ns]=S.useState(Q);Q&&!As&&(Ns(!0),cn(!0),L(null),A(null),W(null),N([])),!Q&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Jt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Qt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Jo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),W(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Ha]=S.useState(0),zs=Qo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Xo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Wa,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Hs=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Za=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Za,Ja=Te?Hi(Mn):void 0,Ws=ns?.seoTypeOptions??[],qs=Te&&u?Wi(u):"",ss=Ma??Ja??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,J=Math.min(lt,le.length-1),ye=le[J],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),W(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:J,sectionVariantIndex:Ie,selectedSectionIndex:m};const Qa=()=>({multivariate:Dn,index:J,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[J]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Wa&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=J;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Qa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),W(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),W(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),Ge(null),Le(null)}return!0},Zs=K?.index;if(K!==void 0&&(K?.seq??null)!==Ze&&(ve(K?.seq??null),typeof Zs=="number"&&Ys(Zs,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==J)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Wr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),W(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Jt(s=>s+1))}if(Ls!==$a){Ha(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),W(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,J,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),W(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Js=()=>Wr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Js()){tn.current=!0;return}Os(n=>n+1)},Qs=()=>{!tn.current||Js()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Xs=()=>{tn.current&&setTimeout(Qs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Xa=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Jr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Zr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Jr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Xa(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,H=P[n];if(!H)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(H,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Zr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(H,re):z,fresh:{}});return}const Xe=pt?pt.merged:null,Pt=Xe??j,zr=ji({merged:!!Xe,tracked:d,current:Lt.current,saved:j});Xe&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Xe,A(Xe));const hs=zr||!Xe?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Hr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Qs()})};if(re.isSavedBlock){const te=Ss(H,re);if(!te)return;Hr({blockKey:te,data:Pt,...he?{base:{value:Xe?Ae:he}}:{},rebaseOnConflict:!1,guard:Xr({formBase:d,rebased:!!Xe,versionOf:er})});return}if(!z)return;const Hn={...I[z]},Wt=[...P];if(re.isMultivariate){const te=st(H,re);if(!te||!z)return;const de=Ei(te,l,Pt);Wt[n]=Kt(H,re,de)}else if(re.isHidden){const te=Vs(H.__resolveType),de=te?{...H.section}:{...H},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Qr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Wt[n]={...H,section:de}:Wt[n]=de}else re.isLazy?Wt[n]={...H,section:Pt}:Wt[n]=Pt;if(ue.length>1){const te=Hn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Qr(te?.__resolveType,de[be],Wt)),Hn.sections={...te,variants:de}}else Hn.sections=Wt;Hr({blockKey:z,data:Hn,rebaseOnConflict:!1,guard:Xr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),W(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),W(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Zn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),W(null),Ge(null),Le(null);return}A(i.data),W(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,J,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&Z===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Ht=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Ht.length===0)return;const s=Pl(t);return{kinds:Ht,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=Z&&u?Gn(Z,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=Z?{__resolveType:Z,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Ht.length>0?{kinds:Ht,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",H=i[z],re=typeof H?.name=="string"?H.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Qt?{__resolveType:Qt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const H=[...a];return H[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,H,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),H={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,H,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,H),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Hs:je?.label??"",wo=Qt&&u?Gn(Qt,u):null,xr=(t,n)=>n&&X?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?X?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Hs,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Zt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=X&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=X&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Zt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Zt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Zt&&!Ft&&!Te&&!Ct&&!mt,No=!X&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),W(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=J;J===t?s=n:t<J&&n>=J?s=J-1:t>J&&n<=J&&(s=J+1),fe(s);const a=Zn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Zn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<J?fe(J-1):t===J&&fe(Math.max(0,t-1)),L(null),A(null),W(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),W(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),W(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const H={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:H[s]}),await kt(z,H),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const H={...j,variants:z},re=[...a];re[s]=Kt(h,x,H);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Xe=[...I];Xe[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Xe);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const H=Un(ue),re=Yn(H,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:H,data:he,create:!0});sn=qn(pt),Ae=sn?null:H;const Xe=[...I];Xe[t]={...P,rule:ln(H)},await be(Xe),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Jt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Zt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Jt(s=>s+1);return}It(Ps.slice(0,t-1)),Jt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!X&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("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",Ji),children:[r.jsx(Zi,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Wn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Qi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Qt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Ht),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Qt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(X?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${J}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(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-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Xi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(X||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:J,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Wn,{onClick:bn}),Eo&&r.jsx(Wn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?X?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Zt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Xn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Xt&&Ve(null)}}),Qe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Qe]?.rule,f??{},u??void 0)?kn(At[Qe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Qe]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Ko(Qe,t)},onOpenChange:t=>{!t&&!Xt&&nt(null)}})]})})})}export{uf as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-BqutwFSm.js";import{c as V,b as W,a as X,D as Y}from"./drawer-C8pd-9h5.js";import{u as Z}from"./use-mobile-XeH7HFdg.js";import{d as ee}from"./chat-context-CRAqcBEA.js";import{S as F,a as le,M as se,c as te}from"./index-Cu6YVL4w.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(F,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,cu as rt,cv as _e,j as c,cw as st,cx as be,cy as k,cz as lt,cA as j,cB as N,cC as $,cD as at,bQ as Ee,cE as Re,cF as it,cG as ct,cH as dt,cI as ut,cJ as pt,cK as ft,cL as mt,cM as ht,cN as vt,cO as gt,cP as xt,cQ as St,c as ee,l as oe,ai as wt}from"./index-BHfNbC3J.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-CeFLqtNb.js";import{t as je,n as yt}from"./ChevronUp-DI2ULEH1.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
1
|
+
import{r as d,cu as rt,cv as _e,j as c,cw as st,cx as be,cy as k,cz as lt,cA as j,cB as N,cC as $,cD as at,bQ as Ee,cE as Re,cF as it,cG as ct,cH as dt,cI as ut,cJ as pt,cK as ft,cL as mt,cM as ht,cN as vt,cO as gt,cP as xt,cQ as St,c as ee,l as oe,ai as wt}from"./index-BqutwFSm.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-oqricAgA.js";import{t as je,n as yt}from"./ChevronUp-DQBYMpqT.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
|