decocms 4.111.1 → 4.112.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-C1710OBb.js → AlertCircle-CWc3BvFb.js} +1 -1
- package/dist/client/assets/{AreaChart-C2g_hZSn.js → AreaChart-8TuFtZwM.js} +1 -1
- package/dist/client/assets/{ArrowRight-Cpx1Lebk.js → ArrowRight-DnZw9chb.js} +1 -1
- package/dist/client/assets/{ArrowUp-84PrwJl7.js → ArrowUp-Dqm6yb7b.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B3GPW-_w.js → ArrowUpRight-a-xAV1yD.js} +1 -1
- package/dist/client/assets/{Check-D39cW1EC.js → Check-BXZBH--f.js} +1 -1
- package/dist/client/assets/{CheckCircle-Yz1eDu6Z.js → CheckCircle-Dx2byA8l.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dxdrzb03.js → ChevronDown-C82kSPQJ.js} +1 -1
- package/dist/client/assets/{ChevronRight-DD-OjvGf.js → ChevronRight-pKqWhPFO.js} +1 -1
- package/dist/client/assets/{ChevronUp-CorFhFXr.js → ChevronUp-Ur5tOU4r.js} +1 -1
- package/dist/client/assets/{Copy01-DggHPLxu.js → Copy01-CjvNe041.js} +1 -1
- package/dist/client/assets/{DotsVertical-DSmQb07B.js → DotsVertical-CsPrfBHu.js} +1 -1
- package/dist/client/assets/{Eye-BYEbwinV.js → Eye-D6UmvuQl.js} +1 -1
- package/dist/client/assets/{FilterLines-BC5HBNi1.js → FilterLines-I4EBUx4y.js} +1 -1
- package/dist/client/assets/{Globe01-CmsCC8zN.js → Globe01-bBcCao8m.js} +1 -1
- package/dist/client/assets/{Globe04-Cidz_2od.js → Globe04-BvAgykOe.js} +1 -1
- package/dist/client/assets/{HardDrive-DSsiIG4q.js → HardDrive-B1MltyIG.js} +1 -1
- package/dist/client/assets/{Image01-CTEGxjN6.js → Image01-CwV9iuxz.js} +1 -1
- package/dist/client/assets/{Key01-C-zj_nZY.js → Key01-C-044wq-.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CdBrffSJ.js → LayoutLeft-B7XnXJCX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-WuLv33QG.js → LinkExternal01-Beo7SFkQ.js} +1 -1
- package/dist/client/assets/LogOut01-BbBoHzGS.js +1 -0
- package/dist/client/assets/{Monitor01-CIfeipNC.js → Monitor01-CNCx-B51.js} +1 -1
- package/dist/client/assets/{Package-BJ248Tbr.js → Package-CidzBhtk.js} +1 -1
- package/dist/client/assets/{Palette-D-jexNuW.js → Palette-DyqhX3Li.js} +1 -1
- package/dist/client/assets/{Play-DeSndEh-.js → Play-Bs1D_H9C.js} +1 -1
- package/dist/client/assets/{Plus-Cht7lL4D.js → Plus-CxvuE4Es.js} +1 -1
- package/dist/client/assets/{SearchLg-CkwIt1df.js → SearchLg-D6bYV_e6.js} +1 -1
- package/dist/client/assets/{SearchMd-Bxv7C6ib.js → SearchMd-CVAS4bHb.js} +1 -1
- package/dist/client/assets/{Settings02-CqbXJDf7.js → Settings02-C48BmakR.js} +1 -1
- package/dist/client/assets/{Shield01-Bvbq_wVy.js → Shield01-CpLEfQVx.js} +1 -1
- package/dist/client/assets/{Star01-DJspHAU-.js → Star01-DbfqTNT0.js} +1 -1
- package/dist/client/assets/{Stars01-Cc9iJO8V.js → Stars01-DdKwQ9te.js} +1 -1
- package/dist/client/assets/{Stars02-8nmeIDYy.js → Stars02-B1CYtkwJ.js} +1 -1
- package/dist/client/assets/{Sun-CYtT9w41.js → Sun-CiZGxTK4.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DKZ8Ars7.js → SwitchHorizontal01-DjC0A58U.js} +1 -1
- package/dist/client/assets/{Tool01-BzMShFGo.js → Tool01-ttrYDD-F.js} +1 -1
- package/dist/client/assets/{Tool02-Dgp6-KLz.js → Tool02-1ZIphfq5.js} +1 -1
- package/dist/client/assets/{Trash01-DQk8SKeW.js → Trash01-CbEfRhj4.js} +1 -1
- package/dist/client/assets/{TrendUp01-Dz5gzrTN.js → TrendUp01-DAMS2ptH.js} +1 -1
- package/dist/client/assets/{Upload01-CSTbHDB3.js → Upload01-CtTjeXyd.js} +1 -1
- package/dist/client/assets/{User01-JZByJh_c.js → User01-DvoPZa3L.js} +1 -1
- package/dist/client/assets/{Users01-EWDKaBW5.js → Users01-HKR3d_K9.js} +1 -1
- package/dist/client/assets/{Users03-DiELMSun.js → Users03-Dxbbv3M0.js} +1 -1
- package/dist/client/assets/{X-CeuyThrh.js → X-Dc8jzuGp.js} +1 -1
- package/dist/client/assets/{XCircle-DcmvhxNa.js → XCircle-Bb4jhNm5.js} +1 -1
- package/dist/client/assets/{XClose-D26wD9_Q.js → XClose-BLwV1Ngp.js} +1 -1
- package/dist/client/assets/{Zap-DC8YgF5a.js → Zap-KiDFkWg-.js} +1 -1
- package/dist/client/assets/ZapSquare-Bqk2MRuL.js +1 -0
- package/dist/client/assets/{ZoomOut-Dzo8MaxJ.js → ZoomOut-Ce4wv8I3.js} +1 -1
- package/dist/client/assets/{access-gate-BjRWysew.js → access-gate-BQpTDI1E.js} +1 -1
- package/dist/client/assets/{add-section-modal-COG4EZv1.js → add-section-modal-BL2N_SLv.js} +1 -1
- package/dist/client/assets/agent-icon-CCxdHfHq.js +1 -0
- package/dist/client/assets/agents-list-D_QSFEpR.js +1 -0
- package/dist/client/assets/{ai-providers-xni6KFW1.js → ai-providers-CeCbz9WJ.js} +1 -1
- package/dist/client/assets/{alert-DO3pqp5Y.js → alert-B6DPJVFC.js} +1 -1
- package/dist/client/assets/{alert-dialog-CyxTQtK2.js → alert-dialog-3eCoJM_J.js} +1 -1
- package/dist/client/assets/app-editor-CWFz698e.js +1 -0
- package/dist/client/assets/{auth-CshA0DLa.js → auth-C488ati9.js} +1 -1
- package/dist/client/assets/{auth-catchall-D2K6sR0i.js → auth-catchall-7cPesftU.js} +1 -1
- package/dist/client/assets/{auth-entry-qdcFV22b.js → auth-entry-BeFx04UO.js} +1 -1
- package/dist/client/assets/{auth-split-layout-2p5tfz8M.js → auth-split-layout-Kv3PLrjS.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CCSTyrRC.js → authenticate-and-persist-oauth-CsBw_Hbi.js} +1 -1
- package/dist/client/assets/{automation-list-row-DNgedRhX.js → automation-list-row-D7W2Rtfd.js} +1 -1
- package/dist/client/assets/{automation-runs-02j6ZCbn.js → automation-runs-CjOXuQZP.js} +1 -1
- package/dist/client/assets/automations-BkUN9YOh.js +1 -0
- package/dist/client/assets/{autosend-72ilm6k6.js → autosend-iAh1cE6e.js} +1 -1
- package/dist/client/assets/{avatar-_bj3nvif.js → avatar-Cc14VL9E.js} +1 -1
- package/dist/client/assets/{badge-BnUjJn2C.js → badge-D9Myt67H.js} +1 -1
- package/dist/client/assets/{block-document-CeZxcQRc.js → block-document-BhHqcQ9v.js} +1 -1
- package/dist/client/assets/{brand-context-BHAMKTB9.js → brand-context-CiVdo2I7.js} +1 -1
- package/dist/client/assets/{buckets-B3qTExtg.js → buckets-CwzgTqTA.js} +1 -1
- package/dist/client/assets/bulk-category-panel-yqxFIFkD.js +1 -0
- package/dist/client/assets/{calendar-DzxL6tfI.js → calendar-C5NP6DS-.js} +1 -1
- package/dist/client/assets/{capability-load-error-DOdp2rNY.js → capability-load-error-CDt4ZVsU.js} +1 -1
- package/dist/client/assets/{card-DidS0F8g.js → card-Bqgf0tZo.js} +1 -1
- package/dist/client/assets/category-editor-Cb81bY1E.js +1 -0
- package/dist/client/assets/{chat-context--BCe0uBG.js → chat-context-Dtvr7cnX.js} +1 -1
- package/dist/client/assets/{checkbox-DaD8kLui.js → checkbox-CLeT6Gju.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BAq6z2bu.js → cli-auth-success-DCWFaEeO.js} +1 -1
- package/dist/client/assets/collection-detail-Cv7U6u2s.js +1 -0
- package/dist/client/assets/{collection-display-button-C-NfOkHF.js → collection-display-button-BuoLe9v_.js} +1 -1
- package/dist/client/assets/{collection-search-Bu14gD2R.js → collection-search-BM5saw5W.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bk6LnhMm.js → collection-table-wrapper-DK6IXxRn.js} +1 -1
- package/dist/client/assets/{collection-tabs-D6ZdND0h.js → collection-tabs-Daxt5rsE.js} +1 -1
- package/dist/client/assets/{command-B7Ss5ZQF.js → command-DY8SVt2y.js} +1 -1
- package/dist/client/assets/commerce-onboarding-GPK4Zth8.js +1 -0
- package/dist/client/assets/{companions-core-DyyxV0Vm.js → companions-core-CE6Q99bc.js} +1 -1
- package/dist/client/assets/{connect-Q_wOtUHo.js → connect-BxOdx2Dd.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-RMuHHgUH.js → connect-desktop-dialog-CNKcnYr9.js} +1 -1
- package/dist/client/assets/{connection-card-CNK047a0.js → connection-card-CVkAOr7Y.js} +1 -1
- package/dist/client/assets/connection-detail-DeYwGyZI.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Bu-giKug.js → connection-form-helpers-B3OfCtqO.js} +1 -1
- package/dist/client/assets/connections-JhayEu-8.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-C_h6McgN.js → decopilot-sse-pool-XB4qOGfZ.js} +1 -1
- package/dist/client/assets/{dialog-EQ_Nu1nb.js → dialog-DXHGb8ov.js} +1 -1
- package/dist/client/assets/{domain-settings-BA4FPQ9J.js → domain-settings-CFdyAL0q.js} +1 -1
- package/dist/client/assets/{drawer-BtIHYjMs.js → drawer-B33BKDxG.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Du_BmHui.js → dropdown-menu-C7j_C2Iz.js} +1 -1
- package/dist/client/assets/{empty-state-CId3svrh.js → empty-state-C86_b7IP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DlEzKLiw.js → extract-connection-data-DpPAxW37.js} +1 -1
- package/dist/client/assets/file-explorer-CX8OyLAP.js +2 -0
- package/dist/client/assets/{file-type-icon-DW7dVPZj.js → file-type-icon-D3SBaNGX.js} +1 -1
- package/dist/client/assets/{files-BKWJwV-t.js → files-KeQYXxyT.js} +1 -1
- package/dist/client/assets/{form-BaVTHbUM.js → form-XFZrliJE.js} +1 -1
- package/dist/client/assets/{general-kPZeN7Cu.js → general-DBEEnNet.js} +1 -1
- package/dist/client/assets/{github-repo-picker-C3sQ7jRy.js → github-repo-picker-RzuGCDsI.js} +1 -1
- package/dist/client/assets/{hooks-DkEEOEGE.js → hooks-2lJrOuZm.js} +1 -1
- package/dist/client/assets/{index-DvuEUZpB.js → index-6kZv92JJ.js} +1 -1
- package/dist/client/assets/{index-BBl4qqLw.js → index-BKasOmzh.js} +1 -1
- package/dist/client/assets/{index-B2MTCe2b.js → index-C0xyoib4.js} +1 -1
- package/dist/client/assets/{index-cJuhIA5E.js → index-C85KaHKW.js} +2 -2
- package/dist/client/assets/{index-B3G-1Db4.js → index-CTGvOy90.js} +1 -1
- package/dist/client/assets/{index-BDS4mH87.js → index-CTu_OuGZ.js} +1 -1
- package/dist/client/assets/index-CY_ng_RT.css +1 -0
- package/dist/client/assets/index-Cat2Ur2a.js +1 -0
- package/dist/client/assets/{index-CuPAXGvf.js → index-CfHpa9w5.js} +1 -1
- package/dist/client/assets/{index-BgT_1f1m.js → index-CfhyBu5A.js} +1 -1
- package/dist/client/assets/{index-osUKgSS7.js → index-DMSyZ1PC.js} +5 -5
- package/dist/client/assets/{index-DHtzYrzs.js → index-DMmps4z3.js} +5 -5
- package/dist/client/assets/{index-Cv99iQ9s.js → index-DSZnahxG.js} +3 -3
- package/dist/client/assets/{index-RA2fruq-.js → index-dG1PkEhl.js} +1 -1
- package/dist/client/assets/{index-redirect-BO-wau82.js → index-redirect-DmjZ1B8p.js} +1 -1
- package/dist/client/assets/{input-D1Gv8_NL.js → input-1RtsmTkF.js} +1 -1
- package/dist/client/assets/{integration-icon-CZMpVL1E.js → integration-icon-DxLbb9qy.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DFsMgWfM.js → invite-member-dialog-j2avaEuH.js} +1 -1
- package/dist/client/assets/{label-C6LQRjqo.js → label-CuycpzyK.js} +1 -1
- package/dist/client/assets/{layout-e_SjAR9T.js → layout-cuby18T_.js} +1 -1
- package/dist/client/assets/{login-BSE4ROrF.js → login-dgVubRRa.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CExdgV58.js → mcp-oauth-zippK-pA.js} +1 -1
- package/dist/client/assets/{members-CHmCLjfq.js → members-DDqeH639.js} +1 -1
- package/dist/client/assets/{monaco-editor-Kvx66aN7.js → monaco-editor-BTlS3Jcm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-TBIrVoKL.js → monitoring-stats-row-BtnXyvA-.js} +1 -1
- package/dist/client/assets/{multi-select-Lx9hoOhE.js → multi-select-DDWHXTOC.js} +1 -1
- package/dist/client/assets/{oauth-callback-BpCtjLRG.js → oauth-callback-C3gXSJ-f.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CeNAuOqe.js → oauth-callback-ai-provider-DuWDDtiB.js} +1 -1
- package/dist/client/assets/{onboarding-hb5F4qib.js → onboarding-B7taP69e.js} +1 -1
- package/dist/client/assets/{org-install-Bs0HJQO0.js → org-install-BMshT6Kz.js} +1 -1
- package/dist/client/assets/{org-layout-B_o3hfnw.js → org-layout-B4Kd_h2Z.js} +1 -1
- package/dist/client/assets/{organization-choice-CEKaLhVE.js → organization-choice-2omIAvR5.js} +1 -1
- package/dist/client/assets/{orgs-ipONzmrt.js → orgs-D1RgFQJ7.js} +1 -1
- package/dist/client/assets/{page-seo-form-CmLzT3gw.js → page-seo-form-BN228Xkk.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BqvEObfo.js +1 -0
- package/dist/client/assets/{popover-nLbxx2tm.js → popover-pMjGUykd.js} +1 -1
- package/dist/client/assets/post-editor-B-yA3z0f.js +1 -0
- package/dist/client/assets/{primitives-B_fLkgE2.js → primitives-hTNWqwra.js} +1 -1
- package/dist/client/assets/{profile-C0Hwg89f.js → profile-BskU3ogX.js} +1 -1
- package/dist/client/assets/project-app-view-Ck_oFYlZ.js +1 -0
- package/dist/client/assets/record-editor-BKFwUXbn.js +1 -0
- package/dist/client/assets/redirect-editor-Buh94JvK.js +1 -0
- package/dist/client/assets/registry-Duu54PRM.js +2 -0
- package/dist/client/assets/{registry-layout-D3bAs9Qa.js → registry-layout-5RGlZ5Z_.js} +1 -1
- package/dist/client/assets/reports-BEeeQEGX.js +43 -0
- package/dist/client/assets/{require-capability-UM5-7UW4.js → require-capability-u_hyb0xb.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BVAQEE4a.js → required-auth-layout-B0hyPLrN.js} +1 -1
- package/dist/client/assets/{reset-password-BUVj36_b.js → reset-password-B-1ZDoiX.js} +1 -1
- package/dist/client/assets/roles-CiE8K-D4.js +1 -0
- package/dist/client/assets/{search-input-BkUwKS2D.js → search-input-0trCFAtj.js} +1 -1
- package/dist/client/assets/{secrets-CyLT5I-g.js → secrets-BkJhY_zI.js} +1 -1
- package/dist/client/assets/{sections-editor-BzQFIS__.js → sections-editor-CRr_vuW5.js} +2 -2
- package/dist/client/assets/{select-CW6UAgqk.js → select-BZ2uyFha.js} +1 -1
- package/dist/client/assets/{select-model-BB8UZEr7.js → select-model-CQuepAKj.js} +1 -1
- package/dist/client/assets/{self-tool-result-CNatc7aY.js → self-tool-result-6sETFR7k.js} +1 -1
- package/dist/client/assets/seo-editor-Ct73nPgG.js +1 -0
- package/dist/client/assets/settings-layout-D4zIQbSh.js +1 -0
- package/dist/client/assets/{settings-section-BUc4dc2Z.js → settings-section-hwdjPfIH.js} +1 -1
- package/dist/client/assets/{shell-controls-uvYdBQ9J.js → shell-controls-CjKmQDHH.js} +1 -1
- package/dist/client/assets/{shell-layout-C26BWW3A.js → shell-layout-CQmTObw4.js} +1 -1
- package/dist/client/assets/{sidebar-Df7FAyMJ.js → sidebar-VwrbgopG.js} +1 -1
- package/dist/client/assets/{skeleton-Bh51H_qt.js → skeleton-5or6c6a4.js} +1 -1
- package/dist/client/assets/{sso-cSIAqPoN.js → sso-DThbYWSx.js} +1 -1
- package/dist/client/assets/{store-B93Rq4di.js → store-HyMkBZBo.js} +1 -1
- package/dist/client/assets/store-registry-DwWE7t_E.js +2 -0
- package/dist/client/assets/{studio-tools-C5M-8IB_.js → studio-tools-D3Jh1aS_.js} +1 -1
- package/dist/client/assets/{switch-bwxIfzvo.js → switch-BvId1h7x.js} +1 -1
- package/dist/client/assets/{table-DVd55Q6d.js → table-CbyMEuIw.js} +1 -1
- package/dist/client/assets/{tabs-hgF7ZCkc.js → tabs-bdhX5rhL.js} +1 -1
- package/dist/client/assets/{textarea-DJa_iznS.js → textarea-jptDrRLe.js} +1 -1
- package/dist/client/assets/{toggle-group-CAH1Hx8k.js → toggle-group-DH-q2f-c.js} +1 -1
- package/dist/client/assets/{toolbar-Fx7Y1MeE.js → toolbar-CgmtGgtt.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BzCc0lHV.js → toolbar-icon-button-CPygwZKi.js} +1 -1
- package/dist/client/assets/{tooltip-CeBtAc-Q.js → tooltip-CJ5Y5366.js} +1 -1
- package/dist/client/assets/{use-ai-providers-RUE5iJZ6.js → use-ai-providers-Lg-k4_mA.js} +1 -1
- package/dist/client/assets/{use-api-keys-CavYK5Tg.js → use-api-keys-Bd5cc4tv.js} +1 -1
- package/dist/client/assets/{use-automations-AVicqQJX.js → use-automations-CwOEXsLX.js} +1 -1
- package/dist/client/assets/{use-autosave-CstyN0-Q.js → use-autosave-BLO-Hrcs.js} +1 -1
- package/dist/client/assets/{use-capability-BqKrdQX0.js → use-capability-DEHiMOjo.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CbWbBVoS.js → use-clock-tick-DXtOQtpb.js} +1 -1
- package/dist/client/assets/{use-connection-BFgjYMCx.js → use-connection-Ck7fU3Z4.js} +1 -1
- package/dist/client/assets/{use-copy-D50eCFOO.js → use-copy-DLOqStvb.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bxd3JLCU.js → use-create-virtual-mcp-K5ESAvbN.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BxoahVDF.js → use-debounced-autosave-BJsvh0K3.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DtB2MUZF.js → use-debounced-value-DeWb2Xe3.js} +1 -1
- package/dist/client/assets/{use-deco-credits-AstFkv7d.js → use-deco-credits-_ZnPIq3e.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CLJTbinJ.js → use-decopilot-events-Bt-vNCWP.js} +1 -1
- package/dist/client/assets/{use-delete-connection-6zXECMpi.js → use-delete-connection-B9tkmQ5M.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CbOZffh5.js → use-deployment-admin-xe5VFZgM.js} +1 -1
- package/dist/client/assets/{use-file-configs-BQu09fEP.js → use-file-configs-nbkcXtzD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C_PDhy7Y.js → use-infinite-scroll-DSfn4Dq8.js} +1 -1
- package/dist/client/assets/{use-join-requests-BXOV6Q-X.js → use-join-requests-BdTpATGr.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CMsRck_h.js → use-mcp-auth-status-CxzQOxft.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DCcQbeST.js → use-mcp-client-Bi1l5K5b.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-pt0EYOUp.js → use-mcp-tools-A2pVmeDY.js} +1 -1
- package/dist/client/assets/{use-members-BmDf1Ez2.js → use-members-B-802VrQ.js} +1 -1
- package/dist/client/assets/{use-mobile-BpGP7t1t.js → use-mobile-fV0eYRhU.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DBvbBbE5.js → use-navigate-to-agent-D3lktxgi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-wqvjMz_I.js → use-org-auth-client-Byy_ag-z.js} +1 -1
- package/dist/client/assets/{use-org-sso-BorzfaCb.js → use-org-sso-CqNJvI6A.js} +1 -1
- package/dist/client/assets/{use-organization-roles-nGTnAnyJ.js → use-organization-roles-B_rb7vF1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BalIiDFK.js → use-organization-settings-BtpD3U3D.js} +1 -1
- package/dist/client/assets/{use-registry-app-CKb6cB0l.js → use-registry-app-DftwoaLr.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CiQeT9S9.js → use-registry-connections-CFzxn-fx.js} +1 -1
- package/dist/client/assets/{use-secrets-BUiyxffy.js → use-secrets-DtHqq7gg.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bg74NSvH.js → use-status-sounds-BiF66TnR.js} +1 -1
- package/dist/client/assets/{use-view-mode-B_tIKVK9.js → use-view-mode-CYxmOFxU.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BNYMyb4m.js → use-virtual-mcp-B1_JZqx4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DWm0T-LL.js +1 -0
- package/dist/client/assets/{useQueries-CcJabo7z.js → useQueries-DK7Tbwua.js} +1 -1
- package/dist/client/assets/{useRouterState-dFus1Ln-.js → useRouterState-DNEZopRB.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DwMra6Dq.js +1 -0
- package/dist/client/assets/{users-DwkMIlNd.js → users-C0lqtWR2.js} +1 -1
- package/dist/client/assets/variant-calendar-BnWkzjAV.js +1 -0
- package/dist/client/assets/{view-mode-toggle-8iS5ijBu.js → view-mode-toggle-DD3UaPAO.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ZapSquare-BHPZ3Jvr.js +0 -1
- package/dist/client/assets/agent-icon-d2jw6ps1.js +0 -1
- package/dist/client/assets/agents-list-Cm1KQ9D2.js +0 -1
- package/dist/client/assets/app-editor-C0yvbakK.js +0 -1
- package/dist/client/assets/automations-DzcQxxuw.js +0 -1
- package/dist/client/assets/bulk-category-panel-DSczrC1Z.js +0 -1
- package/dist/client/assets/category-editor-BR9UGbHt.js +0 -1
- package/dist/client/assets/collection-detail-Df9j0JqN.js +0 -1
- package/dist/client/assets/commerce-onboarding-CwSYKBRm.js +0 -1
- package/dist/client/assets/connection-detail-f_zfJBbX.js +0 -1
- package/dist/client/assets/connections-C4mwNVj_.js +0 -1
- package/dist/client/assets/file-explorer-DamDG5YJ.js +0 -2
- package/dist/client/assets/index-3kWge206.css +0 -1
- package/dist/client/assets/index-DksnNwcW.js +0 -1
- package/dist/client/assets/page-seo-sheet-DsDFhgZG.js +0 -1
- package/dist/client/assets/post-editor-rYvYjvCB.js +0 -1
- package/dist/client/assets/project-app-view-C_-8Oph6.js +0 -1
- package/dist/client/assets/record-editor-BAjYX7Y4.js +0 -1
- package/dist/client/assets/redirect-editor-CnHUNMDR.js +0 -1
- package/dist/client/assets/registry-DkBLL9mY.js +0 -2
- package/dist/client/assets/reports-CsadAOm9.js +0 -43
- package/dist/client/assets/roles-BjSGPwj8.js +0 -1
- package/dist/client/assets/seo-editor-BaHx_U8X.js +0 -1
- package/dist/client/assets/settings-layout-D9tllYwD.js +0 -1
- package/dist/client/assets/store-registry-BvxUmcwj.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BLsai4DH.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DZIquNP6.js +0 -1
- package/dist/client/assets/variant-calendar-CjFd9em1.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as He,b as at,r as V,m as Be,j as s,B as qe,k as Hs,o as Sa,t as Q,K as ba}from"./index-osUKgSS7.js";import{a3 as ya,a4 as _a,a5 as ja,H as Gs,J as Jt,K as Us,P as Ws,i as qs,a6 as Ea,V as Js,W as Ys,a7 as ka,a8 as Ra,G as wa,L as Qs,M as Pt,Q as Xs,U as Zs,N as en,_ as tn,a9 as sn,aa as Va,ab as Ct,ac as Na,S as nn,ad as nt,ae as Da,af as Ta,ag as Pa,ah as Ca,e as Aa,k as Ma,ai as Ka,aj as La,ak as Fa,al as Ba,r as Ht,am as Gt,an as Oa,ao as ht,ap as Nt,aq as Ia,ar as $a,as as Xe,at as Ts,au as za,av as Dt,aw as Ut,ax as Ha,ay as cs,az as Ga,aA as kt,aB as Ua,aC as Wa,aD as qa,aE as Ja,aF as Ya,aG as vt,aH as Qa,aI as Xa,aJ as Za,m as eo,aK as Ps,aL as Tt,aM as to,aN as so,aO as no,aP as ao,aQ as us,aR as Cs,aS as As,aT as Rt,aU as Wt,aV as Ms,aW as oo,aX as ds,aY as io,aZ as ro,a_ as lo,a$ as Ks,b0 as co}from"./index-DHtzYrzs.js";import{t as uo}from"./ChevronDown-Dxdrzb03.js";import{$ as fs,U as an,E as mo,x as on,a0 as fo,a1 as po}from"./agent-icon-d2jw6ps1.js";import{i as rn}from"./ChevronRight-DD-OjvGf.js";import{n as go}from"./ChevronUp-CorFhFXr.js";import{i as ho}from"./Globe01-CmsCC8zN.js";import{m as qt}from"./automation-runs-02j6ZCbn.js";import{c as xt,T as St,a as bt}from"./tooltip-CeBtAc-Q.js";import{b as vo,h as xo,a as So,c as bo,d as yo,e as _o}from"./dialog-EQ_Nu1nb.js";import{I as jo}from"./input-D1Gv8_NL.js";import{a as ln}from"./Copy01-DggHPLxu.js";import{c as Eo}from"./ZoomOut-Dzo8MaxJ.js";import{i as ko}from"./Settings02-CqbXJDf7.js";import{s as Ro}from"./Eye-BYEbwinV.js";import{s as cn}from"./TrendUp01-Dz5gzrTN.js";import{s as ps}from"./Plus-Cht7lL4D.js";import{s as un}from"./Trash01-DQk8SKeW.js";import{i as wo}from"./Zap-DC8YgF5a.js";import{a as ft,D as dn,b as mn,c as fn,i as Vo}from"./dropdown-menu-Du_BmHui.js";import{S as No,r as Ls,a as Do,d as To,b as Po,i as Co,f as Ao,P as Mo,c as Ko}from"./page-seo-form-CmLzT3gw.js";import{b as Lo}from"./Tool01-BzMShFGo.js";import{A as Fo}from"./add-section-modal-COG4EZv1.js";import"./ArrowUp-84PrwJl7.js";import"./chat-context--BCe0uBG.js";import"./autosend-72ilm6k6.js";import"./hooks-DkEEOEGE.js";import"./use-mcp-client-DCcQbeST.js";import"./auth-CshA0DLa.js";import"./decopilot-sse-pool-C_h6McgN.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C5M-8IB_.js";import"./use-virtual-mcp-BNYMyb4m.js";import"./use-ai-providers-RUE5iJZ6.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CLJTbinJ.js";import"./use-organization-settings-BalIiDFK.js";import"./drawer-BtIHYjMs.js";import"./collection-search-Bu14gD2R.js";import"./SearchMd-Bxv7C6ib.js";import"./use-mobile-BpGP7t1t.js";import"./AreaChart-C2g_hZSn.js";import"./index-BgT_1f1m.js";import"./calendar-DzxL6tfI.js";import"./X-CeuyThrh.js";import"./shell-layout-C26BWW3A.js";import"./avatar-_bj3nvif.js";import"./User01-JZByJh_c.js";import"./Users03-DiELMSun.js";import"./SearchLg-CkwIt1df.js";import"./Stars02-8nmeIDYy.js";import"./XClose-D26wD9_Q.js";import"./CheckCircle-Yz1eDu6Z.js";import"./FilterLines-BC5HBNi1.js";import"./required-auth-layout-BVAQEE4a.js";import"./use-org-sso-BorzfaCb.js";import"./index-Cv99iQ9s.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-DKZ8Ars7.js";import"./popover-nLbxx2tm.js";import"./use-registry-app-CKb6cB0l.js";import"./use-mcp-tools-pt0EYOUp.js";import"./use-connection-BFgjYMCx.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CCSTyrRC.js";import"./mcp-oauth-CExdgV58.js";import"./extract-connection-data-DlEzKLiw.js";import"./use-members-BmDf1Ez2.js";import"./use-org-auth-client-wqvjMz_I.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-C1710OBb.js";import"./DotsVertical-DSmQb07B.js";import"./use-copy-D50eCFOO.js";import"./Check-D39cW1EC.js";import"./LinkExternal01-WuLv33QG.js";import"./command-B7Ss5ZQF.js";import"./index-B3G-1Db4.js";import"./ArrowRight-Cpx1Lebk.js";import"./companions-core-DyyxV0Vm.js";import"./ZapSquare-BHPZ3Jvr.js";import"./Star01-DJspHAU-.js";import"./Image01-CTEGxjN6.js";import"./Upload01-CSTbHDB3.js";import"./form-BaVTHbUM.js";import"./label-C6LQRjqo.js";import"./select-CW6UAgqk.js";import"./tabs-hgF7ZCkc.js";import"./Tool02-Dgp6-KLz.js";import"./toggle-group-CAH1Hx8k.js";import"./use-deco-credits-AstFkv7d.js";import"./sidebar-Df7FAyMJ.js";import"./LayoutLeft-CdBrffSJ.js";import"./alert-dialog-CyxTQtK2.js";import"./toolbar-icon-button-BzCc0lHV.js";import"./skeleton-Bh51H_qt.js";import"./github-repo-picker-C3sQ7jRy.js";import"./use-debounced-value-DtB2MUZF.js";import"./use-navigate-to-agent-DBvbBbE5.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-CNK047a0.js";import"./use-registry-connections-CiQeT9S9.js";import"./useInfiniteQuery-BLsai4DH.js";import"./use-infinite-scroll-C_PDhy7Y.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-DidS0F8g.js";import"./integration-icon-CZMpVL1E.js";import"./textarea-DJa_iznS.js";import"./connection-form-helpers-Bu-giKug.js";import"./collection-tabs-D6ZdND0h.js";import"./badge-BnUjJn2C.js";import"./useSuspenseInfiniteQuery-DZIquNP6.js";import"./Monitor01-CIfeipNC.js";import"./connect-desktop-dialog-RMuHHgUH.js";import"./select-model-BB8UZEr7.js";import"./checkbox-DaD8kLui.js";import"./Key01-C-zj_nZY.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BUc4dc2Z.js";import"./ArrowUpRight-B3GPW-_w.js";import"./Stars01-Cc9iJO8V.js";import"./index-BBl4qqLw.js";import"./Palette-D-jexNuW.js";import"./file-type-icon-DW7dVPZj.js";import"./toolbar-Fx7Y1MeE.js";import"./Package-BJ248Tbr.js";import"./index-B2MTCe2b.js";import"./XCircle-DcmvhxNa.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bg74NSvH.js";import"./empty-state-CId3svrh.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-BqKrdQX0.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CMsRck_h.js";import"./Play-DeSndEh-.js";import"./use-debounced-autosave-BxoahVDF.js";import"./index-BDS4mH87.js";import"./search-input-BkUwKS2D.js";import"./switch-bwxIfzvo.js";import"./Users01-EWDKaBW5.js";import"./use-secrets-BUiyxffy.js";import"./useQueries-CcJabo7z.js";import"./monaco-editor-Kvx66aN7.js";import"./use-file-configs-BQu09fEP.js";import"./use-automations-AVicqQJX.js";import"./automation-list-row-DNgedRhX.js";import"./Globe04-Cidz_2od.js";import"./HardDrive-DSsiIG4q.js";import"./Sun-CYtT9w41.js";import"./Shield01-Bvbq_wVy.js";import"./table-DVd55Q6d.js";import"./use-clock-tick-CbWbBVoS.js";function Bo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Oo(g,e){const o=Bo(e),d=o[btoa(g)];if(!d)return;let f=typeof d.image=="string"?d.image:void 0;if(!f&&Array.isArray(d.allOf)){const S=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof S=="string"){const b=S.replace("#/definitions/",""),m=o[b];f=typeof m?.image=="string"?m.image:void 0}}if(f?.includes("{{{"))return f}function Io(g,e){if(!e)return;const o=ya(g);if(!o)return;const d=Oo(o.resolveType,e);if(!d)return;const f=_a(d,o.data);if(f)return ja(f)}const $o="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",zo="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 Fs(g){return Array.from({length:g},(e,o)=>({id:crypto.randomUUID(),index:o}))}function pn(g){return g.map((e,o)=>({...e,index:o}))}function Ho(g,e){if(e===g.length)return g;if(e<g.length)return pn(g.slice(0,e));const o=Array.from({length:e-g.length},(d,f)=>({id:crypto.randomUUID(),index:g.length+f}));return[...g,...o]}function gn(g){const e=He.c(20),{section:o,raw:d,meta:f}=g,S=o.isSavedBlock===!0,b=o.isMultivariate===!0;let m;e[0]!==f||e[1]!==d?(m=d&&f?Io(d,f):void 0,e[0]=f,e[1]=d,e[2]=m):m=e[2];const h=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Eo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&s.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==S?(k=S?{color:wa}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=S,e[8]=k):k=e[8];let D;e[9]!==k?(D=s.jsx(fs,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let r;e[11]!==E?(r=Be("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=r):r=e[12];let p;e[13]!==o.label||e[14]!==r?(p=s.jsx("span",{className:r,children:o.label}),e[13]=o.label,e[14]=r,e[15]=p):p=e[15];let i;return e[16]!==y||e[17]!==D||e[18]!==p?(i=s.jsxs(s.Fragment,{children:[u,y,D,p]}),e[16]=y,e[17]=D,e[18]=p,e[19]=i):i=e[19],i}function hn(g,e){const o=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?$o:d?"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 Go(g){const e=He.c(81),{section:o,raw:d,meta:f,sortableId:S,selected:b,onSelect:m,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:r}=g,p=at(),i=d?qs(d.__resolveType??""):!1;let P;e[0]!==o?(P=Ea(o),e[0]=o,e[1]=P):P=e[1];const l=P;let R;e[2]!==S?(R={id:S,animateLayoutChanges:Yo},e[2]=S,e[3]=R):R=e[3];const{attributes:A,listeners:$,setNodeRef:v,transform:C,isDragging:ie}=Js(R);let L;e[4]!==C?(L=Ys.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=L):L=e[5];const ce=ie?0:void 0;let K;e[6]!==L||e[7]!==ce?(K={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=K):K=e[8];const ge=K;let F;e[9]!==o?(F=ka(o),e[9]=o,e[10]=F):F=e[10];const ne=F,he="button",fe=0;let B;e[11]!==m?(B=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),m())},e[11]=m,e[12]=B):B=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let X;e[13]!==o||e[14]!==b||e[15]!==J?(X=Be("touch-none transition-colors",J,hn(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=X):X=e[16];let ue;e[17]!==f||e[18]!==d||e[19]!==o?(ue=s.jsx(gn,{section:o,raw:d,meta:f}),e[17]=f,e[18]=d,e[19]=o,e[20]=ue):ue=e[20];const O=!o.isMultivariate&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Be("h-7 w-7 shrink-0",i?"":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),D()},onPointerDown:Jo,children:s.jsx(wo,{className:Be("h-3.5 w-3.5",i&&"text-yellow-500")})})}),s.jsx(bt,{side:"bottom",children:p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ke;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==p?(Ke=!o.isMultivariate&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection"),className:Be("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),k()},onPointerDown:qo,children:o.isHidden?s.jsx(ko,{className:"h-3.5 w-3.5"}):s.jsx(Ro,{className:"h-3.5 w-3.5"})})}),s.jsx(bt,{side:"bottom",children:o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=p,e[25]=Ke):Ke=e[25];let Z;e[26]!==p?(Z=p("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=p,e[27]=Z):Z=e[27];let Le;e[28]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(an,{className:"h-3.5 w-3.5"}),e[28]=Le):Le=e[28];let ve;e[29]!==Z?(ve=s.jsx(dn,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Wo,onPointerDown:Uo,children:Le})}),e[29]=Z,e[30]=ve):ve=e[30];let de;e[31]!==u?(de=G=>{G.stopPropagation(),u()},e[31]=u,e[32]=de):de=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ln,{className:"h-4 w-4"}),e[33]=oe):oe=e[33];let ee;e[34]!==p?(ee=p("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=p,e[35]=ee):ee=e[35];let re;e[36]!==de||e[37]!==ee?(re=s.jsxs(ft,{onClick:de,children:[oe,ee]}),e[36]=de,e[37]=ee,e[38]=re):re=e[38];let pe;e[39]!==l||e[40]!==E||e[41]!==p?(pe=l&&s.jsxs(ft,{className:Ra,onClick:G=>{G.stopPropagation(),E()},children:[s.jsx(cn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=p,e[42]=pe):pe=e[42];let ke;e[43]!==ne||e[44]!==y||e[45]!==p?(ke=ne&&s.jsxs(ft,{className:zo,onClick:G=>{G.stopPropagation(),y()},children:[s.jsx(fs,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=p,e[46]=ke):ke=e[46];let Re;e[47]!==r||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==p?(Re=o.isSavedBlock===!0&&!o.isMultivariate&&s.jsxs(ft,{onClick:G=>{G.stopPropagation(),r()},children:[s.jsx(fs,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=r,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=p,e[51]=Re):Re=e[51];let xe;e[52]!==h?(xe=G=>{G.stopPropagation(),h()},e[52]=h,e[53]=xe):xe=e[53];let Ne;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(un,{className:"h-4 w-4"}),e[54]=Ne):Ne=e[54];let _e;e[55]!==p?(_e=p("sectionsEditor.sectionList.deleteMenuItem"),e[55]=p,e[56]=_e):_e=e[56];let z;e[57]!==xe||e[58]!==_e?(z=s.jsxs(ft,{className:"text-destructive focus:text-destructive",onClick:xe,children:[Ne,_e]}),e[57]=xe,e[58]=_e,e[59]=z):z=e[59];let le;e[60]!==re||e[61]!==pe||e[62]!==ke||e[63]!==Re||e[64]!==z?(le=s.jsxs(mn,{align:"end",className:"w-44",children:[re,pe,ke,Re,z]}),e[60]=re,e[61]=pe,e[62]=ke,e[63]=Re,e[64]=z,e[65]=le):le=e[65];let je;e[66]!==ve||e[67]!==le?(je=s.jsxs(fn,{children:[ve,le]}),e[66]=ve,e[67]=le,e[68]=je):je=e[68];let De;return e[69]!==A||e[70]!==$||e[71]!==m||e[72]!==v||e[73]!==ge||e[74]!==X||e[75]!==ue||e[76]!==O||e[77]!==Ke||e[78]!==je||e[79]!==B?(De=s.jsxs("div",{ref:v,style:ge,...A,...$,role:he,tabIndex:fe,onClick:m,onKeyDown:B,className:X,children:[ue,O,Ke,je]}),e[69]=A,e[70]=$,e[71]=m,e[72]=v,e[73]=ge,e[74]=X,e[75]=ue,e[76]=O,e[77]=Ke,e[78]=je,e[79]=B,e[80]=De):De=e[80],De}function Uo(g){return g.stopPropagation()}function Wo(g){return g.stopPropagation()}function qo(g){return g.stopPropagation()}function Jo(g){return g.stopPropagation()}function Yo(){return!1}function Qo(g){const e=He.c(104),{listKey:o,rawSections:d,sections:f,meta:S,selectedIndex:b,onSelect:m,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:r,onDetach:p,onAddSection:i,canAddSection:P}=g,l=P===void 0?!0:P,R=at();let A;e[0]!==f.length?(A=()=>Fs(f.length),e[0]=f.length,e[1]=A):A=e[1];const[$,v]=V.useState(A),[C,ie]=V.useState(null),[L,ce]=V.useState(o),[K,ge]=V.useState(f.length),F=V.useRef(!1);L!==o?(ce(o),ge(f.length),v(Fs(f.length))):K!==f.length&&(ge(f.length),v(Ie=>Ho(Ie,f.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:Qs},e[3]=he):he=e[3];const fe=Gs(Jt(Ws,ne),Jt(Us,he));let B;e[4]!==$?(B=$.map(Xo),e[4]=$,e[5]=B):B=e[5];const J=B;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=Ie=>{ie(String(Ie.active.id))},e[6]=X):X=e[6];const ue=X;let O;e[7]!==J||e[8]!==h?(O=Ie=>{ie(null);const{active:N,over:ae}=Ie;if(!ae||N.id===ae.id)return;const I=J.indexOf(String(N.id)),Qe=J.indexOf(String(ae.id));I===-1||Qe===-1||(v(Ze=>pn(Pt([...Ze],I,Qe))),F.current=!0,requestAnimationFrame(()=>{F.current=!1}),h?.(I,Qe))},e[7]=J,e[8]=h,e[9]=O):O=e[9];const Ke=O;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{ie(null)},e[10]=Z):Z=e[10];const Le=Z;let ve,de,oe,ee,re,pe,ke,Re,xe,Ne,_e,z,le,je,De;if(e[11]!==C||e[12]!==l||e[13]!==$||e[14]!==J||e[15]!==Ke||e[16]!==S||e[17]!==i||e[18]!==r||e[19]!==u||e[20]!==p||e[21]!==y||e[22]!==k||e[23]!==m||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==f||e[28]!==b||e[29]!==fe||e[30]!==R){je=Symbol.for("react.early_return_sentinel");e:{const Ie=N=>{F.current||m(N)};if(e[46]!==C||e[47]!==l||e[48]!==$||e[49]!==i||e[50]!==d||e[51]!==f||e[52]!==R){const N=C?$.find(ae=>ae.id===C):null;if(ee=N!=null?f[N.index]:null,oe=N!=null?d[N.index]:void 0,$.length===0){let ae;e[56]!==R?(ae=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=ae):ae=e[57];let I;e[58]!==ae?(I=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ae}),e[58]=ae,e[59]=I):I=e[59];const Qe=!l;let Ze;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ze=s.jsx(ps,{size:14}),e[60]=Ze):Ze=e[60];let ot;e[61]!==R?(ot=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=ot):ot=e[62];let it;e[63]!==i||e[64]!==Qe||e[65]!==ot?(it=s.jsxs(qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Qe,onClick:i,children:[Ze,ot]}),e[63]=i,e[64]=Qe,e[65]=ot,e[66]=it):it=e[66];let rt;e[67]!==I||e[68]!==it?(rt=s.jsxs("div",{className:"space-y-2",children:[I,it]}),e[67]=I,e[68]=it,e[69]=rt):rt=e[69],je=rt;break e}le=Be(N&&"cursor-grabbing"),e[46]=C,e[47]=l,e[48]=$,e[49]=i,e[50]=d,e[51]=f,e[52]=R,e[53]=oe,e[54]=ee,e[55]=le}else oe=e[53],ee=e[54],le=e[55];de=Xs,Re=fe,xe=Zs,Ne=ue,_e=Ke,z=Le,ve=en,pe=J,ke=tn,De="space-y-1",re=$.map(N=>{const ae=f[N.index];return ae?s.jsx(Go,{sortableId:N.id,section:ae,raw:d[N.index],meta:S,selected:b===N.index,onSelect:()=>Ie(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>k(N.index),onToggleHidden:()=>D(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>r(N.index),onDetach:()=>p(N.index)},N.id):null})}e[11]=C,e[12]=l,e[13]=$,e[14]=J,e[15]=Ke,e[16]=S,e[17]=i,e[18]=r,e[19]=u,e[20]=p,e[21]=y,e[22]=k,e[23]=m,e[24]=D,e[25]=E,e[26]=d,e[27]=f,e[28]=b,e[29]=fe,e[30]=R,e[31]=ve,e[32]=de,e[33]=oe,e[34]=ee,e[35]=re,e[36]=pe,e[37]=ke,e[38]=Re,e[39]=xe,e[40]=Ne,e[41]=_e,e[42]=z,e[43]=le,e[44]=je,e[45]=De}else ve=e[31],de=e[32],oe=e[33],ee=e[34],re=e[35],pe=e[36],ke=e[37],Re=e[38],xe=e[39],Ne=e[40],_e=e[41],z=e[42],le=e[43],je=e[44],De=e[45];if(je!==Symbol.for("react.early_return_sentinel"))return je;let G;e[70]!==re||e[71]!==De?(G=s.jsx("div",{className:De,children:re}),e[70]=re,e[71]=De,e[72]=G):G=e[72];let Ae;e[73]!==ve||e[74]!==pe||e[75]!==ke||e[76]!==G?(Ae=s.jsx(ve,{items:pe,strategy:ke,children:G}),e[73]=ve,e[74]=pe,e[75]=ke,e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==oe||e[79]!==ee||e[80]!==S?(Oe=ee?s.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",hn(ee,!1)),children:s.jsx(gn,{section:ee,raw:oe,meta:S})}):null,e[78]=oe,e[79]=ee,e[80]=S,e[81]=Oe):Oe=e[81];let ze;e[82]!==Oe?(ze=s.jsx(sn,{dropAnimation:null,children:Oe}),e[82]=Oe,e[83]=ze):ze=e[83];let Fe;e[84]!==de||e[85]!==Re||e[86]!==xe||e[87]!==Ne||e[88]!==_e||e[89]!==z||e[90]!==Ae||e[91]!==ze?(Fe=s.jsxs(de,{sensors:Re,collisionDetection:xe,onDragStart:Ne,onDragEnd:_e,onDragCancel:z,children:[Ae,ze]}),e[84]=de,e[85]=Re,e[86]=xe,e[87]=Ne,e[88]=_e,e[89]=z,e[90]=Ae,e[91]=ze,e[92]=Fe):Fe=e[92];const Se=!l;let we;e[93]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(ps,{size:14}),e[93]=we):we=e[93];let be;e[94]!==R?(be=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=be):be=e[95];let te;e[96]!==i||e[97]!==Se||e[98]!==be?(te=s.jsxs(qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Se,onClick:i,children:[we,be]}),e[96]=i,e[97]=Se,e[98]=be,e[99]=te):te=e[99];let me;return e[100]!==le||e[101]!==Fe||e[102]!==te?(me=s.jsxs("div",{className:le,children:[Fe,te]}),e[100]=le,e[101]=Fe,e[102]=te,e[103]=me):me=e[103],me}function Xo(g){return g.id}function Bs(g){const e=He.c(57),{open:o,initialName:d,autoLabel:f,isPending:S,onSubmit:b,onOpenChange:m}=g,h=S===void 0?!1:S,u=at(),[y,k]=V.useState(d),[D,E]=V.useState(o);o!==D&&(E(o),o&&k(d));let r;e[0]!==h||e[1]!==m?(r=ue=>{!ue&&!h&&m(!1)},e[0]=h,e[1]=m,e[2]=r):r=e[2];const p=r;let i;e[3]!==h||e[4]!==y||e[5]!==b?(i=async ue=>{ue.preventDefault(),!h&&await b(y.trim())},e[3]=h,e[4]=y,e[5]=b,e[6]=i):i=e[6];const P=i;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=s.jsx(vo,{children:l}),e[9]=l,e[10]=R):R=e[10];let A;e[11]!==f||e[12]!==u?(A=u("sectionsEditor.variantRenameDialog.description",{fallback:f||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=f,e[12]=u,e[13]=A):A=e[13];let $;e[14]!==A?($=s.jsx(xo,{children:A}),e[14]=A,e[15]=$):$=e[15];let v;e[16]!==R||e[17]!==$?(v=s.jsxs(So,{children:[R,$]}),e[16]=R,e[17]=$,e[18]=v):v=e[18];let C;e[19]!==u?(C=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=C):C=e[20];let ie;e[21]!==C?(ie=s.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:C}),e[21]=C,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ue=>k(ue.target.value),e[23]=L):L=e[23];let ce;e[24]!==f||e[25]!==h||e[26]!==y?(ce=s.jsx(jo,{id:"variant-rename-name",value:y,onChange:L,placeholder:f,autoFocus:!0,disabled:h}),e[24]=f,e[25]=h,e[26]=y,e[27]=ce):ce=e[27];let K;e[28]!==ie||e[29]!==ce?(K=s.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=K):K=e[30];let ge;e[31]!==m?(ge=()=>m(!1),e[31]=m,e[32]=ge):ge=e[32];let F;e[33]!==u?(F=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=F):F=e[34];let ne;e[35]!==h||e[36]!==ge||e[37]!==F?(ne=s.jsx(qe,{type:"button",variant:"outline",onClick:ge,disabled:h,children:F}),e[35]=h,e[36]=ge,e[37]=F,e[38]=ne):ne=e[38];let he;e[39]!==h||e[40]!==u?(he=h?s.jsxs(s.Fragment,{children:[s.jsx(Hs,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=he):he=e[41];let fe;e[42]!==h||e[43]!==he?(fe=s.jsx(qe,{type:"submit",disabled:h,children:he}),e[42]=h,e[43]=he,e[44]=fe):fe=e[44];let B;e[45]!==ne||e[46]!==fe?(B=s.jsxs(bo,{children:[ne,fe]}),e[45]=ne,e[46]=fe,e[47]=B):B=e[47];let J;e[48]!==P||e[49]!==K||e[50]!==B||e[51]!==v?(J=s.jsx(yo,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:P,children:[v,K,B]})}),e[48]=P,e[49]=K,e[50]=B,e[51]=v,e[52]=J):J=e[52];let X;return e[53]!==p||e[54]!==o||e[55]!==J?(X=s.jsx(_o,{open:o,onOpenChange:p,children:J}),e[53]=p,e[54]=o,e[55]=J,e[56]=X):X=e[56],X}const Zo="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)]",vn="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.2)]";function xn(g){const e=He.c(5),{rule:o,matchers:d}=g,f=o?.__resolveType??"";let S;if(e[0]!==d||e[1]!==f){const u=d.find(y=>y.resolveType===f)?.iconName??Va(f);S=mo(u),e[0]=d,e[1]=f,e[2]=S}else S=e[2];const b=S;if(!b)return null;let m;return e[3]!==b?(m=s.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=m):m=e[4],m}function Os(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function ms(g){return g.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function ei(g){return g.map((e,o)=>({...e,index:o}))}function Sn(g){const e=He.c(17),{label:o,effectiveRule:d,matchers:f,canDelete:S,dragging:b,onRename:m,onDuplicate:h,onDelete:u}=g,y=at();let k;e[0]!==d||e[1]!==f?(k=s.jsx(xn,{rule:d,matchers:f}),e[0]=d,e[1]=f,e[2]=k):k=e[2];let D;e[3]!==o?(D=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==S||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==y?(E=!b&&s.jsxs(fn,{children:[s.jsx(dn,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:si,onPointerDown:ti,children:s.jsx(an,{size:14})})}),s.jsxs(mn,{align:"end",className:"w-36",children:[s.jsxs(ft,{onClick:p=>{p.stopPropagation(),m?.()},children:[s.jsx(Lo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),s.jsxs(ft,{onClick:p=>{p.stopPropagation(),h?.()},children:[s.jsx(ln,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),s.jsx(Vo,{}),s.jsxs(ft,{variant:"destructive",disabled:!S,onClick:p=>{p.stopPropagation(),u?.()},children:[s.jsx(un,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=S,e[6]=b,e[7]=o,e[8]=u,e[9]=h,e[10]=m,e[11]=y,e[12]=E):E=e[12];let r;return e[13]!==k||e[14]!==D||e[15]!==E?(r=s.jsxs(s.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=r):r=e[16],r}function ti(g){return g.stopPropagation()}function si(g){return g.stopPropagation()}function ni(g){const e=He.c(33),{entry:o,sortableId:d,isActive:f,canDelete:S,decofile:b,meta:m,matchers:h,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:ai},e[0]=d,e[1]=E):E=e[1];const{attributes:r,listeners:p,setNodeRef:i,transform:P,isDragging:l}=Js(E);let R;e[2]!==P?(R=Ys.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const A=l?0:void 0;let $;e[4]!==R||e[5]!==A?($={transform:R,opacity:A},e[4]=R,e[5]=A,e[6]=$):$=e[6];const v=$,C=m??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==C?(ie=Ct(o.variant.rule,b,C),e[7]=b,e[8]=o.variant.rule,e[9]=C,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=fe=>{fe.target===fe.currentTarget&&(fe.key==="Enter"||fe.key===" ")&&(fe.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const K=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=f?vn:Zo;let F;e[13]!==K||e[14]!==ge?(F=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",K,ge),e[13]=K,e[14]=ge,e[15]=F):F=e[15];let ne;e[16]!==S||e[17]!==L||e[18]!==o.variant.label||e[19]!==h||e[20]!==D||e[21]!==k||e[22]!==y?(ne=s.jsx(Sn,{label:o.variant.label,effectiveRule:L,matchers:h,canDelete:S,onRename:y,onDuplicate:k,onDelete:D}),e[16]=S,e[17]=L,e[18]=o.variant.label,e[19]=h,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==r||e[25]!==p||e[26]!==u||e[27]!==i||e[28]!==v||e[29]!==F||e[30]!==ne||e[31]!==ce?(he=s.jsx("div",{ref:i,style:v,...r,...p,onClick:u,onKeyDown:ce,className:F,children:ne}),e[24]=r,e[25]=p,e[26]=u,e[27]=i,e[28]=v,e[29]=F,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function ai(){return!1}function oi(g){const e=He.c(9),{variant:o,decofile:d,meta:f,matchers:S}=g,b=f??void 0;let m;e[0]!==d||e[1]!==b||e[2]!==o.rule?(m=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=m):m=e[3];const h=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vn),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==S||e[7]!==o.label?(y=s.jsx("div",{className:u,children:s.jsx(Sn,{label:o.label,effectiveRule:h,matchers:S,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=S,e[7]=o.label,e[8]=y):y=e[8],y}function ii(g){const e=He.c(91),{listKey:o,variants:d,activeIndex:f,decofile:S,meta:b,matchers:m,onSelect:h,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=g,r=at();let p;e[0]!==d?(p=()=>ms(d),e[0]=d,e[1]=p):p=e[1];const[i,P]=V.useState(p),[l,R]=V.useState(null),[A,$]=V.useState(o),[v,C]=V.useState(d.length);let ie;e[2]!==d?(ie=()=>Os(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=V.useState(ie),K=V.useRef(!1),ge=Os(d);A!==o?($(o),C(d.length),ce(ge),P(ms(d))):v!==d.length?(C(d.length),ce(ge),P(ms(d))):L!==ge&&(ce(ge),P(Fe=>d.map((Se,we)=>({id:Fe[we]?.id??crypto.randomUUID(),index:we,variant:Se}))));let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[4]=F):F=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:Qs},e[5]=ne):ne=e[5];const he=Gs(Jt(Ws,F),Jt(Us,ne));let fe;e[6]!==i?(fe=i.map(ri),e[6]=i,e[7]=fe):fe=e[7];const B=fe,J=d.length>1;let X;e[8]!==i?(X=Fe=>{const Se=String(Fe.active.id);R(i.find(we=>we.id===Se)??null)},e[8]=i,e[9]=X):X=e[9];const ue=X;let O;e[10]!==B||e[11]!==u?(O=Fe=>{R(null);const{active:Se,over:we}=Fe;if(!we||Se.id===we.id)return;const be=B.indexOf(String(Se.id)),te=B.indexOf(String(we.id));be===-1||te===-1||(P(me=>ei(Pt([...me],be,te))),K.current=!0,requestAnimationFrame(()=>{K.current=!1}),u(be,te))},e[10]=B,e[11]=u,e[12]=O):O=e[12];const Ke=O;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[13]=Z):Z=e[13];const Le=Z;let ve,de,oe,ee,re,pe,ke,Re,xe,Ne,_e,z,le;if(e[14]!==f||e[15]!==J||e[16]!==S||e[17]!==i||e[18]!==B||e[19]!==Ke||e[20]!==ue||e[21]!==m||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==h||e[28]!==he||e[29]!==r){const Fe=I=>{K.current||h(I)};_e="space-y-1 border-b p-2";let Se;e[43]!==r?(Se=r("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=r,e[44]=Se):Se=e[44];let we;e[45]!==Se?(we=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Se}),e[45]=Se,e[46]=we):we=e[46];let be;e[47]!==r?(be=r("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=r,e[48]=be):be=e[48];let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(ps,{size:14}),e[49]=te):te=e[49];let me;e[50]!==E||e[51]!==be?(me=s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":be,className:"size-6",onClick:E,children:te})}),e[50]=E,e[51]=be,e[52]=me):me=e[52];let Ie;e[53]!==r?(Ie=r("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=r,e[54]=Ie):Ie=e[54];let N;e[55]!==Ie?(N=s.jsx(bt,{children:Ie}),e[55]=Ie,e[56]=N):N=e[56];let ae;e[57]!==me||e[58]!==N?(ae=s.jsxs(xt,{children:[me,N]}),e[57]=me,e[58]=N,e[59]=ae):ae=e[59],e[60]!==we||e[61]!==ae?(z=s.jsxs("div",{className:"flex items-center justify-between",children:[we,ae]}),e[60]=we,e[61]=ae,e[62]=z):z=e[62],de=Xs,pe=he,ke=Zs,Re=ue,xe=Ke,Ne=Le,ve=en,ee=B,re=tn,le="space-y-0.5",oe=i.map(I=>s.jsx(ni,{sortableId:I.id,entry:I,isActive:I.index===f,canDelete:J,decofile:S,meta:b,matchers:m,onSelect:()=>Fe(I.index),onRename:()=>y(I.index),onDuplicate:()=>k(I.index),onDelete:()=>D(I.index)},I.id)),e[14]=f,e[15]=J,e[16]=S,e[17]=i,e[18]=B,e[19]=Ke,e[20]=ue,e[21]=m,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=h,e[28]=he,e[29]=r,e[30]=ve,e[31]=de,e[32]=oe,e[33]=ee,e[34]=re,e[35]=pe,e[36]=ke,e[37]=Re,e[38]=xe,e[39]=Ne,e[40]=_e,e[41]=z,e[42]=le}else ve=e[30],de=e[31],oe=e[32],ee=e[33],re=e[34],pe=e[35],ke=e[36],Re=e[37],xe=e[38],Ne=e[39],_e=e[40],z=e[41],le=e[42];let je;e[63]!==oe||e[64]!==le?(je=s.jsx("div",{className:le,children:oe}),e[63]=oe,e[64]=le,e[65]=je):je=e[65];let De;e[66]!==ve||e[67]!==ee||e[68]!==re||e[69]!==je?(De=s.jsx(ve,{items:ee,strategy:re,children:je}),e[66]=ve,e[67]=ee,e[68]=re,e[69]=je,e[70]=De):De=e[70];let G;e[71]!==l||e[72]!==S||e[73]!==m||e[74]!==b?(G=l?s.jsx(oi,{variant:l.variant,decofile:S,meta:b,matchers:m}):null,e[71]=l,e[72]=S,e[73]=m,e[74]=b,e[75]=G):G=e[75];let Ae;e[76]!==G?(Ae=s.jsx(sn,{dropAnimation:null,children:G}),e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==de||e[79]!==pe||e[80]!==ke||e[81]!==Re||e[82]!==xe||e[83]!==Ne||e[84]!==De||e[85]!==Ae?(Oe=s.jsxs(de,{sensors:pe,collisionDetection:ke,onDragStart:Re,onDragEnd:xe,onDragCancel:Ne,children:[De,Ae]}),e[78]=de,e[79]=pe,e[80]=ke,e[81]=Re,e[82]=xe,e[83]=Ne,e[84]=De,e[85]=Ae,e[86]=Oe):Oe=e[86];let ze;return e[87]!==_e||e[88]!==z||e[89]!==Oe?(ze=s.jsxs("div",{className:_e,children:[z,Oe]}),e[87]=_e,e[88]=z,e[89]=Oe,e[90]=ze):ze=e[90],ze}function ri(g){return g.id}function li(g){const e=He.c(16),{schema:o,value:d,onChange:f,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}=g,u=at();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=V.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&s.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[s.jsx("button",{type:"button",onClick:()=>D([]),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:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:s.jsx(on,{className:"size-3.5"})}),k.map((i,P)=>{const l=P===k.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&s.jsx(rn,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>D(k.slice(0,P+1)),title:i,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:i})]},`${i}-${P}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let r;e[4]!==k||e[5]!==b||e[6]!==S||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==o||e[11]!==d?(r=s.jsx(nn,{schema:o,value:d,onChange:f,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}),e[4]=k,e[5]=b,e[6]=S,e[7]=f,e[8]=m,e[9]=h,e[10]=o,e[11]=d,e[12]=r):r=e[12];let p;return e[13]!==E||e[14]!==r?(p=s.jsxs("div",{className:"space-y-2",children:[E,r]}),e[13]=E,e[14]=r,e[15]=p):p=e[15],p}function Is(g){const e=He.c(21),{activeSchema:o,formValue:d,formResetKey:f,onFormChange:S,onBreadcrumbChange:b,breadcrumbPath:m,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p}=g;let i;e[0]!==m?(i=m===void 0?[]:m,e[0]=m,e[1]=i):i=e[1];const P=i;let l;e[2]!==o||e[3]!==P||e[4]!==E||e[5]!==f||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==S||e[10]!==r||e[11]!==p||e[12]!==y||e[13]!==k?(l=o&&d?y?s.jsx(No,{schema:o,resolveType:y,value:d,formResetKey:f,onChange:S,onBreadcrumbChange:b,siteDefaultSeo:k}):s.jsx(nn,{schema:o,value:d,onChange:S,basePath:"",breadcrumbPath:P,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p},f):null,e[2]=o,e[3]=P,e[4]=E,e[5]=f,e[6]=d,e[7]=D,e[8]=b,e[9]=S,e[10]=r,e[11]=p,e[12]=y,e[13]=k,e[14]=l):l=e[14];const R=l;let A;e[15]!==h||e[16]!==R?(A=R??s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[15]=h,e[16]=R,e[17]=A):A=e[17];let $;return e[18]!==u||e[19]!==A?($=s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,A]})}),e[18]=u,e[19]=A,e[20]=$):$=e[20],$}const ci="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 ui(g,e){return Na(g,e,nt)}function di(g){const e=He.c(19),{pageKey:o,initialName:d,initialPath:f,onFieldChange:S}=g,b=at(),[m,h]=V.useState(d),[u,y]=V.useState(f),[k,D]=V.useState(o);k!==o&&(D(o),h(d),y(f));let E;e[0]!==S?(E=A=>{h(A.target.value),S("name",A.target.value)},e[0]=S,e[1]=E):E=e[1];let r;e[2]!==b?(r=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=r):r=e[3];let p;e[4]!==m||e[5]!==E||e[6]!==r?(p=s.jsx("input",{type:"text",value:m,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:r}),e[4]=m,e[5]=E,e[6]=r,e[7]=p):p=e[7];let i;e[8]!==S?(i=A=>{y(A.target.value),S("path",A.target.value)},e[8]=S,e[9]=i):i=e[9];let P;e[10]!==b?(P=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==i||e[14]!==P?(l=s.jsx("input",{type:"text",value:u,onChange:i,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:P}),e[12]=u,e[13]=i,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==p||e[17]!==l?(R=s.jsxs("div",{className:"space-y-1",children:[p,l]}),e[16]=p,e[17]=l,e[18]=R):R=e[18],R}function $s(g){const e=He.c(13),{onClick:o}=g,d=at();let f;e[0]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=f):f=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(cn,{size:14}),e[2]=S):S=e[2];let b;e[3]!==o||e[4]!==f?(b=s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":f,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:S})}),e[3]=o,e[4]=f,e[5]=b):b=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let h;e[8]!==m?(h=s.jsx(bt,{side:"bottom",children:m}),e[8]=m,e[9]=h):h=e[9];let u;return e[10]!==b||e[11]!==h?(u=s.jsxs(xt,{children:[b,h]}),e[10]=b,e[11]=h,e[12]=u):u=e[12],u}function zs(g){const e=He.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P}=g;let l;e[0]!==f||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==S||e[5]!==m||e[6]!==h?(l=s.jsx(Da,{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h}),e[0]=f,e[1]=d,e[2]=o,e[3]=b,e[4]=S,e[5]=m,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==p||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==r||e[13]!==k||e[14]!==i||e[15]!==P||e[16]!==u?(R=u&&y&&s.jsx("div",{className:E,children:s.jsx(li,{schema:u,value:y,onChange:k,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P},D)}),e[8]=p,e[9]=D,e[10]=y,e[11]=E,e[12]=r,e[13]=k,e[14]=i,e[15]=P,e[16]=u,e[17]=R):R=e[17];let A;return e[18]!==l||e[19]!==R?(A=s.jsxs(s.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=A):A=e[20],A}function rc({orgSlug:g,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:f,currentPath:S,activePageBlockKey:b=null,activeGlobalBlockKey:m=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const r=at(),p=d?{orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f}:null,{data:i,isLoading:P}=Ta(p),{data:l,isLoading:R}=Pa(p),A=Ca(),$=A?.entity?.id===e?A.entity.metadata?.siteSlug??null:null,[v,C]=V.useState(null),[ie,L]=V.useState(null),[ce,K]=V.useState(null),[ge,F]=V.useState(0),[ne,he]=V.useState(void 0),[fe,B]=V.useState(null),[J,X]=V.useState(null),[ue,O]=V.useState([]),[Ke,Z]=V.useState(0),[Le,ve]=V.useState(null),[de,oe]=V.useState(null),[ee,re]=V.useState(null),[pe,ke]=V.useState(!0),[Re,xe]=V.useState(!1),[Ne,_e]=V.useState(!1),[z,le]=V.useState(y),[je,De]=V.useState(y);y&&!je&&(De(!0),le(!0),C(null),L(null),K(null),O([])),!y&&je&&De(!1);const[G,Ae]=V.useState(null),[Oe,ze]=V.useState(void 0),[Fe,Se]=V.useState([]),[we,be]=V.useState(0),[te,me]=V.useState(0),[Ie,N]=V.useState(null),[ae,I]=V.useState(null),[Qe,Ze]=V.useState(null),ot=Sa(),it=`${g}/${e}/${o}`,rt=Aa({orgSlug:g,virtualMcpId:e,branch:o}),[bn,yn]=V.useState(S),[_n,jn]=V.useState(b),[En,kn]=V.useState(m);(bn!==S||_n!==b||En!==m)&&(queueMicrotask(()=>rt.flush()),yn(S),jn(b),kn(m),C(null),L(null),K(null),F(0),B(null),X(null),me(0),N(null),I(null),O([]),Z(t=>t+1),le(!1),Ae(null),ze(void 0),Se([]),be(t=>t+1));const Ve=Ma({orgSlug:g,virtualMcpId:e,branch:o}),At=eo((t,n)=>{Ve.mutate({blockKey:t,data:n},{onSuccess:()=>u?.(),onError:a=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Yt=Ka({orgSlug:g,virtualMcpId:e,branch:o}),[wt,Mt]=V.useState(!1),Qt=V.useRef(null),yt=V.useRef(null),_t=V.useRef(null),Xt=V.useRef({}),Je=V.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Hs,{size:20,className:"animate-spin text-muted-foreground"})});if(!i||!l)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Rn=La(i),Te=!!m,Ge=Te?null:Fa(Rn,S,b),w=Te?m:Ge?.key??null,Zt=Te&&m?i[m]:void 0,gs=Te&&m&&Zt?Ba(m,Zt):Te&&m?m:"",Kt=!Te&&w&&i[w]?i[w]:null,es=z&&i&&l&&w&&Ge?Ls(i,{kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},l):null,wn=z?Kt?.seo:void 0,ts=Oe!==void 0?Oe:wn,Vn=z?Do(ts):void 0,Nn=es?.seoTypeOptions??[],Dn=z&&l?To(l):"",hs=G??Vn??{},ss=z&&es?Po(hs,es):null,Tn=z&&ss&&Co(ts)?Ht(ss,l):null,Pn=z?Ao(i,l)?.seoData:void 0,$e=Te?[{label:"Default",sections:[{__resolveType:m}]}]:ui(Kt?.sections,i??{}),Lt=$e.length>1,Ce=Math.min(ge,$e.length-1),lt=$e[Ce],W=lt?.sections??[],Me=Gt(W,i),vs=!Te&&Oa(Kt?.sections);if(Te&&m&&Qe!==m){Ze(m);const t=W[0],n=Me[0];if(t&&n){C(0),me(0),O([]);const a=ht(t,n,i);a&&(L(a.data),K(a.resolveType),I(null),N(null))}}!Te&&Qe!==null&&Ze(null),Je.current={rawSections:W,parsedSections:Me,decofile:i??{},activePageKey:w,pageVariants:$e,variantIndex:Ce,sectionVariantIndex:te,selectedSectionIndex:v};const Cn=()=>({multivariate:vs,index:Ce,variants:$e.map(t=>({rule:t.rule}))}),xs=(t,n)=>{if(!E)return;if(!w||!vs||t.length<=1){E(null);return}const a=Ms(w,{multivariate:!0,index:n,variants:t},i,l);E(a.length>0?a:null)},jt=(t,n,a)=>{if(!E)return;if(!w){E(null);return}const c=Cn(),x=Ms(w,c,i,l);if(!t||n<0){E(x.length>0?x:null);return}const j=oo({pageKey:w,page:c,sectionIndex:n,sectionLazy:Me[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:l}),_=[...x,...j];E(_.length>0?_:null)},ct=(t,n,a,c=v??-1,x=!1)=>{const j=Xe(t,n);if(!j){L(null),K(null),I(null),N(null),x&&jt(null,c,a);return}const T=Ts(j,nt)[a];if(!T){L(null),K(null),I(null),N(null),x&&jt(null,c,a);return}const se=Ua(T.value,i);L(se?.data??null),K(se?.resolveType??null);const{resolveType:M,formValue:H}=Nt(T.rule,i,l??void 0);I(M),N(H),x&&jt(j,c,a)};if(h!==void 0&&h!==ne&&(he(h??null),typeof h=="number")){const t=W[h],n=Me[h];if(t&&n)if(C(h),me(0),O([]),Z(a=>a+1),n.isMultivariate)ct(t,n,0,h);else{const a=ht(t,n,i);a?(L(a.data),K(a.resolveType)):(L(null),K(null)),I(null),N(null)}}const Ft={orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f??void 0,siteSlug:$},ns=ce&&l?Ht(ce,l):null,Ue=(t,n)=>{if(!w)return;const a=Tt(i,w,t,Ce,$e);Ve.mutate({blockKey:w,data:a},{onSuccess:()=>n?.onSuccess?.()??u?.(),onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},Et=()=>{C(null),L(null),K(null),me(0),N(null),I(null),O([]),Z(t=>t+1)},An=(t,n)=>{Qt.current&&clearTimeout(Qt.current);const a=Je.current.sectionVariantIndex;Qt.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current,M=c[n];if(!M)return;const H=x[n];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ve.mutate({blockKey:q,data:t},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!_)return;const U={...j[_]},Ee=[...c];if(H.isMultivariate){const q=Xe(M,H);if(!q||!_)return;const Y=ro(q,a,t);Ee[n]=vt(M,H,Y)}else if(H.isHidden){const q=qs(M.__resolveType),Y=q?{...M.section}:{...M},Pe=Array.isArray(Y.variants)?[...Y.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Y.variants=Pe,q?Ee[n]={...M,section:Y}:Ee[n]=Y}else H.isLazy?Ee[n]={...M,section:t}:Ee[n]=t;if(T.length>1){const q=U.sections,Y=[...q?.variants??[]];Y[se]&&(Y[se]={...Y[se],value:Ee}),U.sections={...q,variants:Y}}else U.sections=Ee;Ve.mutate({blockKey:_,data:U},{onSuccess:()=>u?.(),onError:q=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},ds)},Mn=t=>{C(t),me(0),O([]),Z(x=>x+1);const n=W[t],a=Me[t];if(!n||!a)return;if(a.isMultivariate){ct(n,a,0,t);return}const c=ht(n,a,i);if(!c){L(null),K(null),I(null),N(null),jt(null,t,0);return}L(c.data),K(c.resolveType),I(null),N(null),jt(null,t,0)},Ss=t=>{const n=t;L(n),v!==null&&An(n,v)},as=t=>{if(!w||!i||!l||!Ge)return;const n={kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},a=Ls(i,n,l);a&&rt.save(w,()=>{const c=ot.getQueryData(ba.decofile(it))?.[w];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const x={...c,...Xt.current};return Xt.current={},t?.raw!==void 0?{...x,seo:t.raw}:t?.inner!==void 0?Ko(n,a,x,t.inner):x})},Kn=(t,n)=>{w&&(Xt.current[t]=n,as())},Ln=(t,n)=>{if(!w)return;const a=Pt([...W],t,n);v!==null&&(v===t?C(n):t<v&&n>=v?C(v-1):t>v&&n<=v&&C(v+1)),Ue(a)},Fn=t=>{if(!w)return;const n=W.filter((a,c)=>c!==t);v===t?Et():v!==null&&v>t&&C(v-1),Ue(n)},Bn=t=>{if(!w)return;const n=W[t];if(!n)return;const a=[...W];a.splice(t+1,0,ao(n)),v!==null&&v>t&&C(v+1),Ue(a)},On=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a||a.isMultivariate)return;const c=a.isHidden?so(n):no(n);if(!c)return;const x=[...W];x[t]=c,v===t&&Et(),Ue(x)},In=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a||a.isMultivariate)return;const c=to(n);if(!c)return;const x=[...W];x[t]=c,v===t&&Et(),Ue(x)},$n=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a?.isSavedBlock)return;const c=ht(n,a,i);if(!c?.data)return;const{name:x,...j}=c.data,_=[...W];a.isLazy?_[t]={...n,section:j}:_[t]=j,v===t&&Et(),Ue(_)},zn=t=>{if(!w)return;const n=[...W,{__resolveType:t.resolveType}],a=n.length-1;Ue(n,{onSuccess:()=>{xe(!1),C(a),me(0),O([]),Z(_=>_+1);const c=n[a],x=Gt(n,i)[a];if(!c||!x)return;if(x.isMultivariate){ct(c,x,0);return}const j=ht(c,x,i);if(!j){L(null),K(null),I(null),N(null);return}L(j.data),K(j.resolveType),I(null),N(null)}})},Hn=t=>{if(v===null)return;const n=W[v],a=Me[v];!n||!a?.isMultivariate||(me(t),O([]),Z(c=>c+1),ct(n,a,t,v,!0))},Gn=t=>{if(v===null||!w)return;const n=W[v],a=Me[v];if(!n||!a?.isMultivariate)return;const c=Xe(n,a);if(!c)return;const x=Xa(c,t);if(!x){Q.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...W];j[v]=vt(n,a,x);const _=x.variants;let T=te;t===te?T=Math.min(t,_.length-1):t<te&&(T=te-1),me(T),O([]),Z(se=>se+1),ct(j[v],a,T),Ue(j)},Un=t=>{if(v===null||!w)return;const n=W[v],a=Me[v];if(!n||!a?.isMultivariate)return;const c=Xe(n,a);if(!c)return;const x=Za(c,t),j=[...W];j[v]=vt(n,a,x);const _=t+1;me(_),O([]),Z(T=>T+1),ct(j[v],a,_),Ue(j)},Wn=(t,n)=>{if(v===null||!w||t===n)return;const a=W[v],c=Me[v];if(!a||!c?.isMultivariate)return;const x=Xe(a,c);if(!x)return;const j=Ya(x,t,n),_=[...W];_[v]=vt(a,c,j);let T=te;te===t?T=n:t<te&&n>=te?T=te-1:t>te&&n<=te&&(T=te+1),me(T),ct(_[v],c,T),Ue(_)},os=t=>{const n=t??v;if(n===null||!w)return;const a=W[n],c=Me[n];if(!a||!c)return;const x=Wa(a,c);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...W];j[n]=x.section;const _=Gt(j,i)[n];if(!_?.isMultivariate){Q.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(n),me(x.newVariantIndex),O([]),Z(T=>T+1),ct(x.section,_,x.newVariantIndex,n),Ue(j)},qn=()=>{if(v===null||!w)return;const t=W[v],n=Me[v];if(!t||!n?.isMultivariate)return;const a=Xe(t,n);if(!a)return;const c=Qa(t,n,a);if(!c){Q.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const x=[...W];x[v]=c;const j=Gt(x,i)[v];if(!j)return;me(0),I(null),N(null),O([]),Z(T=>T+1);const _=ht(c,j,i);_?(L(_.data),K(_.resolveType)):(L(null),K(null)),jt(null,v,0),Ue(x)},Jn=async t=>{if(Le===null||!w)return;const n=us(t,i);if(n){Q.error(n);return}const a=W[Le],c=Me[Le];if(!a||!c)return;const x=ht(a,c,i);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...x.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:j});const _=[...W];_[Le]={__resolveType:t},await Ve.mutateAsync({blockKey:w,data:Tt(i,w,_,Ce,$e)}),v===Le&&Et(),ve(null),Q.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},bs=lt?.rule;if(Lt&&v===null&&J===null&&bs){const{resolveType:t,formValue:n}=Nt(bs,i??{},l??void 0);X(t),B(n)}const Bt=l?Ia(l):[],ys=l&&i?$a(l,i):[],Yn=!Te&&!!(f&&l&&i),Qn=J&&l?Ht(J,l):null,Ot=()=>{yt.current&&(clearTimeout(yt.current),yt.current=null),_t.current&&(clearTimeout(_t.current),_t.current=null)},Vt=async(t,n)=>{if(!(io(n,t,l)>0))try{await Yt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},_s=t=>{yt.current&&clearTimeout(yt.current),yt.current=setTimeout(()=>{const{activePageKey:n,decofile:a,variantIndex:c}=Je.current;if(!n)return;const x={...a[n]},j={...x.sections},_=[...j.variants??[]],T=_[c],se=T?.rule;if(kt(se,a,l)){const M=se?.__resolveType??"",H=a[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...q}=t;Ve.mutate({blockKey:M,data:Rt(Ee??"",q,U)},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}T&&(_[c]={...T,rule:t}),x.sections={...j,variants:_},Ve.mutate({blockKey:n,data:x},{onSuccess:()=>u?.(),onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},ds)},Xn=t=>{X(t);const n=t?{__resolveType:t}:{__resolveType:Ks};B({}),_s(n)},Zn=t=>{const n=t;B(n);const a=J?{__resolveType:J,...n}:{...n};_s(a)},ea=async t=>{Ot();const{activePageKey:n,decofile:a,variantIndex:c}=Je.current;if(!n)return;const x=a[n],j=x?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],se=T[c];if(!se)return;const M=Dt(se.rule,a,l),H=Wt(t);T[c]={...se,rule:H};const U={...a,[n]:{...x,sections:{..._,variants:T}}},{resolveType:Ee,formValue:q}=Nt(H,U,l??void 0);X(Ee),B(q);try{await Ve.mutateAsync({blockKey:n,data:U[n]}),M&&M!==t&&await Vt(M,U),u?.()}catch(Y){Q.error(Y instanceof Error?Y.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{_t.current&&clearTimeout(_t.current);const{selectedSectionIndex:n,sectionVariantIndex:a}=Je.current;n!==null&&(_t.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(!_)return;const M=c[n],H=x[n];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const q=(U.variants??[])[a]?.rule;if(kt(q,j,l)){const ye=q?.__resolveType??"",We=j[ye],tt=typeof We?.name=="string"?We.name:ye,{__resolveType:dt,...st}=t;Ve.mutate({blockKey:ye,data:Rt(dt??"",st,tt)},{onSuccess:()=>u?.(),onError:mt=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:mt.message}))});return}const Y=Ps(U,a,t),Pe=[...c];Pe[n]=vt(M,H,Y);const Ye=Tt(j,_,Pe,se,T);Ve.mutate({blockKey:_,data:Ye},{onSuccess:()=>u?.(),onError:ye=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ye.message}))})},ds))},ta=t=>{I(t),N({}),js(t?{__resolveType:t}:{__resolveType:Ks})},sa=t=>{const n=t;N(n);const a=ae?{__resolveType:ae,...n}:{...n};js(a)},na=async t=>{Ot();const{selectedSectionIndex:n,sectionVariantIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(n===null||!_)return;const M=c[n],H=x[n];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const Ee=U.variants??[],q=Dt(Ee[a]?.rule,j,l),Y=Wt(t),Pe=Ps(U,a,Y),Ye=[...c];Ye[n]=vt(M,H,Pe);const ye=Tt(j,_,Ye,se,T),We={...j,[_]:ye},{resolveType:tt,formValue:dt}=Nt(Y,We,l??void 0);I(tt),N(dt);try{await Ve.mutateAsync({blockKey:_,data:ye}),q&&q!==t&&await Vt(q,We),u?.()}catch(st){Q.error(st instanceof Error?st.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Te&&!Ge)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:S})});if(Te&&!Zt)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ut=v!==null?Me[v]??null:null,Es=v!==null?W[v]:null,ks=Es&&ut?.isMultivariate?Xe(Es,ut):null,pt=ks?Ts(ks,nt):[],is=Math.min(te,Math.max(pt.length-1,0)),It=pt[is]??null,gt=ut?.isMultivariate===!0,Rs=v!==null&&ut!==null,$t=Rs&&(gt||!!(ns&&ie)),aa=$t&&!Te&&ut?.isSavedBlock===!0,et=Te||aa,oa=Te?gs:ut?.label??"",ia=ae&&l?Ht(ae,l):null,rs=$t&&(!Te||ue.length>0)?Te?[gs,...ue]:[Ge.name,ut.label,...gt&&It?[It.label]:[],...ue]:[],ra=z&&Ge?[Ge.name,"SEO",...Fe]:[],zt=z?ra:et?rs.length>0?rs:[oa]:rs,ws=()=>{if(!w)return;const t=i[w],n=qa(t.sections,W);if(!n)return;const a=Ja(n);Ve.mutate({blockKey:w,data:{...t,sections:n}},{onSuccess:()=>{F(a),C(null),L(null),K(null),O([]),B(null),X(null)},onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},ls=(t,n,a)=>{if(!w)return;const c=i[w],x=c.sections;if(!x||typeof x!="object"||Array.isArray(x))return;const j=x;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const T=lo(j,_),se={...i,[w]:{...c,sections:T}};Ve.mutate({blockKey:w,data:se[w]},{onSuccess:()=>{n?.(),a&&Vt(a,se)},onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},la=t=>{oe(null),F(t),C(null),L(null),K(null),O([]);const n=$e[t]?.rule,{resolveType:a,formValue:c}=Nt(n,i??{},l??void 0);X(a),B(c),xs($e.map(x=>({rule:x.rule})),t)},ca=(t,n)=>{if(t===n)return;let a=Ce;Ce===t?a=n:t<Ce&&n>=Ce?a=Ce-1:t>Ce&&n<=Ce&&(a=Ce+1),F(a);const c=Pt($e.map(x=>({rule:x.rule})),t,n);xs(c,a),ls(x=>Pt(x,t,n))},ua=t=>{const n=$e[t]?.rule,a=Dt(n,i??{},l??void 0);ls(c=>c.length<=1?null:(c.splice(t,1),c),()=>{$e.length-1===1?F(0):t<Ce?F(Ce-1):t===Ce&&F(Math.max(0,t-1)),C(null),L(null),K(null),O([]),B(null),X(null)},a)},da=t=>{ls(n=>co(n,t),()=>{F(t+1),C(null),L(null),K(null),O([]),B(null),X(null)})},ma=async(t,n)=>{Ot();const a=Je.current.activePageKey,c=Je.current.decofile;if(!a)return;const x=c[a],j=x.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],se=T[t];if(!se?.rule||typeof se.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=se.rule,H=n.trim();Mt(!0);try{if(!H){if(!kt(M,c,l)){oe(null);return}const Ye=M.__resolveType??"";T[t]={...se,rule:Cs(M,c,l)};const ye={...c,[a]:{...x,sections:{..._,variants:T}}};await Ve.mutateAsync({blockKey:a,data:ye[a]}),await Vt(Ye,ye),oe(null),u?.();return}const U=As(M,c,l);if(!U){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ve.mutateAsync({blockKey:U.blockKey,data:Rt(U.resolveType,U.data,H)}),oe(null),u?.();return}const Ee=cs(H),q=us(Ee,c);if(q){Q.error(q);return}const Y=Rt(U.resolveType,U.data,H);let Pe=null;try{await Ve.mutateAsync({blockKey:Ee,data:Y}),Pe=Ee,T[t]={...se,rule:Wt(Ee)},await Ve.mutateAsync({blockKey:a,data:{...x,sections:{..._,variants:T}}}),Pe=null}catch(Ye){throw Pe&&await Yt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ye}oe(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(U){Q.error(U instanceof Error?U.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Mt(!1)}},fa=async(t,n)=>{Ot();const{selectedSectionIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(a===null||!_)return;const M=c[a],H=x[a];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const Ee=U.variants??[],q=Ee[t];if(!q?.rule||typeof q.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=q.rule,Pe=n.trim();Mt(!0);const Ye=async ye=>{const We={...U,variants:ye},tt=[...c];tt[a]=vt(M,H,We);const dt=Tt(j,_,tt,se,T);return await Ve.mutateAsync({blockKey:_,data:dt}),{...j,[_]:dt}};try{if(!Pe){if(!kt(Y,j,l)){re(null);return}const mt=Y.__resolveType??"",Ds=[...Ee];Ds[t]={...q,rule:Cs(Y,j,l)};const xa=await Ye(Ds);await Vt(mt,xa),re(null),u?.();return}const ye=As(Y,j,l);if(!ye){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ye.blockKey){await Ve.mutateAsync({blockKey:ye.blockKey,data:Rt(ye.resolveType,ye.data,Pe)}),re(null),u?.();return}const We=cs(Pe),tt=us(We,j);if(tt){Q.error(tt);return}const dt=Rt(ye.resolveType,ye.data,Pe);let st=null;try{await Ve.mutateAsync({blockKey:We,data:dt}),st=We;const mt=[...Ee];mt[t]={...q,rule:Wt(We)},await Ye(mt),st=null}catch(mt){throw st&&await Yt.mutateAsync({blockKey:st}).catch(()=>{}),mt}re(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ye){Q.error(ye instanceof Error?ye.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Mt(!1)}},Vs=()=>{Et()},pa=t=>{Ae(t),as({inner:t})},ga=t=>{ze(t),as({raw:t})},ha=()=>{Ae(null),Se([])},va=()=>be(t=>t+1),Ns=t=>{if(z){if(t===0){rt.flush(),le(!1),Ae(null),ze(void 0),Se([]),be(a=>a+1),k?.();return}if(t===1){Se([]),be(a=>a+1);return}Se(Fe.slice(0,t-1)),be(a=>a+1);return}if(Te){O(ue.slice(0,t)),Z(a=>a+1);return}if(t===0){Vs();return}if(t===1){O([]),Z(a=>a+1);return}if(gt&&t===2){O([]),Z(a=>a+1);return}const n=gt?2:1;O(ue.slice(0,t-n))};return s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[s.jsx("div",{className:"shrink-0",children:et||$t||z?s.jsxs("div",{className:Be("border-b px-3 py-2.5",et&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[zt.length>1&&s.jsx("button",{type:"button",onClick:()=>Ns(zt.length-2),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:Be("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",et?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(on,{className:"size-4"})}),!Te&&Lt&<&&s.jsxs("button",{type:"button",onClick:Vs,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:lt.label}),className:Be("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",ci),children:[s.jsx(xn,{rule:Ct(lt.rule,i??{},l??void 0),matchers:Bt}),s.jsx("span",{className:"max-w-[160px] truncate",children:lt.label})]}),s.jsx("nav",{"aria-label":r("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:zt.map((t,n)=>{const a=n===zt.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n>0&&s.jsx(rn,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ns(n),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?et?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":et?"text-foreground/80":"text-muted-foreground",et?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${n}`)})}),et&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(ho,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(bt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rs&&!gt&&!ut?.isHidden&&w&&s.jsx($s,{onClick:()=>os()})]}),et&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(di,{pageKey:w,initialName:Ge.name,initialPath:Ge.path,onFieldChange:Kn})}),s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>le(!0),children:s.jsx(fo,{size:14})})}),s.jsx(bt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&w?D(w):_e(!0),children:s.jsx(po,{size:14})})}),s.jsx(bt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx($s,{onClick:ws})]})}),z?s.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Kt&&w?s.jsx(Mo,{rawSeo:ts,innerSeo:hs,defaultResolveType:Dn,seoSchema:Tn,activeResolveType:ss,seoTypeOptions:Nn,formResetKey:we,siteDefaultSeo:Pn,onBreadcrumbChange:Se,onPersistRaw:ga,onInnerChange:pa,onClearForm:ha,onBumpFormKey:va}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):$t?s.jsxs(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[gt&&pt.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(za,{listKey:`${w??""}:${v??""}`,variants:pt.map((t,n)=>({index:n,label:t.label})),selectedIndex:is,onSelect:Hn,onRename:re,onDuplicate:Un,onDelete:Gn,onRemoveAll:qn,onReorder:Wn,onAdd:()=>os()}),gt&&s.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),s.jsx(zs,{currentRt:ae??"",currentLabel:Ut(It?.rule,i??{},nt,l??void 0),currentGlobalKey:Dt(It?.rule,i??{},l??void 0)??void 0,matchers:Bt,globals:ys,onSelect:ta,onSelectGlobal:na,schema:ia,formValue:Ie,onChange:sa,formKey:`${v??"none"}:${is}:${ae??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})]})]}),s.jsx(Is,{activeSchema:ns,formValue:ie,formResetKey:Ke,onFormChange:Ss,onBreadcrumbChange:O,breadcrumbPath:ue,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})]}):Te?s.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(Is,{activeSchema:ns,formValue:ie,formResetKey:Ke,onFormChange:Ss,onBreadcrumbChange:O,breadcrumbPath:ue,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})}):s.jsxs(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Lt&&w&&s.jsx(ii,{listKey:w,variants:$e,activeIndex:Ce,decofile:i??{},meta:l,matchers:Bt,onSelect:la,onReorder:ca,onRename:oe,onDuplicate:da,onDelete:ua,onAdd:ws}),Lt&&J!==null&&s.jsxs("div",{className:Be("px-3 border-b",pe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),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":pe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),pe?s.jsx(go,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(uo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),pe&&s.jsx("div",{className:Be("space-y-3",wt&&"pointer-events-none opacity-50"),children:s.jsx(zs,{currentRt:J,currentLabel:Ut(lt?.rule,i??{},nt,l??void 0),currentGlobalKey:Dt(lt?.rule,i??{},l??void 0)??void 0,matchers:Bt,globals:ys,onSelect:Xn,onSelectGlobal:ea,schema:Qn,formValue:fe,onChange:Zn,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})})]}),s.jsx("div",{className:"p-2 pt-3",children:s.jsx(Qo,{listKey:`${w??""}-${Ce}`,rawSections:W,sections:Me,meta:l,selectedIndex:v,onSelect:Mn,onReorder:Ln,onDelete:Fn,onDuplicate:Bn,onMakeReusable:ve,onToggleHidden:On,onToggleLazy:In,onAddVariant:os,onDetach:$n,onAddSection:()=>xe(!0),canAddSection:Yn})})]}),s.jsx(Ha,{open:Le!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Le!==null?cs(Me[Le]?.label??""):"",isPending:Ve.isPending,onSubmit:Jn}),f&&s.jsx(Fo,{open:Re,onOpenChange:xe,meta:l,decofile:i,previewBaseUrl:f,onSelect:zn}),Ne&&w&&i&&s.jsx(Ga,{open:Ne,onOpenChange:_e,pageKey:w,decofile:i}),de!==null&&s.jsx(Bs,{open:!0,initialName:kt($e[de]?.rule,i??{},l??void 0)?Ut($e[de]?.rule,i??{},nt,l??void 0):"",autoLabel:nt(Ct($e[de]?.rule,i??{},l??void 0)),isPending:wt,onSubmit:async t=>{await ma(de,t)},onOpenChange:t=>{!t&&!wt&&oe(null)}}),ee!==null&&s.jsx(Bs,{open:!0,initialName:kt(pt[ee]?.rule,i??{},l??void 0)?Ut(pt[ee]?.rule,i??{},nt,l??void 0):"",autoLabel:nt(Ct(pt[ee]?.rule,i??{},l??void 0)),isPending:wt,onSubmit:async t=>{await fa(ee,t)},onOpenChange:t=>{!t&&!wt&&re(null)}})]})}export{rc as SectionsEditor};
|
|
1
|
+
import{c as He,b as at,r as V,m as Be,j as s,B as qe,k as Hs,o as Sa,t as Q,K as ba}from"./index-DMSyZ1PC.js";import{a3 as ya,a4 as _a,a5 as ja,H as Gs,J as Jt,K as Us,P as Ws,i as qs,a6 as Ea,V as Js,W as Ys,a7 as ka,a8 as Ra,G as wa,L as Qs,M as Pt,Q as Xs,U as Zs,N as en,_ as tn,a9 as sn,aa as Va,ab as Ct,ac as Na,S as nn,ad as nt,ae as Da,af as Ta,ag as Pa,ah as Ca,e as Aa,k as Ma,ai as Ka,aj as La,ak as Fa,al as Ba,r as Ht,am as Gt,an as Oa,ao as ht,ap as Nt,aq as Ia,ar as $a,as as Xe,at as Ts,au as za,av as Dt,aw as Ut,ax as Ha,ay as cs,az as Ga,aA as kt,aB as Ua,aC as Wa,aD as qa,aE as Ja,aF as Ya,aG as vt,aH as Qa,aI as Xa,aJ as Za,m as eo,aK as Ps,aL as Tt,aM as to,aN as so,aO as no,aP as ao,aQ as us,aR as Cs,aS as As,aT as Rt,aU as Wt,aV as Ms,aW as oo,aX as ds,aY as io,aZ as ro,a_ as lo,a$ as Ks,b0 as co}from"./index-DMmps4z3.js";import{t as uo}from"./ChevronDown-C82kSPQJ.js";import{$ as fs,U as an,E as mo,x as on,a0 as fo,a1 as po}from"./agent-icon-CCxdHfHq.js";import{i as rn}from"./ChevronRight-pKqWhPFO.js";import{n as go}from"./ChevronUp-Ur5tOU4r.js";import{i as ho}from"./Globe01-bBcCao8m.js";import{m as qt}from"./automation-runs-CjOXuQZP.js";import{c as xt,T as St,a as bt}from"./tooltip-CJ5Y5366.js";import{b as vo,h as xo,a as So,c as bo,d as yo,e as _o}from"./dialog-DXHGb8ov.js";import{I as jo}from"./input-1RtsmTkF.js";import{a as ln}from"./Copy01-CjvNe041.js";import{c as Eo}from"./ZoomOut-Ce4wv8I3.js";import{i as ko}from"./Settings02-C48BmakR.js";import{s as Ro}from"./Eye-D6UmvuQl.js";import{s as cn}from"./TrendUp01-DAMS2ptH.js";import{s as ps}from"./Plus-CxvuE4Es.js";import{s as un}from"./Trash01-CbEfRhj4.js";import{i as wo}from"./Zap-KiDFkWg-.js";import{a as ft,D as dn,b as mn,c as fn,i as Vo}from"./dropdown-menu-C7j_C2Iz.js";import{S as No,r as Ls,a as Do,d as To,b as Po,i as Co,f as Ao,P as Mo,c as Ko}from"./page-seo-form-BN228Xkk.js";import{b as Lo}from"./Tool01-ttrYDD-F.js";import{A as Fo}from"./add-section-modal-BL2N_SLv.js";import"./ArrowUp-Dqm6yb7b.js";import"./chat-context-Dtvr7cnX.js";import"./autosend-iAh1cE6e.js";import"./hooks-2lJrOuZm.js";import"./use-mcp-client-Bi1l5K5b.js";import"./auth-C488ati9.js";import"./decopilot-sse-pool-XB4qOGfZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D3Jh1aS_.js";import"./use-virtual-mcp-B1_JZqx4.js";import"./use-ai-providers-Lg-k4_mA.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-Bt-vNCWP.js";import"./use-organization-settings-BtpD3U3D.js";import"./drawer-B33BKDxG.js";import"./collection-search-BM5saw5W.js";import"./SearchMd-CVAS4bHb.js";import"./use-mobile-fV0eYRhU.js";import"./AreaChart-8TuFtZwM.js";import"./index-CfhyBu5A.js";import"./calendar-C5NP6DS-.js";import"./X-Dc8jzuGp.js";import"./shell-layout-CQmTObw4.js";import"./avatar-Cc14VL9E.js";import"./User01-DvoPZa3L.js";import"./Users03-Dxbbv3M0.js";import"./SearchLg-D6bYV_e6.js";import"./Stars02-B1CYtkwJ.js";import"./XClose-BLwV1Ngp.js";import"./CheckCircle-Dx2byA8l.js";import"./FilterLines-I4EBUx4y.js";import"./required-auth-layout-B0hyPLrN.js";import"./use-org-sso-CqNJvI6A.js";import"./index-DSZnahxG.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-DjC0A58U.js";import"./popover-pMjGUykd.js";import"./use-registry-app-DftwoaLr.js";import"./use-mcp-tools-A2pVmeDY.js";import"./use-connection-Ck7fU3Z4.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CsBw_Hbi.js";import"./mcp-oauth-zippK-pA.js";import"./extract-connection-data-DpPAxW37.js";import"./use-members-B-802VrQ.js";import"./use-org-auth-client-Byy_ag-z.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-CWc3BvFb.js";import"./DotsVertical-CsPrfBHu.js";import"./use-copy-DLOqStvb.js";import"./Check-BXZBH--f.js";import"./LinkExternal01-Beo7SFkQ.js";import"./command-DY8SVt2y.js";import"./index-CTGvOy90.js";import"./ArrowRight-DnZw9chb.js";import"./companions-core-CE6Q99bc.js";import"./ZapSquare-Bqk2MRuL.js";import"./Star01-DbfqTNT0.js";import"./Image01-CwV9iuxz.js";import"./Upload01-CtTjeXyd.js";import"./form-XFZrliJE.js";import"./label-CuycpzyK.js";import"./select-BZ2uyFha.js";import"./tabs-bdhX5rhL.js";import"./Tool02-1ZIphfq5.js";import"./toggle-group-DH-q2f-c.js";import"./use-deco-credits-_ZnPIq3e.js";import"./sidebar-VwrbgopG.js";import"./LayoutLeft-B7XnXJCX.js";import"./alert-dialog-3eCoJM_J.js";import"./toolbar-icon-button-CPygwZKi.js";import"./skeleton-5or6c6a4.js";import"./github-repo-picker-RzuGCDsI.js";import"./use-debounced-value-DeWb2Xe3.js";import"./use-navigate-to-agent-D3lktxgi.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-CVkAOr7Y.js";import"./use-registry-connections-CFzxn-fx.js";import"./useInfiniteQuery-DWm0T-LL.js";import"./use-infinite-scroll-DSfn4Dq8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-Bqgf0tZo.js";import"./integration-icon-DxLbb9qy.js";import"./textarea-jptDrRLe.js";import"./connection-form-helpers-B3OfCtqO.js";import"./collection-tabs-Daxt5rsE.js";import"./badge-D9Myt67H.js";import"./useSuspenseInfiniteQuery-DwMra6Dq.js";import"./Monitor01-CNCx-B51.js";import"./connect-desktop-dialog-CNKcnYr9.js";import"./select-model-CQuepAKj.js";import"./checkbox-CLeT6Gju.js";import"./Key01-C-044wq-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-hwdjPfIH.js";import"./ArrowUpRight-a-xAV1yD.js";import"./Stars01-DdKwQ9te.js";import"./index-BKasOmzh.js";import"./Palette-DyqhX3Li.js";import"./file-type-icon-D3SBaNGX.js";import"./toolbar-CgmtGgtt.js";import"./Package-CidzBhtk.js";import"./index-C0xyoib4.js";import"./XCircle-Bb4jhNm5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BiF66TnR.js";import"./empty-state-C86_b7IP.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DEHiMOjo.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CxzQOxft.js";import"./Play-Bs1D_H9C.js";import"./use-debounced-autosave-BJsvh0K3.js";import"./index-CTu_OuGZ.js";import"./search-input-0trCFAtj.js";import"./switch-BvId1h7x.js";import"./Users01-HKR3d_K9.js";import"./use-secrets-DtHqq7gg.js";import"./useQueries-DK7Tbwua.js";import"./monaco-editor-BTlS3Jcm.js";import"./use-file-configs-nbkcXtzD.js";import"./use-automations-CwOEXsLX.js";import"./automation-list-row-D7W2Rtfd.js";import"./Globe04-BvAgykOe.js";import"./HardDrive-B1MltyIG.js";import"./LogOut01-BbBoHzGS.js";import"./Sun-CiZGxTK4.js";import"./Shield01-CpLEfQVx.js";import"./table-CbyMEuIw.js";import"./use-clock-tick-DXtOQtpb.js";function Bo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Oo(g,e){const o=Bo(e),d=o[btoa(g)];if(!d)return;let f=typeof d.image=="string"?d.image:void 0;if(!f&&Array.isArray(d.allOf)){const S=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof S=="string"){const b=S.replace("#/definitions/",""),m=o[b];f=typeof m?.image=="string"?m.image:void 0}}if(f?.includes("{{{"))return f}function Io(g,e){if(!e)return;const o=ya(g);if(!o)return;const d=Oo(o.resolveType,e);if(!d)return;const f=_a(d,o.data);if(f)return ja(f)}const $o="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",zo="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 Fs(g){return Array.from({length:g},(e,o)=>({id:crypto.randomUUID(),index:o}))}function pn(g){return g.map((e,o)=>({...e,index:o}))}function Ho(g,e){if(e===g.length)return g;if(e<g.length)return pn(g.slice(0,e));const o=Array.from({length:e-g.length},(d,f)=>({id:crypto.randomUUID(),index:g.length+f}));return[...g,...o]}function gn(g){const e=He.c(20),{section:o,raw:d,meta:f}=g,S=o.isSavedBlock===!0,b=o.isMultivariate===!0;let m;e[0]!==f||e[1]!==d?(m=d&&f?Io(d,f):void 0,e[0]=f,e[1]=d,e[2]=m):m=e[2];const h=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Eo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&s.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==S?(k=S?{color:wa}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=S,e[8]=k):k=e[8];let D;e[9]!==k?(D=s.jsx(fs,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let r;e[11]!==E?(r=Be("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=r):r=e[12];let p;e[13]!==o.label||e[14]!==r?(p=s.jsx("span",{className:r,children:o.label}),e[13]=o.label,e[14]=r,e[15]=p):p=e[15];let i;return e[16]!==y||e[17]!==D||e[18]!==p?(i=s.jsxs(s.Fragment,{children:[u,y,D,p]}),e[16]=y,e[17]=D,e[18]=p,e[19]=i):i=e[19],i}function hn(g,e){const o=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?$o:d?"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 Go(g){const e=He.c(81),{section:o,raw:d,meta:f,sortableId:S,selected:b,onSelect:m,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:r}=g,p=at(),i=d?qs(d.__resolveType??""):!1;let P;e[0]!==o?(P=Ea(o),e[0]=o,e[1]=P):P=e[1];const l=P;let R;e[2]!==S?(R={id:S,animateLayoutChanges:Yo},e[2]=S,e[3]=R):R=e[3];const{attributes:A,listeners:$,setNodeRef:v,transform:C,isDragging:ie}=Js(R);let L;e[4]!==C?(L=Ys.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=L):L=e[5];const ce=ie?0:void 0;let K;e[6]!==L||e[7]!==ce?(K={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=K):K=e[8];const ge=K;let F;e[9]!==o?(F=ka(o),e[9]=o,e[10]=F):F=e[10];const ne=F,he="button",fe=0;let B;e[11]!==m?(B=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),m())},e[11]=m,e[12]=B):B=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let X;e[13]!==o||e[14]!==b||e[15]!==J?(X=Be("touch-none transition-colors",J,hn(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=X):X=e[16];let ue;e[17]!==f||e[18]!==d||e[19]!==o?(ue=s.jsx(gn,{section:o,raw:d,meta:f}),e[17]=f,e[18]=d,e[19]=o,e[20]=ue):ue=e[20];const O=!o.isMultivariate&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Be("h-7 w-7 shrink-0",i?"":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),D()},onPointerDown:Jo,children:s.jsx(wo,{className:Be("h-3.5 w-3.5",i&&"text-yellow-500")})})}),s.jsx(bt,{side:"bottom",children:p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ke;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==p?(Ke=!o.isMultivariate&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection"),className:Be("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),k()},onPointerDown:qo,children:o.isHidden?s.jsx(ko,{className:"h-3.5 w-3.5"}):s.jsx(Ro,{className:"h-3.5 w-3.5"})})}),s.jsx(bt,{side:"bottom",children:o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=p,e[25]=Ke):Ke=e[25];let Z;e[26]!==p?(Z=p("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=p,e[27]=Z):Z=e[27];let Le;e[28]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(an,{className:"h-3.5 w-3.5"}),e[28]=Le):Le=e[28];let ve;e[29]!==Z?(ve=s.jsx(dn,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Wo,onPointerDown:Uo,children:Le})}),e[29]=Z,e[30]=ve):ve=e[30];let de;e[31]!==u?(de=G=>{G.stopPropagation(),u()},e[31]=u,e[32]=de):de=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ln,{className:"h-4 w-4"}),e[33]=oe):oe=e[33];let ee;e[34]!==p?(ee=p("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=p,e[35]=ee):ee=e[35];let re;e[36]!==de||e[37]!==ee?(re=s.jsxs(ft,{onClick:de,children:[oe,ee]}),e[36]=de,e[37]=ee,e[38]=re):re=e[38];let pe;e[39]!==l||e[40]!==E||e[41]!==p?(pe=l&&s.jsxs(ft,{className:Ra,onClick:G=>{G.stopPropagation(),E()},children:[s.jsx(cn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=p,e[42]=pe):pe=e[42];let ke;e[43]!==ne||e[44]!==y||e[45]!==p?(ke=ne&&s.jsxs(ft,{className:zo,onClick:G=>{G.stopPropagation(),y()},children:[s.jsx(fs,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=p,e[46]=ke):ke=e[46];let Re;e[47]!==r||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==p?(Re=o.isSavedBlock===!0&&!o.isMultivariate&&s.jsxs(ft,{onClick:G=>{G.stopPropagation(),r()},children:[s.jsx(fs,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=r,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=p,e[51]=Re):Re=e[51];let xe;e[52]!==h?(xe=G=>{G.stopPropagation(),h()},e[52]=h,e[53]=xe):xe=e[53];let Ne;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(un,{className:"h-4 w-4"}),e[54]=Ne):Ne=e[54];let _e;e[55]!==p?(_e=p("sectionsEditor.sectionList.deleteMenuItem"),e[55]=p,e[56]=_e):_e=e[56];let z;e[57]!==xe||e[58]!==_e?(z=s.jsxs(ft,{className:"text-destructive focus:text-destructive",onClick:xe,children:[Ne,_e]}),e[57]=xe,e[58]=_e,e[59]=z):z=e[59];let le;e[60]!==re||e[61]!==pe||e[62]!==ke||e[63]!==Re||e[64]!==z?(le=s.jsxs(mn,{align:"end",className:"w-44",children:[re,pe,ke,Re,z]}),e[60]=re,e[61]=pe,e[62]=ke,e[63]=Re,e[64]=z,e[65]=le):le=e[65];let je;e[66]!==ve||e[67]!==le?(je=s.jsxs(fn,{children:[ve,le]}),e[66]=ve,e[67]=le,e[68]=je):je=e[68];let De;return e[69]!==A||e[70]!==$||e[71]!==m||e[72]!==v||e[73]!==ge||e[74]!==X||e[75]!==ue||e[76]!==O||e[77]!==Ke||e[78]!==je||e[79]!==B?(De=s.jsxs("div",{ref:v,style:ge,...A,...$,role:he,tabIndex:fe,onClick:m,onKeyDown:B,className:X,children:[ue,O,Ke,je]}),e[69]=A,e[70]=$,e[71]=m,e[72]=v,e[73]=ge,e[74]=X,e[75]=ue,e[76]=O,e[77]=Ke,e[78]=je,e[79]=B,e[80]=De):De=e[80],De}function Uo(g){return g.stopPropagation()}function Wo(g){return g.stopPropagation()}function qo(g){return g.stopPropagation()}function Jo(g){return g.stopPropagation()}function Yo(){return!1}function Qo(g){const e=He.c(104),{listKey:o,rawSections:d,sections:f,meta:S,selectedIndex:b,onSelect:m,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:r,onDetach:p,onAddSection:i,canAddSection:P}=g,l=P===void 0?!0:P,R=at();let A;e[0]!==f.length?(A=()=>Fs(f.length),e[0]=f.length,e[1]=A):A=e[1];const[$,v]=V.useState(A),[C,ie]=V.useState(null),[L,ce]=V.useState(o),[K,ge]=V.useState(f.length),F=V.useRef(!1);L!==o?(ce(o),ge(f.length),v(Fs(f.length))):K!==f.length&&(ge(f.length),v(Ie=>Ho(Ie,f.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:Qs},e[3]=he):he=e[3];const fe=Gs(Jt(Ws,ne),Jt(Us,he));let B;e[4]!==$?(B=$.map(Xo),e[4]=$,e[5]=B):B=e[5];const J=B;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=Ie=>{ie(String(Ie.active.id))},e[6]=X):X=e[6];const ue=X;let O;e[7]!==J||e[8]!==h?(O=Ie=>{ie(null);const{active:N,over:ae}=Ie;if(!ae||N.id===ae.id)return;const I=J.indexOf(String(N.id)),Qe=J.indexOf(String(ae.id));I===-1||Qe===-1||(v(Ze=>pn(Pt([...Ze],I,Qe))),F.current=!0,requestAnimationFrame(()=>{F.current=!1}),h?.(I,Qe))},e[7]=J,e[8]=h,e[9]=O):O=e[9];const Ke=O;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{ie(null)},e[10]=Z):Z=e[10];const Le=Z;let ve,de,oe,ee,re,pe,ke,Re,xe,Ne,_e,z,le,je,De;if(e[11]!==C||e[12]!==l||e[13]!==$||e[14]!==J||e[15]!==Ke||e[16]!==S||e[17]!==i||e[18]!==r||e[19]!==u||e[20]!==p||e[21]!==y||e[22]!==k||e[23]!==m||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==f||e[28]!==b||e[29]!==fe||e[30]!==R){je=Symbol.for("react.early_return_sentinel");e:{const Ie=N=>{F.current||m(N)};if(e[46]!==C||e[47]!==l||e[48]!==$||e[49]!==i||e[50]!==d||e[51]!==f||e[52]!==R){const N=C?$.find(ae=>ae.id===C):null;if(ee=N!=null?f[N.index]:null,oe=N!=null?d[N.index]:void 0,$.length===0){let ae;e[56]!==R?(ae=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=ae):ae=e[57];let I;e[58]!==ae?(I=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ae}),e[58]=ae,e[59]=I):I=e[59];const Qe=!l;let Ze;e[60]===Symbol.for("react.memo_cache_sentinel")?(Ze=s.jsx(ps,{size:14}),e[60]=Ze):Ze=e[60];let ot;e[61]!==R?(ot=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=ot):ot=e[62];let it;e[63]!==i||e[64]!==Qe||e[65]!==ot?(it=s.jsxs(qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Qe,onClick:i,children:[Ze,ot]}),e[63]=i,e[64]=Qe,e[65]=ot,e[66]=it):it=e[66];let rt;e[67]!==I||e[68]!==it?(rt=s.jsxs("div",{className:"space-y-2",children:[I,it]}),e[67]=I,e[68]=it,e[69]=rt):rt=e[69],je=rt;break e}le=Be(N&&"cursor-grabbing"),e[46]=C,e[47]=l,e[48]=$,e[49]=i,e[50]=d,e[51]=f,e[52]=R,e[53]=oe,e[54]=ee,e[55]=le}else oe=e[53],ee=e[54],le=e[55];de=Xs,Re=fe,xe=Zs,Ne=ue,_e=Ke,z=Le,ve=en,pe=J,ke=tn,De="space-y-1",re=$.map(N=>{const ae=f[N.index];return ae?s.jsx(Go,{sortableId:N.id,section:ae,raw:d[N.index],meta:S,selected:b===N.index,onSelect:()=>Ie(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>k(N.index),onToggleHidden:()=>D(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>r(N.index),onDetach:()=>p(N.index)},N.id):null})}e[11]=C,e[12]=l,e[13]=$,e[14]=J,e[15]=Ke,e[16]=S,e[17]=i,e[18]=r,e[19]=u,e[20]=p,e[21]=y,e[22]=k,e[23]=m,e[24]=D,e[25]=E,e[26]=d,e[27]=f,e[28]=b,e[29]=fe,e[30]=R,e[31]=ve,e[32]=de,e[33]=oe,e[34]=ee,e[35]=re,e[36]=pe,e[37]=ke,e[38]=Re,e[39]=xe,e[40]=Ne,e[41]=_e,e[42]=z,e[43]=le,e[44]=je,e[45]=De}else ve=e[31],de=e[32],oe=e[33],ee=e[34],re=e[35],pe=e[36],ke=e[37],Re=e[38],xe=e[39],Ne=e[40],_e=e[41],z=e[42],le=e[43],je=e[44],De=e[45];if(je!==Symbol.for("react.early_return_sentinel"))return je;let G;e[70]!==re||e[71]!==De?(G=s.jsx("div",{className:De,children:re}),e[70]=re,e[71]=De,e[72]=G):G=e[72];let Ae;e[73]!==ve||e[74]!==pe||e[75]!==ke||e[76]!==G?(Ae=s.jsx(ve,{items:pe,strategy:ke,children:G}),e[73]=ve,e[74]=pe,e[75]=ke,e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==oe||e[79]!==ee||e[80]!==S?(Oe=ee?s.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",hn(ee,!1)),children:s.jsx(gn,{section:ee,raw:oe,meta:S})}):null,e[78]=oe,e[79]=ee,e[80]=S,e[81]=Oe):Oe=e[81];let ze;e[82]!==Oe?(ze=s.jsx(sn,{dropAnimation:null,children:Oe}),e[82]=Oe,e[83]=ze):ze=e[83];let Fe;e[84]!==de||e[85]!==Re||e[86]!==xe||e[87]!==Ne||e[88]!==_e||e[89]!==z||e[90]!==Ae||e[91]!==ze?(Fe=s.jsxs(de,{sensors:Re,collisionDetection:xe,onDragStart:Ne,onDragEnd:_e,onDragCancel:z,children:[Ae,ze]}),e[84]=de,e[85]=Re,e[86]=xe,e[87]=Ne,e[88]=_e,e[89]=z,e[90]=Ae,e[91]=ze,e[92]=Fe):Fe=e[92];const Se=!l;let we;e[93]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(ps,{size:14}),e[93]=we):we=e[93];let be;e[94]!==R?(be=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=be):be=e[95];let te;e[96]!==i||e[97]!==Se||e[98]!==be?(te=s.jsxs(qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Se,onClick:i,children:[we,be]}),e[96]=i,e[97]=Se,e[98]=be,e[99]=te):te=e[99];let me;return e[100]!==le||e[101]!==Fe||e[102]!==te?(me=s.jsxs("div",{className:le,children:[Fe,te]}),e[100]=le,e[101]=Fe,e[102]=te,e[103]=me):me=e[103],me}function Xo(g){return g.id}function Bs(g){const e=He.c(57),{open:o,initialName:d,autoLabel:f,isPending:S,onSubmit:b,onOpenChange:m}=g,h=S===void 0?!1:S,u=at(),[y,k]=V.useState(d),[D,E]=V.useState(o);o!==D&&(E(o),o&&k(d));let r;e[0]!==h||e[1]!==m?(r=ue=>{!ue&&!h&&m(!1)},e[0]=h,e[1]=m,e[2]=r):r=e[2];const p=r;let i;e[3]!==h||e[4]!==y||e[5]!==b?(i=async ue=>{ue.preventDefault(),!h&&await b(y.trim())},e[3]=h,e[4]=y,e[5]=b,e[6]=i):i=e[6];const P=i;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=s.jsx(vo,{children:l}),e[9]=l,e[10]=R):R=e[10];let A;e[11]!==f||e[12]!==u?(A=u("sectionsEditor.variantRenameDialog.description",{fallback:f||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=f,e[12]=u,e[13]=A):A=e[13];let $;e[14]!==A?($=s.jsx(xo,{children:A}),e[14]=A,e[15]=$):$=e[15];let v;e[16]!==R||e[17]!==$?(v=s.jsxs(So,{children:[R,$]}),e[16]=R,e[17]=$,e[18]=v):v=e[18];let C;e[19]!==u?(C=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=C):C=e[20];let ie;e[21]!==C?(ie=s.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:C}),e[21]=C,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ue=>k(ue.target.value),e[23]=L):L=e[23];let ce;e[24]!==f||e[25]!==h||e[26]!==y?(ce=s.jsx(jo,{id:"variant-rename-name",value:y,onChange:L,placeholder:f,autoFocus:!0,disabled:h}),e[24]=f,e[25]=h,e[26]=y,e[27]=ce):ce=e[27];let K;e[28]!==ie||e[29]!==ce?(K=s.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=K):K=e[30];let ge;e[31]!==m?(ge=()=>m(!1),e[31]=m,e[32]=ge):ge=e[32];let F;e[33]!==u?(F=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=F):F=e[34];let ne;e[35]!==h||e[36]!==ge||e[37]!==F?(ne=s.jsx(qe,{type:"button",variant:"outline",onClick:ge,disabled:h,children:F}),e[35]=h,e[36]=ge,e[37]=F,e[38]=ne):ne=e[38];let he;e[39]!==h||e[40]!==u?(he=h?s.jsxs(s.Fragment,{children:[s.jsx(Hs,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=he):he=e[41];let fe;e[42]!==h||e[43]!==he?(fe=s.jsx(qe,{type:"submit",disabled:h,children:he}),e[42]=h,e[43]=he,e[44]=fe):fe=e[44];let B;e[45]!==ne||e[46]!==fe?(B=s.jsxs(bo,{children:[ne,fe]}),e[45]=ne,e[46]=fe,e[47]=B):B=e[47];let J;e[48]!==P||e[49]!==K||e[50]!==B||e[51]!==v?(J=s.jsx(yo,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:P,children:[v,K,B]})}),e[48]=P,e[49]=K,e[50]=B,e[51]=v,e[52]=J):J=e[52];let X;return e[53]!==p||e[54]!==o||e[55]!==J?(X=s.jsx(_o,{open:o,onOpenChange:p,children:J}),e[53]=p,e[54]=o,e[55]=J,e[56]=X):X=e[56],X}const Zo="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)]",vn="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.2)]";function xn(g){const e=He.c(5),{rule:o,matchers:d}=g,f=o?.__resolveType??"";let S;if(e[0]!==d||e[1]!==f){const u=d.find(y=>y.resolveType===f)?.iconName??Va(f);S=mo(u),e[0]=d,e[1]=f,e[2]=S}else S=e[2];const b=S;if(!b)return null;let m;return e[3]!==b?(m=s.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=m):m=e[4],m}function Os(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function ms(g){return g.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function ei(g){return g.map((e,o)=>({...e,index:o}))}function Sn(g){const e=He.c(17),{label:o,effectiveRule:d,matchers:f,canDelete:S,dragging:b,onRename:m,onDuplicate:h,onDelete:u}=g,y=at();let k;e[0]!==d||e[1]!==f?(k=s.jsx(xn,{rule:d,matchers:f}),e[0]=d,e[1]=f,e[2]=k):k=e[2];let D;e[3]!==o?(D=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==S||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==y?(E=!b&&s.jsxs(fn,{children:[s.jsx(dn,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:si,onPointerDown:ti,children:s.jsx(an,{size:14})})}),s.jsxs(mn,{align:"end",className:"w-36",children:[s.jsxs(ft,{onClick:p=>{p.stopPropagation(),m?.()},children:[s.jsx(Lo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),s.jsxs(ft,{onClick:p=>{p.stopPropagation(),h?.()},children:[s.jsx(ln,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),s.jsx(Vo,{}),s.jsxs(ft,{variant:"destructive",disabled:!S,onClick:p=>{p.stopPropagation(),u?.()},children:[s.jsx(un,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=S,e[6]=b,e[7]=o,e[8]=u,e[9]=h,e[10]=m,e[11]=y,e[12]=E):E=e[12];let r;return e[13]!==k||e[14]!==D||e[15]!==E?(r=s.jsxs(s.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=r):r=e[16],r}function ti(g){return g.stopPropagation()}function si(g){return g.stopPropagation()}function ni(g){const e=He.c(33),{entry:o,sortableId:d,isActive:f,canDelete:S,decofile:b,meta:m,matchers:h,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:ai},e[0]=d,e[1]=E):E=e[1];const{attributes:r,listeners:p,setNodeRef:i,transform:P,isDragging:l}=Js(E);let R;e[2]!==P?(R=Ys.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const A=l?0:void 0;let $;e[4]!==R||e[5]!==A?($={transform:R,opacity:A},e[4]=R,e[5]=A,e[6]=$):$=e[6];const v=$,C=m??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==C?(ie=Ct(o.variant.rule,b,C),e[7]=b,e[8]=o.variant.rule,e[9]=C,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=fe=>{fe.target===fe.currentTarget&&(fe.key==="Enter"||fe.key===" ")&&(fe.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const K=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=f?vn:Zo;let F;e[13]!==K||e[14]!==ge?(F=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",K,ge),e[13]=K,e[14]=ge,e[15]=F):F=e[15];let ne;e[16]!==S||e[17]!==L||e[18]!==o.variant.label||e[19]!==h||e[20]!==D||e[21]!==k||e[22]!==y?(ne=s.jsx(Sn,{label:o.variant.label,effectiveRule:L,matchers:h,canDelete:S,onRename:y,onDuplicate:k,onDelete:D}),e[16]=S,e[17]=L,e[18]=o.variant.label,e[19]=h,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==r||e[25]!==p||e[26]!==u||e[27]!==i||e[28]!==v||e[29]!==F||e[30]!==ne||e[31]!==ce?(he=s.jsx("div",{ref:i,style:v,...r,...p,onClick:u,onKeyDown:ce,className:F,children:ne}),e[24]=r,e[25]=p,e[26]=u,e[27]=i,e[28]=v,e[29]=F,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function ai(){return!1}function oi(g){const e=He.c(9),{variant:o,decofile:d,meta:f,matchers:S}=g,b=f??void 0;let m;e[0]!==d||e[1]!==b||e[2]!==o.rule?(m=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=m):m=e[3];const h=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vn),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==S||e[7]!==o.label?(y=s.jsx("div",{className:u,children:s.jsx(Sn,{label:o.label,effectiveRule:h,matchers:S,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=S,e[7]=o.label,e[8]=y):y=e[8],y}function ii(g){const e=He.c(91),{listKey:o,variants:d,activeIndex:f,decofile:S,meta:b,matchers:m,onSelect:h,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=g,r=at();let p;e[0]!==d?(p=()=>ms(d),e[0]=d,e[1]=p):p=e[1];const[i,P]=V.useState(p),[l,R]=V.useState(null),[A,$]=V.useState(o),[v,C]=V.useState(d.length);let ie;e[2]!==d?(ie=()=>Os(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=V.useState(ie),K=V.useRef(!1),ge=Os(d);A!==o?($(o),C(d.length),ce(ge),P(ms(d))):v!==d.length?(C(d.length),ce(ge),P(ms(d))):L!==ge&&(ce(ge),P(Fe=>d.map((Se,we)=>({id:Fe[we]?.id??crypto.randomUUID(),index:we,variant:Se}))));let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[4]=F):F=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:Qs},e[5]=ne):ne=e[5];const he=Gs(Jt(Ws,F),Jt(Us,ne));let fe;e[6]!==i?(fe=i.map(ri),e[6]=i,e[7]=fe):fe=e[7];const B=fe,J=d.length>1;let X;e[8]!==i?(X=Fe=>{const Se=String(Fe.active.id);R(i.find(we=>we.id===Se)??null)},e[8]=i,e[9]=X):X=e[9];const ue=X;let O;e[10]!==B||e[11]!==u?(O=Fe=>{R(null);const{active:Se,over:we}=Fe;if(!we||Se.id===we.id)return;const be=B.indexOf(String(Se.id)),te=B.indexOf(String(we.id));be===-1||te===-1||(P(me=>ei(Pt([...me],be,te))),K.current=!0,requestAnimationFrame(()=>{K.current=!1}),u(be,te))},e[10]=B,e[11]=u,e[12]=O):O=e[12];const Ke=O;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[13]=Z):Z=e[13];const Le=Z;let ve,de,oe,ee,re,pe,ke,Re,xe,Ne,_e,z,le;if(e[14]!==f||e[15]!==J||e[16]!==S||e[17]!==i||e[18]!==B||e[19]!==Ke||e[20]!==ue||e[21]!==m||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==h||e[28]!==he||e[29]!==r){const Fe=I=>{K.current||h(I)};_e="space-y-1 border-b p-2";let Se;e[43]!==r?(Se=r("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=r,e[44]=Se):Se=e[44];let we;e[45]!==Se?(we=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Se}),e[45]=Se,e[46]=we):we=e[46];let be;e[47]!==r?(be=r("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=r,e[48]=be):be=e[48];let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(ps,{size:14}),e[49]=te):te=e[49];let me;e[50]!==E||e[51]!==be?(me=s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":be,className:"size-6",onClick:E,children:te})}),e[50]=E,e[51]=be,e[52]=me):me=e[52];let Ie;e[53]!==r?(Ie=r("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=r,e[54]=Ie):Ie=e[54];let N;e[55]!==Ie?(N=s.jsx(bt,{children:Ie}),e[55]=Ie,e[56]=N):N=e[56];let ae;e[57]!==me||e[58]!==N?(ae=s.jsxs(xt,{children:[me,N]}),e[57]=me,e[58]=N,e[59]=ae):ae=e[59],e[60]!==we||e[61]!==ae?(z=s.jsxs("div",{className:"flex items-center justify-between",children:[we,ae]}),e[60]=we,e[61]=ae,e[62]=z):z=e[62],de=Xs,pe=he,ke=Zs,Re=ue,xe=Ke,Ne=Le,ve=en,ee=B,re=tn,le="space-y-0.5",oe=i.map(I=>s.jsx(ni,{sortableId:I.id,entry:I,isActive:I.index===f,canDelete:J,decofile:S,meta:b,matchers:m,onSelect:()=>Fe(I.index),onRename:()=>y(I.index),onDuplicate:()=>k(I.index),onDelete:()=>D(I.index)},I.id)),e[14]=f,e[15]=J,e[16]=S,e[17]=i,e[18]=B,e[19]=Ke,e[20]=ue,e[21]=m,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=h,e[28]=he,e[29]=r,e[30]=ve,e[31]=de,e[32]=oe,e[33]=ee,e[34]=re,e[35]=pe,e[36]=ke,e[37]=Re,e[38]=xe,e[39]=Ne,e[40]=_e,e[41]=z,e[42]=le}else ve=e[30],de=e[31],oe=e[32],ee=e[33],re=e[34],pe=e[35],ke=e[36],Re=e[37],xe=e[38],Ne=e[39],_e=e[40],z=e[41],le=e[42];let je;e[63]!==oe||e[64]!==le?(je=s.jsx("div",{className:le,children:oe}),e[63]=oe,e[64]=le,e[65]=je):je=e[65];let De;e[66]!==ve||e[67]!==ee||e[68]!==re||e[69]!==je?(De=s.jsx(ve,{items:ee,strategy:re,children:je}),e[66]=ve,e[67]=ee,e[68]=re,e[69]=je,e[70]=De):De=e[70];let G;e[71]!==l||e[72]!==S||e[73]!==m||e[74]!==b?(G=l?s.jsx(oi,{variant:l.variant,decofile:S,meta:b,matchers:m}):null,e[71]=l,e[72]=S,e[73]=m,e[74]=b,e[75]=G):G=e[75];let Ae;e[76]!==G?(Ae=s.jsx(sn,{dropAnimation:null,children:G}),e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==de||e[79]!==pe||e[80]!==ke||e[81]!==Re||e[82]!==xe||e[83]!==Ne||e[84]!==De||e[85]!==Ae?(Oe=s.jsxs(de,{sensors:pe,collisionDetection:ke,onDragStart:Re,onDragEnd:xe,onDragCancel:Ne,children:[De,Ae]}),e[78]=de,e[79]=pe,e[80]=ke,e[81]=Re,e[82]=xe,e[83]=Ne,e[84]=De,e[85]=Ae,e[86]=Oe):Oe=e[86];let ze;return e[87]!==_e||e[88]!==z||e[89]!==Oe?(ze=s.jsxs("div",{className:_e,children:[z,Oe]}),e[87]=_e,e[88]=z,e[89]=Oe,e[90]=ze):ze=e[90],ze}function ri(g){return g.id}function li(g){const e=He.c(16),{schema:o,value:d,onChange:f,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}=g,u=at();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=V.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&s.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[s.jsx("button",{type:"button",onClick:()=>D([]),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:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:s.jsx(on,{className:"size-3.5"})}),k.map((i,P)=>{const l=P===k.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&s.jsx(rn,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>D(k.slice(0,P+1)),title:i,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:i})]},`${i}-${P}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let r;e[4]!==k||e[5]!==b||e[6]!==S||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==o||e[11]!==d?(r=s.jsx(nn,{schema:o,value:d,onChange:f,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:S,decofile:b,onSaveReferencedBlock:m,sandbox:h}),e[4]=k,e[5]=b,e[6]=S,e[7]=f,e[8]=m,e[9]=h,e[10]=o,e[11]=d,e[12]=r):r=e[12];let p;return e[13]!==E||e[14]!==r?(p=s.jsxs("div",{className:"space-y-2",children:[E,r]}),e[13]=E,e[14]=r,e[15]=p):p=e[15],p}function Is(g){const e=He.c(21),{activeSchema:o,formValue:d,formResetKey:f,onFormChange:S,onBreadcrumbChange:b,breadcrumbPath:m,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p}=g;let i;e[0]!==m?(i=m===void 0?[]:m,e[0]=m,e[1]=i):i=e[1];const P=i;let l;e[2]!==o||e[3]!==P||e[4]!==E||e[5]!==f||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==S||e[10]!==r||e[11]!==p||e[12]!==y||e[13]!==k?(l=o&&d?y?s.jsx(No,{schema:o,resolveType:y,value:d,formResetKey:f,onChange:S,onBreadcrumbChange:b,siteDefaultSeo:k}):s.jsx(nn,{schema:o,value:d,onChange:S,basePath:"",breadcrumbPath:P,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p},f):null,e[2]=o,e[3]=P,e[4]=E,e[5]=f,e[6]=d,e[7]=D,e[8]=b,e[9]=S,e[10]=r,e[11]=p,e[12]=y,e[13]=k,e[14]=l):l=e[14];const R=l;let A;e[15]!==h||e[16]!==R?(A=R??s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[15]=h,e[16]=R,e[17]=A):A=e[17];let $;return e[18]!==u||e[19]!==A?($=s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,A]})}),e[18]=u,e[19]=A,e[20]=$):$=e[20],$}const ci="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 ui(g,e){return Na(g,e,nt)}function di(g){const e=He.c(19),{pageKey:o,initialName:d,initialPath:f,onFieldChange:S}=g,b=at(),[m,h]=V.useState(d),[u,y]=V.useState(f),[k,D]=V.useState(o);k!==o&&(D(o),h(d),y(f));let E;e[0]!==S?(E=A=>{h(A.target.value),S("name",A.target.value)},e[0]=S,e[1]=E):E=e[1];let r;e[2]!==b?(r=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=r):r=e[3];let p;e[4]!==m||e[5]!==E||e[6]!==r?(p=s.jsx("input",{type:"text",value:m,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:r}),e[4]=m,e[5]=E,e[6]=r,e[7]=p):p=e[7];let i;e[8]!==S?(i=A=>{y(A.target.value),S("path",A.target.value)},e[8]=S,e[9]=i):i=e[9];let P;e[10]!==b?(P=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==i||e[14]!==P?(l=s.jsx("input",{type:"text",value:u,onChange:i,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:P}),e[12]=u,e[13]=i,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==p||e[17]!==l?(R=s.jsxs("div",{className:"space-y-1",children:[p,l]}),e[16]=p,e[17]=l,e[18]=R):R=e[18],R}function $s(g){const e=He.c(13),{onClick:o}=g,d=at();let f;e[0]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=f):f=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(cn,{size:14}),e[2]=S):S=e[2];let b;e[3]!==o||e[4]!==f?(b=s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":f,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:S})}),e[3]=o,e[4]=f,e[5]=b):b=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let h;e[8]!==m?(h=s.jsx(bt,{side:"bottom",children:m}),e[8]=m,e[9]=h):h=e[9];let u;return e[10]!==b||e[11]!==h?(u=s.jsxs(xt,{children:[b,h]}),e[10]=b,e[11]=h,e[12]=u):u=e[12],u}function zs(g){const e=He.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P}=g;let l;e[0]!==f||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==S||e[5]!==m||e[6]!==h?(l=s.jsx(Da,{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:S,globals:b,onSelect:m,onSelectGlobal:h}),e[0]=f,e[1]=d,e[2]=o,e[3]=b,e[4]=S,e[5]=m,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==p||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==r||e[13]!==k||e[14]!==i||e[15]!==P||e[16]!==u?(R=u&&y&&s.jsx("div",{className:E,children:s.jsx(li,{schema:u,value:y,onChange:k,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P},D)}),e[8]=p,e[9]=D,e[10]=y,e[11]=E,e[12]=r,e[13]=k,e[14]=i,e[15]=P,e[16]=u,e[17]=R):R=e[17];let A;return e[18]!==l||e[19]!==R?(A=s.jsxs(s.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=A):A=e[20],A}function lc({orgSlug:g,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:f,currentPath:S,activePageBlockKey:b=null,activeGlobalBlockKey:m=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const r=at(),p=d?{orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f}:null,{data:i,isLoading:P}=Ta(p),{data:l,isLoading:R}=Pa(p),A=Ca(),$=A?.entity?.id===e?A.entity.metadata?.siteSlug??null:null,[v,C]=V.useState(null),[ie,L]=V.useState(null),[ce,K]=V.useState(null),[ge,F]=V.useState(0),[ne,he]=V.useState(void 0),[fe,B]=V.useState(null),[J,X]=V.useState(null),[ue,O]=V.useState([]),[Ke,Z]=V.useState(0),[Le,ve]=V.useState(null),[de,oe]=V.useState(null),[ee,re]=V.useState(null),[pe,ke]=V.useState(!0),[Re,xe]=V.useState(!1),[Ne,_e]=V.useState(!1),[z,le]=V.useState(y),[je,De]=V.useState(y);y&&!je&&(De(!0),le(!0),C(null),L(null),K(null),O([])),!y&&je&&De(!1);const[G,Ae]=V.useState(null),[Oe,ze]=V.useState(void 0),[Fe,Se]=V.useState([]),[we,be]=V.useState(0),[te,me]=V.useState(0),[Ie,N]=V.useState(null),[ae,I]=V.useState(null),[Qe,Ze]=V.useState(null),ot=Sa(),it=`${g}/${e}/${o}`,rt=Aa({orgSlug:g,virtualMcpId:e,branch:o}),[bn,yn]=V.useState(S),[_n,jn]=V.useState(b),[En,kn]=V.useState(m);(bn!==S||_n!==b||En!==m)&&(queueMicrotask(()=>rt.flush()),yn(S),jn(b),kn(m),C(null),L(null),K(null),F(0),B(null),X(null),me(0),N(null),I(null),O([]),Z(t=>t+1),le(!1),Ae(null),ze(void 0),Se([]),be(t=>t+1));const Ve=Ma({orgSlug:g,virtualMcpId:e,branch:o}),At=eo((t,n)=>{Ve.mutate({blockKey:t,data:n},{onSuccess:()=>u?.(),onError:a=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Yt=Ka({orgSlug:g,virtualMcpId:e,branch:o}),[wt,Mt]=V.useState(!1),Qt=V.useRef(null),yt=V.useRef(null),_t=V.useRef(null),Xt=V.useRef({}),Je=V.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Hs,{size:20,className:"animate-spin text-muted-foreground"})});if(!i||!l)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Rn=La(i),Te=!!m,Ge=Te?null:Fa(Rn,S,b),w=Te?m:Ge?.key??null,Zt=Te&&m?i[m]:void 0,gs=Te&&m&&Zt?Ba(m,Zt):Te&&m?m:"",Kt=!Te&&w&&i[w]?i[w]:null,es=z&&i&&l&&w&&Ge?Ls(i,{kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},l):null,wn=z?Kt?.seo:void 0,ts=Oe!==void 0?Oe:wn,Vn=z?Do(ts):void 0,Nn=es?.seoTypeOptions??[],Dn=z&&l?To(l):"",hs=G??Vn??{},ss=z&&es?Po(hs,es):null,Tn=z&&ss&&Co(ts)?Ht(ss,l):null,Pn=z?Ao(i,l)?.seoData:void 0,$e=Te?[{label:"Default",sections:[{__resolveType:m}]}]:ui(Kt?.sections,i??{}),Lt=$e.length>1,Ce=Math.min(ge,$e.length-1),lt=$e[Ce],W=lt?.sections??[],Me=Gt(W,i),vs=!Te&&Oa(Kt?.sections);if(Te&&m&&Qe!==m){Ze(m);const t=W[0],n=Me[0];if(t&&n){C(0),me(0),O([]);const a=ht(t,n,i);a&&(L(a.data),K(a.resolveType),I(null),N(null))}}!Te&&Qe!==null&&Ze(null),Je.current={rawSections:W,parsedSections:Me,decofile:i??{},activePageKey:w,pageVariants:$e,variantIndex:Ce,sectionVariantIndex:te,selectedSectionIndex:v};const Cn=()=>({multivariate:vs,index:Ce,variants:$e.map(t=>({rule:t.rule}))}),xs=(t,n)=>{if(!E)return;if(!w||!vs||t.length<=1){E(null);return}const a=Ms(w,{multivariate:!0,index:n,variants:t},i,l);E(a.length>0?a:null)},jt=(t,n,a)=>{if(!E)return;if(!w){E(null);return}const c=Cn(),x=Ms(w,c,i,l);if(!t||n<0){E(x.length>0?x:null);return}const j=oo({pageKey:w,page:c,sectionIndex:n,sectionLazy:Me[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:l}),_=[...x,...j];E(_.length>0?_:null)},ct=(t,n,a,c=v??-1,x=!1)=>{const j=Xe(t,n);if(!j){L(null),K(null),I(null),N(null),x&&jt(null,c,a);return}const T=Ts(j,nt)[a];if(!T){L(null),K(null),I(null),N(null),x&&jt(null,c,a);return}const se=Ua(T.value,i);L(se?.data??null),K(se?.resolveType??null);const{resolveType:M,formValue:H}=Nt(T.rule,i,l??void 0);I(M),N(H),x&&jt(j,c,a)};if(h!==void 0&&h!==ne&&(he(h??null),typeof h=="number")){const t=W[h],n=Me[h];if(t&&n)if(C(h),me(0),O([]),Z(a=>a+1),n.isMultivariate)ct(t,n,0,h);else{const a=ht(t,n,i);a?(L(a.data),K(a.resolveType)):(L(null),K(null)),I(null),N(null)}}const Ft={orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f??void 0,siteSlug:$},ns=ce&&l?Ht(ce,l):null,Ue=(t,n)=>{if(!w)return;const a=Tt(i,w,t,Ce,$e);Ve.mutate({blockKey:w,data:a},{onSuccess:()=>n?.onSuccess?.()??u?.(),onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},Et=()=>{C(null),L(null),K(null),me(0),N(null),I(null),O([]),Z(t=>t+1)},An=(t,n)=>{Qt.current&&clearTimeout(Qt.current);const a=Je.current.sectionVariantIndex;Qt.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current,M=c[n];if(!M)return;const H=x[n];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ve.mutate({blockKey:q,data:t},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!_)return;const U={...j[_]},Ee=[...c];if(H.isMultivariate){const q=Xe(M,H);if(!q||!_)return;const Y=ro(q,a,t);Ee[n]=vt(M,H,Y)}else if(H.isHidden){const q=qs(M.__resolveType),Y=q?{...M.section}:{...M},Pe=Array.isArray(Y.variants)?[...Y.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Y.variants=Pe,q?Ee[n]={...M,section:Y}:Ee[n]=Y}else H.isLazy?Ee[n]={...M,section:t}:Ee[n]=t;if(T.length>1){const q=U.sections,Y=[...q?.variants??[]];Y[se]&&(Y[se]={...Y[se],value:Ee}),U.sections={...q,variants:Y}}else U.sections=Ee;Ve.mutate({blockKey:_,data:U},{onSuccess:()=>u?.(),onError:q=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},ds)},Mn=t=>{C(t),me(0),O([]),Z(x=>x+1);const n=W[t],a=Me[t];if(!n||!a)return;if(a.isMultivariate){ct(n,a,0,t);return}const c=ht(n,a,i);if(!c){L(null),K(null),I(null),N(null),jt(null,t,0);return}L(c.data),K(c.resolveType),I(null),N(null),jt(null,t,0)},Ss=t=>{const n=t;L(n),v!==null&&An(n,v)},as=t=>{if(!w||!i||!l||!Ge)return;const n={kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},a=Ls(i,n,l);a&&rt.save(w,()=>{const c=ot.getQueryData(ba.decofile(it))?.[w];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const x={...c,...Xt.current};return Xt.current={},t?.raw!==void 0?{...x,seo:t.raw}:t?.inner!==void 0?Ko(n,a,x,t.inner):x})},Kn=(t,n)=>{w&&(Xt.current[t]=n,as())},Ln=(t,n)=>{if(!w)return;const a=Pt([...W],t,n);v!==null&&(v===t?C(n):t<v&&n>=v?C(v-1):t>v&&n<=v&&C(v+1)),Ue(a)},Fn=t=>{if(!w)return;const n=W.filter((a,c)=>c!==t);v===t?Et():v!==null&&v>t&&C(v-1),Ue(n)},Bn=t=>{if(!w)return;const n=W[t];if(!n)return;const a=[...W];a.splice(t+1,0,ao(n)),v!==null&&v>t&&C(v+1),Ue(a)},On=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a||a.isMultivariate)return;const c=a.isHidden?so(n):no(n);if(!c)return;const x=[...W];x[t]=c,v===t&&Et(),Ue(x)},In=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a||a.isMultivariate)return;const c=to(n);if(!c)return;const x=[...W];x[t]=c,v===t&&Et(),Ue(x)},$n=t=>{if(!w)return;const n=W[t],a=Me[t];if(!n||!a?.isSavedBlock)return;const c=ht(n,a,i);if(!c?.data)return;const{name:x,...j}=c.data,_=[...W];a.isLazy?_[t]={...n,section:j}:_[t]=j,v===t&&Et(),Ue(_)},zn=t=>{if(!w)return;const n=[...W,{__resolveType:t.resolveType}],a=n.length-1;Ue(n,{onSuccess:()=>{xe(!1),C(a),me(0),O([]),Z(_=>_+1);const c=n[a],x=Gt(n,i)[a];if(!c||!x)return;if(x.isMultivariate){ct(c,x,0);return}const j=ht(c,x,i);if(!j){L(null),K(null),I(null),N(null);return}L(j.data),K(j.resolveType),I(null),N(null)}})},Hn=t=>{if(v===null)return;const n=W[v],a=Me[v];!n||!a?.isMultivariate||(me(t),O([]),Z(c=>c+1),ct(n,a,t,v,!0))},Gn=t=>{if(v===null||!w)return;const n=W[v],a=Me[v];if(!n||!a?.isMultivariate)return;const c=Xe(n,a);if(!c)return;const x=Xa(c,t);if(!x){Q.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...W];j[v]=vt(n,a,x);const _=x.variants;let T=te;t===te?T=Math.min(t,_.length-1):t<te&&(T=te-1),me(T),O([]),Z(se=>se+1),ct(j[v],a,T),Ue(j)},Un=t=>{if(v===null||!w)return;const n=W[v],a=Me[v];if(!n||!a?.isMultivariate)return;const c=Xe(n,a);if(!c)return;const x=Za(c,t),j=[...W];j[v]=vt(n,a,x);const _=t+1;me(_),O([]),Z(T=>T+1),ct(j[v],a,_),Ue(j)},Wn=(t,n)=>{if(v===null||!w||t===n)return;const a=W[v],c=Me[v];if(!a||!c?.isMultivariate)return;const x=Xe(a,c);if(!x)return;const j=Ya(x,t,n),_=[...W];_[v]=vt(a,c,j);let T=te;te===t?T=n:t<te&&n>=te?T=te-1:t>te&&n<=te&&(T=te+1),me(T),ct(_[v],c,T),Ue(_)},os=t=>{const n=t??v;if(n===null||!w)return;const a=W[n],c=Me[n];if(!a||!c)return;const x=Wa(a,c);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...W];j[n]=x.section;const _=Gt(j,i)[n];if(!_?.isMultivariate){Q.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(n),me(x.newVariantIndex),O([]),Z(T=>T+1),ct(x.section,_,x.newVariantIndex,n),Ue(j)},qn=()=>{if(v===null||!w)return;const t=W[v],n=Me[v];if(!t||!n?.isMultivariate)return;const a=Xe(t,n);if(!a)return;const c=Qa(t,n,a);if(!c){Q.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const x=[...W];x[v]=c;const j=Gt(x,i)[v];if(!j)return;me(0),I(null),N(null),O([]),Z(T=>T+1);const _=ht(c,j,i);_?(L(_.data),K(_.resolveType)):(L(null),K(null)),jt(null,v,0),Ue(x)},Jn=async t=>{if(Le===null||!w)return;const n=us(t,i);if(n){Q.error(n);return}const a=W[Le],c=Me[Le];if(!a||!c)return;const x=ht(a,c,i);if(!x){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...x.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:j});const _=[...W];_[Le]={__resolveType:t},await Ve.mutateAsync({blockKey:w,data:Tt(i,w,_,Ce,$e)}),v===Le&&Et(),ve(null),Q.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},bs=lt?.rule;if(Lt&&v===null&&J===null&&bs){const{resolveType:t,formValue:n}=Nt(bs,i??{},l??void 0);X(t),B(n)}const Bt=l?Ia(l):[],ys=l&&i?$a(l,i):[],Yn=!Te&&!!(f&&l&&i),Qn=J&&l?Ht(J,l):null,Ot=()=>{yt.current&&(clearTimeout(yt.current),yt.current=null),_t.current&&(clearTimeout(_t.current),_t.current=null)},Vt=async(t,n)=>{if(!(io(n,t,l)>0))try{await Yt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},_s=t=>{yt.current&&clearTimeout(yt.current),yt.current=setTimeout(()=>{const{activePageKey:n,decofile:a,variantIndex:c}=Je.current;if(!n)return;const x={...a[n]},j={...x.sections},_=[...j.variants??[]],T=_[c],se=T?.rule;if(kt(se,a,l)){const M=se?.__resolveType??"",H=a[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...q}=t;Ve.mutate({blockKey:M,data:Rt(Ee??"",q,U)},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}T&&(_[c]={...T,rule:t}),x.sections={...j,variants:_},Ve.mutate({blockKey:n,data:x},{onSuccess:()=>u?.(),onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},ds)},Xn=t=>{X(t);const n=t?{__resolveType:t}:{__resolveType:Ks};B({}),_s(n)},Zn=t=>{const n=t;B(n);const a=J?{__resolveType:J,...n}:{...n};_s(a)},ea=async t=>{Ot();const{activePageKey:n,decofile:a,variantIndex:c}=Je.current;if(!n)return;const x=a[n],j=x?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],se=T[c];if(!se)return;const M=Dt(se.rule,a,l),H=Wt(t);T[c]={...se,rule:H};const U={...a,[n]:{...x,sections:{..._,variants:T}}},{resolveType:Ee,formValue:q}=Nt(H,U,l??void 0);X(Ee),B(q);try{await Ve.mutateAsync({blockKey:n,data:U[n]}),M&&M!==t&&await Vt(M,U),u?.()}catch(Y){Q.error(Y instanceof Error?Y.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{_t.current&&clearTimeout(_t.current);const{selectedSectionIndex:n,sectionVariantIndex:a}=Je.current;n!==null&&(_t.current=setTimeout(()=>{const{rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(!_)return;const M=c[n],H=x[n];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const q=(U.variants??[])[a]?.rule;if(kt(q,j,l)){const ye=q?.__resolveType??"",We=j[ye],tt=typeof We?.name=="string"?We.name:ye,{__resolveType:dt,...st}=t;Ve.mutate({blockKey:ye,data:Rt(dt??"",st,tt)},{onSuccess:()=>u?.(),onError:mt=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:mt.message}))});return}const Y=Ps(U,a,t),Pe=[...c];Pe[n]=vt(M,H,Y);const Ye=Tt(j,_,Pe,se,T);Ve.mutate({blockKey:_,data:Ye},{onSuccess:()=>u?.(),onError:ye=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ye.message}))})},ds))},ta=t=>{I(t),N({}),js(t?{__resolveType:t}:{__resolveType:Ks})},sa=t=>{const n=t;N(n);const a=ae?{__resolveType:ae,...n}:{...n};js(a)},na=async t=>{Ot();const{selectedSectionIndex:n,sectionVariantIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(n===null||!_)return;const M=c[n],H=x[n];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const Ee=U.variants??[],q=Dt(Ee[a]?.rule,j,l),Y=Wt(t),Pe=Ps(U,a,Y),Ye=[...c];Ye[n]=vt(M,H,Pe);const ye=Tt(j,_,Ye,se,T),We={...j,[_]:ye},{resolveType:tt,formValue:dt}=Nt(Y,We,l??void 0);I(tt),N(dt);try{await Ve.mutateAsync({blockKey:_,data:ye}),q&&q!==t&&await Vt(q,We),u?.()}catch(st){Q.error(st instanceof Error?st.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Te&&!Ge)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:S})});if(Te&&!Zt)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ut=v!==null?Me[v]??null:null,Es=v!==null?W[v]:null,ks=Es&&ut?.isMultivariate?Xe(Es,ut):null,pt=ks?Ts(ks,nt):[],is=Math.min(te,Math.max(pt.length-1,0)),It=pt[is]??null,gt=ut?.isMultivariate===!0,Rs=v!==null&&ut!==null,$t=Rs&&(gt||!!(ns&&ie)),aa=$t&&!Te&&ut?.isSavedBlock===!0,et=Te||aa,oa=Te?gs:ut?.label??"",ia=ae&&l?Ht(ae,l):null,rs=$t&&(!Te||ue.length>0)?Te?[gs,...ue]:[Ge.name,ut.label,...gt&&It?[It.label]:[],...ue]:[],ra=z&&Ge?[Ge.name,"SEO",...Fe]:[],zt=z?ra:et?rs.length>0?rs:[oa]:rs,ws=()=>{if(!w)return;const t=i[w],n=qa(t.sections,W);if(!n)return;const a=Ja(n);Ve.mutate({blockKey:w,data:{...t,sections:n}},{onSuccess:()=>{F(a),C(null),L(null),K(null),O([]),B(null),X(null)},onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},ls=(t,n,a)=>{if(!w)return;const c=i[w],x=c.sections;if(!x||typeof x!="object"||Array.isArray(x))return;const j=x;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const T=lo(j,_),se={...i,[w]:{...c,sections:T}};Ve.mutate({blockKey:w,data:se[w]},{onSuccess:()=>{n?.(),a&&Vt(a,se)},onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},la=t=>{oe(null),F(t),C(null),L(null),K(null),O([]);const n=$e[t]?.rule,{resolveType:a,formValue:c}=Nt(n,i??{},l??void 0);X(a),B(c),xs($e.map(x=>({rule:x.rule})),t)},ca=(t,n)=>{if(t===n)return;let a=Ce;Ce===t?a=n:t<Ce&&n>=Ce?a=Ce-1:t>Ce&&n<=Ce&&(a=Ce+1),F(a);const c=Pt($e.map(x=>({rule:x.rule})),t,n);xs(c,a),ls(x=>Pt(x,t,n))},ua=t=>{const n=$e[t]?.rule,a=Dt(n,i??{},l??void 0);ls(c=>c.length<=1?null:(c.splice(t,1),c),()=>{$e.length-1===1?F(0):t<Ce?F(Ce-1):t===Ce&&F(Math.max(0,t-1)),C(null),L(null),K(null),O([]),B(null),X(null)},a)},da=t=>{ls(n=>co(n,t),()=>{F(t+1),C(null),L(null),K(null),O([]),B(null),X(null)})},ma=async(t,n)=>{Ot();const a=Je.current.activePageKey,c=Je.current.decofile;if(!a)return;const x=c[a],j=x.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],se=T[t];if(!se?.rule||typeof se.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=se.rule,H=n.trim();Mt(!0);try{if(!H){if(!kt(M,c,l)){oe(null);return}const Ye=M.__resolveType??"";T[t]={...se,rule:Cs(M,c,l)};const ye={...c,[a]:{...x,sections:{..._,variants:T}}};await Ve.mutateAsync({blockKey:a,data:ye[a]}),await Vt(Ye,ye),oe(null),u?.();return}const U=As(M,c,l);if(!U){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ve.mutateAsync({blockKey:U.blockKey,data:Rt(U.resolveType,U.data,H)}),oe(null),u?.();return}const Ee=cs(H),q=us(Ee,c);if(q){Q.error(q);return}const Y=Rt(U.resolveType,U.data,H);let Pe=null;try{await Ve.mutateAsync({blockKey:Ee,data:Y}),Pe=Ee,T[t]={...se,rule:Wt(Ee)},await Ve.mutateAsync({blockKey:a,data:{...x,sections:{..._,variants:T}}}),Pe=null}catch(Ye){throw Pe&&await Yt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ye}oe(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(U){Q.error(U instanceof Error?U.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Mt(!1)}},fa=async(t,n)=>{Ot();const{selectedSectionIndex:a,rawSections:c,parsedSections:x,decofile:j,activePageKey:_,pageVariants:T,variantIndex:se}=Je.current;if(a===null||!_)return;const M=c[a],H=x[a];if(!M||!H?.isMultivariate)return;const U=Xe(M,H);if(!U)return;const Ee=U.variants??[],q=Ee[t];if(!q?.rule||typeof q.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=q.rule,Pe=n.trim();Mt(!0);const Ye=async ye=>{const We={...U,variants:ye},tt=[...c];tt[a]=vt(M,H,We);const dt=Tt(j,_,tt,se,T);return await Ve.mutateAsync({blockKey:_,data:dt}),{...j,[_]:dt}};try{if(!Pe){if(!kt(Y,j,l)){re(null);return}const mt=Y.__resolveType??"",Ds=[...Ee];Ds[t]={...q,rule:Cs(Y,j,l)};const xa=await Ye(Ds);await Vt(mt,xa),re(null),u?.();return}const ye=As(Y,j,l);if(!ye){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ye.blockKey){await Ve.mutateAsync({blockKey:ye.blockKey,data:Rt(ye.resolveType,ye.data,Pe)}),re(null),u?.();return}const We=cs(Pe),tt=us(We,j);if(tt){Q.error(tt);return}const dt=Rt(ye.resolveType,ye.data,Pe);let st=null;try{await Ve.mutateAsync({blockKey:We,data:dt}),st=We;const mt=[...Ee];mt[t]={...q,rule:Wt(We)},await Ye(mt),st=null}catch(mt){throw st&&await Yt.mutateAsync({blockKey:st}).catch(()=>{}),mt}re(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ye){Q.error(ye instanceof Error?ye.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Mt(!1)}},Vs=()=>{Et()},pa=t=>{Ae(t),as({inner:t})},ga=t=>{ze(t),as({raw:t})},ha=()=>{Ae(null),Se([])},va=()=>be(t=>t+1),Ns=t=>{if(z){if(t===0){rt.flush(),le(!1),Ae(null),ze(void 0),Se([]),be(a=>a+1),k?.();return}if(t===1){Se([]),be(a=>a+1);return}Se(Fe.slice(0,t-1)),be(a=>a+1);return}if(Te){O(ue.slice(0,t)),Z(a=>a+1);return}if(t===0){Vs();return}if(t===1){O([]),Z(a=>a+1);return}if(gt&&t===2){O([]),Z(a=>a+1);return}const n=gt?2:1;O(ue.slice(0,t-n))};return s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[s.jsx("div",{className:"shrink-0",children:et||$t||z?s.jsxs("div",{className:Be("border-b px-3 py-2.5",et&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[zt.length>1&&s.jsx("button",{type:"button",onClick:()=>Ns(zt.length-2),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:Be("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",et?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(on,{className:"size-4"})}),!Te&&Lt&<&&s.jsxs("button",{type:"button",onClick:Vs,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:lt.label}),className:Be("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",ci),children:[s.jsx(xn,{rule:Ct(lt.rule,i??{},l??void 0),matchers:Bt}),s.jsx("span",{className:"max-w-[160px] truncate",children:lt.label})]}),s.jsx("nav",{"aria-label":r("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:zt.map((t,n)=>{const a=n===zt.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n>0&&s.jsx(rn,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ns(n),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?et?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":et?"text-foreground/80":"text-muted-foreground",et?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${n}`)})}),et&&s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(ho,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(bt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rs&&!gt&&!ut?.isHidden&&w&&s.jsx($s,{onClick:()=>os()})]}),et&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(di,{pageKey:w,initialName:Ge.name,initialPath:Ge.path,onFieldChange:Kn})}),s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>le(!0),children:s.jsx(fo,{size:14})})}),s.jsx(bt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(xt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(qe,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&w?D(w):_e(!0),children:s.jsx(po,{size:14})})}),s.jsx(bt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx($s,{onClick:ws})]})}),z?s.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Kt&&w?s.jsx(Mo,{rawSeo:ts,innerSeo:hs,defaultResolveType:Dn,seoSchema:Tn,activeResolveType:ss,seoTypeOptions:Nn,formResetKey:we,siteDefaultSeo:Pn,onBreadcrumbChange:Se,onPersistRaw:ga,onInnerChange:pa,onClearForm:ha,onBumpFormKey:va}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):$t?s.jsxs(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[gt&&pt.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(za,{listKey:`${w??""}:${v??""}`,variants:pt.map((t,n)=>({index:n,label:t.label})),selectedIndex:is,onSelect:Hn,onRename:re,onDuplicate:Un,onDelete:Gn,onRemoveAll:qn,onReorder:Wn,onAdd:()=>os()}),gt&&s.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),s.jsx(zs,{currentRt:ae??"",currentLabel:Ut(It?.rule,i??{},nt,l??void 0),currentGlobalKey:Dt(It?.rule,i??{},l??void 0)??void 0,matchers:Bt,globals:ys,onSelect:ta,onSelectGlobal:na,schema:ia,formValue:Ie,onChange:sa,formKey:`${v??"none"}:${is}:${ae??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})]})]}),s.jsx(Is,{activeSchema:ns,formValue:ie,formResetKey:Ke,onFormChange:Ss,onBreadcrumbChange:O,breadcrumbPath:ue,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})]}):Te?s.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(Is,{activeSchema:ns,formValue:ie,formResetKey:Ke,onFormChange:Ss,onBreadcrumbChange:O,breadcrumbPath:ue,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})}):s.jsxs(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Lt&&w&&s.jsx(ii,{listKey:w,variants:$e,activeIndex:Ce,decofile:i??{},meta:l,matchers:Bt,onSelect:la,onReorder:ca,onRename:oe,onDuplicate:da,onDelete:ua,onAdd:ws}),Lt&&J!==null&&s.jsxs("div",{className:Be("px-3 border-b",pe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),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":pe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),pe?s.jsx(go,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(uo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),pe&&s.jsx("div",{className:Be("space-y-3",wt&&"pointer-events-none opacity-50"),children:s.jsx(zs,{currentRt:J,currentLabel:Ut(lt?.rule,i??{},nt,l??void 0),currentGlobalKey:Dt(lt?.rule,i??{},l??void 0)??void 0,matchers:Bt,globals:ys,onSelect:Xn,onSelectGlobal:ea,schema:Qn,formValue:fe,onChange:Zn,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:i,onSaveReferencedBlock:At,sandbox:Ft})})]}),s.jsx("div",{className:"p-2 pt-3",children:s.jsx(Qo,{listKey:`${w??""}-${Ce}`,rawSections:W,sections:Me,meta:l,selectedIndex:v,onSelect:Mn,onReorder:Ln,onDelete:Fn,onDuplicate:Bn,onMakeReusable:ve,onToggleHidden:On,onToggleLazy:In,onAddVariant:os,onDetach:$n,onAddSection:()=>xe(!0),canAddSection:Yn})})]}),s.jsx(Ha,{open:Le!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Le!==null?cs(Me[Le]?.label??""):"",isPending:Ve.isPending,onSubmit:Jn}),f&&s.jsx(Fo,{open:Re,onOpenChange:xe,meta:l,decofile:i,previewBaseUrl:f,onSelect:zn}),Ne&&w&&i&&s.jsx(Ga,{open:Ne,onOpenChange:_e,pageKey:w,decofile:i}),de!==null&&s.jsx(Bs,{open:!0,initialName:kt($e[de]?.rule,i??{},l??void 0)?Ut($e[de]?.rule,i??{},nt,l??void 0):"",autoLabel:nt(Ct($e[de]?.rule,i??{},l??void 0)),isPending:wt,onSubmit:async t=>{await ma(de,t)},onOpenChange:t=>{!t&&!wt&&oe(null)}}),ee!==null&&s.jsx(Bs,{open:!0,initialName:kt(pt[ee]?.rule,i??{},l??void 0)?Ut(pt[ee]?.rule,i??{},nt,l??void 0):"",autoLabel:nt(Ct(pt[ee]?.rule,i??{},l??void 0)),isPending:wt,onSubmit:async t=>{await fa(ee,t)},onOpenChange:t=>{!t&&!wt&&re(null)}})]})}export{lc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,aH as nt,aF as Pe,j as d,cV as rt,aJ as be,aG as k,cW as st,aC as j,aI as _,bM as $,cX as lt,af as Ne,cY as Ee,aD as at,bH as ct,bO as it,d2 as dt,d3 as ut,d4 as pt,d5 as ft,cZ as mt,aE as ht,d6 as vt,c_ as gt,d0 as xt,c as ee,m as oe}from"./index-osUKgSS7.js";import{V as St}from"./tooltip-CeBtAc-Q.js";import{i as wt}from"./Check-D39cW1EC.js";import{t as Re}from"./ChevronDown-Dxdrzb03.js";import{n as Ct}from"./ChevronUp-CorFhFXr.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.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:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.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:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);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,...c,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.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.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=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,F]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>F(f)),[O,U]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=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===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.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]),i.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),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};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,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.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 y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===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,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&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:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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",Fe=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.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.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=i.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=Ue;var We="SelectLabel",Bt=i.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 ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{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:i.useCallback(m=>{g(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:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.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 Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(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=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.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;c(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=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.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.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.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",Ft=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.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]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,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=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;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(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;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 mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,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 g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=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 v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=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:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=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:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|
|
1
|
+
import{r as i,aH as nt,aF as Pe,j as d,cV as rt,aJ as be,aG as k,cW as st,aC as j,aI as _,bM as $,cX as lt,af as Ne,cY as Ee,aD as at,bH as ct,bO as it,d2 as dt,d3 as ut,d4 as pt,d5 as ft,cZ as mt,aE as ht,d6 as vt,c_ as gt,d0 as xt,c as ee,m as oe}from"./index-DMSyZ1PC.js";import{V as St}from"./tooltip-CJ5Y5366.js";import{i as wt}from"./Check-BXZBH--f.js";import{t as Re}from"./ChevronDown-C82kSPQJ.js";import{n as Ct}from"./ChevronUp-Ur5tOU4r.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.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:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.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:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);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,...c,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.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.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=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,F]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>F(f)),[O,U]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=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===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.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]),i.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),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};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,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.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 y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===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,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&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:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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",Fe=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.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.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=i.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=Ue;var We="SelectLabel",Bt=i.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 ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{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:i.useCallback(m=>{g(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:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.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 Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(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=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.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;c(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=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.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.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.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",Ft=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.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]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,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=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;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(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;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 mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,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 g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=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 v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=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:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=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:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|