decocms 4.567.0 → 4.568.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-77Slg1mo.js → AlertCircle-4XjOBzzr.js} +1 -1
- package/dist/client/assets/{AreaChart-SE-oSToz.js → AreaChart-U2booYre.js} +1 -1
- package/dist/client/assets/{ArrowLeft-0eZGIs9d.js → ArrowLeft-FLGKBq3z.js} +1 -1
- package/dist/client/assets/{ArrowUp-D3pp3g8x.js → ArrowUp-Lwcx-ceL.js} +1 -1
- package/dist/client/assets/{CartesianChart-oe8TUIzs.js → CartesianChart-BcKhfNJ4.js} +1 -1
- package/dist/client/assets/{CategoricalChart-D-0Fq-ih.js → CategoricalChart-Du8Ljv-7.js} +1 -1
- package/dist/client/assets/{CheckCircle-TpvuszDI.js → CheckCircle-DFL7pw-c.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C6Gq0VMA.js → ChevronSelectorVertical-DujPgcUo.js} +1 -1
- package/dist/client/assets/{ChevronUp-BtMiI6cM.js → ChevronUp-BvHbQNBW.js} +1 -1
- package/dist/client/assets/{CreditCard01-5X4JuL9P.js → CreditCard01-BwD4GYuP.js} +1 -1
- package/dist/client/assets/{Globe04-DE5hlmxS.js → Globe04-Wakfx0G2.js} +1 -1
- package/dist/client/assets/{Key01-BEX3raxr.js → Key01-D8VFHgU4.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ClWYoOJF.js → LinkBroken01--Z9NHGsb.js} +1 -1
- package/dist/client/assets/{Minus-Dqs0K-y6.js → Minus-mLwaHX_9.js} +1 -1
- package/dist/client/assets/{Monitor01-Dy43NIcG.js → Monitor01-xd6_AGZa.js} +1 -1
- package/dist/client/assets/{Play-B9kSRU73.js → Play-Bd4GTUnl.js} +1 -1
- package/dist/client/assets/{Plus-DTA_qyzr.js → Plus-Cq9NYyX9.js} +1 -1
- package/dist/client/assets/{ReferenceLine-HOuLDy67.js → ReferenceLine-CEoolREz.js} +1 -1
- package/dist/client/assets/{SearchMd-DODrmRDH.js → SearchMd-BxQmfb5s.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CK3v09in.js → ShoppingBag01-CYCT2jnZ.js} +1 -1
- package/dist/client/assets/{Sun-BirMDMzO.js → Sun-COkqP7iJ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DFMegDqF.js → SwitchHorizontal01-TPw7EzQJ.js} +1 -1
- package/dist/client/assets/{Tool01-Dhj9-e2p.js → Tool01-BqhX4Lir.js} +1 -1
- package/dist/client/assets/{Tooltip-DUa9z7L4.js → Tooltip-Rsr656vO.js} +1 -1
- package/dist/client/assets/{Trash01-DlPuy4hk.js → Trash01-BsqfSoas.js} +1 -1
- package/dist/client/assets/{Upload01-B7_UtIIy.js → Upload01-CjUA7jDn.js} +1 -1
- package/dist/client/assets/{UserSquare-DRzDrNWv.js → UserSquare-DLTddIeU.js} +1 -1
- package/dist/client/assets/{Users01-D2MH6X4i.js → Users01-C0dAo1hK.js} +1 -1
- package/dist/client/assets/{XClose-BPpAzkjm.js → XClose-BmPamPKb.js} +1 -1
- package/dist/client/assets/{Zap-CSm2QafG.js → Zap-CNah22BF.js} +1 -1
- package/dist/client/assets/{access-gate-VZjzTtj1.js → access-gate-KNoXvQR4.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Dlb7QEF0.js → add-connection-dialog-CoeePYAP.js} +1 -1
- package/dist/client/assets/agent-app-h9dvewo_.js +1 -0
- package/dist/client/assets/{agent-assets-C17EfgRE.js → agent-assets-BFTAqbZ2.js} +1 -1
- package/dist/client/assets/{agent-automation-B4ZBovsD.js → agent-automation-DQSsp-Qq.js} +1 -1
- package/dist/client/assets/{agent-automations-qrK0F_qT.js → agent-automations-HvNPVcR1.js} +1 -1
- package/dist/client/assets/{agent-calendar-DH2mwvW-.js → agent-calendar-D1UuIhb8.js} +1 -1
- package/dist/client/assets/{agent-capabilities-_Toql8Rw.js → agent-capabilities-D2A31nji.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DKscloVB.js → agent-connect-sources-anUeuGw0.js} +1 -1
- package/dist/client/assets/agent-deck-BCxKCrzx.js +1 -0
- package/dist/client/assets/{agent-e2e-EecJC8x2.js → agent-e2e-BFTeY8yw.js} +1 -1
- package/dist/client/assets/agent-experiments-DCgjZH4p.js +1 -0
- package/dist/client/assets/{agent-file-iZ4NUGLw.js → agent-file-CRchtrX1.js} +1 -1
- package/dist/client/assets/{agent-hosting-Dv4dOzql.js → agent-hosting-G7B4MOee.js} +1 -1
- package/dist/client/assets/{agent-icon-Bw6QCyEx.js → agent-icon-DGjvzBU0.js} +1 -1
- package/dist/client/assets/agent-library-Mjv8f5mE.js +1 -0
- package/dist/client/assets/agent-library-file-jHy8SGkc.js +1 -0
- package/dist/client/assets/agent-overview-vbL61vSj.js +1 -0
- package/dist/client/assets/{agent-releases-TATL9kUr.js → agent-releases-CHTMMSg0.js} +1 -1
- package/dist/client/assets/agent-settings-C2R4yKuP.js +1 -0
- package/dist/client/assets/{agent-site-editor-DNv8LivC.js → agent-site-editor-Cbl8939c.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CPa8HId6.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DPYtm9fq.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DlIkhRRY.js +1 -0
- package/dist/client/assets/agent-view-AO-J0D6v.js +1 -0
- package/dist/client/assets/{agent-view-guard-DZBM0b8V.js → agent-view-guard-DNJq8WJa.js} +1 -1
- package/dist/client/assets/{ai-providers-AE8XVdCE.js → ai-providers-Cj1o2PDA.js} +1 -1
- package/dist/client/assets/{alert-CdBC10NR.js → alert-CkisSQR8.js} +1 -1
- package/dist/client/assets/{analytics-sections-BeJKxwpX.js → analytics-sections-CPw_3198.js} +1 -1
- package/dist/client/assets/api-keys-Ca6cGjfN.js +1 -0
- package/dist/client/assets/{api-keys-Dhr7aXaQ.js → api-keys-DvsVEDYM.js} +1 -1
- package/dist/client/assets/{app-editor-DKFrTznS.js → app-editor-D_UGcnYy.js} +1 -1
- package/dist/client/assets/{asset-utils-7GGOgR3V.js → asset-utils-BMQvttAs.js} +1 -1
- package/dist/client/assets/{auth-DsiBBvOi.js → auth-D2Lcha9t.js} +1 -1
- package/dist/client/assets/{auth-catchall-BDiLMtRv.js → auth-catchall-DyFlHo48.js} +1 -1
- package/dist/client/assets/{auth-entry-cOo1IIAQ.js → auth-entry-DDLQ2T30.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BD7ZQtZI.js → auth-split-layout-C64FoWws.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-g4wWRHNx.js → authenticate-and-persist-oauth-BXtcfltM.js} +1 -1
- package/dist/client/assets/{automation-list-row-DxL776kN.js → automation-list-row-Cbotm6BG.js} +1 -1
- package/dist/client/assets/{automation-runs-CLAvbaXa.js → automation-runs-uTz7ccV0.js} +1 -1
- package/dist/client/assets/{automations-DTy3O45p.js → automations-CgCrXng3.js} +1 -1
- package/dist/client/assets/{autosend-CLDsiYES.js → autosend-BeP-7Z9T.js} +1 -1
- package/dist/client/assets/{badge-CQfwGgw6.js → badge-37ZrebMM.js} +1 -1
- package/dist/client/assets/{block-document-Ds1SRHrx.js → block-document-AH_Uk3nK.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BjUOv6Gn.js → blocks-preview-workspace-context-wN3COmWz.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DTS9heYD.js → blocks-tab-states-CERDbw5g.js} +1 -1
- package/dist/client/assets/{blog-schema-D0od8ENQ.js → blog-schema-DUx1yOEj.js} +1 -1
- package/dist/client/assets/{buckets-DJa_BsNC.js → buckets-CncRgLSv.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-B3q_lki0.js → build-improve-prompt-doc-BWQkcKAa.js} +1 -1
- package/dist/client/assets/{calendar-DyqOJ3Yl.js → calendar-ESmP-ay5.js} +1 -1
- package/dist/client/assets/{capability-load-error-BCivHBGk.js → capability-load-error-D91RsAwR.js} +1 -1
- package/dist/client/assets/{category-editor-CjAyQPuX.js → category-editor-C7jYzChE.js} +1 -1
- package/dist/client/assets/{chart-eHX6bECf.js → chart-yg_E5Zl2.js} +1 -1
- package/dist/client/assets/{chat-context-DGlvTnKl.js → chat-context-DSkOndUS.js} +1 -1
- package/dist/client/assets/{chat-draft-lDXn_WJo.js → chat-draft-CCm5Ov2V.js} +1 -1
- package/dist/client/assets/{checkbox-BicdYBus.js → checkbox-DS3fV3cm.js} +1 -1
- package/dist/client/assets/{choose-editor-EWBezbD2.js → choose-editor-O-d7ISrT.js} +1 -1
- package/dist/client/assets/{cli-auth-success-F_8HAZW5.js → cli-auth-success-1kH4GC4v.js} +1 -1
- package/dist/client/assets/{client-icons-DajqMwYZ.js → client-icons-C8Uj1zsT.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-BwSxTAM8.js → cms-settings-editor-BOlrMR3T.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-uQohRmgN.js → cms-store-drafts-Cmau_Xpk.js} +1 -1
- package/dist/client/assets/{collapsible-BUfI2uMB.js → collapsible-DRuNeeSr.js} +1 -1
- package/dist/client/assets/{collection-detail-DJM8n-Nh.js → collection-detail-DpUbmPF3.js} +1 -1
- package/dist/client/assets/{collection-display-button-BwDkXlls.js → collection-display-button-Bwz5aQUh.js} +1 -1
- package/dist/client/assets/{collection-search-CX3zyrl-.js → collection-search-BQWTlXQF.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-YLWvJmM-.js → collection-table-wrapper-CbyF6Nov.js} +1 -1
- package/dist/client/assets/{collection-tabs-By2NKMgI.js → collection-tabs-D3WnD7EM.js} +1 -1
- package/dist/client/assets/{combobox-CfLj8nnB.js → combobox-CT2qCKie.js} +1 -1
- package/dist/client/assets/{command-gJAHYCw0.js → command-D37uN5J-.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CfXFRKkt.js → companion-mcps-section-BFZVF2RC.js} +1 -1
- package/dist/client/assets/{config-BmEe9Sll.js → config-CZ3pUlCW.js} +1 -1
- package/dist/client/assets/{connect-Bv1wjltN.js → connect-71FB3CXN.js} +1 -1
- package/dist/client/assets/{connect-layout-BWcLA-tm.js → connect-layout-CKRVOgzj.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DSZRQtyq.js → connect-source-dialog-CNca8slt.js} +1 -1
- package/dist/client/assets/{connection-C_2ILr0W.js → connection-DESaeNZx.js} +1 -1
- package/dist/client/assets/{connection-card-CYwtBEJi.js → connection-card-t63ssUn-.js} +1 -1
- package/dist/client/assets/{connection-detail-Bou1FrgT.js → connection-detail-DuRyDzXg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-TcnlMaZD.js → connection-form-helpers-DL8JpgdC.js} +1 -1
- package/dist/client/assets/{connection-slug-BW3zmzZg.js → connection-slug-Bv1gCwRj.js} +1 -1
- package/dist/client/assets/{connections-k6Hr0O7B.js → connections-CdsCJmtK.js} +1 -1
- package/dist/client/assets/{content-tab-BZbNqACK.js → content-tab-Bh7FUKC3.js} +3 -3
- package/dist/client/assets/{context-BrQkqNcb.js → context-DLjNZH7d.js} +1 -1
- package/dist/client/assets/{context-menu-vgijVtOb.js → context-menu-CugaroNR.js} +1 -1
- package/dist/client/assets/{context-shell-Ctmm-Xdc.js → context-shell-DYGyde-Z.js} +3 -3
- package/dist/client/assets/{core.esm-BMG4ioMU.js → core.esm-CTG2N8v2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DVfXqnPV.js → create-organization-dialog-CogPW5s2.js} +1 -1
- package/dist/client/assets/{device-hint-C-9B9AO-.js → device-hint-CD49lDbc.js} +1 -1
- package/dist/client/assets/{discover-PXb5-Euj.js → discover-BM-XQVCu.js} +1 -1
- package/dist/client/assets/{domain-settings-BZ2zcLtt.js → domain-settings-Bt06PPmF.js} +1 -1
- package/dist/client/assets/{drawer-7PMhL6c9.js → drawer-DsjbbVTG.js} +1 -1
- package/dist/client/assets/{editor-C31TESmA.js → editor-BpBeMMun.js} +1 -1
- package/dist/client/assets/{editor-classes-Cf4dLWq3.js → editor-classes-CS7nwV3G.js} +1 -1
- package/dist/client/assets/{empty-state-CkiFzdzZ.js → empty-state-CPetbKsr.js} +1 -1
- package/dist/client/assets/{empty-state-Br5S8FBX.js → empty-state-CgDxl1cN.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-C_eZAy_m.js → experiments-tab-choice-Ckqo9bHe.js} +1 -1
- package/dist/client/assets/{extract-connection-data-ByI5vK4V.js → extract-connection-data-BoY4cFA7.js} +1 -1
- package/dist/client/assets/{feature-gate-Fvf7MS-k.js → feature-gate-D4S13Ohw.js} +1 -1
- package/dist/client/assets/{feature-paywall-C6MAaSeS.js → feature-paywall-BPHi9qtV.js} +1 -1
- package/dist/client/assets/{feedback-uGs2nxfi.js → feedback-UOqcYnsR.js} +1 -1
- package/dist/client/assets/{file-explorer-BYGhyWEG.js → file-explorer-R1XT7WuQ.js} +1 -1
- package/dist/client/assets/{file-preview-DVtj98bP.js → file-preview-Bn_lFKvb.js} +1 -1
- package/dist/client/assets/{file-share-button-BRYVxpzc.js → file-share-button-BbBCmHML.js} +1 -1
- package/dist/client/assets/{file-type-icon-aib86xB6.js → file-type-icon-DwSbw3u_.js} +1 -1
- package/dist/client/assets/{folder-icon-xP_msldQ.js → folder-icon-22cZTm1q.js} +1 -1
- package/dist/client/assets/{form-BBNzwOZG.js → form-xPNilXk8.js} +1 -1
- package/dist/client/assets/{general-CeisvnAE.js → general-BNCy0qRP.js} +1 -1
- package/dist/client/assets/{github-icon-Caf_vA32.js → github-icon-M98rwFqR.js} +1 -1
- package/dist/client/assets/{home-jWQT8tJO.js → home-CX-I119p.js} +1 -1
- package/dist/client/assets/{home-overview-C_lPrOCA.js → home-overview-BImgFzPA.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-C-wcyta_.js → hosted-reconcile-B_zakWIj.js} +1 -1
- package/dist/client/assets/{icon-button-D7c84PdP.js → icon-button-nAmR0pUP.js} +1 -1
- package/dist/client/assets/{index-CkLGogIO.js → index-2pjgY723.js} +1 -1
- package/dist/client/assets/{index-CqcoXuFg.js → index-B6xZxtVu.js} +1 -1
- package/dist/client/assets/{index-CNvZmowt.js → index-Bx0EGvvq.js} +1 -1
- package/dist/client/assets/{index-CMM5_x0M.js → index-C24rff9A.js} +1 -1
- package/dist/client/assets/{index-rV6-HlJv.js → index-CM9G2Opl.js} +1 -1
- package/dist/client/assets/{index-DrT_mubP.js → index-CcQukHqg.js} +1 -1
- package/dist/client/assets/{index-DqnMzkHt.js → index-ChbLGWhe.js} +1 -1
- package/dist/client/assets/{index-rbq2RwK4.js → index-CiqUNjUm.js} +1 -1
- package/dist/client/assets/{index-DJTz8tA2.js → index-CkRd4yOd.js} +1 -1
- package/dist/client/assets/{index-B2hAsS12.js → index-CopIngND.js} +1 -1
- package/dist/client/assets/{index-2X0wZvq4.js → index-CpdAUi_L.js} +1 -1
- package/dist/client/assets/{index-BXDjwwPk.js → index-DUYaR34S.js} +1 -1
- package/dist/client/assets/{index-qZbv6YO4.js → index-DYRhQ9nm.js} +1 -1
- package/dist/client/assets/{index-C98dKlkT.js → index-H80WMTvM.js} +1 -1
- package/dist/client/assets/{index-CGPEL67z.js → index-oG6UN7--.js} +1 -1
- package/dist/client/assets/{index-redirect-DCqW-S58.js → index-redirect-BLueVivV.js} +1 -1
- package/dist/client/assets/{index-B8UywZZm.js → index-ucJDxPyE.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-BGhionND.js → infiniteQueryObserver-Bd4S1JAr.js} +1 -1
- package/dist/client/assets/{infra-billing-CkEQLhps.js → infra-billing-Cg1YMKnB.js} +1 -1
- package/dist/client/assets/{input-DE1KZAH4.js → input-D-wXYNeQ.js} +3 -3
- package/dist/client/assets/{input-30s27Dwt.js → input-egigpNvJ.js} +1 -1
- package/dist/client/assets/{integration-icon-DXRPTOXy.js → integration-icon-a40gN_z1.js} +1 -1
- package/dist/client/assets/{jira-icon-CfexjHAg.js → jira-icon-DIaDl6Sc.js} +1 -1
- package/dist/client/assets/{label-bffvb9RR.js → label-CxjTL0R_.js} +1 -1
- package/dist/client/assets/{layout-DUb1_0Na.js → layout-DeMWwMag.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CGYaMIvK.js → legacy-agents-deep-maguvV0Q.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DTIlt7DJ.js → legacy-main-redirect-CrJ1J4b6.js} +1 -1
- package/dist/client/assets/library-YQBdctuF.js +1 -0
- package/dist/client/assets/{library-tab-ChfMhJEt.js → library-tab-CqHQSOSi.js} +1 -1
- package/dist/client/assets/{login-oQzZnf04.js → login-GqA0qMx7.js} +1 -1
- package/dist/client/assets/{markdown-C594pPG2.js → markdown-Cs2UsOW2.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BgKMzsSF.js → mcp-app-renderer-Da9_HDDx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dm95e807.js → mcp-oauth-CwgKK51G.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BzKawp-_.js → mcp-oauth-DB6dlajV.js} +1 -1
- package/dist/client/assets/{members-DEZJ5Mkk.js → members-kUrSWAB8.js} +1 -1
- package/dist/client/assets/{memory-D8k1PjtE.js → memory-68_RSYrN.js} +1 -1
- package/dist/client/assets/{mock-board-DbSEkLmB.js → mock-board-CthDdMFD.js} +3 -3
- package/dist/client/assets/{monaco-editor-Cp-Ik4oF.js → monaco-editor-0eOa-DPV.js} +1 -1
- package/dist/client/assets/{monitoring-DcVl24hV.js → monitoring-CajYiFMp.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-do-o5vGg.js → monitoring-stats-row-Badkrd8m.js} +1 -1
- package/dist/client/assets/{multi-select-CTRCP8n_.js → multi-select-Dc3qkP9e.js} +1 -1
- package/dist/client/assets/{mustache-ezjY74jH.js → mustache-FPu-BUlH.js} +1 -1
- package/dist/client/assets/{named-rule-view-DvHwI-Uj.js → named-rule-view-Iopjwm11.js} +1 -1
- package/dist/client/assets/{new-project-dialog-C8Uv8Lu7.js → new-project-dialog-CcXdYQOA.js} +1 -1
- package/dist/client/assets/{oauth-callback-CUY5LMrV.js → oauth-callback-CtKUneJ3.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BM4j1Kp6.js → oauth-callback-ai-provider-BW86dzZR.js} +1 -1
- package/dist/client/assets/{oauth-consent-CGVwKR_T.js → oauth-consent-ImI0sTuT.js} +1 -1
- package/dist/client/assets/{onboarding-Rp6hEouh.js → onboarding-BWsm-6Ib.js} +1 -1
- package/dist/client/assets/{openai-conversation-DEpsjI9o.js → openai-conversation-x0vBTDcX.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DWyqj7gv.js → optimistic-project-sidebar-views-DQpn9Pgs.js} +1 -1
- package/dist/client/assets/{order-monitor-day-Bu3YI8SD.js → order-monitor-day-CDgLweRg.js} +1 -1
- package/dist/client/assets/{organization-choice-CH8EbPmN.js → organization-choice-CRVdDLQi.js} +1 -1
- package/dist/client/assets/{orgs-Rdz1cKF2.js → orgs-CT9apq2g.js} +1 -1
- package/dist/client/assets/{own-accounts-section-B5fmcBw0.js → own-accounts-section-BRHD0772.js} +1 -1
- package/dist/client/assets/{pair-xiFs456g.js → pair-mfml6eLi.js} +1 -1
- package/dist/client/assets/{parse-sections-CWxm7mRm.js → parse-sections-11L0xusW.js} +3 -3
- package/dist/client/assets/{plan-iqz5I5FG.js → plan-DRqprlax.js} +1 -1
- package/dist/client/assets/{plan-ladder-5XW4hCzP.js → plan-ladder-BoOM3V_X.js} +1 -1
- package/dist/client/assets/{plan-usage-card-Cj9Gz5rK.js → plan-usage-card-C52vk1JD.js} +1 -1
- package/dist/client/assets/{popover-Bcm8q-UM.js → popover-BaWxRQRQ.js} +1 -1
- package/dist/client/assets/{post-calendar-C-wpEVEt.js → post-calendar-B7v9fy1f.js} +1 -1
- package/dist/client/assets/{post-editor-DSrYz5eu.js → post-editor-B5pVpoGq.js} +1 -1
- package/dist/client/assets/{preview-content-BZTSsgR7.js → preview-content-VAE9VX_a.js} +1 -1
- package/dist/client/assets/{preview-dialog-Si16X-hs.js → preview-dialog-vZA6Vkch.js} +1 -1
- package/dist/client/assets/{preview-panel-BUZ06et3.js → preview-panel-CmtR7uJm.js} +1 -1
- package/dist/client/assets/{preview-tab-IspVWI2P.js → preview-tab-COW5YDet.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-QdVrFrEF.js → product-picker-dialog-Di0GUuGQ.js} +1 -1
- package/dist/client/assets/{profile-BU9rPDry.js → profile-DbHjYdB0.js} +1 -1
- package/dist/client/assets/{project-app-view-BBFj0BFi.js → project-app-view-oayAW59Y.js} +1 -1
- package/dist/client/assets/{project-apps-J9B-3GYC.js → project-apps-DKkSorHl.js} +1 -1
- package/dist/client/assets/{project-icon-BYuH9rQ-.js → project-icon-BDGMpF2P.js} +1 -1
- package/dist/client/assets/{project-index-DAfZ854O.js → project-index-BXdjh86r.js} +1 -1
- package/dist/client/assets/project-reports-D6yXFUI4.js +1 -0
- package/dist/client/assets/{project-sidebar-views-Czma7tbo.js → project-sidebar-views-DxAssfab.js} +1 -1
- package/dist/client/assets/project-tasks-CxdDJlKX.js +1 -0
- package/dist/client/assets/{projects-DHRuNCso.js → projects-DWtsTPdq.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DAINcqhx.js → projects-empty-state-CA380eV8.js} +1 -1
- package/dist/client/assets/{prompts-BwCKANv5.js → prompts-BHFq_gsc.js} +1 -1
- package/dist/client/assets/record-editor-D0DXAuHN.js +1 -0
- package/dist/client/assets/{redirect-editor-DKgcJLei.js → redirect-editor-BwLrArGh.js} +1 -1
- package/dist/client/assets/reports-CH4MzjC3.js +1 -0
- package/dist/client/assets/{reports-B-KM0N71.js → reports-Dvv0WRgv.js} +1 -1
- package/dist/client/assets/{reports-onboarding-lrKJ48LY.js → reports-onboarding-DqGzGU-U.js} +1 -1
- package/dist/client/assets/{reports-tab-7YQe_lby.js → reports-tab-C-YlOqTD.js} +2 -2
- package/dist/client/assets/repositories-Bvcf-KuW.js +1 -0
- package/dist/client/assets/{repositories-DZ-YNWPW.js → repositories-COBSE7nS.js} +1 -1
- package/dist/client/assets/{repository-binding-DtOS-5pr.js → repository-binding-BWkpkFiy.js} +1 -1
- package/dist/client/assets/{repository-picker-BkanTJ3i.js → repository-picker-TrkRysRA.js} +1 -1
- package/dist/client/assets/{require-capability-DJA2DKIk.js → require-capability-DmJgWdQR.js} +1 -1
- package/dist/client/assets/{required-auth-layout-FfGW_C4w.js → required-auth-layout-sIreaYcR.js} +1 -1
- package/dist/client/assets/{reset-password-Do7rzjnV.js → reset-password-B2HAlTO4.js} +1 -1
- package/dist/client/assets/{resizable-C3wpOoRo.js → resizable-e7KAJlT2.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-D0LRqEAN.js → resolve-tab-icon-DnOPa8fE.js} +1 -1
- package/dist/client/assets/{review-settings-Dknq5J3l.js → review-settings-BZ6UQlsU.js} +1 -1
- package/dist/client/assets/{role-color-C15OiMK-.js → role-color-DKoRr7_O.js} +1 -1
- package/dist/client/assets/{roles-BnyT0Tpg.js → roles-BzRIIi-m.js} +1 -1
- package/dist/client/assets/route-DgZ0eIWH.js +1 -0
- package/dist/client/assets/{route-wsTyUIFW.js → route-cawoaLGc.js} +1 -1
- package/dist/client/assets/{route-cyGY1xFk.js → route-uBGz5xtE.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CTE-NRJ8.js → sandbox-lifecycle-context-DzPeV1F2.js} +1 -1
- package/dist/client/assets/{schema-HsTF1Pc5.js → schema-kWZLxlYI.js} +1 -1
- package/dist/client/assets/{schema-BeGOWHqJ.js → schema-tSFLTBrW.js} +1 -1
- package/dist/client/assets/{scroll-area-C4JxE3Sd.js → scroll-area-BEM410Qx.js} +1 -1
- package/dist/client/assets/{search-input-CqVCmKRX.js → search-input-BeN2Dgcn.js} +1 -1
- package/dist/client/assets/{search-toggle-2zm3S8SV.js → search-toggle-c4jDK8W2.js} +1 -1
- package/dist/client/assets/{secret-picker-BWL5LPg8.js → secret-picker-Cjv-JfME.js} +1 -1
- package/dist/client/assets/{secrets-tbMtsvU-.js → secrets-CevHfsbC.js} +1 -1
- package/dist/client/assets/{section-array-field-DAQuFQGC.js → section-array-field-DJyNG6r7.js} +1 -1
- package/dist/client/assets/{sections-BlIgOACC.js → sections-9yqUizm4.js} +1 -1
- package/dist/client/assets/{sections-editor-BW_YSgr6.js → sections-editor-DeOAChIV.js} +1 -1
- package/dist/client/assets/{select-74xFBRwJ.js → select-MFmOiD7V.js} +1 -1
- package/dist/client/assets/{select-model-DhRUUoEu.js → select-model-CQpO4P5t.js} +1 -1
- package/dist/client/assets/{seo-editor-Ckanf0Y7.js → seo-editor-C2CaIIDv.js} +1 -1
- package/dist/client/assets/{separator-oNbzaXZp.js → separator-BiskJWog.js} +1 -1
- package/dist/client/assets/settings-tab-DQ4iDk73.js +1 -0
- package/dist/client/assets/{sheet-DSOCEYQs.js → sheet-MLWNRYhQ.js} +1 -1
- package/dist/client/assets/{shell-layout-DLOpHw0Q.js → shell-layout-CMz_aZCA.js} +1 -1
- package/dist/client/assets/{site-draft-actions-DZN15MLN.js → site-draft-actions-CmIfl7aD.js} +1 -1
- package/dist/client/assets/{site-draft-view-M5zMgyWp.js → site-draft-view-DMPeif4U.js} +1 -1
- package/dist/client/assets/site-editor-Br6S_qwB.js +1 -0
- package/dist/client/assets/{site-editor-toast-BU0n_ImS.js → site-editor-toast-6KgkdfPr.js} +1 -1
- package/dist/client/assets/{skills-BNUPWCHo.js → skills-BqxMFGPE.js} +1 -1
- package/dist/client/assets/{slider-COhKeoXK.js → slider-D87k16tL.js} +1 -1
- package/dist/client/assets/{sortable.esm-DcEMfWKZ.js → sortable.esm-JloqmUYv.js} +1 -1
- package/dist/client/assets/{sso-gKduWE5w.js → sso-DQRc1SkX.js} +1 -1
- package/dist/client/assets/{suggestion-tumipUUi.js → suggestion-DSascTGX.js} +1 -1
- package/dist/client/assets/{switch-DhJh_HPi.js → switch-CnGPtCHB.js} +1 -1
- package/dist/client/assets/{synced-repos-n432_4GJ.js → synced-repos-D_gHr2cZ.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-P5ldYfjO.js → tab-icon-glyph--BvwD-9q.js} +1 -1
- package/dist/client/assets/{table-BsHAPl3y.js → table--lSGBU5J.js} +1 -1
- package/dist/client/assets/{tabs-ChqaRicq.js → tabs-Cl2CsEMh.js} +1 -1
- package/dist/client/assets/{task-board-BEneHA34.js → task-board-BzsqXAQD.js} +1 -1
- package/dist/client/assets/{task-route-P15E5tiK.js → task-route-BCP5p_Kg.js} +1 -1
- package/dist/client/assets/{task-status-C56yYxCa.js → task-status-C10P7bk5.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-sEKNVpnd.js → taskboard-analytics-tig154_J.js} +1 -1
- package/dist/client/assets/{tasks-BGXHV-F9.js → tasks-C-AxxRS8.js} +1 -1
- package/dist/client/assets/tasks-CE1MQpDZ.js +1 -0
- package/dist/client/assets/{textarea-DB65Cb4P.js → textarea-BA6pOE5t.js} +1 -1
- package/dist/client/assets/{thread-analytics-DBVrKrEw.js → thread-analytics-Chj_yROn.js} +1 -1
- package/dist/client/assets/{thread-intent-CWn1HmtU.js → thread-intent-CI_dX-N0.js} +1 -1
- package/dist/client/assets/{thread-route-BjJwVBtH.js → thread-route-BAKmNNyY.js} +1 -1
- package/dist/client/assets/{thread-route-BYTJQqVq.js → thread-route-jBbjjKNR.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-D86XTeGF.js → thread-sheet-body-kWzPcNxq.js} +1 -1
- package/dist/client/assets/{time-range-picker-NUSfs4B1.js → time-range-picker-D3aABZRy.js} +1 -1
- package/dist/client/assets/{toggle-group-C49gUsJz.js → toggle-group-Dh3zyTAy.js} +1 -1
- package/dist/client/assets/{tool-namespace-Bj1cvBDc.js → tool-namespace-DWzf9fHX.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Bs7M3rhU.js → tool-set-selector-Ct1WdfRK.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D-DoL4BQ.js → toolbar-icon-button-DLr3JTpB.js} +1 -1
- package/dist/client/assets/{tooltip-CSjs8EXx.js → tooltip-D_WhUD2W.js} +1 -1
- package/dist/client/assets/{tooltipContext-D6EVwPYC.js → tooltipContext-DBg9OJee.js} +1 -1
- package/dist/client/assets/{track-iPianFfO.js → track-DnomIQY8.js} +1 -1
- package/dist/client/assets/{types-Cr7M9oTi.js → types-ASWejG-h.js} +1 -1
- package/dist/client/assets/{url-slug-DYxjfT2K.js → url-slug-C7rIIBEj.js} +1 -1
- package/dist/client/assets/{usage-stats-QKrG0Chq.js → usage-stats-XRbUuNdg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BvE5F9lZ.js → use-ai-providers-CP8hIgY3.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CI1WcDAo.js → use-apply-named-rule-NujXCbVj.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-D3qra8L7.js +1 -0
- package/dist/client/assets/{use-automations-C6CsqXzM.js → use-automations-QnSiBJK1.js} +1 -1
- package/dist/client/assets/{use-autosave-DXTXn5fk.js → use-autosave-vzKNIh7N.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CrOozSZ7.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-C7mDb3bl.js → use-chat-layout-state-CZu4sqCQ.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-CQy1zqVQ.js → use-cms-publish-actions-BsAhW6oR.js} +1 -1
- package/dist/client/assets/{use-connect-companion-FoCT7yyy.js → use-connect-companion-BPvHx0lV.js} +1 -1
- package/dist/client/assets/{use-connection-Cbht658s.js → use-connection-Bh4mFZP8.js} +1 -1
- package/dist/client/assets/{use-content-sync--RnYhndo.js → use-content-sync-DwMQ9IL5.js} +1 -1
- package/dist/client/assets/{use-copy-pqG4JWZ9.js → use-copy-Bs4XYM8b.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-LBGPcKQF.js → use-date-fns-locale-BsWCfsQ_.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BhHBDt6n.js → use-debounced-autosave-CvEiuLQU.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DZeaw_xf.js → use-debounced-value-pGYMxzxk.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DRZjLOnu.js → use-deco-credits-DYCNC_rr.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-B4_GF30e.js → use-decopilot-events-d_M9Hjhx.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BwZvQv2v.js → use-delete-connection-C4bEnWu4.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CWBM5pU4.js → use-deployment-admin-DbaoxO_S.js} +1 -1
- package/dist/client/assets/{use-entitlements-DRzAxQMt.js → use-entitlements-CpaMfout.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CLbSHMWD.js → use-fast-preview-draft-url-D7lYg71A.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cbnx7meP.js → use-file-configs-DXg7w0ah.js} +1 -1
- package/dist/client/assets/{use-id-selection-Bo8PJDCH.js → use-id-selection-BUJSoF-P.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CbhFgNvg.js → use-inbox-feed-dFlcVIpe.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D2U3wOff.js → use-infinite-scroll-oh57fQW8.js} +1 -1
- package/dist/client/assets/{use-join-requests-IG9tsdHd.js → use-join-requests-rNOmuzaG.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-z25jEKcZ.js → use-main-panel-tabs-_zYm5HQh.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DBT7VWeT.js → use-mcp-auth-status-CHVe_UL9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-IDMULkw-.js → use-mcp-client-TeUnMSC4.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DdK4Oz96.js → use-mcp-prompts-DDyg7FMp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dua9SLd1.js → use-mcp-tools-Dfsa_hrX.js} +1 -1
- package/dist/client/assets/{use-mobile-C9EJZpJe.js → use-mobile-BbP62vju.js} +1 -1
- package/dist/client/assets/{use-move-blocks-RdGjZI5s.js → use-move-blocks-Bi-2K9Wd.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CnITDZ1K.js → use-navigate-to-agent-8ajznGe2.js} +1 -1
- package/dist/client/assets/{use-org-fs-D39JXIqn.js → use-org-fs-Bz2ywQpd.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CaKxuApg.js → use-org-repo-syncs-zcGBRnsE.js} +1 -1
- package/dist/client/assets/{use-org-sso-DHFjLEgz.js → use-org-sso-YfhiI7Na.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DNsCw29W.js → use-organization-settings-BRBR1fOm.js} +1 -1
- package/dist/client/assets/{use-project-scope-BDLA_MFt.js → use-project-scope-GFa4JvNG.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DiJWCjqp.js → use-recent-apps-CWh8PA7D.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DIEvib1u.js → use-reports-diagnostic-BrE3eDqC.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BFY14jyB.js → use-sandbox-events-68YztdQP.js} +1 -1
- package/dist/client/assets/{use-secrets-CCi4Nf5b.js → use-secrets-BhPSZQfa.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BDzVvnhP.js → use-section-preview-base-3lOa0tAM.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BUc8VCoH.js → use-sidebar-collapsed-CfApMrjn.js} +1 -1
- package/dist/client/assets/{use-tags-DVR6me46.js → use-tags-rAc8X0bx.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DN7o6q3R.js → use-task-board-analytics-BEP1IVqq.js} +1 -1
- package/dist/client/assets/{use-task-board-events-D0AhUaeo.js → use-task-board-events-BQOt8K6j.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-C8FVkZ-C.js → use-task-board-item-prs-Dpg9J2j_.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CdM5j7aW.js → use-task-board-items-rcG1gNIH.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-C-FdeWq2.js → use-task-board-prompts-OFKn7DUf.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CRegh7J_.js → use-task-metadata-PVdfMsAN.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-WXqq1m_V.js → use-thread-outputs-B_TAH3sz.js} +1 -1
- package/dist/client/assets/{use-voice-input-8QaSlWvq.js → use-voice-input-Dx_WJHtm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v4D5ym6Y.js +1 -0
- package/dist/client/assets/{useQueries-ZkLHF4yp.js → useQueries-CR738UlN.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DOWp786v.js +1 -0
- package/dist/client/assets/{users-CmySmLhu.js → users-CMO3k4s-.js} +1 -1
- package/dist/client/assets/{utils-DJ4kGZR9.js → utils-Bbsz503j.js} +1 -1
- package/dist/client/assets/{variant-calendar-Dp3dcJps.js → variant-calendar-BHsjE51A.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Bg1xLD4H.js → variant-matcher-override-_Rve3iRZ.js} +1 -1
- package/dist/client/assets/{view-header-BT81K0Rv.js → view-header-C--lK37a.js} +1 -1
- package/dist/client/assets/{virtual-mcp-R0xcD8OP.js → virtual-mcp-CAdekzcm.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BBUNHexJ.js → watch-sse-pool-DhHWqGJ6.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/studio-modules/v1/html-swap.js +47 -36
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-D-w7piVd.js +0 -1
- package/dist/client/assets/agent-deck-sQICWvWi.js +0 -1
- package/dist/client/assets/agent-experiments-CYKGvEGA.js +0 -1
- package/dist/client/assets/agent-library-BHDQegTE.js +0 -1
- package/dist/client/assets/agent-library-file-CVUtuonJ.js +0 -1
- package/dist/client/assets/agent-overview-WvKNJRaS.js +0 -1
- package/dist/client/assets/agent-settings-CXIVbo4Q.js +0 -1
- package/dist/client/assets/agent-site-editor-code-C8pZNRHE.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CsMmLm8L.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-vjIMqLQd.js +0 -1
- package/dist/client/assets/agent-view-Doh3INR0.js +0 -1
- package/dist/client/assets/api-keys-Cbsqw06u.js +0 -1
- package/dist/client/assets/library-KpfW-byA.js +0 -1
- package/dist/client/assets/project-reports-ByPdonNL.js +0 -1
- package/dist/client/assets/project-tasks-Da5LxTaa.js +0 -1
- package/dist/client/assets/record-editor-CBUfhtyf.js +0 -1
- package/dist/client/assets/reports-BOoYfaIC.js +0 -1
- package/dist/client/assets/repositories-DHNSFbbH.js +0 -1
- package/dist/client/assets/route-D6Y4UL2U.js +0 -1
- package/dist/client/assets/settings-tab-DHUT_FZr.js +0 -1
- package/dist/client/assets/site-editor-CQZ_UVRr.js +0 -1
- package/dist/client/assets/tasks-Du9Lvkep.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CLDGXLQz.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DA_MqDc2.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CVYcell7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-kNSTEkih.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,cz as T,cv as ce,j as b,cB as _,cO as ae,eo as O,cC as C,cI as P,cD as ie,c as F,m as $}from"./index-B8UywZZm.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,v]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,D]=d.useState(0),[j,y]=d.useState(!1),[N,W]=d.useState(!1),m=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:j,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:D,children:b.jsx(_.div,{dir:p,...s,ref:m,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=v(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=v(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=v(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(me,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),me=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[ve,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=v(g,o),[w,A]=d.useState(null),Y=T(e,m=>A(m)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,D=l.content-l.viewport,j=P(i),y=P(c),N=X(h,10);function W(m){if(x.current){const p=m.clientX-x.current.left,R=m.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const m=p=>{const R=p.target;w?.contains(R)&&j(p,D)};return document.addEventListener("wheel",m,{passive:!1}),()=>document.removeEventListener("wheel",m,{passive:!1})},[M,w,D,j]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(ve,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,m=>{m.button===0&&(m.target.setPointerCapture(m.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(m))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=v(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=v(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=v(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] transition-[color,box-shadow] focus-ring",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,cz as T,cv as ce,j as b,cB as _,cO as ae,eo as O,cC as C,cI as P,cD as ie,c as F,m as $}from"./index-ucJDxPyE.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,v]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,D]=d.useState(0),[j,y]=d.useState(!1),[N,W]=d.useState(!1),m=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:j,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:D,children:b.jsx(_.div,{dir:p,...s,ref:m,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=v(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=v(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=v(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=v(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(me,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),me=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=v(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[ve,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=v(g,o),[w,A]=d.useState(null),Y=T(e,m=>A(m)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,D=l.content-l.viewport,j=P(i),y=P(c),N=X(h,10);function W(m){if(x.current){const p=m.clientX-x.current.left,R=m.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const m=p=>{const R=p.target;w?.contains(R)&&j(p,D)};return document.addEventListener("wheel",m,{passive:!1}),()=>document.removeEventListener("wheel",m,{passive:!1})},[M,w,D,j]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(ve,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,m=>{m.button===0&&(m.target.setPointerCapture(m.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(m))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=v(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=v(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=v(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] transition-[color,box-shadow] focus-ring",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as a,cp as j,h as I,cq as S,cr as g}from"./index-
|
|
1
|
+
import{c as f,j as a,cp as j,h as I,cq as S,cr as g}from"./index-ucJDxPyE.js";import{i as v}from"./SearchMd-BxQmfb5s.js";function y(x){const e=f.c(14),{value:o,onChange:l,placeholder:h,onKeyDown:c,className:i,isSearching:p,disabled:u}=x,m=h===void 0?"Search...":h;let s;e[0]!==p?(s=a.jsx(j,{className:"pr-0",children:p?a.jsx(I,{className:"size-4"}):a.jsx(v,{})}),e[0]=p,e[1]=s):s=e[1];let t;e[2]!==l?(t=d=>l(d.target.value),e[2]=l,e[3]=t):t=e[3];let n;e[4]!==u||e[5]!==c||e[6]!==m||e[7]!==t||e[8]!==o?(n=a.jsx(S,{type:"text",value:o,onChange:t,onKeyDown:c,placeholder:m,disabled:u}),e[4]=u,e[5]=c,e[6]=m,e[7]=t,e[8]=o,e[9]=n):n=e[9];let r;return e[10]!==i||e[11]!==s||e[12]!==n?(r=a.jsxs(g,{size:"sm",className:i,children:[s,n]}),e[10]=i,e[11]=s,e[12]=n,e[13]=r):r=e[13],r}export{y as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,m as B,j as a,b2 as M}from"./index-
|
|
1
|
+
import{c as K,r as C,m as B,j as a,b2 as M}from"./index-ucJDxPyE.js";import{i as I}from"./SearchMd-BxQmfb5s.js";import{I as O}from"./icon-button-nAmR0pUP.js";function G(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,_=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"outline",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const k=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==k?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground shadow-edge",k,j),e[4]=j,e[5]=k,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const y=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==y||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:y,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=y,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==_||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":_,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=_,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{G as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,ax as d,b as j,j as i}from"./index-
|
|
1
|
+
import{c as x,ax as d,b as j,j as i}from"./index-ucJDxPyE.js";import{t as E}from"./Users01-C0dAo1hK.js";const R=/^[A-Za-z0-9_.-]+$/;function b(f){const e=x.c(15),{field:p,secretById:t}=f,s=j(),n=p.value||"";if(!n)return null;let l;e[0]!==n||e[1]!==t?(l=t.get(n),e[0]=n,e[1]=t,e[2]=l):l=e[2];const c=l;if(!c){let a;e[3]!==n||e[4]!==s?(a=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5];let u;return e[6]!==a?(u=i.jsx("span",{className:"text-destructive",children:a}),e[6]=a,e[7]=u):u=e[7],u}let o;e[8]!==c.scope?(o=i.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=i.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=i.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(f){const e=x.c(2),{scope:p}=f,t=p==="user"?d:E;let s;return e[0]!==t?(s=i.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{b as S,R as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as N,j as s,n as C,hk as k,R as F,r as y,bB as B,B as D,ax as L,ag as E,D as O,v as R,w as A,x as I,aT as q,I as _,y as V,t as z,g2 as H}from"./index-
|
|
1
|
+
import{c as j,b as N,j as s,n as C,hk as k,R as F,r as y,bB as B,B as D,ax as L,ag as E,D as O,v as R,w as A,x as I,aT as q,I as _,y as V,t as z,g2 as H}from"./index-ucJDxPyE.js";import{i as G}from"./AlertCircle-4XjOBzzr.js";import{s as J}from"./Plus-Cq9NYyX9.js";import{t as K}from"./Users01-C0dAo1hK.js";import{E as M}from"./empty-state-CgDxl1cN.js";import{L as w}from"./label-CxjTL0R_.js";import{S as Q,b as U,a as W,d as X,c as P}from"./select-MFmOiD7V.js";import{T as Y}from"./textarea-BA6pOE5t.js";import{u as Z,a as ee}from"./use-secrets-BhPSZQfa.js";import{R as te}from"./require-capability-DmJgWdQR.js";import"./index-BdQq_4o_.js";import"./index-oG6UN7--.js";import"./ChevronUp-BvHbQNBW.js";import"./access-gate-KNoXvQR4.js";import"./capability-load-error-D91RsAwR.js";function se(t){const e=j.c(6),{error:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(G,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function re(t){const e=j.c(8),{scope:r}=t,i=N(),c=r==="user"?L:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let m;e[10]!==l||e[11]!==a?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let u;e[15]!==d?(u=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=u):u=e[16];let x;return e[17]!==m||e[18]!==u?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=x):x=e[19],x}function ne(t){const e=j.c(9),{action:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(E,{}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==i?(l=i("settings.secrets.emptyDescription"),e[3]=i,e[4]=l):l=e[4];let a;return e[5]!==r||e[6]!==n||e[7]!==l?(a=s.jsx(H,{children:s.jsx(M,{size:"inline",icon:c,title:n,description:l,children:r})}),e[5]=r,e[6]=n,e[7]=l,e[8]=a):a=e[8],a}function T({open:t,onOpenChange:e}){const r=N(),[i,c]=y.useState("organization"),[n,l]=y.useState(""),[a,m]=y.useState(""),[d,u]=y.useState(""),x=ee();function g(){c("organization"),l(""),m(""),u("")}function p(){g(),e(!1)}async function S(o){if(o.preventDefault(),!(!n.trim()||!a))try{await x.mutateAsync({scope:i,name:n.trim(),value:a,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:o=>{o?e(o):p()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(Q,{value:i,onValueChange:o=>c(o),children:[s.jsx(U,{id:"secret-scope",children:s.jsx(W,{})}),s.jsxs(X,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(_,{id:"secret-name",value:n,onChange:o=>l(o.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(_,{id:"secret-value",type:"password",value:a,onChange:o=>m(o.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Y,{id:"secret-description",value:d,onChange:o=>u(o.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!a,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=j.c(34),e=N(),r=Z(),[i,c]=y.useState(!1);let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),l=s.jsx(J,{size:14}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let a;t[2]!==e?(a=e("settings.secrets.newSecret"),t[2]=e,t[3]=a):a=t[3];let m;t[4]!==a?(m=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[l,a]})}),t[4]=a,t[5]=m):m=t[5];const d=m;if(r.length===0){let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ne,{action:!1}),t[6]=o):o=t[6];let f;t[7]!==i?(f=s.jsx(T,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,o,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let u,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const o=r.filter(oe),f=r.filter(ae),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let b;t[18]!==r.length||t[19]!==e||t[20]!==h?(b=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=b):b=t[21];let v;t[22]!==b?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),t[22]=b,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=u):u=t[26],x=o.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:o.map(le)})]}):null,g=f.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ce)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=u,t[16]=x,t[17]=g}else u=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(T,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let S;return t[29]!==u||t[30]!==x||t[31]!==g||t[32]!==p?(S=s.jsxs(s.Fragment,{children:[u,x,g,p]}),t[29]=u,t[30]=x,t[31]=g,t[32]=p,t[33]=S):S=t[33],S}function ce(t){return s.jsx($,{secret:t},t.id)}function le(t){return s.jsx($,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function me(){const t=j.c(7),e=N();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:de,children:s.jsx(y.Suspense,{fallback:s.jsx(B,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(k,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function de(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function _e(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(me,{})}),t[0]=e):e=t[0],e}export{_e as default};
|
package/dist/client/assets/{section-array-field-DAQuFQGC.js → section-array-field-DJyNG6r7.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bA as g,c5 as E,fz as w,fd as L,fA as A,bF as y,bL as d,bX as D,fB as P,bE as T,bV as k,bC as j,bW as B,fC as R,b7 as C,bR as x,bY as K}from"./index-
|
|
1
|
+
import{bA as g,c5 as E,fz as w,fd as L,fA as A,bF as y,bL as d,bX as D,fB as P,bE as T,bV as k,bC as j,bW as B,fC as R,b7 as C,bR as x,bY as K}from"./index-ucJDxPyE.js";import{D as I,r as F,A as W,Y as U,ad as Y}from"./blocks-tab-states-CERDbw5g.js";const l="https://docs.decocms.com/storefront/blocks",ne={quickstart:`${l}/next/quickstart`,siteEditor:`${l}/next/site-editor#edit-on-your-machine`,serve:`${l}/next/cli#deco-serve`,schema:`${l}/next/cli#deco-schema-and-deco-content`,troubleshooting:`${l}/next/troubleshooting#site-editor`},ae="https://github.com/decocms/blocks/tree/main/.agents/skills/deco-site-workflow";function $(e){return e.includes("matchers")||e.includes("Match")}function m(e,r){const t=e.__resolveType;return typeof t!="string"||!t||U(t,r)?!1:r?w(r,t):$(t)}function oe(e,r){const t=[];for(const[n,a]of Object.entries(r)){if(n.includes("/")||!g(n,e)||E(n)||!a||typeof a!="object"||Array.isArray(a))continue;const o=a;m(o,e)&&t.push({blockKey:n,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return t.sort((n,a)=>(n.name??n.blockKey).localeCompare(a.name??a.blockKey))}function p(e,r,t){if(!e)return!1;const n=e.__resolveType;if(typeof n!="string"||!g(n,t)||!Object.hasOwn(r,n))return!1;const a=r[n];return!a||typeof a!="object"||Array.isArray(a)?!1:m(a,t)}function se(e,r,t){return p(e,r,t)?e?.__resolveType??null:null}function V(e,r,t){if(!e)return null;const n=e.__resolveType??"";if(!n)return null;if(p(e,r,t)){const s=r[n]??{},i=s.__resolveType??n,{__resolveType:c,name:u,...v}=s;return{resolveType:i,data:v,blockKey:n}}const{__resolveType:a,...o}=e;return{resolveType:n,data:o}}function q(e,r,t){const n=V(e,r,t);return n?{__resolveType:n.resolveType,...n.data}:{__resolveType:""}}function ie(e,r,t){if(e)return p(e,r,t)?q(e,r,t):e}function z(e,r,t,n){if(!e)return"Default";if(p(e,r,n)){const a=e.__resolveType??"",o=r[a];return I(a,o)}return t(e,F(r))}function ce(e,r,t){return{__resolveType:e,...r,name:t}}function ue(e){return{__resolveType:e}}function le(e,r,t){const n=V(e,r,t);return n?{resolveType:n.resolveType,formValue:n.data}:{resolveType:"",formValue:{}}}function fe(e,r){const t={__resolveType:e};if(!e||!r)return t;const n=W(e,r),a=n?.type==="inline-union"?n.inlineUnionBranches?.[0]?.discriminators:void 0;return a?{...t,...a}:t}function S(e){const r=[];for(let t=e;t?.key!=null;t=t.parent)r.push(t.key);return r.reverse()}function G(e){return{blockKey:e.blockKey,path:S(e)}}function N(e,r,t){const n=[];for(const[o,s]of Object.entries(e))o!==r&&n.push({node:s,blockKey:o,parent:null,key:null});const a=new Set;for(;n.length>0;){const o=n.pop(),{node:s}=o;if(!(!s||typeof s!="object")&&!a.has(s)){if(a.add(s),Array.isArray(s)){s.forEach((i,c)=>{n.push({node:i,blockKey:o.blockKey,parent:o,key:c})});continue}t(s,o);for(const[i,c]of Object.entries(s))n.push({node:c,blockKey:o.blockKey,parent:o,key:i})}}}function H(e,r,t){if(!r)return[];const n=[];return N(e,r,(a,o)=>{if(a.__resolveType!==r||!p(a,e,t))return;const s=X(o);n.push({...G(o),...s?{variant:s}:{}})}),n}function X(e){for(let r=e;r;r=r.parent){const t=r.parent,n=t?.parent,a=n?.parent;if(!t||!n||!a)return;if(r.key==="rule"&&typeof t.key=="number"&&n.key==="variants"&&Y(a.node)&&L(a.node.__resolveType)){const o=a.node.experiment;return{containerPath:S(a),containerType:a.node.__resolveType,index:t.key,...typeof o=="string"?{experiment:o}:{}}}}}function J(e){for(const r of e.anyOfRefs??[]){if(r.resolveType!==A&&r.resolveType!==y)continue;const t=r.schema?.properties?.variants?.items?.properties?.value,n=t?.lazy?t.properties?.value:t;if(n?.type==="array")return n}}function Q(e){return J(e)!==void 0}function ye(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return Array.isArray(t.variants)?t.__resolveType===R?!0:r&&t.__resolveType===y&&!M(t.variants):!1}function M(e){return e.some(r=>Array.isArray(d(r)))}function O(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return t.__resolveType===A?!0:r&&t.__resolveType===y&&Array.isArray(t.variants)&&M(t.variants)}function pe(e,r){if(!O(e,r))return null;const t=e.variants;if(!Array.isArray(t))return null;const n=C(t[0],r);return Array.isArray(n)?n:null}function ve(e,r,t,n){if(!O(e,n))return r;const a=structuredClone(e),o=[...a.variants??[]];return o.length===0?o.push({rule:k(t),value:T(a.__resolveType,r)}):o[0]=x(a.__resolveType,o[0],r),{...a,variants:o}}function de(e,r){const n=e[r]?.sections;if(!n||Array.isArray(n))return 1;const a=n;return Array.isArray(a.variants)?a.variants.length:1}function _e(e,r,t){const a=e[r]?.sections;if(Array.isArray(a))return t===0?a:[];if(a&&typeof a=="object"){const o=a.variants;if(Array.isArray(o)){const s=d(o[t]);return Array.isArray(s)?s:[]}}return[]}function be(e,r,t){if(Array.isArray(e))return[{label:"Default",sections:e}];if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.variants)){const a=n.variants,o=P(a.map(s=>z(s.rule,r,t)));return a.map((s,i)=>{const c=o[i],u=d(s);return{label:c||`Variant ${i+1}`,sections:Array.isArray(u)?u:[],rule:s.rule}})}}return[]}function _(e,r,t){return{rule:k(r),value:T(t,e)}}function b(e,r){return e?e.__resolveType===y?y:A:j(r)}function f(e,r,t){return{...r,__resolveType:b(r,t),variants:e}}function he(e,r,t,n=!1){const a=structuredClone(r);if(e&&typeof e=="object"&&!Array.isArray(e)){const c=e;if(!Array.isArray(c.variants))return null;const u=[...c.variants],v=D(u,n);return u.splice(v,0,_(a,t,b(c))),{sections:f(u,c),newVariantIndex:v}}const o=b(void 0,t),s=_(Array.isArray(e)?e:[],t,o),i=_(a,t,o);return{sections:f(n?[i,s]:[s,i],void 0,t),newVariantIndex:n?0:1}}function Ae(e,r,t=!1){const n=e[r];if(!n)return null;const a=[...e];return a.splice(K(e,r,t),0,structuredClone(n)),a}function ge(e,r){if(r.length===0)return f([],e);if(r.length===1){const t=r[0],n=t?.rule;if(!B(n))return f(r,e);const a=d(t);if(Array.isArray(a))return a}return f(r,e)}function Z(e,r,t){return H(e,r,t).length}function Te(e,r,t,n){return n?!1:Z(e,r,t)===0}const ke={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}};function h(e){return e.includes("/sections/")||e.includes("multivariate/section")||e===R}function ee(e){if(e.anyOfRefs?.length)return e.anyOfRefs.some(t=>h(t.resolveType));const r=e.properties?.__resolveType;return r?.type==="block-ref"&&r.anyOfRefs?.length?r.anyOfRefs.some(t=>h(t.resolveType)):!1}function Re(e){return e.type!=="block-ref"||!e.anyOfRefs?.length?!1:e.anyOfRefs.some(r=>h(r.resolveType))}function me(e,r){if(r==="global"||r==="sections"||Q(e))return!0;const t=e.type==="array"?e.items:void 0;return t?ee(t):!1}export{Te as A,Ae as B,ke as C,ae as D,de as a,he as b,me as c,q as d,ue as e,Re as f,_e as g,z as h,Q as i,se as j,le as k,oe as l,p as m,ce as n,ye as o,be as p,O as q,ie as r,fe as s,J as t,pe as u,ne as v,ve as w,h as x,V as y,ge as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aU as i,T as e,l as s}from"./agent-icon-
|
|
1
|
+
import{aU as i,T as e,l as s}from"./agent-icon-DGjvzBU0.js";import{c6 as n}from"./index-ucJDxPyE.js";import{a as o}from"./UserSquare-DLTddIeU.js";const r=["general","views","connections","repository","site"],a={general:{icon:s,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},views:{icon:o,titleKey:"virtualMcp.settings.views.title",descriptionKey:"virtualMcp.settings.views.description"},connections:{icon:i,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},repository:{icon:n,titleKey:"virtualMcp.settings.repository.title",descriptionKey:"virtualMcp.settings.repository.description"},site:{icon:e,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function g(t){return!!t&&r.includes(t)}export{a as P,r as a,g as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i2 as Xo,bf as ei,c as wn,b as Rn,r as b,m as ie,j as r,bQ as ti,b8 as As,i3 as Ba,B as It,Y as an,au as ni,_ as si,be as ri,Z as ai,q as oi,hA as ii,i4 as li,i5 as ci,h as ui,bg as wt,i6 as Jr,i7 as ys,i8 as di,i9 as pt,ia as Yr,ib as fi,bt as mi,ic as pi,id as Qr,ie as hi,t as H,bZ as Zr,ig as gi,ih as Bt,ii as vi,ij as yi,ik as Si,bY as Xr,il as Ss,im as bi,io as xi,ip as _i,bW as ki,bu as wi,iq as Ri,ir as ji,bT as Ei,K as Vi,is as ea,fc as Ti,bm as $n,br as ta,it as na,iu as Ai,iv as Ni,iw as Ci,ix as bs,iy as Pi,iz as Bi,iA as Ki,iB as sa,iC as Di,iD as Mi,bR as ra,iE as Fi,iF as Ii,iG as Li,bV as Oi}from"./index-B8UywZZm.js";import{u as zi}from"./chat-context-DGlvTnKl.js";import{a5 as $i,O as Qn,a6 as Wi,a7 as Hi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as aa,ad as Yi,ae as Qi,A as Gn,y as Un,d as Zi,u as Xi,af as oa,i as el,ag as tl,k as nl,h as sl,ah as Ka,p as kn,ai as rl,aj as al,w as ia,ak as ol,al as il,am as Wn,an as la,ao as ca,ap as ua,aq as xs,ar as ll,F as cl,as as ul,z as dl,at as da,au as fl,av as fa,aw as ma,ax as pa,M as ml,ay as ha,a as pl,az as on,aA as hl,aB as gl,v as Hn,a4 as xn}from"./parse-sections-CWxm7mRm.js";import{b as vl}from"./repository-binding-DtOS-5pr.js";import{n as yl,t as Sl}from"./ChevronUp-BtMiI6cM.js";import{a7 as Da,b as Yn,am as bl,e as xl,E as _l,a1 as ga,Y as va}from"./agent-icon-Bw6QCyEx.js";import{S as ln}from"./scroll-area-C4JxE3Sd.js";import{c as Rt,T as jt,a as Et}from"./tooltip-CSjs8EXx.js";import{l as kl,u as wl,m as Rl,U as jl,ai as El,S as Vl,F as ya,aX as Sa,as as Kt,at as Dt,a4 as Tl,aY as Al,aZ as Nl,aT as ba,a7 as Cl,ae as Pl}from"./site-editor-toast-BU0n_ImS.js";import{u as Bl,ao as xa,e as _a,j as Kl,D as Dl,A as qn,a3 as Ml,ae as Fl,ag as Il}from"./blocks-tab-states-DTS9heYD.js";import{m as Ll,u as Ol,P as zl}from"./mustache-ezjY74jH.js";import{a as Rs,e as Ma}from"./UserSquare-DRzDrNWv.js";import{i as ka,s as wa}from"./Tool01-Dhj9-e2p.js";import{s as $l}from"./Plus-DTA_qyzr.js";import{s as Wl}from"./Trash01-DlPuy4hk.js";import{i as js}from"./Zap-CSm2QafG.js";import{u as Hl,a as Ra,K as ql,P as Gl,b as Ul,C as Jl,D as Yl,c as Ql}from"./core.esm-BMG4ioMU.js";import{u as Zl,s as Xl,a as Jn,S as ec,v as tc}from"./sortable.esm-DcEMfWKZ.js";import{s as nc,g as sc,u as rc,A as ac}from"./use-section-preview-base-BDzVvnhP.js";import{u as oc,a as ic,P as ja,w as lc,b as cc}from"./seo-editor-Ckanf0Y7.js";import{R as uc,y as _s,T as Ea,x as dc,U as fc}from"./hosted-reconcile-C-wcyta_.js";import{u as mc}from"./use-apply-named-rule-CI1WcDAo.js";import{m as Jt,d as Es,y as Vs,n as Ft,e as cn,q as pc,k as Ut,r as ks,j as Mt,h as _n,b as hc,s as Va,z as gc,A as vc,B as yc}from"./section-array-field-DAQuFQGC.js";import{b as Ta,a as Sc}from"./variant-matcher-override-Bg1xLD4H.js";import"./autosend-CLDsiYES.js";import"./thread-route-BYTJQqVq.js";import"./use-project-scope-BDLA_MFt.js";import"./thread-intent-CWn1HmtU.js";import"./use-mcp-client-IDMULkw-.js";import"./auth-DsiBBvOi.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-BBUNHexJ.js";import"./task-board-BEneHA34.js";import"./schema-BeGOWHqJ.js";import"./use-entitlements-DRzAxQMt.js";import"./use-ai-providers-BvE5F9lZ.js";import"./use-decopilot-events-B4_GF30e.js";import"./use-organization-settings-DNsCw29W.js";import"./utils-DJ4kGZR9.js";import"./Play-B9kSRU73.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-xiFs456g.js";import"./LinkBroken01-ClWYoOJF.js";import"./collapsible-BUfI2uMB.js";import"./use-copy-pqG4JWZ9.js";import"./usage-stats-QKrG0Chq.js";import"./tool-namespace-Bj1cvBDc.js";import"./form-BBNzwOZG.js";import"./label-bffvb9RR.js";import"./utils-CVEq3hMx.js";import"./markdown-C594pPG2.js";import"./use-mobile-C9EJZpJe.js";import"./shell-layout-DLOpHw0Q.js";import"./Globe04-DE5hlmxS.js";import"./use-deployment-admin-CWBM5pU4.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BPpAzkjm.js";import"./CheckCircle-TpvuszDI.js";import"./Monitor01-Dy43NIcG.js";import"./command-gJAHYCw0.js";import"./index-CNvZmowt.js";import"./SearchMd-DODrmRDH.js";import"./integration-icon-DXRPTOXy.js";import"./project-icon-BYuH9rQ-.js";import"./use-navigate-to-agent-CnITDZ1K.js";import"./new-project-dialog-C8Uv8Lu7.js";import"./ArrowLeft-0eZGIs9d.js";import"./repository-picker-BkanTJ3i.js";import"./github-icon-Caf_vA32.js";import"./useInfiniteQuery-CVYcell7.js";import"./infiniteQueryObserver-BGhionND.js";import"./collection-search-CX3zyrl-.js";import"./ShoppingBag01-CK3v09in.js";import"./use-debounced-value-DZeaw_xf.js";import"./required-auth-layout-FfGW_C4w.js";import"./use-org-sso-DHFjLEgz.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BgKMzsSF.js";import"./types-Cr7M9oTi.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-77Slg1mo.js";import"./sheet-DSOCEYQs.js";import"./use-connection-Cbht658s.js";import"./use-mcp-prompts-DdK4Oz96.js";import"./use-thread-outputs-WXqq1m_V.js";import"./file-type-icon-aib86xB6.js";import"./switch-DhJh_HPi.js";import"./textarea-DB65Cb4P.js";import"./ChevronSelectorVertical-C6Gq0VMA.js";import"./popover-Bcm8q-UM.js";import"./monaco-editor-Cp-Ik4oF.js";import"./editor-C31TESmA.js";import"./calendar-DyqOJ3Yl.js";import"./SwitchHorizontal01-DFMegDqF.js";import"./Minus-Dqs0K-y6.js";import"./select-74xFBRwJ.js";import"./index-BdQq_4o_.js";import"./index-CGPEL67z.js";import"./editor-classes-Cf4dLWq3.js";import"./toggle-group-C49gUsJz.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CfLj8nnB.js";import"./Upload01-B7_UtIIy.js";import"./search-input-CqVCmKRX.js";import"./tabs-ChqaRicq.js";import"./use-file-configs-Cbnx7meP.js";import"./asset-utils-7GGOgR3V.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-8QaSlWvq.js";import"./drawer-7PMhL6c9.js";import"./index-qZbv6YO4.js";import"./checkbox-BicdYBus.js";import"./Key01-BEX3raxr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-D3pp3g8x.js";import"./CreditCard01-5X4JuL9P.js";import"./Sun-BirMDMzO.js";import"./Users01-D2MH6X4i.js";import"./use-blocks-v8-project-DA_MqDc2.js";import"./use-sandbox-events-BFY14jyB.js";import"./empty-state-CkiFzdzZ.js";import"./slider-COhKeoXK.js";import"./index-BXDjwwPk.js";import"./tooltipContext-D6EVwPYC.js";import"./CategoricalChart-D-0Fq-ih.js";import"./index-rV6-HlJv.js";import"./use-move-blocks-RdGjZI5s.js";const bc={escape:$i};function xc(v,e){for(const p of nc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function _c(v,e){if(!e)return;const p=Xo(v,ei(e));if(p)try{const S=xc(p.resolveType,e);return S&&Ll.render(S,p.data,{},bc).trim()||void 0}catch{return}}function kc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=ie("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const wc="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 Aa(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Fa(v){return v.map((e,p)=>({...e,index:p}))}function Rc(v,e){if(e===v.length)return v;if(e<v.length)return Fa(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Ia(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Qn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?sc(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?_c(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Ji(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&As(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Yn:k?Da:Ma;let G;e[16]!==k||e[17]!==P?(G=P?{color:ri}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?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(Qi,{"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(bl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=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 d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Rs,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=ie("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(kc,{icon:js,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(aa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(aa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const jc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ec="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 La(v,e,p){if(p)return Yi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return ie("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":S?jc:x?Ec:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(v,e){return ie("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 Vc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Qn(),xe=S?As(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Ba(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Nc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Jl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=Hi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=ie("touch-none transition-colors",Xe,La(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(Ia,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ie(ws(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Ac,children:r.jsx(js,{className:ie("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(qi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ie(ws(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Tc,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=si,Qe=Gi;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=ie(ws(_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 $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(js,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ni,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(xl,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(an,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:ie(!c&&Ui),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Da,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:ie(!c&&wc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Yn,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Ma,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Wl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==We||e[65]!==De?($=r.jsxs(an,{variant:"destructive",onClick:We,children:[et,De]}),e[64]=We,e[65]=De,e[66]=$):$=e[66];let oe;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(oe=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=oe):oe=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==oe?(Ve=r.jsxs(de,{children:[$e,oe]}),e[74]=de,e[75]=$e,e[76]=oe,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,W,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Ye,e[85]=W,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Tc(v){return v.stopPropagation()}function Ac(v){return v.stopPropagation()}function Nc(){return!1}function Ts(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=ie("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx($l,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Cc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Qn();let ke;e[0]!==x.length?(ke=()=>Aa(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Aa(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Rc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Xl},e[3]=g):g=e[3];const we=Hl(Ra(Gl,ue),Ra(ql,g));let rt;e[4]!==d?(rt=d.map(Pc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==at||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Fa(Jn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=at,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const W=Ye;let ot,de,Qe,ve,it,$e,Be,Ke,se,Y,ee,K,T,fe,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=ie(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Yl,Ke=we,se=Ql,Y=L,ee=A,K=W,ot=ec,$e=at,Be=tc,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Vc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=We}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],We=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let De;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:ie("cursor-grabbing shadow-lift",La(ve,!1,I)),children:r.jsx(Ia,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let oe;e[82]!==$?(oe=ti.createPortal(r.jsx(Ul,{dropAnimation:Wi,children:$}),document.body),e[82]=$,e[83]=oe):oe=e[83];let Ve;e[84]!==de||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==K||e[90]!==De||e[91]!==oe?(Ve=r.jsxs(de,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:K,children:[De,oe]}),e[84]=de,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=K,e[90]=De,e[91]=oe,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Pc(v){return v.id}function Bc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Es(v,p,S)}:{kind:"noop"};const V=Vs(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Gn(x),_=Un(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Na="section-form-stale-save",Kc=3;function Ca(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Pa=new WeakMap;let Dc=0;function Mc(v){let e=Pa.get(v);return e===void 0&&(e=++Dc,Pa.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=zi(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=kl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Bl(_e),X=Qn(),ze=xe?.virtualMcpId,Pe=vl(ze===e?e:null)?.metadata?.siteSlug??null,st=rc({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=wl(e,p),g=Rl(ue),we=Ei(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Ye,W]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[We,et]=b.useState(K.length);We!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[De,$]=b.useState(0),[oe,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Oa]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(Z),[Ns,Cs]=b.useState(Z);Z&&!Ns&&(Cs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ns&&Cs(!1);const[za,dn]=b.useState(null),[Ps,An]=b.useState(void 0),[Bs,Ot]=b.useState([]),[Ks,Qt]=b.useState(0),[Me,lt]=b.useState(0),[$a,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Ds,Ms]=b.useState(null),Fs=oi(),Is=jl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Wa,Ha]=b.useState(V),[qa,Ga]=b.useState(C),[Ua,Ja]=b.useState(_);(Wa!==V||qa!==C||Ua!==_)&&(queueMicrotask(()=>fn.flush()),Ha(V),Ga(C),Ja(_),L(null),A(null),W(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const D=Xi({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Nn=Ol({orgSlug:v,virtualMcpId:e,branch:p}),Ls=mc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Cn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),Zn=b.useRef(new WeakSet);El(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Cn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Ya,Qa]=b.useState(0),$s=ii(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=li($s,I[0]?.blockKey??null,ci(d,I[0]?.blockKey??null)),[Za,Xa]=b.useState(null),Xn=Vl(v,e).epoch,[eo,to]=b.useState(Xn);oc(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?xa(_a(d,u),V,C)?.key??null:null),es=ya({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,no]=b.useState(!1),ts=ya({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ts.ready,failed:ts.failed,retry:ts.retry,request:()=>no(!0)};if(es.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:es.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!es.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ui,{className:"size-5 text-muted-foreground"})});if(!d||!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 so=_a(d,u),q=!!_,ae=q?null:xa(so,V,C),y=q?_:ae?.key??null,ns=q&&_?d[_]:void 0,Us=q&&_&&ns?Dl(_,ns):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,ss=Re&&d&&u&&y&&ae?oa(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ro=Re?nn?.seo:void 0,Pn=Ps!==void 0?Ps:ro,ao=Re?el(Pn):void 0,Js=ss?.seoTypeOptions??[],Ys=Re&&u?tl(u):"",rs=za??ao??{},Bn=Re&&ss?ic(rs,ss):null,Qs=Re&&Bn&&nl(Pn)?qn(Bn,u):null,Zs=Re?sl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Kn=!q&&pc(nn?.sections,g);if(q&&_&&Ds!==_){Ms(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Ds!==null&&Ms(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const oo=()=>({multivariate:Kn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Kn&&Ti(nn?.sections?.variants?.[te]?.value)}),as=(t,n)=>{if(!w)return;if(!y||!Kn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?Sa(y,s):Ta(y,s,d,u);w(a.length>0?a:null)},os=w&&y&&Kn&&yt&&!Oe&&!Ee?y:null;if(os!==Za&&(Xa(os),os)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>as(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=oo(),o=g?Sa(y,a):Ta(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Al(i):Sc({...i,decofile:d,meta:u}),f=g?Nl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=pi(f.value,d);A(j?.data??null),W(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},is=t=>{F(null),de(t),L(null),A(null),W(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),as(me.map(o=>({rule:o.rule})),t)},io=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Xs=="number"&&io(Xs,0)),Xn!==eo){to(Xn);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||D.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),W(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Ya){Qa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Ca(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?ys(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=di(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Dn=Ye&&u?qn(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);D.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),ls=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Na}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Pl(Fs,Is,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},lo=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Dn}},vn=t=>{ct.current=t,ke(t)},co=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Fi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||$n(a.plan.theirs)!==$n(t.plan.theirs)}):[...n,{...t,changedAgain:Zn.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if($n(o.plan.mine)===$n(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},uo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},fo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},mo=()=>{const t=ct.current[0],n=fo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=wi(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&Ri(n.plan,n.choices)&&Tl(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,Zn.current.add(a),(zt.current===a||uo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},po=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??lo(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const B=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,B))return;const ne=re.current.decofile,{rawSections:U,parsedSections:Ne,pageVariants:J,variantIndex:be}=Ca(ne,i,g),Ie=i.pageKey,he=U[n];if(!he)return;const le=Ne[n];if(!le)return;const Ge=f?.base,Ze=ys(he,le,l,ne,g),Nt=!!Ge&&!!Ze&&Ai(Ge,Ze)&&!(f&&Qr(f,Ze));if(Nt&&Ge&&Ze){if(Ni(Ge,Ze)){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Q=le.isSavedBlock?"here":Ci(Ge,U.map((ce,mt)=>ys(ce,Ne[mt],l,ne,g)),n,f?.sectionCount??U.length);if(Q==="unknown"){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Q=="number"&&f){f.sectionCount=U.length,f.sectionIndex=Q,zt.current===f&&L(Q),yn(B,Q,s,i);return}}const Ct=Nt&&Ge&&Ze?ta({ancestor:Ge,mine:B,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=U.length,co({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Pi(Ct),changedAgain:!1,blockKey:le.isSavedBlock?bs(he,le):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??B,qr=Bi({merged:!!Pt,tracked:f,current:zt.current,saved:B});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Na}),qr&&f&&(f.emitted=Pt,A(Pt));const vs=qr||!Pt?rn:B;f&&(f.base=vs,f.sectionCount=U.length,Ki(f,vs));const Gr={onSuccess:()=>{f&&Zn.current.delete(f),k?.()},onError:Q=>{if(f?.base===vs&&Ge&&(f.base=Ge),Q instanceof Cl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const ce=Ii(s,Q.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:B},n,s+1,i,ce.immediate),ye.current.delete(R),ar(xn(g))},ce.delay)}else ls();return}D.reportError(Q)}},Ur=Q=>{pn.current=!0;let ce=!1;D.mutateAsync(Q).then(()=>Gr.onSuccess(),mt=>{ce=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(ce?xn(g):0),tr()})};if(le.isSavedBlock){const Q=bs(he,le);if(!Q)return;Ur({blockKey:Q,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,...sr?{copy:{value:ne[Q]}}:{}})});return}if(!Ie)return;const zn={...ne[Ie]},Gt=[...U];if(le.isMultivariate){const Q=pt(he,le);if(!Q||!Ie)return;const ce=Mi(Q,l,rn);Gt[n]=Bt(he,le,ce)}else if(le.isHidden){const Q=As(he.__resolveType),ce=Q?{...he.section}:{...he},mt=Array.isArray(ce.variants)?[...ce.variants]:[];mt[0]&&(mt[0]=ra(ce.__resolveType,mt[0],rn)),ce.variants=mt,Q?Gt[n]={...he,section:ce}:Gt[n]=ce}else le.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(J.length>1){const Q=zn.sections,ce=[...Q?.variants??[]];ce[be]&&(ce[be]=ra(Q?.__resolveType,ce[be],Gt)),zn.sections={...Q,variants:ce}}else zn.sections=Gt;Ur({blockKey:Ie,data:zn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ho=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),W(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=ji(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},cs=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=oa(d,n,u);s&&fn.save(y,()=>{const a=Fs.getQueryData(Vi.decofile(Is))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Cn.current};return Cn.current={},t?.raw!==void 0?lc(o,t.raw,u):t?.inner!==void 0?cc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Cn.current[t]=n,cs())},go=(t,n)=>{if(!y)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},vo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},yo=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},So=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?xi(n,g):_i(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Wt(),dt(o)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=bi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Wt(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},_o=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Wt()}}),He(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,He(!0)},ko=t=>{const n=jn.current;if(!n){_o(t);return}n({__resolveType:t.resolveType}),He(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},wo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=yi(a,t);if(!o){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Xr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},jo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=gi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=hi(s,a,void 0,u,g);if(!o){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=vi(t,n,s);if(!a){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(o)},Eo=async t=>{if(oe===null||!y)return;const n=Un(t,d,u);if(n){H.error(n);return}const s=M[oe],a=pe[oe];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[oe]={__resolveType:t},await D.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===oe&&Wt(),Ve(null),Hn(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?rl(u):[],us=u&&d?al(u,d):[],Ht=g&&u&&d?uc(u,d):[],ds=(t,n)=>{if(Ht.length===0)return;const s=Ml(t);return{kinds:Ht,selected:s,campaignPrefill:dc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(vc(n,t,u,g))try{await Nn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:B,...z}=t;D.mutate({blockKey:h,data:Ft(B??"",z,E)},{onSuccess:()=>k?.(),onError:D.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Va(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},Mn=async(t,n,s)=>{const a=fc(n,t);if(!a.ok)return a.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ba),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 Ls.apply({writes:o})).ok?null:(a.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ba,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await Mn(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Fl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Il(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await Mn(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],B=E[a];return B?(E[a]={...B,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.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 f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:B,formValue:z}=Ut(R,E,u??void 0);ee(B),se(z);try{await D.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const J=z?.__resolveType??"",be=i[J],Ie=typeof be?.name=="string"?be.name:J,{__resolveType:he,...le}=t;D.mutate({blockKey:J,data:Ft(he??"",le,Ie)},{onSuccess:()=>k?.(),onError:D.reportError});return}const ne=Ss(E,s,t),U=[...a];U[n]=Bt(h,R,ne);const Ne=on(i,l,U,j,f);D.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g)))},Vo=t=>{qe(t);const n=t?Va(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},To=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Ao=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await Mn(t,i,B=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const U=pt(z,ne);if(!U)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,Ss(U,s,B)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=Mt(B[s]?.rule,i,u),ne=cn(t),U=Ss(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,U);const J=on(i,l,Ne,j,f),be={...i,[l]:J},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await D.mutateAsync({blockKey:l,data:J}),z&&z!==t&&await qt(z,be),k?.()}catch(le){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(le))})}};if(!q&&!ae)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(q&&!ns)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?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Fn=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Fn]??null,Tt=je?.isMultivariate===!0,fs=m!==null&&je!==null,At=fs&&(Tt||!!(Dn&&Xe)),Co=At&&!q&&je?.isSavedBlock===!0,ft=q||Co,wr=q?Us:je?.label??"",Po=Zt&&u?qn(Zt,u):null,Rr=(t,n)=>n&&X?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Bo=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),ms=Rr(ae?.name??"",yt?Se?.label:null),In=At&&(!q||K.length>0)?q?[Us,...K]:[ms,...Bo,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Bs]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[ms,jr,Vr]:[],Ln=Tr.length>0?Tr:Er.length>0?Er:ft?In.length>0?In:[wr]:In.length>0?In:[ms],Ar=fs&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Do=fs&&!Tt&&!q&&K.length===0&&!!je&&Ba(je)&&!!y,Mo=X&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=X&&K.length>0?ia(K[K.length-1]):null,Fo=K.length>1?ia(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Io=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Fo??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",ps=!Yt&&!Lt&&!Re&&!At&&!ft,Lo=!X&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=hc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:D.reportError})},On=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],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 f=gc(i,l),j={...d,[y]:{...a,sections:f}};D.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:D.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Jn(me.map(o=>({rule:o.rule})),t,n);as(a,s),On(o=>Jn(o,t,n))},Kr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);On(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},Oo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!ki(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);On(n=>{const s=Li({variants:n}),a=n[s];return a?[{...a,rule:Oi(u)}]:null},()=>{de(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;On(s=>(n=Xr(s,t,g),yc(s,t,g)),()=>{de(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},zo=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.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 f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const J=h.__resolveType??"";f[t]={...j,rule:Es(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await D.mutateAsync({blockKey:s,data:be[s]}),await qt(J,be),F(null),k?.();return}const E=Vs(h,a,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await D.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const B=Gn(R),z=Un(B,a,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,R);let U=null,Ne=!1;try{const J=await D.mutateAsync({blockKey:B,data:ne,create:!0});Ne=Hn(J),U=Ne?null:B,f[t]={...j,rule:cn(B)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),U=null}catch(J){throw U&&await Nn.mutateAsync({blockKey:U}).catch(()=>{}),J}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=B[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,U=n.trim();en(!0);const Ne=async J=>{const be={...E,variants:J},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!U){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...B];Nt[t]={...z,rule:Es(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const J=Vs(ne,i,u);if(!J){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(J.blockKey){await D.mutateAsync({blockKey:J.blockKey,data:Ft(J.resolveType,J.data,U)}),O(null),k?.();return}const be=Gn(U),Ie=Un(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(J.resolveType,J.data,U);let le=null,Ge=!1;try{const Ze=await D.mutateAsync({blockKey:be,data:he,create:!0});Ge=Hn(Ze),le=Ge?null:be;const Nt=[...B];Nt[t]={...z,rule:cn(be)},await Ne(Nt),le=null}catch(Ze){throw le&&await Nn.mutateAsync({blockKey:le}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),k?.()}catch(J){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(J))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Wo={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Bc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){H.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 B=[...i];B[n]={...l,rule:h.inlinedRule};const z=await j(B);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const B=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Hn(B),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(B){throw R&&await Nn.mutateAsync({blockKey:R}).catch(()=>{}),B}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await Mn(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),cs({inner:t})},Lr=t=>{An(t),cs({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},Ho=()=>{Vn(!1),Tn(!1),L(null),un(!0)},qo=()=>{Re&&$r(),L(null),Vn(!0)},Go=()=>Tn(!0),hs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Bs.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},gs=Ln.length>1?r.jsx("button",{type:"button",onClick:()=>hs(gl(Ln.length,{isMultivariateSectionTop:Lo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ie("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(_l,{className:"size-4"})}):null,Uo=ft||At||Re?Ko&&r.jsxs("div",{className:ie("border-b px-3 py-2.5",ft&&"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:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:ie("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",il),children:[r.jsx(ol,{rule:ks(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(Wn,{onClick:()=>Sn()})]}),ft&&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(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Jo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(ua,{className:"mt-3",children:r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ll,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Fn,onSelect:ur,onRename:O,onDuplicate:Ro,onDelete:wo,onRemoveAll:dr,onReorder:jo,onAdd:()=>Sn()}),r.jsx(ua,{children:r.jsx(xs,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:Vo,onSelectGlobal:No,named:ds(kt?.rule,Ao),namedRow:_s(kt?.rule,Ht),rule:kt?.rule,schema:Po,formValue:$a,onChange:To,formKey:`${m??"none"}:${Fn}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:ie(X?"px-2":"p-2 pt-3"),children:r.jsx(Cc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ho(t),Je?.(t)},onReorder:go,onDelete:vo,onDuplicate:yo,onMakeReusable:Ve,onToggleHidden:So,onToggleLazy:rt?bo:void 0,onAddVariant:Sn,onDetach:xo,onAddSection:()=>He(!0),canAddSection:mr})}),Yo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Qo=r.jsx(ln,{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:nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:ie("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Oa(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(yl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(cl,{value:g,children:r.jsx(ul,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&gs&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:gs}),(X||Ln.length>1)&&r.jsx(dl,{crumbs:Ln,onSelect:hs,onSelectRoot:()=>{fn.flush(),Ue?Ue():hs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ie("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&gs,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{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:Io}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),ps&&yt&&Se&&r.jsx(da,{variants:me,activeIndex:te,onSelect:is,onManage:qo,onRemoveAll:Oo}),Mo&&r.jsx(da,{variants:Vt,activeIndex:Fn,onSelect:ur,onManage:Go,onRemoveAll:dr}),ps&&!yt&&r.jsx(Wn,{onClick:bn}),Do&&r.jsx(Wn,{onClick:()=>Sn()}),r.jsx(fl,{}),ps&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Ho,children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Uo}),ut&&r.jsx(fi,{open:!0,fields:mi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>po({...ut.choices,[t]:n}),onApply:mo},Mc(ut.formBase)),Lt?r.jsx(fa,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&K.length===0&&Wr,r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Wo:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?X?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Yo})},"editor-seo"):Qo:Yt?r.jsx(fa,{onAdd:bn,children:Jo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ts,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Zo,r.jsx(ml,{open:oe!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:oe!==null?Gn(pe[oe]?.label??""):"",isPending:D.isPending,onSubmit:Eo}),at&&r.jsx(ac,{open:Ae,onOpenChange:t=>{He(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:ko}),ht&&y&&d&&r.jsx(zl,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ha,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(me[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await zo(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(ha,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $o(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{uf as SectionsEditor};
|
|
1
|
+
import{i2 as Xo,bf as ei,c as wn,b as Rn,r as b,m as ie,j as r,bQ as ti,b8 as As,i3 as Ba,B as It,Y as an,au as ni,_ as si,be as ri,Z as ai,q as oi,hA as ii,i4 as li,i5 as ci,h as ui,bg as wt,i6 as Jr,i7 as ys,i8 as di,i9 as pt,ia as Yr,ib as fi,bt as mi,ic as pi,id as Qr,ie as hi,t as H,bZ as Zr,ig as gi,ih as Bt,ii as vi,ij as yi,ik as Si,bY as Xr,il as Ss,im as bi,io as xi,ip as _i,bW as ki,bu as wi,iq as Ri,ir as ji,bT as Ei,K as Vi,is as ea,fc as Ti,bm as $n,br as ta,it as na,iu as Ai,iv as Ni,iw as Ci,ix as bs,iy as Pi,iz as Bi,iA as Ki,iB as sa,iC as Di,iD as Mi,bR as ra,iE as Fi,iF as Ii,iG as Li,bV as Oi}from"./index-ucJDxPyE.js";import{u as zi}from"./chat-context-DSkOndUS.js";import{a5 as $i,O as Qn,a6 as Wi,a7 as Hi,a8 as qi,a9 as Gi,aa as Ui,ab as Ji,ac as aa,ad as Yi,ae as Qi,A as Gn,y as Un,d as Zi,u as Xi,af as oa,i as el,ag as tl,k as nl,h as sl,ah as Ka,p as kn,ai as rl,aj as al,w as ia,ak as ol,al as il,am as Wn,an as la,ao as ca,ap as ua,aq as xs,ar as ll,F as cl,as as ul,z as dl,at as da,au as fl,av as fa,aw as ma,ax as pa,M as ml,ay as ha,a as pl,az as on,aA as hl,aB as gl,v as Hn,a4 as xn}from"./parse-sections-11L0xusW.js";import{b as vl}from"./repository-binding-BWkpkFiy.js";import{n as yl,t as Sl}from"./ChevronUp-BvHbQNBW.js";import{a7 as Da,b as Yn,am as bl,e as xl,E as _l,a1 as ga,Y as va}from"./agent-icon-DGjvzBU0.js";import{S as ln}from"./scroll-area-BEM410Qx.js";import{c as Rt,T as jt,a as Et}from"./tooltip-D_WhUD2W.js";import{l as kl,u as wl,m as Rl,U as jl,ai as El,S as Vl,F as ya,aX as Sa,as as Kt,at as Dt,a4 as Tl,aY as Al,aZ as Nl,aT as ba,a7 as Cl,ae as Pl}from"./site-editor-toast-6KgkdfPr.js";import{u as Bl,ao as xa,e as _a,j as Kl,D as Dl,A as qn,a3 as Ml,ae as Fl,ag as Il}from"./blocks-tab-states-CERDbw5g.js";import{m as Ll,u as Ol,P as zl}from"./mustache-FPu-BUlH.js";import{a as Rs,e as Ma}from"./UserSquare-DLTddIeU.js";import{i as ka,s as wa}from"./Tool01-BqhX4Lir.js";import{s as $l}from"./Plus-Cq9NYyX9.js";import{s as Wl}from"./Trash01-BsqfSoas.js";import{i as js}from"./Zap-CNah22BF.js";import{u as Hl,a as Ra,K as ql,P as Gl,b as Ul,C as Jl,D as Yl,c as Ql}from"./core.esm-CTG2N8v2.js";import{u as Zl,s as Xl,a as Jn,S as ec,v as tc}from"./sortable.esm-JloqmUYv.js";import{s as nc,g as sc,u as rc,A as ac}from"./use-section-preview-base-3lOa0tAM.js";import{u as oc,a as ic,P as ja,w as lc,b as cc}from"./seo-editor-C2CaIIDv.js";import{R as uc,y as _s,T as Ea,x as dc,U as fc}from"./hosted-reconcile-B_zakWIj.js";import{u as mc}from"./use-apply-named-rule-NujXCbVj.js";import{m as Jt,d as Es,y as Vs,n as Ft,e as cn,q as pc,k as Ut,r as ks,j as Mt,h as _n,b as hc,s as Va,z as gc,A as vc,B as yc}from"./section-array-field-DJyNG6r7.js";import{b as Ta,a as Sc}from"./variant-matcher-override-_Rve3iRZ.js";import"./autosend-BeP-7Z9T.js";import"./thread-route-jBbjjKNR.js";import"./use-project-scope-GFa4JvNG.js";import"./thread-intent-CI_dX-N0.js";import"./use-mcp-client-TeUnMSC4.js";import"./auth-D2Lcha9t.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-DhHWqGJ6.js";import"./task-board-BzsqXAQD.js";import"./schema-tSFLTBrW.js";import"./use-entitlements-CpaMfout.js";import"./use-ai-providers-CP8hIgY3.js";import"./use-decopilot-events-d_M9Hjhx.js";import"./use-organization-settings-BRBR1fOm.js";import"./utils-Bbsz503j.js";import"./Play-Bd4GTUnl.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-mfml6eLi.js";import"./LinkBroken01--Z9NHGsb.js";import"./collapsible-DRuNeeSr.js";import"./use-copy-Bs4XYM8b.js";import"./usage-stats-XRbUuNdg.js";import"./tool-namespace-DWzf9fHX.js";import"./form-xPNilXk8.js";import"./label-CxjTL0R_.js";import"./utils-CVEq3hMx.js";import"./markdown-Cs2UsOW2.js";import"./use-mobile-BbP62vju.js";import"./shell-layout-CMz_aZCA.js";import"./Globe04-Wakfx0G2.js";import"./use-deployment-admin-DbaoxO_S.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-BmPamPKb.js";import"./CheckCircle-DFL7pw-c.js";import"./Monitor01-xd6_AGZa.js";import"./command-D37uN5J-.js";import"./index-Bx0EGvvq.js";import"./SearchMd-BxQmfb5s.js";import"./integration-icon-a40gN_z1.js";import"./project-icon-BDGMpF2P.js";import"./use-navigate-to-agent-8ajznGe2.js";import"./new-project-dialog-CcXdYQOA.js";import"./ArrowLeft-FLGKBq3z.js";import"./repository-picker-TrkRysRA.js";import"./github-icon-M98rwFqR.js";import"./useInfiniteQuery-v4D5ym6Y.js";import"./infiniteQueryObserver-Bd4S1JAr.js";import"./collection-search-BQWTlXQF.js";import"./ShoppingBag01-CYCT2jnZ.js";import"./use-debounced-value-pGYMxzxk.js";import"./required-auth-layout-sIreaYcR.js";import"./use-org-sso-YfhiI7Na.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Da9_HDDx.js";import"./types-ASWejG-h.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-4XjOBzzr.js";import"./sheet-MLWNRYhQ.js";import"./use-connection-Bh4mFZP8.js";import"./use-mcp-prompts-DDyg7FMp.js";import"./use-thread-outputs-B_TAH3sz.js";import"./file-type-icon-DwSbw3u_.js";import"./switch-CnGPtCHB.js";import"./textarea-BA6pOE5t.js";import"./ChevronSelectorVertical-DujPgcUo.js";import"./popover-BaWxRQRQ.js";import"./monaco-editor-0eOa-DPV.js";import"./editor-BpBeMMun.js";import"./calendar-ESmP-ay5.js";import"./SwitchHorizontal01-TPw7EzQJ.js";import"./Minus-mLwaHX_9.js";import"./select-MFmOiD7V.js";import"./index-BdQq_4o_.js";import"./index-oG6UN7--.js";import"./editor-classes-CS7nwV3G.js";import"./toggle-group-Dh3zyTAy.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CT2qCKie.js";import"./Upload01-CjUA7jDn.js";import"./search-input-BeN2Dgcn.js";import"./tabs-Cl2CsEMh.js";import"./use-file-configs-DXg7w0ah.js";import"./asset-utils-BMQvttAs.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-voice-input-Dx_WJHtm.js";import"./drawer-DsjbbVTG.js";import"./index-DYRhQ9nm.js";import"./checkbox-DS3fV3cm.js";import"./Key01-D8VFHgU4.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-Lwcx-ceL.js";import"./CreditCard01-BwD4GYuP.js";import"./Sun-COkqP7iJ.js";import"./Users01-C0dAo1hK.js";import"./use-blocks-v8-project-CrOozSZ7.js";import"./use-sandbox-events-68YztdQP.js";import"./empty-state-CPetbKsr.js";import"./slider-D87k16tL.js";import"./index-DUYaR34S.js";import"./tooltipContext-DBg9OJee.js";import"./CategoricalChart-Du8Ljv-7.js";import"./index-CM9G2Opl.js";import"./use-move-blocks-Bi-2K9Wd.js";const bc={escape:$i};function xc(v,e){for(const p of nc(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function _c(v,e){if(!e)return;const p=Xo(v,ei(e));if(p)try{const S=xc(p.resolveType,e);return S&&Ll.render(S,p.data,{},bc).trim()||void 0}catch{return}}function kc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=ie("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const wc="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 Aa(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Fa(v){return v.map((e,p)=>({...e,index:p}))}function Rc(v,e){if(e===v.length)return v;if(e<v.length)return Fa(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Ia(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=Rn(),_=Qn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?sc(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?_c(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=Ji(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&As(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Yn:k?Da:Ma;let G;e[16]!==k||e[17]!==P?(G=P?{color:ri}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?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(Qi,{"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(bl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=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 d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Rs,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=ie("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(kc,{icon:js,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(aa,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(aa,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const jc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ec="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 La(v,e,p){if(p)return Yi({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return ie("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":S?jc:x?Ec:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(v,e){return ie("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 Vc(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=Rn(),c=Qn(),xe=S?As(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Ba(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Nc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Zl(Oe);let Pe;e[4]!==ze?(Pe=Jl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let ue;e[6]!==Pe||e[7]!==st?(ue={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=ue):ue=e[8];const g=ue;let we;e[9]!==p?(we=Hi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,at="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=ie("touch-none transition-colors",Xe,La(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Ye=r.jsx(Ia,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ie(ws(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Ac,children:r.jsx(js,{className:ie("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ot=c?r.jsx(qi,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ie(ws(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Tc,children:G?r.jsx(ka,{className:"h-3.5 w-3.5"}):r.jsx(wa,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),de=si,Qe=Gi;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=ie(ws(_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 $e;e[25]!==Qe||e[26]!==ve||e[27]!==it?($e=r.jsx(Qe,{label:ve,classicClassName:it}),e[25]=Qe,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(js,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ni,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(xl,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(an,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let K;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(K=ke&&r.jsxs(an,{className:ie(!c&&Ui),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Da,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=K):K=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(an,{className:ie(!c&&wc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Yn,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let fe;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(fe=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(an,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Ma,{className:"h-4 w-4"}):r.jsx(Rs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=fe):fe=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Wl,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==We||e[65]!==De?($=r.jsxs(an,{variant:"destructive",onClick:We,children:[et,De]}),e[64]=We,e[65]=De,e[66]=$):$=e[66];let oe;e[67]!==Be||e[68]!==ee||e[69]!==K||e[70]!==T||e[71]!==fe||e[72]!==$?(oe=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,K,T,fe,$]}),e[67]=Be,e[68]=ee,e[69]=K,e[70]=T,e[71]=fe,e[72]=$,e[73]=oe):oe=e[73];let Ve;e[74]!==de||e[75]!==$e||e[76]!==oe?(Ve=r.jsxs(de,{children:[$e,oe]}),e[74]=de,e[75]=$e,e[76]=oe,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==ot||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:at,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Ye,W,ot,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Ye,e[85]=W,e[86]=ot,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Tc(v){return v.stopPropagation()}function Ac(v){return v.stopPropagation()}function Nc(){return!1}function Ts(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=Rn();let _;e[0]!==x?(_=ie("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx($l,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Cc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=Rn(),I=Qn();let ke;e[0]!==x.length?(ke=()=>Aa(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Aa(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Rc(tt,x.length)));let ue;e[2]===Symbol.for("react.memo_cache_sentinel")?(ue={activationConstraint:{distance:8}},e[2]=ue):ue=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Xl},e[3]=g):g=e[3];const we=Hl(Ra(Gl,ue),Ra(ql,g));let rt;e[4]!==d?(rt=d.map(Pc),e[4]=d,e[5]=rt):rt=e[5];const at=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==at||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=at.indexOf(String(O.id)),ht=at.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Fa(Jn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=at,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Ee(null)},e[10]=Ye):Ye=e[10];const W=Ye;let ot,de,Qe,ve,it,$e,Be,Ke,se,Y,ee,K,T,fe,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==at||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){fe=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Qe=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],fe=bt;break e}T=ie(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Qe,e[57]=ve,e[58]=T}else Qe=e[56],ve=e[57],T=e[58];de=Yl,Ke=we,se=Ql,Y=L,ee=A,K=W,ot=ec,$e=at,Be=tc,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Vc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=at,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=ot,e[34]=de,e[35]=Qe,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=K,e[45]=T,e[46]=fe,e[47]=We}else ot=e[33],de=e[34],Qe=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],K=e[44],T=e[45],fe=e[46],We=e[47];if(fe!==Symbol.for("react.early_return_sentinel"))return fe;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let De;e[71]!==ot||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(ot,{items:$e,strategy:Be,children:et}),e[71]=ot,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Qe||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:ie("cursor-grabbing shadow-lift",La(ve,!1,I)),children:r.jsx(Ia,{section:ve,raw:Qe,meta:V,decofile:C})}):null,e[76]=Qe,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let oe;e[82]!==$?(oe=ti.createPortal(r.jsx(Ul,{dropAnimation:Wi,children:$}),document.body),e[82]=$,e[83]=oe):oe=e[83];let Ve;e[84]!==de||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==K||e[90]!==De||e[91]!==oe?(Ve=r.jsxs(de,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:K,children:[De,oe]}),e[84]=de,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=K,e[90]=De,e[91]=oe,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ts,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Pc(v){return v.id}function Bc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Es(v,p,S)}:{kind:"noop"};const V=Vs(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Gn(x),_=Un(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Na="section-form-stale-save",Kc=3;function Ca(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ka(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Pa=new WeakMap;let Dc=0;function Mc(v){let e=Pa.get(v);return e===void 0&&(e=++Dc,Pa.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=zi(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=kl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Bl(_e),X=Qn(),ze=xe?.virtualMcpId,Pe=vl(ze===e?e:null)?.metadata?.siteSlug??null,st=rc({virtualMcpId:e,branch:p,sandboxUrl:x}),ue=wl(e,p),g=Rl(ue),we=Ei(g),rt=!g,at=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Ye,W]=b.useState(null),[ot,de]=b.useState(0),[Qe,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[K,T]=b.useState([]),fe=b.useRef(null),[We,et]=b.useState(K.length);We!==K.length&&(et(K.length),requestAnimationFrame(()=>{fe.current&&(fe.current.scrollTop=0)}));const[De,$]=b.useState(0),[oe,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Oa]=b.useState(!0),[Yt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(Z),[Ns,Cs]=b.useState(Z);Z&&!Ns&&(Cs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ns&&Cs(!1);const[za,dn]=b.useState(null),[Ps,An]=b.useState(void 0),[Bs,Ot]=b.useState([]),[Ks,Qt]=b.useState(0),[Me,lt]=b.useState(0),[$a,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Ds,Ms]=b.useState(null),Fs=oi(),Is=jl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Zi({orgSlug:v,virtualMcpId:e,branch:p}),[Wa,Ha]=b.useState(V),[qa,Ga]=b.useState(C),[Ua,Ja]=b.useState(_);(Wa!==V||qa!==C||Ua!==_)&&(queueMicrotask(()=>fn.flush()),Ha(V),Ga(C),Ja(_),L(null),A(null),W(null),de(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1));const D=Xi({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Nn=Ol({orgSlug:v,virtualMcpId:e,branch:p}),Ls=mc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Cn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),Zn=b.useRef(new WeakSet);El(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,o]){const f=l==null?void 0:s[l],j=l==null?void 0:a[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Cn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Ya,Qa]=b.useState(0),$s=ii(ue,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=li($s,I[0]?.blockKey??null,ci(d,I[0]?.blockKey??null)),[Za,Xa]=b.useState(null),Xn=Vl(v,e).epoch,[eo,to]=b.useState(Xn);oc(Re?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?xa(_a(d,u),V,C)?.key??null:null),es=ya({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,no]=b.useState(!1),ts=ya({orgSlug:v,virtualMcpId:e,branch:p},qs?Kl:[]),Gs={ready:!(ue.kind==="protocol"&&ue.hosted)||qs&&ts.ready,failed:ts.failed,retry:ts.retry,request:()=>no(!0)};if(es.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:es.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!es.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ui,{className:"size-5 text-muted-foreground"})});if(!d||!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 so=_a(d,u),q=!!_,ae=q?null:xa(so,V,C),y=q?_:ae?.key??null,ns=q&&_?d[_]:void 0,Us=q&&_&&ns?Dl(_,ns):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,ss=Re&&d&&u&&y&&ae?oa(d,{kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},u):null,ro=Re?nn?.seo:void 0,Pn=Ps!==void 0?Ps:ro,ao=Re?el(Pn):void 0,Js=ss?.seoTypeOptions??[],Ys=Re&&u?tl(u):"",rs=za??ao??{},Bn=Re&&ss?ic(rs,ss):null,Qs=Re&&Bn&&nl(Pn)?qn(Bn,u):null,Zs=Re?sl(d,u)?.seoData:void 0,me=q?[{label:"Default",sections:[{__resolveType:_}]}]:Ka(nn?.sections,d??{},g),yt=me.length>1,te=Math.min(ot,me.length-1),Se=me[te],M=Se?.sections??[],pe=kn(M,d,g),Kn=!q&&pc(nn?.sections,g);if(q&&_&&Ds!==_){Ms(_);const t=M[0],n=pe[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Ds!==null&&Ms(null),re.current={rawSections:M,parsedSections:pe,decofile:d??{},activePageKey:y,pageVariants:me,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const oo=()=>({multivariate:Kn,index:te,variants:me.map(t=>({rule:t.rule})),lazyValues:g&&Kn&&Ti(nn?.sections?.variants?.[te]?.value)}),as=(t,n)=>{if(!w)return;if(!y||!Kn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},a=g?Sa(y,s):Ta(y,s,d,u);w(a.length>0?a:null)},os=w&&y&&Kn&&yt&&!Oe&&!Ee?y:null;if(os!==Za&&(Xa(os),os)){const t=me.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>as(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const a=oo(),o=g?Sa(y,a):Ta(y,a,d,u);if(!t||n<0){w(o.length>0?o:null);return}const i={pageKey:y,page:a,sectionIndex:n,sectionLazy:pe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?Al(i):Sc({...i,decofile:d,meta:u}),f=g?Nl(o,l):[...o,...l];w(f.length>0?f:null)},xt=(t,n,s,a=m??-1,o=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),o&&$t(null,a,s);return}const f=Yr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),o&&$t(null,a,s);return}const j=pi(f.value,d);A(j?.data??null),W(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),o&&$t(i,a,s)},is=t=>{F(null),de(t),L(null),A(null),W(null),T([]);const n=me[t]?.rule,{resolveType:s,formValue:a}=Ut(n,d??{},u??void 0);ee(s),se(a),as(me.map(o=>({rule:o.rule})),t)},io=(t,n)=>{const s=M[t],a=pe[t];if(!s||!a)return!1;const o=a.isMultivariate?pt(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),lt(i),T([]),$(l=>l+1),a.isMultivariate)xt(s,a,i,t);else{const l=wt(s,a,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Qe&&(ve(P?.seq??null),typeof Xs=="number"&&io(Xs,0)),Xn!==eo){to(Xn);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||D.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(fe.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=pe[m];if(T([]),$(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)xt(s,a,Me,m);else{const o=wt(s,a,d,g);A(o?.data??null),W(o?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Qt(s=>s+1))}if(Os!==Ya){Qa(Os);const t=m!==null?M[m]:null,n=m!==null?pe[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Ca(d,n,g),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?ys(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,d,g):null,i=di(ut,o,l=>Qr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Dn=Ye&&u?qn(Ye,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=on(d,y,t,te,me);D.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(fe.current,document.activeElement),ls=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Na}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=ue.kind==="protocol"&&ue.source==="github",rr=t=>Pl(Fs,Is,t,ue.kind==="protocol"?ue:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},lo=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=re.current,o=zt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:a,schema:Dn}},vn=t=>{ct.current=t,ke(t)},co=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:na(a.plan,a.choices,t.plan),fresh:Fi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||$n(a.plan.theirs)!==$n(t.plan.theirs)}):[...n,{...t,changedAgain:Zn.current.has(t.formBase)}];vn(o)},or=(t,n)=>{const s=ct.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if($n(o.plan.mine)===$n(n))return!0;const i=ta({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:na(o.plan,o.choices,i)})),!0},uo=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},fo=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!or(n,a)&&yn(a,n.sectionIndex,0,s),ct.current[0]??null},mo=()=>{const t=ct.current[0],n=fo();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=wi(n.plan,n.choices);ue.kind==="protocol"&&ue.source==="github"&&Ri(n.plan,n.choices)&&Tl(c,!1),vn(ct.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,Zn.current.add(a),(zt.current===a||uo(n))&&(zt.current=a,A(s),$(i=>i+1)),yn(s,a.sectionIndex,0,o)},po=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,a,o=!1)=>{const i=a??lo(n),l=i.sectionVariantIndex,f=i.formBase,j=o||ea(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const B=typeof t=="function"?t():t,z=ea(ct.current,f,i,n,g).base;if(z&&or(z,B))return;const ne=re.current.decofile,{rawSections:U,parsedSections:Ne,pageVariants:J,variantIndex:be}=Ca(ne,i,g),Ie=i.pageKey,he=U[n];if(!he)return;const le=Ne[n];if(!le)return;const Ge=f?.base,Ze=ys(he,le,l,ne,g),Nt=!!Ge&&!!Ze&&Ai(Ge,Ze)&&!(f&&Qr(f,Ze));if(Nt&&Ge&&Ze){if(Ni(Ge,Ze)){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Q=le.isSavedBlock?"here":Ci(Ge,U.map((ce,mt)=>ys(ce,Ne[mt],l,ne,g)),n,f?.sectionCount??U.length);if(Q==="unknown"){ls(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Q=="number"&&f){f.sectionCount=U.length,f.sectionIndex=Q,zt.current===f&&L(Q),yn(B,Q,s,i);return}}const Ct=Nt&&Ge&&Ze?ta({ancestor:Ge,mine:B,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=U.length,co({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Pi(Ct),changedAgain:!1,blockKey:le.isSavedBlock?bs(he,le):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??B,qr=Bi({merged:!!Pt,tracked:f,current:zt.current,saved:B});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Na}),qr&&f&&(f.emitted=Pt,A(Pt));const vs=qr||!Pt?rn:B;f&&(f.base=vs,f.sectionCount=U.length,Ki(f,vs));const Gr={onSuccess:()=>{f&&Zn.current.delete(f),k?.()},onError:Q=>{if(f?.base===vs&&Ge&&(f.base=Ge),Q instanceof Cl){if(f&&(f.version=void 0),s<Kc){ye.current.delete(R),hn.current=!0;const ce=Ii(s,Q.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:B},n,s+1,i,ce.immediate),ye.current.delete(R),ar(xn(g))},ce.delay)}else ls();return}D.reportError(Q)}},Ur=Q=>{pn.current=!0;let ce=!1;D.mutateAsync(Q).then(()=>Gr.onSuccess(),mt=>{ce=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,ar(ce?xn(g):0),tr()})};if(le.isSavedBlock){const Q=bs(he,le);if(!Q)return;Ur({blockKey:Q,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:sa({formBase:f,rebased:!!Pt,versionOf:rr,...sr?{copy:{value:ne[Q]}}:{}})});return}if(!Ie)return;const zn={...ne[Ie]},Gt=[...U];if(le.isMultivariate){const Q=pt(he,le);if(!Q||!Ie)return;const ce=Mi(Q,l,rn);Gt[n]=Bt(he,le,ce)}else if(le.isHidden){const Q=As(he.__resolveType),ce=Q?{...he.section}:{...he},mt=Array.isArray(ce.variants)?[...ce.variants]:[];mt[0]&&(mt[0]=ra(ce.__resolveType,mt[0],rn)),ce.variants=mt,Q?Gt[n]={...he,section:ce}:Gt[n]=ce}else le.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(J.length>1){const Q=zn.sections,ce=[...Q?.variants??[]];ce[be]&&(ce[be]=ra(Q?.__resolveType,ce[be],Gt)),zn.sections={...Q,variants:ce}}else zn.sections=Gt;Ur({blockKey:Ie,data:zn,rebaseOnConflict:!1,guard:sa({formBase:null,rebased:!1,versionOf:rr,...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ho=t=>{tn.current=!1,L(t),lt(0),T([]),$(o=>o+1);const n=M[t],s=pe[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const a=wt(n,s,d,g);if(!a){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(a.data),W(a.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=ji(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},cs=t=>{if(!y||!d||!u||!ae)return;const n={kind:"page",pageKey:y,pageName:String(ae.name??""),path:String(ae.path??"")},s=oa(d,n,u);s&&fn.save(y,()=>{const a=Fs.getQueryData(Vi.decofile(Is))?.[y];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Cn.current};return Cn.current={},t?.raw!==void 0?lc(o,t.raw,u):t?.inner!==void 0?cc(n,s,o,t.inner):o})},lr=(t,n)=>{y&&(Cn.current[t]=n,cs())},go=(t,n)=>{if(!y)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},vo=t=>{if(!y)return;const n=M.filter((s,a)=>a!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},yo=t=>{if(!y)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},So=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s)return;const a=s.isHidden?xi(n,g):_i(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&Wt(),dt(o)},bo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s||s.isMultivariate)return;const a=bi(n);if(!a)return;const o=[...M];o[t]=a,m===t&&Wt(),dt(o)},xo=t=>{if(!y)return;const n=M[t],s=pe[t];if(!n||!s?.isSavedBlock)return;const a=wt(n,s,d,g);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},_o=t=>{if(!y)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;dt(n,{onError:()=>{re.current.selectedSectionIndex===s&&Wt()}}),He(!1),L(s),lt(0),T([]),$(l=>l+1);const a=n[s],o=kn(n,d,g)[s];if(!a||!o)return;if(o.isMultivariate){xt(a,o,0);return}const i=wt(a,o,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{jn.current=t.append,He(!0)},ko=t=>{const n=jn.current;if(!n){_o(t);return}n({__resolveType:t.resolveType}),He(!1),jn.current=null},ur=t=>{if(m===null)return;const n=M[m],s=pe[m];!n||!s?.isMultivariate||(lt(t),T([]),$(a=>a+1),xt(n,s,t,m,!0))},wo=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=yi(a,t);if(!o){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Bt(n,s,o);const l=o.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ro=t=>{if(m===null||!y)return;const n=M[m],s=pe[m];if(!n||!s?.isMultivariate)return;const a=pt(n,s);if(!a)return;const o=Si(a,t,g),i=[...M];i[m]=Bt(n,s,o);const l=Xr(a.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},jo=(t,n)=>{if(m===null||!y||t===n)return;const s=M[m],a=pe[m];if(!s||!a?.isMultivariate)return;const o=pt(s,a);if(!o)return;const i=gi(o,t,n),l=[...M];l[m]=Bt(s,a,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],a,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=M[n],a=pe[n];if(!s||!a)return;const o=hi(s,a,void 0,u,g);if(!o){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(o.newVariantIndex),T([]),$(f=>f+1),xt(o.section,l,o.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=M[m],n=pe[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const a=vi(t,n,s);if(!a){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=kn(o,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(a,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(o)},Eo=async t=>{if(oe===null||!y)return;const n=Un(t,d,u);if(n){H.error(n);return}const s=M[oe],a=pe[oe];if(!s||!a)return;const o=wt(s,a,d,g);if(!o){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),f=[...M];f[oe]={__resolveType:t},await D.mutateAsync({blockKey:y,data:on(d,y,f,te,me)}),m===oe&&Wt(),Ve(null),Hn(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?rl(u):[],us=u&&d?al(u,d):[],Ht=g&&u&&d?uc(u,d):[],ds=(t,n)=>{if(Ht.length===0)return;const s=Ml(t);return{kinds:Ht,selected:s,campaignPrefill:dc(t),onPick:n,load:Gs}},mr=!q&&!!(at&&u&&d),pr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(vc(n,t,u,g))try{await Nn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],f=l[a],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:B,...z}=t;D.mutate({blockKey:h,data:Ft(B??"",z,E)},{onSuccess:()=>k?.(),onError:D.reportError});return}f&&(l[a]={...f,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Va(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},Mn=async(t,n,s)=>{const a=fc(n,t);if(!a.ok)return a.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ba),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 Ls.apply({writes:o})).ok?null:(a.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ba,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await Mn(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Fl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Il(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.current;if(!n)return;const o=await Mn(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],B=E[a];return B?(E[a]={...B,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!o)return;const{resolveType:i,formValue:l}=Ut(o.rule,o.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:a}=re.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 f=[...l.variants],j=f[a];if(!j)return;const h=Mt(j.rule,s,u),R=cn(t);f[a]={...j,rule:R};const E={...s,[n]:{...o,sections:{...l,variants:f}}},{resolveType:B,formValue:z}=Ut(R,E,u??void 0);ee(B),se(z);try{await D.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const J=z?.__resolveType??"",be=i[J],Ie=typeof be?.name=="string"?be.name:J,{__resolveType:he,...le}=t;D.mutate({blockKey:J,data:Ft(he??"",le,Ie)},{onSuccess:()=>k?.(),onError:D.reportError});return}const ne=Ss(E,s,t),U=[...a];U[n]=Bt(h,R,ne);const Ne=on(i,l,U,j,f);D.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:D.reportError})},xn(g)))},Vo=t=>{qe(t);const n=t?Va(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},To=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Ao=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await Mn(t,i,B=>{const z=a[n],ne=o[n];if(!z||!ne?.isMultivariate)return null;const U=pt(z,ne);if(!U)return null;const Ne=[...a];return Ne[n]=Bt(z,ne,Ss(U,s,B)),{blockKey:l,data:on(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},No=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=a[n],R=o[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=Mt(B[s]?.rule,i,u),ne=cn(t),U=Ss(E,s,ne),Ne=[...a];Ne[n]=Bt(h,R,U);const J=on(i,l,Ne,j,f),be={...i,[l]:J},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await D.mutateAsync({blockKey:l,data:J}),z&&z!==t&&await qt(z,be),k?.()}catch(le){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(le))})}};if(!q&&!ae)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(q&&!ns)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?pe[m]??null:null,_r=m!==null?M[m]:null,kr=_r&&je?.isMultivariate?pt(_r,je):null,Vt=kr?Yr(kr,we,g):[],Fn=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Fn]??null,Tt=je?.isMultivariate===!0,fs=m!==null&&je!==null,At=fs&&(Tt||!!(Dn&&Xe)),Co=At&&!q&&je?.isSavedBlock===!0,ft=q||Co,wr=q?Us:je?.label??"",Po=Zt&&u?qn(Zt,u):null,Rr=(t,n)=>n&&X?`${t} · ${n}`:t,jr=je?je.variantOf??je.label:"",Bo=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[Rr(jr,t)]:[je.label,t]:[je?.label??""]})(),ms=Rr(ae?.name??"",yt?Se?.label:null),In=At&&(!q||K.length>0)?q?[Us,...K]:[ms,...Bo,...K]:[],Er=Re&&ae?[ae.name,"SEO",...Bs]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Yt&&ae?[ae.name,Vr]:Lt&&ae&&je?[ms,jr,Vr]:[],Ln=Tr.length>0?Tr:Er.length>0?Er:ft?In.length>0?In:[wr]:In.length>0?In:[ms],Ar=fs&&!Tt&&!je?.isHidden&&!!y,Ko=ft||!q&&yt&&!!Se||Ar,Do=fs&&!Tt&&!q&&K.length===0&&!!je&&Ba(je)&&!!y,Mo=X&&At&&!Lt&&Tt&&K.length===0&&!!kt,Nr=X&&K.length>0?ia(K[K.length-1]):null,Fo=K.length>1?ia(K[K.length-2]):null,Cr=ft?wr:At?je?.label??"":ae?.name??"",Io=Yt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?je?.variantOf??je?.label??"":Yt||Re?ae?.name??"":Nr?Fo??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?ae?.name??"":ae?.path??"",ps=!Yt&&!Lt&&!Re&&!At&&!ft,Lo=!X&&!Re&&!q&&Tt&&K.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=hc(t.sections,M,u,g);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{de(a),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:D.reportError})},On=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const a=d[y],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 f=gc(i,l),j={...d,[y]:{...a,sections:f}};D.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:D.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),de(s);const a=Jn(me.map(o=>({rule:o.rule})),t,n);as(a,s),On(o=>Jn(o,t,n))},Kr=t=>{const n=me[t]?.rule,s=Mt(n,d??{},u??void 0);On(a=>a.length<=1?null:(a.splice(t,1),a),()=>{me.length-1===1?de(0):t<te?de(te-1):t===te&&de(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},Oo=()=>{const t=me.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!ki(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);On(n=>{const s=Li({variants:n}),a=n[s];return a?[{...a,rule:Oi(u)}]:null},()=>{de(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;On(s=>(n=Xr(s,t,g),yc(s,t,g)),()=>{de(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},zo=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,a=re.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 f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,a,u)){F(null);return}const J=h.__resolveType??"";f[t]={...j,rule:Es(h,a,u)};const be={...a,[s]:{...o,sections:{...l,variants:f}}};await D.mutateAsync({blockKey:s,data:be[s]}),await qt(J,be),F(null),k?.();return}const E=Vs(h,a,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await D.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),F(null),k?.();return}const B=Gn(R),z=Un(B,a,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,R);let U=null,Ne=!1;try{const J=await D.mutateAsync({blockKey:B,data:ne,create:!0});Ne=Hn(J),U=Ne?null:B,f[t]={...j,rule:cn(B)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:f}}}),U=null}catch(J){throw U&&await Nn.mutateAsync({blockKey:U}).catch(()=>{}),J}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},$o=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=a[s],R=o[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const B=E.variants??[],z=B[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,U=n.trim();en(!0);const Ne=async J=>{const be={...E,variants:J},Ie=[...a];Ie[s]=Bt(h,R,be);const he=on(i,l,Ie,j,f);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!U){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...B];Nt[t]={...z,rule:Es(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const J=Vs(ne,i,u);if(!J){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(J.blockKey){await D.mutateAsync({blockKey:J.blockKey,data:Ft(J.resolveType,J.data,U)}),O(null),k?.();return}const be=Gn(U),Ie=Un(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(J.resolveType,J.data,U);let le=null,Ge=!1;try{const Ze=await D.mutateAsync({blockKey:be,data:he,create:!0});Ge=Hn(Ze),le=Ge?null:be;const Nt=[...B];Nt[t]={...z,rule:cn(be)},await Ne(Nt),le=null}catch(Ze){throw le&&await Nn.mutateAsync({blockKey:le}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),k?.()}catch(J){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(J))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Wo={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Mr(a,t,E),{...o,[a]:E}},h=Bc(f,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){H.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 B=[...i];B[n]={...l,rule:h.inlinedRule};const z=await j(B);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const B=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Hn(B),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(B){throw R&&await Nn.mutateAsync({blockKey:R}).catch(()=>{}),B}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,o,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...o,[a]:j};try{await Mr(a,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:a,decofile:o}=re.current;if(!a)return;let i=null;!await Mn(s,o,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:a,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),cs({inner:t})},Lr=t=>{An(t),cs({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Qt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Qt(t=>t+1),ge?.()},Ho=()=>{Vn(!1),Tn(!1),L(null),un(!0)},qo=()=>{Re&&$r(),L(null),Vn(!0)},Go=()=>Tn(!0),hs=t=>{if(Yt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(Re){if(t===0){$r();return}if(t===1){Ot([]),Qt(s=>s+1);return}Ot(Bs.slice(0,t-1)),Qt(s=>s+1);return}if(q){T(K.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(K.slice(0,t-1-n))},gs=Ln.length>1?r.jsx("button",{type:"button",onClick:()=>hs(gl(Ln.length,{isMultivariateSectionTop:Lo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ie("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(_l,{className:"size-4"})}):null,Uo=ft||At||Re?Ko&&r.jsxs("div",{className:ie("border-b px-3 py-2.5",ft&&"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:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:ie("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",il),children:[r.jsx(ol,{rule:ks(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(Wn,{onClick:()=>Sn()})]}),ft&&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(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Jo=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(ua,{className:"mt-3",children:r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ll,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Fn,onSelect:ur,onRename:O,onDuplicate:Ro,onDelete:wo,onRemoveAll:dr,onReorder:jo,onAdd:()=>Sn()}),r.jsx(ua,{children:r.jsx(xs,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:Vo,onSelectGlobal:No,named:ds(kt?.rule,Ao),namedRow:_s(kt?.rule,Ht),rule:kt?.rule,schema:Po,formValue:$a,onChange:To,formKey:`${m??"none"}:${Fn}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:ie(X?"px-2":"p-2 pt-3"),children:r.jsx(Cc,{listKey:`${y??""}-${te}`,rawSections:M,sections:pe,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ho(t),Je?.(t)},onReorder:go,onDelete:vo,onDuplicate:yo,onMakeReusable:Ve,onToggleHidden:So,onToggleLazy:rt?bo:void 0,onAddVariant:Sn,onDetach:xo,onAddSection:()=>He(!0),canAddSection:mr})}),Yo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&ae&&r.jsx(la,{pageKey:y,initialName:ae.name,initialPath:ae.path,onFieldChange:lr}),nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Qo=r.jsx(ln,{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:nn&&y?r.jsx(ja,{rawSeo:Pn,innerSeo:rs,defaultResolveType:Ys,seoTypesLoading:g&&!u,seoSchema:Qs,activeResolveType:Bn,seoTypeOptions:Js,formResetKey:Ks,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Zo=r.jsxs(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(ca,{listKey:y,variants:me,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:is,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:ie("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Oa(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(yl,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Sl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:ie("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(xs,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:us,onSelect:gr,onSelectGlobal:br,named:ds(Se?.rule,Sr),namedRow:_s(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(cl,{value:g,children:r.jsx(ul,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&gs&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:gs}),(X||Ln.length>1)&&r.jsx(dl,{crumbs:Ln,onSelect:hs,onSelectRoot:()=>{fn.flush(),Ue?Ue():hs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ie("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&gs,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{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:Io}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),ps&&yt&&Se&&r.jsx(da,{variants:me,activeIndex:te,onSelect:is,onManage:qo,onRemoveAll:Oo}),Mo&&r.jsx(da,{variants:Vt,activeIndex:Fn,onSelect:ur,onManage:Go,onRemoveAll:dr}),ps&&!yt&&r.jsx(Wn,{onClick:bn}),Do&&r.jsx(Wn,{onClick:()=>Sn()}),r.jsx(fl,{}),ps&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Ho,children:r.jsx(ga,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(va,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Uo}),ut&&r.jsx(fi,{open:!0,fields:mi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>po({...ut.choices,[t]:n}),onApply:mo},Mc(ut.formBase)),Lt?r.jsx(fa,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&K.length===0&&Wr,r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Wo:void 0})})})]},"editor-section-form"):q?r.jsx(ln,{viewportRef:fe,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ea,{value:yr,children:r.jsx(ma,{value:q&&g?Be:null,children:r.jsx(pa,{activeSchema:Dn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:K,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):Re?X?r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Yo})},"editor-seo"):Qo:Yt?r.jsx(fa,{onAdd:bn,children:Jo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(ln,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ts,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Zo,r.jsx(ml,{open:oe!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:oe!==null?Gn(pe[oe]?.label??""):"",isPending:D.isPending,onSubmit:Eo}),at&&r.jsx(ac,{open:Ae,onOpenChange:t=>{He(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:ko}),ht&&y&&d&&r.jsx(zl,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(ha,{open:!0,initialName:Jt(me[Te]?.rule,d??{},u??void 0)?_n(me[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(me[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await zo(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(ha,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(ks(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $o(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{uf as SectionsEditor};
|