decocms 4.319.7 → 4.319.9
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-RmDfWWB1.js → AlertCircle-Cbfze2vA.js} +1 -1
- package/dist/client/assets/{AreaChart-Bxq_kLgD.js → AreaChart-ESWfdZrx.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BNGHL2is.js → ArrowLeft-sTRXJKw4.js} +1 -1
- package/dist/client/assets/{ArrowUp-CCCG4uD8.js → ArrowUp-Ck_S8UXb.js} +1 -1
- package/dist/client/assets/{Check-CMcrSGq4.js → Check-BSrzKRPt.js} +1 -1
- package/dist/client/assets/{CheckCircle-BZ_VJF1Y.js → CheckCircle-DyLCcRg7.js} +1 -1
- package/dist/client/assets/{ChevronDown-CjoGJTaF.js → ChevronDown-DS4KDE95.js} +1 -1
- package/dist/client/assets/{ChevronRight-DLfQb7o8.js → ChevronRight-HiBK7iT4.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BmYKo6f0.js → ChevronSelectorVertical-CfYYUsnO.js} +1 -1
- package/dist/client/assets/{ChevronUp--L2cn8UF.js → ChevronUp-DBNo7toe.js} +1 -1
- package/dist/client/assets/{Copy01-t2OLtrnB.js → Copy01-cV8y7I27.js} +1 -1
- package/dist/client/assets/{CreditCard01-BSCxoB6N.js → CreditCard01-D2p53cnj.js} +1 -1
- package/dist/client/assets/{DotsVertical-DmeUsVvJ.js → DotsVertical-Cn-HQJLl.js} +1 -1
- package/dist/client/assets/{Download01-CYAg8W5B.js → Download01-DKxxD2lG.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BLm7jjwY.js → ErrorBarContext-CjrL28Ly.js} +1 -1
- package/dist/client/assets/{Eye-Dy7Gk0Xt.js → Eye-CFsMHhc3.js} +1 -1
- package/dist/client/assets/{FilterLines-CsGLiybF.js → FilterLines-CY-R2Pgs.js} +1 -1
- package/dist/client/assets/{GitBranch01-BTXEMA0k.js → GitBranch01-gzbYsobG.js} +1 -1
- package/dist/client/assets/{Globe01-D2SWA6aV.js → Globe01-wsmSifpz.js} +1 -1
- package/dist/client/assets/{Globe04-CY5sEEdx.js → Globe04-BbtNoerk.js} +1 -1
- package/dist/client/assets/{HardDrive-Cfo2QjQ1.js → HardDrive-B2Kmw_-U.js} +1 -1
- package/dist/client/assets/{Image01-Bk-NSMSs.js → Image01-4ZjVZeII.js} +1 -1
- package/dist/client/assets/{Key01--XvWEe9Q.js → Key01-BGSob3xF.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DXIJl-2q.js → LinkExternal01-DgCDtWFz.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-Bey4SIAd.js → LockUnlocked01-DPANpO_w.js} +1 -1
- package/dist/client/assets/{LogOut01-nae5zUB9.js → LogOut01-y1fQHOm-.js} +1 -1
- package/dist/client/assets/{Monitor01-D0uHbg8n.js → Monitor01-DZQMQTQG.js} +1 -1
- package/dist/client/assets/{Package-CZZ4PusZ.js → Package-FFc5eynf.js} +1 -1
- package/dist/client/assets/{Palette-Bm8uQz-a.js → Palette-_BVhH0qL.js} +1 -1
- package/dist/client/assets/{Play-BDHx6xUV.js → Play-mDAbVXyx.js} +1 -1
- package/dist/client/assets/{Plus-DsbRnoOt.js → Plus-DuwKEMqs.js} +1 -1
- package/dist/client/assets/{SearchLg-B7JpdJS1.js → SearchLg-BWCvW3vV.js} +1 -1
- package/dist/client/assets/{SearchMd-Vz_-9QqS.js → SearchMd-BNMN35l9.js} +1 -1
- package/dist/client/assets/{Sector-BFUoUHo2.js → Sector-Ci4Ux-xI.js} +1 -1
- package/dist/client/assets/{Settings02-5XByl1dU.js → Settings02-BdKfdvdO.js} +1 -1
- package/dist/client/assets/{Share07-CY9TyDW3.js → Share07-DgnKCkn5.js} +1 -1
- package/dist/client/assets/{Shield01-JyKrsX11.js → Shield01-CRyZWHgQ.js} +1 -1
- package/dist/client/assets/{Stars01-BzZ30BuE.js → Stars01-CqIitG82.js} +1 -1
- package/dist/client/assets/{Stars02-Du35s2ko.js → Stars02-C5vVPVXG.js} +1 -1
- package/dist/client/assets/{Sun-DTzMPtU4.js → Sun-B_wiAXGd.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CzXRCyWz.js → SwitchHorizontal01-BSS5u6hh.js} +1 -1
- package/dist/client/assets/{Tool01-DIVRpFEj.js → Tool01-kD_St_C1.js} +1 -1
- package/dist/client/assets/{Tool02-36UedhX_.js → Tool02-C4Mhmh2n.js} +1 -1
- package/dist/client/assets/{Trash01-BkZOPZ1F.js → Trash01-BQ7TqJow.js} +1 -1
- package/dist/client/assets/{TrendUp01-BPrRs2GV.js → TrendUp01-Dmxvc_8Y.js} +1 -1
- package/dist/client/assets/{Upload01-lJGqMu88.js → Upload01-BUUJWF9q.js} +1 -1
- package/dist/client/assets/{User01-kVN08-rP.js → User01-6GEEYLNL.js} +1 -1
- package/dist/client/assets/{UserSquare-B4nTC6Up.js → UserSquare-B1QhMNkc.js} +1 -1
- package/dist/client/assets/{Users01-BKIaNyuX.js → Users01-D3492jop.js} +1 -1
- package/dist/client/assets/{Users03-DxMpuryd.js → Users03-C-fPfgy4.js} +1 -1
- package/dist/client/assets/{XCircle-BiAG3_o-.js → XCircle-BR9peTMp.js} +1 -1
- package/dist/client/assets/{XClose-Dy9_68Fl.js → XClose-CId8Q3oo.js} +1 -1
- package/dist/client/assets/{YAxis-Bn1sD-jh.js → YAxis-D1yzoPbg.js} +1 -1
- package/dist/client/assets/{Zap-bTmIcWrz.js → Zap-C81otJUu.js} +1 -1
- package/dist/client/assets/{ZapSquare-DQpxhOTW.js → ZapSquare-DafqFLME.js} +1 -1
- package/dist/client/assets/{ZoomOut-wNrKwTvt.js → ZoomOut-A4Edr_rF.js} +1 -1
- package/dist/client/assets/{access-gate-CSvwSPbV.js → access-gate-b5TlHoe3.js} +1 -1
- package/dist/client/assets/{agent-icon-BVZRzxwR.js → agent-icon-patNN3F9.js} +1 -1
- package/dist/client/assets/agents-list-CYdT80sf.js +1 -0
- package/dist/client/assets/{ai-providers-wRTjY-9I.js → ai-providers-BwuVzE7K.js} +1 -1
- package/dist/client/assets/{alert-H1NhcHHV.js → alert-BBHy--nB.js} +1 -1
- package/dist/client/assets/{alert-dialog-L0qx6i6s.js → alert-dialog-B0BRtAnp.js} +1 -1
- package/dist/client/assets/{analytics-tab-DX_oRkmZ.js → analytics-tab-ypQ97HlI.js} +1 -1
- package/dist/client/assets/{api-keys-D6oQ-S2x.js → api-keys-Cgz1SOLn.js} +1 -1
- package/dist/client/assets/app-editor-lRxxGwYD.js +1 -0
- package/dist/client/assets/{auth-DlWrMWjY.js → auth-Di--WQHJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-D0xCfSsC.js → auth-catchall-Cxvoz1wY.js} +1 -1
- package/dist/client/assets/{auth-entry-t33i1B3q.js → auth-entry-JjGry1jW.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DlFk6Di3.js → auth-split-layout-D5KuCOy0.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-woXc6jrT.js → authenticate-and-persist-oauth-CjESgZgI.js} +1 -1
- package/dist/client/assets/{automation-list-row-DG5dUHEh.js → automation-list-row-1Zs7zFIm.js} +1 -1
- package/dist/client/assets/{automation-runs-B1QvBcUO.js → automation-runs-BnvqbNbI.js} +1 -1
- package/dist/client/assets/{automations-3xUqxF1a.js → automations-BgsL-M5q.js} +1 -1
- package/dist/client/assets/{avatar-CrpmBG4U.js → avatar-DpXC79Fw.js} +1 -1
- package/dist/client/assets/{badge-o9MTCHXi.js → badge-mutKhjD6.js} +1 -1
- package/dist/client/assets/{block-document-DTaaYlQh.js → block-document-BNyDHxm6.js} +1 -1
- package/dist/client/assets/{breadcrumb-DdX6SJH1.js → breadcrumb-TFEAIiKj.js} +1 -1
- package/dist/client/assets/{buckets-BbyLFsrZ.js → buckets-CJTbBrrA.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-D1KbF1yy.js → bulk-category-panel-B59puZE1.js} +1 -1
- package/dist/client/assets/{capability-load-error-D1mAZ573.js → capability-load-error-DW5RgyIb.js} +1 -1
- package/dist/client/assets/{cards-Cgj3-S7j.js → cards-B_0ClWxN.js} +1 -1
- package/dist/client/assets/category-editor-D_rSR82G.js +1 -0
- package/dist/client/assets/{cdn-tab-B3bXac4Z.js → cdn-tab-DfZZi1_D.js} +1 -1
- package/dist/client/assets/{chart-6BEeqhn8.js → chart-DsuJR6l_.js} +1 -1
- package/dist/client/assets/{chat-context-D_yTO8Wi.js → chat-context-DdSuZE3w.js} +1 -1
- package/dist/client/assets/{checkbox-COXniVrf.js → checkbox-BlKIO9QJ.js} +1 -1
- package/dist/client/assets/{choose-editor-DJllq4xP.js → choose-editor-CyA_vGg2.js} +1 -1
- package/dist/client/assets/{cli-auth-success-uegggAWH.js → cli-auth-success-BCjskaVH.js} +1 -1
- package/dist/client/assets/collection-detail-D2PAk6Qd.js +1 -0
- package/dist/client/assets/{collection-display-button-8NzhICbK.js → collection-display-button-uov2GUqF.js} +1 -1
- package/dist/client/assets/{collection-search-CVaeQHld.js → collection-search-DpMT1vYf.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BdDifBik.js → collection-table-wrapper-etwMAVIq.js} +1 -1
- package/dist/client/assets/{collection-tabs-mVsENYKi.js → collection-tabs-6TyH3ybi.js} +1 -1
- package/dist/client/assets/{command-CDjRpAST.js → command-0A8TicqW.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DlZzl8Qx.js +1 -0
- package/dist/client/assets/{config-DbZZ6yr6.js → config-FZs5m7aB.js} +1 -1
- package/dist/client/assets/{connect-DkqLe0-y.js → connect-D1Az22LS.js} +1 -1
- package/dist/client/assets/{connection-CumhSPUp.js → connection-BOKd-Vhl.js} +1 -1
- package/dist/client/assets/{connection-card-BTjW1qCi.js → connection-card-C0r2lBXt.js} +1 -1
- package/dist/client/assets/connection-detail-DR0uEKCM.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DVafqfi_.js → connection-form-helpers-Cx0hSG8H.js} +1 -1
- package/dist/client/assets/connections-50b_6B2i.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-DZv9gsIL.js → decopilot-sse-pool-BGdXs4q_.js} +1 -1
- package/dist/client/assets/{dialog-CLmeJCvy.js → dialog-CefQc73v.js} +1 -1
- package/dist/client/assets/{domain-settings-DjNxzmaZ.js → domain-settings-f40JEWNa.js} +1 -1
- package/dist/client/assets/{drawer-SLxMT12H.js → drawer-BZ-PaoE1.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Y5klxs5R.js → dropdown-menu-Dmm7Trn3.js} +1 -1
- package/dist/client/assets/{e2e-tab-B1yBl1Xi.js → e2e-tab-CGSRbTy5.js} +1 -1
- package/dist/client/assets/{editor-BWyYvDPl.js → editor-BxhxuLJa.js} +1 -1
- package/dist/client/assets/{empty-state-Bzhb7xfM.js → empty-state-C54Q6sBj.js} +1 -1
- package/dist/client/assets/{empty-state-BVQl3CM1.js → empty-state-mYORqltN.js} +1 -1
- package/dist/client/assets/extract-connection-data-DXnTgJE5.js +1 -0
- package/dist/client/assets/file-explorer-CEisRSg0.js +2 -0
- package/dist/client/assets/{file-type-icon-DKwFQUrg.js → file-type-icon-BFYTEN10.js} +1 -1
- package/dist/client/assets/{folder-icon-CvFZ67nf.js → folder-icon-DD3eiqXL.js} +1 -1
- package/dist/client/assets/{form-BhmieFHl.js → form-CAcKi06k.js} +1 -1
- package/dist/client/assets/{general-DqC7rf9Y.js → general-ChXYwEto.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CPP6CKCn.js → github-repo-picker-C-0rHR-M.js} +1 -1
- package/dist/client/assets/{hooks-Bj6hNUFL.js → hooks-DHadwCKp.js} +1 -1
- package/dist/client/assets/{hosting-tab-BDHy5Zp3.js → hosting-tab-yn6WUggV.js} +1 -1
- package/dist/client/assets/{index-wc_UedlX.js → index-BCzXIVbP.js} +1 -1
- package/dist/client/assets/{index-D459Ldmw.js → index-CIZG7m9-.js} +1 -1
- package/dist/client/assets/{index-ygoeB01B.js → index-CyVZ5lgJ.js} +3 -3
- package/dist/client/assets/{index-YU_r-OSr.js → index-DEVfPJkj.js} +6 -6
- package/dist/client/assets/index-DFf6BmI8.js +1 -0
- package/dist/client/assets/{index-XlZPQyL9.js → index-DfY5ZnY2.js} +1 -1
- package/dist/client/assets/{index-DbRvG53L.js → index-TfAJegqd.js} +1 -1
- package/dist/client/assets/{index-0hzf5p67.js → index-WnatCyEy.js} +1 -1
- package/dist/client/assets/{index-DR-VR2Og.js → index-eiH1IWjN.js} +1 -1
- package/dist/client/assets/{index-redirect-B1ocOC72.js → index-redirect-BJRrlGCr.js} +1 -1
- package/dist/client/assets/{infra-billing-ChM1qbkW.js → infra-billing-x14J2hwN.js} +1 -1
- package/dist/client/assets/{input-BbML9Nmm.js → input-DJ33AwMQ.js} +1 -1
- package/dist/client/assets/{integration-icon-CC4Y31FZ.js → integration-icon-Bp-AVupB.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-KxcqPjYn.js → invite-member-dialog-C1tLDFqS.js} +1 -1
- package/dist/client/assets/{label-BZuUXuoD.js → label-C3nYoz5C.js} +1 -1
- package/dist/client/assets/{layout-DXtLEpjO.js → layout-CWV7yC9D.js} +1 -1
- package/dist/client/assets/{login-CyaM0ub6.js → login-B3u4sQZp.js} +1 -1
- package/dist/client/assets/{markdown-QHOZW3yA.js → markdown-BkQsssiC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DxDxYsmM.js → mcp-oauth-1onT9Dwz.js} +1 -1
- package/dist/client/assets/{members-DI-2x27i.js → members-Dg4YsBhQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-DoVJJbtY.js → monaco-editor-CekVK54D.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-xCIh2mjA.js → monitoring-stats-row-By6Kd2TD.js} +1 -1
- package/dist/client/assets/{multi-select-Dty3beLI.js → multi-select-BtoaMUJz.js} +1 -1
- package/dist/client/assets/{oauth-callback-CHvJCPHa.js → oauth-callback-6tEtW-LM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Cpn6QcNh.js → oauth-callback-ai-provider-MDX175zJ.js} +1 -1
- package/dist/client/assets/{onboarding-X-86Jc55.js → onboarding-4-7USRUz.js} +1 -1
- package/dist/client/assets/{org-layout-DKn-hlKp.js → org-layout-BVuUNoCr.js} +1 -1
- package/dist/client/assets/{organization-choice-CjxXFvze.js → organization-choice-IjHgk-3p.js} +1 -1
- package/dist/client/assets/{orgs-CupGUIPm.js → orgs-tZDlTKNv.js} +1 -1
- package/dist/client/assets/{page-seo-form-CP2pbi7O.js → page-seo-form-Cp6KSuC_.js} +1 -1
- package/dist/client/assets/{popover-Br4XvIdI.js → popover-D55EARay.js} +1 -1
- package/dist/client/assets/post-calendar-BFF6JP7b.js +1 -0
- package/dist/client/assets/post-editor-Bm1hF1x-.js +1 -0
- package/dist/client/assets/{primitives-BdMuLV4E.js → primitives-BrSMCaVk.js} +1 -1
- package/dist/client/assets/{profile-C__08fBx.js → profile-Bhc2V-M8.js} +1 -1
- package/dist/client/assets/project-app-view-DrWz74Sr.js +1 -0
- package/dist/client/assets/{prompts-DFmVumWY.js → prompts-_NVNULaa.js} +1 -1
- package/dist/client/assets/record-editor-rnVyvPSr.js +1 -0
- package/dist/client/assets/redirect-editor-CM_un7BL.js +1 -0
- package/dist/client/assets/registry-B7Kq3HQ7.js +2 -0
- package/dist/client/assets/{registry-layout-Cu0igRoV.js → registry-layout-BrJe1W34.js} +1 -1
- package/dist/client/assets/{reports-Bpt3ASUy.js → reports-CWdoeFlh.js} +1 -1
- package/dist/client/assets/{require-capability-DT5PyiAq.js → require-capability-BwNGmU08.js} +1 -1
- package/dist/client/assets/{required-auth-layout-RI0Rgpr1.js → required-auth-layout-rRB3j86p.js} +1 -1
- package/dist/client/assets/{reset-password-D0d52oKe.js → reset-password-CxGtiwtI.js} +1 -1
- package/dist/client/assets/{review-settings-Bg2mt1WZ.js → review-settings-CWIQgB3U.js} +1 -1
- package/dist/client/assets/{roles-KfXy9nFt.js → roles-DtbJAGmi.js} +1 -1
- package/dist/client/assets/{schema-D1PTLZoj.js → schema-CTX-wtUj.js} +1 -1
- package/dist/client/assets/{scroll-area-ChMFgJZQ.js → scroll-area-BhaZbee4.js} +1 -1
- package/dist/client/assets/{search-input-DhOjZQ9T.js → search-input-CVs6a7cw.js} +1 -1
- package/dist/client/assets/{secrets-CccjUopH.js → secrets-C3f__cCp.js} +1 -1
- package/dist/client/assets/{sections-editor-DPEAPUfu.js → sections-editor-BqhaMUe3.js} +2 -2
- package/dist/client/assets/{select-DB6__ViP.js → select-C8VpiT9w.js} +1 -1
- package/dist/client/assets/{select-model-B_OAB8dw.js → select-model-D1dRIP_D.js} +1 -1
- package/dist/client/assets/{self-tool-result-6JqgkdnQ.js → self-tool-result-C8bZjo2U.js} +1 -1
- package/dist/client/assets/seo-editor-DPQFMo68.js +1 -0
- package/dist/client/assets/{settings-layout-B5EijCfK.js → settings-layout-DNHHSoYV.js} +1 -1
- package/dist/client/assets/{shell-controls-BlQ0AWMv.js → shell-controls-BlgO97pY.js} +1 -1
- package/dist/client/assets/{shell-layout-B4DGPaJE.js → shell-layout-DdASzo_y.js} +1 -1
- package/dist/client/assets/{skill-preview-DG2p4vzB.js → skill-preview-Cux1kH84.js} +1 -1
- package/dist/client/assets/{skills-mEZ4URyq.js → skills-ByWAAiCH.js} +1 -1
- package/dist/client/assets/{spinner-DBih_T6j.js → spinner-BKgquf7Q.js} +1 -1
- package/dist/client/assets/{sso-DwFXfkv9.js → sso-BuMyYnVO.js} +1 -1
- package/dist/client/assets/{store-BXU91Mku.js → store-BvYy-wk5.js} +1 -1
- package/dist/client/assets/store-registry-DTeHXWro.js +2 -0
- package/dist/client/assets/{super-agent-icon-tE09KgxD.js → super-agent-icon-X7k4V5iD.js} +1 -1
- package/dist/client/assets/{switch-BeKb78iP.js → switch-ekFlz4BX.js} +1 -1
- package/dist/client/assets/synced-repos-pwl6TyIr.js +1 -0
- package/dist/client/assets/{table-DJIeRc2m.js → table-DxIpuuMu.js} +1 -1
- package/dist/client/assets/{tabs-C0n0SKSR.js → tabs-Cb3eYxFR.js} +1 -1
- package/dist/client/assets/{task-board-ZkwmcnXT.js → task-board-BR_pi0j4.js} +1 -1
- package/dist/client/assets/{tasks-DGUH4Bcj.js → tasks-1DwMg88n.js} +1 -1
- package/dist/client/assets/{textarea-BEF_54uu.js → textarea-DmjAO8WJ.js} +1 -1
- package/dist/client/assets/{thread-route-z9ruvfsc.js → thread-route-CvQsqsJY.js} +1 -1
- package/dist/client/assets/{toggle-group-Nf1lDiVJ.js → toggle-group-Buj7cwOI.js} +1 -1
- package/dist/client/assets/{toolbar-BzHZwA1O.js → toolbar-T9fNZ5Dm.js} +1 -1
- package/dist/client/assets/{track-CshboNx6.js → track-UqVBrAJT.js} +1 -1
- package/dist/client/assets/{types-Boeh_rGH.js → types-sWp7JVPE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CgeALaZJ.js → use-ai-providers-QUqgpHAI.js} +1 -1
- package/dist/client/assets/{use-api-keys-DWagnGEw.js → use-api-keys-CJDSbqKR.js} +1 -1
- package/dist/client/assets/{use-automations-CuNOck6d.js → use-automations-BFLuZmRd.js} +1 -1
- package/dist/client/assets/{use-autosave-n62BKfNd.js → use-autosave-K_2e8huM.js} +1 -1
- package/dist/client/assets/{use-connection-D85CDmBf.js → use-connection-CklhgwT-.js} +1 -1
- package/dist/client/assets/{use-copy-Du_Yq_Wx.js → use-copy-DXvQhxzo.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BOcvBOg6.js → use-create-virtual-mcp-Bir9un1y.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DfyQADbT.js → use-debounced-autosave-DDM-x_p4.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D-Z6eH8B.js → use-debounced-value-BX1Z2C1S.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-wvDyde03.js → use-decopilot-events-BCpugb4D.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DGZu9hFG.js → use-delete-connection-DXsyiE-F.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bn2Y1twe.js → use-deployment-admin-CpYjp9p_.js} +1 -1
- package/dist/client/assets/{use-destination-route-CQh1Fm5z.js → use-destination-route-C4i1vP71.js} +1 -1
- package/dist/client/assets/{use-file-configs-nRky1k66.js → use-file-configs-C0TVz0AH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cda0QvZZ.js → use-infinite-scroll-DHeyE3Gp.js} +1 -1
- package/dist/client/assets/{use-join-requests-BrgVQ94G.js → use-join-requests-2b4gCXfW.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B6aQHTgp.js → use-mcp-auth-status-CWXW9vhJ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-wCEu91RM.js → use-mcp-client-BiMbFhZA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CVVHK2jc.js → use-mcp-tools-D1SQ9VQp.js} +1 -1
- package/dist/client/assets/{use-members-BBrmjcaS.js → use-members-KzBukpu-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B-SDjYaO.js → use-navigate-to-agent-DMGreR6U.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D1W0MG5J.js → use-org-auth-client-DXJoDvFV.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-B0qMGZPW.js → use-org-repo-syncs-DABsYoTf.js} +1 -1
- package/dist/client/assets/{use-org-sso-e9EjhNog.js → use-org-sso-DvDCIeZJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cbwcb8_N.js → use-organization-roles-CxZxpz25.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B43b0mJm.js → use-organization-settings-DOmendGP.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DXF7icZm.js → use-panel-navigate-5GuF3Xky.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DqnuK1Vj.js → use-registry-connections-D-9Urbos.js} +1 -1
- package/dist/client/assets/{use-secrets-ZlJv-EZ7.js → use-secrets-C_EMCwrS.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Wg7ZnoM0.js → use-section-preview-base-JJaaLUdY.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BDFav8gD.js → use-status-sounds-BvVFIICB.js} +1 -1
- package/dist/client/assets/{use-tags-BhNPXW5M.js → use-tags-CnHiO94-.js} +1 -1
- package/dist/client/assets/{use-view-mode-EyM_CMVf.js → use-view-mode-BT0iEFTU.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-d_rTOrSq.js → use-virtual-mcp-CYMnefxf.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CULS4zh1.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DaZYFkir.js +1 -0
- package/dist/client/assets/{users-CsuaAql7.js → users-BHgxlfhz.js} +1 -1
- package/dist/client/assets/variant-calendar-4jaTpdDv.js +1 -0
- package/dist/client/assets/{view-mode-toggle-bGr20uvR.js → view-mode-toggle-BgXxXgC3.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +488 -488
- package/dist/server/server.js +355 -355
- package/package.json +1 -1
- package/dist/client/assets/agents-list-BLMdeLal.js +0 -1
- package/dist/client/assets/app-editor-NCpgz-kr.js +0 -1
- package/dist/client/assets/category-editor-BAAZA7qC.js +0 -1
- package/dist/client/assets/collection-detail-Br49iGvw.js +0 -1
- package/dist/client/assets/commerce-onboarding-t2DOflkA.js +0 -1
- package/dist/client/assets/connection-detail-bO4cqDJR.js +0 -1
- package/dist/client/assets/connections-BHRXdtIS.js +0 -1
- package/dist/client/assets/extract-connection-data-DBygL9Ff.js +0 -1
- package/dist/client/assets/file-explorer-DKz0ctdn.js +0 -2
- package/dist/client/assets/index-Cg2dMEIi.js +0 -1
- package/dist/client/assets/post-calendar-BJUWUGwv.js +0 -1
- package/dist/client/assets/post-editor-B_DMKQ3f.js +0 -1
- package/dist/client/assets/project-app-view-bhJvbl4o.js +0 -1
- package/dist/client/assets/record-editor-Dwkyd-SD.js +0 -1
- package/dist/client/assets/redirect-editor-BSNKGGdN.js +0 -1
- package/dist/client/assets/registry-69N5svO-.js +0 -2
- package/dist/client/assets/seo-editor-jvVO1ljZ.js +0 -1
- package/dist/client/assets/store-registry-CyB03OSx.js +0 -2
- package/dist/client/assets/synced-repos-CvSG6gCS.js +0 -1
- package/dist/client/assets/useInfiniteQuery-JTsmNGfi.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C_xm246s.js +0 -1
- package/dist/client/assets/variant-calendar-DbKVgad5.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as st,b as Dt,r as R,n as Ue,j as n,aI as Xn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Ca,t as Q,K as Pa}from"./index-ygoeB01B.js";import{b as Ma}from"./chat-context-D_yTO8Wi.js";import{a7 as ts,a8 as La,a9 as Ka,aa as Oa,ab as Ia,ac as ns,N as ss,O as Zt,ad as as,ae as os,P as is,Q as rs,af as ls,ag as Ba,_ as cs,$ as us,ah as Fa,ai as $a,aj as ds,G as za,U as ms,V as Lt,Y as fs,Z as ps,W as gs,a4 as hs,ak as Ha,al as Kt,am as vs,an as Ua,ao as Ga,ap as qa,aq as Wa,ar as Ya,d as Qa,e as Ja,as as Za,at as Xa,au as eo,av as to,aw as On,ax as no,ay as so,az as ao,a2 as qt,aA as oo,aB as io,aC as Wt,aD as ro,aE as bt,aF as Ct,aG as lo,aH as co,aI as nt,aJ as In,aK as uo,g as mo,aL as Bn,aM as fo,aN as po,aO as Pt,aP as Yt,aQ as Fn,aR as go,aS as fn,aT as ho,aU as ht,aV as Et,aW as vo,aX as So,aY as bo,aZ as yo,a_ as xo,a$ as yt,b0 as _o,b1 as jo,b2 as Eo,i as Ro,b3 as $n,b4 as Mt,b5 as zn,b6 as Hn,b7 as wo,b8 as ko,b9 as To,ba as Do,bb as pn,bc as Un,bd as Gn,be as Rt,bf as Qt,bg as qn,bh as Vo,bi as gn,bj as No,bk as Ao,bl as Co,bm as Po,bn as Mo,bo as Lo}from"./index-YU_r-OSr.js";import{t as Ko}from"./ChevronDown-CjoGJTaF.js";import{ad as vn,u as Oo,Q as Ss,z as Io,r as Bo,ak as Fo,o as $o}from"./agent-icon-BVZRzxwR.js";import{i as zo}from"./ChevronRight-DLfQb7o8.js";import{n as Ho}from"./ChevronUp--L2cn8UF.js";import{i as Uo}from"./Globe01-D2SWA6aV.js";import{S as Jt}from"./scroll-area-ChMFgJZQ.js";import{d as Go,h as qo,c as Wo,e as Yo,b as Qo,D as Jo}from"./dialog-CLmeJCvy.js";import{I as Zo}from"./input-BbML9Nmm.js";import{a as bs}from"./Copy01-t2OLtrnB.js";import{i as Xo}from"./Settings02-5XByl1dU.js";import{s as ei}from"./Eye-Dy7Gk0Xt.js";import{s as ti}from"./TrendUp01-BPrRs2GV.js";import{s as Sn}from"./Plus-DsbRnoOt.js";import{s as ys}from"./Trash01-BkZOPZ1F.js";import{i as ni}from"./Zap-bTmIcWrz.js";import{D as xs,a as vt,c as _s,b as js,i as si}from"./dropdown-menu-Y5klxs5R.js";import{a as ai,P as oi,b as ii}from"./page-seo-form-CP2pbi7O.js";import{a as ri}from"./Tool01-DIVRpFEj.js";import{u as li,A as ci}from"./use-section-preview-base-Wg7ZnoM0.js";import"./use-panel-navigate-DXF7icZm.js";import"./use-destination-route-CQh1Fm5z.js";import"./thread-route-z9ruvfsc.js";import"./Check-CMcrSGq4.js";import"./Download01-CYAg8W5B.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Bj6hNUFL.js";import"./use-mcp-client-wCEu91RM.js";import"./auth-DlWrMWjY.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DZv9gsIL.js";import"./task-board-ZkwmcnXT.js";import"./schema-D1PTLZoj.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-d_rTOrSq.js";import"./use-ai-providers-CgeALaZJ.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-wvDyde03.js";import"./use-organization-settings-B43b0mJm.js";import"./ArrowUp-CCCG4uD8.js";import"./automation-runs-B1QvBcUO.js";import"./useInfiniteQuery-JTsmNGfi.js";import"./use-infinite-scroll-Cda0QvZZ.js";import"./use-connection-D85CDmBf.js";import"./table-DJIeRc2m.js";import"./empty-state-Bzhb7xfM.js";import"./use-members-BBrmjcaS.js";import"./use-org-auth-client-D1W0MG5J.js";import"./AlertCircle-RmDfWWB1.js";import"./CheckCircle-BZ_VJF1Y.js";import"./DotsVertical-DmeUsVvJ.js";import"./XCircle-BiAG3_o-.js";import"./use-automations-CuNOck6d.js";import"./useSuspenseInfiniteQuery-C_xm246s.js";import"./avatar-CrpmBG4U.js";import"./User01-kVN08-rP.js";import"./Tool02-36UedhX_.js";import"./Stars01-BzZ30BuE.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Du_Yq_Wx.js";import"./markdown-QHOZW3yA.js";import"./ZoomOut-wNrKwTvt.js";import"./monaco-editor-DoVJJbtY.js";import"./spinner-DBih_T6j.js";import"./editor-BWyYvDPl.js";import"./types-Boeh_rGH.js";import"./XClose-Dy9_68Fl.js";import"./Share07-CY9TyDW3.js";import"./SearchMd-Vz_-9QqS.js";import"./shell-layout-B4DGPaJE.js";import"./Users03-DxMpuryd.js";import"./SearchLg-B7JpdJS1.js";import"./Stars02-Du35s2ko.js";import"./FilterLines-CsGLiybF.js";import"./Monitor01-D0uHbg8n.js";import"./required-auth-layout-RI0Rgpr1.js";import"./use-org-sso-e9EjhNog.js";import"./Image01-Bk-NSMSs.js";import"./LinkExternal01-DXIJl-2q.js";import"./integration-icon-CC4Y31FZ.js";import"./Palette-Bm8uQz-a.js";import"./use-navigate-to-agent-B-SDjYaO.js";import"./github-repo-BpKUwJal.js";import"./chart-6BEeqhn8.js";import"./index-XlZPQyL9.js";import"./AreaChart-Bxq_kLgD.js";import"./form-BhmieFHl.js";import"./label-BZuUXuoD.js";import"./file-type-icon-DKwFQUrg.js";import"./drawer-SLxMT12H.js";import"./collection-search-CVaeQHld.js";import"./use-mcp-tools-CVVHK2jc.js";import"./Upload01-lJGqMu88.js";import"./select-DB6__ViP.js";import"./UserSquare-B4nTC6Up.js";import"./ArrowLeft-BNGHL2is.js";import"./tabs-C0n0SKSR.js";import"./toggle-group-Nf1lDiVJ.js";import"./super-agent-icon-tE09KgxD.js";import"./self-tool-result-6JqgkdnQ.js";import"./alert-dialog-L0qx6i6s.js";import"./extract-connection-data-DBygL9Ff.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-D-Z6eH8B.js";import"./authenticate-and-persist-oauth-woXc6jrT.js";import"./mcp-oauth-DxDxYsmM.js";import"./track-CshboNx6.js";import"./popover-Br4XvIdI.js";import"./toolbar-BzHZwA1O.js";import"./github-repo-picker-CPP6CKCn.js";import"./LockUnlocked01-Bey4SIAd.js";import"./agent-capabilities-BxGDQyCw.js";import"./connection-card-BTjW1qCi.js";import"./use-registry-connections-DqnuK1Vj.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BEF_54uu.js";import"./connection-form-helpers-DVafqfi_.js";import"./collection-tabs-mVsENYKi.js";import"./badge-o9MTCHXi.js";import"./select-model-B_OAB8dw.js";import"./checkbox-COXniVrf.js";import"./ChevronSelectorVertical-BmYKo6f0.js";import"./Key01--XvWEe9Q.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-CvFZ67nf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BDFav8gD.js";import"./ZapSquare-DQpxhOTW.js";import"./skill-preview-DG2p4vzB.js";import"./GitBranch01-BTXEMA0k.js";import"./Package-CZZ4PusZ.js";import"./use-file-configs-nRky1k66.js";import"./site-slug-uya6Wp4-.js";import"./pt-BR-CLy76QW2.js";import"./Play-BDHx6xUV.js";import"./use-debounced-autosave-DfyQADbT.js";import"./search-input-DhOjZQ9T.js";import"./use-mcp-auth-status-B6aQHTgp.js";import"./switch-BeKb78iP.js";import"./Users01-BKIaNyuX.js";import"./use-secrets-ZlJv-EZ7.js";import"./config-DbZZ6yr6.js";import"./Shield01-JyKrsX11.js";import"./command-CDjRpAST.js";import"./index-wc_UedlX.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-DdX6SJH1.js";import"./SwitchHorizontal01-CzXRCyWz.js";import"./use-tags-BhNPXW5M.js";import"./automation-list-row-DG5dUHEh.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-B0qMGZPW.js";import"./cards-Cgj3-S7j.js";import"./CreditCard01-BSCxoB6N.js";import"./Globe04-CY5sEEdx.js";import"./HardDrive-Cfo2QjQ1.js";import"./LogOut01-nae5zUB9.js";import"./Sun-DTzMPtU4.js";function ui(m){return m.schema?.definitions??m.schema?.$defs??{}}function Es(m,e){const o=ui(e),u=o[btoa(m)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(_=>typeof _.$ref=="string")?.$ref;if(typeof x=="string"){const _=o[x.replace("#/definitions/","")];_&&p.push(_)}}return p}function di(m,e){for(const o of Es(m,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function mi(m,e){if(!e)return;const o=ts(m);if(!o)return;const u=di(o.resolveType,e);if(!u)return;const p=La(u,o.data);if(p)return Ka(p)}const fi={escape:Ia};function pi(m,e){for(const o of Es(m,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function gi(m,e){if(!e)return;const o=ts(m);if(o)try{const u=pi(o.resolveType,e);return u&&Oa.render(u,o.data,{},fi).trim()||void 0}catch{return}}const hi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Wn(m){return Array.from({length:m},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Rs(m){return m.map((e,o)=>({...e,index:o}))}function Si(m,e){if(e===m.length)return m;if(e<m.length)return Rs(m.slice(0,e));const o=Array.from({length:e-m.length},(u,p)=>({id:crypto.randomUUID(),index:m.length+p}));return[...m,...o]}function ws(m){const e=st.c(25),{section:o,raw:u,meta:p}=m,x=o.isSavedBlock===!0,_=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?mi(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==_||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!_?gi(u,p):void 0,e[3]=p,e[4]=_,e[5]=u,e[6]=x,e[7]=g):g=e[7];const w=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Oo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let k;e[11]!==_||e[12]!==x?(k=x?{color:za}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=_,e[12]=x,e[13]=k):k=e[13];let c;e[14]!==k?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:k}),e[14]=k,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let E;e[16]!==b?(E=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=E):E=e[17];const l=w??o.label;let T;e[18]!==E||e[19]!==l?(T=n.jsx("span",{className:E,children:l}),e[18]=E,e[19]=l,e[20]=T):T=e[20];let i;return e[21]!==T||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,T]}),e[21]=T,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const bi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",yi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",xi="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(m,e){return Ue("h-7 shrink-0 overflow-hidden",e?bi:m?xi:yi)}function ks(m,e){const o=m.isSavedBlock===!0,u=m.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?hi:u?ds:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _i(m){const e=st.c(89),{section:o,raw:u,meta:p,sortableId:x,selected:_,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:w,onToggleHidden:K,onToggleLazy:M,onAddVariant:k,onDetach:c}=m,b=Dt(),E=u?ls(u.__resolveType??""):!1,l=o.isHidden===!0,T=E||l;let i;e[0]!==o?(i=Ba(o),e[0]=o,e[1]=i):i=e[1];const re=i,H=ns();let J;e[2]!==x?(J={id:x,animateLayoutChanges:ki},e[2]=x,e[3]=J):J=e[3];const{attributes:te,listeners:d,setNodeRef:L,transform:pe,isDragging:A}=cs(J);let ee;e[4]!==pe?(ee=us.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ee):ee=e[5];const D=A?0:void 0;let oe;e[6]!==ee||e[7]!==D?(oe={transform:ee,opacity:D},e[6]=ee,e[7]=D,e[8]=oe):oe=e[8];const U=oe;let ye;e[9]!==o?(ye=Fa(o),e[9]=o,e[10]=ye):ye=e[10];const ge=ye;let we;e[11]!==te||e[12]!==H?(we=H?{}:te,e[11]=te,e[12]=H,e[13]=we):we=e[13];let G;e[14]!==d||e[15]!==H?(G=H?{}:d,e[14]=d,e[15]=H,e[16]=G):G=e[16];let ne;e[17]!==v?(ne=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),v())},e[17]=v,e[18]=ne):ne=e[18];const Ie=A?"cursor-grabbing":"cursor-pointer";let le;e[19]!==o||e[20]!==_||e[21]!==Ie?(le=Ue("touch-none transition-colors",Ie,ks(o,_)),e[19]=o,e[20]=_,e[21]=Ie,e[22]=le):le=e[22];let O;e[23]!==p||e[24]!==u||e[25]!==o?(O=n.jsx(ws,{section:o,raw:u,meta:p}),e[23]=p,e[24]=u,e[25]=o,e[26]=O):O=e[26];let Ge;e[27]!==l||e[28]!==b?(Ge=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[27]=l,e[28]=b,e[29]=Ge):Ge=e[29];let We;e[30]!==K?(We=N=>{N.stopPropagation(),K()},e[30]=K,e[31]=We):We=e[31];let Me;e[32]!==l?(Me=l?n.jsx(Xo,{className:"h-3.5 w-3.5"}):n.jsx(ei,{className:"h-3.5 w-3.5"}),e[32]=l,e[33]=Me):Me=e[33];let xe;e[34]!==l||e[35]!==b?(xe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[34]=l,e[35]=b,e[36]=xe):xe=e[36];let B;e[37]!==xe?(B=n.jsx(Tt,{side:"bottom",children:xe}),e[37]=xe,e[38]=B):B=e[38];const Z=_s,Ne=xs,Ae=!0,ue=tt,Ce="button",ke="ghost",Le="icon";let he;e[39]!==b?(he=b("sectionsEditor.sectionList.sectionActionsMenu"),e[39]=b,e[40]=he):he=e[40];const Be=Ue(hn(T,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let ce;e[41]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[41]=ce):ce=e[41];let _e;e[42]!==ue||e[43]!==H||e[44]!==he||e[45]!==Be?(_e=n.jsx(ue,{type:Ce,variant:ke,size:Le,disabled:H,"aria-label":he,className:Be,onClick:Ei,onPointerDown:ji,children:ce}),e[42]=ue,e[43]=H,e[44]=he,e[45]=Be,e[46]=_e):_e=e[46];let je;e[47]!==Ne||e[48]!==_e?(je=n.jsx(Ne,{asChild:Ae,children:_e}),e[47]=Ne,e[48]=_e,e[49]=je):je=e[49];let de;e[50]!==g?(de=N=>{N.stopPropagation(),g()},e[50]=g,e[51]=de):de=e[51];let q;e[52]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(bs,{className:"h-4 w-4"}),e[52]=q):q=e[52];let Ee;e[53]!==b?(Ee=b("sectionsEditor.sectionList.duplicateMenuItem"),e[53]=b,e[54]=Ee):Ee=e[54];let ve;e[55]!==de||e[56]!==Ee?(ve=n.jsxs(vt,{onClick:de,children:[q,Ee]}),e[55]=de,e[56]=Ee,e[57]=ve):ve=e[57];let se;e[58]!==re||e[59]!==k||e[60]!==b?(se=re&&n.jsxs(vt,{className:$a,onClick:N=>{N.stopPropagation(),k()},children:[n.jsx(ti,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[58]=re,e[59]=k,e[60]=b,e[61]=se):se=e[61];let me;e[62]!==ge||e[63]!==w||e[64]!==b?(me=ge&&n.jsxs(vt,{className:vi,onClick:N=>{N.stopPropagation(),w()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[62]=ge,e[63]=w,e[64]=b,e[65]=me):me=e[65];let ie;e[66]!==c||e[67]!==o.isMultivariate||e[68]!==o.isSavedBlock||e[69]!==b?(ie=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:N=>{N.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[66]=c,e[67]=o.isMultivariate,e[68]=o.isSavedBlock,e[69]=b,e[70]=ie):ie=e[70];let fe;e[71]!==y?(fe=N=>{N.stopPropagation(),y()},e[71]=y,e[72]=fe):fe=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=n.jsx(ys,{className:"h-4 w-4"}),e[73]=Se):Se=e[73];let Pe;e[74]!==b?(Pe=b("sectionsEditor.sectionList.deleteMenuItem"),e[74]=b,e[75]=Pe):Pe=e[75];let ae;e[76]!==fe||e[77]!==Pe?(ae=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:fe,children:[Se,Pe]}),e[76]=fe,e[77]=Pe,e[78]=ae):ae=e[78];let C;e[79]!==ve||e[80]!==se||e[81]!==me||e[82]!==ie||e[83]!==ae?(C=n.jsxs(js,{align:"end",className:"w-44",children:[ve,se,me,ie,ae]}),e[79]=ve,e[80]=se,e[81]=me,e[82]=ie,e[83]=ae,e[84]=C):C=e[84];let I;return e[85]!==Z||e[86]!==je||e[87]!==C?(I=n.jsxs(Z,{children:[je,C]}),e[85]=Z,e[86]=je,e[87]=C,e[88]=I):I=e[88],n.jsxs("div",{ref:L,style:U,...we,...G,role:"button",tabIndex:0,onClick:v,onKeyDown:ne,className:le,children:[O,!H&&!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(T,E)),onClick:N=>{N.stopPropagation(),M()},onPointerDown:wi,children:n.jsx(ni,{className:Ue("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon",disabled:H,"aria-label":Ge,className:Ue(hn(T,l)),onClick:We,onPointerDown:Ri,children:Me})}),B]}),I]})}function ji(m){return m.stopPropagation()}function Ei(m){return m.stopPropagation()}function Ri(m){return m.stopPropagation()}function wi(m){return m.stopPropagation()}function ki(){return!1}function Ti(m){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:_,onSelect:v,onReorder:y,onDelete:g,onDuplicate:w,onMakeReusable:K,onToggleHidden:M,onToggleLazy:k,onAddVariant:c,onDetach:b,onAddSection:E,canAddSection:l}=m,T=l===void 0?!0:l,i=Dt(),re=ns();let H;e[0]!==p.length?(H=()=>Wn(p.length),e[0]=p.length,e[1]=H):H=e[1];const[J,te]=R.useState(H),[d,L]=R.useState(null),[pe,A]=R.useState(o),[ee,D]=R.useState(p.length),oe=R.useRef(!1);pe!==o?(A(o),D(p.length),te(Wn(p.length))):ee!==p.length&&(D(p.length),te(ae=>Si(ae,p.length)));let U;e[2]===Symbol.for("react.memo_cache_sentinel")?(U={activationConstraint:{distance:8}},e[2]=U):U=e[2];let ye;e[3]===Symbol.for("react.memo_cache_sentinel")?(ye={coordinateGetter:ms},e[3]=ye):ye=e[3];const ge=ss(Zt(rs,U),Zt(is,ye));let we;e[4]!==J?(we=J.map(Di),e[4]=J,e[5]=we):we=e[5];const G=we;let ne;e[6]===Symbol.for("react.memo_cache_sentinel")?(ne=ae=>{L(String(ae.active.id))},e[6]=ne):ne=e[6];const Ie=ne;let le;e[7]!==G||e[8]!==y?(le=ae=>{L(null);const{active:C,over:I}=ae;if(!I||C.id===I.id)return;const N=G.indexOf(String(C.id)),Ke=G.indexOf(String(I.id));N===-1||Ke===-1||(te(ct=>Rs(Lt([...ct],N,Ke))),oe.current=!0,requestAnimationFrame(()=>{oe.current=!1}),y?.(N,Ke))},e[7]=G,e[8]=y,e[9]=le):le=e[9];const O=le;let Ge;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>{L(null)},e[10]=Ge):Ge=e[10];const We=Ge;let Me,xe,B,Z,Ne,Ae,ue,Ce,ke,Le,he,Be,ce,_e,je;if(e[11]!==d||e[12]!==T||e[13]!==J||e[14]!==G||e[15]!==O||e[16]!==x||e[17]!==E||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==w||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==k||e[26]!==u||e[27]!==p||e[28]!==_||e[29]!==ge||e[30]!==i){_e=Symbol.for("react.early_return_sentinel");e:{const ae=C=>{oe.current||v(C)};if(e[46]!==d||e[47]!==T||e[48]!==J||e[49]!==E||e[50]!==u||e[51]!==p||e[52]!==i){const C=d?J.find(I=>I.id===d):null;if(Z=C!=null?p[C.index]:null,B=C!=null?u[C.index]:void 0,J.length===0){let I;e[56]!==i?(I=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=I):I=e[57];let N;e[58]!==I?(N=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:I}),e[58]=I,e[59]=N):N=e[59];const Ke=!T;let ct;e[60]===Symbol.for("react.memo_cache_sentinel")?(ct=n.jsx(Sn,{size:14}),e[60]=ct):ct=e[60];let Te;e[61]!==i?(Te=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=Te):Te=e[62];let Ye;e[63]!==E||e[64]!==Ke||e[65]!==Te?(Ye=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ke,onClick:E,children:[ct,Te]}),e[63]=E,e[64]=Ke,e[65]=Te,e[66]=Ye):Ye=e[66];let Fe;e[67]!==N||e[68]!==Ye?(Fe=n.jsxs("div",{className:"space-y-2",children:[N,Ye]}),e[67]=N,e[68]=Ye,e[69]=Fe):Fe=e[69],_e=Fe;break e}ce=Ue(C&&"cursor-grabbing"),e[46]=d,e[47]=T,e[48]=J,e[49]=E,e[50]=u,e[51]=p,e[52]=i,e[53]=B,e[54]=Z,e[55]=ce}else B=e[53],Z=e[54],ce=e[55];xe=fs,Ce=ge,ke=ps,Le=Ie,he=O,Be=We,Me=gs,Ae=G,ue=hs,je="space-y-1",Ne=J.map(C=>{const I=p[C.index];return I?n.jsx(_i,{sortableId:C.id,section:I,raw:u[C.index],meta:x,selected:_===C.index,onSelect:()=>ae(C.index),onDelete:()=>g(C.index),onDuplicate:()=>w(C.index),onMakeReusable:()=>K(C.index),onToggleHidden:()=>M(C.index),onToggleLazy:()=>k(C.index),onAddVariant:()=>c(C.index),onDetach:()=>b(C.index)},C.id):null})}e[11]=d,e[12]=T,e[13]=J,e[14]=G,e[15]=O,e[16]=x,e[17]=E,e[18]=c,e[19]=g,e[20]=b,e[21]=w,e[22]=K,e[23]=v,e[24]=M,e[25]=k,e[26]=u,e[27]=p,e[28]=_,e[29]=ge,e[30]=i,e[31]=Me,e[32]=xe,e[33]=B,e[34]=Z,e[35]=Ne,e[36]=Ae,e[37]=ue,e[38]=Ce,e[39]=ke,e[40]=Le,e[41]=he,e[42]=Be,e[43]=ce,e[44]=_e,e[45]=je}else Me=e[31],xe=e[32],B=e[33],Z=e[34],Ne=e[35],Ae=e[36],ue=e[37],Ce=e[38],ke=e[39],Le=e[40],he=e[41],Be=e[42],ce=e[43],_e=e[44],je=e[45];if(_e!==Symbol.for("react.early_return_sentinel"))return _e;let de;e[70]!==Ne||e[71]!==je?(de=n.jsx("div",{className:je,children:Ne}),e[70]=Ne,e[71]=je,e[72]=de):de=e[72];let q;e[73]!==Me||e[74]!==Ae||e[75]!==ue||e[76]!==de?(q=n.jsx(Me,{items:Ae,strategy:ue,children:de}),e[73]=Me,e[74]=Ae,e[75]=ue,e[76]=de,e[77]=q):q=e[77];let Ee;e[78]!==B||e[79]!==Z||e[80]!==x?(Ee=Z?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ks(Z,!1)),children:n.jsx(ws,{section:Z,raw:B,meta:x})}):null,e[78]=B,e[79]=Z,e[80]=x,e[81]=Ee):Ee=e[81];let ve;e[82]!==Ee?(ve=Xn.createPortal(n.jsx(as,{dropAnimation:os,children:Ee}),document.body),e[82]=Ee,e[83]=ve):ve=e[83];let se;e[84]!==xe||e[85]!==Ce||e[86]!==ke||e[87]!==Le||e[88]!==he||e[89]!==Be||e[90]!==q||e[91]!==ve?(se=n.jsxs(xe,{sensors:Ce,collisionDetection:ke,onDragStart:Le,onDragEnd:he,onDragCancel:Be,children:[q,ve]}),e[84]=xe,e[85]=Ce,e[86]=ke,e[87]=Le,e[88]=he,e[89]=Be,e[90]=q,e[91]=ve,e[92]=se):se=e[92];const me=re||!T;let ie;e[93]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Sn,{size:14}),e[93]=ie):ie=e[93];let fe;e[94]!==i?(fe=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=fe):fe=e[95];let Se;e[96]!==E||e[97]!==me||e[98]!==fe?(Se=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:me,onClick:E,children:[ie,fe]}),e[96]=E,e[97]=me,e[98]=fe,e[99]=Se):Se=e[99];let Pe;return e[100]!==ce||e[101]!==se||e[102]!==Se?(Pe=n.jsxs("div",{className:ce,children:[se,Se]}),e[100]=ce,e[101]=se,e[102]=Se,e[103]=Pe):Pe=e[103],Pe}function Di(m){return m.id}function Yn(m){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:_,onOpenChange:v}=m,y=x===void 0?!1:x,g=Dt(),[w,K]=R.useState(u),[M,k]=R.useState(o);o!==M&&(k(o),o&&K(u));let c;e[0]!==y||e[1]!==v?(c=ne=>{!ne&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let E;e[3]!==y||e[4]!==w||e[5]!==_?(E=async ne=>{ne.preventDefault(),!y&&await _(w.trim())},e[3]=y,e[4]=w,e[5]=_,e[6]=E):E=e[6];const l=E;let T;e[7]!==g?(T=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=T):T=e[8];let i;e[9]!==T?(i=n.jsx(Go,{children:T}),e[9]=T,e[10]=i):i=e[10];let re;e[11]!==p||e[12]!==g?(re=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=re):re=e[13];let H;e[14]!==re?(H=n.jsx(qo,{children:re}),e[14]=re,e[15]=H):H=e[15];let J;e[16]!==i||e[17]!==H?(J=n.jsxs(Wo,{children:[i,H]}),e[16]=i,e[17]=H,e[18]=J):J=e[18];let te;e[19]!==g?(te=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=te):te=e[20];let d;e[21]!==te?(d=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:te}),e[21]=te,e[22]=d):d=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ne=>K(ne.target.value),e[23]=L):L=e[23];let pe;e[24]!==p||e[25]!==y||e[26]!==w?(pe=n.jsx(Zo,{id:"variant-rename-name",value:w,onChange:L,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=w,e[27]=pe):pe=e[27];let A;e[28]!==d||e[29]!==pe?(A=n.jsxs("div",{className:"space-y-1.5 py-4",children:[d,pe]}),e[28]=d,e[29]=pe,e[30]=A):A=e[30];let ee;e[31]!==v?(ee=()=>v(!1),e[31]=v,e[32]=ee):ee=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let oe;e[35]!==y||e[36]!==ee||e[37]!==D?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:ee,disabled:y,children:D}),e[35]=y,e[36]=ee,e[37]=D,e[38]=oe):oe=e[38];let U;e[39]!==y||e[40]!==g?(U=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=U):U=e[41];let ye;e[42]!==y||e[43]!==U?(ye=n.jsx(tt,{type:"submit",disabled:y,children:U}),e[42]=y,e[43]=U,e[44]=ye):ye=e[44];let ge;e[45]!==oe||e[46]!==ye?(ge=n.jsxs(Yo,{children:[oe,ye]}),e[45]=oe,e[46]=ye,e[47]=ge):ge=e[47];let we;e[48]!==l||e[49]!==A||e[50]!==ge||e[51]!==J?(we=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[J,A,ge]})}),e[48]=l,e[49]=A,e[50]=ge,e[51]=J,e[52]=we):we=e[52];let G;return e[53]!==b||e[54]!==o||e[55]!==we?(G=n.jsx(Jo,{open:o,onOpenChange:b,children:we}),e[53]=b,e[54]=o,e[55]=we,e[56]=G):G=e[56],G}function Ts(m){const e=st.c(5),{rule:o,matchers:u}=m,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(w=>w.resolveType===p)?.iconName??Ha(p);x=Io(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const _=x;if(!_)return null;let v;return e[3]!==_?(v=n.jsx(_,{size:14,className:"shrink-0"}),e[3]=_,e[4]=v):v=e[4],v}function Qn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function Jn(m){return m.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Vi(m,e){const o=new Map;for(const u of m){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Ni(m){return m.map((e,o)=>({...e,index:o}))}function Ds(m){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:_,onRename:v,onDuplicate:y,onDelete:g}=m,w=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(Ts,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let k;e[5]!==x||e[6]!==_||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==w?(k=!_&&n.jsxs(_s,{children:[n.jsx(xs,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":w("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ci,onPointerDown:Ai,children:n.jsx(Ss,{size:14})})}),n.jsxs(js,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ri,{size:14}),w("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),w("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(si,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(ys,{size:14}),w("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=_,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=w,e[12]=k):k=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==k?(c=n.jsxs(n.Fragment,{children:[K,M,k]}),e[13]=K,e[14]=M,e[15]=k,e[16]=c):c=e[16],c}function Ai(m){return m.stopPropagation()}function Ci(m){return m.stopPropagation()}function Pi(m){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:_,matchers:v,onSelect:y,onRename:g,onDuplicate:w,onDelete:K}=m;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Mi},e[0]=o.id,e[1]=M):M=e[1];const{attributes:k,listeners:c,setNodeRef:b,transform:E,isDragging:l}=cs(M);let T;e[2]!==E?(T=us.Transform.toString(E?{...E,x:0}:null),e[2]=E,e[3]=T):T=e[3];const i=l?0:void 0;let re;e[4]!==T||e[5]!==i?(re={transform:T,opacity:i},e[4]=T,e[5]=i,e[6]=re):re=e[6];const H=re,J=_??void 0;let te;e[7]!==x||e[8]!==o.variant.rule||e[9]!==J?(te=Kt(o.variant.rule,x,J),e[7]=x,e[8]=o.variant.rule,e[9]=J,e[10]=te):te=e[10];const d=te;let L;e[11]!==y?(L=U=>{U.target===U.currentTarget&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),y())},e[11]=y,e[12]=L):L=e[12];const pe=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",A=u?vs:ds;let ee;e[13]!==pe||e[14]!==A?(ee=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",pe,A),e[13]=pe,e[14]=A,e[15]=ee):ee=e[15];let D;e[16]!==p||e[17]!==d||e[18]!==o.variant.label||e[19]!==v||e[20]!==K||e[21]!==w||e[22]!==g?(D=n.jsx(Ds,{label:o.variant.label,effectiveRule:d,matchers:v,canDelete:p,onRename:g,onDuplicate:w,onDelete:K}),e[16]=p,e[17]=d,e[18]=o.variant.label,e[19]=v,e[20]=K,e[21]=w,e[22]=g,e[23]=D):D=e[23];let oe;return e[24]!==k||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==H||e[29]!==ee||e[30]!==D||e[31]!==L?(oe=n.jsx("div",{ref:b,style:H,...k,...c,onClick:y,onKeyDown:L,className:ee,children:D}),e[24]=k,e[25]=c,e[26]=y,e[27]=b,e[28]=H,e[29]=ee,e[30]=D,e[31]=L,e[32]=oe):oe=e[32],oe}function Mi(){return!1}function Li(m){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=m,_=p??void 0;let v;e[0]!==u||e[1]!==_||e[2]!==o.rule?(v=Kt(o.rule,u,_),e[0]=u,e[1]=_,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vs),e[4]=g):g=e[4];let w;return e[5]!==y||e[6]!==x||e[7]!==o.label?(w=n.jsx("div",{className:g,children:n.jsx(Ds,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=w):w=e[8],w}function Ki(m){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:_,matchers:v,onSelect:y,onReorder:g,onRename:w,onDuplicate:K,onDelete:M,onAdd:k}=m,c=Dt();let b;e[0]!==u?(b=()=>Jn(u),e[0]=u,e[1]=b):b=e[1];const[E,l]=R.useState(b),[T,i]=R.useState(null),[re,H]=R.useState(o),[J,te]=R.useState(u.length);let d;e[2]!==u?(d=()=>Qn(u),e[2]=u,e[3]=d):d=e[3];const[L,pe]=R.useState(d),A=R.useRef(!1),ee=Qn(u);re!==o?(H(o),te(u.length),pe(ee),l(Jn(u))):(J!==u.length||L!==ee)&&(te(u.length),pe(ee),l(ve=>Vi(ve,u)));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ms},e[5]=oe):oe=e[5];const U=ss(Zt(rs,D),Zt(is,oe));let ye;e[6]!==E?(ye=E.map(Oi),e[6]=E,e[7]=ye):ye=e[7];const ge=ye,we=u.length>1;let G;e[8]!==E?(G=ve=>{const se=String(ve.active.id);i(E.find(me=>me.id===se)??null)},e[8]=E,e[9]=G):G=e[9];const ne=G;let Ie;e[10]!==ge||e[11]!==g?(Ie=ve=>{i(null);const{active:se,over:me}=ve;if(!me||se.id===me.id)return;const ie=ge.indexOf(String(se.id)),fe=ge.indexOf(String(me.id));ie===-1||fe===-1||(l(Se=>Ni(Lt([...Se],ie,fe))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),g(ie,fe))},e[10]=ge,e[11]=g,e[12]=Ie):Ie=e[12];const le=Ie;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{i(null)},e[13]=O):O=e[13];const Ge=O;let We,Me,xe,B,Z,Ne,Ae,ue,Ce,ke,Le,he,Be;if(e[14]!==p||e[15]!==we||e[16]!==x||e[17]!==E||e[18]!==ge||e[19]!==le||e[20]!==ne||e[21]!==v||e[22]!==_||e[23]!==k||e[24]!==M||e[25]!==K||e[26]!==w||e[27]!==y||e[28]!==U||e[29]!==c){const ve=I=>{A.current||y(I)};Le="space-y-1 border-b p-2";let se;e[43]!==c?(se=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=se):se=e[44];let me;e[45]!==se?(me=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:se}),e[45]=se,e[46]=me):me=e[46];let ie;e[47]!==c?(ie=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=ie):ie=e[48];let fe;e[49]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Sn,{size:14}),e[49]=fe):fe=e[49];let Se;e[50]!==k||e[51]!==ie?(Se=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ie,className:"size-6",onClick:k,children:fe})}),e[50]=k,e[51]=ie,e[52]=Se):Se=e[52];let Pe;e[53]!==c?(Pe=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Pe):Pe=e[54];let ae;e[55]!==Pe?(ae=n.jsx(Tt,{children:Pe}),e[55]=Pe,e[56]=ae):ae=e[56];let C;e[57]!==Se||e[58]!==ae?(C=n.jsxs(wt,{children:[Se,ae]}),e[57]=Se,e[58]=ae,e[59]=C):C=e[59],e[60]!==me||e[61]!==C?(he=n.jsxs("div",{className:"flex items-center justify-between",children:[me,C]}),e[60]=me,e[61]=C,e[62]=he):he=e[62],Me=fs,Ne=U,Ae=ps,ue=ne,Ce=le,ke=Ge,We=gs,B=ge,Z=hs,Be="space-y-0.5",xe=E.map(I=>n.jsx(Pi,{entry:I,isActive:I.index===p,canDelete:we,decofile:x,meta:_,matchers:v,onSelect:()=>ve(I.index),onRename:()=>w(I.index),onDuplicate:()=>K(I.index),onDelete:()=>M(I.index)},I.id)),e[14]=p,e[15]=we,e[16]=x,e[17]=E,e[18]=ge,e[19]=le,e[20]=ne,e[21]=v,e[22]=_,e[23]=k,e[24]=M,e[25]=K,e[26]=w,e[27]=y,e[28]=U,e[29]=c,e[30]=We,e[31]=Me,e[32]=xe,e[33]=B,e[34]=Z,e[35]=Ne,e[36]=Ae,e[37]=ue,e[38]=Ce,e[39]=ke,e[40]=Le,e[41]=he,e[42]=Be}else We=e[30],Me=e[31],xe=e[32],B=e[33],Z=e[34],Ne=e[35],Ae=e[36],ue=e[37],Ce=e[38],ke=e[39],Le=e[40],he=e[41],Be=e[42];let ce;e[63]!==xe||e[64]!==Be?(ce=n.jsx("div",{className:Be,children:xe}),e[63]=xe,e[64]=Be,e[65]=ce):ce=e[65];let _e;e[66]!==We||e[67]!==B||e[68]!==Z||e[69]!==ce?(_e=n.jsx(We,{items:B,strategy:Z,children:ce}),e[66]=We,e[67]=B,e[68]=Z,e[69]=ce,e[70]=_e):_e=e[70];let je;e[71]!==T||e[72]!==x||e[73]!==v||e[74]!==_?(je=T?n.jsx(Li,{variant:T.variant,decofile:x,meta:_,matchers:v}):null,e[71]=T,e[72]=x,e[73]=v,e[74]=_,e[75]=je):je=e[75];let de;e[76]!==je?(de=Xn.createPortal(n.jsx(as,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=de):de=e[77];let q;e[78]!==Me||e[79]!==Ne||e[80]!==Ae||e[81]!==ue||e[82]!==Ce||e[83]!==ke||e[84]!==_e||e[85]!==de?(q=n.jsxs(Me,{sensors:Ne,collisionDetection:Ae,onDragStart:ue,onDragEnd:Ce,onDragCancel:ke,children:[_e,de]}),e[78]=Me,e[79]=Ne,e[80]=Ae,e[81]=ue,e[82]=Ce,e[83]=ke,e[84]=_e,e[85]=de,e[86]=q):q=e[86];let Ee;return e[87]!==Le||e[88]!==he||e[89]!==q?(Ee=n.jsxs("div",{className:Le,children:[he,q]}),e[87]=Le,e[88]=he,e[89]=q,e[90]=Ee):Ee=e[90],Ee}function Oi(m){return m.id}function Zn(m){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:_,onSelect:v,onSelectGlobal:y,schema:g,formValue:w,onChange:K,formKey:M,formWrapperClassName:k,meta:c,decofile:b,onSaveReferencedBlock:E,sandbox:l}=m;let T;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==_||e[4]!==x||e[5]!==v||e[6]!==y?(T=n.jsx(Ua,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:_,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=_,e[4]=x,e[5]=v,e[6]=y,e[7]=T):T=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==w||e[11]!==k||e[12]!==c||e[13]!==K||e[14]!==E||e[15]!==l||e[16]!==g?(i=g&&w&&n.jsx("div",{className:k,children:n.jsx(Ga,{schema:g,value:w,onChange:K,meta:c,decofile:b,onSaveReferencedBlock:E,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=w,e[11]=k,e[12]=c,e[13]=K,e[14]=E,e[15]=l,e[16]=g,e[17]=i):i=e[17];let re;return e[18]!==T||e[19]!==i?(re=n.jsxs(n.Fragment,{children:[T,i]}),e[18]=T,e[19]=i,e[20]=re):re=e[20],re}function zc({orgSlug:m,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:_=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:w=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:k}){const c=Dt(),b=Ma()?.taskId??null,E=u?{orgSlug:m,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:T}=qa(E),{data:i,isLoading:re}=Wa(E),H=Ya(),J=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,te=li({virtualMcpId:e,sandboxUrl:p}),[d,L]=R.useState(null),[pe,A]=R.useState(null),[ee,D]=R.useState(null),[oe,U]=R.useState(0),[ye,ge]=R.useState(void 0),[we,G]=R.useState(null),[ne,Ie]=R.useState(null),[le,O]=R.useState([]),Ge=R.useRef(null),[We,Me]=R.useState(le.length);We!==le.length&&(Me(le.length),requestAnimationFrame(()=>{Ge.current&&(Ge.current.scrollTop=0)}));const[xe,B]=R.useState(0),[Z,Ne]=R.useState(null),[Ae,ue]=R.useState(null),[Ce,ke]=R.useState(null),[Le,he]=R.useState(!0),[Be,ce]=R.useState(!1),[_e,je]=R.useState(!1),de=R.useRef(null),[q,Ee]=R.useState(w),[ve,se]=R.useState(w);w&&!ve&&(se(!0),Ee(!0),L(null),A(null),D(null),O([])),!w&&ve&&se(!1);const[me,ie]=R.useState(null),[fe,Se]=R.useState(void 0),[Pe,ae]=R.useState([]),[C,I]=R.useState(0),[N,Ke]=R.useState(0),[ct,Te]=R.useState(null),[Ye,Fe]=R.useState(null),[bn,yn]=R.useState(null),Vs=Ca(),Ns=`${m}/${e}/${o}`,Xt=Qa({orgSlug:m,virtualMcpId:e,branch:o}),[As,Cs]=R.useState(x),[Ps,Ms]=R.useState(_),[Ls,Ks]=R.useState(v);(As!==x||Ps!==_||Ls!==v)&&(queueMicrotask(()=>Xt.flush()),Cs(x),Ms(_),Ks(v),L(null),A(null),D(null),U(0),G(null),Ie(null),Ke(0),Te(null),Fe(null),O([]),B(t=>t+1),Ee(!1),ie(null),Se(void 0),ae([]),I(t=>t+1));const De=Ja({orgSlug:m,virtualMcpId:e,branch:o}),Ot=Ro((t,s)=>{De.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Za({orgSlug:m,virtualMcpId:e,branch:o}),[Vt,It]=R.useState(!1),ze=R.useRef(null),at=R.useRef(null),ot=R.useRef(null),tn=R.useRef({}),Xe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||T||re)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Os=Xa(l),Ve=!!v,Qe=Ve?null:eo(Os,x,_),j=Ve?v:Qe?.key??null,nn=Ve&&v?l[v]:void 0,xn=Ve&&v&&nn?to(v,nn):Ve&&v?v:"",Bt=!Ve&&j&&l[j]?l[j]:null,sn=q&&l&&i&&j&&Qe?On(l,{kind:"page",pageKey:j,pageName:String(Qe.name??""),path:String(Qe.path??"")},i):null,Is=q?Bt?.seo:void 0,an=fe!==void 0?fe:Is,Bs=q?no(an):void 0,Fs=sn?.seoTypeOptions??[],$s=q&&i?so(i):"",_n=me??Bs??{},on=q&&sn?ai(_n,sn):null,zs=q&&on&&ao(an)?qt(on,i):null,Hs=q?oo(l,i)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:v}]}]:io(Bt?.sections,l??{}),Ft=qe.length>1,$e=Math.min(oe,qe.length-1),ut=qe[$e],W=ut?.sections??[],He=Wt(W,l),jn=!Ve&&ro(Bt?.sections);if(Ve&&v&&bn!==v){yn(v);const t=W[0],s=He[0];if(t&&s){L(0),Ke(0),O([]);const a=bt(t,s,l);a&&(A(a.data),D(a.resolveType),Fe(null),Te(null))}}!Ve&&bn!==null&&yn(null),Xe.current={rawSections:W,parsedSections:He,decofile:l??{},activePageKey:j,pageVariants:qe,variantIndex:$e,sectionVariantIndex:N,selectedSectionIndex:d};const Us=()=>({multivariate:jn,index:$e,variants:qe.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!k)return;if(!j||!jn||t.length<=1){k(null);return}const a=qn(j,{multivariate:!0,index:s,variants:t},l,i);k(a.length>0?a:null)},xt=(t,s,a)=>{if(!k)return;if(!j){k(null);return}const r=Us(),f=qn(j,r,l,i);if(!t||s<0){k(f.length>0?f:null);return}const S=Vo({pageKey:j,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];k(h.length>0?h:null)},dt=(t,s,a,r=d??-1,f=!1)=>{const S=nt(t,s);if(!S){A(null),D(null),Fe(null),Te(null),f&&xt(null,r,a);return}const V=In(S,ht)[a];if(!V){A(null),D(null),Fe(null),Te(null),f&&xt(null,r,a);return}const X=vo(V.value,l);A(X?.data??null),D(X?.resolveType??null);const{resolveType:P,formValue:F}=Ct(V.rule,l,i??void 0);Fe(P),Te(F),f&&xt(S,r,a)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==ye&&(ge(y?.seq??null),typeof Nt=="number")){const t=W[Nt],s=He[Nt];if(t&&s)if(L(Nt),Ke(0),O([]),B(a=>a+1),s.isMultivariate)dt(t,s,0,Nt);else{const a=bt(t,s,l);a?(A(a.data),D(a.resolveType)):(A(null),D(null)),Fe(null),Te(null)}}const $t={orgSlug:m,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:J},rn=ee&&i?qt(ee,i):null,Je=(t,s)=>{if(!j)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(l,j,t,$e,qe);De.mutate({blockKey:j,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{L(null),A(null),D(null),Ke(0),Te(null),Fe(null),O([]),B(t=>t+1)},Gs=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Xe.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current,P=r[s];if(!P)return;const F=f[s];if(!F)return;if(F.isSavedBlock){const z=Ao(P,F);if(!z)return;De.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:Y=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(F.isMultivariate){const z=nt(P,F);if(!z||!h)return;const Y=Co(z,a,t);Re[s]=yt(P,F,Y)}else if(F.isHidden){const z=ls(P.__resolveType),Y=z?{...P.section}:{...P},Oe=Array.isArray(Y.variants)?[...Y.variants]:[];Oe[0]&&(Oe[0]={...Oe[0],value:t}),Y.variants=Oe,z?Re[s]={...P,section:Y}:Re[s]=Y}else F.isLazy?Re[s]={...P,section:t}:Re[s]=t;if(V.length>1){const z=$.sections,Y=[...z?.variants??[]];Y[X]&&(Y[X]={...Y[X],value:Re}),$.sections={...z,variants:Y}}else $.sections=Re;De.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},gn)},qs=t=>{L(t),Ke(0),O([]),B(f=>f+1);const s=W[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){A(null),D(null),Fe(null),Te(null),xt(null,t,0);return}A(r.data),D(r.resolveType),Fe(null),Te(null),xt(null,t,0)},Rn=t=>{const s=t;A(s),d!==null&&Gs(s,d)},ln=t=>{if(!j||!l||!i||!Qe)return;const s={kind:"page",pageKey:j,pageName:String(Qe.name??""),path:String(Qe.path??"")},a=On(l,s,i);a&&Xt.save(j,()=>{const r=Vs.getQueryData(Pa.decofile(Ns))?.[j];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?ii(s,a,f,t.inner):f})},Ws=(t,s)=>{j&&(tn.current[t]=s,ln())},Ys=(t,s)=>{if(!j)return;const a=Lt([...W],t,s);d!==null&&(d===t?L(s):t<d&&s>=d?L(d-1):t>d&&s<=d&&L(d+1)),Je(a)},Qs=t=>{if(!j)return;const s=W.filter((a,r)=>r!==t);d===t?_t():d!==null&&d>t&&L(d-1),Je(s)},Js=t=>{if(!j)return;const s=W[t];if(!s)return;const a=[...W];a.splice(t+1,0,Do(s)),d!==null&&d>t&&L(d+1),Je(a)},Zs=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a)return;const r=a.isHidden?ko(s):To(s);if(!r)return;const f=[...W];f[t]=r,d===t&&_t(),Je(f)},Xs=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=wo(s);if(!r)return;const f=[...W];f[t]=r,d===t&&_t(),Je(f)},ea=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...W];a.isLazy?h[t]={...s,section:S}:h[t]=S,d===t&&_t(),Je(h)},ta=t=>{if(!j)return;const s=[...W,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ce(!1),L(a),Ke(0),O([]),B(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){A(null),D(null),Fe(null),Te(null);return}A(S.data),D(S.resolveType),Fe(null),Te(null)}})},wn=t=>{de.current=t.append,ce(!0)},na=t=>{const s=de.current;if(!s){ta(t);return}s({__resolveType:t.resolveType}),ce(!1),de.current=null},sa=t=>{if(d===null)return;const s=W[d],a=He[d];!s||!a?.isMultivariate||(Ke(t),O([]),B(r=>r+1),dt(s,a,t,d,!0))},aa=t=>{if(d===null||!j)return;const s=W[d],a=He[d];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=jo(r,t);if(!f){Q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...W];S[d]=yt(s,a,f);const h=f.variants;let V=N;t===N?V=Math.min(t,h.length-1):t<N&&(V=N-1),Ke(V),O([]),B(X=>X+1),dt(S[d],a,V),Je(S)},oa=t=>{if(d===null||!j)return;const s=W[d],a=He[d];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Eo(r,t),S=[...W];S[d]=yt(s,a,f);const h=t+1;Ke(h),O([]),B(V=>V+1),dt(S[d],a,h),Je(S)},ia=(t,s)=>{if(d===null||!j||t===s)return;const a=W[d],r=He[d];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=xo(f,t,s),h=[...W];h[d]=yt(a,r,S);let V=N;N===t?V=s:t<N&&s>=N?V=N-1:t>N&&s<=N&&(V=N+1),Ke(V),dt(h[d],r,V),Je(h)},cn=t=>{const s=t??d;if(s===null||!j)return;const a=W[s],r=He[s];if(!a||!r)return;const f=So(a,r);if(!f){Q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...W];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){Q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(s),Ke(f.newVariantIndex),O([]),B(V=>V+1),dt(f.section,h,f.newVariantIndex,s),Je(S)},ra=()=>{if(d===null||!j)return;const t=W[d],s=He[d];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=_o(t,s,a);if(!r){Q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...W];f[d]=r;const S=Wt(f,l)[d];if(!S)return;Ke(0),Fe(null),Te(null),O([]),B(V=>V+1);const h=bt(r,S,l);h?(A(h.data),D(h.resolveType)):(A(null),D(null)),xt(null,d,0),Je(f)},la=async t=>{if(Z===null||!j)return;const s=pn(t,l);if(s){Q.error(s);return}const a=W[Z],r=He[Z];if(!a||!r)return;const f=bt(a,r,l);if(!f){Q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await De.mutateAsync({blockKey:t,data:S});const h=[...W];h[Z]={__resolveType:t},await De.mutateAsync({blockKey:j,data:Mt(l,j,h,$e,qe)}),d===Z&&_t(),Ne(null),Q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){Q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&d===null&&ne===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);Ie(t),G(s)}const zt=i?lo(i):[],Tn=i&&l?co(i,l):[],ca=!Ve&&!!(te&&i&&l),ua=ne&&i?qt(ne,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},At=async(t,s)=>{if(!(No(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],V=h[r],X=V?.rule;if(Et(X,a,i)){const P=X?.__resolveType??"",F=a[P],$=typeof F?.name=="string"?F.name:P,{__resolveType:Re,...z}=t;De.mutate({blockKey:P,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:Y=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}V&&(h[r]={...V,rule:t}),f.sections={...S,variants:h},De.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:P=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},gn)},da=t=>{Ie(t);const s=t?zn(t,i):{__resolveType:Hn};G(t?s:{}),Dn(s)},ma=t=>{const s=t;G(s);const a=ne?{__resolveType:ne,...s}:{...s};Dn(a)},fa=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[r];if(!X)return;const P=Pt(X.rule,a,i),F=Qt(t);V[r]={...X,rule:F};const $={...a,[s]:{...f,sections:{...h,variants:V}}},{resolveType:Re,formValue:z}=Ct(F,$,i??void 0);Ie(Re),G(z);try{await De.mutateAsync({blockKey:s,data:$[s]}),P&&P!==t&&await At(P,$),g?.()}catch(Y){Q.error(Y instanceof Error?Y.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(!h)return;const P=r[s],F=f[s];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Ze=S[be],rt=typeof Ze?.name=="string"?Ze.name:be,{__resolveType:pt,...lt}=t;De.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Y=$n($,a,t),Oe=[...r];Oe[s]=yt(P,F,Y);const et=Mt(S,h,Oe,X,V);De.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},gn))},pa=t=>{Fe(t);const s=t?zn(t,i):{__resolveType:Hn};Te(t?s:{}),Vn(s)},ga=t=>{const s=t;Te(s);const a=Ye?{__resolveType:Ye,...s}:{...s};Vn(a)},ha=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(s===null||!h)return;const P=r[s],F=f[s];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const Re=$.variants??[],z=Pt(Re[a]?.rule,S,i),Y=Qt(t),Oe=$n($,a,Y),et=[...r];et[s]=yt(P,F,Oe);const be=Mt(S,h,et,X,V),Ze={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(Y,Ze,i??void 0);Fe(rt),Te(pt);try{await De.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await At(z,Ze),g?.()}catch(lt){Q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ve&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=d!==null?He[d]??null:null,Nn=d!==null?W[d]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,St=An?In(An,ht):[],un=Math.min(N,Math.max(St.length-1,0)),Ht=St[un]??null,ft=mt?.isMultivariate===!0,Cn=d!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&pe)),va=Ut&&!Ve&&mt?.isSavedBlock===!0,it=Ve||va,Sa=Ve?xn:mt?.label??"",ba=Ye&&i?qt(Ye,i):null,dn=Ut&&(!Ve||le.length>0)?Ve?[xn,...le]:[Qe.name,mt.label,...ft&&Ht?[Ht.label]:[],...le]:[],ya=q&&Qe?[Qe.name,"SEO",...Pe]:[],Gt=q?ya:it?dn.length>0?dn:[Sa]:dn,xa=!q&&!Ve&&ft&&le.length===0,Pn=()=>{if(!j)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[j],s=bo(t.sections,W);if(!s)return;const a=yo(s);De.mutate({blockKey:j,data:{...t,sections:s}},{onSuccess:()=>{U(a),L(null),A(null),D(null),O([]),G(null),Ie(null)},onError:r=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,a)=>{if(!j)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[j],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const V=Po(S,h),X={...l,[j]:{...r,sections:V}};De.mutate({blockKey:j,data:X[j]},{onSuccess:()=>{s?.(),a&&At(a,X)},onError:P=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},_a=t=>{ue(null),U(t),L(null),A(null),D(null),O([]);const s=qe[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);Ie(a),G(r),En(qe.map(f=>({rule:f.rule})),t)},ja=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),U(a);const r=Lt(qe.map(f=>({rule:f.rule})),t,s);En(r,a),mn(f=>Lt(f,t,s))},Ea=t=>{const s=qe[t]?.rule,a=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{qe.length-1===1?U(0):t<$e?U($e-1):t===$e&&U(Math.max(0,t-1)),L(null),A(null),D(null),O([]),G(null),Ie(null)},a)},Ra=t=>{mn(s=>Mo(s,t),()=>{U(t+1),L(null),A(null),D(null),O([]),G(null),Ie(null)})},wa=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Xe.current.activePageKey,r=Xe.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[t];if(!X?.rule||typeof X.rule!="object"){Q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const P=X.rule,F=s.trim();It(!0);try{if(!F){if(!Et(P,r,i)){ue(null);return}const et=P.__resolveType??"";V[t]={...X,rule:Un(P,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:V}}};await De.mutateAsync({blockKey:a,data:be[a]}),await At(et,be),ue(null),g?.();return}const $=Gn(P,r,i);if(!$){Q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await De.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,F)}),ue(null),g?.();return}const Re=fn(F),z=pn(Re,r);if(z){Q.error(z);return}const Y=Rt($.resolveType,$.data,F);let Oe=null;try{await De.mutateAsync({blockKey:Re,data:Y}),Oe=Re,V[t]={...X,rule:Qt(Re)},await De.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:V}}}),Oe=null}catch(et){throw Oe&&await en.mutateAsync({blockKey:Oe}).catch(()=>{}),et}ue(null),Q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),g?.()}catch($){Q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},ka=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(a===null||!h)return;const P=r[a],F=f[a];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){Q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=z.rule,Oe=s.trim();It(!0);const et=async be=>{const Ze={...$,variants:be},rt=[...r];rt[a]=yt(P,F,Ze);const pt=Mt(S,h,rt,X,V);return await De.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Oe){if(!Et(Y,S,i)){ke(null);return}const gt=Y.__resolveType??"",Kn=[...Re];Kn[t]={...z,rule:Un(Y,S,i)};const Aa=await et(Kn);await At(gt,Aa),ke(null),g?.();return}const be=Gn(Y,S,i);if(!be){Q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await De.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Oe)}),ke(null),g?.();return}const Ze=fn(Oe),rt=pn(Ze,S);if(rt){Q.error(rt);return}const pt=Rt(be.resolveType,be.data,Oe);let lt=null;try{await De.mutateAsync({blockKey:Ze,data:pt}),lt=Ze;const gt=[...Re];gt[t]={...z,rule:Qt(Ze)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}ke(null),Q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Oe})),g?.()}catch(be){Q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},Ta=t=>{ie(t),ln({inner:t})},Da=t=>{Se(t),ln({raw:t})},Va=()=>{ie(null),ae([])},Na=()=>I(t=>t+1),Ln=t=>{if(q){if(t===0){Xt.flush(),Ee(!1),ie(null),Se(void 0),ae([]),I(a=>a+1),K?.();return}if(t===1){ae([]),I(a=>a+1);return}ae(Pe.slice(0,t-1)),I(a=>a+1);return}if(Ve){O(le.slice(0,t)),B(a=>a+1);return}if(t===0){Mn();return}if(t===1){O([]),B(a=>a+1);return}if(ft&&t===2){O([]),B(a=>a+1);return}const s=ft?2:1;O(le.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||q?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Lo(Gt.length,{isMultivariateSectionTop:xa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Bo,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("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",uo),children:[n.jsx(Ts,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=mo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(zo,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Uo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&j&&n.jsx(Bn,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(fo,{pageKey:j,initialName:Qe.name,initialPath:Qe.path,onFieldChange:Ws})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Fo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&j?M():je(!0),children:n.jsx($o,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Bn,{onClick:Pn})]})}),q?n.jsx(Jt,{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:Bt&&j?n.jsx(oi,{rawSeo:an,innerSeo:_n,defaultResolveType:$s,seoSchema:zs,activeResolveType:on,seoTypeOptions:Fs,formResetKey:C,siteDefaultSeo:Hs,onBreadcrumbChange:ae,onPersistRaw:Da,onInnerChange:Ta,onClearForm:Va,onBumpFormKey:Na}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Jt,{viewportRef:Ge,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&le.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(po,{listKey:`${j??""}:${d??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:sa,onRename:ke,onDuplicate:oa,onDelete:aa,onRemoveAll:ra,onReorder:ia,onAdd:()=>cn()}),ft&&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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Zn,{currentRt:Ye??"",currentLabel:Yt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:pa,onSelectGlobal:ha,schema:ba,formValue:ct,onChange:ga,formKey:`${d??"none"}:${un}:${Ye??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:pe,formResetKey:xe,onFormChange:Rn,onBreadcrumbChange:O,breadcrumbPath:le,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t,previewBaseUrl:te,onRequestAddSection:wn})]},"editor-section-form"):Ve?n.jsx(Jt,{viewportRef:Ge,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:pe,formResetKey:xe,onFormChange:Rn,onBreadcrumbChange:O,breadcrumbPath:le,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t,previewBaseUrl:te,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&j&&n.jsx(Ki,{listKey:j,variants:qe,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:_a,onReorder:ja,onRename:ue,onDuplicate:Ra,onDelete:Ea,onAdd:Pn}),Ft&&ne!==null&&n.jsxs("div",{className:Ue("px-3 border-b",Le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>he(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:c("sectionsEditor.sectionsEditor.variantRule")}),Le?n.jsx(Ho,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ko,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Le&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Zn,{currentRt:ne,currentLabel:Yt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:da,onSelectGlobal:fa,schema:ua,formValue:we,onChange:ma,formKey:`${$e}:${ne??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Ti,{listKey:`${j??""}-${$e}`,rawSections:W,sections:He,meta:i,selectedIndex:d,onSelect:qs,onReorder:Ys,onDelete:Qs,onDuplicate:Js,onMakeReusable:Ne,onToggleHidden:Zs,onToggleLazy:Xs,onAddVariant:cn,onDetach:ea,onAddSection:()=>ce(!0),canAddSection:ca})})]},"editor-section-list"),n.jsx(go,{open:Z!==null,onOpenChange:t=>{t||Ne(null)},defaultBlockId:Z!==null?fn(He[Z]?.label??""):"",isPending:De.isPending,onSubmit:la}),te&&n.jsx(ci,{open:Be,onOpenChange:t=>{ce(t),t||(de.current=null)},meta:i,decofile:l,previewBaseUrl:te,onSelect:na}),_e&&j&&l&&n.jsx(ho,{open:_e,onOpenChange:je,pageKey:j,decofile:l}),Ae!==null&&n.jsx(Yn,{open:!0,initialName:Et(qe[Ae]?.rule,l??{},i??void 0)?Yt(qe[Ae]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(qe[Ae]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wa(Ae,t)},onOpenChange:t=>{!t&&!Vt&&ue(null)}}),Ce!==null&&n.jsx(Yn,{open:!0,initialName:Et(St[Ce]?.rule,l??{},i??void 0)?Yt(St[Ce]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(St[Ce]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await ka(Ce,t)},onOpenChange:t=>{!t&&!Vt&&ke(null)}})]})}export{zc as SectionsEditor};
|
|
1
|
+
import{c as st,b as Dt,r as R,n as Ue,j as n,aI as Xn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Ca,t as Q,K as Pa}from"./index-CyVZ5lgJ.js";import{b as Ma}from"./chat-context-DdSuZE3w.js";import{a7 as ts,a8 as La,a9 as Ka,aa as Oa,ab as Ia,ac as ns,N as ss,O as Zt,ad as as,ae as os,P as is,Q as rs,af as ls,ag as Ba,_ as cs,$ as us,ah as Fa,ai as $a,aj as ds,G as za,U as ms,V as Lt,Y as fs,Z as ps,W as gs,a4 as hs,ak as Ha,al as Kt,am as vs,an as Ua,ao as Ga,ap as qa,aq as Wa,ar as Ya,d as Qa,e as Ja,as as Za,at as Xa,au as eo,av as to,aw as On,ax as no,ay as so,az as ao,a2 as qt,aA as oo,aB as io,aC as Wt,aD as ro,aE as bt,aF as Ct,aG as lo,aH as co,aI as nt,aJ as In,aK as uo,g as mo,aL as Bn,aM as fo,aN as po,aO as Pt,aP as Yt,aQ as Fn,aR as go,aS as fn,aT as ho,aU as ht,aV as Et,aW as vo,aX as So,aY as bo,aZ as yo,a_ as xo,a$ as yt,b0 as _o,b1 as jo,b2 as Eo,i as Ro,b3 as $n,b4 as Mt,b5 as zn,b6 as Hn,b7 as wo,b8 as ko,b9 as To,ba as Do,bb as pn,bc as Un,bd as Gn,be as Rt,bf as Qt,bg as qn,bh as Vo,bi as gn,bj as No,bk as Ao,bl as Co,bm as Po,bn as Mo,bo as Lo}from"./index-DEVfPJkj.js";import{t as Ko}from"./ChevronDown-DS4KDE95.js";import{ad as vn,u as Oo,Q as Ss,z as Io,r as Bo,ak as Fo,o as $o}from"./agent-icon-patNN3F9.js";import{i as zo}from"./ChevronRight-HiBK7iT4.js";import{n as Ho}from"./ChevronUp-DBNo7toe.js";import{i as Uo}from"./Globe01-wsmSifpz.js";import{S as Jt}from"./scroll-area-BhaZbee4.js";import{d as Go,h as qo,c as Wo,e as Yo,b as Qo,D as Jo}from"./dialog-CefQc73v.js";import{I as Zo}from"./input-DJ33AwMQ.js";import{a as bs}from"./Copy01-cV8y7I27.js";import{i as Xo}from"./Settings02-BdKfdvdO.js";import{s as ei}from"./Eye-CFsMHhc3.js";import{s as ti}from"./TrendUp01-Dmxvc_8Y.js";import{s as Sn}from"./Plus-DuwKEMqs.js";import{s as ys}from"./Trash01-BQ7TqJow.js";import{i as ni}from"./Zap-C81otJUu.js";import{D as xs,a as vt,c as _s,b as js,i as si}from"./dropdown-menu-Dmm7Trn3.js";import{a as ai,P as oi,b as ii}from"./page-seo-form-Cp6KSuC_.js";import{a as ri}from"./Tool01-kD_St_C1.js";import{u as li,A as ci}from"./use-section-preview-base-JJaaLUdY.js";import"./use-panel-navigate-5GuF3Xky.js";import"./use-destination-route-C4i1vP71.js";import"./thread-route-CvQsqsJY.js";import"./Check-BSrzKRPt.js";import"./Download01-DKxxD2lG.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DHadwCKp.js";import"./use-mcp-client-BiMbFhZA.js";import"./auth-Di--WQHJ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BGdXs4q_.js";import"./task-board-BR_pi0j4.js";import"./schema-CTX-wtUj.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CYMnefxf.js";import"./use-ai-providers-QUqgpHAI.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BCpugb4D.js";import"./use-organization-settings-DOmendGP.js";import"./ArrowUp-Ck_S8UXb.js";import"./automation-runs-BnvqbNbI.js";import"./useInfiniteQuery-CULS4zh1.js";import"./use-infinite-scroll-DHeyE3Gp.js";import"./use-connection-CklhgwT-.js";import"./table-DxIpuuMu.js";import"./empty-state-C54Q6sBj.js";import"./use-members-KzBukpu-.js";import"./use-org-auth-client-DXJoDvFV.js";import"./AlertCircle-Cbfze2vA.js";import"./CheckCircle-DyLCcRg7.js";import"./DotsVertical-Cn-HQJLl.js";import"./XCircle-BR9peTMp.js";import"./use-automations-BFLuZmRd.js";import"./useSuspenseInfiniteQuery-DaZYFkir.js";import"./avatar-DpXC79Fw.js";import"./User01-6GEEYLNL.js";import"./Tool02-C4Mhmh2n.js";import"./Stars01-CqIitG82.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DXvQhxzo.js";import"./markdown-BkQsssiC.js";import"./ZoomOut-A4Edr_rF.js";import"./monaco-editor-CekVK54D.js";import"./spinner-BKgquf7Q.js";import"./editor-BxhxuLJa.js";import"./types-sWp7JVPE.js";import"./XClose-CId8Q3oo.js";import"./Share07-DgnKCkn5.js";import"./SearchMd-BNMN35l9.js";import"./shell-layout-DdASzo_y.js";import"./Users03-C-fPfgy4.js";import"./SearchLg-BWCvW3vV.js";import"./Stars02-C5vVPVXG.js";import"./FilterLines-CY-R2Pgs.js";import"./Monitor01-DZQMQTQG.js";import"./required-auth-layout-rRB3j86p.js";import"./use-org-sso-DvDCIeZJ.js";import"./Image01-4ZjVZeII.js";import"./LinkExternal01-DgCDtWFz.js";import"./integration-icon-Bp-AVupB.js";import"./Palette-_BVhH0qL.js";import"./use-navigate-to-agent-DMGreR6U.js";import"./github-repo-BpKUwJal.js";import"./chart-DsuJR6l_.js";import"./index-DfY5ZnY2.js";import"./AreaChart-ESWfdZrx.js";import"./form-CAcKi06k.js";import"./label-C3nYoz5C.js";import"./file-type-icon-BFYTEN10.js";import"./drawer-BZ-PaoE1.js";import"./collection-search-DpMT1vYf.js";import"./use-mcp-tools-D1SQ9VQp.js";import"./Upload01-BUUJWF9q.js";import"./select-C8VpiT9w.js";import"./UserSquare-B1QhMNkc.js";import"./ArrowLeft-sTRXJKw4.js";import"./tabs-Cb3eYxFR.js";import"./toggle-group-Buj7cwOI.js";import"./super-agent-icon-X7k4V5iD.js";import"./self-tool-result-C8bZjo2U.js";import"./alert-dialog-B0BRtAnp.js";import"./extract-connection-data-DXnTgJE5.js";import"./metadata-dUsYcpuu.js";import"./connection-BOKd-Vhl.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BX1Z2C1S.js";import"./authenticate-and-persist-oauth-CjESgZgI.js";import"./mcp-oauth-1onT9Dwz.js";import"./track-UqVBrAJT.js";import"./popover-D55EARay.js";import"./toolbar-T9fNZ5Dm.js";import"./github-repo-picker-C-0rHR-M.js";import"./LockUnlocked01-DPANpO_w.js";import"./agent-capabilities-BxGDQyCw.js";import"./connection-card-C0r2lBXt.js";import"./use-registry-connections-D-9Urbos.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DmjAO8WJ.js";import"./connection-form-helpers-Cx0hSG8H.js";import"./collection-tabs-6TyH3ybi.js";import"./badge-mutKhjD6.js";import"./select-model-D1dRIP_D.js";import"./checkbox-BlKIO9QJ.js";import"./ChevronSelectorVertical-CfYYUsnO.js";import"./Key01-BGSob3xF.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DD3eiqXL.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BvVFIICB.js";import"./ZapSquare-DafqFLME.js";import"./skill-preview-Cux1kH84.js";import"./GitBranch01-gzbYsobG.js";import"./Package-FFc5eynf.js";import"./use-file-configs-C0TVz0AH.js";import"./site-slug-uya6Wp4-.js";import"./pt-BR-CLy76QW2.js";import"./Play-mDAbVXyx.js";import"./use-debounced-autosave-DDM-x_p4.js";import"./search-input-CVs6a7cw.js";import"./use-mcp-auth-status-CWXW9vhJ.js";import"./switch-ekFlz4BX.js";import"./Users01-D3492jop.js";import"./use-secrets-C_EMCwrS.js";import"./config-FZs5m7aB.js";import"./Shield01-CRyZWHgQ.js";import"./command-0A8TicqW.js";import"./index-BCzXIVbP.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-TFEAIiKj.js";import"./SwitchHorizontal01-BSS5u6hh.js";import"./use-tags-CnHiO94-.js";import"./automation-list-row-1Zs7zFIm.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-DABsYoTf.js";import"./cards-B_0ClWxN.js";import"./CreditCard01-D2p53cnj.js";import"./Globe04-BbtNoerk.js";import"./HardDrive-B2Kmw_-U.js";import"./LogOut01-y1fQHOm-.js";import"./Sun-B_wiAXGd.js";function ui(m){return m.schema?.definitions??m.schema?.$defs??{}}function Es(m,e){const o=ui(e),u=o[btoa(m)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(_=>typeof _.$ref=="string")?.$ref;if(typeof x=="string"){const _=o[x.replace("#/definitions/","")];_&&p.push(_)}}return p}function di(m,e){for(const o of Es(m,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function mi(m,e){if(!e)return;const o=ts(m);if(!o)return;const u=di(o.resolveType,e);if(!u)return;const p=La(u,o.data);if(p)return Ka(p)}const fi={escape:Ia};function pi(m,e){for(const o of Es(m,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function gi(m,e){if(!e)return;const o=ts(m);if(o)try{const u=pi(o.resolveType,e);return u&&Oa.render(u,o.data,{},fi).trim()||void 0}catch{return}}const hi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Wn(m){return Array.from({length:m},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Rs(m){return m.map((e,o)=>({...e,index:o}))}function Si(m,e){if(e===m.length)return m;if(e<m.length)return Rs(m.slice(0,e));const o=Array.from({length:e-m.length},(u,p)=>({id:crypto.randomUUID(),index:m.length+p}));return[...m,...o]}function ws(m){const e=st.c(25),{section:o,raw:u,meta:p}=m,x=o.isSavedBlock===!0,_=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?mi(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==_||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!_?gi(u,p):void 0,e[3]=p,e[4]=_,e[5]=u,e[6]=x,e[7]=g):g=e[7];const w=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Oo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let k;e[11]!==_||e[12]!==x?(k=x?{color:za}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=_,e[12]=x,e[13]=k):k=e[13];let c;e[14]!==k?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:k}),e[14]=k,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let E;e[16]!==b?(E=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=E):E=e[17];const l=w??o.label;let T;e[18]!==E||e[19]!==l?(T=n.jsx("span",{className:E,children:l}),e[18]=E,e[19]=l,e[20]=T):T=e[20];let i;return e[21]!==T||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,T]}),e[21]=T,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const bi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",yi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",xi="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(m,e){return Ue("h-7 shrink-0 overflow-hidden",e?bi:m?xi:yi)}function ks(m,e){const o=m.isSavedBlock===!0,u=m.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?hi:u?ds:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _i(m){const e=st.c(89),{section:o,raw:u,meta:p,sortableId:x,selected:_,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:w,onToggleHidden:K,onToggleLazy:M,onAddVariant:k,onDetach:c}=m,b=Dt(),E=u?ls(u.__resolveType??""):!1,l=o.isHidden===!0,T=E||l;let i;e[0]!==o?(i=Ba(o),e[0]=o,e[1]=i):i=e[1];const re=i,H=ns();let J;e[2]!==x?(J={id:x,animateLayoutChanges:ki},e[2]=x,e[3]=J):J=e[3];const{attributes:te,listeners:d,setNodeRef:L,transform:pe,isDragging:A}=cs(J);let ee;e[4]!==pe?(ee=us.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ee):ee=e[5];const D=A?0:void 0;let oe;e[6]!==ee||e[7]!==D?(oe={transform:ee,opacity:D},e[6]=ee,e[7]=D,e[8]=oe):oe=e[8];const U=oe;let ye;e[9]!==o?(ye=Fa(o),e[9]=o,e[10]=ye):ye=e[10];const ge=ye;let we;e[11]!==te||e[12]!==H?(we=H?{}:te,e[11]=te,e[12]=H,e[13]=we):we=e[13];let G;e[14]!==d||e[15]!==H?(G=H?{}:d,e[14]=d,e[15]=H,e[16]=G):G=e[16];let ne;e[17]!==v?(ne=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),v())},e[17]=v,e[18]=ne):ne=e[18];const Ie=A?"cursor-grabbing":"cursor-pointer";let le;e[19]!==o||e[20]!==_||e[21]!==Ie?(le=Ue("touch-none transition-colors",Ie,ks(o,_)),e[19]=o,e[20]=_,e[21]=Ie,e[22]=le):le=e[22];let O;e[23]!==p||e[24]!==u||e[25]!==o?(O=n.jsx(ws,{section:o,raw:u,meta:p}),e[23]=p,e[24]=u,e[25]=o,e[26]=O):O=e[26];let Ge;e[27]!==l||e[28]!==b?(Ge=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[27]=l,e[28]=b,e[29]=Ge):Ge=e[29];let We;e[30]!==K?(We=N=>{N.stopPropagation(),K()},e[30]=K,e[31]=We):We=e[31];let Me;e[32]!==l?(Me=l?n.jsx(Xo,{className:"h-3.5 w-3.5"}):n.jsx(ei,{className:"h-3.5 w-3.5"}),e[32]=l,e[33]=Me):Me=e[33];let xe;e[34]!==l||e[35]!==b?(xe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[34]=l,e[35]=b,e[36]=xe):xe=e[36];let B;e[37]!==xe?(B=n.jsx(Tt,{side:"bottom",children:xe}),e[37]=xe,e[38]=B):B=e[38];const Z=_s,Ne=xs,Ae=!0,ue=tt,Ce="button",ke="ghost",Le="icon";let he;e[39]!==b?(he=b("sectionsEditor.sectionList.sectionActionsMenu"),e[39]=b,e[40]=he):he=e[40];const Be=Ue(hn(T,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let ce;e[41]===Symbol.for("react.memo_cache_sentinel")?(ce=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[41]=ce):ce=e[41];let _e;e[42]!==ue||e[43]!==H||e[44]!==he||e[45]!==Be?(_e=n.jsx(ue,{type:Ce,variant:ke,size:Le,disabled:H,"aria-label":he,className:Be,onClick:Ei,onPointerDown:ji,children:ce}),e[42]=ue,e[43]=H,e[44]=he,e[45]=Be,e[46]=_e):_e=e[46];let je;e[47]!==Ne||e[48]!==_e?(je=n.jsx(Ne,{asChild:Ae,children:_e}),e[47]=Ne,e[48]=_e,e[49]=je):je=e[49];let de;e[50]!==g?(de=N=>{N.stopPropagation(),g()},e[50]=g,e[51]=de):de=e[51];let q;e[52]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(bs,{className:"h-4 w-4"}),e[52]=q):q=e[52];let Ee;e[53]!==b?(Ee=b("sectionsEditor.sectionList.duplicateMenuItem"),e[53]=b,e[54]=Ee):Ee=e[54];let ve;e[55]!==de||e[56]!==Ee?(ve=n.jsxs(vt,{onClick:de,children:[q,Ee]}),e[55]=de,e[56]=Ee,e[57]=ve):ve=e[57];let se;e[58]!==re||e[59]!==k||e[60]!==b?(se=re&&n.jsxs(vt,{className:$a,onClick:N=>{N.stopPropagation(),k()},children:[n.jsx(ti,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[58]=re,e[59]=k,e[60]=b,e[61]=se):se=e[61];let me;e[62]!==ge||e[63]!==w||e[64]!==b?(me=ge&&n.jsxs(vt,{className:vi,onClick:N=>{N.stopPropagation(),w()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[62]=ge,e[63]=w,e[64]=b,e[65]=me):me=e[65];let ie;e[66]!==c||e[67]!==o.isMultivariate||e[68]!==o.isSavedBlock||e[69]!==b?(ie=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:N=>{N.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[66]=c,e[67]=o.isMultivariate,e[68]=o.isSavedBlock,e[69]=b,e[70]=ie):ie=e[70];let fe;e[71]!==y?(fe=N=>{N.stopPropagation(),y()},e[71]=y,e[72]=fe):fe=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=n.jsx(ys,{className:"h-4 w-4"}),e[73]=Se):Se=e[73];let Pe;e[74]!==b?(Pe=b("sectionsEditor.sectionList.deleteMenuItem"),e[74]=b,e[75]=Pe):Pe=e[75];let ae;e[76]!==fe||e[77]!==Pe?(ae=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:fe,children:[Se,Pe]}),e[76]=fe,e[77]=Pe,e[78]=ae):ae=e[78];let C;e[79]!==ve||e[80]!==se||e[81]!==me||e[82]!==ie||e[83]!==ae?(C=n.jsxs(js,{align:"end",className:"w-44",children:[ve,se,me,ie,ae]}),e[79]=ve,e[80]=se,e[81]=me,e[82]=ie,e[83]=ae,e[84]=C):C=e[84];let I;return e[85]!==Z||e[86]!==je||e[87]!==C?(I=n.jsxs(Z,{children:[je,C]}),e[85]=Z,e[86]=je,e[87]=C,e[88]=I):I=e[88],n.jsxs("div",{ref:L,style:U,...we,...G,role:"button",tabIndex:0,onClick:v,onKeyDown:ne,className:le,children:[O,!H&&!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(T,E)),onClick:N=>{N.stopPropagation(),M()},onPointerDown:wi,children:n.jsx(ni,{className:Ue("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon",disabled:H,"aria-label":Ge,className:Ue(hn(T,l)),onClick:We,onPointerDown:Ri,children:Me})}),B]}),I]})}function ji(m){return m.stopPropagation()}function Ei(m){return m.stopPropagation()}function Ri(m){return m.stopPropagation()}function wi(m){return m.stopPropagation()}function ki(){return!1}function Ti(m){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:_,onSelect:v,onReorder:y,onDelete:g,onDuplicate:w,onMakeReusable:K,onToggleHidden:M,onToggleLazy:k,onAddVariant:c,onDetach:b,onAddSection:E,canAddSection:l}=m,T=l===void 0?!0:l,i=Dt(),re=ns();let H;e[0]!==p.length?(H=()=>Wn(p.length),e[0]=p.length,e[1]=H):H=e[1];const[J,te]=R.useState(H),[d,L]=R.useState(null),[pe,A]=R.useState(o),[ee,D]=R.useState(p.length),oe=R.useRef(!1);pe!==o?(A(o),D(p.length),te(Wn(p.length))):ee!==p.length&&(D(p.length),te(ae=>Si(ae,p.length)));let U;e[2]===Symbol.for("react.memo_cache_sentinel")?(U={activationConstraint:{distance:8}},e[2]=U):U=e[2];let ye;e[3]===Symbol.for("react.memo_cache_sentinel")?(ye={coordinateGetter:ms},e[3]=ye):ye=e[3];const ge=ss(Zt(rs,U),Zt(is,ye));let we;e[4]!==J?(we=J.map(Di),e[4]=J,e[5]=we):we=e[5];const G=we;let ne;e[6]===Symbol.for("react.memo_cache_sentinel")?(ne=ae=>{L(String(ae.active.id))},e[6]=ne):ne=e[6];const Ie=ne;let le;e[7]!==G||e[8]!==y?(le=ae=>{L(null);const{active:C,over:I}=ae;if(!I||C.id===I.id)return;const N=G.indexOf(String(C.id)),Ke=G.indexOf(String(I.id));N===-1||Ke===-1||(te(ct=>Rs(Lt([...ct],N,Ke))),oe.current=!0,requestAnimationFrame(()=>{oe.current=!1}),y?.(N,Ke))},e[7]=G,e[8]=y,e[9]=le):le=e[9];const O=le;let Ge;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>{L(null)},e[10]=Ge):Ge=e[10];const We=Ge;let Me,xe,B,Z,Ne,Ae,ue,Ce,ke,Le,he,Be,ce,_e,je;if(e[11]!==d||e[12]!==T||e[13]!==J||e[14]!==G||e[15]!==O||e[16]!==x||e[17]!==E||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==w||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==k||e[26]!==u||e[27]!==p||e[28]!==_||e[29]!==ge||e[30]!==i){_e=Symbol.for("react.early_return_sentinel");e:{const ae=C=>{oe.current||v(C)};if(e[46]!==d||e[47]!==T||e[48]!==J||e[49]!==E||e[50]!==u||e[51]!==p||e[52]!==i){const C=d?J.find(I=>I.id===d):null;if(Z=C!=null?p[C.index]:null,B=C!=null?u[C.index]:void 0,J.length===0){let I;e[56]!==i?(I=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=I):I=e[57];let N;e[58]!==I?(N=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:I}),e[58]=I,e[59]=N):N=e[59];const Ke=!T;let ct;e[60]===Symbol.for("react.memo_cache_sentinel")?(ct=n.jsx(Sn,{size:14}),e[60]=ct):ct=e[60];let Te;e[61]!==i?(Te=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=Te):Te=e[62];let Ye;e[63]!==E||e[64]!==Ke||e[65]!==Te?(Ye=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ke,onClick:E,children:[ct,Te]}),e[63]=E,e[64]=Ke,e[65]=Te,e[66]=Ye):Ye=e[66];let Fe;e[67]!==N||e[68]!==Ye?(Fe=n.jsxs("div",{className:"space-y-2",children:[N,Ye]}),e[67]=N,e[68]=Ye,e[69]=Fe):Fe=e[69],_e=Fe;break e}ce=Ue(C&&"cursor-grabbing"),e[46]=d,e[47]=T,e[48]=J,e[49]=E,e[50]=u,e[51]=p,e[52]=i,e[53]=B,e[54]=Z,e[55]=ce}else B=e[53],Z=e[54],ce=e[55];xe=fs,Ce=ge,ke=ps,Le=Ie,he=O,Be=We,Me=gs,Ae=G,ue=hs,je="space-y-1",Ne=J.map(C=>{const I=p[C.index];return I?n.jsx(_i,{sortableId:C.id,section:I,raw:u[C.index],meta:x,selected:_===C.index,onSelect:()=>ae(C.index),onDelete:()=>g(C.index),onDuplicate:()=>w(C.index),onMakeReusable:()=>K(C.index),onToggleHidden:()=>M(C.index),onToggleLazy:()=>k(C.index),onAddVariant:()=>c(C.index),onDetach:()=>b(C.index)},C.id):null})}e[11]=d,e[12]=T,e[13]=J,e[14]=G,e[15]=O,e[16]=x,e[17]=E,e[18]=c,e[19]=g,e[20]=b,e[21]=w,e[22]=K,e[23]=v,e[24]=M,e[25]=k,e[26]=u,e[27]=p,e[28]=_,e[29]=ge,e[30]=i,e[31]=Me,e[32]=xe,e[33]=B,e[34]=Z,e[35]=Ne,e[36]=Ae,e[37]=ue,e[38]=Ce,e[39]=ke,e[40]=Le,e[41]=he,e[42]=Be,e[43]=ce,e[44]=_e,e[45]=je}else Me=e[31],xe=e[32],B=e[33],Z=e[34],Ne=e[35],Ae=e[36],ue=e[37],Ce=e[38],ke=e[39],Le=e[40],he=e[41],Be=e[42],ce=e[43],_e=e[44],je=e[45];if(_e!==Symbol.for("react.early_return_sentinel"))return _e;let de;e[70]!==Ne||e[71]!==je?(de=n.jsx("div",{className:je,children:Ne}),e[70]=Ne,e[71]=je,e[72]=de):de=e[72];let q;e[73]!==Me||e[74]!==Ae||e[75]!==ue||e[76]!==de?(q=n.jsx(Me,{items:Ae,strategy:ue,children:de}),e[73]=Me,e[74]=Ae,e[75]=ue,e[76]=de,e[77]=q):q=e[77];let Ee;e[78]!==B||e[79]!==Z||e[80]!==x?(Ee=Z?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ks(Z,!1)),children:n.jsx(ws,{section:Z,raw:B,meta:x})}):null,e[78]=B,e[79]=Z,e[80]=x,e[81]=Ee):Ee=e[81];let ve;e[82]!==Ee?(ve=Xn.createPortal(n.jsx(as,{dropAnimation:os,children:Ee}),document.body),e[82]=Ee,e[83]=ve):ve=e[83];let se;e[84]!==xe||e[85]!==Ce||e[86]!==ke||e[87]!==Le||e[88]!==he||e[89]!==Be||e[90]!==q||e[91]!==ve?(se=n.jsxs(xe,{sensors:Ce,collisionDetection:ke,onDragStart:Le,onDragEnd:he,onDragCancel:Be,children:[q,ve]}),e[84]=xe,e[85]=Ce,e[86]=ke,e[87]=Le,e[88]=he,e[89]=Be,e[90]=q,e[91]=ve,e[92]=se):se=e[92];const me=re||!T;let ie;e[93]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Sn,{size:14}),e[93]=ie):ie=e[93];let fe;e[94]!==i?(fe=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=fe):fe=e[95];let Se;e[96]!==E||e[97]!==me||e[98]!==fe?(Se=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:me,onClick:E,children:[ie,fe]}),e[96]=E,e[97]=me,e[98]=fe,e[99]=Se):Se=e[99];let Pe;return e[100]!==ce||e[101]!==se||e[102]!==Se?(Pe=n.jsxs("div",{className:ce,children:[se,Se]}),e[100]=ce,e[101]=se,e[102]=Se,e[103]=Pe):Pe=e[103],Pe}function Di(m){return m.id}function Yn(m){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:_,onOpenChange:v}=m,y=x===void 0?!1:x,g=Dt(),[w,K]=R.useState(u),[M,k]=R.useState(o);o!==M&&(k(o),o&&K(u));let c;e[0]!==y||e[1]!==v?(c=ne=>{!ne&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let E;e[3]!==y||e[4]!==w||e[5]!==_?(E=async ne=>{ne.preventDefault(),!y&&await _(w.trim())},e[3]=y,e[4]=w,e[5]=_,e[6]=E):E=e[6];const l=E;let T;e[7]!==g?(T=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=T):T=e[8];let i;e[9]!==T?(i=n.jsx(Go,{children:T}),e[9]=T,e[10]=i):i=e[10];let re;e[11]!==p||e[12]!==g?(re=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=re):re=e[13];let H;e[14]!==re?(H=n.jsx(qo,{children:re}),e[14]=re,e[15]=H):H=e[15];let J;e[16]!==i||e[17]!==H?(J=n.jsxs(Wo,{children:[i,H]}),e[16]=i,e[17]=H,e[18]=J):J=e[18];let te;e[19]!==g?(te=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=te):te=e[20];let d;e[21]!==te?(d=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:te}),e[21]=te,e[22]=d):d=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ne=>K(ne.target.value),e[23]=L):L=e[23];let pe;e[24]!==p||e[25]!==y||e[26]!==w?(pe=n.jsx(Zo,{id:"variant-rename-name",value:w,onChange:L,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=w,e[27]=pe):pe=e[27];let A;e[28]!==d||e[29]!==pe?(A=n.jsxs("div",{className:"space-y-1.5 py-4",children:[d,pe]}),e[28]=d,e[29]=pe,e[30]=A):A=e[30];let ee;e[31]!==v?(ee=()=>v(!1),e[31]=v,e[32]=ee):ee=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let oe;e[35]!==y||e[36]!==ee||e[37]!==D?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:ee,disabled:y,children:D}),e[35]=y,e[36]=ee,e[37]=D,e[38]=oe):oe=e[38];let U;e[39]!==y||e[40]!==g?(U=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=U):U=e[41];let ye;e[42]!==y||e[43]!==U?(ye=n.jsx(tt,{type:"submit",disabled:y,children:U}),e[42]=y,e[43]=U,e[44]=ye):ye=e[44];let ge;e[45]!==oe||e[46]!==ye?(ge=n.jsxs(Yo,{children:[oe,ye]}),e[45]=oe,e[46]=ye,e[47]=ge):ge=e[47];let we;e[48]!==l||e[49]!==A||e[50]!==ge||e[51]!==J?(we=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[J,A,ge]})}),e[48]=l,e[49]=A,e[50]=ge,e[51]=J,e[52]=we):we=e[52];let G;return e[53]!==b||e[54]!==o||e[55]!==we?(G=n.jsx(Jo,{open:o,onOpenChange:b,children:we}),e[53]=b,e[54]=o,e[55]=we,e[56]=G):G=e[56],G}function Ts(m){const e=st.c(5),{rule:o,matchers:u}=m,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(w=>w.resolveType===p)?.iconName??Ha(p);x=Io(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const _=x;if(!_)return null;let v;return e[3]!==_?(v=n.jsx(_,{size:14,className:"shrink-0"}),e[3]=_,e[4]=v):v=e[4],v}function Qn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function Jn(m){return m.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Vi(m,e){const o=new Map;for(const u of m){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Ni(m){return m.map((e,o)=>({...e,index:o}))}function Ds(m){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:_,onRename:v,onDuplicate:y,onDelete:g}=m,w=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(Ts,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let k;e[5]!==x||e[6]!==_||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==w?(k=!_&&n.jsxs(_s,{children:[n.jsx(xs,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":w("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ci,onPointerDown:Ai,children:n.jsx(Ss,{size:14})})}),n.jsxs(js,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ri,{size:14}),w("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),w("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(si,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(ys,{size:14}),w("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=_,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=w,e[12]=k):k=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==k?(c=n.jsxs(n.Fragment,{children:[K,M,k]}),e[13]=K,e[14]=M,e[15]=k,e[16]=c):c=e[16],c}function Ai(m){return m.stopPropagation()}function Ci(m){return m.stopPropagation()}function Pi(m){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:_,matchers:v,onSelect:y,onRename:g,onDuplicate:w,onDelete:K}=m;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Mi},e[0]=o.id,e[1]=M):M=e[1];const{attributes:k,listeners:c,setNodeRef:b,transform:E,isDragging:l}=cs(M);let T;e[2]!==E?(T=us.Transform.toString(E?{...E,x:0}:null),e[2]=E,e[3]=T):T=e[3];const i=l?0:void 0;let re;e[4]!==T||e[5]!==i?(re={transform:T,opacity:i},e[4]=T,e[5]=i,e[6]=re):re=e[6];const H=re,J=_??void 0;let te;e[7]!==x||e[8]!==o.variant.rule||e[9]!==J?(te=Kt(o.variant.rule,x,J),e[7]=x,e[8]=o.variant.rule,e[9]=J,e[10]=te):te=e[10];const d=te;let L;e[11]!==y?(L=U=>{U.target===U.currentTarget&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),y())},e[11]=y,e[12]=L):L=e[12];const pe=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",A=u?vs:ds;let ee;e[13]!==pe||e[14]!==A?(ee=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",pe,A),e[13]=pe,e[14]=A,e[15]=ee):ee=e[15];let D;e[16]!==p||e[17]!==d||e[18]!==o.variant.label||e[19]!==v||e[20]!==K||e[21]!==w||e[22]!==g?(D=n.jsx(Ds,{label:o.variant.label,effectiveRule:d,matchers:v,canDelete:p,onRename:g,onDuplicate:w,onDelete:K}),e[16]=p,e[17]=d,e[18]=o.variant.label,e[19]=v,e[20]=K,e[21]=w,e[22]=g,e[23]=D):D=e[23];let oe;return e[24]!==k||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==H||e[29]!==ee||e[30]!==D||e[31]!==L?(oe=n.jsx("div",{ref:b,style:H,...k,...c,onClick:y,onKeyDown:L,className:ee,children:D}),e[24]=k,e[25]=c,e[26]=y,e[27]=b,e[28]=H,e[29]=ee,e[30]=D,e[31]=L,e[32]=oe):oe=e[32],oe}function Mi(){return!1}function Li(m){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=m,_=p??void 0;let v;e[0]!==u||e[1]!==_||e[2]!==o.rule?(v=Kt(o.rule,u,_),e[0]=u,e[1]=_,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vs),e[4]=g):g=e[4];let w;return e[5]!==y||e[6]!==x||e[7]!==o.label?(w=n.jsx("div",{className:g,children:n.jsx(Ds,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=w):w=e[8],w}function Ki(m){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:_,matchers:v,onSelect:y,onReorder:g,onRename:w,onDuplicate:K,onDelete:M,onAdd:k}=m,c=Dt();let b;e[0]!==u?(b=()=>Jn(u),e[0]=u,e[1]=b):b=e[1];const[E,l]=R.useState(b),[T,i]=R.useState(null),[re,H]=R.useState(o),[J,te]=R.useState(u.length);let d;e[2]!==u?(d=()=>Qn(u),e[2]=u,e[3]=d):d=e[3];const[L,pe]=R.useState(d),A=R.useRef(!1),ee=Qn(u);re!==o?(H(o),te(u.length),pe(ee),l(Jn(u))):(J!==u.length||L!==ee)&&(te(u.length),pe(ee),l(ve=>Vi(ve,u)));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ms},e[5]=oe):oe=e[5];const U=ss(Zt(rs,D),Zt(is,oe));let ye;e[6]!==E?(ye=E.map(Oi),e[6]=E,e[7]=ye):ye=e[7];const ge=ye,we=u.length>1;let G;e[8]!==E?(G=ve=>{const se=String(ve.active.id);i(E.find(me=>me.id===se)??null)},e[8]=E,e[9]=G):G=e[9];const ne=G;let Ie;e[10]!==ge||e[11]!==g?(Ie=ve=>{i(null);const{active:se,over:me}=ve;if(!me||se.id===me.id)return;const ie=ge.indexOf(String(se.id)),fe=ge.indexOf(String(me.id));ie===-1||fe===-1||(l(Se=>Ni(Lt([...Se],ie,fe))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),g(ie,fe))},e[10]=ge,e[11]=g,e[12]=Ie):Ie=e[12];const le=Ie;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{i(null)},e[13]=O):O=e[13];const Ge=O;let We,Me,xe,B,Z,Ne,Ae,ue,Ce,ke,Le,he,Be;if(e[14]!==p||e[15]!==we||e[16]!==x||e[17]!==E||e[18]!==ge||e[19]!==le||e[20]!==ne||e[21]!==v||e[22]!==_||e[23]!==k||e[24]!==M||e[25]!==K||e[26]!==w||e[27]!==y||e[28]!==U||e[29]!==c){const ve=I=>{A.current||y(I)};Le="space-y-1 border-b p-2";let se;e[43]!==c?(se=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=se):se=e[44];let me;e[45]!==se?(me=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:se}),e[45]=se,e[46]=me):me=e[46];let ie;e[47]!==c?(ie=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=ie):ie=e[48];let fe;e[49]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Sn,{size:14}),e[49]=fe):fe=e[49];let Se;e[50]!==k||e[51]!==ie?(Se=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ie,className:"size-6",onClick:k,children:fe})}),e[50]=k,e[51]=ie,e[52]=Se):Se=e[52];let Pe;e[53]!==c?(Pe=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Pe):Pe=e[54];let ae;e[55]!==Pe?(ae=n.jsx(Tt,{children:Pe}),e[55]=Pe,e[56]=ae):ae=e[56];let C;e[57]!==Se||e[58]!==ae?(C=n.jsxs(wt,{children:[Se,ae]}),e[57]=Se,e[58]=ae,e[59]=C):C=e[59],e[60]!==me||e[61]!==C?(he=n.jsxs("div",{className:"flex items-center justify-between",children:[me,C]}),e[60]=me,e[61]=C,e[62]=he):he=e[62],Me=fs,Ne=U,Ae=ps,ue=ne,Ce=le,ke=Ge,We=gs,B=ge,Z=hs,Be="space-y-0.5",xe=E.map(I=>n.jsx(Pi,{entry:I,isActive:I.index===p,canDelete:we,decofile:x,meta:_,matchers:v,onSelect:()=>ve(I.index),onRename:()=>w(I.index),onDuplicate:()=>K(I.index),onDelete:()=>M(I.index)},I.id)),e[14]=p,e[15]=we,e[16]=x,e[17]=E,e[18]=ge,e[19]=le,e[20]=ne,e[21]=v,e[22]=_,e[23]=k,e[24]=M,e[25]=K,e[26]=w,e[27]=y,e[28]=U,e[29]=c,e[30]=We,e[31]=Me,e[32]=xe,e[33]=B,e[34]=Z,e[35]=Ne,e[36]=Ae,e[37]=ue,e[38]=Ce,e[39]=ke,e[40]=Le,e[41]=he,e[42]=Be}else We=e[30],Me=e[31],xe=e[32],B=e[33],Z=e[34],Ne=e[35],Ae=e[36],ue=e[37],Ce=e[38],ke=e[39],Le=e[40],he=e[41],Be=e[42];let ce;e[63]!==xe||e[64]!==Be?(ce=n.jsx("div",{className:Be,children:xe}),e[63]=xe,e[64]=Be,e[65]=ce):ce=e[65];let _e;e[66]!==We||e[67]!==B||e[68]!==Z||e[69]!==ce?(_e=n.jsx(We,{items:B,strategy:Z,children:ce}),e[66]=We,e[67]=B,e[68]=Z,e[69]=ce,e[70]=_e):_e=e[70];let je;e[71]!==T||e[72]!==x||e[73]!==v||e[74]!==_?(je=T?n.jsx(Li,{variant:T.variant,decofile:x,meta:_,matchers:v}):null,e[71]=T,e[72]=x,e[73]=v,e[74]=_,e[75]=je):je=e[75];let de;e[76]!==je?(de=Xn.createPortal(n.jsx(as,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=de):de=e[77];let q;e[78]!==Me||e[79]!==Ne||e[80]!==Ae||e[81]!==ue||e[82]!==Ce||e[83]!==ke||e[84]!==_e||e[85]!==de?(q=n.jsxs(Me,{sensors:Ne,collisionDetection:Ae,onDragStart:ue,onDragEnd:Ce,onDragCancel:ke,children:[_e,de]}),e[78]=Me,e[79]=Ne,e[80]=Ae,e[81]=ue,e[82]=Ce,e[83]=ke,e[84]=_e,e[85]=de,e[86]=q):q=e[86];let Ee;return e[87]!==Le||e[88]!==he||e[89]!==q?(Ee=n.jsxs("div",{className:Le,children:[he,q]}),e[87]=Le,e[88]=he,e[89]=q,e[90]=Ee):Ee=e[90],Ee}function Oi(m){return m.id}function Zn(m){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:_,onSelect:v,onSelectGlobal:y,schema:g,formValue:w,onChange:K,formKey:M,formWrapperClassName:k,meta:c,decofile:b,onSaveReferencedBlock:E,sandbox:l}=m;let T;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==_||e[4]!==x||e[5]!==v||e[6]!==y?(T=n.jsx(Ua,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:_,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=_,e[4]=x,e[5]=v,e[6]=y,e[7]=T):T=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==w||e[11]!==k||e[12]!==c||e[13]!==K||e[14]!==E||e[15]!==l||e[16]!==g?(i=g&&w&&n.jsx("div",{className:k,children:n.jsx(Ga,{schema:g,value:w,onChange:K,meta:c,decofile:b,onSaveReferencedBlock:E,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=w,e[11]=k,e[12]=c,e[13]=K,e[14]=E,e[15]=l,e[16]=g,e[17]=i):i=e[17];let re;return e[18]!==T||e[19]!==i?(re=n.jsxs(n.Fragment,{children:[T,i]}),e[18]=T,e[19]=i,e[20]=re):re=e[20],re}function Hc({orgSlug:m,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:_=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:w=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:k}){const c=Dt(),b=Ma()?.taskId??null,E=u?{orgSlug:m,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:T}=qa(E),{data:i,isLoading:re}=Wa(E),H=Ya(),J=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,te=li({virtualMcpId:e,sandboxUrl:p}),[d,L]=R.useState(null),[pe,A]=R.useState(null),[ee,D]=R.useState(null),[oe,U]=R.useState(0),[ye,ge]=R.useState(void 0),[we,G]=R.useState(null),[ne,Ie]=R.useState(null),[le,O]=R.useState([]),Ge=R.useRef(null),[We,Me]=R.useState(le.length);We!==le.length&&(Me(le.length),requestAnimationFrame(()=>{Ge.current&&(Ge.current.scrollTop=0)}));const[xe,B]=R.useState(0),[Z,Ne]=R.useState(null),[Ae,ue]=R.useState(null),[Ce,ke]=R.useState(null),[Le,he]=R.useState(!0),[Be,ce]=R.useState(!1),[_e,je]=R.useState(!1),de=R.useRef(null),[q,Ee]=R.useState(w),[ve,se]=R.useState(w);w&&!ve&&(se(!0),Ee(!0),L(null),A(null),D(null),O([])),!w&&ve&&se(!1);const[me,ie]=R.useState(null),[fe,Se]=R.useState(void 0),[Pe,ae]=R.useState([]),[C,I]=R.useState(0),[N,Ke]=R.useState(0),[ct,Te]=R.useState(null),[Ye,Fe]=R.useState(null),[bn,yn]=R.useState(null),Vs=Ca(),Ns=`${m}/${e}/${o}`,Xt=Qa({orgSlug:m,virtualMcpId:e,branch:o}),[As,Cs]=R.useState(x),[Ps,Ms]=R.useState(_),[Ls,Ks]=R.useState(v);(As!==x||Ps!==_||Ls!==v)&&(queueMicrotask(()=>Xt.flush()),Cs(x),Ms(_),Ks(v),L(null),A(null),D(null),U(0),G(null),Ie(null),Ke(0),Te(null),Fe(null),O([]),B(t=>t+1),Ee(!1),ie(null),Se(void 0),ae([]),I(t=>t+1));const De=Ja({orgSlug:m,virtualMcpId:e,branch:o}),Ot=Ro((t,s)=>{De.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Za({orgSlug:m,virtualMcpId:e,branch:o}),[Vt,It]=R.useState(!1),ze=R.useRef(null),at=R.useRef(null),ot=R.useRef(null),tn=R.useRef({}),Xe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||T||re)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Os=Xa(l),Ve=!!v,Qe=Ve?null:eo(Os,x,_),j=Ve?v:Qe?.key??null,nn=Ve&&v?l[v]:void 0,xn=Ve&&v&&nn?to(v,nn):Ve&&v?v:"",Bt=!Ve&&j&&l[j]?l[j]:null,sn=q&&l&&i&&j&&Qe?On(l,{kind:"page",pageKey:j,pageName:String(Qe.name??""),path:String(Qe.path??"")},i):null,Is=q?Bt?.seo:void 0,an=fe!==void 0?fe:Is,Bs=q?no(an):void 0,Fs=sn?.seoTypeOptions??[],$s=q&&i?so(i):"",_n=me??Bs??{},on=q&&sn?ai(_n,sn):null,zs=q&&on&&ao(an)?qt(on,i):null,Hs=q?oo(l,i)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:v}]}]:io(Bt?.sections,l??{}),Ft=qe.length>1,$e=Math.min(oe,qe.length-1),ut=qe[$e],W=ut?.sections??[],He=Wt(W,l),jn=!Ve&&ro(Bt?.sections);if(Ve&&v&&bn!==v){yn(v);const t=W[0],s=He[0];if(t&&s){L(0),Ke(0),O([]);const a=bt(t,s,l);a&&(A(a.data),D(a.resolveType),Fe(null),Te(null))}}!Ve&&bn!==null&&yn(null),Xe.current={rawSections:W,parsedSections:He,decofile:l??{},activePageKey:j,pageVariants:qe,variantIndex:$e,sectionVariantIndex:N,selectedSectionIndex:d};const Us=()=>({multivariate:jn,index:$e,variants:qe.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!k)return;if(!j||!jn||t.length<=1){k(null);return}const a=qn(j,{multivariate:!0,index:s,variants:t},l,i);k(a.length>0?a:null)},xt=(t,s,a)=>{if(!k)return;if(!j){k(null);return}const r=Us(),f=qn(j,r,l,i);if(!t||s<0){k(f.length>0?f:null);return}const S=Vo({pageKey:j,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];k(h.length>0?h:null)},dt=(t,s,a,r=d??-1,f=!1)=>{const S=nt(t,s);if(!S){A(null),D(null),Fe(null),Te(null),f&&xt(null,r,a);return}const V=In(S,ht)[a];if(!V){A(null),D(null),Fe(null),Te(null),f&&xt(null,r,a);return}const X=vo(V.value,l);A(X?.data??null),D(X?.resolveType??null);const{resolveType:P,formValue:F}=Ct(V.rule,l,i??void 0);Fe(P),Te(F),f&&xt(S,r,a)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==ye&&(ge(y?.seq??null),typeof Nt=="number")){const t=W[Nt],s=He[Nt];if(t&&s)if(L(Nt),Ke(0),O([]),B(a=>a+1),s.isMultivariate)dt(t,s,0,Nt);else{const a=bt(t,s,l);a?(A(a.data),D(a.resolveType)):(A(null),D(null)),Fe(null),Te(null)}}const $t={orgSlug:m,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:J},rn=ee&&i?qt(ee,i):null,Je=(t,s)=>{if(!j)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(l,j,t,$e,qe);De.mutate({blockKey:j,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{L(null),A(null),D(null),Ke(0),Te(null),Fe(null),O([]),B(t=>t+1)},Gs=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Xe.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current,P=r[s];if(!P)return;const F=f[s];if(!F)return;if(F.isSavedBlock){const z=Ao(P,F);if(!z)return;De.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:Y=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(F.isMultivariate){const z=nt(P,F);if(!z||!h)return;const Y=Co(z,a,t);Re[s]=yt(P,F,Y)}else if(F.isHidden){const z=ls(P.__resolveType),Y=z?{...P.section}:{...P},Oe=Array.isArray(Y.variants)?[...Y.variants]:[];Oe[0]&&(Oe[0]={...Oe[0],value:t}),Y.variants=Oe,z?Re[s]={...P,section:Y}:Re[s]=Y}else F.isLazy?Re[s]={...P,section:t}:Re[s]=t;if(V.length>1){const z=$.sections,Y=[...z?.variants??[]];Y[X]&&(Y[X]={...Y[X],value:Re}),$.sections={...z,variants:Y}}else $.sections=Re;De.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},gn)},qs=t=>{L(t),Ke(0),O([]),B(f=>f+1);const s=W[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){A(null),D(null),Fe(null),Te(null),xt(null,t,0);return}A(r.data),D(r.resolveType),Fe(null),Te(null),xt(null,t,0)},Rn=t=>{const s=t;A(s),d!==null&&Gs(s,d)},ln=t=>{if(!j||!l||!i||!Qe)return;const s={kind:"page",pageKey:j,pageName:String(Qe.name??""),path:String(Qe.path??"")},a=On(l,s,i);a&&Xt.save(j,()=>{const r=Vs.getQueryData(Pa.decofile(Ns))?.[j];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?ii(s,a,f,t.inner):f})},Ws=(t,s)=>{j&&(tn.current[t]=s,ln())},Ys=(t,s)=>{if(!j)return;const a=Lt([...W],t,s);d!==null&&(d===t?L(s):t<d&&s>=d?L(d-1):t>d&&s<=d&&L(d+1)),Je(a)},Qs=t=>{if(!j)return;const s=W.filter((a,r)=>r!==t);d===t?_t():d!==null&&d>t&&L(d-1),Je(s)},Js=t=>{if(!j)return;const s=W[t];if(!s)return;const a=[...W];a.splice(t+1,0,Do(s)),d!==null&&d>t&&L(d+1),Je(a)},Zs=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a)return;const r=a.isHidden?ko(s):To(s);if(!r)return;const f=[...W];f[t]=r,d===t&&_t(),Je(f)},Xs=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=wo(s);if(!r)return;const f=[...W];f[t]=r,d===t&&_t(),Je(f)},ea=t=>{if(!j)return;const s=W[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...W];a.isLazy?h[t]={...s,section:S}:h[t]=S,d===t&&_t(),Je(h)},ta=t=>{if(!j)return;const s=[...W,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ce(!1),L(a),Ke(0),O([]),B(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){A(null),D(null),Fe(null),Te(null);return}A(S.data),D(S.resolveType),Fe(null),Te(null)}})},wn=t=>{de.current=t.append,ce(!0)},na=t=>{const s=de.current;if(!s){ta(t);return}s({__resolveType:t.resolveType}),ce(!1),de.current=null},sa=t=>{if(d===null)return;const s=W[d],a=He[d];!s||!a?.isMultivariate||(Ke(t),O([]),B(r=>r+1),dt(s,a,t,d,!0))},aa=t=>{if(d===null||!j)return;const s=W[d],a=He[d];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=jo(r,t);if(!f){Q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...W];S[d]=yt(s,a,f);const h=f.variants;let V=N;t===N?V=Math.min(t,h.length-1):t<N&&(V=N-1),Ke(V),O([]),B(X=>X+1),dt(S[d],a,V),Je(S)},oa=t=>{if(d===null||!j)return;const s=W[d],a=He[d];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Eo(r,t),S=[...W];S[d]=yt(s,a,f);const h=t+1;Ke(h),O([]),B(V=>V+1),dt(S[d],a,h),Je(S)},ia=(t,s)=>{if(d===null||!j||t===s)return;const a=W[d],r=He[d];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=xo(f,t,s),h=[...W];h[d]=yt(a,r,S);let V=N;N===t?V=s:t<N&&s>=N?V=N-1:t>N&&s<=N&&(V=N+1),Ke(V),dt(h[d],r,V),Je(h)},cn=t=>{const s=t??d;if(s===null||!j)return;const a=W[s],r=He[s];if(!a||!r)return;const f=So(a,r);if(!f){Q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...W];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){Q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(s),Ke(f.newVariantIndex),O([]),B(V=>V+1),dt(f.section,h,f.newVariantIndex,s),Je(S)},ra=()=>{if(d===null||!j)return;const t=W[d],s=He[d];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=_o(t,s,a);if(!r){Q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...W];f[d]=r;const S=Wt(f,l)[d];if(!S)return;Ke(0),Fe(null),Te(null),O([]),B(V=>V+1);const h=bt(r,S,l);h?(A(h.data),D(h.resolveType)):(A(null),D(null)),xt(null,d,0),Je(f)},la=async t=>{if(Z===null||!j)return;const s=pn(t,l);if(s){Q.error(s);return}const a=W[Z],r=He[Z];if(!a||!r)return;const f=bt(a,r,l);if(!f){Q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await De.mutateAsync({blockKey:t,data:S});const h=[...W];h[Z]={__resolveType:t},await De.mutateAsync({blockKey:j,data:Mt(l,j,h,$e,qe)}),d===Z&&_t(),Ne(null),Q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){Q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&d===null&&ne===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);Ie(t),G(s)}const zt=i?lo(i):[],Tn=i&&l?co(i,l):[],ca=!Ve&&!!(te&&i&&l),ua=ne&&i?qt(ne,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},At=async(t,s)=>{if(!(No(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],V=h[r],X=V?.rule;if(Et(X,a,i)){const P=X?.__resolveType??"",F=a[P],$=typeof F?.name=="string"?F.name:P,{__resolveType:Re,...z}=t;De.mutate({blockKey:P,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:Y=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}V&&(h[r]={...V,rule:t}),f.sections={...S,variants:h},De.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:P=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},gn)},da=t=>{Ie(t);const s=t?zn(t,i):{__resolveType:Hn};G(t?s:{}),Dn(s)},ma=t=>{const s=t;G(s);const a=ne?{__resolveType:ne,...s}:{...s};Dn(a)},fa=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[r];if(!X)return;const P=Pt(X.rule,a,i),F=Qt(t);V[r]={...X,rule:F};const $={...a,[s]:{...f,sections:{...h,variants:V}}},{resolveType:Re,formValue:z}=Ct(F,$,i??void 0);Ie(Re),G(z);try{await De.mutateAsync({blockKey:s,data:$[s]}),P&&P!==t&&await At(P,$),g?.()}catch(Y){Q.error(Y instanceof Error?Y.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(!h)return;const P=r[s],F=f[s];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Ze=S[be],rt=typeof Ze?.name=="string"?Ze.name:be,{__resolveType:pt,...lt}=t;De.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Y=$n($,a,t),Oe=[...r];Oe[s]=yt(P,F,Y);const et=Mt(S,h,Oe,X,V);De.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},gn))},pa=t=>{Fe(t);const s=t?zn(t,i):{__resolveType:Hn};Te(t?s:{}),Vn(s)},ga=t=>{const s=t;Te(s);const a=Ye?{__resolveType:Ye,...s}:{...s};Vn(a)},ha=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(s===null||!h)return;const P=r[s],F=f[s];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const Re=$.variants??[],z=Pt(Re[a]?.rule,S,i),Y=Qt(t),Oe=$n($,a,Y),et=[...r];et[s]=yt(P,F,Oe);const be=Mt(S,h,et,X,V),Ze={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(Y,Ze,i??void 0);Fe(rt),Te(pt);try{await De.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await At(z,Ze),g?.()}catch(lt){Q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ve&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=d!==null?He[d]??null:null,Nn=d!==null?W[d]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,St=An?In(An,ht):[],un=Math.min(N,Math.max(St.length-1,0)),Ht=St[un]??null,ft=mt?.isMultivariate===!0,Cn=d!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&pe)),va=Ut&&!Ve&&mt?.isSavedBlock===!0,it=Ve||va,Sa=Ve?xn:mt?.label??"",ba=Ye&&i?qt(Ye,i):null,dn=Ut&&(!Ve||le.length>0)?Ve?[xn,...le]:[Qe.name,mt.label,...ft&&Ht?[Ht.label]:[],...le]:[],ya=q&&Qe?[Qe.name,"SEO",...Pe]:[],Gt=q?ya:it?dn.length>0?dn:[Sa]:dn,xa=!q&&!Ve&&ft&&le.length===0,Pn=()=>{if(!j)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[j],s=bo(t.sections,W);if(!s)return;const a=yo(s);De.mutate({blockKey:j,data:{...t,sections:s}},{onSuccess:()=>{U(a),L(null),A(null),D(null),O([]),G(null),Ie(null)},onError:r=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,a)=>{if(!j)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[j],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const V=Po(S,h),X={...l,[j]:{...r,sections:V}};De.mutate({blockKey:j,data:X[j]},{onSuccess:()=>{s?.(),a&&At(a,X)},onError:P=>Q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},_a=t=>{ue(null),U(t),L(null),A(null),D(null),O([]);const s=qe[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);Ie(a),G(r),En(qe.map(f=>({rule:f.rule})),t)},ja=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),U(a);const r=Lt(qe.map(f=>({rule:f.rule})),t,s);En(r,a),mn(f=>Lt(f,t,s))},Ea=t=>{const s=qe[t]?.rule,a=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{qe.length-1===1?U(0):t<$e?U($e-1):t===$e&&U(Math.max(0,t-1)),L(null),A(null),D(null),O([]),G(null),Ie(null)},a)},Ra=t=>{mn(s=>Mo(s,t),()=>{U(t+1),L(null),A(null),D(null),O([]),G(null),Ie(null)})},wa=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Xe.current.activePageKey,r=Xe.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const V=[...h.variants],X=V[t];if(!X?.rule||typeof X.rule!="object"){Q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const P=X.rule,F=s.trim();It(!0);try{if(!F){if(!Et(P,r,i)){ue(null);return}const et=P.__resolveType??"";V[t]={...X,rule:Un(P,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:V}}};await De.mutateAsync({blockKey:a,data:be[a]}),await At(et,be),ue(null),g?.();return}const $=Gn(P,r,i);if(!$){Q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await De.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,F)}),ue(null),g?.();return}const Re=fn(F),z=pn(Re,r);if(z){Q.error(z);return}const Y=Rt($.resolveType,$.data,F);let Oe=null;try{await De.mutateAsync({blockKey:Re,data:Y}),Oe=Re,V[t]={...X,rule:Qt(Re)},await De.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:V}}}),Oe=null}catch(et){throw Oe&&await en.mutateAsync({blockKey:Oe}).catch(()=>{}),et}ue(null),Q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),g?.()}catch($){Q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},ka=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:V,variantIndex:X}=Xe.current;if(a===null||!h)return;const P=r[a],F=f[a];if(!P||!F?.isMultivariate)return;const $=nt(P,F);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){Q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=z.rule,Oe=s.trim();It(!0);const et=async be=>{const Ze={...$,variants:be},rt=[...r];rt[a]=yt(P,F,Ze);const pt=Mt(S,h,rt,X,V);return await De.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Oe){if(!Et(Y,S,i)){ke(null);return}const gt=Y.__resolveType??"",Kn=[...Re];Kn[t]={...z,rule:Un(Y,S,i)};const Aa=await et(Kn);await At(gt,Aa),ke(null),g?.();return}const be=Gn(Y,S,i);if(!be){Q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await De.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Oe)}),ke(null),g?.();return}const Ze=fn(Oe),rt=pn(Ze,S);if(rt){Q.error(rt);return}const pt=Rt(be.resolveType,be.data,Oe);let lt=null;try{await De.mutateAsync({blockKey:Ze,data:pt}),lt=Ze;const gt=[...Re];gt[t]={...z,rule:Qt(Ze)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}ke(null),Q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Oe})),g?.()}catch(be){Q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},Ta=t=>{ie(t),ln({inner:t})},Da=t=>{Se(t),ln({raw:t})},Va=()=>{ie(null),ae([])},Na=()=>I(t=>t+1),Ln=t=>{if(q){if(t===0){Xt.flush(),Ee(!1),ie(null),Se(void 0),ae([]),I(a=>a+1),K?.();return}if(t===1){ae([]),I(a=>a+1);return}ae(Pe.slice(0,t-1)),I(a=>a+1);return}if(Ve){O(le.slice(0,t)),B(a=>a+1);return}if(t===0){Mn();return}if(t===1){O([]),B(a=>a+1);return}if(ft&&t===2){O([]),B(a=>a+1);return}const s=ft?2:1;O(le.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||q?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Lo(Gt.length,{isMultivariateSectionTop:xa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Bo,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("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",uo),children:[n.jsx(Ts,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=mo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(zo,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Uo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&j&&n.jsx(Bn,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(fo,{pageKey:j,initialName:Qe.name,initialPath:Qe.path,onFieldChange:Ws})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Fo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&j?M():je(!0),children:n.jsx($o,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Bn,{onClick:Pn})]})}),q?n.jsx(Jt,{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:Bt&&j?n.jsx(oi,{rawSeo:an,innerSeo:_n,defaultResolveType:$s,seoSchema:zs,activeResolveType:on,seoTypeOptions:Fs,formResetKey:C,siteDefaultSeo:Hs,onBreadcrumbChange:ae,onPersistRaw:Da,onInnerChange:Ta,onClearForm:Va,onBumpFormKey:Na}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Jt,{viewportRef:Ge,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&le.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(po,{listKey:`${j??""}:${d??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:sa,onRename:ke,onDuplicate:oa,onDelete:aa,onRemoveAll:ra,onReorder:ia,onAdd:()=>cn()}),ft&&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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Zn,{currentRt:Ye??"",currentLabel:Yt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:pa,onSelectGlobal:ha,schema:ba,formValue:ct,onChange:ga,formKey:`${d??"none"}:${un}:${Ye??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:pe,formResetKey:xe,onFormChange:Rn,onBreadcrumbChange:O,breadcrumbPath:le,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t,previewBaseUrl:te,onRequestAddSection:wn})]},"editor-section-form"):Ve?n.jsx(Jt,{viewportRef:Ge,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:pe,formResetKey:xe,onFormChange:Rn,onBreadcrumbChange:O,breadcrumbPath:le,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t,previewBaseUrl:te,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&j&&n.jsx(Ki,{listKey:j,variants:qe,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:_a,onReorder:ja,onRename:ue,onDuplicate:Ra,onDelete:Ea,onAdd:Pn}),Ft&&ne!==null&&n.jsxs("div",{className:Ue("px-3 border-b",Le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>he(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:c("sectionsEditor.sectionsEditor.variantRule")}),Le?n.jsx(Ho,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ko,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Le&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Zn,{currentRt:ne,currentLabel:Yt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:da,onSelectGlobal:fa,schema:ua,formValue:we,onChange:ma,formKey:`${$e}:${ne??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Ot,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Ti,{listKey:`${j??""}-${$e}`,rawSections:W,sections:He,meta:i,selectedIndex:d,onSelect:qs,onReorder:Ys,onDelete:Qs,onDuplicate:Js,onMakeReusable:Ne,onToggleHidden:Zs,onToggleLazy:Xs,onAddVariant:cn,onDetach:ea,onAddSection:()=>ce(!0),canAddSection:ca})})]},"editor-section-list"),n.jsx(go,{open:Z!==null,onOpenChange:t=>{t||Ne(null)},defaultBlockId:Z!==null?fn(He[Z]?.label??""):"",isPending:De.isPending,onSubmit:la}),te&&n.jsx(ci,{open:Be,onOpenChange:t=>{ce(t),t||(de.current=null)},meta:i,decofile:l,previewBaseUrl:te,onSelect:na}),_e&&j&&l&&n.jsx(ho,{open:_e,onOpenChange:je,pageKey:j,decofile:l}),Ae!==null&&n.jsx(Yn,{open:!0,initialName:Et(qe[Ae]?.rule,l??{},i??void 0)?Yt(qe[Ae]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(qe[Ae]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wa(Ae,t)},onOpenChange:t=>{!t&&!Vt&&ue(null)}}),Ce!==null&&n.jsx(Yn,{open:!0,initialName:Et(St[Ce]?.rule,l??{},i??void 0)?Yt(St[Ce]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(St[Ce]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await ka(Ce,t)},onOpenChange:t=>{!t&&!Vt&&ke(null)}})]})}export{Hc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bx as st,bv as Ne,j as i,e7 as rt,bz as Ie,bw as k,e8 as lt,bs as j,by as P,cL as $,e9 as at,aI as Ee,ea as Re,bt as ct,cG as it,eb as dt,cP as ut,ec as pt,ed as ft,ee as mt,ef as ht,eg as gt,bu as vt,eh as xt,ei as St,ej as wt,c as ee,n as oe}from"./index-ygoeB01B.js";import{i as yt}from"./Check-CMcrSGq4.js";import{t as je}from"./ChevronDown-CjoGJTaF.js";import{n as Ct}from"./ChevronUp--L2cn8UF.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+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(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|
|
1
|
+
import{r as d,bx as st,bv as Ne,j as i,e7 as rt,bz as Ie,bw as k,e8 as lt,bs as j,by as P,cL as $,e9 as at,aI as Ee,ea as Re,bt as ct,cG as it,eb as dt,cP as ut,ec as pt,ed as ft,ee as mt,ef as ht,eg as gt,bu as vt,eh as xt,ei as St,ej as wt,c as ee,n as oe}from"./index-CyVZ5lgJ.js";import{i as yt}from"./Check-BSrzKRPt.js";import{t as je}from"./ChevronDown-DS4KDE95.js";import{n as Ct}from"./ChevronUp-DBNo7toe.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+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(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|