decocms 4.42.1 → 4.43.1
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-BUV1aaBB.js → AlertCircle-CKIMoBfF.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C5PTEkeN.js → ArrowUpRight-ChxT--i8.js} +1 -1
- package/dist/client/assets/{Check-B16xJXjE.js → Check-CgQMRine.js} +1 -1
- package/dist/client/assets/{CheckCircle-BcsYRx5f.js → CheckCircle-DLd87675.js} +1 -1
- package/dist/client/assets/{ChevronDown-CcTWKRPg.js → ChevronDown-qqM0SLXR.js} +1 -1
- package/dist/client/assets/{ChevronRight-CcgcZsYL.js → ChevronRight-CpGhiI97.js} +1 -1
- package/dist/client/assets/{ChevronUp-BCHrnAh6.js → ChevronUp-Dn1vKsEF.js} +1 -1
- package/dist/client/assets/{Circle-CP3BX1rw.js → Circle-BoRv3d_d.js} +1 -1
- package/dist/client/assets/{Copy01-BTdPDBN9.js → Copy01-DNpGGgMd.js} +1 -1
- package/dist/client/assets/{DotsVertical-DdWpUKpz.js → DotsVertical-D34upRsH.js} +1 -1
- package/dist/client/assets/{Eye-8fr_Pgxa.js → Eye-CjtO2Q0D.js} +1 -1
- package/dist/client/assets/{FilterLines-BhagGFYG.js → FilterLines-D4XPLN7q.js} +1 -1
- package/dist/client/assets/{Globe01-Dvg2vd2p.js → Globe01-DoBbyUVa.js} +1 -1
- package/dist/client/assets/{Globe04-BSzzSQ4p.js → Globe04-BGQQ3Wui.js} +1 -1
- package/dist/client/assets/{HardDrive-COFBbxS6.js → HardDrive-CWIHpDtZ.js} +1 -1
- package/dist/client/assets/{Key01-DFriydhl.js → Key01-x8JGAd1M.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bu4UzHdK.js → LayoutLeft-BFPLHnt_.js} +1 -1
- package/dist/client/assets/{LinkExternal01-NA15RRaa.js → LinkExternal01-ChGbs-hB.js} +1 -1
- package/dist/client/assets/{List-BP287K_j.js → List-Da7El2Ly.js} +1 -1
- package/dist/client/assets/{Loading02-DXvcKtoc.js → Loading02-Cp7778Gu.js} +1 -1
- package/dist/client/assets/{Monitor01-Td-GdAGC.js → Monitor01-B-ZV-YPA.js} +1 -1
- package/dist/client/assets/{Palette-CUdoQUk3.js → Palette-Bwaj6wi0.js} +1 -1
- package/dist/client/assets/{Play-BhgmI7co.js → Play-CnWIOlZ6.js} +1 -1
- package/dist/client/assets/{Plus-DLawdkEq.js → Plus-DDEPCr2D.js} +1 -1
- package/dist/client/assets/{SearchLg-CbQnZnSn.js → SearchLg-ozbODPXv.js} +1 -1
- package/dist/client/assets/{SearchMd-CbuoT2qj.js → SearchMd-PQ-iON4O.js} +1 -1
- package/dist/client/assets/{Settings02-CQQdXaww.js → Settings02-Crk_Uo0T.js} +1 -1
- package/dist/client/assets/{Shield01-DtZY81u0.js → Shield01-H38rviWD.js} +1 -1
- package/dist/client/assets/{Star01-BnYY23Ra.js → Star01-BdaFiyBl.js} +1 -1
- package/dist/client/assets/{Stars01-dYe3LXjT.js → Stars01-GnMep6CC.js} +1 -1
- package/dist/client/assets/{Stars02-DfpBD2GB.js → Stars02-D26vPcwS.js} +1 -1
- package/dist/client/assets/{Sun-z8YeD1S4.js → Sun-CUQU5tHW.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D2ejF96b.js → SwitchHorizontal01-CPghm9Dm.js} +1 -1
- package/dist/client/assets/{Tool01-BEyDyPOp.js → Tool01-iV_f6mkx.js} +1 -1
- package/dist/client/assets/{Trash01-BLVHcRAt.js → Trash01-CNFquYeR.js} +1 -1
- package/dist/client/assets/{Upload01-B8-U1BRh.js → Upload01-75JfaDUf.js} +1 -1
- package/dist/client/assets/{User01-C3sDptA-.js → User01-BcAD6NVn.js} +1 -1
- package/dist/client/assets/{Users01-CuUXC1Ci.js → Users01-mZ0iYiBm.js} +1 -1
- package/dist/client/assets/{Users03-R5e8a-ic.js → Users03-CnkyQOrs.js} +1 -1
- package/dist/client/assets/{X-BZoqOmD2.js → X-QFZbkFZe.js} +1 -1
- package/dist/client/assets/{XCircle-DPRLMCT4.js → XCircle-DtHOc2ZU.js} +1 -1
- package/dist/client/assets/{XClose-C_JaNpS1.js → XClose--u79-Ly4.js} +1 -1
- package/dist/client/assets/{Zap-xFZJwGEw.js → Zap-CWLHRo7I.js} +1 -1
- package/dist/client/assets/{ZapSquare-CtbS5__E.js → ZapSquare-CLhh9YdT.js} +1 -1
- package/dist/client/assets/{ZoomOut-CfwWeUWz.js → ZoomOut-EBbOVCDp.js} +1 -1
- package/dist/client/assets/{access-gate-CKAc3MI3.js → access-gate-Cx6_pyVm.js} +1 -1
- package/dist/client/assets/add-section-modal-BAzLzMRT.js +1 -0
- package/dist/client/assets/{agent-capabilities-C8FAf02H.js → agent-capabilities-CRvsdn4y.js} +1 -1
- package/dist/client/assets/{agent-icon-CxboDRSz.js → agent-icon-pZLSDYa_.js} +1 -1
- package/dist/client/assets/{agents-list-jvSb6xVs.js → agents-list-B6IncTQe.js} +1 -1
- package/dist/client/assets/{ai-providers-C59nw8WL.js → ai-providers-DD9hr-M8.js} +1 -1
- package/dist/client/assets/{alert-DNTB_hZa.js → alert-D7vrU7Bn.js} +1 -1
- package/dist/client/assets/{alert-dialog-DztyyUi4.js → alert-dialog-BVhND3bB.js} +1 -1
- package/dist/client/assets/app-editor-BqRmTY3P.js +1 -0
- package/dist/client/assets/{auth-B49_gEpl.js → auth-DBBNrHUP.js} +1 -1
- package/dist/client/assets/{auth-catchall-DCcZhJ5p.js → auth-catchall-DdCIXIcF.js} +1 -1
- package/dist/client/assets/{auth-entry-BvlziyC8.js → auth-entry-TaN4yNlW.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BYs9kt-I.js → auth-split-layout-C3kFIex_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C-vgMxhR.js → authenticate-and-persist-oauth-C9_UmFJ2.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cf-bRsMO.js → automation-list-row-CNhEHndD.js} +1 -1
- package/dist/client/assets/{automation-runs-DBVJ_kj9.js → automation-runs-DJjdDqQF.js} +2 -2
- package/dist/client/assets/{automations-BmlQyKZJ.js → automations-C5irh7_A.js} +1 -1
- package/dist/client/assets/{autosend-PPQPd6hx.js → autosend-B_DvBwNT.js} +1 -1
- package/dist/client/assets/{avatar-ANBinthd.js → avatar-DP-cqOlQ.js} +1 -1
- package/dist/client/assets/{badge-BuGvx5wO.js → badge-DlJrSSei.js} +1 -1
- package/dist/client/assets/{block-document-CKRnkLuF.js → block-document-Bl2zOr3v.js} +3 -3
- package/dist/client/assets/{brand-context-D0e9ClrU.js → brand-context-Ct0NjL0d.js} +1 -1
- package/dist/client/assets/{breadcrumb-B3Z_-uKL.js → breadcrumb-GalsWMoY.js} +1 -1
- package/dist/client/assets/{buckets-4KVSvyFr.js → buckets-DovRUEbj.js} +1 -1
- package/dist/client/assets/bulk-category-panel-DrrZfGBv.js +1 -0
- package/dist/client/assets/{calendar-DnSwKPIN.js → calendar-ByCvKibf.js} +1 -1
- package/dist/client/assets/{capability-load-error-sYOaQ0g0.js → capability-load-error-CD_DVoFx.js} +1 -1
- package/dist/client/assets/{card-DJqFWzIJ.js → card-Csn3UcjD.js} +1 -1
- package/dist/client/assets/category-editor-Bff59WSQ.js +1 -0
- package/dist/client/assets/{chat-context-DCZGSOx8.js → chat-context-OiSfW84L.js} +1 -1
- package/dist/client/assets/{checkbox-COswPEj2.js → checkbox-xZZhzUrW.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bv-I3_Gx.js → cli-auth-success-DhLdz_vG.js} +1 -1
- package/dist/client/assets/collection-detail-D01Pq2z1.js +1 -0
- package/dist/client/assets/{collection-display-button-oD6CYYEi.js → collection-display-button-Br3ILVGs.js} +1 -1
- package/dist/client/assets/{collection-search-CcVZ5PBf.js → collection-search-DeLY6X9U.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dge6GrJC.js → collection-table-wrapper-BOz5eUZB.js} +1 -1
- package/dist/client/assets/{collection-tabs-DWNEk1Al.js → collection-tabs-Bfi1Oe5-.js} +1 -1
- package/dist/client/assets/{command-XRq6AHU5.js → command-BMT4cbQ7.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BCHKuTrr.js → commerce-onboarding-BV-yCVK4.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CdGFPNIo.js → connect-desktop-dialog-DD7fudsE.js} +1 -1
- package/dist/client/assets/{connection-card-CTO6rag4.js → connection-card-DA6l3iLZ.js} +1 -1
- package/dist/client/assets/connection-detail-CRJMjt9j.js +1 -0
- package/dist/client/assets/{connection-form-helpers-OplPjIR_.js → connection-form-helpers-D-Ov9ZXq.js} +1 -1
- package/dist/client/assets/connections-B6Wx27C5.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-DP8aNAOD.js → decopilot-sse-pool-Dewrv2vl.js} +1 -1
- package/dist/client/assets/{dialog-DApjYcGg.js → dialog-Ck6uCn5n.js} +1 -1
- package/dist/client/assets/{domain-settings-CiG1vjfL.js → domain-settings-BsAVYDoK.js} +1 -1
- package/dist/client/assets/{drawer-CTO2hLFc.js → drawer-vm496Lvi.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C1VpDy3z.js → dropdown-menu-BQ3wlJ0e.js} +1 -1
- package/dist/client/assets/{empty-state-_kCTiI7J.js → empty-state-CwiE9raz.js} +1 -1
- package/dist/client/assets/{extract-connection-data-q9aI-svo.js → extract-connection-data-DhBmy0jo.js} +1 -1
- package/dist/client/assets/file-explorer-BeYa--Uk.js +2 -0
- package/dist/client/assets/{file-type-icon-BwLjGPIE.js → file-type-icon-CLTaPXWY.js} +1 -1
- package/dist/client/assets/{files-DbPQpdYj.js → files-VVg7_Tn3.js} +1 -1
- package/dist/client/assets/{form-FihqRwG5.js → form-CYN5fbtc.js} +1 -1
- package/dist/client/assets/{general-WssWwsmi.js → general-tdZiT7eV.js} +1 -1
- package/dist/client/assets/github-repo-picker-BBm3pnxe.js +1 -0
- package/dist/client/assets/{hooks-DBr0m9c1.js → hooks-BLrBhhSc.js} +1 -1
- package/dist/client/assets/{index-D23suRTi.js → index-6CqfHRwv.js} +1 -1
- package/dist/client/assets/{index-CbmxR1uM.js → index-BCQhoJho.js} +1 -1
- package/dist/client/assets/{index-IrvmnvcP.js → index-BVrD0Vyp.js} +3 -3
- package/dist/client/assets/{index-87jGW96_.js → index-BeR5pCj_.js} +1 -1
- package/dist/client/assets/{index-zDs19lPZ.js → index-C-Dbke2M.js} +1 -1
- package/dist/client/assets/{index-BIkrNFxo.js → index-DHeIz23k.js} +1 -1
- package/dist/client/assets/index-DhHJ9QL9.css +1 -0
- package/dist/client/assets/{index-DZfqLgYu.js → index-DjDN5EMh.js} +1 -1
- package/dist/client/assets/{index-C_QjJ53G.js → index-IL4sxsdP.js} +8 -8
- package/dist/client/assets/{index-Dx7DdQRD.js → index-IeH9azOo.js} +1 -1
- package/dist/client/assets/{index-BvrYnHg7.js → index-a94DUj3O.js} +1 -1
- package/dist/client/assets/{index-N9_ZF8cE.js → index-aNhiPg63.js} +10 -10
- package/dist/client/assets/index-dT0VnAI1.js +217 -0
- package/dist/client/assets/{index-V6HPX6V9.js → index-g9gz6hey.js} +1 -1
- package/dist/client/assets/{index-D-LnlVR-.js → index-qE6jsvIp.js} +1 -1
- package/dist/client/assets/{index-redirect-DZROBaZp.js → index-redirect-BFwh0wpr.js} +1 -1
- package/dist/client/assets/{input-D0zl9pbZ.js → input-D1rmycTV.js} +1 -1
- package/dist/client/assets/{integration-icon-CidjOFvm.js → integration-icon-_YMxWoYF.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-B2Y_TvJZ.js → invite-member-dialog-CfsQ0ZEj.js} +1 -1
- package/dist/client/assets/{label-rMO70OLY.js → label-B5YHEFF3.js} +1 -1
- package/dist/client/assets/{login-DOZHO9E2.js → login-Bd8fmwnt.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B2qTVLOE.js → mcp-oauth-BMDNynvE.js} +1 -1
- package/dist/client/assets/{members-CSK3868z.js → members-n1jfO1D4.js} +1 -1
- package/dist/client/assets/{monaco-editor-BOuR6H_P.js → monaco-editor-5bBXjgbR.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-BmSEk4JX.js → monitoring-stats-row-C33Ay0ko.js} +1 -1
- package/dist/client/assets/{oauth-callback-OQFjwRKe.js → oauth-callback-CojjpytS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DrTpi1tG.js → oauth-callback-ai-provider-nZr59Gvo.js} +1 -1
- package/dist/client/assets/{onboarding-nIzVSXob.js → onboarding-C_k2U6Bi.js} +1 -1
- package/dist/client/assets/{org-install-BMP-9_b6.js → org-install-BIV4JCd2.js} +1 -1
- package/dist/client/assets/{org-layout-8bhX7pQC.js → org-layout-CC7oOH5e.js} +1 -1
- package/dist/client/assets/{organization-choice-DiABJQkd.js → organization-choice-CK8_uyCp.js} +1 -1
- package/dist/client/assets/page-seo-form-DUFGbWn3.js +1 -0
- package/dist/client/assets/page-seo-sheet-CiLFYd7i.js +1 -0
- package/dist/client/assets/{popover-QyTTRoCY.js → popover-D8-HA_34.js} +1 -1
- package/dist/client/assets/post-editor-DMc8SVcn.js +1 -0
- package/dist/client/assets/{primitives-Gory5Wuu.js → primitives-DA4fn3fP.js} +1 -1
- package/dist/client/assets/{profile-DR-6zBTk.js → profile-CkpBT-eo.js} +1 -1
- package/dist/client/assets/project-app-view-9KHobi59.js +1 -0
- package/dist/client/assets/record-editor-clJfYC1f.js +1 -0
- package/dist/client/assets/registry-5fnU2SsZ.js +2 -0
- package/dist/client/assets/{registry-layout-ChE1SgAD.js → registry-layout-KnqLMIBG.js} +1 -1
- package/dist/client/assets/{require-capability-tPA0YjZg.js → require-capability-DjmHfA2I.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BibPmRFP.js → required-auth-layout-D0jQ0aNu.js} +1 -1
- package/dist/client/assets/{reset-password-Ml42vC8p.js → reset-password-DZWSlMHj.js} +1 -1
- package/dist/client/assets/{roles-zoLqZoaX.js → roles-wtI7xjSF.js} +1 -1
- package/dist/client/assets/{search-input-CtOw9M3F.js → search-input-CorH7XFH.js} +1 -1
- package/dist/client/assets/{secrets-D0zh91De.js → secrets-n2XVLTme.js} +1 -1
- package/dist/client/assets/{sections-editor-BobRAdzx.js → sections-editor-CbGUpDjB.js} +2 -2
- package/dist/client/assets/{select-CArP3-Qg.js → select-DI8I4WJ8.js} +1 -1
- package/dist/client/assets/{select-model-DXWN98pQ.js → select-model-Qgwg9p0u.js} +1 -1
- package/dist/client/assets/{seo-editor-DAC90b40.js → seo-editor-CmVPtBfb.js} +1 -1
- package/dist/client/assets/{settings-layout-B3ALc5wh.js → settings-layout-CUksI0IB.js} +1 -1
- package/dist/client/assets/{settings-section-C-Mqos9P.js → settings-section-DTg9wYL3.js} +1 -1
- package/dist/client/assets/{shell-controls-CR5QuGOk.js → shell-controls-CU7WfpuR.js} +1 -1
- package/dist/client/assets/shell-layout-_1bABYX_.js +1 -0
- package/dist/client/assets/{sidebar-CmadAIxp.js → sidebar-nDhZ0gvC.js} +1 -1
- package/dist/client/assets/{skeleton-B1XTWwJr.js → skeleton-DCphi09W.js} +1 -1
- package/dist/client/assets/{sso-DTTEgRnf.js → sso-C4Wbk7oG.js} +1 -1
- package/dist/client/assets/{store-CqpUz5qD.js → store-CLr3us38.js} +1 -1
- package/dist/client/assets/store-registry-DDc01sGv.js +2 -0
- package/dist/client/assets/{studio-tools-CMklO0EH.js → studio-tools-D7oi6bE7.js} +1 -1
- package/dist/client/assets/{switch-CS3osMxV.js → switch-DIXEkL5C.js} +1 -1
- package/dist/client/assets/{tab-id-C4S0EPFu.js → tab-id-DAJ8K7VA.js} +1 -1
- package/dist/client/assets/{table-DzJIbaR4.js → table-BD-HvLR1.js} +1 -1
- package/dist/client/assets/{tabs-C0qUbd04.js → tabs-2mklsU70.js} +1 -1
- package/dist/client/assets/{textarea-RkaMNWZ5.js → textarea-B3v1azqk.js} +1 -1
- package/dist/client/assets/{toggle-group-DlYKy-SR.js → toggle-group-kmPf3ZtQ.js} +1 -1
- package/dist/client/assets/{toolbar-JOUseasH.js → toolbar-DJ2bDd9i.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DRxYzGI_.js → toolbar-icon-button-CAENFHZs.js} +1 -1
- package/dist/client/assets/{tools-list-C9bngZEZ.js → tools-list-BvliuRgj.js} +1 -1
- package/dist/client/assets/{tooltip-DyTNjtAQ.js → tooltip-6XsvbcPm.js} +1 -1
- package/dist/client/assets/{types-DqPYg5H4.js → types-mKz5cguk.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CwEQhJ2W.js → use-ai-providers-Dc83EZFK.js} +1 -1
- package/dist/client/assets/{use-automations-24HA54lb.js → use-automations-B2OHZDtE.js} +1 -1
- package/dist/client/assets/{use-capability-Bu7oVEGz.js → use-capability-CMUDs7io.js} +1 -1
- package/dist/client/assets/{use-clock-tick-GChsORgt.js → use-clock-tick-Bd2FzyOw.js} +1 -1
- package/dist/client/assets/{use-collections-Div5qFbc.js → use-collections-BmWmVNmA.js} +1 -1
- package/dist/client/assets/{use-connection-BKUxTste.js → use-connection-C9dMYRKr.js} +1 -1
- package/dist/client/assets/{use-copy-BHeV6ukd.js → use-copy-Dkb23eJ2.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B-E2mnFx.js → use-create-virtual-mcp-CtR5Ln-Q.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BVvoOyoc.js → use-debounced-autosave-D6-KOf5d.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C8XEyKzu.js → use-debounced-value-C_YfvxPr.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-OBFeu75Z.js → use-decopilot-events-VrcGDptY.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B3dSyaRN.js → use-delete-connection-BMWT3duu.js} +1 -1
- package/dist/client/assets/{use-file-configs-DxlPDMzg.js → use-file-configs-GB4olcnE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C4LN8_oB.js → use-infinite-scroll-fBdOmO40.js} +1 -1
- package/dist/client/assets/{use-join-requests-BOWtWdxW.js → use-join-requests-DLdCvo8G.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DQUOeFco.js → use-mcp-client-Lqn_C3qr.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Bk99_Vhn.js → use-mcp-prompts-CMq0xGeM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B-jAiNbN.js → use-mcp-tools-DJDVX4rj.js} +1 -1
- package/dist/client/assets/{use-members-Bo1aF7BX.js → use-members-Bi4U8t9-.js} +1 -1
- package/dist/client/assets/{use-mobile-Cd7zsr90.js → use-mobile-Cmlqgq4k.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DSHaKE7a.js → use-navigate-to-agent-BYgcjQkF.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DFUm7cjy.js → use-org-auth-client-DUy7hwUr.js} +1 -1
- package/dist/client/assets/{use-org-sso-DbVvgjNR.js → use-org-sso-DuScBhpQ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BkZ-PQ8-.js → use-organization-roles-CBBq7SV7.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DjQ8N7Gc.js → use-organization-settings-BQWFu8nW.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B-fnx9yk.js → use-registry-connections-BgcT6Tg3.js} +1 -1
- package/dist/client/assets/{use-secrets-DxDpkkMJ.js → use-secrets-CuP78fwS.js} +1 -1
- package/dist/client/assets/{use-status-sounds-IgpOZOBg.js → use-status-sounds-ColfGIxe.js} +1 -1
- package/dist/client/assets/{use-view-mode-DuI_cKCa.js → use-view-mode-BIzBFo9a.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CU2FdJRv.js → use-virtual-mcp-BbQV2eLt.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bgk8iFmg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BMbE48wB.js +1 -0
- package/dist/client/assets/{variant-calendar-9xplS-lW.js → variant-calendar-BPma4fIJ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CYgQfD6c.js → view-mode-toggle-CDajZZgb.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/add-section-modal-Cg4oWrNi.js +0 -1
- package/dist/client/assets/app-editor-BX4EZ6KL.js +0 -1
- package/dist/client/assets/bulk-category-panel-C44iHroM.js +0 -1
- package/dist/client/assets/category-editor-BP7qnK1m.js +0 -1
- package/dist/client/assets/collection-detail-6gCqNuEz.js +0 -1
- package/dist/client/assets/connection-detail-YTipj66f.js +0 -1
- package/dist/client/assets/connections-CwAnq_cV.js +0 -1
- package/dist/client/assets/file-explorer-CjideV3r.js +0 -2
- package/dist/client/assets/github-repo-picker-eJFRPx1Y.js +0 -1
- package/dist/client/assets/index-C2ybUFaX.css +0 -1
- package/dist/client/assets/index-_2thZC-g.js +0 -217
- package/dist/client/assets/page-seo-form-C6zuc-ks.js +0 -1
- package/dist/client/assets/page-seo-sheet-BSKIhvTU.js +0 -1
- package/dist/client/assets/post-editor-CSOkNCi2.js +0 -1
- package/dist/client/assets/project-app-view-DO8B8CEU.js +0 -1
- package/dist/client/assets/record-editor-Uf0eMG9E.js +0 -1
- package/dist/client/assets/registry-BDxKgIex.js +0 -2
- package/dist/client/assets/shell-layout-CMtQD7SX.js +0 -1
- package/dist/client/assets/store-registry-BI075YdI.js +0 -2
- package/dist/client/assets/useInfiniteQuery-F3NAb6sv.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-z5EP-RbA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t,P as D,r as j,aC as w,B as S,t as y}from"./index-
|
|
1
|
+
import{c as p,j as t,P as D,r as j,aC as w,B as S,t as y}from"./index-aNhiPg63.js";import{i as k}from"./AlertCircle-CKIMoBfF.js";import{s as z}from"./Plus-DDEPCr2D.js";import{s as F}from"./User01-BcAD6NVn.js";import{t as E}from"./Users01-mZ0iYiBm.js";import{e as $,d as I,c as O,a as A,b as R,D as T}from"./dialog-Ck6uCn5n.js";import{I as N}from"./input-D1rmycTV.js";import{L as g}from"./label-B5YHEFF3.js";import{a as B,c as V,d as L,S as q,b as C}from"./select-DI8I4WJ8.js";import{S as H}from"./skeleton-DCphi09W.js";import{T as K}from"./textarea-B3v1azqk.js";import{P as b}from"./index-DHeIz23k.js";import{c as W}from"./settings-section-DTg9wYL3.js";import{u as Y,a as G}from"./use-secrets-CuP78fwS.js";import{R as J}from"./require-capability-DjmHfA2I.js";import"./X-QFZbkFZe.js";import"./tooltip-6XsvbcPm.js";import"./Check-CgQMRine.js";import"./ChevronDown-qqM0SLXR.js";import"./ChevronUp-Dn1vKsEF.js";import"./sidebar-nDhZ0gvC.js";import"./LayoutLeft-BFPLHnt_.js";import"./use-mobile-Cmlqgq4k.js";import"./card-Csn3UcjD.js";import"./ArrowUpRight-ChxT--i8.js";import"./studio-tools-D7oi6bE7.js";import"./use-capability-CMUDs7io.js";import"./access-gate-Cx6_pyVm.js";import"./capability-load-error-CD_DVoFx.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function P(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(P,{secret:s},s.id)}function ee(s){return t.jsx(P,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(D,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as He,r as R,l as Be,j as n,B as We,i as zn,p as Ss,t as G,K as xs}from"./index-N9_ZF8cE.js";import{M as ys,N as bs,O as _s,y as Hn,z as It,K as Un,P as Gn,Q as Wn,R as js,w as qn,C as Yn,T as ks,G as ws,V as Rs,A as Jn,B as Rt,F as Qn,H as Xn,D as Zn,E as ea,U as ta,W as Ds,X as Dt,Y as mt,Z as bt,_ as Ns,$ as Vs,a0 as Cs,b as Ps,c as Ts,a1 as As,a2 as Ms,a3 as Es,a4 as Ks,v as $t,a5 as Ot,a6 as $s,a7 as ut,a8 as kt,a9 as Os,aa as Bs,ab as Je,ac as Vn,ad as Fs,ae as Cn,af as Bt,ag as Ls,ah as an,ai as Is,aj as et,ak as zs,al as Hs,am as Us,an as Gs,ao as Ws,ap as qs,aq as dt,ar as Ys,as as Js,at as Qs,au as Pn,av as wt,e as Xs,aw as Zs,ax as er,ay as tr,az as nr,aA as sn,aB as Tn,aC as An,aD as yt,aE as Ft,aF as ar,aG as rn,aH as sr,aI as rr,f as na,aJ as Mn,aK as or}from"./index-_2thZC-g.js";import{t as ir}from"./ChevronDown-CcTWKRPg.js";import{s as aa,n as lr}from"./Loading02-DXvcKtoc.js";import{i as sa}from"./ChevronRight-CcgcZsYL.js";import{n as cr}from"./ChevronUp-BCHrnAh6.js";import{H as ln,G as ra,K as ur,U as dr,M as mr}from"./agent-icon-CxboDRSz.js";import{i as fr}from"./Globe01-Dvg2vd2p.js";import{B as Lt}from"./automation-runs-DBVJ_kj9.js";import{T as ft,a as pt,b as ht}from"./tooltip-DyTNjtAQ.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-DApjYcGg.js";import{I as yr}from"./input-D0zl9pbZ.js";import{a as oa}from"./Copy01-BTdPDBN9.js";import{a as br}from"./ZoomOut-CfwWeUWz.js";import{i as _r}from"./Settings02-CQQdXaww.js";import{s as jr}from"./Eye-8fr_Pgxa.js";import{s as cn}from"./Plus-DLawdkEq.js";import{s as ia}from"./Trash01-BLVHcRAt.js";import{i as kr}from"./Zap-xFZJwGEw.js";import{d as it,a as la,D as ca,c as ua,j as wr}from"./dropdown-menu-C1VpDy3z.js";import{r as En,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-C6zuc-ks.js";import{c as Mr}from"./Tool01-BEyDyPOp.js";import{A as Er}from"./add-section-modal-Cg4oWrNi.js";import"./SwitchHorizontal01-D2ejF96b.js";import"./chat-context-DCZGSOx8.js";import"./autosend-PPQPd6hx.js";import"./hooks-DBr0m9c1.js";import"./use-mcp-client-DQUOeFco.js";import"./constants-B72Xmt_K.js";import"./auth-B49_gEpl.js";import"./decopilot-sse-pool-DP8aNAOD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CU2FdJRv.js";import"./use-collections-Div5qFbc.js";import"./use-ai-providers-CwEQhJ2W.js";import"./studio-tools-CMklO0EH.js";import"./use-decopilot-events-OBFeu75Z.js";import"./tab-id-C4S0EPFu.js";import"./use-organization-settings-DjQ8N7Gc.js";import"./drawer-CTO2hLFc.js";import"./collection-search-CcVZ5PBf.js";import"./SearchMd-CbuoT2qj.js";import"./use-mobile-Cd7zsr90.js";import"./use-mcp-prompts-Bk99_Vhn.js";import"./X-BZoqOmD2.js";import"./shell-layout-CMtQD7SX.js";import"./avatar-ANBinthd.js";import"./User01-C3sDptA-.js";import"./Users03-R5e8a-ic.js";import"./SearchLg-CbQnZnSn.js";import"./Stars02-DfpBD2GB.js";import"./XClose-C_JaNpS1.js";import"./CheckCircle-BcsYRx5f.js";import"./FilterLines-BhagGFYG.js";import"./alert-dialog-DztyyUi4.js";import"./required-auth-layout-BibPmRFP.js";import"./use-org-sso-DbVvgjNR.js";import"./ZapSquare-CtbS5__E.js";import"./Check-B16xJXjE.js";import"./Star01-BnYY23Ra.js";import"./Upload01-B8-U1BRh.js";import"./AlertCircle-BUV1aaBB.js";import"./form-FihqRwG5.js";import"./label-rMO70OLY.js";import"./select-CArP3-Qg.js";import"./XCircle-DPRLMCT4.js";import"./tabs-C0qUbd04.js";import"./toggle-group-DlYKy-SR.js";import"./agent-capabilities-C8FAf02H.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CTO6rag4.js";import"./use-registry-connections-B-fnx9yk.js";import"./use-connection-BKUxTste.js";import"./useInfiniteQuery-F3NAb6sv.js";import"./use-infinite-scroll-C4LN8_oB.js";import"./extract-connection-data-q9aI-svo.js";import"./card-DJqFWzIJ.js";import"./integration-icon-CidjOFvm.js";import"./collection-tabs-DWNEk1Al.js";import"./badge-BuGvx5wO.js";import"./textarea-RkaMNWZ5.js";import"./connection-form-helpers-OplPjIR_.js";import"./authenticate-and-persist-oauth-C-vgMxhR.js";import"./mcp-oauth-B2qTVLOE.js";import"./useSuspenseInfiniteQuery-z5EP-RbA.js";import"./Monitor01-Td-GdAGC.js";import"./connect-desktop-dialog-CdGFPNIo.js";import"./select-model-DXWN98pQ.js";import"./checkbox-COswPEj2.js";import"./skeleton-B1XTWwJr.js";import"./Key01-DFriydhl.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C-Mqos9P.js";import"./ArrowUpRight-C5PTEkeN.js";import"./Stars01-dYe3LXjT.js";import"./command-XRq6AHU5.js";import"./index-BvrYnHg7.js";import"./popover-QyTTRoCY.js";import"./index-C_QjJ53G.js";import"./Palette-CUdoQUk3.js";import"./file-type-icon-BwLjGPIE.js";import"./toolbar-JOUseasH.js";import"./use-debounced-value-C8XEyKzu.js";import"./DotsVertical-DdWpUKpz.js";import"./LinkExternal01-NA15RRaa.js";import"./index-IrvmnvcP.js";import"./LayoutLeft-Bu4UzHdK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-IgpOZOBg.js";import"./empty-state-_kCTiI7J.js";import"./Users01-CuUXC1Ci.js";import"./use-mcp-tools-B-jAiNbN.js";import"./types-DqPYg5H4.js";import"./use-capability-Bu7oVEGz.js";import"./tools-list-C9bngZEZ.js";import"./switch-CS3osMxV.js";import"./Play-BhgmI7co.js";import"./use-debounced-autosave-BVvoOyoc.js";import"./index-BIkrNFxo.js";import"./sidebar-CmadAIxp.js";import"./search-input-CtOw9M3F.js";import"./github-repo-picker-eJFRPx1Y.js";import"./use-navigate-to-agent-DSHaKE7a.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DxDpkkMJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-Bo1aF7BX.js";import"./use-org-auth-client-DFUm7cjy.js";import"./index-87jGW96_.js";import"./get-initials-D-f_fDFw.js";import"./List-BP287K_j.js";import"./format-time-Cy7tTmZp.js";import"./Circle-CP3BX1rw.js";import"./calendar-DnSwKPIN.js";import"./toolbar-icon-button-DRxYzGI_.js";import"./use-automations-24HA54lb.js";import"./monaco-editor-BOuR6H_P.js";import"./automation-list-row-Cf-bRsMO.js";import"./use-file-configs-DxlPDMzg.js";import"./Globe04-BSzzSQ4p.js";import"./HardDrive-COFBbxS6.js";import"./Sun-z8YeD1S4.js";import"./Shield01-DtZY81u0.js";import"./table-DzJIbaR4.js";import"./use-clock-tick-GChsORgt.js";import"./use-copy-BHeV6ukd.js";function Kr(d){return d.schema?.definitions??d.schema?.$defs??{}}function $r(d,e){const r=Kr(e),l=r[btoa(d)];if(!l)return;let u=typeof l.image=="string"?l.image:void 0;if(!u&&Array.isArray(l.allOf)){const h=l.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),m=r[S];u=typeof m?.image=="string"?m.image:void 0}}if(u?.includes("{{{"))return u}function Or(d,e){if(!e)return;const r=ys(d);if(!r)return;const l=$r(r.resolveType,e);if(!l)return;const u=bs(l,r.data);if(u)return _s(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Fr="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 Kn(d){return Array.from({length:d},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(d){return d.map((e,r)=>({...e,index:r}))}function Lr(d,e){if(e===d.length)return d;if(e<d.length)return da(d.slice(0,e));const r=Array.from({length:e-d.length},(l,u)=>({id:crypto.randomUUID(),index:d.length+u}));return[...d,...r]}function ma(d){const e=He.c(20),{section:r,raw:l,meta:u}=d,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let m;e[0]!==u||e[1]!==l?(m=l&&u?Or(l,u):void 0,e[0]=u,e[1]=l,e[2]=m):m=e[2];const v=m;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let N;e[6]!==S||e[7]!==h?(N=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=N):N=e[8];let k;e[9]!==N?(k=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:N}),e[9]=N,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let w;e[11]!==_?(w=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=w):w=e[12];let o;e[13]!==r.label||e[14]!==w?(o=n.jsx("span",{className:w,children:r.label}),e[13]=r.label,e[14]=w,e[15]=o):o=e[15];let D;return e[16]!==y||e[17]!==k||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,y,k,o]}),e[16]=y,e[17]=k,e[18]=o,e[19]=D):D=e[19],D}function fa(d,e){const r=d.isSavedBlock===!0,l=d.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":r?Br:l?"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 Ir(d){const e=He.c(64),{section:r,raw:l,meta:u,sortableId:h,selected:S,onSelect:m,onDelete:v,onDuplicate:g,onMakeReusable:y,onToggleHidden:N,onToggleLazy:k,onAddVariant:_,onDetach:w}=d,o=l?Wn(l.__resolveType??""):!1;let D;e[0]!==r?(D=js(r),e[0]=r,e[1]=D):D=e[1];const c=D;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:f,transform:P,isDragging:se}=qn(J);let T;e[4]!==P?(T=Yn.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let V;e[6]!==T||e[7]!==pe?(V={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=V):V=e[8];const ce=V;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==m?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),m())},e[11]=m,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==l||e[19]!==r?(je=n.jsx(ma,{section:r,raw:l,meta:u}),e[17]=u,e[18]=l,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),k()},onPointerDown:Gr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(ht,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==N||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),N()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(ht,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=N,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(la,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ra,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(oa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let W;e[31]!==c||e[32]!==_?(W=c&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(aa,{className:"h-4 w-4"}),"Add variant"]}),e[31]=c,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==y?(q=te&&n.jsxs(it,{className:Fr,onClick:$=>{$.stopPropagation(),y()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=y,e[36]=q):q=e[36];let ne;e[37]!==w||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),w()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=w,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ia,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(ca,{children:[X,n.jsxs(ua,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==m||e[55]!==f||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:f,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:m,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=m,e[55]=f,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(d){return d.stopPropagation()}function Hr(d){return d.stopPropagation()}function Ur(d){return d.stopPropagation()}function Gr(d){return d.stopPropagation()}function Wr(){return!1}function qr(d){const e=He.c(90),{listKey:r,rawSections:l,sections:u,meta:h,selectedIndex:S,onSelect:m,onReorder:v,onDelete:g,onDuplicate:y,onMakeReusable:N,onToggleHidden:k,onToggleLazy:_,onAddVariant:w,onDetach:o,onAddSection:D,canAddSection:c}=d,J=c===void 0?!0:c;let H;e[0]!==u.length?(H=()=>Kn(u.length),e[0]=u.length,e[1]=H):H=e[1];const[K,f]=R.useState(H),[P,se]=R.useState(null),[T,pe]=R.useState(r),[V,ce]=R.useState(u.length),B=R.useRef(!1);T!==r?(pe(r),ce(u.length),f(Kn(u.length))):V!==u.length&&(ce(u.length),f(F=>Lr(F,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Jn},e[3]=oe):oe=e[3];const Ce=Hn(It(Gn,te),It(Un,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=F=>{se(String(F.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=F=>{se(null);const{active:ae,over:Q}=F;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(f(Qe=>da(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==P||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==w||e[19]!==g||e[20]!==o||e[21]!==y||e[22]!==N||e[23]!==m||e[24]!==k||e[25]!==_||e[26]!==l||e[27]!==u||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const F=ae=>{B.current||m(ae)};if(e[45]!==P||e[46]!==J||e[47]!==K||e[48]!==D||e[49]!==l||e[50]!==u){const ae=P?K.find(Q=>Q.id===P):null;if(q=ae!=null?u[ae.index]:null,W=ae!=null?l[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=J,e[47]=K,e[48]=D,e[49]=l,e[50]=u,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Qn,Se=Ce,de=Xn,be=je,$=Ae,Z=Ne,ve=Zn,le=ue,ke=ea,Ke="space-y-1",ne=K.map(ae=>{const Q=u[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:l[ae.index],meta:h,selected:S===ae.index,onSelect:()=>F(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>y(ae.index),onMakeReusable:()=>N(ae.index),onToggleHidden:()=>k(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>w(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=w,e[19]=g,e[20]=o,e[21]=y,e[22]=N,e[23]=m,e[24]=k,e[25]=_,e[26]=l,e[27]=u,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Fe;e[59]!==ne||e[60]!==Ke?(Fe=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Fe):Fe=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Fe?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Fe}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Fe,e[66]=Pe):Pe=e[66];let $e;e[67]!==W||e[68]!==q||e[69]!==h?($e=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=$e):$e=e[70];let Le;e[71]!==$e?(Le=n.jsx(ta,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Le):Le=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Le?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Le]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Le,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(d){return d.id}function $n(d){const e=He.c(38),{open:r,initialName:l,autoLabel:u,isPending:h,onSubmit:S,onOpenChange:m}=d,v=h===void 0?!1:h,[g,y]=R.useState(l),[N,k]=R.useState(r);r!==N&&(k(r),r&&y(l));let _;e[0]!==v||e[1]!==m?(_=oe=>{!oe&&!v&&m(!1)},e[0]=v,e[1]=m,e[2]=_):_=e[2];const w=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(pr,{children:"Rename variant"}),e[7]=c):c=e[7];const J=u||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[c,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=oe=>y(oe.target.value),e[11]=f):f=e[11];let P;e[12]!==u||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:f,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==m?(se=()=>m(!1),e[16]=m,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==T||e[27]!==V?(ce=n.jsxs(vr,{children:[T,V]}),e[26]=T,e[27]=V,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==w||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:w,children:B}),e[34]=w,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="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)]",pa="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 ha(d){const e=He.c(5),{rule:r,matchers:l}=d,u=r?.__resolveType??"";let h;if(e[0]!==l||e[1]!==u){const g=l.find(y=>y.resolveType===u)?.iconName??Ds(u);h=ur(g),e[0]=l,e[1]=u,e[2]=h}else h=e[2];const S=h;if(!S)return null;let m;return e[3]!==S?(m=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=m):m=e[4],m}function On(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function on(d){return d.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(d){return d.map((e,r)=>({...e,index:r}))}function ga(d){const e=He.c(16),{label:r,effectiveRule:l,matchers:u,canDelete:h,dragging:S,onRename:m,onDuplicate:v,onDelete:g}=d;let y;e[0]!==l||e[1]!==u?(y=n.jsx(ha,{rule:l,matchers:u}),e[0]=l,e[1]=u,e[2]=y):y=e[2];let N;e[3]!==r?(N=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=N):N=e[4];let k;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==m?(k=!S&&n.jsxs(ca,{children:[n.jsx(la,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(ra,{size:14})})}),n.jsxs(ua,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:w=>{w.stopPropagation(),m?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:w=>{w.stopPropagation(),v?.()},children:[n.jsx(oa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:w=>{w.stopPropagation(),g?.()},children:[n.jsx(ia,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=m,e[11]=k):k=e[11];let _;return e[12]!==y||e[13]!==N||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[y,N,k]}),e[12]=y,e[13]=N,e[14]=k,e[15]=_):_=e[15],_}function Xr(d){return d.stopPropagation()}function Zr(d){return d.stopPropagation()}function eo(d){const e=He.c(33),{entry:r,sortableId:l,isActive:u,canDelete:h,decofile:S,meta:m,matchers:v,onSelect:g,onRename:y,onDuplicate:N,onDelete:k}=d;let _;e[0]!==l?(_={id:l,animateLayoutChanges:to},e[0]=l,e[1]=_):_=e[1];const{attributes:w,listeners:o,setNodeRef:D,transform:c,isDragging:J}=qn(_);let H;e[2]!==c?(H=Yn.Transform.toString(c?{...c,x:0}:null),e[2]=c,e[3]=H):H=e[3];const K=J?0:void 0;let f;e[4]!==H||e[5]!==K?(f={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=f):f=e[6];const P=f,se=m??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Dt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let V;e[11]!==g?(V=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=V):V=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=u?pa:Jr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==N||e[22]!==y?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:y,onDuplicate:N,onDelete:k}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=N,e[22]=y,e[23]=oe):oe=e[23];let Ce;return e[24]!==w||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==V?(Ce=n.jsx("div",{ref:D,style:P,...w,...o,onClick:g,onKeyDown:V,className:te,children:oe}),e[24]=w,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=V,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(d){const e=He.c(9),{variant:r,decofile:l,meta:u,matchers:h}=d,S=u??void 0;let m;e[0]!==l||e[1]!==S||e[2]!==r.rule?(m=Dt(r.rule,l,S),e[0]=l,e[1]=S,e[2]=r.rule,e[3]=m):m=e[3];const v=m;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let y;return e[5]!==v||e[6]!==h||e[7]!==r.label?(y=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=y):y=e[8],y}function ao(d){const e=He.c(77),{listKey:r,variants:l,activeIndex:u,decofile:h,meta:S,matchers:m,onSelect:v,onReorder:g,onRename:y,onDuplicate:N,onDelete:k,onAdd:_}=d;let w;e[0]!==l?(w=()=>on(l),e[0]=l,e[1]=w):w=e[1];const[o,D]=R.useState(w),[c,J]=R.useState(null),[H,K]=R.useState(r),[f,P]=R.useState(l.length);let se;e[2]!==l?(se=()=>On(l),e[2]=l,e[3]=se):se=e[3];const[T,pe]=R.useState(se),V=R.useRef(!1),ce=On(l);H!==r?(K(r),P(l.length),pe(ce),D(on(l))):f!==l.length?(P(l.length),pe(ce),D(on(l))):T!==ce&&(pe(ce),D(Me=>l.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Jn},e[5]=te):te=e[5];const oe=Hn(It(Gn,B),It(Un,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=l.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(F=>Qr(Rt([...F],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==u||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==m||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==N||e[26]!==y||e[27]!==v||e[28]!==oe){const Me=F=>{V.current||v(F)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(ht,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(ft,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Qn,le=oe,ke=Xn,Se=je,de=Ae,be=Ne,ve=Zn,q=E,ne=ea,we="space-y-0.5",W=o.map(F=>n.jsx(eo,{sortableId:F.id,entry:F,isActive:F.index===u,canDelete:ue,decofile:h,meta:S,matchers:m,onSelect:()=>Me(F.index),onRename:()=>y(F.index),onDuplicate:()=>N(F.index),onDelete:()=>k(F.index)},F.id)),e[14]=u,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=m,e[22]=S,e[23]=_,e[24]=k,e[25]=N,e[26]=y,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ee;e[49]!==W||e[50]!==we?(Ee=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ee):Ee=e[51];let Ke;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ee?(Ke=n.jsx(ve,{items:q,strategy:ne,children:Ee}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ee,e[56]=Ke):Ke=e[56];let Fe;e[57]!==c||e[58]!==h||e[59]!==m||e[60]!==S?(Fe=c?n.jsx(no,{variant:c.variant,decofile:h,meta:S,matchers:m}):null,e[57]=c,e[58]=h,e[59]=m,e[60]=S,e[61]=Fe):Fe=e[61];let Pe;e[62]!==Fe?(Pe=n.jsx(ta,{dropAnimation:null,children:Fe}),e[62]=Fe,e[63]=Pe):Pe=e[63];let $e;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==Ke||e[71]!==Pe?($e=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[Ke,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=Ke,e[71]=Pe,e[72]=$e):$e=e[72];let Le;return e[73]!==$||e[74]!==Z||e[75]!==$e?(Le=n.jsxs("div",{className:$,children:[Z,$e]}),e[73]=$,e[74]=Z,e[75]=$e,e[76]=Le):Le=e[76],Le}function so(d){return d.id}function va({pageKey:d,prefix:e,variants:r,selectedIndex:l,decofile:u,meta:h}){if(!d||l<0||l>=r.length)return[];const S=[];for(let m=0;m<=l;m++){const v=r[m];if(!v)continue;const g=v.rule,y=m===l?"1":"0",k=(mt(g,u,h)?bt(g,u,h):null)??`${d}@${e}.${m}.rule`;S.push(`${k}=${y}`)}return S}function Bn(d,e,r,l){return!e.multivariate||e.variants.length<=1?[]:va({pageKey:d,prefix:"sections.variants",variants:e.variants,selectedIndex:e.index,decofile:r,meta:l})}function ro({pageKey:d,page:e,sectionIndex:r,sectionLazy:l,mvObj:u,selectedVariantIndex:h,decofile:S,meta:m}){if(r<0)return[];const g=`${e.multivariate?`sections.variants.${e.index}.value`:"sections"}.${r}${l?".section":""}.variants`,y=Array.isArray(u.variants)?u.variants:[];return va({pageKey:d,prefix:g,variants:y,selectedIndex:h,decofile:S,meta:m})}function Fn(d){const e=He.c(15),{schema:r,value:l,onChange:u,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}=d;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[y,N]=R.useState(g);let k;e[1]!==y?(k=y.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>N([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(lr,{className:"size-3.5"})}),y.map((o,D)=>{const c=D===y.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>N(y.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",c?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=y,e[2]=k):k=e[2];let _;e[3]!==y||e[4]!==S||e[5]!==h||e[6]!==u||e[7]!==m||e[8]!==v||e[9]!==r||e[10]!==l?(_=n.jsx(na,{schema:r,value:l,onChange:u,basePath:"",breadcrumbPath:y,onBreadcrumbChange:N,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}),e[3]=y,e[4]=S,e[5]=h,e[6]=u,e[7]=m,e[8]=v,e[9]=r,e[10]=l,e[11]=_):_=e[11];let w;return e[12]!==k||e[13]!==_?(w=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=w):w=e[14],w}function Ln(d){const e=He.c(21),{activeSchema:r,formValue:l,formResetKey:u,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:m,emptyMessage:v,beforeForm:g,seoResolveType:y,siteDefaultSeo:N,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o}=d;let D;e[0]!==m?(D=m===void 0?[]:m,e[0]=m,e[1]=D):D=e[1];const c=D;let J;e[2]!==r||e[3]!==c||e[4]!==_||e[5]!==u||e[6]!==l||e[7]!==k||e[8]!==S||e[9]!==h||e[10]!==w||e[11]!==o||e[12]!==y||e[13]!==N?(J=r&&l?y?n.jsx(Ar,{schema:r,resolveType:y,value:l,formResetKey:u,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:N}):n.jsx(na,{schema:r,value:l,onChange:h,basePath:"",breadcrumbPath:c,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o},u):null,e[2]=r,e[3]=c,e[4]=_,e[5]=u,e[6]=l,e[7]=k,e[8]=S,e[9]=h,e[10]=w,e[11]=o,e[12]=y,e[13]=N,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let f;return e[18]!==g||e[19]!==K?(f=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=f):f=e[20],f}const oo="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 io(d,e){return zs(d,e,et)}function lo(d){const e=He.c(13),{pageKey:r,initialName:l,initialPath:u,onFieldChange:h}=d,[S,m]=R.useState(l),[v,g]=R.useState(u),[y,N]=R.useState(r);y!==r&&(N(r),m(l),g(u));let k;e[0]!==h?(k=c=>{m(c.target.value),h("name",c.target.value)},e[0]=h,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=k,e[4]=_):_=e[4];let w;e[5]!==h?(w=c=>{g(c.target.value),h("path",c.target.value)},e[5]=h,e[6]=w):w=e[6];let o;e[7]!==v||e[8]!==w?(o=n.jsx("input",{type:"text",value:v,onChange:w,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=w,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(d){const e=He.c(6),{onClick:r}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(aa,{size:14}),e[0]=l):l=e[0];let u;e[1]!==r?(u=n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:l})}),e[1]=r,e[2]=u):u=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ht,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==u?(S=n.jsxs(ft,{children:[u,h]}),e[4]=u,e[5]=S):S=e[5],S}function Ql({orgSlug:d,virtualMcpId:e,branch:r,previewReady:l=!0,previewUrl:u,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:m=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:y=!1,onExitSeo:N,onViewJsonFile:k,onVariantPreviewOverride:_}){const w=l?{orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:D}=Ns(w),{data:c,isLoading:J}=Vs(w),H=Cs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[f,P]=R.useState(null),[se,T]=R.useState(null),[pe,V]=R.useState(null),[ce,B]=R.useState(0),[te,oe]=R.useState(void 0),[Ce,E]=R.useState(null),[ue,ie]=R.useState(null),[je,M]=R.useState([]),[Ae,X]=R.useState(0),[Ne,ve]=R.useState(null),[re,W]=R.useState(null),[q,ne]=R.useState(null),[le,ke]=R.useState(!0),[Se,de]=R.useState(!1),[be,$]=R.useState(!1),[Z,we]=R.useState(y),[Ee,Ke]=R.useState(y);y&&!Ee&&(Ke(!0),we(!0),P(null),T(null),V(null),M([])),!y&&Ee&&Ke(!1);const[Fe,Pe]=R.useState(null),[$e,Le]=R.useState(void 0),[Me,xe]=R.useState([]),[Re,me]=R.useState(0),[ee,F]=R.useState(0),[ae,Q]=R.useState(null),[Ie,he]=R.useState(null),[Qe,un]=R.useState(null),Sa=Ss(),xa=`${d}/${e}/${r}`,zt=Ps({orgSlug:d,virtualMcpId:e,branch:r}),[ya,ba]=R.useState(h),[_a,ja]=R.useState(S),[ka,wa]=R.useState(m);(ya!==h||_a!==S||ka!==m)&&(queueMicrotask(()=>zt.flush()),ba(h),ja(S),wa(m),P(null),T(null),V(null),B(0),E(null),ie(null),F(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Le(void 0),xe([]),me(t=>t+1));const ye=Ts({orgSlug:d,virtualMcpId:e,branch:r}),Nt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ht=As({orgSlug:d,virtualMcpId:e,branch:r}),[_t,Vt]=R.useState(!1),Ut=R.useRef(null),gt=R.useRef(null),vt=R.useRef(null),Gt=R.useRef({}),qe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||D||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Ra=Ms(o),_e=!!m,ze=_e?null:Es(Ra,h,S),j=_e?m:ze?.key??null,Wt=_e&&m?o[m]:void 0,dn=_e&&m&&Wt?Ks(m,Wt):_e&&m?m:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&c&&j&&ze?En(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},c):null,Da=Z?Ct?.seo:void 0,Yt=$e!==void 0?$e:Da,Na=Z?Rr(Yt):void 0,Va=qt?.seoTypeOptions??[],Ca=Z&&c?Dr(c):"",mn=Fe??Na??{},Jt=Z&&qt?Nr(mn,qt):null,Pa=Z&&Jt&&Vr(Yt)?$t(Jt,c):null,Ta=Z?Cr(o,c)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:m}]}]:io(Ct?.sections,o??{}),Pt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Te=Ot(I,o),fn=!_e&&$s(Ct?.sections);if(_e&&m&&Qe!==m){un(m);const t=I[0],a=Te[0];if(t&&a){P(0),F(0),M([]);const s=ut(t,a,o);s&&(T(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),qe.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:f};const Aa=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Bn(j,{multivariate:!0,index:a,variants:t},o,c);_(s.length>0?s:null)},St=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Aa(),p=Bn(j,i,o,c);if(!t||a<0){_(p.length>0?p:null);return}const b=ro({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:c}),x=[...p,...b];_(x.length>0?x:null)},nt=(t,a,s,i=f??-1,p=!1)=>{const b=Je(t,a);if(!b){T(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const C=Vn(b,et)[s];if(!C){T(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const Y=Hs(C.value,o);T(Y?.data??null),V(Y?.resolveType??null);const{resolveType:A,formValue:O}=kt(C.rule,o,c??void 0);he(A),Q(O),p&&St(b,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),F(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),V(s.resolveType)):(T(null),V(null)),he(null),Q(null)}}const Tt={orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:K},Qt=pe&&c?$t(pe,c):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},xt=()=>{P(null),T(null),V(null),F(0),Q(null),he(null),M([]),X(t=>t+1)},Ma=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=p[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const L={...b[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Wn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=L.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),L.sections={...z,variants:U}}else L.sections=ge;ye.mutate({blockKey:x,data:L},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},rn)},Ea=t=>{P(t),F(0),M([]),X(p=>p+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),V(null),he(null),Q(null),St(null,t,0);return}T(i.data),V(i.resolveType),he(null),Q(null),St(null,t,0)},hn=t=>{const a=t;T(a),f!==null&&Ma(a,f)},Xt=t=>{if(!j||!o||!c||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=En(o,a,c);s&&zt.save(j,()=>{const i=Sa.getQueryData(xs.decofile(xa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Gt.current};return Gt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Tr(a,s,p,t.inner):p})},Ka=(t,a)=>{j&&(Gt.current[t]=a,Xt())},$a=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);f!==null&&(f===t?P(a):t<f&&a>=f?P(f-1):t>f&&a<=f&&P(f+1)),Ue(s)},Oa=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);f===t?xt():f!==null&&f>t&&P(f-1),Ue(a)},Ba=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),f!==null&&f>t&&P(f+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},La=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},Ia=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:p,...b}=i.data,x=[...I];s.isLazy?x[t]={...a,section:b}:x[t]=b,f===t&&xt(),Ue(x)},za=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),F(0),M([]),X(x=>x+1);const i=a[s],p=Ot(a,o)[s];if(!i||!p)return;if(p.isMultivariate){nt(i,p,0);return}const b=ut(i,p,o);if(!b){T(null),V(null),he(null),Q(null);return}T(b.data),V(b.resolveType),he(null),Q(null)}})},Ha=t=>{if(f===null)return;const a=I[f],s=Te[f];!a||!s?.isMultivariate||(F(t),M([]),X(i=>i+1),nt(a,s,t,f,!0))},Ua=t=>{if(f===null||!j)return;const a=I[f],s=Te[f];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const p=Js(i,t);if(!p){G.error("Cannot delete the only variant.");return}const b=[...I];b[f]=dt(a,s,p);const x=p.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),F(C),M([]),X(Y=>Y+1),nt(b[f],s,C),Ue(b)},Ga=t=>{if(f===null||!j)return;const a=I[f],s=Te[f];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const p=Qs(i,t),b=[...I];b[f]=dt(a,s,p);const x=t+1;F(x),M([]),X(C=>C+1),nt(b[f],s,x),Ue(b)},Wa=(t,a)=>{if(f===null||!j||t===a)return;const s=I[f],i=Te[f];if(!s||!i?.isMultivariate)return;const p=Je(s,i);if(!p)return;const b=qs(p,t,a),x=[...I];x[f]=dt(s,i,b);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),F(C),nt(x[f],i,C),Ue(x)},Zt=t=>{const a=t??f;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const p=Us(s,i);if(!p){G.error("This section cannot have variants.");return}const b=[...I];b[a]=p.section;const x=Ot(b,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}P(a),F(p.newVariantIndex),M([]),X(C=>C+1),nt(p.section,x,p.newVariantIndex,a),Ue(b)},qa=()=>{if(f===null||!j)return;const t=I[f],a=Te[f];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){G.error("Could not remove variants.");return}const p=[...I];p[f]=i;const b=Ot(p,o)[f];if(!b)return;F(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,b,o);x?(T(x.data),V(x.resolveType)):(T(null),V(null)),St(null,f,0),Ue(p)},Ya=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){G.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const p=ut(s,i,o);if(!p){G.error("This section cannot be saved as global.");return}const b={...p.data,name:t};try{await ye.mutateAsync({blockKey:t,data:b});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),f===Ne&&xt(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Pt&&f===null&&ue===null&&gn){const{resolveType:t,formValue:a}=kt(gn,o??{},c??void 0);ie(t),E(a)}const At=c?Os(c):[],vn=c&&o?Bs(c,o):[],Ja=!_e&&!!(u&&c&&o),Sn=ue&&c?$t(ue,c):null,Mt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},jt=async(t,a)=>{if(!(ar(a,t,c)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p={...s[a]},b={...p.sections},x=[...b.variants??[]],C=x[i],Y=C?.rule;if(mt(Y,s,c)){const A=Y?.__resolveType??"",O=s[A],L=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,L)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),p.sections={...b,variants:x},ye.mutate({blockKey:a,data:p},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},rn)},Qa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Mn};E({}),xn(a)},Xa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Za=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p=s[a],b=p?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=bt(Y.rule,s,c),O=Ft(t);C[i]={...Y,rule:O};const L={...s,[a]:{...p,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=kt(O,L,c??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:L[a]}),A&&A!==t&&await jt(A,L),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(vt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const z=(L.variants??[])[s]?.rule;if(mt(z,b,c)){const fe=z?.__resolveType??"",Ge=b[fe],Xe=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(L,s,t),De=[...i];De[a]=dt(A,O,U);const Ye=wt(b,x,De,Y,C);ye.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},rn))},es=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:Mn})},ts=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ns=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const ge=L.variants??[],z=bt(ge[s]?.rule,b,c),U=Ft(t),De=Pn(L,s,U),Ye=[...i];Ye[a]=dt(A,O,De);const fe=wt(b,x,Ye,Y,C),Ge={...b,[x]:fe},{resolveType:Xe,formValue:rt}=kt(U,Ge,c??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await jt(z,Ge),g?.()}catch(Ze){G.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Wt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=f!==null?Te[f]??null:null,bn=f!==null?I[f]:null,_n=bn&&at?.isMultivariate?Je(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=f!==null&&at!==null,Kt=jn&&(ct||!!(Qt&&se)),as=Kt&&!_e&&at?.isSavedBlock===!0,st=_e||as,ss=_e?dn:at?.label??"",kn=Ie&&c?$t(Ie,c):null,tn=Kt&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],rs=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?rs:st?tn.length>0?tn:[ss]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),V(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const b=p;if(!Array.isArray(b.variants))return;const x=t([...b.variants]);if(!x)return;const C=rr(b,x),Y={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&jt(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},os=t=>{W(null),B(t),P(null),T(null),V(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=kt(a,o??{},c??void 0);ie(s),E(i),pn(Oe.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Rt(Oe.map(p=>({rule:p.rule})),t,a);pn(i,s),nn(p=>Rt(p,t,a))},ls=t=>{const a=Oe[t]?.rule,s=bt(a,o??{},c??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),V(null),M([]),E(null),ie(null)},s)},cs=t=>{nn(a=>or(a,t),()=>{B(t+1),P(null),T(null),V(null),M([]),E(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const p=i[s],b=p.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Vt(!0);try{if(!O){if(!mt(A,i,c)){W(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:Tn(A,i,c)};const fe={...i,[s]:{...p,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await jt(Ye,fe),W(null),g?.();return}const L=An(A,i,c);if(!L){G.error("Could not read this variant's matcher rule.");return}if(L.blockKey){await ye.mutateAsync({blockKey:L.blockKey,data:yt(L.resolveType,L.data,O)}),W(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){G.error(z);return}const U=yt(L.resolveType,L.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,C[t]={...Y,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...p,sections:{...x,variants:C}}}),De=null}catch(Ye){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),Ye}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(L){G.error(L instanceof Error?L.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=p[s];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const ge=L.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Ye=async fe=>{const Ge={...L,variants:fe},Xe=[...i];Xe[s]=dt(A,O,Ge);const rt=wt(b,x,Xe,Y,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...b,[x]:rt}};try{if(!De){if(!mt(U,b,c)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Tn(U,b,c)};const vs=await Ye(Nn);await jt(ot,vs),ne(null),g?.();return}const fe=An(U,b,c);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const Ge=an(De),Xe=sn(Ge,b);if(Xe){G.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),Ze=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Ye(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{xt()},ms=t=>{Pe(t),Xt({inner:t})},fs=t=>{Le(t),Xt({raw:t})},ps=()=>{Pe(null),xe([])},hs=()=>me(t=>t+1),gs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Pe(null),Le(void 0),xe([]),me(s=>s+1),N?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||Kt||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Pt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.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",oo),children:[n.jsx(ha,{rule:Dt(tt.rule,o??{},c??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>gs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(ht,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(lo,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:Ka})}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&j?k(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Yt,innerSeo:mn,defaultResolveType:Ca,seoSchema:Pa,activeResolveType:Jt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Ta,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${f??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:Ha,onRename:ne,onDuplicate:Ga,onDelete:Ua,onRemoveAll:qa,onReorder:Wa,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,c??void 0),currentGlobalKey:bt(Et?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:es,onSelectGlobal:ns}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:kn,value:ae,onChange:ts,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${f??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:c,matchers:At,onSelect:os,onReorder:is,onRename:W,onDuplicate:cs,onDelete:ls,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",_t&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,c??void 0),currentGlobalKey:bt(tt?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:Qa,onSelectGlobal:Za}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:Sn,value:Ce,onChange:Xa,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:c,selectedIndex:f,onSelect:Ea,onReorder:$a,onDelete:Oa,onDuplicate:Ba,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:La,onAddVariant:Zt,onDetach:Ia,onAddSection:()=>de(!0),canAddSection:Ja})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:Ya}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:c,decofile:o,previewBaseUrl:u,onSelect:za}),be&&j&&o&&n.jsx(Is,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx($n,{open:!0,initialName:mt(Oe[re]?.rule,o??{},c??void 0)?Bt(Oe[re]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(Oe[re]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await us(re,t)},onOpenChange:t=>{!t&&!_t&&W(null)}}),q!==null&&n.jsx($n,{open:!0,initialName:mt(lt[q]?.rule,o??{},c??void 0)?Bt(lt[q]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(lt[q]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await ds(q,t)},onOpenChange:t=>{!t&&!_t&&ne(null)}})]})}export{Ql as SectionsEditor};
|
|
1
|
+
import{c as He,r as R,l as Be,j as n,B as Ge,i as zn,p as Ss,t as W,K as xs}from"./index-aNhiPg63.js";import{r as ys,a as bs,s as _s,u as Hn,b as It,K as Un,P as Wn,i as Gn,c as js,d as qn,C as Yn,e as ks,G as ws,V as Rs,f as Jn,g as Rt,D as Qn,h as Xn,S as Zn,v as ea,j as ta,k as Ds,l as Dt,m as mt,n as bt,o as Ns,p as Vs,q as Cs,t as Ps,w as Ts,x as As,y as Ms,z as Es,A as $s,B as Kt,E as Ot,F as Ks,H as ut,I as kt,J as Os,L as Bs,M as Je,N as Vn,O as Fs,Q as Cn,R as Bt,T as Ls,U as an,W as Is,X as et,Y as zs,Z as Hs,_ as Us,$ as Ws,a0 as Gs,a1 as qs,a2 as dt,a3 as Ys,a4 as Js,a5 as Qs,a6 as Pn,a7 as wt,a8 as Xs,a9 as Zs,aa as er,ab as tr,ac as nr,ad as sn,ae as Tn,af as An,ag as yt,ah as Ft,ai as ar,aj as rn,ak as sr,al as rr,am as na,an as Mn,ao as or}from"./index-dT0VnAI1.js";import{t as ir}from"./ChevronDown-qqM0SLXR.js";import{s as aa,n as lr}from"./Loading02-Cp7778Gu.js";import{i as sa}from"./ChevronRight-CpGhiI97.js";import{n as cr}from"./ChevronUp-Dn1vKsEF.js";import{U as ln,P as ra,C as ur,V as dr,W as mr}from"./agent-icon-pZLSDYa_.js";import{i as fr}from"./Globe01-DoBbyUVa.js";import{A as Lt}from"./automation-runs-DJjdDqQF.js";import{T as ft,a as pt,b as ht}from"./tooltip-6XsvbcPm.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-Ck6uCn5n.js";import{I as yr}from"./input-D1rmycTV.js";import{a as oa}from"./Copy01-DNpGGgMd.js";import{b as br}from"./ZoomOut-EBbOVCDp.js";import{i as _r}from"./Settings02-Crk_Uo0T.js";import{s as jr}from"./Eye-CjtO2Q0D.js";import{s as cn}from"./Plus-DDEPCr2D.js";import{s as ia}from"./Trash01-CNFquYeR.js";import{i as kr}from"./Zap-CWLHRo7I.js";import{d as it,a as la,D as ca,c as ua,j as wr}from"./dropdown-menu-BQ3wlJ0e.js";import{r as En,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-DUFGbWn3.js";import{c as Mr}from"./Tool01-iV_f6mkx.js";import{A as Er}from"./add-section-modal-BAzLzMRT.js";import"./SwitchHorizontal01-CPghm9Dm.js";import"./chat-context-OiSfW84L.js";import"./autosend-B_DvBwNT.js";import"./hooks-BLrBhhSc.js";import"./use-mcp-client-Lqn_C3qr.js";import"./constants-B72Xmt_K.js";import"./auth-DBBNrHUP.js";import"./decopilot-sse-pool-Dewrv2vl.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BbQV2eLt.js";import"./use-collections-BmWmVNmA.js";import"./use-ai-providers-Dc83EZFK.js";import"./studio-tools-D7oi6bE7.js";import"./use-decopilot-events-VrcGDptY.js";import"./tab-id-DAJ8K7VA.js";import"./use-organization-settings-BQWFu8nW.js";import"./drawer-vm496Lvi.js";import"./collection-search-DeLY6X9U.js";import"./SearchMd-PQ-iON4O.js";import"./use-mobile-Cmlqgq4k.js";import"./use-mcp-prompts-CMq0xGeM.js";import"./X-QFZbkFZe.js";import"./shell-layout-_1bABYX_.js";import"./avatar-DP-cqOlQ.js";import"./User01-BcAD6NVn.js";import"./Users03-CnkyQOrs.js";import"./SearchLg-ozbODPXv.js";import"./Stars02-D26vPcwS.js";import"./XClose--u79-Ly4.js";import"./CheckCircle-DLd87675.js";import"./FilterLines-D4XPLN7q.js";import"./alert-dialog-BVhND3bB.js";import"./required-auth-layout-D0jQ0aNu.js";import"./use-org-sso-DuScBhpQ.js";import"./ZapSquare-CLhh9YdT.js";import"./Check-CgQMRine.js";import"./Star01-BdaFiyBl.js";import"./Upload01-75JfaDUf.js";import"./AlertCircle-CKIMoBfF.js";import"./form-CYN5fbtc.js";import"./label-B5YHEFF3.js";import"./select-DI8I4WJ8.js";import"./XCircle-DtHOc2ZU.js";import"./tabs-2mklsU70.js";import"./toggle-group-kmPf3ZtQ.js";import"./agent-capabilities-CRvsdn4y.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DA6l3iLZ.js";import"./use-registry-connections-BgcT6Tg3.js";import"./use-connection-C9dMYRKr.js";import"./useInfiniteQuery-Bgk8iFmg.js";import"./use-infinite-scroll-fBdOmO40.js";import"./extract-connection-data-DhBmy0jo.js";import"./card-Csn3UcjD.js";import"./integration-icon-_YMxWoYF.js";import"./collection-tabs-Bfi1Oe5-.js";import"./badge-DlJrSSei.js";import"./textarea-B3v1azqk.js";import"./connection-form-helpers-D-Ov9ZXq.js";import"./authenticate-and-persist-oauth-C9_UmFJ2.js";import"./mcp-oauth-BMDNynvE.js";import"./useSuspenseInfiniteQuery-BMbE48wB.js";import"./Monitor01-B-ZV-YPA.js";import"./connect-desktop-dialog-DD7fudsE.js";import"./select-model-Qgwg9p0u.js";import"./checkbox-xZZhzUrW.js";import"./skeleton-DCphi09W.js";import"./Key01-x8JGAd1M.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DTg9wYL3.js";import"./ArrowUpRight-ChxT--i8.js";import"./Stars01-GnMep6CC.js";import"./command-BMT4cbQ7.js";import"./index-a94DUj3O.js";import"./popover-D8-HA_34.js";import"./index-IL4sxsdP.js";import"./Palette-Bwaj6wi0.js";import"./file-type-icon-CLTaPXWY.js";import"./toolbar-DJ2bDd9i.js";import"./use-debounced-value-C_YfvxPr.js";import"./DotsVertical-D34upRsH.js";import"./LinkExternal01-ChGbs-hB.js";import"./index-BVrD0Vyp.js";import"./LayoutLeft-BFPLHnt_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-ColfGIxe.js";import"./empty-state-CwiE9raz.js";import"./use-mcp-tools-DJDVX4rj.js";import"./types-mKz5cguk.js";import"./use-capability-CMUDs7io.js";import"./tools-list-BvliuRgj.js";import"./switch-DIXEkL5C.js";import"./Play-CnWIOlZ6.js";import"./use-debounced-autosave-D6-KOf5d.js";import"./index-DHeIz23k.js";import"./sidebar-nDhZ0gvC.js";import"./search-input-CorH7XFH.js";import"./github-repo-picker-BBm3pnxe.js";import"./use-navigate-to-agent-BYgcjQkF.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./Users01-mZ0iYiBm.js";import"./use-secrets-CuP78fwS.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-Bi4U8t9-.js";import"./use-org-auth-client-DUy7hwUr.js";import"./index-BeR5pCj_.js";import"./get-initials-D-f_fDFw.js";import"./List-Da7El2Ly.js";import"./format-time-Cy7tTmZp.js";import"./Circle-BoRv3d_d.js";import"./calendar-ByCvKibf.js";import"./toolbar-icon-button-CAENFHZs.js";import"./use-file-configs-GB4olcnE.js";import"./monaco-editor-5bBXjgbR.js";import"./use-automations-B2OHZDtE.js";import"./automation-list-row-CNhEHndD.js";import"./Globe04-BGQQ3Wui.js";import"./HardDrive-CWIHpDtZ.js";import"./Sun-CUQU5tHW.js";import"./Shield01-H38rviWD.js";import"./table-BD-HvLR1.js";import"./use-clock-tick-Bd2FzyOw.js";import"./use-copy-Dkb23eJ2.js";function $r(d){return d.schema?.definitions??d.schema?.$defs??{}}function Kr(d,e){const r=$r(e),l=r[btoa(d)];if(!l)return;let u=typeof l.image=="string"?l.image:void 0;if(!u&&Array.isArray(l.allOf)){const h=l.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),m=r[S];u=typeof m?.image=="string"?m.image:void 0}}if(u?.includes("{{{"))return u}function Or(d,e){if(!e)return;const r=ys(d);if(!r)return;const l=Kr(r.resolveType,e);if(!l)return;const u=bs(l,r.data);if(u)return _s(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Fr="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 $n(d){return Array.from({length:d},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(d){return d.map((e,r)=>({...e,index:r}))}function Lr(d,e){if(e===d.length)return d;if(e<d.length)return da(d.slice(0,e));const r=Array.from({length:e-d.length},(l,u)=>({id:crypto.randomUUID(),index:d.length+u}));return[...d,...r]}function ma(d){const e=He.c(20),{section:r,raw:l,meta:u}=d,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let m;e[0]!==u||e[1]!==l?(m=l&&u?Or(l,u):void 0,e[0]=u,e[1]=l,e[2]=m):m=e[2];const v=m;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let N;e[6]!==S||e[7]!==h?(N=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=N):N=e[8];let k;e[9]!==N?(k=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:N}),e[9]=N,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let w;e[11]!==_?(w=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=w):w=e[12];let o;e[13]!==r.label||e[14]!==w?(o=n.jsx("span",{className:w,children:r.label}),e[13]=r.label,e[14]=w,e[15]=o):o=e[15];let D;return e[16]!==y||e[17]!==k||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,y,k,o]}),e[16]=y,e[17]=k,e[18]=o,e[19]=D):D=e[19],D}function fa(d,e){const r=d.isSavedBlock===!0,l=d.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":r?Br:l?"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 Ir(d){const e=He.c(64),{section:r,raw:l,meta:u,sortableId:h,selected:S,onSelect:m,onDelete:v,onDuplicate:g,onMakeReusable:y,onToggleHidden:N,onToggleLazy:k,onAddVariant:_,onDetach:w}=d,o=l?Gn(l.__resolveType??""):!1;let D;e[0]!==r?(D=js(r),e[0]=r,e[1]=D):D=e[1];const c=D;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:$,setNodeRef:f,transform:P,isDragging:se}=qn(J);let T;e[4]!==P?(T=Yn.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let V;e[6]!==T||e[7]!==pe?(V={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=V):V=e[8];const ce=V;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==m?(E=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),m())},e[11]=m,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==l||e[19]!==r?(je=n.jsx(ma,{section:r,raw:l,meta:u}),e[17]=u,e[18]=l,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),k()},onPointerDown:Wr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(ht,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==N||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:K=>{K.stopPropagation(),N()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(ht,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=N,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(la,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ra,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=K=>{K.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(oa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==c||e[32]!==_?(G=c&&n.jsxs(it,{className:Rs,onClick:K=>{K.stopPropagation(),_()},children:[n.jsx(aa,{className:"h-4 w-4"}),"Add variant"]}),e[31]=c,e[32]=_,e[33]=G):G=e[33];let q;e[34]!==te||e[35]!==y?(q=te&&n.jsxs(it,{className:Fr,onClick:K=>{K.stopPropagation(),y()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=y,e[36]=q):q=e[36];let ne;e[37]!==w||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:K=>{K.stopPropagation(),w()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=w,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=K=>{K.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ia,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(ca,{children:[X,n.jsxs(ua,{align:"end",className:"w-44",children:[re,G,q,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==$||e[54]!==m||e[55]!==f||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:f,style:ce,...H,...$,role:oe,tabIndex:Ce,onClick:m,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=$,e[54]=m,e[55]=f,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(d){return d.stopPropagation()}function Hr(d){return d.stopPropagation()}function Ur(d){return d.stopPropagation()}function Wr(d){return d.stopPropagation()}function Gr(){return!1}function qr(d){const e=He.c(90),{listKey:r,rawSections:l,sections:u,meta:h,selectedIndex:S,onSelect:m,onReorder:v,onDelete:g,onDuplicate:y,onMakeReusable:N,onToggleHidden:k,onToggleLazy:_,onAddVariant:w,onDetach:o,onAddSection:D,canAddSection:c}=d,J=c===void 0?!0:c;let H;e[0]!==u.length?(H=()=>$n(u.length),e[0]=u.length,e[1]=H):H=e[1];const[$,f]=R.useState(H),[P,se]=R.useState(null),[T,pe]=R.useState(r),[V,ce]=R.useState(u.length),B=R.useRef(!1);T!==r?(pe(r),ce(u.length),f($n(u.length))):V!==u.length&&(ce(u.length),f(F=>Lr(F,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Jn},e[3]=oe):oe=e[3];const Ce=Hn(It(Wn,te),It(Un,oe));let E;e[4]!==$?(E=$.map(Yr),e[4]=$,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=F=>{se(String(F.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=F=>{se(null);const{active:ae,over:Q}=F;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(f(Qe=>da(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,K,Z,we,Ee,$e;if(e[11]!==P||e[12]!==J||e[13]!==$||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==w||e[19]!==g||e[20]!==o||e[21]!==y||e[22]!==N||e[23]!==m||e[24]!==k||e[25]!==_||e[26]!==l||e[27]!==u||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const F=ae=>{B.current||m(ae)};if(e[45]!==P||e[46]!==J||e[47]!==$||e[48]!==D||e[49]!==l||e[50]!==u){const ae=P?$.find(Q=>Q.id===P):null;if(q=ae!=null?u[ae.index]:null,G=ae!=null?l[ae.index]:void 0,$.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=J,e[47]=$,e[48]=D,e[49]=l,e[50]=u,e[51]=G,e[52]=q,e[53]=we}else G=e[51],q=e[52],we=e[53];re=Qn,Se=Ce,de=Xn,be=je,K=Ae,Z=Ne,ve=Zn,le=ue,ke=ea,$e="space-y-1",ne=$.map(ae=>{const Q=u[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:l[ae.index],meta:h,selected:S===ae.index,onSelect:()=>F(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>y(ae.index),onMakeReusable:()=>N(ae.index),onToggleHidden:()=>k(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>w(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=J,e[13]=$,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=w,e[19]=g,e[20]=o,e[21]=y,e[22]=N,e[23]=m,e[24]=k,e[25]=_,e[26]=l,e[27]=u,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=K,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=$e}else ve=e[30],re=e[31],G=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],K=e[40],Z=e[41],we=e[42],Ee=e[43],$e=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Fe;e[59]!==ne||e[60]!==$e?(Fe=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Fe):Fe=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Fe?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Fe}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Fe,e[66]=Pe):Pe=e[66];let Ke;e[67]!==G||e[68]!==q||e[69]!==h?(Ke=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:G,meta:h})}):null,e[67]=G,e[68]=q,e[69]=h,e[70]=Ke):Ke=e[70];let Le;e[71]!==Ke?(Le=n.jsx(ta,{dropAnimation:null,children:Ke}),e[71]=Ke,e[72]=Le):Le=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==K||e[78]!==Z||e[79]!==Pe||e[80]!==Le?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:K,onDragCancel:Z,children:[Pe,Le]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=K,e[78]=Z,e[79]=Pe,e[80]=Le,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(d){return d.id}function Kn(d){const e=He.c(38),{open:r,initialName:l,autoLabel:u,isPending:h,onSubmit:S,onOpenChange:m}=d,v=h===void 0?!1:h,[g,y]=R.useState(l),[N,k]=R.useState(r);r!==N&&(k(r),r&&y(l));let _;e[0]!==v||e[1]!==m?(_=oe=>{!oe&&!v&&m(!1)},e[0]=v,e[1]=m,e[2]=_):_=e[2];const w=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(pr,{children:"Rename variant"}),e[7]=c):c=e[7];const J=u||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[c,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let $;e[10]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=$):$=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=oe=>y(oe.target.value),e[11]=f):f=e[11];let P;e[12]!==u||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[$,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:f,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==m?(se=()=>m(!1),e[16]=m,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==T||e[27]!==V?(ce=n.jsxs(vr,{children:[T,V]}),e[26]=T,e[27]=V,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==w||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:w,children:B}),e[34]=w,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="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)]",pa="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 ha(d){const e=He.c(5),{rule:r,matchers:l}=d,u=r?.__resolveType??"";let h;if(e[0]!==l||e[1]!==u){const g=l.find(y=>y.resolveType===u)?.iconName??Ds(u);h=ur(g),e[0]=l,e[1]=u,e[2]=h}else h=e[2];const S=h;if(!S)return null;let m;return e[3]!==S?(m=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=m):m=e[4],m}function On(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function on(d){return d.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(d){return d.map((e,r)=>({...e,index:r}))}function ga(d){const e=He.c(16),{label:r,effectiveRule:l,matchers:u,canDelete:h,dragging:S,onRename:m,onDuplicate:v,onDelete:g}=d;let y;e[0]!==l||e[1]!==u?(y=n.jsx(ha,{rule:l,matchers:u}),e[0]=l,e[1]=u,e[2]=y):y=e[2];let N;e[3]!==r?(N=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=N):N=e[4];let k;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==m?(k=!S&&n.jsxs(ca,{children:[n.jsx(la,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(ra,{size:14})})}),n.jsxs(ua,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:w=>{w.stopPropagation(),m?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:w=>{w.stopPropagation(),v?.()},children:[n.jsx(oa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:w=>{w.stopPropagation(),g?.()},children:[n.jsx(ia,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=m,e[11]=k):k=e[11];let _;return e[12]!==y||e[13]!==N||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[y,N,k]}),e[12]=y,e[13]=N,e[14]=k,e[15]=_):_=e[15],_}function Xr(d){return d.stopPropagation()}function Zr(d){return d.stopPropagation()}function eo(d){const e=He.c(33),{entry:r,sortableId:l,isActive:u,canDelete:h,decofile:S,meta:m,matchers:v,onSelect:g,onRename:y,onDuplicate:N,onDelete:k}=d;let _;e[0]!==l?(_={id:l,animateLayoutChanges:to},e[0]=l,e[1]=_):_=e[1];const{attributes:w,listeners:o,setNodeRef:D,transform:c,isDragging:J}=qn(_);let H;e[2]!==c?(H=Yn.Transform.toString(c?{...c,x:0}:null),e[2]=c,e[3]=H):H=e[3];const $=J?0:void 0;let f;e[4]!==H||e[5]!==$?(f={transform:H,opacity:$},e[4]=H,e[5]=$,e[6]=f):f=e[6];const P=f,se=m??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Dt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let V;e[11]!==g?(V=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=V):V=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=u?pa:Jr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==N||e[22]!==y?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:y,onDuplicate:N,onDelete:k}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=N,e[22]=y,e[23]=oe):oe=e[23];let Ce;return e[24]!==w||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==V?(Ce=n.jsx("div",{ref:D,style:P,...w,...o,onClick:g,onKeyDown:V,className:te,children:oe}),e[24]=w,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=V,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(d){const e=He.c(9),{variant:r,decofile:l,meta:u,matchers:h}=d,S=u??void 0;let m;e[0]!==l||e[1]!==S||e[2]!==r.rule?(m=Dt(r.rule,l,S),e[0]=l,e[1]=S,e[2]=r.rule,e[3]=m):m=e[3];const v=m;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let y;return e[5]!==v||e[6]!==h||e[7]!==r.label?(y=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=y):y=e[8],y}function ao(d){const e=He.c(77),{listKey:r,variants:l,activeIndex:u,decofile:h,meta:S,matchers:m,onSelect:v,onReorder:g,onRename:y,onDuplicate:N,onDelete:k,onAdd:_}=d;let w;e[0]!==l?(w=()=>on(l),e[0]=l,e[1]=w):w=e[1];const[o,D]=R.useState(w),[c,J]=R.useState(null),[H,$]=R.useState(r),[f,P]=R.useState(l.length);let se;e[2]!==l?(se=()=>On(l),e[2]=l,e[3]=se):se=e[3];const[T,pe]=R.useState(se),V=R.useRef(!1),ce=On(l);H!==r?($(r),P(l.length),pe(ce),D(on(l))):f!==l.length?(P(l.length),pe(ce),D(on(l))):T!==ce&&(pe(ce),D(Me=>l.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Jn},e[5]=te):te=e[5];const oe=Hn(It(Wn,B),It(Un,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=l.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(F=>Qr(Rt([...F],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,K,Z,we;if(e[14]!==u||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==m||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==N||e[26]!==y||e[27]!==v||e[28]!==oe){const Me=F=>{V.current||v(F)};K="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(ht,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(ft,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Qn,le=oe,ke=Xn,Se=je,de=Ae,be=Ne,ve=Zn,q=E,ne=ea,we="space-y-0.5",G=o.map(F=>n.jsx(eo,{sortableId:F.id,entry:F,isActive:F.index===u,canDelete:ue,decofile:h,meta:S,matchers:m,onSelect:()=>Me(F.index),onRename:()=>y(F.index),onDuplicate:()=>N(F.index),onDelete:()=>k(F.index)},F.id)),e[14]=u,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=m,e[22]=S,e[23]=_,e[24]=k,e[25]=N,e[26]=y,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=K,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],K=e[39],Z=e[40],we=e[41];let Ee;e[49]!==G||e[50]!==we?(Ee=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ee):Ee=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ee?($e=n.jsx(ve,{items:q,strategy:ne,children:Ee}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ee,e[56]=$e):$e=e[56];let Fe;e[57]!==c||e[58]!==h||e[59]!==m||e[60]!==S?(Fe=c?n.jsx(no,{variant:c.variant,decofile:h,meta:S,matchers:m}):null,e[57]=c,e[58]=h,e[59]=m,e[60]=S,e[61]=Fe):Fe=e[61];let Pe;e[62]!==Fe?(Pe=n.jsx(ta,{dropAnimation:null,children:Fe}),e[62]=Fe,e[63]=Pe):Pe=e[63];let Ke;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Pe?(Ke=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Pe,e[72]=Ke):Ke=e[72];let Le;return e[73]!==K||e[74]!==Z||e[75]!==Ke?(Le=n.jsxs("div",{className:K,children:[Z,Ke]}),e[73]=K,e[74]=Z,e[75]=Ke,e[76]=Le):Le=e[76],Le}function so(d){return d.id}function va({pageKey:d,prefix:e,variants:r,selectedIndex:l,decofile:u,meta:h}){if(!d||l<0||l>=r.length)return[];const S=[];for(let m=0;m<=l;m++){const v=r[m];if(!v)continue;const g=v.rule,y=m===l?"1":"0",k=(mt(g,u,h)?bt(g,u,h):null)??`${d}@${e}.${m}.rule`;S.push(`${k}=${y}`)}return S}function Bn(d,e,r,l){return!e.multivariate||e.variants.length<=1?[]:va({pageKey:d,prefix:"sections.variants",variants:e.variants,selectedIndex:e.index,decofile:r,meta:l})}function ro({pageKey:d,page:e,sectionIndex:r,sectionLazy:l,mvObj:u,selectedVariantIndex:h,decofile:S,meta:m}){if(r<0)return[];const g=`${e.multivariate?`sections.variants.${e.index}.value`:"sections"}.${r}${l?".section":""}.variants`,y=Array.isArray(u.variants)?u.variants:[];return va({pageKey:d,prefix:g,variants:y,selectedIndex:h,decofile:S,meta:m})}function Fn(d){const e=He.c(15),{schema:r,value:l,onChange:u,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}=d;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[y,N]=R.useState(g);let k;e[1]!==y?(k=y.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>N([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(lr,{className:"size-3.5"})}),y.map((o,D)=>{const c=D===y.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>N(y.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",c?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=y,e[2]=k):k=e[2];let _;e[3]!==y||e[4]!==S||e[5]!==h||e[6]!==u||e[7]!==m||e[8]!==v||e[9]!==r||e[10]!==l?(_=n.jsx(na,{schema:r,value:l,onChange:u,basePath:"",breadcrumbPath:y,onBreadcrumbChange:N,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}),e[3]=y,e[4]=S,e[5]=h,e[6]=u,e[7]=m,e[8]=v,e[9]=r,e[10]=l,e[11]=_):_=e[11];let w;return e[12]!==k||e[13]!==_?(w=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=w):w=e[14],w}function Ln(d){const e=He.c(21),{activeSchema:r,formValue:l,formResetKey:u,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:m,emptyMessage:v,beforeForm:g,seoResolveType:y,siteDefaultSeo:N,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o}=d;let D;e[0]!==m?(D=m===void 0?[]:m,e[0]=m,e[1]=D):D=e[1];const c=D;let J;e[2]!==r||e[3]!==c||e[4]!==_||e[5]!==u||e[6]!==l||e[7]!==k||e[8]!==S||e[9]!==h||e[10]!==w||e[11]!==o||e[12]!==y||e[13]!==N?(J=r&&l?y?n.jsx(Ar,{schema:r,resolveType:y,value:l,formResetKey:u,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:N}):n.jsx(na,{schema:r,value:l,onChange:h,basePath:"",breadcrumbPath:c,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o},u):null,e[2]=r,e[3]=c,e[4]=_,e[5]=u,e[6]=l,e[7]=k,e[8]=S,e[9]=h,e[10]=w,e[11]=o,e[12]=y,e[13]=N,e[14]=J):J=e[14];const H=J;let $;e[15]!==v||e[16]!==H?($=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=$):$=e[17];let f;return e[18]!==g||e[19]!==$?(f=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,$]})}),e[18]=g,e[19]=$,e[20]=f):f=e[20],f}const oo="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 io(d,e){return zs(d,e,et)}function lo(d){const e=He.c(13),{pageKey:r,initialName:l,initialPath:u,onFieldChange:h}=d,[S,m]=R.useState(l),[v,g]=R.useState(u),[y,N]=R.useState(r);y!==r&&(N(r),m(l),g(u));let k;e[0]!==h?(k=c=>{m(c.target.value),h("name",c.target.value)},e[0]=h,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=k,e[4]=_):_=e[4];let w;e[5]!==h?(w=c=>{g(c.target.value),h("path",c.target.value)},e[5]=h,e[6]=w):w=e[6];let o;e[7]!==v||e[8]!==w?(o=n.jsx("input",{type:"text",value:v,onChange:w,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=w,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(d){const e=He.c(6),{onClick:r}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(aa,{size:14}),e[0]=l):l=e[0];let u;e[1]!==r?(u=n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:l})}),e[1]=r,e[2]=u):u=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ht,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==u?(S=n.jsxs(ft,{children:[u,h]}),e[4]=u,e[5]=S):S=e[5],S}function Ql({orgSlug:d,virtualMcpId:e,branch:r,previewReady:l=!0,previewUrl:u,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:m=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:y=!1,onExitSeo:N,onViewJsonFile:k,onVariantPreviewOverride:_}){const w=l?{orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:D}=Ns(w),{data:c,isLoading:J}=Vs(w),H=Cs(),$=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[f,P]=R.useState(null),[se,T]=R.useState(null),[pe,V]=R.useState(null),[ce,B]=R.useState(0),[te,oe]=R.useState(void 0),[Ce,E]=R.useState(null),[ue,ie]=R.useState(null),[je,M]=R.useState([]),[Ae,X]=R.useState(0),[Ne,ve]=R.useState(null),[re,G]=R.useState(null),[q,ne]=R.useState(null),[le,ke]=R.useState(!0),[Se,de]=R.useState(!1),[be,K]=R.useState(!1),[Z,we]=R.useState(y),[Ee,$e]=R.useState(y);y&&!Ee&&($e(!0),we(!0),P(null),T(null),V(null),M([])),!y&&Ee&&$e(!1);const[Fe,Pe]=R.useState(null),[Ke,Le]=R.useState(void 0),[Me,xe]=R.useState([]),[Re,me]=R.useState(0),[ee,F]=R.useState(0),[ae,Q]=R.useState(null),[Ie,he]=R.useState(null),[Qe,un]=R.useState(null),Sa=Ss(),xa=`${d}/${e}/${r}`,zt=Ps({orgSlug:d,virtualMcpId:e,branch:r}),[ya,ba]=R.useState(h),[_a,ja]=R.useState(S),[ka,wa]=R.useState(m);(ya!==h||_a!==S||ka!==m)&&(queueMicrotask(()=>zt.flush()),ba(h),ja(S),wa(m),P(null),T(null),V(null),B(0),E(null),ie(null),F(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Le(void 0),xe([]),me(t=>t+1));const ye=Ts({orgSlug:d,virtualMcpId:e,branch:r}),Nt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ht=As({orgSlug:d,virtualMcpId:e,branch:r}),[_t,Vt]=R.useState(!1),Ut=R.useRef(null),gt=R.useRef(null),vt=R.useRef(null),Wt=R.useRef({}),qe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||D||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Ra=Ms(o),_e=!!m,ze=_e?null:Es(Ra,h,S),j=_e?m:ze?.key??null,Gt=_e&&m?o[m]:void 0,dn=_e&&m&&Gt?$s(m,Gt):_e&&m?m:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&c&&j&&ze?En(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},c):null,Da=Z?Ct?.seo:void 0,Yt=Ke!==void 0?Ke:Da,Na=Z?Rr(Yt):void 0,Va=qt?.seoTypeOptions??[],Ca=Z&&c?Dr(c):"",mn=Fe??Na??{},Jt=Z&&qt?Nr(mn,qt):null,Pa=Z&&Jt&&Vr(Yt)?Kt(Jt,c):null,Ta=Z?Cr(o,c)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:m}]}]:io(Ct?.sections,o??{}),Pt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Te=Ot(I,o),fn=!_e&&Ks(Ct?.sections);if(_e&&m&&Qe!==m){un(m);const t=I[0],a=Te[0];if(t&&a){P(0),F(0),M([]);const s=ut(t,a,o);s&&(T(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),qe.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:f};const Aa=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Bn(j,{multivariate:!0,index:a,variants:t},o,c);_(s.length>0?s:null)},St=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Aa(),p=Bn(j,i,o,c);if(!t||a<0){_(p.length>0?p:null);return}const b=ro({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:c}),x=[...p,...b];_(x.length>0?x:null)},nt=(t,a,s,i=f??-1,p=!1)=>{const b=Je(t,a);if(!b){T(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const C=Vn(b,et)[s];if(!C){T(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const Y=Hs(C.value,o);T(Y?.data??null),V(Y?.resolveType??null);const{resolveType:A,formValue:O}=kt(C.rule,o,c??void 0);he(A),Q(O),p&&St(b,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),F(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),V(s.resolveType)):(T(null),V(null)),he(null),Q(null)}}const Tt={orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:$},Qt=pe&&c?Kt(pe,c):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},xt=()=>{P(null),T(null),V(null),F(0),Q(null),he(null),M([]),X(t=>t+1)},Ma=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=p[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const L={...b[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Gn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=L.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),L.sections={...z,variants:U}}else L.sections=ge;ye.mutate({blockKey:x,data:L},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},rn)},Ea=t=>{P(t),F(0),M([]),X(p=>p+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),V(null),he(null),Q(null),St(null,t,0);return}T(i.data),V(i.resolveType),he(null),Q(null),St(null,t,0)},hn=t=>{const a=t;T(a),f!==null&&Ma(a,f)},Xt=t=>{if(!j||!o||!c||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=En(o,a,c);s&&zt.save(j,()=>{const i=Sa.getQueryData(xs.decofile(xa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Tr(a,s,p,t.inner):p})},$a=(t,a)=>{j&&(Wt.current[t]=a,Xt())},Ka=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);f!==null&&(f===t?P(a):t<f&&a>=f?P(f-1):t>f&&a<=f&&P(f+1)),Ue(s)},Oa=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);f===t?xt():f!==null&&f>t&&P(f-1),Ue(a)},Ba=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),f!==null&&f>t&&P(f+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},La=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},Ia=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:p,...b}=i.data,x=[...I];s.isLazy?x[t]={...a,section:b}:x[t]=b,f===t&&xt(),Ue(x)},za=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),F(0),M([]),X(x=>x+1);const i=a[s],p=Ot(a,o)[s];if(!i||!p)return;if(p.isMultivariate){nt(i,p,0);return}const b=ut(i,p,o);if(!b){T(null),V(null),he(null),Q(null);return}T(b.data),V(b.resolveType),he(null),Q(null)}})},Ha=t=>{if(f===null)return;const a=I[f],s=Te[f];!a||!s?.isMultivariate||(F(t),M([]),X(i=>i+1),nt(a,s,t,f,!0))},Ua=t=>{if(f===null||!j)return;const a=I[f],s=Te[f];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const p=Js(i,t);if(!p){W.error("Cannot delete the only variant.");return}const b=[...I];b[f]=dt(a,s,p);const x=p.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),F(C),M([]),X(Y=>Y+1),nt(b[f],s,C),Ue(b)},Wa=t=>{if(f===null||!j)return;const a=I[f],s=Te[f];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const p=Qs(i,t),b=[...I];b[f]=dt(a,s,p);const x=t+1;F(x),M([]),X(C=>C+1),nt(b[f],s,x),Ue(b)},Ga=(t,a)=>{if(f===null||!j||t===a)return;const s=I[f],i=Te[f];if(!s||!i?.isMultivariate)return;const p=Je(s,i);if(!p)return;const b=qs(p,t,a),x=[...I];x[f]=dt(s,i,b);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),F(C),nt(x[f],i,C),Ue(x)},Zt=t=>{const a=t??f;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const p=Us(s,i);if(!p){W.error("This section cannot have variants.");return}const b=[...I];b[a]=p.section;const x=Ot(b,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),F(p.newVariantIndex),M([]),X(C=>C+1),nt(p.section,x,p.newVariantIndex,a),Ue(b)},qa=()=>{if(f===null||!j)return;const t=I[f],a=Te[f];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){W.error("Could not remove variants.");return}const p=[...I];p[f]=i;const b=Ot(p,o)[f];if(!b)return;F(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,b,o);x?(T(x.data),V(x.resolveType)):(T(null),V(null)),St(null,f,0),Ue(p)},Ya=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const p=ut(s,i,o);if(!p){W.error("This section cannot be saved as global.");return}const b={...p.data,name:t};try{await ye.mutateAsync({blockKey:t,data:b});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),f===Ne&&xt(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Pt&&f===null&&ue===null&&gn){const{resolveType:t,formValue:a}=kt(gn,o??{},c??void 0);ie(t),E(a)}const At=c?Os(c):[],vn=c&&o?Bs(c,o):[],Ja=!_e&&!!(u&&c&&o),Sn=ue&&c?Kt(ue,c):null,Mt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},jt=async(t,a)=>{if(!(ar(a,t,c)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p={...s[a]},b={...p.sections},x=[...b.variants??[]],C=x[i],Y=C?.rule;if(mt(Y,s,c)){const A=Y?.__resolveType??"",O=s[A],L=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,L)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),p.sections={...b,variants:x},ye.mutate({blockKey:a,data:p},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},rn)},Qa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Mn};E({}),xn(a)},Xa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Za=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p=s[a],b=p?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=bt(Y.rule,s,c),O=Ft(t);C[i]={...Y,rule:O};const L={...s,[a]:{...p,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=kt(O,L,c??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:L[a]}),A&&A!==t&&await jt(A,L),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(vt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const z=(L.variants??[])[s]?.rule;if(mt(z,b,c)){const fe=z?.__resolveType??"",We=b[fe],Xe=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Pn(L,s,t),De=[...i];De[a]=dt(A,O,U);const Ye=wt(b,x,De,Y,C);ye.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},rn))},es=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:Mn})},ts=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ns=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const ge=L.variants??[],z=bt(ge[s]?.rule,b,c),U=Ft(t),De=Pn(L,s,U),Ye=[...i];Ye[a]=dt(A,O,De);const fe=wt(b,x,Ye,Y,C),We={...b,[x]:fe},{resolveType:Xe,formValue:rt}=kt(U,We,c??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await jt(z,We),g?.()}catch(Ze){W.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Gt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=f!==null?Te[f]??null:null,bn=f!==null?I[f]:null,_n=bn&&at?.isMultivariate?Je(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=f!==null&&at!==null,$t=jn&&(ct||!!(Qt&&se)),as=$t&&!_e&&at?.isSavedBlock===!0,st=_e||as,ss=_e?dn:at?.label??"",kn=Ie&&c?Kt(Ie,c):null,tn=$t&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],rs=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?rs:st?tn.length>0?tn:[ss]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Ws(t.sections,I);if(!a)return;const s=Gs(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),V(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const b=p;if(!Array.isArray(b.variants))return;const x=t([...b.variants]);if(!x)return;const C=rr(b,x),Y={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&jt(s,Y)},onError:A=>W.error(`Save failed: ${A.message}`)})},os=t=>{G(null),B(t),P(null),T(null),V(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=kt(a,o??{},c??void 0);ie(s),E(i),pn(Oe.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Rt(Oe.map(p=>({rule:p.rule})),t,a);pn(i,s),nn(p=>Rt(p,t,a))},ls=t=>{const a=Oe[t]?.rule,s=bt(a,o??{},c??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),V(null),M([]),E(null),ie(null)},s)},cs=t=>{nn(a=>or(a,t),()=>{B(t+1),P(null),T(null),V(null),M([]),E(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const p=i[s],b=p.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Vt(!0);try{if(!O){if(!mt(A,i,c)){G(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:Tn(A,i,c)};const fe={...i,[s]:{...p,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await jt(Ye,fe),G(null),g?.();return}const L=An(A,i,c);if(!L){W.error("Could not read this variant's matcher rule.");return}if(L.blockKey){await ye.mutateAsync({blockKey:L.blockKey,data:yt(L.resolveType,L.data,O)}),G(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){W.error(z);return}const U=yt(L.resolveType,L.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,C[t]={...Y,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...p,sections:{...x,variants:C}}}),De=null}catch(Ye){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),Ye}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(L){W.error(L instanceof Error?L.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=p[s];if(!A||!O?.isMultivariate)return;const L=Je(A,O);if(!L)return;const ge=L.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Ye=async fe=>{const We={...L,variants:fe},Xe=[...i];Xe[s]=dt(A,O,We);const rt=wt(b,x,Xe,Y,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...b,[x]:rt}};try{if(!De){if(!mt(U,b,c)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Tn(U,b,c)};const vs=await Ye(Nn);await jt(ot,vs),ne(null),g?.();return}const fe=An(U,b,c);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=an(De),Xe=sn(We,b);if(Xe){W.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:We,data:rt}),Ze=We;const ot=[...ge];ot[t]={...z,rule:Ft(We)},await Ye(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{xt()},ms=t=>{Pe(t),Xt({inner:t})},fs=t=>{Le(t),Xt({raw:t})},ps=()=>{Pe(null),xe([])},hs=()=>me(t=>t+1),gs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Pe(null),Le(void 0),xe([]),me(s=>s+1),N?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||$t||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Pt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.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",oo),children:[n.jsx(ha,{rule:Dt(tt.rule,o??{},c??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>gs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(ht,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(lo,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&j?k(j):K(!0),children:n.jsx(mr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Yt,innerSeo:mn,defaultResolveType:Ca,seoSchema:Pa,activeResolveType:Jt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Ta,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):$t?n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${f??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:Ha,onRename:ne,onDuplicate:Wa,onDelete:Ua,onRemoveAll:qa,onReorder:Ga,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,c??void 0),currentGlobalKey:bt(Et?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:es,onSelectGlobal:ns}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:kn,value:ae,onChange:ts,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${f??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:c,matchers:At,onSelect:os,onReorder:is,onRename:G,onDuplicate:cs,onDelete:ls,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",_t&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,c??void 0),currentGlobalKey:bt(tt?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:Qa,onSelectGlobal:Za}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:Sn,value:Ce,onChange:Xa,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:c,selectedIndex:f,onSelect:Ea,onReorder:Ka,onDelete:Oa,onDuplicate:Ba,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:La,onAddVariant:Zt,onDetach:Ia,onAddSection:()=>de(!0),canAddSection:Ja})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:Ya}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:c,decofile:o,previewBaseUrl:u,onSelect:za}),be&&j&&o&&n.jsx(Is,{open:be,onOpenChange:K,pageKey:j,decofile:o}),re!==null&&n.jsx(Kn,{open:!0,initialName:mt(Oe[re]?.rule,o??{},c??void 0)?Bt(Oe[re]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(Oe[re]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await us(re,t)},onOpenChange:t=>{!t&&!_t&&G(null)}}),q!==null&&n.jsx(Kn,{open:!0,initialName:mt(lt[q]?.rule,o??{},c??void 0)?Bt(lt[q]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(lt[q]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await ds(q,t)},onOpenChange:t=>{!t&&!_t&&ne(null)}})]})}export{Ql as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,aR as nt,aP as Pe,j as d,dy as rt,aT as be,aQ as k,dz as st,aM as j,aS as N,bI as $,dv as lt,ap as _e,dA as Ee,aN as at,bE as it,bK as ct,dC as dt,dF as ut,dD as pt,dG as ft,dw as mt,aO as ht,dE as vt,dx as gt,dB as xt,c as ee,l as oe}from"./index-N9_ZF8cE.js";import{V as St}from"./tooltip-DyTNjtAQ.js";import{i as wt}from"./Check-B16xJXjE.js";import{t as Re}from"./ChevronDown-CcTWKRPg.js";import{n as Ct}from"./ChevronUp-BCHrnAh6.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"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=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[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,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const 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(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=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,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}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[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=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=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]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.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=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===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(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(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=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(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-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(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=_.top+_.height/2-A,ie=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(ie,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,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper: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=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.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:c.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:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...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=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const 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:i,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=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,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let 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,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{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(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{mo as S,uo as a,ho as b,fo as c,po as d,Ne as e};
|
|
1
|
+
import{r as c,aR as nt,aP as Pe,j as d,dy as rt,aT as be,aQ as k,dz as st,aM as j,aS as N,bI as $,dv as lt,ap as _e,dA as Ee,aN as at,bE as it,bK as ct,dC as dt,dF as ut,dD as pt,dG as ft,dw as mt,aO as ht,dE as vt,dx as gt,dB as xt,c as ee,l as oe}from"./index-aNhiPg63.js";import{V as St}from"./tooltip-6XsvbcPm.js";import{i as wt}from"./Check-CgQMRine.js";import{t as Re}from"./ChevronDown-qqM0SLXR.js";import{n as Ct}from"./ChevronUp-Dn1vKsEF.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"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=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[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,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const 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(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=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,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}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[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=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=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]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.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=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===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(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(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=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(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-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(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=_.top+_.height/2-A,ie=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(ie,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,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper: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=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.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:c.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:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...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=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const 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:i,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=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,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let 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,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{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(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{mo as S,uo as a,ho as b,fo as c,po as d,Ne as e};
|