decocms 4.34.3 → 4.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B6-eZTUR.js → AlertCircle-C2zWCKFU.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CzpmfU3d.js → ArrowUpRight-CEd_dX9G.js} +1 -1
- package/dist/client/assets/{Check-DVkdUWft.js → Check-BRK73b5S.js} +1 -1
- package/dist/client/assets/{CheckCircle-B_h70CXk.js → CheckCircle-Bc6DVWpl.js} +1 -1
- package/dist/client/assets/{ChevronDown-sHPJGGX_.js → ChevronDown-Cl64FuM7.js} +1 -1
- package/dist/client/assets/{ChevronRight-lsn3SwWd.js → ChevronRight-BiUpAxck.js} +1 -1
- package/dist/client/assets/{ChevronUp-D5GPoW4G.js → ChevronUp-Bd8WwASv.js} +1 -1
- package/dist/client/assets/{Circle-CnWLbQ7e.js → Circle-CVEWxAkn.js} +1 -1
- package/dist/client/assets/{Copy01-DQqUJZLN.js → Copy01-BQ_PiBJg.js} +1 -1
- package/dist/client/assets/{DotsVertical-nfukLkBe.js → DotsVertical-BajBw7s_.js} +1 -1
- package/dist/client/assets/{Eye-NVid_T2x.js → Eye-9-W42Pav.js} +1 -1
- package/dist/client/assets/{FilterLines-C-g-0AC4.js → FilterLines-DAOyUgW1.js} +1 -1
- package/dist/client/assets/{Globe01-BEnNdnJg.js → Globe01-C8lrsv2j.js} +1 -1
- package/dist/client/assets/{Globe04-BU3ZK8iN.js → Globe04-Ben7MbOW.js} +1 -1
- package/dist/client/assets/{HardDrive-p0LtEe3M.js → HardDrive-s5-cqKOl.js} +1 -1
- package/dist/client/assets/{Key01-DvyZlUa3.js → Key01-Bii-u3if.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CZff3RKJ.js → LayoutLeft-DZ1o8wY9.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CAcDRzLQ.js → LinkExternal01-DzEGzhif.js} +1 -1
- package/dist/client/assets/{List-7N0Lpsu9.js → List-BLq_vEGx.js} +1 -1
- package/dist/client/assets/{Loading02-ChtSb8eO.js → Loading02-8PRXrpou.js} +1 -1
- package/dist/client/assets/{Monitor01-L8_sCfVc.js → Monitor01-DHJyQ_kz.js} +1 -1
- package/dist/client/assets/{Palette-Cmey6VAa.js → Palette-D_lkOnBw.js} +1 -1
- package/dist/client/assets/{Play-Bu_9vwKG.js → Play-_cajpL44.js} +1 -1
- package/dist/client/assets/{Plus-5idR36sg.js → Plus-DNXyFi3K.js} +1 -1
- package/dist/client/assets/{SearchLg-DPP5sFCQ.js → SearchLg-DZwERN6V.js} +1 -1
- package/dist/client/assets/{SearchMd-BfTX24Hu.js → SearchMd-D-hUUaFS.js} +1 -1
- package/dist/client/assets/{Settings02-CQu3SnQJ.js → Settings02-La9BPNoQ.js} +1 -1
- package/dist/client/assets/{Shield01-BvX9ixjn.js → Shield01-t0UkG_Fu.js} +1 -1
- package/dist/client/assets/{Star01-BnD2dU2r.js → Star01-Vp5jNxy-.js} +1 -1
- package/dist/client/assets/{Stars01-DDJPZfVf.js → Stars01-DzGOGcyE.js} +1 -1
- package/dist/client/assets/{Stars02-BvMFoF7B.js → Stars02-DEt9kiBB.js} +1 -1
- package/dist/client/assets/{Sun-KNxCahoc.js → Sun-D3e2kVWD.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BoSKzb4-.js → SwitchHorizontal01-DywB6wR-.js} +1 -1
- package/dist/client/assets/{Tool01-CxxzyTgu.js → Tool01-BWJW2W9Q.js} +1 -1
- package/dist/client/assets/{Trash01-BIMqCoAe.js → Trash01-Bw4Y_fB0.js} +1 -1
- package/dist/client/assets/{Upload01-koOiZigp.js → Upload01-DNGqtihL.js} +1 -1
- package/dist/client/assets/{User01-CpMygYKK.js → User01-Kj6tpX8J.js} +1 -1
- package/dist/client/assets/{Users01-Cpgt7AAw.js → Users01-BHFcKE6V.js} +1 -1
- package/dist/client/assets/{Users03-D4_vSnDO.js → Users03-DL337Un-.js} +1 -1
- package/dist/client/assets/{X-CKo1zMxh.js → X-Dur8Z-Za.js} +1 -1
- package/dist/client/assets/{XCircle-B-Q051bA.js → XCircle-CBMT0KL4.js} +1 -1
- package/dist/client/assets/{XClose-D-GHscRg.js → XClose-Dw5u5Ptt.js} +1 -1
- package/dist/client/assets/{Zap-BoJ6IPGQ.js → Zap-Ci4q4Rqw.js} +1 -1
- package/dist/client/assets/{ZapSquare-hsOEtcoH.js → ZapSquare-BKMxUjl5.js} +1 -1
- package/dist/client/assets/{ZoomOut-CJycF6CW.js → ZoomOut-HEnwOMfN.js} +1 -1
- package/dist/client/assets/{access-gate-Bf-5_XN0.js → access-gate-jwtP_GBZ.js} +1 -1
- package/dist/client/assets/add-section-modal-BA4wLToL.js +1 -0
- package/dist/client/assets/{agent-capabilities-7Ww0Mzev.js → agent-capabilities-B2MQDL39.js} +1 -1
- package/dist/client/assets/{agent-icon-BcaN-4kc.js → agent-icon-CmQR7VYX.js} +1 -1
- package/dist/client/assets/{agents-list-B11Cm-UP.js → agents-list-xOxbtiew.js} +1 -1
- package/dist/client/assets/{ai-providers-CaQhqgBI.js → ai-providers-lPoA9O4z.js} +1 -1
- package/dist/client/assets/{alert-C0TuOF91.js → alert-T1HcG_-8.js} +1 -1
- package/dist/client/assets/{alert-dialog-D4mo4prS.js → alert-dialog-s3u3eE8R.js} +3 -3
- package/dist/client/assets/app-editor-CSARpVTj.js +1 -0
- package/dist/client/assets/{auth-TnEGxV6g.js → auth-ByhUq4a_.js} +1 -1
- package/dist/client/assets/{auth-catchall-ANwsdj50.js → auth-catchall-CVGTphXP.js} +1 -1
- package/dist/client/assets/{auth-entry-M9O8Mhwg.js → auth-entry-B2qhbyMd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bgejkyeq.js → auth-split-layout-hXoKYrxt.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-XGlotzfu.js → authenticate-and-persist-oauth--jV2-M4K.js} +1 -1
- package/dist/client/assets/{automation-list-row-B3vcRgR1.js → automation-list-row-BbhqzIWL.js} +1 -1
- package/dist/client/assets/{automation-runs-8slOPeUz.js → automation-runs-BgY5daU-.js} +2 -2
- package/dist/client/assets/{automations-QXIV5Yst.js → automations-DqkxCDOd.js} +1 -1
- package/dist/client/assets/{autosend-DzoVWdRW.js → autosend-dMnF67ZR.js} +1 -1
- package/dist/client/assets/{avatar-C7KRhBwX.js → avatar-Dgp_8vlO.js} +1 -1
- package/dist/client/assets/{badge-Bww7_SxY.js → badge-DFPi3DPJ.js} +1 -1
- package/dist/client/assets/{block-document-rdQzyaH9.js → block-document-CWw457Q5.js} +3 -3
- package/dist/client/assets/{brand-context-2Uz155GG.js → brand-context-BTxfkcRU.js} +1 -1
- package/dist/client/assets/{breadcrumb-DuPQdZsM.js → breadcrumb-DRdhsGPh.js} +1 -1
- package/dist/client/assets/{buckets-DLT3b1Xt.js → buckets-BJgc_S1f.js} +1 -1
- package/dist/client/assets/bulk-category-panel-BhkFtloe.js +1 -0
- package/dist/client/assets/{calendar-C0w3gJKi.js → calendar-CiYduEHg.js} +1 -1
- package/dist/client/assets/{capability-load-error-DLHaUA0D.js → capability-load-error-BhvoK8h4.js} +1 -1
- package/dist/client/assets/{card-CT0bI_1b.js → card-Bpu7lsLm.js} +1 -1
- package/dist/client/assets/category-editor-CtlwU2G1.js +1 -0
- package/dist/client/assets/{chat-context-k_ubGfLV.js → chat-context-CXarely7.js} +1 -1
- package/dist/client/assets/{checkbox-Dws3TE4J.js → checkbox-DH7SmeG6.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D1Prk1op.js → cli-auth-success-C47I99I4.js} +1 -1
- package/dist/client/assets/collection-detail-DEvQhyxM.js +1 -0
- package/dist/client/assets/{collection-display-button-BnoQl1k_.js → collection-display-button-BbYZf4Ds.js} +1 -1
- package/dist/client/assets/{collection-search-CZrjnOFy.js → collection-search-FxDkU1LY.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-NhFfrP1I.js → collection-table-wrapper-pItFXUgd.js} +1 -1
- package/dist/client/assets/{collection-tabs-SM9omXek.js → collection-tabs-D3R2hyly.js} +1 -1
- package/dist/client/assets/{command-aBXeGVCo.js → command-V21ANmhD.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Dn-u4i3k.js → commerce-onboarding-5jhAYX7W.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CeYIwLB3.js → connect-desktop-dialog-C182LszJ.js} +1 -1
- package/dist/client/assets/{connection-card-DpwwtZkm.js → connection-card-h9ojCe1y.js} +1 -1
- package/dist/client/assets/connection-detail--9fwdqbY.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CH063jU_.js → connection-form-helpers-Bpf1pKYB.js} +1 -1
- package/dist/client/assets/connections-DlVIUTDY.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-BfoUPePd.js → decopilot-sse-pool-r20ANcgR.js} +1 -1
- package/dist/client/assets/{dialog-BIK8Tom0.js → dialog-mIunfNF1.js} +1 -1
- package/dist/client/assets/{domain-settings-CTrHf9tM.js → domain-settings-DDdK4fqJ.js} +1 -1
- package/dist/client/assets/{drawer-DjMWbbKo.js → drawer-BbVPD459.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CxpBgxyz.js → dropdown-menu-Ckt1rFkP.js} +1 -1
- package/dist/client/assets/{empty-state-B1Pvl14I.js → empty-state-D1uvzlNE.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DiTS4nsP.js → extract-connection-data-C5iMuAQ4.js} +1 -1
- package/dist/client/assets/file-explorer-DnkEAc9s.js +2 -0
- package/dist/client/assets/{file-type-icon-BSbth4Md.js → file-type-icon-M0r5z8Et.js} +1 -1
- package/dist/client/assets/{files-Bru4iSiG.js → files-myRMunMH.js} +1 -1
- package/dist/client/assets/{form-CaX_nL78.js → form-DFTCc20c.js} +1 -1
- package/dist/client/assets/{general-CZckrZnJ.js → general-W0gODQ6-.js} +1 -1
- package/dist/client/assets/github-repo-picker-DLDIrQSt.js +1 -0
- package/dist/client/assets/{hooks-Besk-JeM.js → hooks-BoTVA0mi.js} +1 -1
- package/dist/client/assets/{index-LSjVPeX9.js → index-9gM0pWop.js} +3 -3
- package/dist/client/assets/{index-DQTJ9UtC.js → index-B4nnSk_C.js} +1 -1
- package/dist/client/assets/{index-mJLFSMtO.js → index-B9enrohW.js} +1 -1
- package/dist/client/assets/{index-C3vL-FSh.js → index-BUPmS7n0.js} +1 -1
- package/dist/client/assets/{index-DHDmhkFR.js → index-Bt6oyrQ_.js} +2 -2
- package/dist/client/assets/{index-Zu_Nc85c.js → index-CC_UV35u.js} +1 -1
- package/dist/client/assets/{index-C4Rok0Ak.js → index-CEeQ9vEp.js} +1 -1
- package/dist/client/assets/{index-Dbp2tz6n.js → index-CHTXbbov.js} +11 -11
- package/dist/client/assets/{index-BzdhcJRl.js → index-CHi6_Wje.js} +1 -1
- package/dist/client/assets/{index-Dho2GOgD.js → index-CJXI6-WF.js} +1 -1
- package/dist/client/assets/{index-BnWpXqRN.js → index-DK0NGyFF.js} +1 -1
- package/dist/client/assets/index-DhHJ9QL9.css +1 -0
- package/dist/client/assets/index-DiNsudt7.js +217 -0
- package/dist/client/assets/{index-DlaPc07g.js → index-E_NWIv9K.js} +1 -1
- package/dist/client/assets/{index-CEaizLnj.js → index-cyQt4Yyx.js} +1 -1
- package/dist/client/assets/{index-redirect-A9yKajXK.js → index-redirect-Qq82m_VH.js} +1 -1
- package/dist/client/assets/{input-Dorl9omt.js → input-CmSWz8o2.js} +1 -1
- package/dist/client/assets/{integration-icon-BA2vV2po.js → integration-icon-CfSC6rtu.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BvEWnmxX.js → invite-member-dialog-vLfngyFn.js} +1 -1
- package/dist/client/assets/{label-C5iFhVJI.js → label-B9xXuLAT.js} +1 -1
- package/dist/client/assets/{login-Bq9AUaMz.js → login-CHp34Afr.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Di76FXht.js → mcp-oauth-D1IBLEDf.js} +1 -1
- package/dist/client/assets/{members-CZt-A3ZF.js → members-BcF8CilA.js} +1 -1
- package/dist/client/assets/{monaco-editor-BAUIVH5o.js → monaco-editor-6edrpcHw.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-DEg2p21r.js → monitoring-stats-row-BRbRwEAL.js} +1 -1
- package/dist/client/assets/{oauth-callback-QcbFbT7S.js → oauth-callback-DYKqJbSu.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B55r28UG.js → oauth-callback-ai-provider-DvpcJBwZ.js} +1 -1
- package/dist/client/assets/{onboarding-_839Bkd7.js → onboarding-D4C_zKzK.js} +1 -1
- package/dist/client/assets/{org-install-CaItI9bT.js → org-install-BC6pCgZy.js} +1 -1
- package/dist/client/assets/{org-layout-D5oupmn-.js → org-layout-Dkkja8eZ.js} +1 -1
- package/dist/client/assets/{organization-choice-Dm7VUtfU.js → organization-choice-BjUcpzh8.js} +1 -1
- package/dist/client/assets/page-seo-form-CSWsbdF5.js +1 -0
- package/dist/client/assets/page-seo-sheet-Banc0NEt.js +1 -0
- package/dist/client/assets/{popover-0tZDxpLx.js → popover-DqOLJjYt.js} +1 -1
- package/dist/client/assets/post-editor-Cb7vz9kK.js +1 -0
- package/dist/client/assets/{primitives-B0hpR4Gt.js → primitives-DKofhleV.js} +1 -1
- package/dist/client/assets/{profile-BOY0w03d.js → profile-CwevXg0F.js} +1 -1
- package/dist/client/assets/project-app-view-CUgkYG3W.js +1 -0
- package/dist/client/assets/record-editor-ld08pUMz.js +1 -0
- package/dist/client/assets/registry-CBGYdqJy.js +2 -0
- package/dist/client/assets/{registry-layout-Bmen9Q_w.js → registry-layout-BMGVPsMn.js} +1 -1
- package/dist/client/assets/{require-capability-Bg2o22fO.js → require-capability-DB46Pdpe.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CP87uq0l.js → required-auth-layout-DQViUcsZ.js} +1 -1
- package/dist/client/assets/{reset-password-t3HEiFrB.js → reset-password-CK8xjWrh.js} +1 -1
- package/dist/client/assets/{roles-fy-KeFfZ.js → roles-DUBXClvI.js} +1 -1
- package/dist/client/assets/{search-input-edISIFhV.js → search-input-o4YKXrM-.js} +1 -1
- package/dist/client/assets/{secrets-BFjZnM3g.js → secrets-CGLIyZvB.js} +1 -1
- package/dist/client/assets/sections-editor-Crq3mMkJ.js +2 -0
- package/dist/client/assets/{select-CZz3tZl9.js → select-CwHjJZxE.js} +1 -1
- package/dist/client/assets/{select-model-DJ6QJz4n.js → select-model-idoIFrun.js} +2 -2
- package/dist/client/assets/{seo-editor-B-nGTTTS.js → seo-editor-DxzM_oef.js} +1 -1
- package/dist/client/assets/{settings-layout-Ce06Eqmh.js → settings-layout-qlC4ancf.js} +1 -1
- package/dist/client/assets/{settings-section-QMAuLmMF.js → settings-section-DiyBI0p4.js} +1 -1
- package/dist/client/assets/{shell-controls-DYYLVCg-.js → shell-controls-BdDjUbBC.js} +1 -1
- package/dist/client/assets/{shell-layout-BXL8LQO9.js → shell-layout-BWNLY1YB.js} +1 -1
- package/dist/client/assets/{sidebar-BrKreIfO.js → sidebar-BmZkvg7r.js} +1 -1
- package/dist/client/assets/{skeleton-IazyrK3c.js → skeleton-d4B9XvAo.js} +1 -1
- package/dist/client/assets/{sso-seAE7zti.js → sso-dPAU3wlS.js} +1 -1
- package/dist/client/assets/{store-CeLvICwM.js → store-BNc3SLhL.js} +1 -1
- package/dist/client/assets/store-registry-DKQX9wKw.js +2 -0
- package/dist/client/assets/{studio-tools-BpLcN2_F.js → studio-tools-BJ0Qkwde.js} +1 -1
- package/dist/client/assets/{switch-s20BBoMQ.js → switch-BxrDKURr.js} +1 -1
- package/dist/client/assets/tab-id-DAJ8K7VA.js +1 -0
- package/dist/client/assets/{table-BemIEL7_.js → table-Xfjmxtui.js} +1 -1
- package/dist/client/assets/{tabs-C64C5tAR.js → tabs-DdfjC_o8.js} +1 -1
- package/dist/client/assets/{textarea-pi_2NO_-.js → textarea-OL70WZGE.js} +1 -1
- package/dist/client/assets/{toggle-group-Bcm6y1ek.js → toggle-group-DV8Zx8Ay.js} +1 -1
- package/dist/client/assets/toolbar-WlEFPDs8.js +1 -0
- package/dist/client/assets/{toolbar-icon-button-f24bAtkM.js → toolbar-icon-button-Cux-De1p.js} +1 -1
- package/dist/client/assets/{tools-list-CIErjvXL.js → tools-list-D_E-h8Xe.js} +1 -1
- package/dist/client/assets/{tooltip-CydqKsA_.js → tooltip-76CNxa0k.js} +1 -1
- package/dist/client/assets/{types-5HxTY4AH.js → types-BB1jNEFr.js} +3 -3
- package/dist/client/assets/{use-ai-providers-DZ911KMX.js → use-ai-providers-wCtA7FyN.js} +1 -1
- package/dist/client/assets/{use-automations-9xQWIU-d.js → use-automations-BUVfsajQ.js} +1 -1
- package/dist/client/assets/{use-capability-BYGPZ1D7.js → use-capability-C0on-UG3.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DUJqyX8q.js → use-clock-tick-DQFIRULM.js} +1 -1
- package/dist/client/assets/{use-collections-D1y6LTm_.js → use-collections-D64OZMP5.js} +1 -1
- package/dist/client/assets/{use-connection-CP2AuPqM.js → use-connection-CESoyj30.js} +1 -1
- package/dist/client/assets/{use-copy-VlG9OPMK.js → use-copy-DXRHRy3k.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CvhecNl0.js → use-create-virtual-mcp-Z0tu5okZ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DExHtN-l.js → use-debounced-autosave-BfHNWB6a.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CPVLb6a1.js → use-debounced-value-J9Owrphs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-eFXvDChG.js → use-decopilot-events-iOO06bl2.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B63SRTFu.js → use-delete-connection-Be5c2BHf.js} +1 -1
- package/dist/client/assets/{use-file-configs-CQz8KxZG.js → use-file-configs-Bk5oOklp.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CMwn1DgB.js → use-infinite-scroll-BAleyRHG.js} +1 -1
- package/dist/client/assets/{use-join-requests-Id_ktqQL.js → use-join-requests-Dvy7cbad.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BsQuo4Md.js → use-mcp-client-CLRfC1wx.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CU1SlYv5.js → use-mcp-prompts-DO1Yp12I.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cyf7GlEc.js → use-mcp-tools-B-eRGQ3S.js} +1 -1
- package/dist/client/assets/{use-members-BdFrMhZQ.js → use-members-DtisIxk_.js} +1 -1
- package/dist/client/assets/{use-mobile-BaYDLsxM.js → use-mobile-Br8RngNM.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Pq_i3MPp.js → use-navigate-to-agent-CbM55DRt.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DJUVn8l4.js → use-org-auth-client-Bt5tMO5f.js} +1 -1
- package/dist/client/assets/{use-org-sso-BuHqqjwY.js → use-org-sso-92hmv2kj.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BeecqeuV.js → use-organization-roles-CNAnfCxi.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BWg3tHRJ.js → use-organization-settings-Jtb68vdP.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CYI61Q6O.js → use-registry-connections-CUygRLiX.js} +1 -1
- package/dist/client/assets/{use-secrets-_BVoLH4e.js → use-secrets-kA2FYkL5.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BrY0FSuJ.js → use-status-sounds-CCyOrel4.js} +1 -1
- package/dist/client/assets/{use-view-mode-C0I-L3JD.js → use-view-mode-CPuTvdY-.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DGj5HLRt.js → use-virtual-mcp-SJZFwIbn.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-KWlqlVrT.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DVYIL8L1.js +1 -0
- package/dist/client/assets/{variant-calendar-CBLO0B-V.js → variant-calendar-BRqfYBIT.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BOwhpQmu.js → view-mode-toggle-CwK1jegn.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +424 -404
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BP9Tx8i_.js +0 -1
- package/dist/client/assets/app-editor-CsYgkuW0.js +0 -1
- package/dist/client/assets/bulk-category-panel-e2nnRlgr.js +0 -1
- package/dist/client/assets/category-editor-cs9Ty-6l.js +0 -1
- package/dist/client/assets/collection-detail-COZr3qmE.js +0 -1
- package/dist/client/assets/connection-detail-DMkDWl6i.js +0 -1
- package/dist/client/assets/connections-BbPSnxYn.js +0 -1
- package/dist/client/assets/file-explorer-E_BWBfrL.js +0 -2
- package/dist/client/assets/github-repo-picker-BMrTazj0.js +0 -1
- package/dist/client/assets/index-CLaL3vnE.js +0 -519
- package/dist/client/assets/index-dPmP2Tp4.css +0 -1
- package/dist/client/assets/page-seo-form-BZnZl9y-.js +0 -1
- package/dist/client/assets/page-seo-sheet-_NhvVN_8.js +0 -1
- package/dist/client/assets/post-editor-CdzeQ2uD.js +0 -1
- package/dist/client/assets/project-app-view-Ciuwcn26.js +0 -1
- package/dist/client/assets/record-editor-C-pGHfgi.js +0 -1
- package/dist/client/assets/registry-Cvi1orAO.js +0 -2
- package/dist/client/assets/sections-editor-BxcBalTL.js +0 -2
- package/dist/client/assets/store-registry-DaWic-RW.js +0 -2
- package/dist/client/assets/tab-id-DznSzCvK.js +0 -1
- package/dist/client/assets/toolbar-Dv_CE5oq.js +0 -1
- package/dist/client/assets/useInfiniteQuery-OBUJ2wGg.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-bm5CR5SP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t,P as
|
|
1
|
+
import{c as p,j as t,P as D,r as j,aC as w,B as S,t as y}from"./index-CHTXbbov.js";import{i as k}from"./AlertCircle-C2zWCKFU.js";import{s as z}from"./Plus-DNXyFi3K.js";import{s as F}from"./User01-Kj6tpX8J.js";import{t as E}from"./Users01-BHFcKE6V.js";import{e as $,d as I,c as O,a as A,b as R,D as T}from"./dialog-mIunfNF1.js";import{I as N}from"./input-CmSWz8o2.js";import{L as g}from"./label-B9xXuLAT.js";import{a as B,c as V,d as L,S as q,b as C}from"./select-CwHjJZxE.js";import{S as H}from"./skeleton-d4B9XvAo.js";import{T as K}from"./textarea-OL70WZGE.js";import{P as b}from"./index-cyQt4Yyx.js";import{c as W}from"./settings-section-DiyBI0p4.js";import{u as Y,a as G}from"./use-secrets-kA2FYkL5.js";import{R as J}from"./require-capability-DB46Pdpe.js";import"./X-Dur8Z-Za.js";import"./tooltip-76CNxa0k.js";import"./Check-BRK73b5S.js";import"./ChevronDown-Cl64FuM7.js";import"./ChevronUp-Bd8WwASv.js";import"./sidebar-BmZkvg7r.js";import"./LayoutLeft-DZ1o8wY9.js";import"./use-mobile-Br8RngNM.js";import"./card-Bpu7lsLm.js";import"./ArrowUpRight-CEd_dX9G.js";import"./studio-tools-BJ0Qkwde.js";import"./use-capability-C0on-UG3.js";import"./access-gate-jwtP_GBZ.js";import"./capability-load-error-BhvoK8h4.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function P(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(P,{secret:s},s.id)}function ee(s){return t.jsx(P,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(D,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as He,r as R,l as Be,j as n,B as We,i as zn,p as Ss,t as G,K as xs}from"./index-CHTXbbov.js";import{M as ys,N as bs,O as _s,y as Hn,z as It,K as Un,P as Gn,Q as Wn,R as js,w as qn,C as Jn,T as ks,G as ws,V as Rs,A as Yn,B as Rt,F as Qn,H as Xn,D as Zn,E as ea,U as ta,W as Ds,X as Dt,Y as mt,Z as bt,_ as Ns,$ as Vs,a0 as Cs,b as Ts,c as Ps,a1 as As,a2 as Ms,a3 as Es,a4 as Ks,v as $t,a5 as Ot,a6 as $s,a7 as ut,a8 as kt,a9 as Os,aa as Bs,ab as Ye,ac as Vn,ad as Fs,ae as Cn,af as Bt,ag as Ls,ah as an,ai as Is,aj as et,ak as zs,al as Hs,am as Us,an as Gs,ao as Ws,ap as qs,aq as dt,ar as Js,as as Ys,at as Qs,au as Tn,av as wt,e as Xs,aw as Zs,ax as er,ay as tr,az as nr,aA as sn,aB as Pn,aC as An,aD as yt,aE as Ft,aF as ar,aG as rn,aH as sr,aI as rr,f as na,aJ as Mn,aK as or}from"./index-DiNsudt7.js";import{t as ir}from"./ChevronDown-Cl64FuM7.js";import{s as aa,n as lr}from"./Loading02-8PRXrpou.js";import{i as sa}from"./ChevronRight-BiUpAxck.js";import{n as cr}from"./ChevronUp-Bd8WwASv.js";import{G as ln,F as ra,J as ur,T as dr,L as mr}from"./agent-icon-CmQR7VYX.js";import{i as fr}from"./Globe01-C8lrsv2j.js";import{B as Lt}from"./automation-runs-BgY5daU-.js";import{T as ft,a as pt,b as ht}from"./tooltip-76CNxa0k.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-mIunfNF1.js";import{I as yr}from"./input-CmSWz8o2.js";import{a as oa}from"./Copy01-BQ_PiBJg.js";import{a as br}from"./ZoomOut-HEnwOMfN.js";import{i as _r}from"./Settings02-La9BPNoQ.js";import{s as jr}from"./Eye-9-W42Pav.js";import{s as cn}from"./Plus-DNXyFi3K.js";import{s as ia}from"./Trash01-Bw4Y_fB0.js";import{i as kr}from"./Zap-Ci4q4Rqw.js";import{d as it,a as la,D as ca,c as ua,j as wr}from"./dropdown-menu-Ckt1rFkP.js";import{r as En,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Tr,b as Pr,S as Ar}from"./page-seo-form-CSWsbdF5.js";import{c as Mr}from"./Tool01-BWJW2W9Q.js";import{A as Er}from"./add-section-modal-BA4wLToL.js";import"./SwitchHorizontal01-DywB6wR-.js";import"./chat-context-CXarely7.js";import"./autosend-dMnF67ZR.js";import"./hooks-BoTVA0mi.js";import"./use-mcp-client-CLRfC1wx.js";import"./constants-B72Xmt_K.js";import"./auth-ByhUq4a_.js";import"./decopilot-sse-pool-r20ANcgR.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-SJZFwIbn.js";import"./use-collections-D64OZMP5.js";import"./use-ai-providers-wCtA7FyN.js";import"./studio-tools-BJ0Qkwde.js";import"./use-decopilot-events-iOO06bl2.js";import"./tab-id-DAJ8K7VA.js";import"./use-organization-settings-Jtb68vdP.js";import"./drawer-BbVPD459.js";import"./collection-search-FxDkU1LY.js";import"./SearchMd-D-hUUaFS.js";import"./use-mobile-Br8RngNM.js";import"./use-mcp-prompts-DO1Yp12I.js";import"./X-Dur8Z-Za.js";import"./shell-layout-BWNLY1YB.js";import"./avatar-Dgp_8vlO.js";import"./User01-Kj6tpX8J.js";import"./Users03-DL337Un-.js";import"./SearchLg-DZwERN6V.js";import"./Stars02-DEt9kiBB.js";import"./XClose-Dw5u5Ptt.js";import"./CheckCircle-Bc6DVWpl.js";import"./FilterLines-DAOyUgW1.js";import"./alert-dialog-s3u3eE8R.js";import"./required-auth-layout-DQViUcsZ.js";import"./use-org-sso-92hmv2kj.js";import"./ZapSquare-BKMxUjl5.js";import"./Check-BRK73b5S.js";import"./Star01-Vp5jNxy-.js";import"./Upload01-DNGqtihL.js";import"./AlertCircle-C2zWCKFU.js";import"./form-DFTCc20c.js";import"./label-B9xXuLAT.js";import"./select-CwHjJZxE.js";import"./XCircle-CBMT0KL4.js";import"./tabs-DdfjC_o8.js";import"./toggle-group-DV8Zx8Ay.js";import"./agent-capabilities-B2MQDL39.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-h9ojCe1y.js";import"./use-registry-connections-CUygRLiX.js";import"./use-connection-CESoyj30.js";import"./useInfiniteQuery-KWlqlVrT.js";import"./use-infinite-scroll-BAleyRHG.js";import"./extract-connection-data-C5iMuAQ4.js";import"./card-Bpu7lsLm.js";import"./integration-icon-CfSC6rtu.js";import"./collection-tabs-D3R2hyly.js";import"./badge-DFPi3DPJ.js";import"./textarea-OL70WZGE.js";import"./connection-form-helpers-Bpf1pKYB.js";import"./authenticate-and-persist-oauth--jV2-M4K.js";import"./mcp-oauth-D1IBLEDf.js";import"./useSuspenseInfiniteQuery-DVYIL8L1.js";import"./Monitor01-DHJyQ_kz.js";import"./connect-desktop-dialog-C182LszJ.js";import"./select-model-idoIFrun.js";import"./checkbox-DH7SmeG6.js";import"./skeleton-d4B9XvAo.js";import"./Key01-Bii-u3if.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DiyBI0p4.js";import"./ArrowUpRight-CEd_dX9G.js";import"./Stars01-DzGOGcyE.js";import"./command-V21ANmhD.js";import"./index-DK0NGyFF.js";import"./popover-DqOLJjYt.js";import"./index-Bt6oyrQ_.js";import"./Palette-D_lkOnBw.js";import"./file-type-icon-M0r5z8Et.js";import"./toolbar-WlEFPDs8.js";import"./use-debounced-value-J9Owrphs.js";import"./DotsVertical-BajBw7s_.js";import"./LinkExternal01-DzEGzhif.js";import"./index-9gM0pWop.js";import"./LayoutLeft-DZ1o8wY9.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CCyOrel4.js";import"./empty-state-D1uvzlNE.js";import"./Users01-BHFcKE6V.js";import"./use-mcp-tools-B-eRGQ3S.js";import"./types-BB1jNEFr.js";import"./use-capability-C0on-UG3.js";import"./tools-list-D_E-h8Xe.js";import"./switch-BxrDKURr.js";import"./Play-_cajpL44.js";import"./use-debounced-autosave-BfHNWB6a.js";import"./index-cyQt4Yyx.js";import"./sidebar-BmZkvg7r.js";import"./search-input-o4YKXrM-.js";import"./github-repo-picker-DLDIrQSt.js";import"./use-navigate-to-agent-CbM55DRt.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-kA2FYkL5.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-DtisIxk_.js";import"./use-org-auth-client-Bt5tMO5f.js";import"./index-B4nnSk_C.js";import"./get-initials-D-f_fDFw.js";import"./List-BLq_vEGx.js";import"./format-time-Cy7tTmZp.js";import"./Circle-CVEWxAkn.js";import"./calendar-CiYduEHg.js";import"./toolbar-icon-button-Cux-De1p.js";import"./use-automations-BUVfsajQ.js";import"./monaco-editor-6edrpcHw.js";import"./automation-list-row-BbhqzIWL.js";import"./use-file-configs-Bk5oOklp.js";import"./Globe04-Ben7MbOW.js";import"./HardDrive-s5-cqKOl.js";import"./Sun-D3e2kVWD.js";import"./Shield01-t0UkG_Fu.js";import"./table-Xfjmxtui.js";import"./use-clock-tick-DQFIRULM.js";import"./use-copy-DXRHRy3k.js";function Kr(d){return d.schema?.definitions??d.schema?.$defs??{}}function $r(d,e){const r=Kr(e),l=r[btoa(d)];if(!l)return;let u=typeof l.image=="string"?l.image:void 0;if(!u&&Array.isArray(l.allOf)){const h=l.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),m=r[S];u=typeof m?.image=="string"?m.image:void 0}}if(u?.includes("{{{"))return u}function Or(d,e){if(!e)return;const r=ys(d);if(!r)return;const l=$r(r.resolveType,e);if(!l)return;const u=bs(l,r.data);if(u)return _s(u)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Fr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Kn(d){return Array.from({length:d},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(d){return d.map((e,r)=>({...e,index:r}))}function Lr(d,e){if(e===d.length)return d;if(e<d.length)return da(d.slice(0,e));const r=Array.from({length:e-d.length},(l,u)=>({id:crypto.randomUUID(),index:d.length+u}));return[...d,...r]}function ma(d){const e=He.c(20),{section:r,raw:l,meta:u}=d,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let m;e[0]!==u||e[1]!==l?(m=l&&u?Or(l,u):void 0,e[0]=u,e[1]=l,e[2]=m):m=e[2];const v=m;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let N;e[6]!==S||e[7]!==h?(N=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=N):N=e[8];let k;e[9]!==N?(k=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:N}),e[9]=N,e[10]=k):k=e[10];const _=r.isHidden&&"line-through opacity-50";let w;e[11]!==_?(w=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=w):w=e[12];let o;e[13]!==r.label||e[14]!==w?(o=n.jsx("span",{className:w,children:r.label}),e[13]=r.label,e[14]=w,e[15]=o):o=e[15];let D;return e[16]!==y||e[17]!==k||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,y,k,o]}),e[16]=y,e[17]=k,e[18]=o,e[19]=D):D=e[19],D}function fa(d,e){const r=d.isSavedBlock===!0,l=d.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:l?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(d){const e=He.c(64),{section:r,raw:l,meta:u,sortableId:h,selected:S,onSelect:m,onDelete:v,onDuplicate:g,onMakeReusable:y,onToggleHidden:N,onToggleLazy:k,onAddVariant:_,onDetach:w}=d,o=l?Wn(l.__resolveType??""):!1;let D;e[0]!==r?(D=js(r),e[0]=r,e[1]=D):D=e[1];const c=D;let Y;e[2]!==h?(Y={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=Y):Y=e[3];const{attributes:H,listeners:K,setNodeRef:f,transform:T,isDragging:se}=qn(Y);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let V;e[6]!==P||e[7]!==pe?(V={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=V):V=e[8];const ce=V;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==m?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),m())},e[11]=m,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==u||e[18]!==l||e[19]!==r?(je=n.jsx(ma,{section:r,raw:l,meta:u}),e[17]=u,e[18]=l,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),k()},onPointerDown:Gr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(ht,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==N||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),N()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(ht,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=N,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(la,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(ra,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(oa,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let W;e[31]!==c||e[32]!==_?(W=c&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(aa,{className:"h-4 w-4"}),"Add variant"]}),e[31]=c,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==y?(q=te&&n.jsxs(it,{className:Fr,onClick:$=>{$.stopPropagation(),y()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=y,e[36]=q):q=e[36];let ne;e[37]!==w||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),w()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=w,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ia,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(ca,{children:[X,n.jsxs(ua,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==m||e[55]!==f||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:f,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:m,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=m,e[55]=f,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(d){return d.stopPropagation()}function Hr(d){return d.stopPropagation()}function Ur(d){return d.stopPropagation()}function Gr(d){return d.stopPropagation()}function Wr(){return!1}function qr(d){const e=He.c(90),{listKey:r,rawSections:l,sections:u,meta:h,selectedIndex:S,onSelect:m,onReorder:v,onDelete:g,onDuplicate:y,onMakeReusable:N,onToggleHidden:k,onToggleLazy:_,onAddVariant:w,onDetach:o,onAddSection:D,canAddSection:c}=d,Y=c===void 0?!0:c;let H;e[0]!==u.length?(H=()=>Kn(u.length),e[0]=u.length,e[1]=H):H=e[1];const[K,f]=R.useState(H),[T,se]=R.useState(null),[P,pe]=R.useState(r),[V,ce]=R.useState(u.length),B=R.useRef(!1);P!==r?(pe(r),ce(u.length),f(Kn(u.length))):V!==u.length&&(ce(u.length),f(F=>Lr(F,u.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Yn},e[3]=oe):oe=e[3];const Ce=Hn(It(Gn,te),It(Un,oe));let E;e[4]!==K?(E=K.map(Jr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=F=>{se(String(F.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=F=>{se(null);const{active:ae,over:Q}=F;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(f(Qe=>da(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==T||e[12]!==Y||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==w||e[19]!==g||e[20]!==o||e[21]!==y||e[22]!==N||e[23]!==m||e[24]!==k||e[25]!==_||e[26]!==l||e[27]!==u||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const F=ae=>{B.current||m(ae)};if(e[45]!==T||e[46]!==Y||e[47]!==K||e[48]!==D||e[49]!==l||e[50]!==u){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?u[ae.index]:null,W=ae!=null?l[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!Y;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=T,e[46]=Y,e[47]=K,e[48]=D,e[49]=l,e[50]=u,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Qn,Se=Ce,de=Xn,be=je,$=Ae,Z=Ne,ve=Zn,le=ue,ke=ea,Ke="space-y-1",ne=K.map(ae=>{const Q=u[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:l[ae.index],meta:h,selected:S===ae.index,onSelect:()=>F(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>y(ae.index),onMakeReusable:()=>N(ae.index),onToggleHidden:()=>k(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>w(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=Y,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=w,e[19]=g,e[20]=o,e[21]=y,e[22]=N,e[23]=m,e[24]=k,e[25]=_,e[26]=l,e[27]=u,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Fe;e[59]!==ne||e[60]!==Ke?(Fe=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Fe):Fe=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Fe?(Te=n.jsx(ve,{items:le,strategy:ke,children:Fe}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Fe,e[66]=Te):Te=e[66];let $e;e[67]!==W||e[68]!==q||e[69]!==h?($e=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=$e):$e=e[70];let Le;e[71]!==$e?(Le=n.jsx(ta,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Le):Le=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Le?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Le]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Le,e[81]=Me):Me=e[81];const xe=!Y;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(d){return d.id}function $n(d){const e=He.c(38),{open:r,initialName:l,autoLabel:u,isPending:h,onSubmit:S,onOpenChange:m}=d,v=h===void 0?!1:h,[g,y]=R.useState(l),[N,k]=R.useState(r);r!==N&&(k(r),r&&y(l));let _;e[0]!==v||e[1]!==m?(_=oe=>{!oe&&!v&&m(!1)},e[0]=v,e[1]=m,e[2]=_):_=e[2];const w=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(pr,{children:"Rename variant"}),e[7]=c):c=e[7];const Y=u||"the rule";let H;e[8]!==Y?(H=n.jsxs(hr,{children:[c,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Y}),"."]})]}),e[8]=Y,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=oe=>y(oe.target.value),e[11]=f):f=e[11];let T;e[12]!==u||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:f,placeholder:u,autoFocus:!0,disabled:v})]}),e[12]=u,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==m?(se=()=>m(!1),e[16]=m,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let V;e[23]!==v||e[24]!==pe?(V=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=V):V=e[25];let ce;e[26]!==P||e[27]!==V?(ce=n.jsxs(vr,{children:[P,V]}),e[26]=P,e[27]=V,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,T,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==w||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:w,children:B}),e[34]=w,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Yr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",pa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ha(d){const e=He.c(5),{rule:r,matchers:l}=d,u=r?.__resolveType??"";let h;if(e[0]!==l||e[1]!==u){const g=l.find(y=>y.resolveType===u)?.iconName??Ds(u);h=ur(g),e[0]=l,e[1]=u,e[2]=h}else h=e[2];const S=h;if(!S)return null;let m;return e[3]!==S?(m=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=m):m=e[4],m}function On(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function on(d){return d.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(d){return d.map((e,r)=>({...e,index:r}))}function ga(d){const e=He.c(16),{label:r,effectiveRule:l,matchers:u,canDelete:h,dragging:S,onRename:m,onDuplicate:v,onDelete:g}=d;let y;e[0]!==l||e[1]!==u?(y=n.jsx(ha,{rule:l,matchers:u}),e[0]=l,e[1]=u,e[2]=y):y=e[2];let N;e[3]!==r?(N=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=N):N=e[4];let k;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==m?(k=!S&&n.jsxs(ca,{children:[n.jsx(la,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(ra,{size:14})})}),n.jsxs(ua,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:w=>{w.stopPropagation(),m?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:w=>{w.stopPropagation(),v?.()},children:[n.jsx(oa,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:w=>{w.stopPropagation(),g?.()},children:[n.jsx(ia,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=m,e[11]=k):k=e[11];let _;return e[12]!==y||e[13]!==N||e[14]!==k?(_=n.jsxs(n.Fragment,{children:[y,N,k]}),e[12]=y,e[13]=N,e[14]=k,e[15]=_):_=e[15],_}function Xr(d){return d.stopPropagation()}function Zr(d){return d.stopPropagation()}function eo(d){const e=He.c(33),{entry:r,sortableId:l,isActive:u,canDelete:h,decofile:S,meta:m,matchers:v,onSelect:g,onRename:y,onDuplicate:N,onDelete:k}=d;let _;e[0]!==l?(_={id:l,animateLayoutChanges:to},e[0]=l,e[1]=_):_=e[1];const{attributes:w,listeners:o,setNodeRef:D,transform:c,isDragging:Y}=qn(_);let H;e[2]!==c?(H=Jn.Transform.toString(c?{...c,x:0}:null),e[2]=c,e[3]=H):H=e[3];const K=Y?0:void 0;let f;e[4]!==H||e[5]!==K?(f={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=f):f=e[6];const T=f,se=m??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Dt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let V;e[11]!==g?(V=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=V):V=e[12];const ce=Y?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=u?pa:Yr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==k||e[21]!==N||e[22]!==y?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:y,onDuplicate:N,onDelete:k}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=k,e[21]=N,e[22]=y,e[23]=oe):oe=e[23];let Ce;return e[24]!==w||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==V?(Ce=n.jsx("div",{ref:D,style:T,...w,...o,onClick:g,onKeyDown:V,className:te,children:oe}),e[24]=w,e[25]=o,e[26]=g,e[27]=D,e[28]=T,e[29]=te,e[30]=oe,e[31]=V,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(d){const e=He.c(9),{variant:r,decofile:l,meta:u,matchers:h}=d,S=u??void 0;let m;e[0]!==l||e[1]!==S||e[2]!==r.rule?(m=Dt(r.rule,l,S),e[0]=l,e[1]=S,e[2]=r.rule,e[3]=m):m=e[3];const v=m;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let y;return e[5]!==v||e[6]!==h||e[7]!==r.label?(y=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=y):y=e[8],y}function ao(d){const e=He.c(77),{listKey:r,variants:l,activeIndex:u,decofile:h,meta:S,matchers:m,onSelect:v,onReorder:g,onRename:y,onDuplicate:N,onDelete:k,onAdd:_}=d;let w;e[0]!==l?(w=()=>on(l),e[0]=l,e[1]=w):w=e[1];const[o,D]=R.useState(w),[c,Y]=R.useState(null),[H,K]=R.useState(r),[f,T]=R.useState(l.length);let se;e[2]!==l?(se=()=>On(l),e[2]=l,e[3]=se):se=e[3];const[P,pe]=R.useState(se),V=R.useRef(!1),ce=On(l);H!==r?(K(r),T(l.length),pe(ce),D(on(l))):f!==l.length?(T(l.length),pe(ce),D(on(l))):P!==ce&&(pe(ce),D(Me=>l.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Yn},e[5]=te):te=e[5];const oe=Hn(It(Gn,B),It(Un,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=l.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);Y(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{Y(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(F=>Qr(Rt([...F],me,ee))),V.current=!0,requestAnimationFrame(()=>{V.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Y(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==u||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==m||e[22]!==S||e[23]!==_||e[24]!==k||e[25]!==N||e[26]!==y||e[27]!==v||e[28]!==oe){const Me=F=>{V.current||v(F)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(ht,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(ft,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Qn,le=oe,ke=Xn,Se=je,de=Ae,be=Ne,ve=Zn,q=E,ne=ea,we="space-y-0.5",W=o.map(F=>n.jsx(eo,{sortableId:F.id,entry:F,isActive:F.index===u,canDelete:ue,decofile:h,meta:S,matchers:m,onSelect:()=>Me(F.index),onRename:()=>y(F.index),onDuplicate:()=>N(F.index),onDelete:()=>k(F.index)},F.id)),e[14]=u,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=m,e[22]=S,e[23]=_,e[24]=k,e[25]=N,e[26]=y,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ee;e[49]!==W||e[50]!==we?(Ee=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ee):Ee=e[51];let Ke;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ee?(Ke=n.jsx(ve,{items:q,strategy:ne,children:Ee}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ee,e[56]=Ke):Ke=e[56];let Fe;e[57]!==c||e[58]!==h||e[59]!==m||e[60]!==S?(Fe=c?n.jsx(no,{variant:c.variant,decofile:h,meta:S,matchers:m}):null,e[57]=c,e[58]=h,e[59]=m,e[60]=S,e[61]=Fe):Fe=e[61];let Te;e[62]!==Fe?(Te=n.jsx(ta,{dropAnimation:null,children:Fe}),e[62]=Fe,e[63]=Te):Te=e[63];let $e;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==Ke||e[71]!==Te?($e=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[Ke,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=Ke,e[71]=Te,e[72]=$e):$e=e[72];let Le;return e[73]!==$||e[74]!==Z||e[75]!==$e?(Le=n.jsxs("div",{className:$,children:[Z,$e]}),e[73]=$,e[74]=Z,e[75]=$e,e[76]=Le):Le=e[76],Le}function so(d){return d.id}function va({pageKey:d,prefix:e,variants:r,selectedIndex:l,decofile:u,meta:h}){if(!d||l<0||l>=r.length)return[];const S=[];for(let m=0;m<=l;m++){const v=r[m];if(!v)continue;const g=v.rule,y=m===l?"1":"0",k=(mt(g,u,h)?bt(g,u,h):null)??`${d}@${e}.${m}.rule`;S.push(`${k}=${y}`)}return S}function Bn(d,e,r,l){return!e.multivariate||e.variants.length<=1?[]:va({pageKey:d,prefix:"sections.variants",variants:e.variants,selectedIndex:e.index,decofile:r,meta:l})}function ro({pageKey:d,page:e,sectionIndex:r,sectionLazy:l,mvObj:u,selectedVariantIndex:h,decofile:S,meta:m}){if(r<0)return[];const g=`${e.multivariate?`sections.variants.${e.index}.value`:"sections"}.${r}${l?".section":""}.variants`,y=Array.isArray(u.variants)?u.variants:[];return va({pageKey:d,prefix:g,variants:y,selectedIndex:h,decofile:S,meta:m})}function Fn(d){const e=He.c(15),{schema:r,value:l,onChange:u,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}=d;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[y,N]=R.useState(g);let k;e[1]!==y?(k=y.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>N([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(lr,{className:"size-3.5"})}),y.map((o,D)=>{const c=D===y.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>N(y.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",c?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=y,e[2]=k):k=e[2];let _;e[3]!==y||e[4]!==S||e[5]!==h||e[6]!==u||e[7]!==m||e[8]!==v||e[9]!==r||e[10]!==l?(_=n.jsx(na,{schema:r,value:l,onChange:u,basePath:"",breadcrumbPath:y,onBreadcrumbChange:N,meta:h,decofile:S,onSaveReferencedBlock:m,sandbox:v}),e[3]=y,e[4]=S,e[5]=h,e[6]=u,e[7]=m,e[8]=v,e[9]=r,e[10]=l,e[11]=_):_=e[11];let w;return e[12]!==k||e[13]!==_?(w=n.jsxs("div",{className:"space-y-2",children:[k,_]}),e[12]=k,e[13]=_,e[14]=w):w=e[14],w}function Ln(d){const e=He.c(21),{activeSchema:r,formValue:l,formResetKey:u,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:m,emptyMessage:v,beforeForm:g,seoResolveType:y,siteDefaultSeo:N,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o}=d;let D;e[0]!==m?(D=m===void 0?[]:m,e[0]=m,e[1]=D):D=e[1];const c=D;let Y;e[2]!==r||e[3]!==c||e[4]!==_||e[5]!==u||e[6]!==l||e[7]!==k||e[8]!==S||e[9]!==h||e[10]!==w||e[11]!==o||e[12]!==y||e[13]!==N?(Y=r&&l?y?n.jsx(Ar,{schema:r,resolveType:y,value:l,formResetKey:u,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:N}):n.jsx(na,{schema:r,value:l,onChange:h,basePath:"",breadcrumbPath:c,onBreadcrumbChange:S,meta:k,decofile:_,onSaveReferencedBlock:w,sandbox:o},u):null,e[2]=r,e[3]=c,e[4]=_,e[5]=u,e[6]=l,e[7]=k,e[8]=S,e[9]=h,e[10]=w,e[11]=o,e[12]=y,e[13]=N,e[14]=Y):Y=e[14];const H=Y;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let f;return e[18]!==g||e[19]!==K?(f=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=f):f=e[20],f}const oo="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function io(d,e){return zs(d,e,et)}function lo(d){const e=He.c(13),{pageKey:r,initialName:l,initialPath:u,onFieldChange:h}=d,[S,m]=R.useState(l),[v,g]=R.useState(u),[y,N]=R.useState(r);y!==r&&(N(r),m(l),g(u));let k;e[0]!==h?(k=c=>{m(c.target.value),h("name",c.target.value)},e[0]=h,e[1]=k):k=e[1];let _;e[2]!==S||e[3]!==k?(_=n.jsx("input",{type:"text",value:S,onChange:k,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=k,e[4]=_):_=e[4];let w;e[5]!==h?(w=c=>{g(c.target.value),h("path",c.target.value)},e[5]=h,e[6]=w):w=e[6];let o;e[7]!==v||e[8]!==w?(o=n.jsx("input",{type:"text",value:v,onChange:w,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=w,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(d){const e=He.c(6),{onClick:r}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(aa,{size:14}),e[0]=l):l=e[0];let u;e[1]!==r?(u=n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:l})}),e[1]=r,e[2]=u):u=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ht,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==u?(S=n.jsxs(ft,{children:[u,h]}),e[4]=u,e[5]=S):S=e[5],S}function Ql({orgSlug:d,virtualMcpId:e,branch:r,previewReady:l=!0,previewUrl:u,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:m=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:y=!1,onExitSeo:N,onViewJsonFile:k,onVariantPreviewOverride:_}){const w=l?{orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u}:null,{data:o,isLoading:D}=Ns(w),{data:c,isLoading:Y}=Vs(w),H=Cs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[f,T]=R.useState(null),[se,P]=R.useState(null),[pe,V]=R.useState(null),[ce,B]=R.useState(0),[te,oe]=R.useState(void 0),[Ce,E]=R.useState(null),[ue,ie]=R.useState(null),[je,M]=R.useState([]),[Ae,X]=R.useState(0),[Ne,ve]=R.useState(null),[re,W]=R.useState(null),[q,ne]=R.useState(null),[le,ke]=R.useState(!0),[Se,de]=R.useState(!1),[be,$]=R.useState(!1),[Z,we]=R.useState(y),[Ee,Ke]=R.useState(y);y&&!Ee&&(Ke(!0),we(!0),T(null),P(null),V(null),M([])),!y&&Ee&&Ke(!1);const[Fe,Te]=R.useState(null),[$e,Le]=R.useState(void 0),[Me,xe]=R.useState([]),[Re,me]=R.useState(0),[ee,F]=R.useState(0),[ae,Q]=R.useState(null),[Ie,he]=R.useState(null),[Qe,un]=R.useState(null),Sa=Ss(),xa=`${d}/${e}/${r}`,zt=Ts({orgSlug:d,virtualMcpId:e,branch:r}),[ya,ba]=R.useState(h),[_a,ja]=R.useState(S),[ka,wa]=R.useState(m);(ya!==h||_a!==S||ka!==m)&&(queueMicrotask(()=>zt.flush()),ba(h),ja(S),wa(m),T(null),P(null),V(null),B(0),E(null),ie(null),F(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Le(void 0),xe([]),me(t=>t+1));const ye=Ps({orgSlug:d,virtualMcpId:e,branch:r}),Nt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ht=As({orgSlug:d,virtualMcpId:e,branch:r}),[_t,Vt]=R.useState(!1),Ut=R.useRef(null),gt=R.useRef(null),vt=R.useRef(null),Gt=R.useRef({}),qe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||D||Y)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Ra=Ms(o),_e=!!m,ze=_e?null:Es(Ra,h,S),j=_e?m:ze?.key??null,Wt=_e&&m?o[m]:void 0,dn=_e&&m&&Wt?Ks(m,Wt):_e&&m?m:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&c&&j&&ze?En(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},c):null,Da=Z?Ct?.seo:void 0,Jt=$e!==void 0?$e:Da,Na=Z?Rr(Jt):void 0,Va=qt?.seoTypeOptions??[],Ca=Z&&c?Dr(c):"",mn=Fe??Na??{},Yt=Z&&qt?Nr(mn,qt):null,Ta=Z&&Yt&&Vr(Jt)?$t(Yt,c):null,Pa=Z?Cr(o,c)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:m}]}]:io(Ct?.sections,o??{}),Tt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Pe=Ot(I,o),fn=!_e&&$s(Ct?.sections);if(_e&&m&&Qe!==m){un(m);const t=I[0],a=Pe[0];if(t&&a){T(0),F(0),M([]);const s=ut(t,a,o);s&&(P(s.data),V(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),qe.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:f};const Aa=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Bn(j,{multivariate:!0,index:a,variants:t},o,c);_(s.length>0?s:null)},St=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Aa(),p=Bn(j,i,o,c);if(!t||a<0){_(p.length>0?p:null);return}const b=ro({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:c}),x=[...p,...b];_(x.length>0?x:null)},nt=(t,a,s,i=f??-1,p=!1)=>{const b=Ye(t,a);if(!b){P(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const C=Vn(b,et)[s];if(!C){P(null),V(null),he(null),Q(null),p&&St(null,i,s);return}const J=Hs(C.value,o);P(J?.data??null),V(J?.resolveType??null);const{resolveType:A,formValue:O}=kt(C.rule,o,c??void 0);he(A),Q(O),p&&St(b,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),F(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),V(s.resolveType)):(P(null),V(null)),he(null),Q(null)}}const Pt={orgSlug:d,virtualMcpId:e,branch:r,previewUrl:u??void 0,siteSlug:K},Qt=pe&&c?$t(pe,c):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},xt=()=>{T(null),P(null),V(null),F(0),Q(null),he(null),M([]),X(t=>t+1)},Ma=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:J}=qe.current,A=i[a];if(!A)return;const O=p[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const L={...b[x]},ge=[...i];if(O.isMultivariate){const z=Ye(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Wn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=L.sections,U=[...z?.variants??[]];U[J]&&(U[J]={...U[J],value:ge}),L.sections={...z,variants:U}}else L.sections=ge;ye.mutate({blockKey:x,data:L},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},rn)},Ea=t=>{T(t),F(0),M([]),X(p=>p+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),V(null),he(null),Q(null),St(null,t,0);return}P(i.data),V(i.resolveType),he(null),Q(null),St(null,t,0)},hn=t=>{const a=t;P(a),f!==null&&Ma(a,f)},Xt=t=>{if(!j||!o||!c||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=En(o,a,c);s&&zt.save(j,()=>{const i=Sa.getQueryData(xs.decofile(xa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const p={...i,...Gt.current};return Gt.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Pr(a,s,p,t.inner):p})},Ka=(t,a)=>{j&&(Gt.current[t]=a,Xt())},$a=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);f!==null&&(f===t?T(a):t<f&&a>=f?T(f-1):t>f&&a<=f&&T(f+1)),Ue(s)},Oa=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);f===t?xt():f!==null&&f>t&&T(f-1),Ue(a)},Ba=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),f!==null&&f>t&&T(f+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},La=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const p=[...I];p[t]=i,f===t&&xt(),Ue(p)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:p,...b}=i.data,x=[...I];s.isLazy?x[t]={...a,section:b}:x[t]=b,f===t&&xt(),Ue(x)},za=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),F(0),M([]),X(x=>x+1);const i=a[s],p=Ot(a,o)[s];if(!i||!p)return;if(p.isMultivariate){nt(i,p,0);return}const b=ut(i,p,o);if(!b){P(null),V(null),he(null),Q(null);return}P(b.data),V(b.resolveType),he(null),Q(null)}})},Ha=t=>{if(f===null)return;const a=I[f],s=Pe[f];!a||!s?.isMultivariate||(F(t),M([]),X(i=>i+1),nt(a,s,t,f,!0))},Ua=t=>{if(f===null||!j)return;const a=I[f],s=Pe[f];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const p=Ys(i,t);if(!p){G.error("Cannot delete the only variant.");return}const b=[...I];b[f]=dt(a,s,p);const x=p.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),F(C),M([]),X(J=>J+1),nt(b[f],s,C),Ue(b)},Ga=t=>{if(f===null||!j)return;const a=I[f],s=Pe[f];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const p=Qs(i,t),b=[...I];b[f]=dt(a,s,p);const x=t+1;F(x),M([]),X(C=>C+1),nt(b[f],s,x),Ue(b)},Wa=(t,a)=>{if(f===null||!j||t===a)return;const s=I[f],i=Pe[f];if(!s||!i?.isMultivariate)return;const p=Ye(s,i);if(!p)return;const b=qs(p,t,a),x=[...I];x[f]=dt(s,i,b);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),F(C),nt(x[f],i,C),Ue(x)},Zt=t=>{const a=t??f;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const p=Us(s,i);if(!p){G.error("This section cannot have variants.");return}const b=[...I];b[a]=p.section;const x=Ot(b,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),F(p.newVariantIndex),M([]),X(C=>C+1),nt(p.section,x,p.newVariantIndex,a),Ue(b)},qa=()=>{if(f===null||!j)return;const t=I[f],a=Pe[f];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const i=Js(t,a,s);if(!i){G.error("Could not remove variants.");return}const p=[...I];p[f]=i;const b=Ot(p,o)[f];if(!b)return;F(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,b,o);x?(P(x.data),V(x.resolveType)):(P(null),V(null)),St(null,f,0),Ue(p)},Ja=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){G.error(a);return}const s=I[Ne],i=Pe[Ne];if(!s||!i)return;const p=ut(s,i,o);if(!p){G.error("This section cannot be saved as global.");return}const b={...p.data,name:t};try{await ye.mutateAsync({blockKey:t,data:b});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),f===Ne&&xt(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Tt&&f===null&&ue===null&&gn){const{resolveType:t,formValue:a}=kt(gn,o??{},c??void 0);ie(t),E(a)}const At=c?Os(c):[],vn=c&&o?Bs(c,o):[],Ya=!_e&&!!(u&&c&&o),Sn=ue&&c?$t(ue,c):null,Mt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},jt=async(t,a)=>{if(!(ar(a,t,c)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p={...s[a]},b={...p.sections},x=[...b.variants??[]],C=x[i],J=C?.rule;if(mt(J,s,c)){const A=J?.__resolveType??"",O=s[A],L=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,L)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),p.sections={...b,variants:x},ye.mutate({blockKey:a,data:p},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},rn)},Qa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Mn};E({}),xn(a)},Xa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Za=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const p=s[a],b=p?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],J=C[i];if(!J)return;const A=bt(J.rule,s,c),O=Ft(t);C[i]={...J,rule:O};const L={...s,[a]:{...p,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=kt(O,L,c??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:L[a]}),A&&A!==t&&await jt(A,L),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(vt.current=setTimeout(()=>{const{rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:J}=qe.current;if(!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Ye(A,O);if(!L)return;const z=(L.variants??[])[s]?.rule;if(mt(z,b,c)){const fe=z?.__resolveType??"",Ge=b[fe],Xe=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Tn(L,s,t),De=[...i];De[a]=dt(A,O,U);const Je=wt(b,x,De,J,C);ye.mutate({blockKey:x,data:Je},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},rn))},es=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:Mn})},ts=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ns=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:J}=qe.current;if(a===null||!x)return;const A=i[a],O=p[a];if(!A||!O?.isMultivariate)return;const L=Ye(A,O);if(!L)return;const ge=L.variants??[],z=bt(ge[s]?.rule,b,c),U=Ft(t),De=Tn(L,s,U),Je=[...i];Je[a]=dt(A,O,De);const fe=wt(b,x,Je,J,C),Ge={...b,[x]:fe},{resolveType:Xe,formValue:rt}=kt(U,Ge,c??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await jt(z,Ge),g?.()}catch(Ze){G.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Wt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=f!==null?Pe[f]??null:null,bn=f!==null?I[f]:null,_n=bn&&at?.isMultivariate?Ye(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=f!==null&&at!==null,Kt=jn&&(ct||!!(Qt&&se)),as=Kt&&!_e&&at?.isSavedBlock===!0,st=_e||as,ss=_e?dn:at?.label??"",kn=Ie&&c?$t(Ie,c):null,tn=Kt&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],rs=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?rs:st?tn.length>0?tn:[ss]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),V(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],p=i.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const b=p;if(!Array.isArray(b.variants))return;const x=t([...b.variants]);if(!x)return;const C=rr(b,x),J={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:J[j]},{onSuccess:()=>{a?.(),s&&jt(s,J)},onError:A=>G.error(`Save failed: ${A.message}`)})},os=t=>{W(null),B(t),T(null),P(null),V(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=kt(a,o??{},c??void 0);ie(s),E(i),pn(Oe.map(p=>({rule:p.rule})),t)},is=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Rt(Oe.map(p=>({rule:p.rule})),t,a);pn(i,s),nn(p=>Rt(p,t,a))},ls=t=>{const a=Oe[t]?.rule,s=bt(a,o??{},c??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),T(null),P(null),V(null),M([]),E(null),ie(null)},s)},cs=t=>{nn(a=>or(a,t),()=>{B(t+1),T(null),P(null),V(null),M([]),E(null),ie(null)})},us=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const p=i[s],b=p.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],J=C[t];if(!J?.rule||typeof J.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=J.rule,O=a.trim();Vt(!0);try{if(!O){if(!mt(A,i,c)){W(null);return}const Je=A.__resolveType??"";C[t]={...J,rule:Pn(A,i,c)};const fe={...i,[s]:{...p,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await jt(Je,fe),W(null),g?.();return}const L=An(A,i,c);if(!L){G.error("Could not read this variant's matcher rule.");return}if(L.blockKey){await ye.mutateAsync({blockKey:L.blockKey,data:yt(L.resolveType,L.data,O)}),W(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){G.error(z);return}const U=yt(L.resolveType,L.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,C[t]={...J,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...p,sections:{...x,variants:C}}}),De=null}catch(Je){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),Je}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(L){G.error(L instanceof Error?L.message:"Failed to rename variant")}finally{Vt(!1)}},ds=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:p,decofile:b,activePageKey:x,pageVariants:C,variantIndex:J}=qe.current;if(s===null||!x)return;const A=i[s],O=p[s];if(!A||!O?.isMultivariate)return;const L=Ye(A,O);if(!L)return;const ge=L.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Je=async fe=>{const Ge={...L,variants:fe},Xe=[...i];Xe[s]=dt(A,O,Ge);const rt=wt(b,x,Xe,J,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...b,[x]:rt}};try{if(!De){if(!mt(U,b,c)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Pn(U,b,c)};const vs=await Je(Nn);await jt(ot,vs),ne(null),g?.();return}const fe=An(U,b,c);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const Ge=an(De),Xe=sn(Ge,b);if(Xe){G.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),Ze=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Je(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{xt()},ms=t=>{Te(t),Xt({inner:t})},fs=t=>{Le(t),Xt({raw:t})},ps=()=>{Te(null),xe([])},hs=()=>me(t=>t+1),gs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Te(null),Le(void 0),xe([]),me(s=>s+1),N?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||Kt||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Tt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.label}`,className:Be("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",oo),children:[n.jsx(ha,{rule:Dt(tt.rule,o??{},c??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(sa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>gs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(ht,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(lo,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:Ka})}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(ft,{children:[n.jsx(pt,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>k&&j?k(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(ht,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Tr,{rawSeo:Jt,innerSeo:mn,defaultResolveType:Ca,seoSchema:Ta,activeResolveType:Yt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Pa,onBreadcrumbChange:xe,onPersistRaw:fs,onInnerChange:ms,onClearForm:ps,onBumpFormKey:hs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${f??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:Ha,onRename:ne,onDuplicate:Ga,onDelete:Ua,onRemoveAll:qa,onReorder:Wa,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,c??void 0),currentGlobalKey:bt(Et?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:es,onSelectGlobal:ns}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:kn,value:ae,onChange:ts,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Pt},`${f??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Pt})]}):_e?n.jsx(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Ln,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:c,decofile:o,onSaveReferencedBlock:Nt,sandbox:Pt})}):n.jsxs(Lt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:c,matchers:At,onSelect:os,onReorder:is,onRename:W,onDuplicate:cs,onDelete:ls,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",_t&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,c??void 0),currentGlobalKey:bt(tt?.rule,o??{},c??void 0)??void 0,matchers:At,globals:vn,onSelect:Qa,onSelectGlobal:Za}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:Sn,value:Ce,onChange:Xa,meta:c??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Pt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Pe,meta:c,selectedIndex:f,onSelect:Ea,onReorder:$a,onDelete:Oa,onDuplicate:Ba,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:La,onAddVariant:Zt,onDetach:Ia,onAddSection:()=>de(!0),canAddSection:Ya})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Pe[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:Ja}),u&&n.jsx(Er,{open:Se,onOpenChange:de,meta:c,decofile:o,previewBaseUrl:u,onSelect:za}),be&&j&&o&&n.jsx(Is,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx($n,{open:!0,initialName:mt(Oe[re]?.rule,o??{},c??void 0)?Bt(Oe[re]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(Oe[re]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await us(re,t)},onOpenChange:t=>{!t&&!_t&&W(null)}}),q!==null&&n.jsx($n,{open:!0,initialName:mt(lt[q]?.rule,o??{},c??void 0)?Bt(lt[q]?.rule,o??{},et,c??void 0):"",autoLabel:et(Dt(lt[q]?.rule,o??{},c??void 0)),isPending:_t,onSubmit:async t=>{await ds(q,t)},onOpenChange:t=>{!t&&!_t&&ne(null)}})]})}export{Ql as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,aQ as nt,aO as Pe,j as d,dy as rt,aS as be,aP as k,dz as st,aL as j,aR as N,bI as $,dv as lt,aq as _e,dA as Ee,aM as at,bE as it,bK as ct,dC as dt,dF as ut,dD as pt,dG as ft,dw as mt,aN as ht,dE as vt,dx as gt,dB as xt,c as ee,l as oe}from"./index-Dbp2tz6n.js";import{V as St}from"./tooltip-CydqKsA_.js";import{i as wt}from"./Check-DVkdUWft.js";import{t as Re}from"./ChevronDown-sHPJGGX_.js";import{n as Ct}from"./ChevronUp-D5GPoW4G.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{mo as S,uo as a,ho as b,fo as c,po as d,Ne as e};
|
|
1
|
+
import{r as c,aR as nt,aP as Pe,j as d,dy as rt,aT as be,aQ as k,dz as st,aM as j,aS as N,bI as $,dv as lt,ap as _e,dA as Ee,aN as at,bE as it,bK as ct,dC as dt,dF as ut,dD as pt,dG as ft,dw as mt,aO as ht,dE as vt,dx as gt,dB as xt,c as ee,l as oe}from"./index-CHTXbbov.js";import{V as St}from"./tooltip-76CNxa0k.js";import{i as wt}from"./Check-BRK73b5S.js";import{t as Re}from"./ChevronDown-Cl64FuM7.js";import{n as Ct}from"./ChevronUp-Bd8WwASv.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(J,t),s=Y(J,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(gt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{mo as S,uo as a,ho as b,fo as c,po as d,Ne as e};
|