decocms 3.76.0 → 3.76.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CZWjmLDT.js → AlertCircle-BZqAQZBb.js} +1 -1
- package/dist/client/assets/{ArrowRight-DswQGw32.js → ArrowRight-6qgvW498.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-zJbKnVEx.js → ArrowUpRight-CUPFfker.js} +1 -1
- package/dist/client/assets/{CheckCircle-DD9zrZHy.js → CheckCircle-DOPRdShL.js} +1 -1
- package/dist/client/assets/{ChevronDown-P1cR1p1z.js → ChevronDown-BhLFFAly.js} +1 -1
- package/dist/client/assets/{ChevronLeft-njq8SkK6.js → ChevronLeft-veOSKT91.js} +1 -1
- package/dist/client/assets/{ChevronRight-C5wvGTH8.js → ChevronRight-tj4xbWmM.js} +1 -1
- package/dist/client/assets/ChevronUp-DhHPsDAS.js +1 -0
- package/dist/client/assets/{DotsVertical-DVx42NIt.js → DotsVertical-kcsdrim_.js} +1 -1
- package/dist/client/assets/{Eye-BkHY3voI.js → Eye-BfNssVzk.js} +1 -1
- package/dist/client/assets/{FilterLines-rKEHnpC8.js → FilterLines-D2obCQW_.js} +1 -1
- package/dist/client/assets/{Globe01-Cq-Rbldi.js → Globe01-CJXHyXNe.js} +1 -1
- package/dist/client/assets/{Globe04-CtEF3BRe.js → Globe04-PQ0ejRYI.js} +1 -1
- package/dist/client/assets/{HardDrive-7UiN3uqO.js → HardDrive-DEG8fjxw.js} +1 -1
- package/dist/client/assets/{Key01-v4LCWUSc.js → Key01-xj4UQriu.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BrCMpwSK.js → LayoutLeft-C9-KQh8d.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DtT4L4N6.js → LinkExternal01-DtLsAcMy.js} +1 -1
- package/dist/client/assets/{Monitor01-D9depcVp.js → Monitor01-CvNVisni.js} +1 -1
- package/dist/client/assets/{Palette-D_iY1hQ7.js → Palette-yNiXmyHD.js} +1 -1
- package/dist/client/assets/{Play-DdLK5xgI.js → Play-C0DhAO4u.js} +1 -1
- package/dist/client/assets/{Plus-Cd0ypUPB.js → Plus-BRQannbC.js} +1 -1
- package/dist/client/assets/{SearchMd-CKCNrxV5.js → SearchMd-CttVjXUQ.js} +1 -1
- package/dist/client/assets/{Settings02-BoqCpz_o.js → Settings02-kQ4zmp5P.js} +1 -1
- package/dist/client/assets/{Shield01-Wa9NR2vn.js → Shield01-BZZVugf_.js} +1 -1
- package/dist/client/assets/{Star01-DhLGcNbl.js → Star01-CFj5T2Jl.js} +1 -1
- package/dist/client/assets/{Stars01-WeiMgRuc.js → Stars01-C4FyHP_L.js} +1 -1
- package/dist/client/assets/{Stars02-DnTT2sBI.js → Stars02-Bo19XD__.js} +1 -1
- package/dist/client/assets/{Sun-1K7RcAWZ.js → Sun-CcSW7Ngf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CEUgiRB1.js → SwitchHorizontal01-BVKPeJMU.js} +1 -1
- package/dist/client/assets/{Tool01-Dv9dCbp6.js → Tool01-AyuVwnGv.js} +1 -1
- package/dist/client/assets/{Trash01-BC1OhQlq.js → Trash01-BZXmKzie.js} +1 -1
- package/dist/client/assets/{Upload01-BHKvZ87r.js → Upload01-D4ez0Mu3.js} +1 -1
- package/dist/client/assets/{User01-B9BKmOI0.js → User01-Dz33ODze.js} +1 -1
- package/dist/client/assets/{Users01-Dy2qezq_.js → Users01-aBataJ8N.js} +1 -1
- package/dist/client/assets/{Users03-B41w1ewc.js → Users03-C6siA5mE.js} +1 -1
- package/dist/client/assets/{X-CNdGRyYk.js → X-DC2HG4lX.js} +1 -1
- package/dist/client/assets/{XCircle-j1-GVtiw.js → XCircle-DJDxYBys.js} +1 -1
- package/dist/client/assets/{XClose-BgQasJGJ.js → XClose-BcOWKb5Q.js} +1 -1
- package/dist/client/assets/{Zap-Cd1AcQhh.js → Zap-OOZsYg72.js} +1 -1
- package/dist/client/assets/{ZapSquare-Cl9Iu0Yu.js → ZapSquare-ok_KEP9c.js} +1 -1
- package/dist/client/assets/{ZoomOut-DG8OwHO2.js → ZoomOut-cYq1CP_X.js} +1 -1
- package/dist/client/assets/{access-gate-CNUwq6nr.js → access-gate-uvqL8ENQ.js} +1 -1
- package/dist/client/assets/add-section-modal-CZMJAFim.js +1 -0
- package/dist/client/assets/agent-icon-C4199b3i.js +1 -0
- package/dist/client/assets/agents-list-BkhDlcw_.js +1 -0
- package/dist/client/assets/ai-providers-CocgfzPQ.js +1 -0
- package/dist/client/assets/{alert-Bx3j7Zu2.js → alert-CUg2Lij_.js} +1 -1
- package/dist/client/assets/{alert-dialog-C8bis9BK.js → alert-dialog-BUQoXI1j.js} +1 -1
- package/dist/client/assets/app-editor-C-syiSQu.js +1 -0
- package/dist/client/assets/{auth-rR0qxEot.js → auth-B9bEkbYh.js} +1 -1
- package/dist/client/assets/{auth-catchall-G4-_U_hr.js → auth-catchall-CoB3zmdz.js} +1 -1
- package/dist/client/assets/{auth-entry-DVVVpVbL.js → auth-entry-CGeJ7qYU.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BnwaUYfT.js → auth-split-layout-DAQR8Zen.js} +1 -1
- package/dist/client/assets/{automation-list-row-DyIqsqOZ.js → automation-list-row-DMPjogBl.js} +1 -1
- package/dist/client/assets/{automation-runs-QwVqCO49.js → automation-runs-y9iHLMe2.js} +1 -1
- package/dist/client/assets/automations-BZ5f_VCT.js +1 -0
- package/dist/client/assets/{avatar-DYinNJvl.js → avatar-CKJB3djy.js} +1 -1
- package/dist/client/assets/{badge-CzYcGjqZ.js → badge-DUlP8HvP.js} +1 -1
- package/dist/client/assets/{block-document-BulOcPyx.js → block-document-Cft5FVFJ.js} +1 -1
- package/dist/client/assets/{brand-context-CkwHlhfX.js → brand-context-ozThKdwR.js} +1 -1
- package/dist/client/assets/buckets-DXjIiLHp.js +1 -0
- package/dist/client/assets/{calendar-CEJilXwV.js → calendar-DDwlGULz.js} +1 -1
- package/dist/client/assets/{capability-load-error-D6fX-v6m.js → capability-load-error-DTVGdoZZ.js} +1 -1
- package/dist/client/assets/{card-e6Sa893P.js → card-D7O9yDM9.js} +1 -1
- package/dist/client/assets/category-editor-B2u5O4dV.js +1 -0
- package/dist/client/assets/{chat-context-DuUO64-v.js → chat-context-GA_fpERN.js} +1 -1
- package/dist/client/assets/checkbox-DOg3LODJ.js +1 -0
- package/dist/client/assets/{cli-auth-success-BY8fHwGL.js → cli-auth-success-Jeg6Lv3T.js} +1 -1
- package/dist/client/assets/collection-detail-BDyvHjSJ.js +1 -0
- package/dist/client/assets/collection-display-button-b4s7O-gz.js +1 -0
- package/dist/client/assets/{collection-search-YuvsCInj.js → collection-search-DC-7DcrR.js} +1 -1
- package/dist/client/assets/{collection-tabs-BvdJGTHh.js → collection-tabs-CRIZ0CX_.js} +1 -1
- package/dist/client/assets/{command-DBO-6Ili.js → command-BzTLypzr.js} +1 -1
- package/dist/client/assets/commerce-onboarding-Cz_Sr1Cc.js +1 -0
- package/dist/client/assets/connect-desktop-dialog-uLnBe_nQ.js +1 -0
- package/dist/client/assets/{connection-card-sqzGo5b9.js → connection-card-DPkWnrYu.js} +1 -1
- package/dist/client/assets/connection-detail-DFBuqM3e.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DAgkTcm-.js → connection-form-helpers-B_oQdAph.js} +1 -1
- package/dist/client/assets/connections-BF1eSDFK.js +1 -0
- package/dist/client/assets/{context-menu--dT1SoD7.js → context-menu-DegHHWIw.js} +1 -1
- package/dist/client/assets/{decopilot-B71gq1IG.js → decopilot-BsjqLgTH.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BfjIH6C6.js → decopilot-sse-pool-CZG5pZEa.js} +1 -1
- package/dist/client/assets/{dialog-D72IgZaK.js → dialog-DDL08EK8.js} +1 -1
- package/dist/client/assets/{domain-settings-GvfG_VOO.js → domain-settings-ctGoYy0P.js} +1 -1
- package/dist/client/assets/{drawer-DUNra2qL.js → drawer-CTdCEiZw.js} +1 -1
- package/dist/client/assets/dropdown-menu-CgCZ8Mte.js +1 -0
- package/dist/client/assets/{empty-state-D0sRK0ON.js → empty-state-BDXQKaPV.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CF6q97ac.js → extract-connection-data-D4y9_vmi.js} +1 -1
- package/dist/client/assets/file-explorer-DTEZJaER.js +2 -0
- package/dist/client/assets/{file-type-icon-CeVYC7mS.js → file-type-icon-GfohFxwW.js} +1 -1
- package/dist/client/assets/{files-a4BL2DOF.js → files-CjZS2qVw.js} +1 -1
- package/dist/client/assets/{form-c6Tjk0mK.js → form-B9v_4_lt.js} +1 -1
- package/dist/client/assets/general-CMdyBBfH.js +1 -0
- package/dist/client/assets/{github-repo-picker-CY9IQCxY.js → github-repo-picker-Qwduwaex.js} +1 -1
- package/dist/client/assets/{hooks-DIkgQaQt.js → hooks-BI65IXS7.js} +1 -1
- package/dist/client/assets/image-field-CEHk9cpM.js +1 -0
- package/dist/client/assets/{import-from-deco-dialog-Bo8H0nZ7.js → import-from-deco-dialog-DDUPpwIu.js} +1 -1
- package/dist/client/assets/{index-pDmuEeOe.js → index-1J83wgnT.js} +1 -1
- package/dist/client/assets/{index-DGp9wWJa.js → index-B2quJDhU.js} +1 -1
- package/dist/client/assets/{index-DxpQDpZ-.js → index-B3siY4Ve.js} +1 -1
- package/dist/client/assets/{index-Cnfeoply.js → index-B8LUbsU-.js} +4 -4
- package/dist/client/assets/{index-CNxHhuwF.js → index-BI3_fNOm.js} +1 -1
- package/dist/client/assets/{index-C1pS4_YG.js → index-BUTJwxVv.js} +1 -1
- package/dist/client/assets/{index-DhKsoRDO.js → index-Br4BSsfF.js} +1 -1
- package/dist/client/assets/index-CQsWL0Jd.js +1 -0
- package/dist/client/assets/{index-Bz87ChsZ.js → index-CWT26dU0.js} +3 -3
- package/dist/client/assets/{index-Dq0yW5NU.js → index-Cvc1xn-4.js} +3 -3
- package/dist/client/assets/{index-CWigfPgT.js → index-DBKP_KxA.js} +1 -1
- package/dist/client/assets/index-DMWSApoW.js +1 -0
- package/dist/client/assets/{index-CMfvUJnv.js → index-DVxNbd_g.js} +1 -1
- package/dist/client/assets/{index-BE9xYrPB.js → index-YDkX6amF.js} +2 -2
- package/dist/client/assets/{index-redirect-C1GVFF5R.js → index-redirect-7dYh9FF7.js} +1 -1
- package/dist/client/assets/{input-_nwToKjA.js → input-klr_kUC2.js} +1 -1
- package/dist/client/assets/{integration-icon-Ck8orUeY.js → integration-icon-gcYOl2yq.js} +1 -1
- package/dist/client/assets/{label-qEVe6vIu.js → label-hfmZhqH1.js} +1 -1
- package/dist/client/assets/{login-DpKCgKK2.js → login-BwlkI7-F.js} +1 -1
- package/dist/client/assets/{mcp-oauth-zL3nfx6O.js → mcp-oauth-C5QgI6bG.js} +1 -1
- package/dist/client/assets/{members-CZS6qxHq.js → members-DtCaJnP7.js} +2 -2
- package/dist/client/assets/{monaco-editor-CjxWYC_f.js → monaco-editor-YJUBj_D_.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B_dqdxSl.js → monitoring-stats-row-DYXC0MeT.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BeEi3Byk.js → oauth-callback-ai-provider-rWJe_yJL.js} +1 -1
- package/dist/client/assets/{oauth-callback-DKE7VzfD.js → oauth-callback-oHGZWLTi.js} +1 -1
- package/dist/client/assets/{onboarding-BNi0EEdl.js → onboarding-C8e3_lZa.js} +1 -1
- package/dist/client/assets/{org-install-Djse-3Co.js → org-install-Bht2exTB.js} +1 -1
- package/dist/client/assets/{org-layout-zxXwGgug.js → org-layout-DJtHiwbS.js} +1 -1
- package/dist/client/assets/{organization-choice-Dk1wgo0w.js → organization-choice-Dye_3x23.js} +1 -1
- package/dist/client/assets/{page-seo-form-DYL4unkh.js → page-seo-form-Io0ovKiN.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CRKfon-Z.js +1 -0
- package/dist/client/assets/{popover-BPaZIpfE.js → popover-BvZF2bBr.js} +1 -1
- package/dist/client/assets/post-editor-DhYABFSS.js +1 -0
- package/dist/client/assets/preview-dialog-BikVelEl.js +5 -0
- package/dist/client/assets/{primitives-rFUF7X3j.js → primitives-Bc5oh19Q.js} +1 -1
- package/dist/client/assets/profile-BoAJRU1a.js +1 -0
- package/dist/client/assets/project-app-view-AcWNwwqH.js +1 -0
- package/dist/client/assets/record-editor-CdJmeinf.js +1 -0
- package/dist/client/assets/registry-Cq-UMbFU.js +2 -0
- package/dist/client/assets/{registry-layout-CPNTqGx6.js → registry-layout-Dxd6kQFA.js} +2 -2
- package/dist/client/assets/{require-capability-qWO2y64O.js → require-capability-kyUIYw2A.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CZ5ywz4q.js → required-auth-layout-BcilPdVi.js} +1 -1
- package/dist/client/assets/{reset-password-CdIGOFtS.js → reset-password-CPk5rTzD.js} +1 -1
- package/dist/client/assets/roles-BTjmfpAQ.js +1 -0
- package/dist/client/assets/save-referenced-block-oaxGf8K5.js +1 -0
- package/dist/client/assets/save-status-De_ZSd1F.js +1 -0
- package/dist/client/assets/{schema-form-BbkFKB86.js → schema-form-C1MMeEGC.js} +1 -1
- package/dist/client/assets/{scroll-area-Dnau9N0n.js → scroll-area-BvvyxqKR.js} +1 -1
- package/dist/client/assets/{search-input-BaC0E9To.js → search-input-B-LDSHMx.js} +1 -1
- package/dist/client/assets/secrets-Bq5342Un.js +1 -0
- package/dist/client/assets/{sections-editor-De-lJO4z.js → sections-editor-BU6mrjAz.js} +2 -2
- package/dist/client/assets/select-DwFQDgcX.js +1 -0
- package/dist/client/assets/{select-model-CWt1Bknh.js → select-model-BWl1FGCY.js} +1 -1
- package/dist/client/assets/seo-editor-WJe9bB3t.js +1 -0
- package/dist/client/assets/{settings-layout-DCzRn5Ns.js → settings-layout-d5QwVuj0.js} +1 -1
- package/dist/client/assets/{settings-section-D3Fp8p3i.js → settings-section-rOWH4a9G.js} +1 -1
- package/dist/client/assets/{sheet-C_eprANm.js → sheet-XVV7S5b8.js} +1 -1
- package/dist/client/assets/{shell-controls-CnGQk1cT.js → shell-controls-D6QH2Gpe.js} +1 -1
- package/dist/client/assets/{shell-layout-DZa9vz6i.js → shell-layout-DIXTRmN4.js} +1 -1
- package/dist/client/assets/{shell-route-loading-DzfmbJgx.js → shell-route-loading-B5-wAKUU.js} +1 -1
- package/dist/client/assets/{sidebar-BEDmuINV.js → sidebar-Djn7svMG.js} +1 -1
- package/dist/client/assets/{skeleton-B8TYMvV6.js → skeleton-C-tuNjEZ.js} +1 -1
- package/dist/client/assets/{sortable.esm-CXuCPoS-.js → sortable.esm-S2exVkMt.js} +1 -1
- package/dist/client/assets/sso-KnN7dzsP.js +1 -0
- package/dist/client/assets/{store-DpnFmmX-.js → store-DcHIPBce.js} +1 -1
- package/dist/client/assets/store-registry-3V2xevo5.js +2 -0
- package/dist/client/assets/{studio-tools-BKbKV9tq.js → studio-tools-D8q7MEyE.js} +1 -1
- package/dist/client/assets/{switch-DZeUpv7n.js → switch-skMKJ2GI.js} +1 -1
- package/dist/client/assets/{table-D62tnfqw.js → table-DsOuzcNK.js} +1 -1
- package/dist/client/assets/{tabs-BwmDvzOa.js → tabs-C0Vh3iPJ.js} +1 -1
- package/dist/client/assets/{task-status-CFNgHUT3.js → task-status-DRz_b988.js} +1 -1
- package/dist/client/assets/{textarea-BNgmZDC5.js → textarea-2KmLad1y.js} +1 -1
- package/dist/client/assets/{toggle-group-Cq6Xi1dh.js → toggle-group-6FcrOIsd.js} +1 -1
- package/dist/client/assets/{toolbar-DdJ_ns82.js → toolbar-DE_I2DnI.js} +1 -1
- package/dist/client/assets/{tooltip-D_6ICuSM.js → tooltip-D_DwQRbZ.js} +1 -1
- package/dist/client/assets/{types-Bn0LA8cd.js → types-zC94Gae_.js} +1 -1
- package/dist/client/assets/{use-ai-providers-gj-kkImt.js → use-ai-providers-0DJv4c0H.js} +1 -1
- package/dist/client/assets/{use-automations-Chypf-85.js → use-automations-CsLMaKM0.js} +1 -1
- package/dist/client/assets/{use-capability-WgQvudy9.js → use-capability-A3j7T78I.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BmlWLziO.js → use-clock-tick-CqrkSCF6.js} +1 -1
- package/dist/client/assets/{use-collections-R0ZvS-Ai.js → use-collections-dA9ibOHr.js} +1 -1
- package/dist/client/assets/{use-connection-DCyLx_hF.js → use-connection-C39BUY8e.js} +1 -1
- package/dist/client/assets/{use-copy-mZgO-NLO.js → use-copy-DM9BeeKg.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BrGJfb-E.js → use-create-virtual-mcp-q3QYUSY1.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cs0wa2AV.js → use-debounced-autosave-BzGp2qae.js} +1 -1
- package/dist/client/assets/use-deco-credits-Bax6GRog.js +1 -0
- package/dist/client/assets/{use-delete-connection-BEyb12gk.js → use-delete-connection-CAqFRv-C.js} +1 -1
- package/dist/client/assets/{use-file-configs-BoDiyEPN.js → use-file-configs-CvRusjpd.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C0w6irwB.js → use-infinite-scroll-DM0o0Ibp.js} +1 -1
- package/dist/client/assets/{use-join-requests-DWKpDg4f.js → use-join-requests-iYNw-oM8.js} +1 -1
- package/dist/client/assets/{use-mcp-client-j7WzNXv1.js → use-mcp-client-DV4dF4m3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D5hbuC8X.js → use-mcp-prompts-CspfQ-gW.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D4YogNCG.js → use-mcp-tools-DnBnaQLn.js} +1 -1
- package/dist/client/assets/{use-members-4evhu5YD.js → use-members-CtcSheMR.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C8HlpzKH.js → use-navigate-to-agent-Cs1C-DBQ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DXrbIv3b.js → use-org-auth-client-lV24PS0n.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bva6WiTR.js → use-org-sso-Cygr8MWL.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CyUUrGRh.js → use-organization-roles-DKqp_63r.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B38ce8Is.js → use-organization-settings-C6jq364X.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DANSvt2N.js → use-registry-connections-yBLIjpTM.js} +1 -1
- package/dist/client/assets/{use-secrets-B9PZDKXf.js → use-secrets-BtkNg5h6.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D8dNgif9.js → use-status-sounds-Bvu0fELl.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bjc0BTTn.js → use-view-mode-CF449xEK.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BojtVjer.js → use-virtual-mcp-WmAC_qSm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bwr_uznn.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-D48NS_O0.js +1 -0
- package/dist/client/assets/variant-calendar-CoVLDgg6.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D7SZK2nR.js → view-mode-toggle-D7_rFTiD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +413 -413
- package/dist/server/server.js +287 -287
- package/package.json +1 -1
- package/dist/client/assets/Check-e4E4gv9b.js +0 -1
- package/dist/client/assets/ChevronUp-DMBQslpk.js +0 -1
- package/dist/client/assets/add-section-modal-BdHBbUlc.js +0 -1
- package/dist/client/assets/agent-icon-Cg7qESLO.js +0 -1
- package/dist/client/assets/agents-list-Cv8hL8Qp.js +0 -1
- package/dist/client/assets/ai-providers-B9jF42-5.js +0 -1
- package/dist/client/assets/app-editor-CkS4moAr.js +0 -1
- package/dist/client/assets/automations-DO0-NdyE.js +0 -1
- package/dist/client/assets/buckets-Dt9m141q.js +0 -1
- package/dist/client/assets/category-editor-BQs9qYu3.js +0 -1
- package/dist/client/assets/checkbox-DHnP85yY.js +0 -1
- package/dist/client/assets/collection-detail-Bwitx8t1.js +0 -1
- package/dist/client/assets/collection-display-button-Cl0680lC.js +0 -1
- package/dist/client/assets/commerce-onboarding-CO_7v-O2.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-DUZgnkWb.js +0 -1
- package/dist/client/assets/connection-detail-DBNeOrup.js +0 -1
- package/dist/client/assets/connections-9HckXwT4.js +0 -1
- package/dist/client/assets/dropdown-menu-DXd30ioR.js +0 -1
- package/dist/client/assets/file-explorer-Bz0TzuPK.js +0 -2
- package/dist/client/assets/general-C-niaOyb.js +0 -1
- package/dist/client/assets/image-field-DouDEOlb.js +0 -1
- package/dist/client/assets/index-ByGLOWBj.js +0 -1
- package/dist/client/assets/index-CBnRwLFs.js +0 -1
- package/dist/client/assets/page-seo-sheet-NcSXQC2t.js +0 -1
- package/dist/client/assets/post-editor-ivmjRk8O.js +0 -1
- package/dist/client/assets/preview-dialog-DCg8NdOu.js +0 -5
- package/dist/client/assets/profile-o471UoMY.js +0 -1
- package/dist/client/assets/project-app-view-DmWANIgd.js +0 -1
- package/dist/client/assets/record-editor-aVQ6MqKD.js +0 -1
- package/dist/client/assets/registry-5hDGRmm6.js +0 -2
- package/dist/client/assets/roles-DsrZximT.js +0 -1
- package/dist/client/assets/save-referenced-block-CX9mAiL4.js +0 -1
- package/dist/client/assets/save-status-CiygUOIM.js +0 -1
- package/dist/client/assets/secrets-1qZp_c2T.js +0 -1
- package/dist/client/assets/select-D9Oa8DMc.js +0 -1
- package/dist/client/assets/seo-editor-CM1oES4Z.js +0 -1
- package/dist/client/assets/sso-Cu4qLJwq.js +0 -1
- package/dist/client/assets/store-registry-CIBZe6y0.js +0 -2
- package/dist/client/assets/use-deco-credits-DosFtgZr.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CTySOOk0.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-jvr57LmV.js +0 -1
- package/dist/client/assets/variant-calendar-nz1RBENW.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Le,r as w,j as t,B as Fe,i as qt,l as Ce,I as ta,t as fe,K as na}from"./index-Dq0yW5NU.js";import{r as sa,i as Tn,c as aa,G as ra,a as jt,b as oa,d as ia,e as la,f as ca,g as ua,h as da,j as ma,k as fa,l as pa,m as bt,p as xt,n as ha,o as Kt,q as Qe,s as vn,t as Sn,P as ga,v as Ft,w as va,x as Sa,y as ba,z as xa,A as ya,B as ja,C as _a,D as dt,E as ka,F as wa,H as Na,I as Ra,J as Ca,K as Da,L as Ta,M as Pa,N as Lt,O as Va,Q as bn,R as Aa,S as Ma,T as Ea,U as zt,V as $a,W as Oa,X as xn}from"./index-Cnfeoply.js";import{t as Ba}from"./ChevronDown-P1cR1p1z.js";import{n as Ka}from"./ChevronLeft-njq8SkK6.js";import{i as Pn}from"./ChevronRight-C5wvGTH8.js";import{n as Fa}from"./ChevronUp-DMBQslpk.js";import{K as Ut,D as Vn,S as An,l as La,L as za,M as Ia}from"./agent-icon-Cg7qESLO.js";import{i as Ha}from"./Globe01-Cq-Rbldi.js";import{S as yt}from"./scroll-area-Dnau9N0n.js";import{b as st,T as at,a as rt}from"./tooltip-D_6ICuSM.js";import{a as Mn,D as En,b as $n,e as On,c as Bn,d as Kn}from"./dialog-D72IgZaK.js";import{I as Fn}from"./input-_nwToKjA.js";import{s as Ua,a as Wa}from"./Eye-BkHY3voI.js";import{c as qa}from"./ZoomOut-DG8OwHO2.js";import{b as Ja}from"./Settings02-BoqCpz_o.js";import{s as Wt}from"./Plus-Cd0ypUPB.js";import{s as Ln}from"./Trash01-BC1OhQlq.js";import{i as Ya}from"./Zap-Cd1AcQhh.js";import{c as nt,a as zn,D as In,b as Hn,g as Za}from"./dropdown-menu-DXd30ioR.js";import{u as Un,a as _t,K as Wn,P as qn,b as Jn,C as Yn,s as Zn,d as mt,D as Qn,c as Xn,S as Gn,v as Qa,e as es,h as Xa}from"./sortable.esm-CXuCPoS-.js";import{r as Ga,s as er,V as tr,a as nr,u as et,e as sr,S as ar,M as yn,f as tt,b as ts}from"./schema-form-BbkFKB86.js";import{r as jn,u as rr,d as or,a as ir,i as lr,f as cr,P as ur,b as dr,S as mr}from"./page-seo-form-DYL4unkh.js";import{i as fr}from"./Tool01-Dv9dCbp6.js";import{AddSectionModal as pr}from"./add-section-modal-BdHBbUlc.js";import{c as hr}from"./save-referenced-block-CX9mAiL4.js";import"./index-CNxHhuwF.js";import"./chat-context-DuUO64-v.js";import"./hooks-DIkgQaQt.js";import"./use-mcp-client-j7WzNXv1.js";import"./auth-rR0qxEot.js";import"./decopilot-sse-pool-BfjIH6C6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BojtVjer.js";import"./use-collections-R0ZvS-Ai.js";import"./use-ai-providers-gj-kkImt.js";import"./studio-tools-BKbKV9tq.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-B38ce8Is.js";import"./drawer-DUNra2qL.js";import"./collection-search-YuvsCInj.js";import"./SearchMd-CKCNrxV5.js";import"./use-mcp-prompts-D5hbuC8X.js";import"./X-CNdGRyYk.js";import"./shell-layout-DZa9vz6i.js";import"./avatar-DYinNJvl.js";import"./User01-B9BKmOI0.js";import"./Users03-B41w1ewc.js";import"./Stars02-DnTT2sBI.js";import"./XClose-BgQasJGJ.js";import"./CheckCircle-DD9zrZHy.js";import"./FilterLines-rKEHnpC8.js";import"./required-auth-layout-CZ5ywz4q.js";import"./use-org-sso-Bva6WiTR.js";import"./SwitchHorizontal01-CEUgiRB1.js";import"./ZapSquare-Cl9Iu0Yu.js";import"./Check-e4E4gv9b.js";import"./Star01-DhLGcNbl.js";import"./Upload01-BHKvZ87r.js";import"./AlertCircle-CZWjmLDT.js";import"./form-c6Tjk0mK.js";import"./label-qEVe6vIu.js";import"./select-D9Oa8DMc.js";import"./ArrowRight-DswQGw32.js";import"./tabs-BwmDvzOa.js";import"./XCircle-j1-GVtiw.js";import"./toggle-group-Cq6Xi1dh.js";import"./use-deco-credits-DosFtgZr.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-sqzGo5b9.js";import"./use-registry-connections-DANSvt2N.js";import"./use-connection-DCyLx_hF.js";import"./useInfiniteQuery-CTySOOk0.js";import"./use-infinite-scroll-C0w6irwB.js";import"./extract-connection-data-CF6q97ac.js";import"./card-e6Sa893P.js";import"./integration-icon-Ck8orUeY.js";import"./collection-tabs-BvdJGTHh.js";import"./badge-CzYcGjqZ.js";import"./textarea-BNgmZDC5.js";import"./connection-form-helpers-DAgkTcm-.js";import"./useSuspenseInfiniteQuery-jvr57LmV.js";import"./mcp-oauth-zL3nfx6O.js";import"./Monitor01-D9depcVp.js";import"./connect-desktop-dialog-DUZgnkWb.js";import"./decopilot-B71gq1IG.js";import"./checkbox-DHnP85yY.js";import"./skeleton-B8TYMvV6.js";import"./Key01-v4LCWUSc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D3Fp8p3i.js";import"./ArrowUpRight-zJbKnVEx.js";import"./Stars01-WeiMgRuc.js";import"./popover-BPaZIpfE.js";import"./command-DBO-6Ili.js";import"./index-CMfvUJnv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D8dNgif9.js";import"./empty-state-D0sRK0ON.js";import"./toolbar-DdJ_ns82.js";import"./preview-dialog-DCg8NdOu.js";import"./LinkExternal01-DtT4L4N6.js";import"./index-DGp9wWJa.js";import"./file-type-icon-CeVYC7mS.js";import"./LayoutLeft-BrCMpwSK.js";import"./use-mcp-tools-D4YogNCG.js";import"./types-Bn0LA8cd.js";import"./use-capability-WgQvudy9.js";import"./shell-route-loading-DzfmbJgx.js";import"./index-DhKsoRDO.js";import"./alert-dialog-C8bis9BK.js";import"./switch-DZeUpv7n.js";import"./Play-DdLK5xgI.js";import"./use-debounced-autosave-Cs0wa2AV.js";import"./index-pDmuEeOe.js";import"./sidebar-BEDmuINV.js";import"./sheet-C_eprANm.js";import"./search-input-BaC0E9To.js";import"./github-repo-picker-CY9IQCxY.js";import"./use-navigate-to-agent-C8HlpzKH.js";import"./Users01-Dy2qezq_.js";import"./use-secrets-B9PZDKXf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-D7SZK2nR.js";import"./DotsVertical-DVx42NIt.js";import"./select-model-CWt1Bknh.js";import"./use-automations-Chypf-85.js";import"./monaco-editor-CjxWYC_f.js";import"./automation-runs-QwVqCO49.js";import"./table-D62tnfqw.js";import"./use-members-4evhu5YD.js";import"./use-org-auth-client-DXrbIv3b.js";import"./task-status-CFNgHUT3.js";import"./automation-list-row-DyIqsqOZ.js";import"./Globe04-CtEF3BRe.js";import"./HardDrive-7UiN3uqO.js";import"./Sun-1K7RcAWZ.js";import"./Palette-D_iY1hQ7.js";import"./Shield01-Wa9NR2vn.js";import"./use-clock-tick-BmlWLziO.js";import"./use-copy-mZgO-NLO.js";import"./content-blocks-o63cs2vh.js";import"./calendar-CEJilXwV.js";import"./image-field-DouDEOlb.js";import"./use-file-configs-BoDiyEPN.js";function gr(l){const e=Le.c(38),{open:r,initialName:i,autoLabel:m,isPending:h,onSubmit:v,onOpenChange:f}=l,d=h===void 0?!1:h,[S,b]=w.useState(i),[P,N]=w.useState(r);r!==P&&(N(r),r&&b(i));let y;e[0]!==d||e[1]!==f?(y=ee=>{!ee&&!d&&f(!1)},e[0]=d,e[1]=f,e[2]=y):y=e[2];const j=y;let o;e[3]!==d||e[4]!==S||e[5]!==v?(o=async ee=>{ee.preventDefault(),!d&&await v(S.trim())},e[3]=d,e[4]=S,e[5]=v,e[6]=o):o=e[6];const x=o;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Mn,{children:"Rename variant"}),e[7]=p):p=e[7];const O=m||"the rule";let I;e[8]!==O?(I=t.jsxs(En,{children:[p,t.jsxs($n,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:O}),"."]})]}),e[8]=O,e[9]=I):I=e[9];let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=V):V=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=ee=>b(ee.target.value),e[11]=c):c=e[11];let R;e[12]!==m||e[13]!==d||e[14]!==S?(R=t.jsxs("div",{className:"space-y-1.5 py-4",children:[V,t.jsx(Fn,{id:"variant-rename-name",value:S,onChange:c,placeholder:m,autoFocus:!0,disabled:d})]}),e[12]=m,e[13]=d,e[14]=S,e[15]=R):R=e[15];let Y;e[16]!==f?(Y=()=>f(!1),e[16]=f,e[17]=Y):Y=e[17];let C;e[18]!==d||e[19]!==Y?(C=t.jsx(Fe,{type:"button",variant:"outline",onClick:Y,disabled:d,children:"Cancel"}),e[18]=d,e[19]=Y,e[20]=C):C=e[20];let Q;e[21]!==d?(Q=d?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=Q):Q=e[22];let D;e[23]!==d||e[24]!==Q?(D=t.jsx(Fe,{type:"submit",disabled:d,children:Q}),e[23]=d,e[24]=Q,e[25]=D):D=e[25];let z;e[26]!==C||e[27]!==D?(z=t.jsxs(On,{children:[C,D]}),e[26]=C,e[27]=D,e[28]=z):z=e[28];let M;e[29]!==x||e[30]!==z||e[31]!==I||e[32]!==R?(M=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:x,children:[I,R,z]})}),e[29]=x,e[30]=z,e[31]=I,e[32]=R,e[33]=M):M=e[33];let U;return e[34]!==j||e[35]!==r||e[36]!==M?(U=t.jsx(Kn,{open:r,onOpenChange:j,children:M}),e[34]=j,e[35]=r,e[36]=M,e[37]=U):U=e[37],U}function It(l,e,r,i,m){const h={...l[e]};if(m.length>1){const v=h.sections,f=[...v?.variants??[]];f[i]&&(f[i]={...f[i],value:r}),h.sections={...v,variants:f}}else h.sections=r;return h}function vr(l){return structuredClone(l)}function Sr(l){return!l.isSavedBlock&&!l.isMultivariate&&!l.isHidden}function _n(l){const e=l.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function kn(l,e){const r=l.trim();return r?r.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,r)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(r)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function br(l){return l.schema?.definitions??l.schema?.$defs??{}}function xr(l,e){const r=br(e),i=r[btoa(l)];if(!i)return;let m=typeof i.image=="string"?i.image:void 0;if(!m&&Array.isArray(i.allOf)){const h=i.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function yr(l,e){if(!e)return;const r=sa(l);if(!r)return;const i=xr(r.resolveType,e);if(!i)return;const m=Ga(i,r.data);if(m)return er(m)}const jr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_r="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 wn(l){return Array.from({length:l},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ns(l){return l.map((e,r)=>({...e,index:r}))}function kr(l,e){if(e===l.length)return l;if(e<l.length)return ns(l.slice(0,e));const r=Array.from({length:e-l.length},(i,m)=>({id:crypto.randomUUID(),index:l.length+m}));return[...l,...r]}function ss(l){const e=Le.c(20),{section:r,raw:i,meta:m}=l,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==m||e[1]!==i?(f=i&&m?yr(i,m):void 0,e[0]=m,e[1]=i,e[2]=f):f=e[2];const d=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(qa,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let b;e[4]!==d?(b=d&&t.jsx("img",{src:d,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=d,e[5]=b):b=e[5];let P;e[6]!==v||e[7]!==h?(P=h?{color:ra}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=P):P=e[8];let N;e[9]!==P?(N=t.jsx(Ut,{className:"h-4 w-4 shrink-0",style:P}),e[9]=P,e[10]=N):N=e[10];const y=r.isHidden&&"line-through opacity-50";let j;e[11]!==y?(j=Ce("min-w-0 flex-1 truncate text-sm font-medium",y),e[11]=y,e[12]=j):j=e[12];let o;e[13]!==r.label||e[14]!==j?(o=t.jsx("span",{className:j,children:r.label}),e[13]=r.label,e[14]=j,e[15]=o):o=e[15];let x;return e[16]!==b||e[17]!==N||e[18]!==o?(x=t.jsxs(t.Fragment,{children:[S,b,N,o]}),e[16]=b,e[17]=N,e[18]=o,e[19]=x):x=e[19],x}function as(l,e){const r=l.isSavedBlock===!0,i=l.isMultivariate===!0;return Ce("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?jr:i?"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)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(l){const e=Le.c(64),{section:r,raw:i,meta:m,sortableId:h,selected:v,onSelect:f,onDelete:d,onDuplicate:S,onMakeReusable:b,onToggleHidden:P,onToggleLazy:N,onAddVariant:y,onDetach:j}=l,o=i?Tn(i.__resolveType??""):!1;let x;e[0]!==r?(x=aa(r),e[0]=r,e[1]=x):x=e[1];const p=x;let O;e[2]!==h?(O={id:h,animateLayoutChanges:Tr},e[2]=h,e[3]=O):O=e[3];const{attributes:I,listeners:V,setNodeRef:c,transform:R,isDragging:Y}=Jn(O);let C;e[4]!==R?(C=Yn.Transform.toString(R?{...R,x:0}:null),e[4]=R,e[5]=C):C=e[5];const Q=Y?0:void 0;let D;e[6]!==C||e[7]!==Q?(D={transform:C,opacity:Q},e[6]=C,e[7]=Q,e[8]=D):D=e[8];const z=D;let M;e[9]!==r?(M=Sr(r),e[9]=r,e[10]=M):M=e[10];const U=M,ee="button",Se=0;let se;e[11]!==f?(se=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),f())},e[11]=f,e[12]=se):se=e[12];const W=Y?"cursor-grabbing":"cursor-pointer";let ae;e[13]!==r||e[14]!==v||e[15]!==W?(ae=Ce("touch-none transition-colors",W,as(r,v)),e[13]=r,e[14]=v,e[15]=W,e[16]=ae):ae=e[16];let te;e[17]!==m||e[18]!==i||e[19]!==r?(te=t.jsx(ss,{section:r,raw:i,meta:m}),e[17]=m,e[18]=i,e[19]=r,e[20]=te):te=e[20];const E=!r.isMultivariate&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ce("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),N()},onPointerDown:Dr,children:t.jsx(Ya,{className:Ce("h-3.5 w-3.5",o&&"text-yellow-500")})})}),t.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let le;e[21]!==P||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(le=!r.isMultivariate&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ce("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),P()},onPointerDown:Cr,children:r.isHidden?t.jsx(Ja,{className:"h-3.5 w-3.5"}):t.jsx(Ua,{className:"h-3.5 w-3.5"})})}),t.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=P,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=le):le=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(zn,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Rr,onPointerDown:Nr,children:t.jsx(Vn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let ne;e[26]!==S?(ne=K=>{K.stopPropagation(),S()},e[26]=S,e[27]=ne):ne=e[27];let re;e[28]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx(Wa,{className:"h-4 w-4"}),e[28]=re):re=e[28];let H;e[29]!==ne?(H=t.jsxs(nt,{onClick:ne,children:[re,"Duplicate"]}),e[29]=ne,e[30]=H):H=e[30];let $;e[31]!==p||e[32]!==y?($=p&&t.jsxs(nt,{className:tr,onClick:K=>{K.stopPropagation(),y()},children:[t.jsx(An,{className:"h-4 w-4"}),"Add variant"]}),e[31]=p,e[32]=y,e[33]=$):$=e[33];let B;e[34]!==U||e[35]!==b?(B=U&&t.jsxs(nt,{className:_r,onClick:K=>{K.stopPropagation(),b()},children:[t.jsx(Ut,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=U,e[35]=b,e[36]=B):B=e[36];let oe;e[37]!==j||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(oe=r.isSavedBlock===!0&&!r.isMultivariate&&t.jsxs(nt,{onClick:K=>{K.stopPropagation(),j()},children:[t.jsx(Ut,{className:"h-4 w-4"}),"Detach"]}),e[37]=j,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=oe):oe=e[40];let pe;e[41]!==d?(pe=K=>{K.stopPropagation(),d()},e[41]=d,e[42]=pe):pe=e[42];let he;e[43]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Ln,{className:"h-4 w-4"}),e[43]=he):he=e[43];let de;e[44]!==pe?(de=t.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:pe,children:[he,"Delete"]}),e[44]=pe,e[45]=de):de=e[45];let ce;e[46]!==H||e[47]!==$||e[48]!==B||e[49]!==oe||e[50]!==de?(ce=t.jsxs(In,{children:[X,t.jsxs(Hn,{align:"end",className:"w-44",children:[H,$,B,oe,de]})]}),e[46]=H,e[47]=$,e[48]=B,e[49]=oe,e[50]=de,e[51]=ce):ce=e[51];let q;return e[52]!==I||e[53]!==V||e[54]!==f||e[55]!==c||e[56]!==z||e[57]!==ae||e[58]!==te||e[59]!==E||e[60]!==le||e[61]!==ce||e[62]!==se?(q=t.jsxs("div",{ref:c,style:z,...I,...V,role:ee,tabIndex:Se,onClick:f,onKeyDown:se,className:ae,children:[te,E,le,ce]}),e[52]=I,e[53]=V,e[54]=f,e[55]=c,e[56]=z,e[57]=ae,e[58]=te,e[59]=E,e[60]=le,e[61]=ce,e[62]=se,e[63]=q):q=e[63],q}function Nr(l){return l.stopPropagation()}function Rr(l){return l.stopPropagation()}function Cr(l){return l.stopPropagation()}function Dr(l){return l.stopPropagation()}function Tr(){return!1}function Pr(l){const e=Le.c(90),{listKey:r,rawSections:i,sections:m,meta:h,selectedIndex:v,onSelect:f,onReorder:d,onDelete:S,onDuplicate:b,onMakeReusable:P,onToggleHidden:N,onToggleLazy:y,onAddVariant:j,onDetach:o,onAddSection:x,canAddSection:p}=l,O=p===void 0?!0:p;let I;e[0]!==m.length?(I=()=>wn(m.length),e[0]=m.length,e[1]=I):I=e[1];const[V,c]=w.useState(I),[R,Y]=w.useState(null),[C,Q]=w.useState(r),[D,z]=w.useState(m.length),M=w.useRef(!1);C!==r?(Q(r),z(m.length),c(wn(m.length))):D!==m.length&&(z(m.length),c(A=>kr(A,m.length)));let U;e[2]===Symbol.for("react.memo_cache_sentinel")?(U={activationConstraint:{distance:8}},e[2]=U):U=e[2];let ee;e[3]===Symbol.for("react.memo_cache_sentinel")?(ee={coordinateGetter:Zn},e[3]=ee):ee=e[3];const Se=Un(_t(qn,U),_t(Wn,ee));let se;e[4]!==V?(se=V.map(Vr),e[4]=V,e[5]=se):se=e[5];const W=se;let ae;e[6]===Symbol.for("react.memo_cache_sentinel")?(ae=A=>{Y(String(A.active.id))},e[6]=ae):ae=e[6];const te=ae;let E;e[7]!==W||e[8]!==d?(E=A=>{Y(null);const{active:F,over:Z}=A;if(!Z||F.id===Z.id)return;const ze=W.indexOf(String(F.id)),He=W.indexOf(String(Z.id));ze===-1||He===-1||(c(We=>ns(mt([...We],ze,He))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),d?.(ze,He))},e[7]=W,e[8]=d,e[9]=E):E=e[9];const le=E;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Y(null)},e[10]=X):X=e[10];const ne=X;let re,H,$,B,oe,pe,he,de,ce,q,K,De,ke,Ee,we;if(e[11]!==R||e[12]!==O||e[13]!==V||e[14]!==W||e[15]!==le||e[16]!==h||e[17]!==x||e[18]!==j||e[19]!==S||e[20]!==o||e[21]!==b||e[22]!==P||e[23]!==f||e[24]!==N||e[25]!==y||e[26]!==i||e[27]!==m||e[28]!==v||e[29]!==Se){Ee=Symbol.for("react.early_return_sentinel");e:{const A=F=>{M.current||f(F)};if(e[45]!==R||e[46]!==O||e[47]!==V||e[48]!==x||e[49]!==i||e[50]!==m){const F=R?V.find(Z=>Z.id===R):null;if(B=F!=null?m[F.index]:null,$=F!=null?i[F.index]:void 0,V.length===0){let Z;e[54]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Z):Z=e[54];const ze=!O;let He;e[55]===Symbol.for("react.memo_cache_sentinel")?(He=t.jsx(Wt,{size:14}),e[55]=He):He=e[55];let We;e[56]!==x||e[57]!==ze?(We=t.jsxs("div",{className:"space-y-2",children:[Z,t.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:ze,onClick:x,children:[He,"Add section"]})]}),e[56]=x,e[57]=ze,e[58]=We):We=e[58],Ee=We;break e}ke=Ce(F&&"cursor-grabbing"),e[45]=R,e[46]=O,e[47]=V,e[48]=x,e[49]=i,e[50]=m,e[51]=$,e[52]=B,e[53]=ke}else $=e[51],B=e[52],ke=e[53];H=Qn,de=Se,ce=Xn,q=te,K=le,De=ne,re=Gn,pe=W,he=Qa,we="space-y-1",oe=V.map(F=>{const Z=m[F.index];return Z?t.jsx(wr,{sortableId:F.id,section:Z,raw:i[F.index],meta:h,selected:v===F.index,onSelect:()=>A(F.index),onDelete:()=>S(F.index),onDuplicate:()=>b(F.index),onMakeReusable:()=>P(F.index),onToggleHidden:()=>N(F.index),onToggleLazy:()=>y(F.index),onAddVariant:()=>j(F.index),onDetach:()=>o(F.index)},F.id):null})}e[11]=R,e[12]=O,e[13]=V,e[14]=W,e[15]=le,e[16]=h,e[17]=x,e[18]=j,e[19]=S,e[20]=o,e[21]=b,e[22]=P,e[23]=f,e[24]=N,e[25]=y,e[26]=i,e[27]=m,e[28]=v,e[29]=Se,e[30]=re,e[31]=H,e[32]=$,e[33]=B,e[34]=oe,e[35]=pe,e[36]=he,e[37]=de,e[38]=ce,e[39]=q,e[40]=K,e[41]=De,e[42]=ke,e[43]=Ee,e[44]=we}else re=e[30],H=e[31],$=e[32],B=e[33],oe=e[34],pe=e[35],he=e[36],de=e[37],ce=e[38],q=e[39],K=e[40],De=e[41],ke=e[42],Ee=e[43],we=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Te;e[59]!==oe||e[60]!==we?(Te=t.jsx("div",{className:we,children:oe}),e[59]=oe,e[60]=we,e[61]=Te):Te=e[61];let $e;e[62]!==re||e[63]!==pe||e[64]!==he||e[65]!==Te?($e=t.jsx(re,{items:pe,strategy:he,children:Te}),e[62]=re,e[63]=pe,e[64]=he,e[65]=Te,e[66]=$e):$e=e[66];let Oe;e[67]!==$||e[68]!==B||e[69]!==h?(Oe=B?t.jsx("div",{className:Ce("cursor-grabbing shadow-lg ring-1 ring-border/60",as(B,!1)),children:t.jsx(ss,{section:B,raw:$,meta:h})}):null,e[67]=$,e[68]=B,e[69]=h,e[70]=Oe):Oe=e[70];let be;e[71]!==Oe?(be=t.jsx(es,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=be):be=e[72];let Be;e[73]!==H||e[74]!==de||e[75]!==ce||e[76]!==q||e[77]!==K||e[78]!==De||e[79]!==$e||e[80]!==be?(Be=t.jsxs(H,{sensors:de,collisionDetection:ce,onDragStart:q,onDragEnd:K,onDragCancel:De,children:[$e,be]}),e[73]=H,e[74]=de,e[75]=ce,e[76]=q,e[77]=K,e[78]=De,e[79]=$e,e[80]=be,e[81]=Be):Be=e[81];const Pe=!O;let ue;e[82]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Wt,{size:14}),e[82]=ue):ue=e[82];let ie;e[83]!==x||e[84]!==Pe?(ie=t.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Pe,onClick:x,children:[ue,"Add section"]}),e[83]=x,e[84]=Pe,e[85]=ie):ie=e[85];let Ne;return e[86]!==ke||e[87]!==Be||e[88]!==ie?(Ne=t.jsxs("div",{className:ke,children:[Be,ie]}),e[86]=ke,e[87]=Be,e[88]=ie,e[89]=Ne):Ne=e[89],Ne}function Vr(l){return l.id}const Ar="oklch(0.65 0.15 160)",rs="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Jt(l){const e=Le.c(5),{rule:r,matchers:i}=l,m=r?.__resolveType??"";let h;if(e[0]!==i||e[1]!==m){const S=i.find(b=>b.resolveType===m)?.iconName??nr(m);h=La(S),e[0]=i,e[1]=m,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=t.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function Nn(l){return l.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function Ht(l){return l.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Mr(l){return l.map((e,r)=>({...e,index:r}))}function Er(l){const e=Le.c(51),{entry:r,sortableId:i,isActive:m,canDelete:h,decofile:v,meta:f,matchers:d,onSelect:S,onRename:b,onDelete:P}=l;let N;e[0]!==i?(N={id:i,animateLayoutChanges:Br},e[0]=i,e[1]=N):N=e[1];const{attributes:y,listeners:j,setNodeRef:o,transform:x,isDragging:p}=Jn(N);let O;e[2]!==x?(O=Yn.Transform.toString(x?{...x,y:0}:null),e[2]=x,e[3]=O):O=e[3];const I=p?0:void 0;let V;e[4]!==O||e[5]!==I?(V={transform:O,opacity:I},e[4]=O,e[5]=I,e[6]=V):V=e[6];const c=V,R=f??void 0;let Y;e[7]!==v||e[8]!==r.variant.rule||e[9]!==R?(Y=jt(r.variant.rule,v,R),e[7]=v,e[8]=r.variant.rule,e[9]=R,e[10]=Y):Y=e[10];const C=Y,Q=m?rs:"text-muted-foreground hover:bg-muted hover:text-foreground",D=p?"cursor-grabbing":"cursor-grab";let z;e[11]!==Q||e[12]!==D?(z=Ce("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",Q,D),e[11]=Q,e[12]=D,e[13]=z):z=e[13];let M;e[14]!==C||e[15]!==d?(M=t.jsx(Jt,{rule:C,matchers:d}),e[14]=C,e[15]=d,e[16]=M):M=e[16];let U;e[17]!==r.variant.label?(U=t.jsx("span",{className:"truncate",children:r.variant.label}),e[17]=r.variant.label,e[18]=U):U=e[18];let ee;e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==M||e[23]!==U?(ee=t.jsxs("button",{type:"button",...y,...j,onClick:S,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[M,U]}),e[19]=y,e[20]=j,e[21]=S,e[22]=M,e[23]=U,e[24]=ee):ee=e[24];const Se=`Actions for ${r.variant.label}`,se=m&&"opacity-100";let W;e[25]!==se?(W=Ce("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",se),e[25]=se,e[26]=W):W=e[26];let ae;e[27]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Vn,{size:12}),e[27]=ae):ae=e[27];let te;e[28]!==Se||e[29]!==W?(te=t.jsx(zn,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":Se,onClick:Or,onPointerDown:$r,className:W,children:ae})}),e[28]=Se,e[29]=W,e[30]=te):te=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(fr,{size:14}),e[31]=E):E=e[31];let le;e[32]!==b?(le=t.jsxs(nt,{onClick:b,children:[E,"Rename"]}),e[32]=b,e[33]=le):le=e[33];let X;e[34]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Za,{}),e[34]=X):X=e[34];const ne=!h;let re;e[35]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx(Ln,{size:14}),e[35]=re):re=e[35];let H;e[36]!==P||e[37]!==ne?(H=t.jsxs(nt,{variant:"destructive",disabled:ne,onClick:P,children:[re,"Delete"]}),e[36]=P,e[37]=ne,e[38]=H):H=e[38];let $;e[39]!==le||e[40]!==H?($=t.jsxs(Hn,{align:"start",className:"w-36",children:[le,X,H]}),e[39]=le,e[40]=H,e[41]=$):$=e[41];let B;e[42]!==te||e[43]!==$?(B=t.jsxs(In,{children:[te,$]}),e[42]=te,e[43]=$,e[44]=B):B=e[44];let oe;return e[45]!==o||e[46]!==c||e[47]!==ee||e[48]!==B||e[49]!==z?(oe=t.jsxs("div",{ref:o,style:c,className:z,children:[ee,B]}),e[45]=o,e[46]=c,e[47]=ee,e[48]=B,e[49]=z,e[50]=oe):oe=e[50],oe}function $r(l){return l.stopPropagation()}function Or(l){return l.stopPropagation()}function Br(){return!1}function Kr(l){const e=Le.c(13),{variant:r,decofile:i,meta:m,matchers:h}=l,v=m??void 0;let f;e[0]!==i||e[1]!==v||e[2]!==r.rule?(f=jt(r.rule,i,v),e[0]=i,e[1]=v,e[2]=r.rule,e[3]=f):f=e[3];const d=f;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=Ce("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",rs),e[4]=S):S=e[4];let b;e[5]!==d||e[6]!==h?(b=t.jsx(Jt,{rule:d,matchers:h}),e[5]=d,e[6]=h,e[7]=b):b=e[7];let P;e[8]!==r.label?(P=t.jsx("span",{className:"truncate",children:r.label}),e[8]=r.label,e[9]=P):P=e[9];let N;return e[10]!==b||e[11]!==P?(N=t.jsxs("div",{className:S,children:[b,P]}),e[10]=b,e[11]=P,e[12]=N):N=e[12],N}function Fr(l){const e=Le.c(77),{listKey:r,variants:i,activeIndex:m,decofile:h,meta:v,matchers:f,onSelect:d,onReorder:S,onRename:b,onDelete:P,onAdd:N}=l;let y;e[0]!==i?(y=()=>Ht(i),e[0]=i,e[1]=y):y=e[1];const[j,o]=w.useState(y),[x,p]=w.useState(null),[O,I]=w.useState(r),[V,c]=w.useState(i.length);let R;e[2]!==i?(R=()=>Nn(i),e[2]=i,e[3]=R):R=e[3];const[Y,C]=w.useState(R),Q=w.useRef(!1),D=Nn(i);O!==r?(I(r),c(i.length),C(D),o(Ht(i))):V!==i.length?(c(i.length),C(D),o(Ht(i))):Y!==D&&(C(D),o(ie=>i.map((Ne,A)=>({id:ie[A]?.id??crypto.randomUUID(),index:A,variant:Ne}))));let z;e[4]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[4]=z):z=e[4];let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:Zn},e[5]=M):M=e[5];const U=Un(_t(qn,z),_t(Wn,M));let ee;e[6]!==j?(ee=j.map(Lr),e[6]=j,e[7]=ee):ee=e[7];const Se=ee,se=i.length>1;let W;e[8]!==j?(W=ie=>{const Ne=String(ie.active.id);p(j.find(A=>A.id===Ne)??null)},e[8]=j,e[9]=W):W=e[9];const ae=W;let te;e[10]!==Se||e[11]!==S?(te=ie=>{p(null);const{active:Ne,over:A}=ie;if(!A||Ne.id===A.id)return;const F=Se.indexOf(String(Ne.id)),Z=Se.indexOf(String(A.id));F===-1||Z===-1||(o(ze=>Mr(mt([...ze],F,Z))),Q.current=!0,requestAnimationFrame(()=>{Q.current=!1}),S(F,Z))},e[10]=Se,e[11]=S,e[12]=te):te=e[12];const E=te;let le;e[13]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{p(null)},e[13]=le):le=e[13];const X=le;let ne,re,H,$,B,oe,pe,he,de,ce,q,K;if(e[14]!==x||e[15]!==m||e[16]!==se||e[17]!==h||e[18]!==j||e[19]!==Se||e[20]!==E||e[21]!==ae||e[22]!==f||e[23]!==v||e[24]!==P||e[25]!==b||e[26]!==d||e[27]!==U){const ie=A=>{Q.current||d(A)};q="flex items-center border-b shrink-0";const Ne=x&&"cursor-grabbing";e[40]!==Ne?(ce=Ce("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",Ne),e[40]=Ne,e[41]=ce):ce=e[41],re=Qn,B=U,oe=Xn,pe=ae,he=E,de=X,ne=Gn,K=Se,H=Xa,$=j.map(A=>t.jsx(Er,{sortableId:A.id,entry:A,isActive:A.index===m,canDelete:se,decofile:h,meta:v,matchers:f,onSelect:()=>ie(A.index),onRename:()=>b(A.index),onDelete:()=>P(A.index)},A.id)),e[14]=x,e[15]=m,e[16]=se,e[17]=h,e[18]=j,e[19]=Se,e[20]=E,e[21]=ae,e[22]=f,e[23]=v,e[24]=P,e[25]=b,e[26]=d,e[27]=U,e[28]=ne,e[29]=re,e[30]=H,e[31]=$,e[32]=B,e[33]=oe,e[34]=pe,e[35]=he,e[36]=de,e[37]=ce,e[38]=q,e[39]=K}else ne=e[28],re=e[29],H=e[30],$=e[31],B=e[32],oe=e[33],pe=e[34],he=e[35],de=e[36],ce=e[37],q=e[38],K=e[39];let De;e[42]!==ne||e[43]!==H||e[44]!==$||e[45]!==K?(De=t.jsx(ne,{items:K,strategy:H,children:$}),e[42]=ne,e[43]=H,e[44]=$,e[45]=K,e[46]=De):De=e[46];let ke;e[47]!==x||e[48]!==h||e[49]!==f||e[50]!==v?(ke=x?t.jsx(Kr,{variant:x.variant,decofile:h,meta:v,matchers:f}):null,e[47]=x,e[48]=h,e[49]=f,e[50]=v,e[51]=ke):ke=e[51];let Ee;e[52]!==ke?(Ee=t.jsx(es,{dropAnimation:null,children:ke}),e[52]=ke,e[53]=Ee):Ee=e[53];let we;e[54]!==re||e[55]!==B||e[56]!==oe||e[57]!==pe||e[58]!==he||e[59]!==de||e[60]!==De||e[61]!==Ee?(we=t.jsxs(re,{sensors:B,collisionDetection:oe,onDragStart:pe,onDragEnd:he,onDragCancel:de,children:[De,Ee]}),e[54]=re,e[55]=B,e[56]=oe,e[57]=pe,e[58]=he,e[59]=de,e[60]=De,e[61]=Ee,e[62]=we):we=e[62];let Te;e[63]!==ce||e[64]!==we?(Te=t.jsx("div",{className:ce,children:we}),e[63]=ce,e[64]=we,e[65]=Te):Te=e[65];let $e;e[66]===Symbol.for("react.memo_cache_sentinel")?($e={color:Ar},e[66]=$e):$e=e[66];let Oe;e[67]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Wt,{size:14}),e[67]=Oe):Oe=e[67];let be;e[68]!==N?(be=t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:$e,onClick:N,children:Oe})}),e[68]=N,e[69]=be):be=e[69];let Be;e[70]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx(rt,{side:"bottom",children:"Add variant"}),e[70]=Be):Be=e[70];let Pe;e[71]!==be?(Pe=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(st,{children:[be,Be]})}),e[71]=be,e[72]=Pe):Pe=e[72];let ue;return e[73]!==q||e[74]!==Te||e[75]!==Pe?(ue=t.jsxs("div",{className:q,children:[Te,Pe]}),e[73]=q,e[74]=Te,e[75]=Pe,e[76]=ue):ue=e[76],ue}function Lr(l){return l.id}function zr(l){const e=Le.c(37),{open:r,onOpenChange:i,defaultBlockId:m,isPending:h,onSubmit:v}=l,f=m===void 0?"":m,d=h===void 0?!1:h,[S,b]=w.useState(f),[P,N]=w.useState(r);r!==P&&(N(r),r&&b(f));let y;e[0]!==d||e[1]!==i?(y=U=>{!U&&!d&&i(!1)},e[0]=d,e[1]=i,e[2]=y):y=e[2];const j=y;let o;e[3]!==S||e[4]!==d||e[5]!==v?(o=async U=>{U.preventDefault();const ee=S.trim();!ee||d||await v(ee)},e[3]=S,e[4]=d,e[5]=v,e[6]=o):o=e[6];const x=o;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs(En,{children:[t.jsx(Mn,{children:"Save as global"}),t.jsx($n,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=p):p=e[7];let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=O):O=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=U=>b(U.target.value),e[9]=I):I=e[9];let V;e[10]!==S||e[11]!==d?(V=t.jsxs("div",{className:"py-4 space-y-2",children:[O,t.jsx(Fn,{id:"block-id",value:S,onChange:I,placeholder:"MyNewBlock",autoFocus:!0,disabled:d})]}),e[10]=S,e[11]=d,e[12]=V):V=e[12];let c;e[13]!==i?(c=()=>i(!1),e[13]=i,e[14]=c):c=e[14];let R;e[15]!==d||e[16]!==c?(R=t.jsx(Fe,{type:"button",variant:"outline",onClick:c,disabled:d,children:"Cancel"}),e[15]=d,e[16]=c,e[17]=R):R=e[17];let Y;e[18]!==S||e[19]!==d?(Y=!S.trim()||d,e[18]=S,e[19]=d,e[20]=Y):Y=e[20];let C;e[21]!==d?(C=d?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=C):C=e[22];let Q;e[23]!==Y||e[24]!==C?(Q=t.jsx(Fe,{type:"submit",disabled:Y,children:C}),e[23]=Y,e[24]=C,e[25]=Q):Q=e[25];let D;e[26]!==R||e[27]!==Q?(D=t.jsxs(On,{children:[R,Q]}),e[26]=R,e[27]=Q,e[28]=D):D=e[28];let z;e[29]!==x||e[30]!==D||e[31]!==V?(z=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:x,children:[p,V,D]})}),e[29]=x,e[30]=D,e[31]=V,e[32]=z):z=e[32];let M;return e[33]!==j||e[34]!==r||e[35]!==z?(M=t.jsx(Kn,{open:r,onOpenChange:j,children:z}),e[33]=j,e[34]=r,e[35]=z,e[36]=M):M=e[36],M}function Rn(l){const e=Le.c(15),{schema:r,value:i,onChange:m,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:d}=l;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0];const[b,P]=w.useState(S);let N;e[1]!==b?(N=b.length>0&&t.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[t.jsx("button",{type:"button",onClick:()=>P([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:t.jsx(Ka,{className:"size-3.5"})}),b.map((o,x)=>{const p=x===b.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[x>0&&t.jsx(Pn,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>P(b.slice(0,x+1)),title:o,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",p?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${x}`)})]}),e[1]=b,e[2]=N):N=e[2];let y;e[3]!==b||e[4]!==v||e[5]!==h||e[6]!==m||e[7]!==f||e[8]!==d||e[9]!==r||e[10]!==i?(y=t.jsx(ts,{schema:r,value:i,onChange:m,basePath:"",breadcrumbPath:b,onBreadcrumbChange:P,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:d}),e[3]=b,e[4]=v,e[5]=h,e[6]=m,e[7]=f,e[8]=d,e[9]=r,e[10]=i,e[11]=y):y=e[11];let j;return e[12]!==N||e[13]!==y?(j=t.jsxs("div",{className:"space-y-2",children:[N,y]}),e[12]=N,e[13]=y,e[14]=j):j=e[14],j}function Cn(l){const e=Le.c(21),{activeSchema:r,formValue:i,formResetKey:m,onFormChange:h,onBreadcrumbChange:v,breadcrumbPath:f,emptyMessage:d,beforeForm:S,seoResolveType:b,siteDefaultSeo:P,meta:N,decofile:y,onSaveReferencedBlock:j,sandbox:o}=l;let x;e[0]!==f?(x=f===void 0?[]:f,e[0]=f,e[1]=x):x=e[1];const p=x;let O;e[2]!==r||e[3]!==p||e[4]!==y||e[5]!==m||e[6]!==i||e[7]!==N||e[8]!==v||e[9]!==h||e[10]!==j||e[11]!==o||e[12]!==b||e[13]!==P?(O=r&&i?b?t.jsx(mr,{schema:r,resolveType:b,value:i,formResetKey:m,onChange:h,onBreadcrumbChange:v,siteDefaultSeo:P}):t.jsx(ts,{schema:r,value:i,onChange:h,basePath:"",breadcrumbPath:p,onBreadcrumbChange:v,meta:N,decofile:y,onSaveReferencedBlock:j,sandbox:o},m):null,e[2]=r,e[3]=p,e[4]=y,e[5]=m,e[6]=i,e[7]=N,e[8]=v,e[9]=h,e[10]=j,e[11]=o,e[12]=b,e[13]=P,e[14]=O):O=e[14];const I=O;let V;e[15]!==d||e[16]!==I?(V=I??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=I,e[17]=V):V=e[17];let c;return e[18]!==S||e[19]!==V?(c=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[S,V]})}),e[18]=S,e[19]=V,e[20]=c):c=e[20],c}const Ir="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Hr(l,e){return va(l,e,tt)}function Ur(l){const e=Le.c(13),{pageKey:r,initialName:i,initialPath:m,onFieldChange:h}=l,[v,f]=w.useState(i),[d,S]=w.useState(m),[b,P]=w.useState(r);b!==r&&(P(r),f(i),S(m));let N;e[0]!==h?(N=p=>{f(p.target.value),h("name",p.target.value)},e[0]=h,e[1]=N):N=e[1];let y;e[2]!==v||e[3]!==N?(y=t.jsx("input",{type:"text",value:v,onChange:N,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=v,e[3]=N,e[4]=y):y=e[4];let j;e[5]!==h?(j=p=>{S(p.target.value),h("path",p.target.value)},e[5]=h,e[6]=j):j=e[6];let o;e[7]!==d||e[8]!==j?(o=t.jsx("input",{type:"text",value:d,onChange:j,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=d,e[8]=j,e[9]=o):o=e[9];let x;return e[10]!==y||e[11]!==o?(x=t.jsxs("div",{className:"space-y-1",children:[y,o]}),e[10]=y,e[11]=o,e[12]=x):x=e[12],x}function Dn(l){const e=Le.c(6),{onClick:r}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(An,{size:14}),e[0]=i):i=e[0];let m;e[1]!==r?(m=t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:i})}),e[1]=r,e[2]=m):m=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(rt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let v;return e[4]!==m?(v=t.jsxs(st,{children:[m,h]}),e[4]=m,e[5]=v):v=e[5],v}function Pl({orgSlug:l,virtualMcpId:e,branch:r,previewReady:i=!0,previewUrl:m,currentPath:h,activePageBlockKey:v=null,activeGlobalBlockKey:f=null,externalSelectedIndex:d,onSaved:S,initialEditSeo:b=!1,onExitSeo:P,onViewJsonFile:N,onVariantPreviewOverride:y}){const j=i?{orgSlug:l,virtualMcpId:e,branch:r,previewUrl:m}:null,{data:o,isLoading:x}=oa(j),{data:p,isLoading:O}=ia(j),I=la(),V=I?.entity?.id===e?I.entity.metadata?.siteSlug??null:null,[c,R]=w.useState(null),[Y,C]=w.useState(null),[Q,D]=w.useState(null),[z,M]=w.useState(0),[U,ee]=w.useState(void 0),[Se,se]=w.useState(null),[W,ae]=w.useState(null),[te,E]=w.useState([]),[le,X]=w.useState(0),[ne,re]=w.useState(null),[H,$]=w.useState(null),[B,oe]=w.useState(!0),[pe,he]=w.useState(!1),[de,ce]=w.useState(!1),[q,K]=w.useState(b),[De,ke]=w.useState(b);b&&!De&&(ke(!0),K(!0),R(null),C(null),D(null),E([])),!b&&De&&ke(!1);const[Ee,we]=w.useState(null),[Te,$e]=w.useState(void 0),[Oe,be]=w.useState([]),[Be,Pe]=w.useState(0),[ue,ie]=w.useState(0),[Ne,A]=w.useState(null),[F,Z]=w.useState(null),[ze,He]=w.useState(null),We=ta(),os=`${l}/${e}/${r}`,kt=ca({orgSlug:l,virtualMcpId:e,branch:r}),[is,ls]=w.useState(h),[cs,us]=w.useState(v),[ds,ms]=w.useState(f);(is!==h||cs!==v||ds!==f)&&(queueMicrotask(()=>kt.flush()),ls(h),us(v),ms(f),R(null),C(null),D(null),M(0),se(null),ae(null),ie(0),A(null),Z(null),E([]),X(n=>n+1),K(!1),we(null),$e(void 0),be([]),Pe(n=>n+1));const Ve=ua({orgSlug:l,virtualMcpId:e,branch:r}),ft=hr((n,s)=>{Ve.mutate({blockKey:n,data:s},{onSuccess:()=>S?.(),onError:a=>fe.error(`Save failed: ${a.message}`)})}),Yt=da({orgSlug:l,virtualMcpId:e,branch:r}),[wt,Zt]=w.useState(!1),Nt=w.useRef(null),ot=w.useRef(null),it=w.useRef(null),Rt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!i||x||O)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(qt,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!p)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const fs=ma(o),ve=!!f,Ke=ve?null:fa(fs,h,v),_=ve?f:Ke?.key??null,Ct=ve&&f?o[f]:void 0,Qt=ve&&f&&Ct?pa(f,Ct):ve&&f?f:"",pt=!ve&&_&&o[_]?o[_]:null,Dt=q&&o&&p&&_&&Ke?jn(o,{kind:"page",pageKey:_,pageName:String(Ke.name??""),path:String(Ke.path??"")},p):null,ps=q?pt?.seo:void 0,Tt=Te!==void 0?Te:ps,hs=q?rr(Tt):void 0,gs=Dt?.seoTypeOptions??[],vs=q&&p?or(p):"",Xt=Ee??hs??{},Pt=q&&Dt?ir(Xt,Dt):null,Ss=q&&Pt&&lr(Tt)?bt(Pt,p):null,bs=q?cr(o,p)?.seoData:void 0,Ae=ve?[{label:"Default",sections:[{__resolveType:f}]}]:Hr(pt?.sections,o??{}),ht=Ae.length>1,_e=Math.min(z,Ae.length-1),Xe=Ae[_e],J=Xe?.sections??[],Re=xt(J,o),Gt=!ve&&ha(pt?.sections);if(ve&&f&&ze!==f){He(f);const n=J[0],s=Re[0];if(n&&s){R(0),ie(0),E([]);const a=et(n,s,o);a&&(C(a.data),D(a.resolveType),Z(null),A(null))}}!ve&&ze!==null&&He(null),qe.current={rawSections:J,parsedSections:Re,decofile:o??{},activePageKey:_,pageVariants:Ae,variantIndex:_e,sectionVariantIndex:ue,selectedSectionIndex:c};const xs=()=>({multivariate:Gt,index:_e,variants:Ae.map(n=>({rule:n.rule}))}),en=(n,s)=>{if(!y)return;if(!_||!Gt||n.length<=1){y(null);return}const a=bn(_,{multivariate:!0,index:s,variants:n},o,p);y(a.length>0?a:null)},lt=(n,s,a)=>{if(!y)return;if(!_){y(null);return}const u=xs(),g=bn(_,u,o,p);if(!n||s<0){y(g.length>0?g:null);return}const T=Aa({pageKey:_,page:u,sectionIndex:s,sectionLazy:Re[s]?.isLazy??!1,mvObj:n,selectedVariantIndex:a,decofile:o,meta:p}),k=[...g,...T];y(k.length>0?k:null)},Je=(n,s,a,u=c??-1,g=!1)=>{const T=Qe(n,s);if(!T){C(null),D(null),Z(null),A(null),g&<(null,u,a);return}const L=vn(T,tt)[a];if(!L){C(null),D(null),Z(null),A(null),g&<(null,u,a);return}const ge=Sa(L.value,o);C(ge?.data??null),D(ge?.resolveType??null);const{resolveType:G,formValue:me}=Kt(L.rule,o,p??void 0);Z(G),A(me),g&<(T,u,a)};if(d!==void 0&&d!==U&&(ee(d??null),typeof d=="number")){const n=J[d],s=Re[d];if(n&&s)if(R(d),ie(0),E([]),X(a=>a+1),s.isMultivariate)Je(n,s,0,d);else{const a=et(n,s,o);a?(C(a.data),D(a.resolveType)):(C(null),D(null)),Z(null),A(null)}}const gt={orgSlug:l,virtualMcpId:e,branch:r,previewUrl:m??void 0,siteSlug:V},Vt=Q&&p?bt(Q,p):null,Ie=(n,s)=>{if(!_)return;const a=It(o,_,n,_e,Ae);Ve.mutate({blockKey:_,data:a},{onSuccess:()=>s?.onSuccess?.()??S?.(),onError:u=>fe.error(`Save failed: ${u.message}`)})},ct=()=>{R(null),C(null),D(null),ie(0),A(null),Z(null),E([]),X(n=>n+1)},ys=(n,s)=>{Nt.current&&clearTimeout(Nt.current);const a=qe.current.sectionVariantIndex;Nt.current=setTimeout(()=>{const{rawSections:u,parsedSections:g,decofile:T,activePageKey:k,pageVariants:L,variantIndex:ge}=qe.current,G=u[s];if(!G)return;const me=g[s];if(!me)return;if(me.isSavedBlock){const ye=me.isLazy?G.section?.__resolveType??G.__resolveType:G.__resolveType;Ve.mutate({blockKey:ye,data:n},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}if(!k)return;const xe={...T[k]},Me=[...u];if(me.isMultivariate){const ye=Qe(G,me);if(!ye||!k)return;const je=$a(ye,a,n);Me[s]=dt(G,me,je)}else if(me.isHidden){const ye=Tn(G.__resolveType),je=ye?{...G.section}:{...G},Ue=Array.isArray(je.variants)?[...je.variants]:[];Ue[0]&&(Ue[0]={...Ue[0],value:n}),je.variants=Ue,ye?Me[s]={...G,section:je}:Me[s]=je}else me.isLazy?Me[s]={...G,section:n}:Me[s]=n;if(L.length>1){const ye=xe.sections,je=[...ye?.variants??[]];je[ge]&&(je[ge]={...je[ge],value:Me}),xe.sections={...ye,variants:je}}else xe.sections=Me;Ve.mutate({blockKey:k,data:xe},{onSuccess:()=>S?.(),onError:ye=>fe.error(`Save failed: ${ye.message}`)})},zt)},js=n=>{R(n),ie(0),E([]),X(g=>g+1);const s=J[n],a=Re[n];if(!s||!a)return;if(a.isMultivariate){Je(s,a,0,n);return}const u=et(s,a,o);if(!u){C(null),D(null),Z(null),A(null),lt(null,n,0);return}C(u.data),D(u.resolveType),Z(null),A(null),lt(null,n,0)},tn=n=>{const s=n;C(s),c!==null&&ys(s,c)},At=n=>{if(!_||!o||!p||!Ke)return;const s={kind:"page",pageKey:_,pageName:String(Ke.name??""),path:String(Ke.path??"")},a=jn(o,s,p);a&&kt.save(_,()=>{const u=We.getQueryData(na.decofile(os))?.[_];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const g={...u,...Rt.current};return Rt.current={},n?.raw!==void 0?{...g,seo:n.raw}:n?.inner!==void 0?dr(s,a,g,n.inner):g})},_s=(n,s)=>{_&&(Rt.current[n]=s,At())},ks=(n,s)=>{if(!_)return;const a=mt([...J],n,s);c!==null&&(c===n?R(s):n<c&&s>=c?R(c-1):n>c&&s<=c&&R(c+1)),Ie(a)},ws=n=>{if(!_)return;const s=J.filter((a,u)=>u!==n);c===n?ct():c!==null&&c>n&&R(c-1),Ie(s)},Ns=n=>{if(!_)return;const s=J[n];if(!s)return;const a=[...J];a.splice(n+1,0,vr(s)),c!==null&&c>n&&R(c+1),Ie(a)},Rs=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a||a.isMultivariate)return;const u=a.isHidden?Ca(s):Da(s);if(!u)return;const g=[...J];g[n]=u,c===n&&ct(),Ie(g)},Cs=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a||a.isMultivariate)return;const u=Ra(s);if(!u)return;const g=[...J];g[n]=u,c===n&&ct(),Ie(g)},Ds=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a?.isSavedBlock)return;const u=et(s,a,o);if(!u?.data)return;const{name:g,...T}=u.data,k=[...J];a.isLazy?k[n]={...s,section:T}:k[n]=T,c===n&&ct(),Ie(k)},Ts=n=>{if(!_)return;const s=[...J,{__resolveType:n.resolveType}],a=s.length-1;Ie(s,{onSuccess:()=>{he(!1),R(a),ie(0),E([]),X(k=>k+1);const u=s[a],g=xt(s,o)[a];if(!u||!g)return;if(g.isMultivariate){Je(u,g,0);return}const T=et(u,g,o);if(!T){C(null),D(null),Z(null),A(null);return}C(T.data),D(T.resolveType),Z(null),A(null)}})},Ps=n=>{if(c===null)return;const s=J[c],a=Re[c];!s||!a?.isMultivariate||(ie(n),E([]),X(u=>u+1),Je(s,a,n,c,!0))},Vs=n=>{if(c===null||!_)return;const s=J[c],a=Re[c];if(!s||!a?.isMultivariate)return;const u=Qe(s,a);if(!u)return;const g=wa(u,n);if(!g){fe.error("Cannot delete the only variant.");return}const T=[...J];T[c]=dt(s,a,g);const k=g.variants;let L=ue;n===ue?L=Math.min(n,k.length-1):n<ue&&(L=ue-1),ie(L),E([]),X(ge=>ge+1),Je(T[c],a,L),Ie(T)},As=n=>{if(c===null||!_)return;const s=J[c],a=Re[c];if(!s||!a?.isMultivariate)return;const u=Qe(s,a);if(!u)return;const g=Na(u,n),T=[...J];T[c]=dt(s,a,g);const k=n+1;ie(k),E([]),X(L=>L+1),Je(T[c],a,k),Ie(T)},Ms=(n,s)=>{if(c===null||!_||n===s)return;const a=J[c],u=Re[c];if(!a||!u?.isMultivariate)return;const g=Qe(a,u);if(!g)return;const T=_a(g,n,s),k=[...J];k[c]=dt(a,u,T);let L=ue;ue===n?L=s:n<ue&&s>=ue?L=ue-1:n>ue&&s<=ue&&(L=ue+1),ie(L),Je(k[c],u,L),Ie(k)},Mt=n=>{const s=n??c;if(s===null||!_)return;const a=J[s],u=Re[s];if(!a||!u)return;const g=ba(a,u);if(!g){fe.error("This section cannot have variants.");return}const T=[...J];T[s]=g.section;const k=xt(T,o)[s];if(!k?.isMultivariate){fe.error("Could not add variant.");return}R(s),ie(g.newVariantIndex),E([]),X(L=>L+1),Je(g.section,k,g.newVariantIndex,s),Ie(T)},Es=()=>{if(c===null||!_)return;const n=J[c],s=Re[c];if(!n||!s?.isMultivariate)return;const a=Qe(n,s);if(!a)return;const u=ka(n,s,a);if(!u){fe.error("Could not remove variants.");return}const g=[...J];g[c]=u;const T=xt(g,o)[c];if(!T)return;ie(0),Z(null),A(null),E([]),X(L=>L+1);const k=et(u,T,o);k?(C(k.data),D(k.resolveType)):(C(null),D(null)),lt(null,c,0),Ie(g)},$s=async n=>{if(ne===null||!_)return;const s=kn(n,o);if(s){fe.error(s);return}const a=J[ne],u=Re[ne];if(!a||!u)return;const g=et(a,u,o);if(!g){fe.error("This section cannot be saved as global.");return}const T={...g.data,name:n};try{await Ve.mutateAsync({blockKey:n,data:T});const k=[...J];k[ne]={__resolveType:n},await Ve.mutateAsync({blockKey:_,data:It(o,_,k,_e,Ae)}),c===ne&&ct(),re(null),fe.success(`Saved global block "${n}"`),S?.()}catch(k){fe.error(k instanceof Error?k.message:"Failed to save global block")}},nn=Xe?.rule;if(ht&&c===null&&W===null&&nn){const{resolveType:n,formValue:s}=Kt(nn,o??{},p??void 0);ae(n),se(s)}const vt=p?sr(p):[],Os=!ve&&!!(m&&p&&o),sn=W&&p?bt(W,p):null,Bs=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),it.current&&(clearTimeout(it.current),it.current=null)},an=async(n,s)=>{if(!(Oa(s,n,p)>0))try{await Yt.mutateAsync({blockKey:n})}catch(a){fe.error(a instanceof Error?a.message:"Could not delete matcher block")}},rn=n=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:u}=qe.current;if(!s)return;const g={...a[s]},T={...g.sections},k=[...T.variants??[]],L=k[u],ge=L?.rule;if(Ft(ge,a,p)){const G=ge?.__resolveType??"",me=a[G],xe=typeof me?.name=="string"?me.name:G,{__resolveType:Me,...ye}=n;Ve.mutate({blockKey:G,data:Lt(Me??"",ye,xe)},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}L&&(k[u]={...L,rule:n}),g.sections={...T,variants:k},Ve.mutate({blockKey:s,data:g},{onSuccess:()=>S?.(),onError:G=>fe.error(`Save failed: ${G.message}`)})},zt)},Ks=n=>{ae(n);const s=n?{__resolveType:n}:{__resolveType:xn};se({}),rn(s)},Fs=n=>{const s=n;se(s);const a=W?{__resolveType:W,...s}:{...s};rn(a)},on=n=>{it.current&&clearTimeout(it.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=qe.current;s!==null&&(it.current=setTimeout(()=>{const{rawSections:u,parsedSections:g,decofile:T,activePageKey:k,pageVariants:L,variantIndex:ge}=qe.current;if(!k)return;const G=u[s],me=g[s];if(!G||!me?.isMultivariate)return;const xe=Qe(G,me);if(!xe)return;const Me=Ea(xe,a,n),ye=[...u];ye[s]=dt(G,me,Me);const je=It(T,k,ye,ge,L);Ve.mutate({blockKey:k,data:je},{onSuccess:()=>S?.(),onError:Ue=>fe.error(`Save failed: ${Ue.message}`)})},zt))},Ls=n=>{Z(n),A({}),on(n?{__resolveType:n}:{__resolveType:xn})},zs=n=>{const s=n;A(s);const a=F?{__resolveType:F,...s}:{...s};on(a)};if(!ve&&!Ke)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(ve&&!Ct)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Ye=c!==null?Re[c]??null:null,ln=c!==null?J[c]:null,cn=ln&&Ye?.isMultivariate?Qe(ln,Ye):null,St=cn?vn(cn,tt):[],Et=Math.min(ue,Math.max(St.length-1,0)),$t=St[Et]??null,Ge=Ye?.isMultivariate===!0,un=c!==null&&Ye!==null,ut=un&&(Ge||!!(Vt&&Y)),Is=ut&&!ve&&Ye?.isSavedBlock===!0,Ze=ve||Is,Hs=ve?Qt:Ye?.label??"",dn=F&&p?bt(F,p):null,Ot=ut&&(!ve||te.length>0)?ve?[Qt,...te]:[Ke.name,Ye.label,...Ge&&$t?[$t.label]:[],...te]:[],Us=q&&Ke?[Ke.name,"SEO",...Oe]:[],mn=q?Us:Ze?Ot.length>0?Ot:[Hs]:Ot,fn=()=>{if(!_)return;const n=o[_],s=xa(n.sections,J);if(!s)return;const a=ya(s);Ve.mutate({blockKey:_,data:{...n,sections:s}},{onSuccess:()=>{M(a),R(null),C(null),D(null),E([]),se(null),ae(null)},onError:u=>fe.error(`Save failed: ${u.message}`)})},pn=(n,s,a)=>{if(!_)return;const u=o[_],g=u.sections;if(!g||typeof g!="object"||Array.isArray(g))return;const T=g;if(!Array.isArray(T.variants))return;const k=n([...T.variants]);if(!k)return;const L=Ma(T,k),ge={...o,[_]:{...u,sections:L}};Ve.mutate({blockKey:_,data:ge[_]},{onSuccess:()=>{s?.(),a&&an(a,ge)},onError:G=>fe.error(`Save failed: ${G.message}`)})},Ws=n=>{$(null),M(n),R(null),C(null),D(null),E([]);const s=Ae[n]?.rule,{resolveType:a,formValue:u}=Kt(s,o??{},p??void 0);ae(a),se(u),en(Ae.map(g=>({rule:g.rule})),n)},qs=(n,s)=>{if(n===s)return;let a=_e;_e===n?a=s:n<_e&&s>=_e?a=_e-1:n>_e&&s<=_e&&(a=_e+1),M(a);const u=mt(Ae.map(g=>({rule:g.rule})),n,s);en(u,a),pn(g=>mt(g,n,s))},Js=n=>{const s=Ae[n]?.rule,a=ja(s,o??{},p??void 0);pn(u=>u.length<=1?null:(u.splice(n,1),u),()=>{Ae.length-1===1?M(0):n<_e?M(_e-1):n===_e&&M(Math.max(0,n-1)),R(null),C(null),D(null),E([]),se(null),ae(null)},a)},Ys=async(n,s)=>{Bs();const a=qe.current.activePageKey,u=qe.current.decofile;if(!a)return;const g=u[a],T=g.sections;if(!T||typeof T!="object"||Array.isArray(T))return;const k=T;if(!Array.isArray(k.variants))return;const L=[...k.variants],ge=L[n];if(!ge?.rule||typeof ge.rule!="object"){fe.error("This variant has no matcher rule to rename.");return}const G=ge.rule,me=s.trim();Zt(!0);try{if(!me){if(!Ft(G,u,p)){$(null);return}const Bt=G.__resolveType??"";L[n]={...ge,rule:Ta(G,u,p)};const gn={...u,[a]:{...g,sections:{...k,variants:L}}};await Ve.mutateAsync({blockKey:a,data:gn[a]}),await an(Bt,gn),$(null),S?.();return}const xe=Pa(G,u,p);if(!xe){fe.error("Could not read this variant's matcher rule.");return}if(xe.blockKey){await Ve.mutateAsync({blockKey:xe.blockKey,data:Lt(xe.resolveType,xe.data,me)}),$(null),S?.();return}const Me=_n(me),ye=kn(Me,u);if(ye){fe.error(ye);return}const je=Lt(xe.resolveType,xe.data,me);let Ue=null;try{await Ve.mutateAsync({blockKey:Me,data:je}),Ue=Me,L[n]={...ge,rule:Va(Me)},await Ve.mutateAsync({blockKey:a,data:{...g,sections:{...k,variants:L}}}),Ue=null}catch(Bt){throw Ue&&await Yt.mutateAsync({blockKey:Ue}).catch(()=>{}),Bt}$(null),fe.success(`Saved matcher as global block "${me}"`),S?.()}catch(xe){fe.error(xe instanceof Error?xe.message:"Failed to rename variant")}finally{Zt(!1)}},hn=()=>{ct()},Zs=n=>{we(n),At({inner:n})},Qs=n=>{$e(n),At({raw:n})},Xs=()=>{we(null),be([])},Gs=()=>Pe(n=>n+1),ea=n=>{if(q){if(n===0){kt.flush(),K(!1),we(null),$e(void 0),be([]),Pe(a=>a+1),P?.();return}if(n===1){be([]),Pe(a=>a+1);return}be(Oe.slice(0,n-1)),Pe(a=>a+1);return}if(ve){E(te.slice(0,n)),X(a=>a+1);return}if(n===0){hn();return}if(n===1){E([]),X(a=>a+1);return}if(Ge&&n===2){E([]),X(a=>a+1);return}const s=Ge?2:1;E(te.slice(0,n-s))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:Ze||ut||q?t.jsxs("div",{className:Ce("border-b px-3 py-2.5",Ze&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ve&&ht&&Xe&&t.jsxs("button",{type:"button",onClick:hn,title:`Editing in variant: ${Xe.label}`,className:Ce("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ir),children:[t.jsx(Jt,{rule:jt(Xe.rule,o??{},p??void 0),matchers:vt}),t.jsx("span",{className:"max-w-[160px] truncate",children:Xe.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:mn.map((n,s)=>{const a=s===mn.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&t.jsx(Pn,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>ea(s),title:n,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?Ze?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Ze?"text-foreground/80":"text-muted-foreground",Ze?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:n})]},`${n}-${s}`)})}),Ze&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(Ha,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(rt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),un&&!Ge&&!Ye?.isHidden&&_&&t.jsx(Dn,{onClick:()=>Mt()})]}),Ze&&t.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(Ur,{pageKey:_,initialName:Ke.name,initialPath:Ke.path,onFieldChange:_s})}),t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>K(!0),children:t.jsx(za,{size:14})})}),t.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>N&&_?N(_):ce(!0),children:t.jsx(Ia,{size:14})})}),t.jsx(rt,{side:"bottom",children:"View JSON"})]}),t.jsx(Dn,{onClick:fn})]})}),ht&&!ut&&!q&&_&&t.jsx(Fr,{listKey:_,variants:Ae,activeIndex:_e,decofile:o??{},meta:p,matchers:vt,onSelect:Ws,onReorder:qs,onRename:$,onDelete:Js,onAdd:fn}),q?t.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:pt&&_?t.jsx(ur,{rawSeo:Tt,innerSeo:Xt,defaultResolveType:vs,seoSchema:Ss,activeResolveType:Pt,seoTypeOptions:gs,formResetKey:Be,siteDefaultSeo:bs,onBreadcrumbChange:be,onPersistRaw:Qs,onInnerChange:Zs,onClearForm:Xs,onBumpFormKey:Gs}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?t.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ge&&St.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ar,{listKey:`${_??""}:${c??""}`,variants:St.map((n,s)=>({index:s,label:n.label})),selectedIndex:Et,onSelect:Ps,onDuplicate:As,onDelete:Vs,onRemoveAll:Es,onReorder:Ms,onAdd:()=>Mt()}),Ge&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(yn,{currentRt:F??"",currentLabel:tt($t?.rule),matchers:vt,onSelect:Ls}),dn&&Ne&&t.jsx("div",{className:"pt-1",children:t.jsx(Rn,{schema:dn,value:Ne,onChange:zs,meta:p??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${c??"none"}:${Et}:${F??""}`)})]})]}),t.jsx(Cn,{activeSchema:Vt,formValue:Y,formResetKey:le,onFormChange:tn,onBreadcrumbChange:E,breadcrumbPath:te,emptyMessage:"No editable fields for this variant.",meta:p,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})]}):ve?t.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(Cn,{activeSchema:Vt,formValue:Y,formResetKey:le,onFormChange:tn,onBreadcrumbChange:E,breadcrumbPath:te,emptyMessage:"No editable fields for this global block.",meta:p,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})}):t.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&W!==null&&t.jsxs("div",{className:Ce("px-3 border-b",B?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>oe(n=>!n),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":B,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),B?t.jsx(Fa,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx(Ba,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),B&&t.jsxs("div",{className:Ce("space-y-3",wt&&"pointer-events-none opacity-50"),children:[t.jsx(yn,{currentRt:W,currentLabel:Sn(Xe?.rule,o??{},tt,p??void 0),matchers:vt,onSelect:Ks}),sn&&Se&&t.jsx("div",{className:"space-y-3",children:t.jsx(Rn,{schema:sn,value:Se,onChange:Fs,meta:p??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${_e}:${W??""}`)})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx(Pr,{listKey:`${_??""}-${_e}`,rawSections:J,sections:Re,meta:p,selectedIndex:c,onSelect:js,onReorder:ks,onDelete:ws,onDuplicate:Ns,onMakeReusable:re,onToggleHidden:Rs,onToggleLazy:Cs,onAddVariant:Mt,onDetach:Ds,onAddSection:()=>he(!0),canAddSection:Os})})]}),t.jsx(zr,{open:ne!==null,onOpenChange:n=>{n||re(null)},defaultBlockId:ne!==null?_n(Re[ne]?.label??""):"",isPending:Ve.isPending,onSubmit:$s}),m&&t.jsx(pr,{open:pe,onOpenChange:he,meta:p,decofile:o,previewBaseUrl:m,onSelect:Ts}),de&&_&&o&&t.jsx(ga,{open:de,onOpenChange:ce,pageKey:_,decofile:o}),H!==null&&t.jsx(gr,{open:!0,initialName:Ft(Ae[H]?.rule,o??{},p??void 0)?Sn(Ae[H]?.rule,o??{},tt,p??void 0):"",autoLabel:tt(jt(Ae[H]?.rule,o??{},p??void 0)),isPending:wt,onSubmit:async n=>{await Ys(H,n)},onOpenChange:n=>{!n&&!wt&&$(null)}})]})}export{Pl as SectionsEditor};
|
|
1
|
+
import{c as Le,r as w,j as t,B as Fe,i as qt,l as Ce,I as ta,t as fe,K as na}from"./index-Cvc1xn-4.js";import{r as sa,i as Tn,c as aa,G as ra,a as jt,b as oa,d as ia,e as la,f as ca,g as ua,h as da,j as ma,k as fa,l as pa,m as bt,p as xt,n as ha,o as Kt,q as Qe,s as vn,t as Sn,P as ga,v as Ft,w as va,x as Sa,y as ba,z as xa,A as ya,B as ja,C as _a,D as dt,E as ka,F as wa,H as Na,I as Ra,J as Ca,K as Da,L as Ta,M as Pa,N as Lt,O as Va,Q as bn,R as Aa,S as Ma,T as Ea,U as zt,V as $a,W as Oa,X as xn}from"./index-B8LUbsU-.js";import{t as Ba}from"./ChevronDown-BhLFFAly.js";import{n as Ka}from"./ChevronLeft-veOSKT91.js";import{i as Pn}from"./ChevronRight-tj4xbWmM.js";import{n as Fa}from"./ChevronUp-DhHPsDAS.js";import{K as Ut,D as Vn,S as An,l as La,L as za,M as Ia}from"./agent-icon-C4199b3i.js";import{i as Ha}from"./Globe01-CJXHyXNe.js";import{S as yt}from"./scroll-area-BvvyxqKR.js";import{b as st,T as at,a as rt}from"./tooltip-D_DwQRbZ.js";import{a as Mn,D as En,b as $n,e as On,c as Bn,d as Kn}from"./dialog-DDL08EK8.js";import{I as Fn}from"./input-klr_kUC2.js";import{s as Ua,a as Wa}from"./Eye-BfNssVzk.js";import{c as qa}from"./ZoomOut-cYq1CP_X.js";import{b as Ja}from"./Settings02-kQ4zmp5P.js";import{s as Wt}from"./Plus-BRQannbC.js";import{s as Ln}from"./Trash01-BZXmKzie.js";import{i as Ya}from"./Zap-OOZsYg72.js";import{c as nt,a as zn,D as In,b as Hn,g as Za}from"./dropdown-menu-CgCZ8Mte.js";import{u as Un,a as _t,K as Wn,P as qn,b as Jn,C as Yn,s as Zn,d as mt,D as Qn,c as Xn,S as Gn,v as Qa,e as es,h as Xa}from"./sortable.esm-S2exVkMt.js";import{r as Ga,s as er,V as tr,a as nr,u as et,e as sr,S as ar,M as yn,f as tt,b as ts}from"./schema-form-C1MMeEGC.js";import{r as jn,u as rr,d as or,a as ir,i as lr,f as cr,P as ur,b as dr,S as mr}from"./page-seo-form-Io0ovKiN.js";import{i as fr}from"./Tool01-AyuVwnGv.js";import{AddSectionModal as pr}from"./add-section-modal-CZMJAFim.js";import{c as hr}from"./save-referenced-block-oaxGf8K5.js";import"./index-BI3_fNOm.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./studio-tools-D8q7MEyE.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-C6jq364X.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./SearchMd-CttVjXUQ.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./X-DC2HG4lX.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./User01-Dz33ODze.js";import"./Users03-C6siA5mE.js";import"./Stars02-Bo19XD__.js";import"./XClose-BcOWKb5Q.js";import"./CheckCircle-DOPRdShL.js";import"./FilterLines-D2obCQW_.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./ZapSquare-ok_KEP9c.js";import"./Star01-CFj5T2Jl.js";import"./Upload01-D4ez0Mu3.js";import"./AlertCircle-BZqAQZBb.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./select-DwFQDgcX.js";import"./ArrowRight-6qgvW498.js";import"./tabs-C0Vh3iPJ.js";import"./XCircle-DJDxYBys.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./use-connection-C39BUY8e.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./integration-icon-gcYOl2yq.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./textarea-2KmLad1y.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./Monitor01-CvNVisni.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./skeleton-C-tuNjEZ.js";import"./Key01-xj4UQriu.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./ArrowUpRight-CUPFfker.js";import"./Stars01-C4FyHP_L.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./LinkExternal01-DtLsAcMy.js";import"./index-B2quJDhU.js";import"./file-type-icon-GfohFxwW.js";import"./LayoutLeft-C9-KQh8d.js";import"./use-mcp-tools-DnBnaQLn.js";import"./types-zC94Gae_.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./switch-skMKJ2GI.js";import"./Play-C0DhAO4u.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./sheet-XVV7S5b8.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./Users01-aBataJ8N.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-D7_rFTiD.js";import"./DotsVertical-kcsdrim_.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Shield01-BZZVugf_.js";import"./use-clock-tick-CqrkSCF6.js";import"./use-copy-DM9BeeKg.js";import"./content-blocks-o63cs2vh.js";import"./calendar-DDwlGULz.js";import"./image-field-CEHk9cpM.js";import"./use-file-configs-CvRusjpd.js";function gr(l){const e=Le.c(38),{open:r,initialName:i,autoLabel:m,isPending:h,onSubmit:v,onOpenChange:f}=l,d=h===void 0?!1:h,[S,b]=w.useState(i),[P,N]=w.useState(r);r!==P&&(N(r),r&&b(i));let y;e[0]!==d||e[1]!==f?(y=ee=>{!ee&&!d&&f(!1)},e[0]=d,e[1]=f,e[2]=y):y=e[2];const j=y;let o;e[3]!==d||e[4]!==S||e[5]!==v?(o=async ee=>{ee.preventDefault(),!d&&await v(S.trim())},e[3]=d,e[4]=S,e[5]=v,e[6]=o):o=e[6];const x=o;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Mn,{children:"Rename variant"}),e[7]=p):p=e[7];const O=m||"the rule";let I;e[8]!==O?(I=t.jsxs(En,{children:[p,t.jsxs($n,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:O}),"."]})]}),e[8]=O,e[9]=I):I=e[9];let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=V):V=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=ee=>b(ee.target.value),e[11]=c):c=e[11];let R;e[12]!==m||e[13]!==d||e[14]!==S?(R=t.jsxs("div",{className:"space-y-1.5 py-4",children:[V,t.jsx(Fn,{id:"variant-rename-name",value:S,onChange:c,placeholder:m,autoFocus:!0,disabled:d})]}),e[12]=m,e[13]=d,e[14]=S,e[15]=R):R=e[15];let Y;e[16]!==f?(Y=()=>f(!1),e[16]=f,e[17]=Y):Y=e[17];let C;e[18]!==d||e[19]!==Y?(C=t.jsx(Fe,{type:"button",variant:"outline",onClick:Y,disabled:d,children:"Cancel"}),e[18]=d,e[19]=Y,e[20]=C):C=e[20];let Q;e[21]!==d?(Q=d?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=Q):Q=e[22];let D;e[23]!==d||e[24]!==Q?(D=t.jsx(Fe,{type:"submit",disabled:d,children:Q}),e[23]=d,e[24]=Q,e[25]=D):D=e[25];let z;e[26]!==C||e[27]!==D?(z=t.jsxs(On,{children:[C,D]}),e[26]=C,e[27]=D,e[28]=z):z=e[28];let M;e[29]!==x||e[30]!==z||e[31]!==I||e[32]!==R?(M=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:x,children:[I,R,z]})}),e[29]=x,e[30]=z,e[31]=I,e[32]=R,e[33]=M):M=e[33];let U;return e[34]!==j||e[35]!==r||e[36]!==M?(U=t.jsx(Kn,{open:r,onOpenChange:j,children:M}),e[34]=j,e[35]=r,e[36]=M,e[37]=U):U=e[37],U}function It(l,e,r,i,m){const h={...l[e]};if(m.length>1){const v=h.sections,f=[...v?.variants??[]];f[i]&&(f[i]={...f[i],value:r}),h.sections={...v,variants:f}}else h.sections=r;return h}function vr(l){return structuredClone(l)}function Sr(l){return!l.isSavedBlock&&!l.isMultivariate&&!l.isHidden}function _n(l){const e=l.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function kn(l,e){const r=l.trim();return r?r.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,r)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(r)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function br(l){return l.schema?.definitions??l.schema?.$defs??{}}function xr(l,e){const r=br(e),i=r[btoa(l)];if(!i)return;let m=typeof i.image=="string"?i.image:void 0;if(!m&&Array.isArray(i.allOf)){const h=i.allOf.find(v=>typeof v.$ref=="string")?.$ref;if(typeof h=="string"){const v=h.replace("#/definitions/",""),f=r[v];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function yr(l,e){if(!e)return;const r=sa(l);if(!r)return;const i=xr(r.resolveType,e);if(!i)return;const m=Ga(i,r.data);if(m)return er(m)}const jr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_r="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 wn(l){return Array.from({length:l},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ns(l){return l.map((e,r)=>({...e,index:r}))}function kr(l,e){if(e===l.length)return l;if(e<l.length)return ns(l.slice(0,e));const r=Array.from({length:e-l.length},(i,m)=>({id:crypto.randomUUID(),index:l.length+m}));return[...l,...r]}function ss(l){const e=Le.c(20),{section:r,raw:i,meta:m}=l,h=r.isSavedBlock===!0,v=r.isMultivariate===!0;let f;e[0]!==m||e[1]!==i?(f=i&&m?yr(i,m):void 0,e[0]=m,e[1]=i,e[2]=f):f=e[2];const d=f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(qa,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=S):S=e[3];let b;e[4]!==d?(b=d&&t.jsx("img",{src:d,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=d,e[5]=b):b=e[5];let P;e[6]!==v||e[7]!==h?(P=h?{color:ra}:v?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=v,e[7]=h,e[8]=P):P=e[8];let N;e[9]!==P?(N=t.jsx(Ut,{className:"h-4 w-4 shrink-0",style:P}),e[9]=P,e[10]=N):N=e[10];const y=r.isHidden&&"line-through opacity-50";let j;e[11]!==y?(j=Ce("min-w-0 flex-1 truncate text-sm font-medium",y),e[11]=y,e[12]=j):j=e[12];let o;e[13]!==r.label||e[14]!==j?(o=t.jsx("span",{className:j,children:r.label}),e[13]=r.label,e[14]=j,e[15]=o):o=e[15];let x;return e[16]!==b||e[17]!==N||e[18]!==o?(x=t.jsxs(t.Fragment,{children:[S,b,N,o]}),e[16]=b,e[17]=N,e[18]=o,e[19]=x):x=e[19],x}function as(l,e){const r=l.isSavedBlock===!0,i=l.isMultivariate===!0;return Ce("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?jr:i?"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)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function wr(l){const e=Le.c(64),{section:r,raw:i,meta:m,sortableId:h,selected:v,onSelect:f,onDelete:d,onDuplicate:S,onMakeReusable:b,onToggleHidden:P,onToggleLazy:N,onAddVariant:y,onDetach:j}=l,o=i?Tn(i.__resolveType??""):!1;let x;e[0]!==r?(x=aa(r),e[0]=r,e[1]=x):x=e[1];const p=x;let O;e[2]!==h?(O={id:h,animateLayoutChanges:Tr},e[2]=h,e[3]=O):O=e[3];const{attributes:I,listeners:V,setNodeRef:c,transform:R,isDragging:Y}=Jn(O);let C;e[4]!==R?(C=Yn.Transform.toString(R?{...R,x:0}:null),e[4]=R,e[5]=C):C=e[5];const Q=Y?0:void 0;let D;e[6]!==C||e[7]!==Q?(D={transform:C,opacity:Q},e[6]=C,e[7]=Q,e[8]=D):D=e[8];const z=D;let M;e[9]!==r?(M=Sr(r),e[9]=r,e[10]=M):M=e[10];const U=M,ee="button",Se=0;let se;e[11]!==f?(se=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),f())},e[11]=f,e[12]=se):se=e[12];const W=Y?"cursor-grabbing":"cursor-pointer";let ae;e[13]!==r||e[14]!==v||e[15]!==W?(ae=Ce("touch-none transition-colors",W,as(r,v)),e[13]=r,e[14]=v,e[15]=W,e[16]=ae):ae=e[16];let te;e[17]!==m||e[18]!==i||e[19]!==r?(te=t.jsx(ss,{section:r,raw:i,meta:m}),e[17]=m,e[18]=i,e[19]=r,e[20]=te):te=e[20];const E=!r.isMultivariate&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ce("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),N()},onPointerDown:Dr,children:t.jsx(Ya,{className:Ce("h-3.5 w-3.5",o&&"text-yellow-500")})})}),t.jsx(rt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let le;e[21]!==P||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(le=!r.isMultivariate&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ce("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),P()},onPointerDown:Cr,children:r.isHidden?t.jsx(Ja,{className:"h-3.5 w-3.5"}):t.jsx(Ua,{className:"h-3.5 w-3.5"})})}),t.jsx(rt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=P,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=le):le=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(zn,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Rr,onPointerDown:Nr,children:t.jsx(Vn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let ne;e[26]!==S?(ne=K=>{K.stopPropagation(),S()},e[26]=S,e[27]=ne):ne=e[27];let re;e[28]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx(Wa,{className:"h-4 w-4"}),e[28]=re):re=e[28];let H;e[29]!==ne?(H=t.jsxs(nt,{onClick:ne,children:[re,"Duplicate"]}),e[29]=ne,e[30]=H):H=e[30];let $;e[31]!==p||e[32]!==y?($=p&&t.jsxs(nt,{className:tr,onClick:K=>{K.stopPropagation(),y()},children:[t.jsx(An,{className:"h-4 w-4"}),"Add variant"]}),e[31]=p,e[32]=y,e[33]=$):$=e[33];let B;e[34]!==U||e[35]!==b?(B=U&&t.jsxs(nt,{className:_r,onClick:K=>{K.stopPropagation(),b()},children:[t.jsx(Ut,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=U,e[35]=b,e[36]=B):B=e[36];let oe;e[37]!==j||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(oe=r.isSavedBlock===!0&&!r.isMultivariate&&t.jsxs(nt,{onClick:K=>{K.stopPropagation(),j()},children:[t.jsx(Ut,{className:"h-4 w-4"}),"Detach"]}),e[37]=j,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=oe):oe=e[40];let pe;e[41]!==d?(pe=K=>{K.stopPropagation(),d()},e[41]=d,e[42]=pe):pe=e[42];let he;e[43]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Ln,{className:"h-4 w-4"}),e[43]=he):he=e[43];let de;e[44]!==pe?(de=t.jsxs(nt,{className:"text-destructive focus:text-destructive",onClick:pe,children:[he,"Delete"]}),e[44]=pe,e[45]=de):de=e[45];let ce;e[46]!==H||e[47]!==$||e[48]!==B||e[49]!==oe||e[50]!==de?(ce=t.jsxs(In,{children:[X,t.jsxs(Hn,{align:"end",className:"w-44",children:[H,$,B,oe,de]})]}),e[46]=H,e[47]=$,e[48]=B,e[49]=oe,e[50]=de,e[51]=ce):ce=e[51];let q;return e[52]!==I||e[53]!==V||e[54]!==f||e[55]!==c||e[56]!==z||e[57]!==ae||e[58]!==te||e[59]!==E||e[60]!==le||e[61]!==ce||e[62]!==se?(q=t.jsxs("div",{ref:c,style:z,...I,...V,role:ee,tabIndex:Se,onClick:f,onKeyDown:se,className:ae,children:[te,E,le,ce]}),e[52]=I,e[53]=V,e[54]=f,e[55]=c,e[56]=z,e[57]=ae,e[58]=te,e[59]=E,e[60]=le,e[61]=ce,e[62]=se,e[63]=q):q=e[63],q}function Nr(l){return l.stopPropagation()}function Rr(l){return l.stopPropagation()}function Cr(l){return l.stopPropagation()}function Dr(l){return l.stopPropagation()}function Tr(){return!1}function Pr(l){const e=Le.c(90),{listKey:r,rawSections:i,sections:m,meta:h,selectedIndex:v,onSelect:f,onReorder:d,onDelete:S,onDuplicate:b,onMakeReusable:P,onToggleHidden:N,onToggleLazy:y,onAddVariant:j,onDetach:o,onAddSection:x,canAddSection:p}=l,O=p===void 0?!0:p;let I;e[0]!==m.length?(I=()=>wn(m.length),e[0]=m.length,e[1]=I):I=e[1];const[V,c]=w.useState(I),[R,Y]=w.useState(null),[C,Q]=w.useState(r),[D,z]=w.useState(m.length),M=w.useRef(!1);C!==r?(Q(r),z(m.length),c(wn(m.length))):D!==m.length&&(z(m.length),c(A=>kr(A,m.length)));let U;e[2]===Symbol.for("react.memo_cache_sentinel")?(U={activationConstraint:{distance:8}},e[2]=U):U=e[2];let ee;e[3]===Symbol.for("react.memo_cache_sentinel")?(ee={coordinateGetter:Zn},e[3]=ee):ee=e[3];const Se=Un(_t(qn,U),_t(Wn,ee));let se;e[4]!==V?(se=V.map(Vr),e[4]=V,e[5]=se):se=e[5];const W=se;let ae;e[6]===Symbol.for("react.memo_cache_sentinel")?(ae=A=>{Y(String(A.active.id))},e[6]=ae):ae=e[6];const te=ae;let E;e[7]!==W||e[8]!==d?(E=A=>{Y(null);const{active:F,over:Z}=A;if(!Z||F.id===Z.id)return;const ze=W.indexOf(String(F.id)),He=W.indexOf(String(Z.id));ze===-1||He===-1||(c(We=>ns(mt([...We],ze,He))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),d?.(ze,He))},e[7]=W,e[8]=d,e[9]=E):E=e[9];const le=E;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Y(null)},e[10]=X):X=e[10];const ne=X;let re,H,$,B,oe,pe,he,de,ce,q,K,De,ke,Ee,we;if(e[11]!==R||e[12]!==O||e[13]!==V||e[14]!==W||e[15]!==le||e[16]!==h||e[17]!==x||e[18]!==j||e[19]!==S||e[20]!==o||e[21]!==b||e[22]!==P||e[23]!==f||e[24]!==N||e[25]!==y||e[26]!==i||e[27]!==m||e[28]!==v||e[29]!==Se){Ee=Symbol.for("react.early_return_sentinel");e:{const A=F=>{M.current||f(F)};if(e[45]!==R||e[46]!==O||e[47]!==V||e[48]!==x||e[49]!==i||e[50]!==m){const F=R?V.find(Z=>Z.id===R):null;if(B=F!=null?m[F.index]:null,$=F!=null?i[F.index]:void 0,V.length===0){let Z;e[54]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Z):Z=e[54];const ze=!O;let He;e[55]===Symbol.for("react.memo_cache_sentinel")?(He=t.jsx(Wt,{size:14}),e[55]=He):He=e[55];let We;e[56]!==x||e[57]!==ze?(We=t.jsxs("div",{className:"space-y-2",children:[Z,t.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:ze,onClick:x,children:[He,"Add section"]})]}),e[56]=x,e[57]=ze,e[58]=We):We=e[58],Ee=We;break e}ke=Ce(F&&"cursor-grabbing"),e[45]=R,e[46]=O,e[47]=V,e[48]=x,e[49]=i,e[50]=m,e[51]=$,e[52]=B,e[53]=ke}else $=e[51],B=e[52],ke=e[53];H=Qn,de=Se,ce=Xn,q=te,K=le,De=ne,re=Gn,pe=W,he=Qa,we="space-y-1",oe=V.map(F=>{const Z=m[F.index];return Z?t.jsx(wr,{sortableId:F.id,section:Z,raw:i[F.index],meta:h,selected:v===F.index,onSelect:()=>A(F.index),onDelete:()=>S(F.index),onDuplicate:()=>b(F.index),onMakeReusable:()=>P(F.index),onToggleHidden:()=>N(F.index),onToggleLazy:()=>y(F.index),onAddVariant:()=>j(F.index),onDetach:()=>o(F.index)},F.id):null})}e[11]=R,e[12]=O,e[13]=V,e[14]=W,e[15]=le,e[16]=h,e[17]=x,e[18]=j,e[19]=S,e[20]=o,e[21]=b,e[22]=P,e[23]=f,e[24]=N,e[25]=y,e[26]=i,e[27]=m,e[28]=v,e[29]=Se,e[30]=re,e[31]=H,e[32]=$,e[33]=B,e[34]=oe,e[35]=pe,e[36]=he,e[37]=de,e[38]=ce,e[39]=q,e[40]=K,e[41]=De,e[42]=ke,e[43]=Ee,e[44]=we}else re=e[30],H=e[31],$=e[32],B=e[33],oe=e[34],pe=e[35],he=e[36],de=e[37],ce=e[38],q=e[39],K=e[40],De=e[41],ke=e[42],Ee=e[43],we=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Te;e[59]!==oe||e[60]!==we?(Te=t.jsx("div",{className:we,children:oe}),e[59]=oe,e[60]=we,e[61]=Te):Te=e[61];let $e;e[62]!==re||e[63]!==pe||e[64]!==he||e[65]!==Te?($e=t.jsx(re,{items:pe,strategy:he,children:Te}),e[62]=re,e[63]=pe,e[64]=he,e[65]=Te,e[66]=$e):$e=e[66];let Oe;e[67]!==$||e[68]!==B||e[69]!==h?(Oe=B?t.jsx("div",{className:Ce("cursor-grabbing shadow-lg ring-1 ring-border/60",as(B,!1)),children:t.jsx(ss,{section:B,raw:$,meta:h})}):null,e[67]=$,e[68]=B,e[69]=h,e[70]=Oe):Oe=e[70];let be;e[71]!==Oe?(be=t.jsx(es,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=be):be=e[72];let Be;e[73]!==H||e[74]!==de||e[75]!==ce||e[76]!==q||e[77]!==K||e[78]!==De||e[79]!==$e||e[80]!==be?(Be=t.jsxs(H,{sensors:de,collisionDetection:ce,onDragStart:q,onDragEnd:K,onDragCancel:De,children:[$e,be]}),e[73]=H,e[74]=de,e[75]=ce,e[76]=q,e[77]=K,e[78]=De,e[79]=$e,e[80]=be,e[81]=Be):Be=e[81];const Pe=!O;let ue;e[82]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Wt,{size:14}),e[82]=ue):ue=e[82];let ie;e[83]!==x||e[84]!==Pe?(ie=t.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Pe,onClick:x,children:[ue,"Add section"]}),e[83]=x,e[84]=Pe,e[85]=ie):ie=e[85];let Ne;return e[86]!==ke||e[87]!==Be||e[88]!==ie?(Ne=t.jsxs("div",{className:ke,children:[Be,ie]}),e[86]=ke,e[87]=Be,e[88]=ie,e[89]=Ne):Ne=e[89],Ne}function Vr(l){return l.id}const Ar="oklch(0.65 0.15 160)",rs="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Jt(l){const e=Le.c(5),{rule:r,matchers:i}=l,m=r?.__resolveType??"";let h;if(e[0]!==i||e[1]!==m){const S=i.find(b=>b.resolveType===m)?.iconName??nr(m);h=La(S),e[0]=i,e[1]=m,e[2]=h}else h=e[2];const v=h;if(!v)return null;let f;return e[3]!==v?(f=t.jsx(v,{size:14,className:"shrink-0"}),e[3]=v,e[4]=f):f=e[4],f}function Nn(l){return l.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function Ht(l){return l.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Mr(l){return l.map((e,r)=>({...e,index:r}))}function Er(l){const e=Le.c(51),{entry:r,sortableId:i,isActive:m,canDelete:h,decofile:v,meta:f,matchers:d,onSelect:S,onRename:b,onDelete:P}=l;let N;e[0]!==i?(N={id:i,animateLayoutChanges:Br},e[0]=i,e[1]=N):N=e[1];const{attributes:y,listeners:j,setNodeRef:o,transform:x,isDragging:p}=Jn(N);let O;e[2]!==x?(O=Yn.Transform.toString(x?{...x,y:0}:null),e[2]=x,e[3]=O):O=e[3];const I=p?0:void 0;let V;e[4]!==O||e[5]!==I?(V={transform:O,opacity:I},e[4]=O,e[5]=I,e[6]=V):V=e[6];const c=V,R=f??void 0;let Y;e[7]!==v||e[8]!==r.variant.rule||e[9]!==R?(Y=jt(r.variant.rule,v,R),e[7]=v,e[8]=r.variant.rule,e[9]=R,e[10]=Y):Y=e[10];const C=Y,Q=m?rs:"text-muted-foreground hover:bg-muted hover:text-foreground",D=p?"cursor-grabbing":"cursor-grab";let z;e[11]!==Q||e[12]!==D?(z=Ce("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",Q,D),e[11]=Q,e[12]=D,e[13]=z):z=e[13];let M;e[14]!==C||e[15]!==d?(M=t.jsx(Jt,{rule:C,matchers:d}),e[14]=C,e[15]=d,e[16]=M):M=e[16];let U;e[17]!==r.variant.label?(U=t.jsx("span",{className:"truncate",children:r.variant.label}),e[17]=r.variant.label,e[18]=U):U=e[18];let ee;e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==M||e[23]!==U?(ee=t.jsxs("button",{type:"button",...y,...j,onClick:S,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[M,U]}),e[19]=y,e[20]=j,e[21]=S,e[22]=M,e[23]=U,e[24]=ee):ee=e[24];const Se=`Actions for ${r.variant.label}`,se=m&&"opacity-100";let W;e[25]!==se?(W=Ce("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",se),e[25]=se,e[26]=W):W=e[26];let ae;e[27]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Vn,{size:12}),e[27]=ae):ae=e[27];let te;e[28]!==Se||e[29]!==W?(te=t.jsx(zn,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":Se,onClick:Or,onPointerDown:$r,className:W,children:ae})}),e[28]=Se,e[29]=W,e[30]=te):te=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(fr,{size:14}),e[31]=E):E=e[31];let le;e[32]!==b?(le=t.jsxs(nt,{onClick:b,children:[E,"Rename"]}),e[32]=b,e[33]=le):le=e[33];let X;e[34]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Za,{}),e[34]=X):X=e[34];const ne=!h;let re;e[35]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx(Ln,{size:14}),e[35]=re):re=e[35];let H;e[36]!==P||e[37]!==ne?(H=t.jsxs(nt,{variant:"destructive",disabled:ne,onClick:P,children:[re,"Delete"]}),e[36]=P,e[37]=ne,e[38]=H):H=e[38];let $;e[39]!==le||e[40]!==H?($=t.jsxs(Hn,{align:"start",className:"w-36",children:[le,X,H]}),e[39]=le,e[40]=H,e[41]=$):$=e[41];let B;e[42]!==te||e[43]!==$?(B=t.jsxs(In,{children:[te,$]}),e[42]=te,e[43]=$,e[44]=B):B=e[44];let oe;return e[45]!==o||e[46]!==c||e[47]!==ee||e[48]!==B||e[49]!==z?(oe=t.jsxs("div",{ref:o,style:c,className:z,children:[ee,B]}),e[45]=o,e[46]=c,e[47]=ee,e[48]=B,e[49]=z,e[50]=oe):oe=e[50],oe}function $r(l){return l.stopPropagation()}function Or(l){return l.stopPropagation()}function Br(){return!1}function Kr(l){const e=Le.c(13),{variant:r,decofile:i,meta:m,matchers:h}=l,v=m??void 0;let f;e[0]!==i||e[1]!==v||e[2]!==r.rule?(f=jt(r.rule,i,v),e[0]=i,e[1]=v,e[2]=r.rule,e[3]=f):f=e[3];const d=f;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=Ce("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",rs),e[4]=S):S=e[4];let b;e[5]!==d||e[6]!==h?(b=t.jsx(Jt,{rule:d,matchers:h}),e[5]=d,e[6]=h,e[7]=b):b=e[7];let P;e[8]!==r.label?(P=t.jsx("span",{className:"truncate",children:r.label}),e[8]=r.label,e[9]=P):P=e[9];let N;return e[10]!==b||e[11]!==P?(N=t.jsxs("div",{className:S,children:[b,P]}),e[10]=b,e[11]=P,e[12]=N):N=e[12],N}function Fr(l){const e=Le.c(77),{listKey:r,variants:i,activeIndex:m,decofile:h,meta:v,matchers:f,onSelect:d,onReorder:S,onRename:b,onDelete:P,onAdd:N}=l;let y;e[0]!==i?(y=()=>Ht(i),e[0]=i,e[1]=y):y=e[1];const[j,o]=w.useState(y),[x,p]=w.useState(null),[O,I]=w.useState(r),[V,c]=w.useState(i.length);let R;e[2]!==i?(R=()=>Nn(i),e[2]=i,e[3]=R):R=e[3];const[Y,C]=w.useState(R),Q=w.useRef(!1),D=Nn(i);O!==r?(I(r),c(i.length),C(D),o(Ht(i))):V!==i.length?(c(i.length),C(D),o(Ht(i))):Y!==D&&(C(D),o(ie=>i.map((Ne,A)=>({id:ie[A]?.id??crypto.randomUUID(),index:A,variant:Ne}))));let z;e[4]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[4]=z):z=e[4];let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:Zn},e[5]=M):M=e[5];const U=Un(_t(qn,z),_t(Wn,M));let ee;e[6]!==j?(ee=j.map(Lr),e[6]=j,e[7]=ee):ee=e[7];const Se=ee,se=i.length>1;let W;e[8]!==j?(W=ie=>{const Ne=String(ie.active.id);p(j.find(A=>A.id===Ne)??null)},e[8]=j,e[9]=W):W=e[9];const ae=W;let te;e[10]!==Se||e[11]!==S?(te=ie=>{p(null);const{active:Ne,over:A}=ie;if(!A||Ne.id===A.id)return;const F=Se.indexOf(String(Ne.id)),Z=Se.indexOf(String(A.id));F===-1||Z===-1||(o(ze=>Mr(mt([...ze],F,Z))),Q.current=!0,requestAnimationFrame(()=>{Q.current=!1}),S(F,Z))},e[10]=Se,e[11]=S,e[12]=te):te=e[12];const E=te;let le;e[13]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{p(null)},e[13]=le):le=e[13];const X=le;let ne,re,H,$,B,oe,pe,he,de,ce,q,K;if(e[14]!==x||e[15]!==m||e[16]!==se||e[17]!==h||e[18]!==j||e[19]!==Se||e[20]!==E||e[21]!==ae||e[22]!==f||e[23]!==v||e[24]!==P||e[25]!==b||e[26]!==d||e[27]!==U){const ie=A=>{Q.current||d(A)};q="flex items-center border-b shrink-0";const Ne=x&&"cursor-grabbing";e[40]!==Ne?(ce=Ce("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",Ne),e[40]=Ne,e[41]=ce):ce=e[41],re=Qn,B=U,oe=Xn,pe=ae,he=E,de=X,ne=Gn,K=Se,H=Xa,$=j.map(A=>t.jsx(Er,{sortableId:A.id,entry:A,isActive:A.index===m,canDelete:se,decofile:h,meta:v,matchers:f,onSelect:()=>ie(A.index),onRename:()=>b(A.index),onDelete:()=>P(A.index)},A.id)),e[14]=x,e[15]=m,e[16]=se,e[17]=h,e[18]=j,e[19]=Se,e[20]=E,e[21]=ae,e[22]=f,e[23]=v,e[24]=P,e[25]=b,e[26]=d,e[27]=U,e[28]=ne,e[29]=re,e[30]=H,e[31]=$,e[32]=B,e[33]=oe,e[34]=pe,e[35]=he,e[36]=de,e[37]=ce,e[38]=q,e[39]=K}else ne=e[28],re=e[29],H=e[30],$=e[31],B=e[32],oe=e[33],pe=e[34],he=e[35],de=e[36],ce=e[37],q=e[38],K=e[39];let De;e[42]!==ne||e[43]!==H||e[44]!==$||e[45]!==K?(De=t.jsx(ne,{items:K,strategy:H,children:$}),e[42]=ne,e[43]=H,e[44]=$,e[45]=K,e[46]=De):De=e[46];let ke;e[47]!==x||e[48]!==h||e[49]!==f||e[50]!==v?(ke=x?t.jsx(Kr,{variant:x.variant,decofile:h,meta:v,matchers:f}):null,e[47]=x,e[48]=h,e[49]=f,e[50]=v,e[51]=ke):ke=e[51];let Ee;e[52]!==ke?(Ee=t.jsx(es,{dropAnimation:null,children:ke}),e[52]=ke,e[53]=Ee):Ee=e[53];let we;e[54]!==re||e[55]!==B||e[56]!==oe||e[57]!==pe||e[58]!==he||e[59]!==de||e[60]!==De||e[61]!==Ee?(we=t.jsxs(re,{sensors:B,collisionDetection:oe,onDragStart:pe,onDragEnd:he,onDragCancel:de,children:[De,Ee]}),e[54]=re,e[55]=B,e[56]=oe,e[57]=pe,e[58]=he,e[59]=de,e[60]=De,e[61]=Ee,e[62]=we):we=e[62];let Te;e[63]!==ce||e[64]!==we?(Te=t.jsx("div",{className:ce,children:we}),e[63]=ce,e[64]=we,e[65]=Te):Te=e[65];let $e;e[66]===Symbol.for("react.memo_cache_sentinel")?($e={color:Ar},e[66]=$e):$e=e[66];let Oe;e[67]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Wt,{size:14}),e[67]=Oe):Oe=e[67];let be;e[68]!==N?(be=t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:$e,onClick:N,children:Oe})}),e[68]=N,e[69]=be):be=e[69];let Be;e[70]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx(rt,{side:"bottom",children:"Add variant"}),e[70]=Be):Be=e[70];let Pe;e[71]!==be?(Pe=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(st,{children:[be,Be]})}),e[71]=be,e[72]=Pe):Pe=e[72];let ue;return e[73]!==q||e[74]!==Te||e[75]!==Pe?(ue=t.jsxs("div",{className:q,children:[Te,Pe]}),e[73]=q,e[74]=Te,e[75]=Pe,e[76]=ue):ue=e[76],ue}function Lr(l){return l.id}function zr(l){const e=Le.c(37),{open:r,onOpenChange:i,defaultBlockId:m,isPending:h,onSubmit:v}=l,f=m===void 0?"":m,d=h===void 0?!1:h,[S,b]=w.useState(f),[P,N]=w.useState(r);r!==P&&(N(r),r&&b(f));let y;e[0]!==d||e[1]!==i?(y=U=>{!U&&!d&&i(!1)},e[0]=d,e[1]=i,e[2]=y):y=e[2];const j=y;let o;e[3]!==S||e[4]!==d||e[5]!==v?(o=async U=>{U.preventDefault();const ee=S.trim();!ee||d||await v(ee)},e[3]=S,e[4]=d,e[5]=v,e[6]=o):o=e[6];const x=o;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs(En,{children:[t.jsx(Mn,{children:"Save as global"}),t.jsx($n,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=p):p=e[7];let O;e[8]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=O):O=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=U=>b(U.target.value),e[9]=I):I=e[9];let V;e[10]!==S||e[11]!==d?(V=t.jsxs("div",{className:"py-4 space-y-2",children:[O,t.jsx(Fn,{id:"block-id",value:S,onChange:I,placeholder:"MyNewBlock",autoFocus:!0,disabled:d})]}),e[10]=S,e[11]=d,e[12]=V):V=e[12];let c;e[13]!==i?(c=()=>i(!1),e[13]=i,e[14]=c):c=e[14];let R;e[15]!==d||e[16]!==c?(R=t.jsx(Fe,{type:"button",variant:"outline",onClick:c,disabled:d,children:"Cancel"}),e[15]=d,e[16]=c,e[17]=R):R=e[17];let Y;e[18]!==S||e[19]!==d?(Y=!S.trim()||d,e[18]=S,e[19]=d,e[20]=Y):Y=e[20];let C;e[21]!==d?(C=d?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=d,e[22]=C):C=e[22];let Q;e[23]!==Y||e[24]!==C?(Q=t.jsx(Fe,{type:"submit",disabled:Y,children:C}),e[23]=Y,e[24]=C,e[25]=Q):Q=e[25];let D;e[26]!==R||e[27]!==Q?(D=t.jsxs(On,{children:[R,Q]}),e[26]=R,e[27]=Q,e[28]=D):D=e[28];let z;e[29]!==x||e[30]!==D||e[31]!==V?(z=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:x,children:[p,V,D]})}),e[29]=x,e[30]=D,e[31]=V,e[32]=z):z=e[32];let M;return e[33]!==j||e[34]!==r||e[35]!==z?(M=t.jsx(Kn,{open:r,onOpenChange:j,children:z}),e[33]=j,e[34]=r,e[35]=z,e[36]=M):M=e[36],M}function Rn(l){const e=Le.c(15),{schema:r,value:i,onChange:m,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:d}=l;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0];const[b,P]=w.useState(S);let N;e[1]!==b?(N=b.length>0&&t.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[t.jsx("button",{type:"button",onClick:()=>P([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:t.jsx(Ka,{className:"size-3.5"})}),b.map((o,x)=>{const p=x===b.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[x>0&&t.jsx(Pn,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>P(b.slice(0,x+1)),title:o,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",p?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${x}`)})]}),e[1]=b,e[2]=N):N=e[2];let y;e[3]!==b||e[4]!==v||e[5]!==h||e[6]!==m||e[7]!==f||e[8]!==d||e[9]!==r||e[10]!==i?(y=t.jsx(ts,{schema:r,value:i,onChange:m,basePath:"",breadcrumbPath:b,onBreadcrumbChange:P,meta:h,decofile:v,onSaveReferencedBlock:f,sandbox:d}),e[3]=b,e[4]=v,e[5]=h,e[6]=m,e[7]=f,e[8]=d,e[9]=r,e[10]=i,e[11]=y):y=e[11];let j;return e[12]!==N||e[13]!==y?(j=t.jsxs("div",{className:"space-y-2",children:[N,y]}),e[12]=N,e[13]=y,e[14]=j):j=e[14],j}function Cn(l){const e=Le.c(21),{activeSchema:r,formValue:i,formResetKey:m,onFormChange:h,onBreadcrumbChange:v,breadcrumbPath:f,emptyMessage:d,beforeForm:S,seoResolveType:b,siteDefaultSeo:P,meta:N,decofile:y,onSaveReferencedBlock:j,sandbox:o}=l;let x;e[0]!==f?(x=f===void 0?[]:f,e[0]=f,e[1]=x):x=e[1];const p=x;let O;e[2]!==r||e[3]!==p||e[4]!==y||e[5]!==m||e[6]!==i||e[7]!==N||e[8]!==v||e[9]!==h||e[10]!==j||e[11]!==o||e[12]!==b||e[13]!==P?(O=r&&i?b?t.jsx(mr,{schema:r,resolveType:b,value:i,formResetKey:m,onChange:h,onBreadcrumbChange:v,siteDefaultSeo:P}):t.jsx(ts,{schema:r,value:i,onChange:h,basePath:"",breadcrumbPath:p,onBreadcrumbChange:v,meta:N,decofile:y,onSaveReferencedBlock:j,sandbox:o},m):null,e[2]=r,e[3]=p,e[4]=y,e[5]=m,e[6]=i,e[7]=N,e[8]=v,e[9]=h,e[10]=j,e[11]=o,e[12]=b,e[13]=P,e[14]=O):O=e[14];const I=O;let V;e[15]!==d||e[16]!==I?(V=I??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=I,e[17]=V):V=e[17];let c;return e[18]!==S||e[19]!==V?(c=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[S,V]})}),e[18]=S,e[19]=V,e[20]=c):c=e[20],c}const Ir="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Hr(l,e){return va(l,e,tt)}function Ur(l){const e=Le.c(13),{pageKey:r,initialName:i,initialPath:m,onFieldChange:h}=l,[v,f]=w.useState(i),[d,S]=w.useState(m),[b,P]=w.useState(r);b!==r&&(P(r),f(i),S(m));let N;e[0]!==h?(N=p=>{f(p.target.value),h("name",p.target.value)},e[0]=h,e[1]=N):N=e[1];let y;e[2]!==v||e[3]!==N?(y=t.jsx("input",{type:"text",value:v,onChange:N,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=v,e[3]=N,e[4]=y):y=e[4];let j;e[5]!==h?(j=p=>{S(p.target.value),h("path",p.target.value)},e[5]=h,e[6]=j):j=e[6];let o;e[7]!==d||e[8]!==j?(o=t.jsx("input",{type:"text",value:d,onChange:j,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=d,e[8]=j,e[9]=o):o=e[9];let x;return e[10]!==y||e[11]!==o?(x=t.jsxs("div",{className:"space-y-1",children:[y,o]}),e[10]=y,e[11]=o,e[12]=x):x=e[12],x}function Dn(l){const e=Le.c(6),{onClick:r}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(An,{size:14}),e[0]=i):i=e[0];let m;e[1]!==r?(m=t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:i})}),e[1]=r,e[2]=m):m=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(rt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let v;return e[4]!==m?(v=t.jsxs(st,{children:[m,h]}),e[4]=m,e[5]=v):v=e[5],v}function Tl({orgSlug:l,virtualMcpId:e,branch:r,previewReady:i=!0,previewUrl:m,currentPath:h,activePageBlockKey:v=null,activeGlobalBlockKey:f=null,externalSelectedIndex:d,onSaved:S,initialEditSeo:b=!1,onExitSeo:P,onViewJsonFile:N,onVariantPreviewOverride:y}){const j=i?{orgSlug:l,virtualMcpId:e,branch:r,previewUrl:m}:null,{data:o,isLoading:x}=oa(j),{data:p,isLoading:O}=ia(j),I=la(),V=I?.entity?.id===e?I.entity.metadata?.siteSlug??null:null,[c,R]=w.useState(null),[Y,C]=w.useState(null),[Q,D]=w.useState(null),[z,M]=w.useState(0),[U,ee]=w.useState(void 0),[Se,se]=w.useState(null),[W,ae]=w.useState(null),[te,E]=w.useState([]),[le,X]=w.useState(0),[ne,re]=w.useState(null),[H,$]=w.useState(null),[B,oe]=w.useState(!0),[pe,he]=w.useState(!1),[de,ce]=w.useState(!1),[q,K]=w.useState(b),[De,ke]=w.useState(b);b&&!De&&(ke(!0),K(!0),R(null),C(null),D(null),E([])),!b&&De&&ke(!1);const[Ee,we]=w.useState(null),[Te,$e]=w.useState(void 0),[Oe,be]=w.useState([]),[Be,Pe]=w.useState(0),[ue,ie]=w.useState(0),[Ne,A]=w.useState(null),[F,Z]=w.useState(null),[ze,He]=w.useState(null),We=ta(),os=`${l}/${e}/${r}`,kt=ca({orgSlug:l,virtualMcpId:e,branch:r}),[is,ls]=w.useState(h),[cs,us]=w.useState(v),[ds,ms]=w.useState(f);(is!==h||cs!==v||ds!==f)&&(queueMicrotask(()=>kt.flush()),ls(h),us(v),ms(f),R(null),C(null),D(null),M(0),se(null),ae(null),ie(0),A(null),Z(null),E([]),X(n=>n+1),K(!1),we(null),$e(void 0),be([]),Pe(n=>n+1));const Ve=ua({orgSlug:l,virtualMcpId:e,branch:r}),ft=hr((n,s)=>{Ve.mutate({blockKey:n,data:s},{onSuccess:()=>S?.(),onError:a=>fe.error(`Save failed: ${a.message}`)})}),Yt=da({orgSlug:l,virtualMcpId:e,branch:r}),[wt,Zt]=w.useState(!1),Nt=w.useRef(null),ot=w.useRef(null),it=w.useRef(null),Rt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!i||x||O)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(qt,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!p)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const fs=ma(o),ve=!!f,Ke=ve?null:fa(fs,h,v),_=ve?f:Ke?.key??null,Ct=ve&&f?o[f]:void 0,Qt=ve&&f&&Ct?pa(f,Ct):ve&&f?f:"",pt=!ve&&_&&o[_]?o[_]:null,Dt=q&&o&&p&&_&&Ke?jn(o,{kind:"page",pageKey:_,pageName:String(Ke.name??""),path:String(Ke.path??"")},p):null,ps=q?pt?.seo:void 0,Tt=Te!==void 0?Te:ps,hs=q?rr(Tt):void 0,gs=Dt?.seoTypeOptions??[],vs=q&&p?or(p):"",Xt=Ee??hs??{},Pt=q&&Dt?ir(Xt,Dt):null,Ss=q&&Pt&&lr(Tt)?bt(Pt,p):null,bs=q?cr(o,p)?.seoData:void 0,Ae=ve?[{label:"Default",sections:[{__resolveType:f}]}]:Hr(pt?.sections,o??{}),ht=Ae.length>1,_e=Math.min(z,Ae.length-1),Xe=Ae[_e],J=Xe?.sections??[],Re=xt(J,o),Gt=!ve&&ha(pt?.sections);if(ve&&f&&ze!==f){He(f);const n=J[0],s=Re[0];if(n&&s){R(0),ie(0),E([]);const a=et(n,s,o);a&&(C(a.data),D(a.resolveType),Z(null),A(null))}}!ve&&ze!==null&&He(null),qe.current={rawSections:J,parsedSections:Re,decofile:o??{},activePageKey:_,pageVariants:Ae,variantIndex:_e,sectionVariantIndex:ue,selectedSectionIndex:c};const xs=()=>({multivariate:Gt,index:_e,variants:Ae.map(n=>({rule:n.rule}))}),en=(n,s)=>{if(!y)return;if(!_||!Gt||n.length<=1){y(null);return}const a=bn(_,{multivariate:!0,index:s,variants:n},o,p);y(a.length>0?a:null)},lt=(n,s,a)=>{if(!y)return;if(!_){y(null);return}const u=xs(),g=bn(_,u,o,p);if(!n||s<0){y(g.length>0?g:null);return}const T=Aa({pageKey:_,page:u,sectionIndex:s,sectionLazy:Re[s]?.isLazy??!1,mvObj:n,selectedVariantIndex:a,decofile:o,meta:p}),k=[...g,...T];y(k.length>0?k:null)},Je=(n,s,a,u=c??-1,g=!1)=>{const T=Qe(n,s);if(!T){C(null),D(null),Z(null),A(null),g&<(null,u,a);return}const L=vn(T,tt)[a];if(!L){C(null),D(null),Z(null),A(null),g&<(null,u,a);return}const ge=Sa(L.value,o);C(ge?.data??null),D(ge?.resolveType??null);const{resolveType:G,formValue:me}=Kt(L.rule,o,p??void 0);Z(G),A(me),g&<(T,u,a)};if(d!==void 0&&d!==U&&(ee(d??null),typeof d=="number")){const n=J[d],s=Re[d];if(n&&s)if(R(d),ie(0),E([]),X(a=>a+1),s.isMultivariate)Je(n,s,0,d);else{const a=et(n,s,o);a?(C(a.data),D(a.resolveType)):(C(null),D(null)),Z(null),A(null)}}const gt={orgSlug:l,virtualMcpId:e,branch:r,previewUrl:m??void 0,siteSlug:V},Vt=Q&&p?bt(Q,p):null,Ie=(n,s)=>{if(!_)return;const a=It(o,_,n,_e,Ae);Ve.mutate({blockKey:_,data:a},{onSuccess:()=>s?.onSuccess?.()??S?.(),onError:u=>fe.error(`Save failed: ${u.message}`)})},ct=()=>{R(null),C(null),D(null),ie(0),A(null),Z(null),E([]),X(n=>n+1)},ys=(n,s)=>{Nt.current&&clearTimeout(Nt.current);const a=qe.current.sectionVariantIndex;Nt.current=setTimeout(()=>{const{rawSections:u,parsedSections:g,decofile:T,activePageKey:k,pageVariants:L,variantIndex:ge}=qe.current,G=u[s];if(!G)return;const me=g[s];if(!me)return;if(me.isSavedBlock){const ye=me.isLazy?G.section?.__resolveType??G.__resolveType:G.__resolveType;Ve.mutate({blockKey:ye,data:n},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}if(!k)return;const xe={...T[k]},Me=[...u];if(me.isMultivariate){const ye=Qe(G,me);if(!ye||!k)return;const je=$a(ye,a,n);Me[s]=dt(G,me,je)}else if(me.isHidden){const ye=Tn(G.__resolveType),je=ye?{...G.section}:{...G},Ue=Array.isArray(je.variants)?[...je.variants]:[];Ue[0]&&(Ue[0]={...Ue[0],value:n}),je.variants=Ue,ye?Me[s]={...G,section:je}:Me[s]=je}else me.isLazy?Me[s]={...G,section:n}:Me[s]=n;if(L.length>1){const ye=xe.sections,je=[...ye?.variants??[]];je[ge]&&(je[ge]={...je[ge],value:Me}),xe.sections={...ye,variants:je}}else xe.sections=Me;Ve.mutate({blockKey:k,data:xe},{onSuccess:()=>S?.(),onError:ye=>fe.error(`Save failed: ${ye.message}`)})},zt)},js=n=>{R(n),ie(0),E([]),X(g=>g+1);const s=J[n],a=Re[n];if(!s||!a)return;if(a.isMultivariate){Je(s,a,0,n);return}const u=et(s,a,o);if(!u){C(null),D(null),Z(null),A(null),lt(null,n,0);return}C(u.data),D(u.resolveType),Z(null),A(null),lt(null,n,0)},tn=n=>{const s=n;C(s),c!==null&&ys(s,c)},At=n=>{if(!_||!o||!p||!Ke)return;const s={kind:"page",pageKey:_,pageName:String(Ke.name??""),path:String(Ke.path??"")},a=jn(o,s,p);a&&kt.save(_,()=>{const u=We.getQueryData(na.decofile(os))?.[_];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const g={...u,...Rt.current};return Rt.current={},n?.raw!==void 0?{...g,seo:n.raw}:n?.inner!==void 0?dr(s,a,g,n.inner):g})},_s=(n,s)=>{_&&(Rt.current[n]=s,At())},ks=(n,s)=>{if(!_)return;const a=mt([...J],n,s);c!==null&&(c===n?R(s):n<c&&s>=c?R(c-1):n>c&&s<=c&&R(c+1)),Ie(a)},ws=n=>{if(!_)return;const s=J.filter((a,u)=>u!==n);c===n?ct():c!==null&&c>n&&R(c-1),Ie(s)},Ns=n=>{if(!_)return;const s=J[n];if(!s)return;const a=[...J];a.splice(n+1,0,vr(s)),c!==null&&c>n&&R(c+1),Ie(a)},Rs=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a||a.isMultivariate)return;const u=a.isHidden?Ca(s):Da(s);if(!u)return;const g=[...J];g[n]=u,c===n&&ct(),Ie(g)},Cs=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a||a.isMultivariate)return;const u=Ra(s);if(!u)return;const g=[...J];g[n]=u,c===n&&ct(),Ie(g)},Ds=n=>{if(!_)return;const s=J[n],a=Re[n];if(!s||!a?.isSavedBlock)return;const u=et(s,a,o);if(!u?.data)return;const{name:g,...T}=u.data,k=[...J];a.isLazy?k[n]={...s,section:T}:k[n]=T,c===n&&ct(),Ie(k)},Ts=n=>{if(!_)return;const s=[...J,{__resolveType:n.resolveType}],a=s.length-1;Ie(s,{onSuccess:()=>{he(!1),R(a),ie(0),E([]),X(k=>k+1);const u=s[a],g=xt(s,o)[a];if(!u||!g)return;if(g.isMultivariate){Je(u,g,0);return}const T=et(u,g,o);if(!T){C(null),D(null),Z(null),A(null);return}C(T.data),D(T.resolveType),Z(null),A(null)}})},Ps=n=>{if(c===null)return;const s=J[c],a=Re[c];!s||!a?.isMultivariate||(ie(n),E([]),X(u=>u+1),Je(s,a,n,c,!0))},Vs=n=>{if(c===null||!_)return;const s=J[c],a=Re[c];if(!s||!a?.isMultivariate)return;const u=Qe(s,a);if(!u)return;const g=wa(u,n);if(!g){fe.error("Cannot delete the only variant.");return}const T=[...J];T[c]=dt(s,a,g);const k=g.variants;let L=ue;n===ue?L=Math.min(n,k.length-1):n<ue&&(L=ue-1),ie(L),E([]),X(ge=>ge+1),Je(T[c],a,L),Ie(T)},As=n=>{if(c===null||!_)return;const s=J[c],a=Re[c];if(!s||!a?.isMultivariate)return;const u=Qe(s,a);if(!u)return;const g=Na(u,n),T=[...J];T[c]=dt(s,a,g);const k=n+1;ie(k),E([]),X(L=>L+1),Je(T[c],a,k),Ie(T)},Ms=(n,s)=>{if(c===null||!_||n===s)return;const a=J[c],u=Re[c];if(!a||!u?.isMultivariate)return;const g=Qe(a,u);if(!g)return;const T=_a(g,n,s),k=[...J];k[c]=dt(a,u,T);let L=ue;ue===n?L=s:n<ue&&s>=ue?L=ue-1:n>ue&&s<=ue&&(L=ue+1),ie(L),Je(k[c],u,L),Ie(k)},Mt=n=>{const s=n??c;if(s===null||!_)return;const a=J[s],u=Re[s];if(!a||!u)return;const g=ba(a,u);if(!g){fe.error("This section cannot have variants.");return}const T=[...J];T[s]=g.section;const k=xt(T,o)[s];if(!k?.isMultivariate){fe.error("Could not add variant.");return}R(s),ie(g.newVariantIndex),E([]),X(L=>L+1),Je(g.section,k,g.newVariantIndex,s),Ie(T)},Es=()=>{if(c===null||!_)return;const n=J[c],s=Re[c];if(!n||!s?.isMultivariate)return;const a=Qe(n,s);if(!a)return;const u=ka(n,s,a);if(!u){fe.error("Could not remove variants.");return}const g=[...J];g[c]=u;const T=xt(g,o)[c];if(!T)return;ie(0),Z(null),A(null),E([]),X(L=>L+1);const k=et(u,T,o);k?(C(k.data),D(k.resolveType)):(C(null),D(null)),lt(null,c,0),Ie(g)},$s=async n=>{if(ne===null||!_)return;const s=kn(n,o);if(s){fe.error(s);return}const a=J[ne],u=Re[ne];if(!a||!u)return;const g=et(a,u,o);if(!g){fe.error("This section cannot be saved as global.");return}const T={...g.data,name:n};try{await Ve.mutateAsync({blockKey:n,data:T});const k=[...J];k[ne]={__resolveType:n},await Ve.mutateAsync({blockKey:_,data:It(o,_,k,_e,Ae)}),c===ne&&ct(),re(null),fe.success(`Saved global block "${n}"`),S?.()}catch(k){fe.error(k instanceof Error?k.message:"Failed to save global block")}},nn=Xe?.rule;if(ht&&c===null&&W===null&&nn){const{resolveType:n,formValue:s}=Kt(nn,o??{},p??void 0);ae(n),se(s)}const vt=p?sr(p):[],Os=!ve&&!!(m&&p&&o),sn=W&&p?bt(W,p):null,Bs=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),it.current&&(clearTimeout(it.current),it.current=null)},an=async(n,s)=>{if(!(Oa(s,n,p)>0))try{await Yt.mutateAsync({blockKey:n})}catch(a){fe.error(a instanceof Error?a.message:"Could not delete matcher block")}},rn=n=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:u}=qe.current;if(!s)return;const g={...a[s]},T={...g.sections},k=[...T.variants??[]],L=k[u],ge=L?.rule;if(Ft(ge,a,p)){const G=ge?.__resolveType??"",me=a[G],xe=typeof me?.name=="string"?me.name:G,{__resolveType:Me,...ye}=n;Ve.mutate({blockKey:G,data:Lt(Me??"",ye,xe)},{onSuccess:()=>S?.(),onError:je=>fe.error(`Save failed: ${je.message}`)});return}L&&(k[u]={...L,rule:n}),g.sections={...T,variants:k},Ve.mutate({blockKey:s,data:g},{onSuccess:()=>S?.(),onError:G=>fe.error(`Save failed: ${G.message}`)})},zt)},Ks=n=>{ae(n);const s=n?{__resolveType:n}:{__resolveType:xn};se({}),rn(s)},Fs=n=>{const s=n;se(s);const a=W?{__resolveType:W,...s}:{...s};rn(a)},on=n=>{it.current&&clearTimeout(it.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=qe.current;s!==null&&(it.current=setTimeout(()=>{const{rawSections:u,parsedSections:g,decofile:T,activePageKey:k,pageVariants:L,variantIndex:ge}=qe.current;if(!k)return;const G=u[s],me=g[s];if(!G||!me?.isMultivariate)return;const xe=Qe(G,me);if(!xe)return;const Me=Ea(xe,a,n),ye=[...u];ye[s]=dt(G,me,Me);const je=It(T,k,ye,ge,L);Ve.mutate({blockKey:k,data:je},{onSuccess:()=>S?.(),onError:Ue=>fe.error(`Save failed: ${Ue.message}`)})},zt))},Ls=n=>{Z(n),A({}),on(n?{__resolveType:n}:{__resolveType:xn})},zs=n=>{const s=n;A(s);const a=F?{__resolveType:F,...s}:{...s};on(a)};if(!ve&&!Ke)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(ve&&!Ct)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Ye=c!==null?Re[c]??null:null,ln=c!==null?J[c]:null,cn=ln&&Ye?.isMultivariate?Qe(ln,Ye):null,St=cn?vn(cn,tt):[],Et=Math.min(ue,Math.max(St.length-1,0)),$t=St[Et]??null,Ge=Ye?.isMultivariate===!0,un=c!==null&&Ye!==null,ut=un&&(Ge||!!(Vt&&Y)),Is=ut&&!ve&&Ye?.isSavedBlock===!0,Ze=ve||Is,Hs=ve?Qt:Ye?.label??"",dn=F&&p?bt(F,p):null,Ot=ut&&(!ve||te.length>0)?ve?[Qt,...te]:[Ke.name,Ye.label,...Ge&&$t?[$t.label]:[],...te]:[],Us=q&&Ke?[Ke.name,"SEO",...Oe]:[],mn=q?Us:Ze?Ot.length>0?Ot:[Hs]:Ot,fn=()=>{if(!_)return;const n=o[_],s=xa(n.sections,J);if(!s)return;const a=ya(s);Ve.mutate({blockKey:_,data:{...n,sections:s}},{onSuccess:()=>{M(a),R(null),C(null),D(null),E([]),se(null),ae(null)},onError:u=>fe.error(`Save failed: ${u.message}`)})},pn=(n,s,a)=>{if(!_)return;const u=o[_],g=u.sections;if(!g||typeof g!="object"||Array.isArray(g))return;const T=g;if(!Array.isArray(T.variants))return;const k=n([...T.variants]);if(!k)return;const L=Ma(T,k),ge={...o,[_]:{...u,sections:L}};Ve.mutate({blockKey:_,data:ge[_]},{onSuccess:()=>{s?.(),a&&an(a,ge)},onError:G=>fe.error(`Save failed: ${G.message}`)})},Ws=n=>{$(null),M(n),R(null),C(null),D(null),E([]);const s=Ae[n]?.rule,{resolveType:a,formValue:u}=Kt(s,o??{},p??void 0);ae(a),se(u),en(Ae.map(g=>({rule:g.rule})),n)},qs=(n,s)=>{if(n===s)return;let a=_e;_e===n?a=s:n<_e&&s>=_e?a=_e-1:n>_e&&s<=_e&&(a=_e+1),M(a);const u=mt(Ae.map(g=>({rule:g.rule})),n,s);en(u,a),pn(g=>mt(g,n,s))},Js=n=>{const s=Ae[n]?.rule,a=ja(s,o??{},p??void 0);pn(u=>u.length<=1?null:(u.splice(n,1),u),()=>{Ae.length-1===1?M(0):n<_e?M(_e-1):n===_e&&M(Math.max(0,n-1)),R(null),C(null),D(null),E([]),se(null),ae(null)},a)},Ys=async(n,s)=>{Bs();const a=qe.current.activePageKey,u=qe.current.decofile;if(!a)return;const g=u[a],T=g.sections;if(!T||typeof T!="object"||Array.isArray(T))return;const k=T;if(!Array.isArray(k.variants))return;const L=[...k.variants],ge=L[n];if(!ge?.rule||typeof ge.rule!="object"){fe.error("This variant has no matcher rule to rename.");return}const G=ge.rule,me=s.trim();Zt(!0);try{if(!me){if(!Ft(G,u,p)){$(null);return}const Bt=G.__resolveType??"";L[n]={...ge,rule:Ta(G,u,p)};const gn={...u,[a]:{...g,sections:{...k,variants:L}}};await Ve.mutateAsync({blockKey:a,data:gn[a]}),await an(Bt,gn),$(null),S?.();return}const xe=Pa(G,u,p);if(!xe){fe.error("Could not read this variant's matcher rule.");return}if(xe.blockKey){await Ve.mutateAsync({blockKey:xe.blockKey,data:Lt(xe.resolveType,xe.data,me)}),$(null),S?.();return}const Me=_n(me),ye=kn(Me,u);if(ye){fe.error(ye);return}const je=Lt(xe.resolveType,xe.data,me);let Ue=null;try{await Ve.mutateAsync({blockKey:Me,data:je}),Ue=Me,L[n]={...ge,rule:Va(Me)},await Ve.mutateAsync({blockKey:a,data:{...g,sections:{...k,variants:L}}}),Ue=null}catch(Bt){throw Ue&&await Yt.mutateAsync({blockKey:Ue}).catch(()=>{}),Bt}$(null),fe.success(`Saved matcher as global block "${me}"`),S?.()}catch(xe){fe.error(xe instanceof Error?xe.message:"Failed to rename variant")}finally{Zt(!1)}},hn=()=>{ct()},Zs=n=>{we(n),At({inner:n})},Qs=n=>{$e(n),At({raw:n})},Xs=()=>{we(null),be([])},Gs=()=>Pe(n=>n+1),ea=n=>{if(q){if(n===0){kt.flush(),K(!1),we(null),$e(void 0),be([]),Pe(a=>a+1),P?.();return}if(n===1){be([]),Pe(a=>a+1);return}be(Oe.slice(0,n-1)),Pe(a=>a+1);return}if(ve){E(te.slice(0,n)),X(a=>a+1);return}if(n===0){hn();return}if(n===1){E([]),X(a=>a+1);return}if(Ge&&n===2){E([]),X(a=>a+1);return}const s=Ge?2:1;E(te.slice(0,n-s))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:Ze||ut||q?t.jsxs("div",{className:Ce("border-b px-3 py-2.5",Ze&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ve&&ht&&Xe&&t.jsxs("button",{type:"button",onClick:hn,title:`Editing in variant: ${Xe.label}`,className:Ce("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ir),children:[t.jsx(Jt,{rule:jt(Xe.rule,o??{},p??void 0),matchers:vt}),t.jsx("span",{className:"max-w-[160px] truncate",children:Xe.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:mn.map((n,s)=>{const a=s===mn.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&t.jsx(Pn,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>ea(s),title:n,className:Ce("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?Ze?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Ze?"text-foreground/80":"text-muted-foreground",Ze?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:n})]},`${n}-${s}`)})}),Ze&&t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(Ha,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(rt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),un&&!Ge&&!Ye?.isHidden&&_&&t.jsx(Dn,{onClick:()=>Mt()})]}),Ze&&t.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(Ur,{pageKey:_,initialName:Ke.name,initialPath:Ke.path,onFieldChange:_s})}),t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>K(!0),children:t.jsx(za,{size:14})})}),t.jsx(rt,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(st,{children:[t.jsx(at,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>N&&_?N(_):ce(!0),children:t.jsx(Ia,{size:14})})}),t.jsx(rt,{side:"bottom",children:"View JSON"})]}),t.jsx(Dn,{onClick:fn})]})}),ht&&!ut&&!q&&_&&t.jsx(Fr,{listKey:_,variants:Ae,activeIndex:_e,decofile:o??{},meta:p,matchers:vt,onSelect:Ws,onReorder:qs,onRename:$,onDelete:Js,onAdd:fn}),q?t.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:pt&&_?t.jsx(ur,{rawSeo:Tt,innerSeo:Xt,defaultResolveType:vs,seoSchema:Ss,activeResolveType:Pt,seoTypeOptions:gs,formResetKey:Be,siteDefaultSeo:bs,onBreadcrumbChange:be,onPersistRaw:Qs,onInnerChange:Zs,onClearForm:Xs,onBumpFormKey:Gs}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?t.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ge&&St.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ar,{listKey:`${_??""}:${c??""}`,variants:St.map((n,s)=>({index:s,label:n.label})),selectedIndex:Et,onSelect:Ps,onDuplicate:As,onDelete:Vs,onRemoveAll:Es,onReorder:Ms,onAdd:()=>Mt()}),Ge&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(yn,{currentRt:F??"",currentLabel:tt($t?.rule),matchers:vt,onSelect:Ls}),dn&&Ne&&t.jsx("div",{className:"pt-1",children:t.jsx(Rn,{schema:dn,value:Ne,onChange:zs,meta:p??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${c??"none"}:${Et}:${F??""}`)})]})]}),t.jsx(Cn,{activeSchema:Vt,formValue:Y,formResetKey:le,onFormChange:tn,onBreadcrumbChange:E,breadcrumbPath:te,emptyMessage:"No editable fields for this variant.",meta:p,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})]}):ve?t.jsx(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(Cn,{activeSchema:Vt,formValue:Y,formResetKey:le,onFormChange:tn,onBreadcrumbChange:E,breadcrumbPath:te,emptyMessage:"No editable fields for this global block.",meta:p,decofile:o,onSaveReferencedBlock:ft,sandbox:gt})}):t.jsxs(yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ht&&W!==null&&t.jsxs("div",{className:Ce("px-3 border-b",B?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>oe(n=>!n),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":B,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),B?t.jsx(Fa,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx(Ba,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),B&&t.jsxs("div",{className:Ce("space-y-3",wt&&"pointer-events-none opacity-50"),children:[t.jsx(yn,{currentRt:W,currentLabel:Sn(Xe?.rule,o??{},tt,p??void 0),matchers:vt,onSelect:Ks}),sn&&Se&&t.jsx("div",{className:"space-y-3",children:t.jsx(Rn,{schema:sn,value:Se,onChange:Fs,meta:p??void 0,decofile:o,onSaveReferencedBlock:ft,sandbox:gt},`${_e}:${W??""}`)})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx(Pr,{listKey:`${_??""}-${_e}`,rawSections:J,sections:Re,meta:p,selectedIndex:c,onSelect:js,onReorder:ks,onDelete:ws,onDuplicate:Ns,onMakeReusable:re,onToggleHidden:Rs,onToggleLazy:Cs,onAddVariant:Mt,onDetach:Ds,onAddSection:()=>he(!0),canAddSection:Os})})]}),t.jsx(zr,{open:ne!==null,onOpenChange:n=>{n||re(null)},defaultBlockId:ne!==null?_n(Re[ne]?.label??""):"",isPending:Ve.isPending,onSubmit:$s}),m&&t.jsx(pr,{open:pe,onOpenChange:he,meta:p,decofile:o,previewBaseUrl:m,onSelect:Ts}),de&&_&&o&&t.jsx(ga,{open:de,onOpenChange:ce,pageKey:_,decofile:o}),H!==null&&t.jsx(gr,{open:!0,initialName:Ft(Ae[H]?.rule,o??{},p??void 0)?Sn(Ae[H]?.rule,o??{},tt,p??void 0):"",autoLabel:tt(jt(Ae[H]?.rule,o??{},p??void 0)),isPending:wt,onSubmit:async n=>{await Ys(H,n)},onOpenChange:n=>{!n&&!wt&&$(null)}})]})}export{Tl as SectionsEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,ah as nt,$ as Pe,j as d,a0 as rt,ai as be,W as k,M as st,P as j,Q as N,bN as $,_ as lt,aO as _e,T as Ee,ag as at,bJ as it,bP as ct,dx as dt,dA as ut,dy as pt,dB as ft,X as mt,U as ht,dz as gt,Y as vt,Z as xt,c as ee,l as oe}from"./index-Cvc1xn-4.js";import{V as St}from"./tooltip-D_DwQRbZ.js";import{i as wt,n as yt}from"./ChevronUp-DhHPsDAS.js";import{t as Re}from"./ChevronDown-BhLFFAly.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var Ct=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:b,required:w,form:S}=r,p=pe(e),[g,y]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:g,onTriggerChange:y,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[v,b,w]=tt(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),m=ot(g,p,y);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(g&&p.key===" ")&&Ct.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[C]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===C&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=C=>{f={x:Math.abs(Math.round(C.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(C.pageY)-(K.current?.y??0))}},R=C=>{f.x<=10&&f.y<=10?C.preventDefault():x.contains(C.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),C=ot(T,f,R);C&&setTimeout(()=>C.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const C=!H.current&&!R;(m.value!==void 0&&m.value===T||C)&&(F(f),C&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const C=!H.current&&!R;(m.value!==void 0&&m.value===T||C)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let C=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=C.indexOf(I);C=C.slice(P+1)}setTimeout(()=>E(C)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),v=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&g&&y){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,g,y,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(vt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=s;if(b?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),y=Math.max(p,g);if(y<S){const m=y+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,v]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),g=c.useRef("touch"),y=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{v(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,v]=c.useState(null),b=k(e,y=>v(y),a.onItemTextChange,y=>l.itemTextRefCallback?.(y,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var ye="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=ye;var Ce="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=Ce;var Je=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(yt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{fo as S,mo as a,po as b,uo as c,co as d,Ne as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as D,j as o,l as R,r as $,B as H}from"./index-
|
|
1
|
+
import{c as D,j as o,l as R,r as $,B as H}from"./index-Cvc1xn-4.js";import{i as Q,a as W,c as J,d as K}from"./dialog-DDL08EK8.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-CTdCEiZw.js";import{u as oe}from"./tooltip-D_DwQRbZ.js";import{b as A}from"./chat-context-GA_fpERN.js";import{D as te,b as le,S as U,M as se}from"./decopilot-BsjqLgTH.js";import{a as G,b as z}from"./connect-desktop-dialog-uLnBe_nQ.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as T,j as t,r as Q,B as je,i as Se}from"./index-Cvc1xn-4.js";import{i as be}from"./ChevronRight-tj4xbWmM.js";import{L as fe}from"./agent-icon-C4199b3i.js";import{S as ue}from"./scroll-area-BvvyxqKR.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-Io0ovKiN.js";import{m as ze}from"./index-B8LUbsU-.js";import{a as ge}from"./Tool01-AyuVwnGv.js";import{s as xe}from"./schema-form-C1MMeEGC.js";import"./AlertCircle-BZqAQZBb.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronUp-DhHPsDAS.js";import"./ChevronDown-BhLFFAly.js";import"./ChevronLeft-veOSKT91.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./X-DC2HG4lX.js";import"./Zap-OOZsYg72.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./dialog-DDL08EK8.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-zC94Gae_.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./studio-tools-D8q7MEyE.js";import"./use-organization-settings-C6jq364X.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./sheet-XVV7S5b8.js";import"./integration-icon-gcYOl2yq.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./input-klr_kUC2.js";import"./select-DwFQDgcX.js";import"./switch-skMKJ2GI.js";import"./index-BI3_fNOm.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./tabs-C0Vh3iPJ.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./textarea-2KmLad1y.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./skeleton-C-tuNjEZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./dropdown-menu-CgCZ8Mte.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-mcp-tools-DnBnaQLn.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";import"./calendar-DDwlGULz.js";import"./sortable.esm-S2exVkMt.js";import"./image-field-CEHk9cpM.js";import"./use-file-configs-CvRusjpd.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ti(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ti as SeoEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,e as R,j as s,s as J,l as k,ae as Q,w as L,p as B,H as I,a as G,i as D,r as F,O as K}from"./index-Dq0yW5NU.js";import{u as E,S as U,M as V}from"./shell-controls-CnGQk1cT.js";import{j as X,k as Y,l as Z,b as q,c as w,d as M,S as P,a as O,f as ee,g as se}from"./sidebar-BEDmuINV.js";import{a as te}from"./index-pDmuEeOe.js";import{n as le,b as re,a as ie,c as oe,d as ne,i as T}from"./ZapSquare-Cl9Iu0Yu.js";import{t as ae,a as A}from"./Users03-B41w1ewc.js";import{i as ce}from"./HardDrive-7UiN3uqO.js";import{i as me}from"./Key01-v4LCWUSc.js";import{i as fe}from"./Shield01-Wa9NR2vn.js";import{s as de}from"./User01-B9BKmOI0.js";import{i as xe}from"./Zap-Cd1AcQhh.js";import{a as be}from"./use-capability-WgQvudy9.js";import{a as ue}from"./use-join-requests-DWKpDg4f.js";import{u as H}from"./tooltip-D_6ICuSM.js";import{u as he}from"./use-status-sounds-D8dNgif9.js";import{a as y}from"./toolbar-DdJ_ns82.js";import"./sheet-C_eprANm.js";import"./X-CNdGRyYk.js";import"./LayoutLeft-BrCMpwSK.js";import"./studio-tools-BKbKV9tq.js";import"./question-004-sINsf4GQ.js";import"./decopilot-sse-pool-BfjIH6C6.js";import"./backoff-CrEUbyZT.js";import"./ChevronLeft-njq8SkK6.js";import"./ChevronRight-C5wvGTH8.js";function W(){const e=S.c(21),{capabilities:t,isPrivileged:f,loading:l,error:a}=be(),r=ue().length;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ae,{size:14}),e[0]=o):o=e[0];let n,i;if(e[1]!==t||e[2]!==a||e[3]!==f||e[4]!==r||e[5]!==l){i=Symbol.for("react.early_return_sentinel");e:{let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(le,{size:14}),e[8]=u):u=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{size:14}),e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{size:14}),e[10]=d):d=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ce,{size:14}),e[11]=x):x=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ie,{size:14}),e[12]=m):m=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(A,{size:14}),e[13]=b):b=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{size:14}),e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(oe,{size:14}),e[15]=g):g=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{size:14}),e[16]=h):h=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(A,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(fe,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Q,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(de,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:o,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:u,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:c,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:d,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:x,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:m,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:b,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:p,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:h,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:r},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(l||a){i=z;break e}n=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?f:$.requires?f||t[$.requires]:!0)})).filter(pe)}e[1]=t,e[2]=a,e[3]=f,e[4]=r,e[5]=l,e[6]=n,e[7]=i}else n=e[6],i=e[7];return i!==Symbol.for("react.early_return_sentinel")?i:n}function pe(e){return e.items.length>0}function ge(){const e=S.c(19),t=W();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org"},e[0]=f):f=e[0];const{org:l}=R(f);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:_e},e[1]=a):a=e[1];const r=E(a);let o;e[2]!==l||e[3]!==r?(o=b=>{const p=b.replace("$org",l);return r.startsWith(p)},e[2]=l,e[3]=r,e[4]=o):o=e[4];const n=o;let i;if(e[5]!==t||e[6]!==n||e[7]!==l){let b;e[9]!==n||e[10]!==l?(b=(p,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:p.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:p.items.map(h=>s.jsx(P,{children:s.jsx(O,{asChild:!0,isActive:n(h.to),children:s.jsxs(L,{to:h.to,params:{org:l},onClick:()=>B("settings_nav_clicked",{section_key:h.key,section_label:h.label,group_label:p.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[h.icon,h.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:h.label})]})})},h.key))})})]},`${p.label}-${g}`),e[9]=n,e[10]=l,e[11]=b):b=e[11],i=t.map(b),e[5]=t,e[6]=n,e[7]=l,e[8]=i}else i=e[8];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=u):u=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[u,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(O,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=c):c=e[13];let d;e[14]!==i?(d=s.jsxs(ee,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[i,c]}),e[14]=i,e[15]=d):d=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.76.0"]})}),e[16]=x):x=e[16];let m;return e[17]!==d?(m=s.jsxs(se,{variant:"sidebar",children:[d,x]}),e[17]=d,e[18]=m):m=e[18],m}function je(){B("signed_out",{source:"settings_sidebar"}),I(),G.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=S.c(21),{onClose:f}=e,l=W();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org"},t[0]=a):a=t[0];const{org:r}=R(a);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={select:ve},t[1]=o):o=t[1];const n=E(o);let i;t[2]!==r||t[3]!==n?(i=g=>{const h=g.replace("$org",r);return n.startsWith(h)},t[2]=r,t[3]=n,t[4]=i):i=t[4];const u=i;let c;if(t[5]!==l||t[6]!==u||t[7]!==f||t[8]!==r){let g;t[10]!==u||t[11]!==f||t[12]!==r?(g=(h,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[h.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:h.label}),h.items.map(j=>s.jsxs(L,{to:j.to,params:{org:r},onClick:f,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",u(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${h.label}-${_}`),t[10]=u,t[11]=f,t[12]=r,t[13]=g):g=t[13],c=l.map(g),t[5]=l,t[6]=u,t[7]=f,t[8]=r,t[9]=c}else c=t[9];let d;t[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=d):d=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[d,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=x):x=t[15];let m;t[16]!==c?(m=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[c,x]}),t[16]=c,t[17]=m):m=t[17];let b;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.76.0"]})}),t[18]=b):b=t[18];let p;return t[19]!==m?(p=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[m,b]}),t[19]=m,t[20]=p):p=t[20],p}function Se(){I(),G.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=S.c(4),t=H(),{org:f}=J();he(f.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(D,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(F.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(te,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=a):a=e[1];const r=a;if(t){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:r}),e[2]=n):n=e[2],n}let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:r})}),e[3]=o):o=e[3],o}function Xe(){const e=S.c(22),t=H();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(y.LogoLink,{}),e[0]=f):f=e[0];let l;e[1]!==t?(l=t&&s.jsx(U,{}),e[1]=t,e[2]=l):l=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"hidden md:contents",children:s.jsx(y.Nav,{})}),e[3]=a):a=e[3];let r;e[4]!==l?(r=s.jsxs(y.LeftColumn,{children:[f,l,a]}),e[4]=l,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[6]=o):o=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[7]=n):n=e[7];let i;e[8]!==r?(i=s.jsxs(y.Header,{children:[r,o,n]}),e[8]=r,e[9]=i):i=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width-icon":"3.5rem"},e[10]=u):u=e[10];let c;e[11]!==t?(c=!t&&s.jsx(ge,{}),e[11]=t,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(X,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[13]=d):d=e[13];let x;e[14]!==c?(x=s.jsxs(Y,{className:"flex-1 bg-sidebar min-h-0",style:u,children:[c,d]}),e[14]=c,e[15]=x):x=e[15];let m;e[16]!==t?(m=t&&s.jsx(V,{renderSidebar:ke}),e[16]=t,e[17]=m):m=e[17];let b;return e[18]!==x||e[19]!==m||e[20]!==i?(b=s.jsx(y.Provider,{children:s.jsx(Z,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[i,x,m]})})}),e[18]=x,e[19]=m,e[20]=i,e[21]=b):b=e[21],b}function ke(e){const{onClose:t}=e;return s.jsx(ye,{onClose:t})}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,Xe as default};
|
|
1
|
+
import{c as S,e as R,j as s,s as J,l as k,ae as Q,w as L,p as B,H as I,a as G,i as D,r as F,O as K}from"./index-Cvc1xn-4.js";import{u as E,S as U,M as V}from"./shell-controls-D6QH2Gpe.js";import{j as X,k as Y,l as Z,b as q,c as w,d as M,S as P,a as O,f as ee,g as se}from"./sidebar-Djn7svMG.js";import{a as te}from"./index-1J83wgnT.js";import{n as le,b as re,a as ie,c as oe,d as ne,i as T}from"./ZapSquare-ok_KEP9c.js";import{t as ae,a as A}from"./Users03-C6siA5mE.js";import{i as ce}from"./HardDrive-DEG8fjxw.js";import{i as me}from"./Key01-xj4UQriu.js";import{i as fe}from"./Shield01-BZZVugf_.js";import{s as de}from"./User01-Dz33ODze.js";import{i as xe}from"./Zap-OOZsYg72.js";import{a as be}from"./use-capability-A3j7T78I.js";import{a as ue}from"./use-join-requests-iYNw-oM8.js";import{u as H}from"./tooltip-D_DwQRbZ.js";import{u as he}from"./use-status-sounds-Bvu0fELl.js";import{a as y}from"./toolbar-DE_I2DnI.js";import"./sheet-XVV7S5b8.js";import"./X-DC2HG4lX.js";import"./LayoutLeft-C9-KQh8d.js";import"./studio-tools-D8q7MEyE.js";import"./question-004-sINsf4GQ.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";function W(){const e=S.c(21),{capabilities:t,isPrivileged:f,loading:l,error:a}=be(),r=ue().length;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ae,{size:14}),e[0]=o):o=e[0];let n,i;if(e[1]!==t||e[2]!==a||e[3]!==f||e[4]!==r||e[5]!==l){i=Symbol.for("react.early_return_sentinel");e:{let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(le,{size:14}),e[8]=u):u=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{size:14}),e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{size:14}),e[10]=d):d=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ce,{size:14}),e[11]=x):x=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ie,{size:14}),e[12]=m):m=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(A,{size:14}),e[13]=b):b=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{size:14}),e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(oe,{size:14}),e[15]=g):g=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{size:14}),e[16]=h):h=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(A,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(fe,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Q,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(de,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:o,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:u,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:c,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:d,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:x,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:m,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:b,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:p,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:h,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:r},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(l||a){i=z;break e}n=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?f:$.requires?f||t[$.requires]:!0)})).filter(pe)}e[1]=t,e[2]=a,e[3]=f,e[4]=r,e[5]=l,e[6]=n,e[7]=i}else n=e[6],i=e[7];return i!==Symbol.for("react.early_return_sentinel")?i:n}function pe(e){return e.items.length>0}function ge(){const e=S.c(19),t=W();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org"},e[0]=f):f=e[0];const{org:l}=R(f);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:_e},e[1]=a):a=e[1];const r=E(a);let o;e[2]!==l||e[3]!==r?(o=b=>{const p=b.replace("$org",l);return r.startsWith(p)},e[2]=l,e[3]=r,e[4]=o):o=e[4];const n=o;let i;if(e[5]!==t||e[6]!==n||e[7]!==l){let b;e[9]!==n||e[10]!==l?(b=(p,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:p.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:p.items.map(h=>s.jsx(P,{children:s.jsx(O,{asChild:!0,isActive:n(h.to),children:s.jsxs(L,{to:h.to,params:{org:l},onClick:()=>B("settings_nav_clicked",{section_key:h.key,section_label:h.label,group_label:p.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[h.icon,h.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:h.label})]})})},h.key))})})]},`${p.label}-${g}`),e[9]=n,e[10]=l,e[11]=b):b=e[11],i=t.map(b),e[5]=t,e[6]=n,e[7]=l,e[8]=i}else i=e[8];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=u):u=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[u,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(O,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=c):c=e[13];let d;e[14]!==i?(d=s.jsxs(ee,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[i,c]}),e[14]=i,e[15]=d):d=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.76.2"]})}),e[16]=x):x=e[16];let m;return e[17]!==d?(m=s.jsxs(se,{variant:"sidebar",children:[d,x]}),e[17]=d,e[18]=m):m=e[18],m}function je(){B("signed_out",{source:"settings_sidebar"}),I(),G.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=S.c(21),{onClose:f}=e,l=W();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org"},t[0]=a):a=t[0];const{org:r}=R(a);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={select:ve},t[1]=o):o=t[1];const n=E(o);let i;t[2]!==r||t[3]!==n?(i=g=>{const h=g.replace("$org",r);return n.startsWith(h)},t[2]=r,t[3]=n,t[4]=i):i=t[4];const u=i;let c;if(t[5]!==l||t[6]!==u||t[7]!==f||t[8]!==r){let g;t[10]!==u||t[11]!==f||t[12]!==r?(g=(h,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[h.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:h.label}),h.items.map(j=>s.jsxs(L,{to:j.to,params:{org:r},onClick:f,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",u(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${h.label}-${_}`),t[10]=u,t[11]=f,t[12]=r,t[13]=g):g=t[13],c=l.map(g),t[5]=l,t[6]=u,t[7]=f,t[8]=r,t[9]=c}else c=t[9];let d;t[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=d):d=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[d,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=x):x=t[15];let m;t[16]!==c?(m=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[c,x]}),t[16]=c,t[17]=m):m=t[17];let b;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.76.2"]})}),t[18]=b):b=t[18];let p;return t[19]!==m?(p=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[m,b]}),t[19]=m,t[20]=p):p=t[20],p}function Se(){I(),G.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=S.c(4),t=H(),{org:f}=J();he(f.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(D,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(F.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(te,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=a):a=e[1];const r=a;if(t){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:r}),e[2]=n):n=e[2],n}let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:r})}),e[3]=o):o=e[3],o}function Xe(){const e=S.c(22),t=H();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(y.LogoLink,{}),e[0]=f):f=e[0];let l;e[1]!==t?(l=t&&s.jsx(U,{}),e[1]=t,e[2]=l):l=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"hidden md:contents",children:s.jsx(y.Nav,{})}),e[3]=a):a=e[3];let r;e[4]!==l?(r=s.jsxs(y.LeftColumn,{children:[f,l,a]}),e[4]=l,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[6]=o):o=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[7]=n):n=e[7];let i;e[8]!==r?(i=s.jsxs(y.Header,{children:[r,o,n]}),e[8]=r,e[9]=i):i=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width-icon":"3.5rem"},e[10]=u):u=e[10];let c;e[11]!==t?(c=!t&&s.jsx(ge,{}),e[11]=t,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(X,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[13]=d):d=e[13];let x;e[14]!==c?(x=s.jsxs(Y,{className:"flex-1 bg-sidebar min-h-0",style:u,children:[c,d]}),e[14]=c,e[15]=x):x=e[15];let m;e[16]!==t?(m=t&&s.jsx(V,{renderSidebar:ke}),e[16]=t,e[17]=m):m=e[17];let b;return e[18]!==x||e[19]!==m||e[20]!==i?(b=s.jsx(y.Provider,{children:s.jsx(Z,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[i,x,m]})})}),e[18]=x,e[19]=m,e[20]=i,e[21]=b):b=e[21],b}function ke(e){const{onClose:t}=e;return s.jsx(ye,{onClose:t})}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as N,j as r,r as S}from"./index-
|
|
1
|
+
import{c as v,l as N,j as r,r as S}from"./index-Cvc1xn-4.js";import{C as w}from"./card-D7O9yDM9.js";import{i as E}from"./ArrowUpRight-CUPFfker.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
|