decocms 4.286.2 → 4.286.3
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-hiOqJcW5.js → AlertCircle-CWbbvCE8.js} +1 -1
- package/dist/client/assets/{AreaChart-BqfhkmRW.js → AreaChart-BxPMYD6n.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DEFSUc-V.js → ArrowLeft-yxeobg0v.js} +1 -1
- package/dist/client/assets/{ArrowUp-CHCWVGsK.js → ArrowUp-ClPk-tEL.js} +1 -1
- package/dist/client/assets/{Check-yS6TBRKx.js → Check-B-T1OdyM.js} +1 -1
- package/dist/client/assets/{CheckCircle-DUmezbyG.js → CheckCircle-Di9U5M_3.js} +1 -1
- package/dist/client/assets/{ChevronDown-RrKk7H6I.js → ChevronDown-lhRoz8ve.js} +1 -1
- package/dist/client/assets/{ChevronRight-B3-5oKsn.js → ChevronRight-PA4SrDe8.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CqILirh0.js → ChevronSelectorVertical-BVHuvXcc.js} +1 -1
- package/dist/client/assets/{ChevronUp-7BeD5K4q.js → ChevronUp-CjB5cNrn.js} +1 -1
- package/dist/client/assets/Circle-0WhMTazG.js +1 -0
- package/dist/client/assets/{Copy01-DH1C4T5n.js → Copy01-rjZTF0JK.js} +1 -1
- package/dist/client/assets/{CreditCard01-DxOjVad1.js → CreditCard01-CEJXC95D.js} +1 -1
- package/dist/client/assets/DotsVertical-BK4JkTfJ.js +1 -0
- package/dist/client/assets/{Download01-uGF8VQkc.js → Download01-B29-DAMF.js} +1 -1
- package/dist/client/assets/{Eye-BP8ZftGB.js → Eye-Dwcpfw8S.js} +1 -1
- package/dist/client/assets/{FilterLines-DQxyjNBq.js → FilterLines-T3vrjlCu.js} +1 -1
- package/dist/client/assets/Flag01-BeOUsooU.js +1 -0
- package/dist/client/assets/{Globe01-DZMulFU5.js → Globe01-BJregYun.js} +1 -1
- package/dist/client/assets/{Globe04-DCtFs4xl.js → Globe04-CzbTyKcv.js} +1 -1
- package/dist/client/assets/{HardDrive-BLuff5wS.js → HardDrive-KdEZynii.js} +1 -1
- package/dist/client/assets/{Key01-DLwJ7Ckf.js → Key01-Dw14FM0z.js} +1 -1
- package/dist/client/assets/{LinkExternal01--8l2Mzfp.js → LinkExternal01-GY6MBjsu.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-DiNL4sfs.js → LockUnlocked01-Dy5fUMBA.js} +1 -1
- package/dist/client/assets/{LogOut01-DDaRu_3P.js → LogOut01-LLXPIQBH.js} +1 -1
- package/dist/client/assets/{Monitor01-i2p8_gzb.js → Monitor01-Dbzqlbm3.js} +1 -1
- package/dist/client/assets/{Palette-xsvHNVzX.js → Palette-2Z9yrBrj.js} +1 -1
- package/dist/client/assets/{Play-BAPfXOmA.js → Play-C8DX3MNw.js} +1 -1
- package/dist/client/assets/{Plus-BAv6QwTj.js → Plus-B-dc60nq.js} +1 -1
- package/dist/client/assets/{SearchLg-C-Eqo4y8.js → SearchLg-BR5Nvvey.js} +1 -1
- package/dist/client/assets/{SearchMd-BsqgJ4OR.js → SearchMd-BkU5uvZ3.js} +1 -1
- package/dist/client/assets/{Settings02-EAB5l-Jo.js → Settings02-D2DQzPhq.js} +1 -1
- package/dist/client/assets/{Share07-D3k-RSTq.js → Share07-C7EQRNeA.js} +1 -1
- package/dist/client/assets/{Shield01-XqMu5Nf3.js → Shield01-CE7mb3Ix.js} +1 -1
- package/dist/client/assets/{Stars01-CqDHtnom.js → Stars01-Dd5b7TNK.js} +1 -1
- package/dist/client/assets/{Stars02-DvnkqIQI.js → Stars02-U_TQPDnJ.js} +1 -1
- package/dist/client/assets/{Sun-BArbxBTe.js → Sun-Bv9Ylpqk.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-V4kh4_ID.js → SwitchHorizontal01-Ba8D7M8C.js} +1 -1
- package/dist/client/assets/Tag01-hM9BONIh.js +1 -0
- package/dist/client/assets/ThumbsUp-DsTVql5w.js +1 -0
- package/dist/client/assets/{Tool01-Bi7x_pFT.js → Tool01-Du0WeBXL.js} +1 -1
- package/dist/client/assets/{Tool02-BahI2w-F.js → Tool02-FNZ9nQDs.js} +1 -1
- package/dist/client/assets/{Trash01-CxXI4uLo.js → Trash01-jS-aJOE_.js} +1 -1
- package/dist/client/assets/TrendUp01-BTPOrFwv.js +1 -0
- package/dist/client/assets/{Upload01-Dx6t-7oj.js → Upload01-CbBPEmg7.js} +1 -1
- package/dist/client/assets/{User01-Bs6_V_tl.js → User01-CRCcS7B3.js} +1 -1
- package/dist/client/assets/UserSquare-CZDBDZu6.js +1 -0
- package/dist/client/assets/{Users01-UmcM8Jww.js → Users01-D3bzr0SJ.js} +1 -1
- package/dist/client/assets/{Users03-xamSOp-f.js → Users03-DgFiBAG1.js} +1 -1
- package/dist/client/assets/{XCircle-DbIIvoOs.js → XCircle-BiZVJH8A.js} +1 -1
- package/dist/client/assets/{XClose-BWO2zbra.js → XClose-CF46faeu.js} +1 -1
- package/dist/client/assets/{YAxis-ByFmlys2.js → YAxis-BMyIVcKx.js} +1 -1
- package/dist/client/assets/{Zap-DrubYVJC.js → Zap-BWNllArR.js} +1 -1
- package/dist/client/assets/{ZapSquare-BWMDlPC4.js → ZapSquare-hz2fwhYk.js} +1 -1
- package/dist/client/assets/{access-gate-BxOMxDlN.js → access-gate-O3YxMPI-.js} +1 -1
- package/dist/client/assets/agent-icon-BWc_2R02.js +1 -0
- package/dist/client/assets/agents-list-C8dqBI87.js +1 -0
- package/dist/client/assets/{ai-providers-DudSkLhI.js → ai-providers-j3ehPHdm.js} +1 -1
- package/dist/client/assets/{alert-Bz2oKGcW.js → alert-_VpoEhWD.js} +1 -1
- package/dist/client/assets/{alert-dialog-C7gi43qw.js → alert-dialog-BGVZQi8t.js} +1 -1
- package/dist/client/assets/{api-keys-BmwPSJJx.js → api-keys-iBLrzFhd.js} +1 -1
- package/dist/client/assets/app-editor-BFs81spL.js +1 -0
- package/dist/client/assets/{auth-XA3XVIU6.js → auth-CLHX9XFE.js} +1 -1
- package/dist/client/assets/{auth-catchall-C9aYupjX.js → auth-catchall-DM1aExYv.js} +1 -1
- package/dist/client/assets/{auth-entry-DxkDBhzc.js → auth-entry-m5S-1owW.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dl6V6Y4j.js → auth-split-layout-D6uGwCuZ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C4F2LaiG.js → authenticate-and-persist-oauth-DI4W2xjU.js} +1 -1
- package/dist/client/assets/{automation-list-row-CmUv79s4.js → automation-list-row-CNNkrJuI.js} +1 -1
- package/dist/client/assets/{automation-runs-DHi91GZY.js → automation-runs-Z0iz6dal.js} +1 -1
- package/dist/client/assets/automations-CtclgEfp.js +1 -0
- package/dist/client/assets/{avatar-BKEDMSnX.js → avatar-BwzKyp1i.js} +1 -1
- package/dist/client/assets/{badge-BVOT5cY1.js → badge-QK4_b8m3.js} +1 -1
- package/dist/client/assets/{block-document-CIjl4dWS.js → block-document-C4eczyjS.js} +2 -2
- package/dist/client/assets/{breadcrumb-DcuBWgU6.js → breadcrumb-WBjlnhkt.js} +1 -1
- package/dist/client/assets/{buckets-BxUOH6pm.js → buckets-CfR2ycW8.js} +1 -1
- package/dist/client/assets/bulk-category-panel-CWZMpFWx.js +1 -0
- package/dist/client/assets/{capability-load-error-Bz8fYgjS.js → capability-load-error-B42WqLL_.js} +1 -1
- package/dist/client/assets/{cards-XUuMSfqb.js → cards-CVa-fA_N.js} +1 -1
- package/dist/client/assets/category-editor-Bm1CzlKC.js +1 -0
- package/dist/client/assets/{chart-Ck_FKld6.js → chart-C0_sgo02.js} +1 -1
- package/dist/client/assets/{chat-context-cfHPN5ei.js → chat-context-xMr_4Axs.js} +1 -1
- package/dist/client/assets/{checkbox-hfjBf94F.js → checkbox-BBAE_NPI.js} +1 -1
- package/dist/client/assets/choose-editor-Bd3WyAXg.js +1 -0
- package/dist/client/assets/{cli-auth-success-CyoOzdgx.js → cli-auth-success-BWuEV9D3.js} +1 -1
- package/dist/client/assets/collection-detail-NXDlLsWB.js +1 -0
- package/dist/client/assets/{collection-display-button-C-VYkKeK.js → collection-display-button-DiJ_qzja.js} +1 -1
- package/dist/client/assets/{collection-search-Bw_HysKr.js → collection-search-BBBLCvXm.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D6YxcBlE.js → collection-table-wrapper-BkCl1Oxu.js} +1 -1
- package/dist/client/assets/{collection-tabs-B_gvi_U1.js → collection-tabs-BhNVbQRQ.js} +1 -1
- package/dist/client/assets/{command-DmgErSks.js → command-dzcaI1yG.js} +1 -1
- package/dist/client/assets/commerce-onboarding-Da6sVkAK.js +1 -0
- package/dist/client/assets/config-n1zSHZqO.js +1 -0
- package/dist/client/assets/{connect-B3CB3NbU.js → connect-Cqh3zHKK.js} +1 -1
- package/dist/client/assets/{connection-Du-s9JTq.js → connection-D7fgeB0z.js} +1 -1
- package/dist/client/assets/{connection-card-qmGgp48y.js → connection-card-Cr01Ig2w.js} +1 -1
- package/dist/client/assets/connection-detail-BHZZoofs.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CEN5IzSB.js → connection-form-helpers-BBbhpert.js} +1 -1
- package/dist/client/assets/connections-BQaOPVh2.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-JfBMouUo.js → decopilot-sse-pool-BxpeMujQ.js} +1 -1
- package/dist/client/assets/{dialog-qy0Z1aJp.js → dialog-DROTnc8B.js} +1 -1
- package/dist/client/assets/{domain-settings-BAj4VRPx.js → domain-settings-trPPWhCm.js} +1 -1
- package/dist/client/assets/{drawer-Ba-RJ-Vm.js → drawer-BXgwQk-w.js} +1 -1
- package/dist/client/assets/dropdown-menu-B4M2oT-i.js +1 -0
- package/dist/client/assets/{empty-state-jsXC5kwN.js → empty-state-CUXmv4-D.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C4yVX3dU.js → extract-connection-data-BLs-F9MR.js} +1 -1
- package/dist/client/assets/file-explorer-DQyKeH0t.js +2 -0
- package/dist/client/assets/{file-type-icon-Qndp-c2z.js → file-type-icon-t6saePJP.js} +1 -1
- package/dist/client/assets/{form-YGkaTcsZ.js → form-Cedy9Kwp.js} +1 -1
- package/dist/client/assets/general-BOCK3WGH.js +1 -0
- package/dist/client/assets/github-icon-Dz4xNzgo.js +1 -0
- package/dist/client/assets/github-repo-picker-BziyF4os.js +1 -0
- package/dist/client/assets/{hooks-BQCR9h_s.js → hooks-RMH7Z-XL.js} +1 -1
- package/dist/client/assets/index-BC8qJ9Xs.js +1 -0
- package/dist/client/assets/{index-CP07biT3.js → index-BQHsB5yn.js} +1 -1
- package/dist/client/assets/{index-B_cjnmHp.js → index-Bkh-xk2l.js} +1 -1
- package/dist/client/assets/index-C6sSInvt.js +1 -0
- package/dist/client/assets/{index-CYDZxSyh.js → index-CRg_jvMs.js} +1 -1
- package/dist/client/assets/{index-BlALgPn0.js → index-CXprdmhJ.js} +1 -1
- package/dist/client/assets/{index-w7SC22aY.js → index-DucPHVXk.js} +2 -2
- package/dist/client/assets/{index-B069nvZi.js → index-Tc1_kaTc.js} +1 -1
- package/dist/client/assets/{index-66BUlUCq.js → index-ZtSDBa1M.js} +3 -3
- package/dist/client/assets/{index-CXN6bmWL.js → index-_P3U4SZO.js} +61 -61
- package/dist/client/assets/{index-redirect-CCwJiDzA.js → index-redirect-CoqPAfXV.js} +1 -1
- package/dist/client/assets/{infra-billing-BMnY0AH9.js → infra-billing-BeWq1GLp.js} +1 -1
- package/dist/client/assets/{input-DSNlRZp-.js → input-DF-XKSRq.js} +1 -1
- package/dist/client/assets/{integration-icon-DgpBd9x9.js → integration-icon-DjGRurnq.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BxVvTBsq.js → invite-member-dialog-DqcFAinu.js} +1 -1
- package/dist/client/assets/{label-CqOwuXw5.js → label-CLXgBrTK.js} +1 -1
- package/dist/client/assets/{layout-BX1xrGBZ.js → layout-C-2mHUlC.js} +1 -1
- package/dist/client/assets/{login-CdYcIAH1.js → login-D4OWmFXZ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CCK0vzqY.js → mcp-oauth-CCo8zz0v.js} +1 -1
- package/dist/client/assets/members-CBSKDkea.js +1 -0
- package/dist/client/assets/{monaco-editor-doGausTU.js → monaco-editor-Dz28X6On.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BE0x_Y2T.js → monitoring-stats-row-BWd9vmex.js} +1 -1
- package/dist/client/assets/{multi-select-CpP6bWVL.js → multi-select-CeCd11zE.js} +1 -1
- package/dist/client/assets/{oauth-callback-DDLCnMS3.js → oauth-callback-B5fykUah.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BdKpH2mQ.js → oauth-callback-ai-provider-ChH0BX2g.js} +1 -1
- package/dist/client/assets/{onboarding-BhdMYjwb.js → onboarding-BXPduKNj.js} +1 -1
- package/dist/client/assets/{org-layout-6Z4I0hHW.js → org-layout-CjgcxBH7.js} +1 -1
- package/dist/client/assets/{organization-choice-BP7uSM89.js → organization-choice-CiVNPul4.js} +1 -1
- package/dist/client/assets/{orgs-Dg1CXVTF.js → orgs-J85r2cCC.js} +1 -1
- package/dist/client/assets/{page-seo-form-CqsF5lXU.js → page-seo-form-BG0L-bvt.js} +1 -1
- package/dist/client/assets/{popover-B-hxuR7_.js → popover-Dac8KJD5.js} +1 -1
- package/dist/client/assets/post-calendar-DQB5WZcK.js +1 -0
- package/dist/client/assets/post-editor-s8s5QbBW.js +1 -0
- package/dist/client/assets/{primitives-DFmC6p_Q.js → primitives-CB_18Rqi.js} +1 -1
- package/dist/client/assets/{profile-Dkr0W5iY.js → profile-V5EfUztV.js} +1 -1
- package/dist/client/assets/project-app-view-B2hne0Rq.js +1 -0
- package/dist/client/assets/{prompts-7twTnqOX.js → prompts-rYMXdTcD.js} +1 -1
- package/dist/client/assets/record-editor-DuktYC5p.js +1 -0
- package/dist/client/assets/redirect-editor-EZGYI9JT.js +1 -0
- package/dist/client/assets/registry-C02S6pn1.js +2 -0
- package/dist/client/assets/{registry-layout-BKOsGixf.js → registry-layout-jVaMxhaB.js} +2 -2
- package/dist/client/assets/{reports-DRMI8_m1.js → reports-BwjyR_vK.js} +2 -2
- package/dist/client/assets/{require-capability-NxUQlfkl.js → require-capability-DuOlrYne.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CHGHhIp4.js → required-auth-layout-Cw5XELIs.js} +1 -1
- package/dist/client/assets/{reset-password-DqdRqc5j.js → reset-password-Dtq_X_bY.js} +1 -1
- package/dist/client/assets/review-settings-CZcxafz4.js +1 -0
- package/dist/client/assets/roles-BXp9ASCp.js +1 -0
- package/dist/client/assets/{scroll-area-5vzmt2fx.js → scroll-area-I0x16PDc.js} +1 -1
- package/dist/client/assets/{search-input-fSMW29Ha.js → search-input-D0Xkp13F.js} +1 -1
- package/dist/client/assets/{secrets-DZUJRYpg.js → secrets-BSMCFXRK.js} +1 -1
- package/dist/client/assets/{sections-editor-dUiZNQ0T.js → sections-editor-xYo3wCUt.js} +2 -2
- package/dist/client/assets/{select-BxxMay64.js → select-DbwWg8mr.js} +1 -1
- package/dist/client/assets/{select-model-3PUtzWOF.js → select-model-2tHFqpDQ.js} +1 -1
- package/dist/client/assets/self-tool-result-xpNWJZXF.js +1 -0
- package/dist/client/assets/seo-editor-Dqckneoh.js +1 -0
- package/dist/client/assets/{settings-layout-68cErOzo.js → settings-layout-DWqCPuUa.js} +1 -1
- package/dist/client/assets/{shell-controls-CnzOBK-d.js → shell-controls-CN_f1c-4.js} +1 -1
- package/dist/client/assets/{shell-layout-BAPiuVCF.js → shell-layout-C_ZyBlX2.js} +1 -1
- package/dist/client/assets/{spinner-5kJIZwhC.js → spinner-DG-xe-ih.js} +1 -1
- package/dist/client/assets/{sso-BSgokATe.js → sso-D9XY7jrz.js} +1 -1
- package/dist/client/assets/{store-BDt4_0eK.js → store-BXWhlkgq.js} +1 -1
- package/dist/client/assets/store-registry-HpksP_CA.js +2 -0
- package/dist/client/assets/super-agent-icon-DcTJHa3h.js +1 -0
- package/dist/client/assets/{switch-DranR37-.js → switch-Dy2L3YiE.js} +1 -1
- package/dist/client/assets/synced-repos-DmEk8PVk.js +1 -0
- package/dist/client/assets/{tab-id-rV9ba-P7.js → tab-id-9f5Elcwo.js} +1 -1
- package/dist/client/assets/{table-BaBcwP7i.js → table-L3_2rt8c.js} +1 -1
- package/dist/client/assets/{tabs-C4RG823b.js → tabs-DT4yo0dz.js} +1 -1
- package/dist/client/assets/{task-board-U9ekmgf6.js → task-board-BU3VhW_R.js} +1 -1
- package/dist/client/assets/task-filters-C6nXtRnq.js +1 -0
- package/dist/client/assets/tasks-BAPI3Xju.js +1 -0
- package/dist/client/assets/{textarea-BJRhlIeX.js → textarea-Dak8L16r.js} +1 -1
- package/dist/client/assets/{toggle-group-BjESUsiw.js → toggle-group-B64JMRC7.js} +1 -1
- package/dist/client/assets/{toolbar-B7xp1f_g.js → toolbar-H9jBvos0.js} +1 -1
- package/dist/client/assets/{track-CLV6okT5.js → track-D52qjC2J.js} +1 -1
- package/dist/client/assets/{types-Dptm8vRS.js → types-DBBMfbWD.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dnx2BwXA.js → use-ai-providers-D88F4M9N.js} +1 -1
- package/dist/client/assets/{use-api-keys-9J2chZIl.js → use-api-keys-Bf2TrBSR.js} +1 -1
- package/dist/client/assets/{use-automations-hHGlxB3Q.js → use-automations-DVpA7X4y.js} +1 -1
- package/dist/client/assets/{use-autosave-CjMVnZ9D.js → use-autosave-P1hDwXVA.js} +1 -1
- package/dist/client/assets/use-commerce-diagnostic-CWLq3qkc.js +1 -0
- package/dist/client/assets/{use-connection-lpB7Ak3D.js → use-connection-CC36uLn5.js} +1 -1
- package/dist/client/assets/{use-copy-cPUcRSDk.js → use-copy-DdEgqbGk.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BE3_FLPI.js → use-create-virtual-mcp-D3LB27Lm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BTblZwgG.js → use-debounced-autosave-B1A8E_zm.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C1RgoEO7.js → use-debounced-value-DPpXL-7f.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BKdVQlWj.js → use-decopilot-events-BlGPRpvB.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D-APxGPc.js → use-delete-connection-qgsHvwBc.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BaYSlZon.js → use-deployment-admin-DgGUpAFW.js} +1 -1
- package/dist/client/assets/{use-file-configs-CwqLdhuz.js → use-file-configs-CbqZjK3e.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll--Ew0plMX.js → use-infinite-scroll-Dh44_qVU.js} +1 -1
- package/dist/client/assets/{use-join-requests-C7H_x6Qk.js → use-join-requests-sPfR15KV.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-5BY6Nzu_.js → use-mcp-auth-status-BojxBf39.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DPpSkRNd.js → use-mcp-client-4vfKAZII.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BgQkZEa9.js → use-mcp-tools-kLeUVQb5.js} +1 -1
- package/dist/client/assets/{use-members-ZgUYxfoN.js → use-members-BThWW8DN.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BDnGtSYT.js → use-navigate-to-agent-B7O4mdOp.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-s5DfOquz.js → use-org-auth-client-CvXr6xpG.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BVrqXPPs.js → use-org-repo-syncs-CdgqxwZ1.js} +1 -1
- package/dist/client/assets/{use-org-sso-4XYfaR1R.js → use-org-sso-dXFz_XEn.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BhSD9m9-.js → use-organization-roles-Iu-q9dgw.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DyKnNOU1.js → use-organization-settings-DYWZmbib.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CumAXYCD.js → use-registry-connections-Dp-yVGrd.js} +1 -1
- package/dist/client/assets/{use-secrets-Dv8l4-qt.js → use-secrets-07Tequ4i.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DNZmvPJ8.js → use-section-preview-base-DfPlaDKY.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Lkn4Z7sU.js → use-status-sounds-taT8tvJS.js} +1 -1
- package/dist/client/assets/{use-tags-mKLoUee7.js → use-tags-p0LvS31V.js} +1 -1
- package/dist/client/assets/{use-view-mode-C2aXQ0iB.js → use-view-mode-BkOAgSbw.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CE8tx9or.js → use-virtual-mcp-B6Y0d6n-.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dive_90S.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CV0LhXLD.js +1 -0
- package/dist/client/assets/{users-B59tCokk.js → users-xEs7h3qa.js} +1 -1
- package/dist/client/assets/variant-calendar-DuMy7tLJ.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D1UCXWa2.js → view-mode-toggle-BVn0Ll1M.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +477 -477
- package/dist/server/server.js +326 -326
- package/package.json +1 -1
- package/dist/client/assets/DotsVertical-DL_xKTby.js +0 -1
- package/dist/client/assets/TrendUp01-CYU0S4zQ.js +0 -1
- package/dist/client/assets/UserSquare-BaeuOy58.js +0 -1
- package/dist/client/assets/agent-icon-Dk522vgR.js +0 -1
- package/dist/client/assets/agents-list-DPxzcA1Q.js +0 -1
- package/dist/client/assets/app-editor-CyR5TnHa.js +0 -1
- package/dist/client/assets/automations-CbhqrSJB.js +0 -1
- package/dist/client/assets/bulk-category-panel-BLG4ug1F.js +0 -1
- package/dist/client/assets/category-editor-CdqRjEq-.js +0 -1
- package/dist/client/assets/choose-editor-Zlcu6_gN.js +0 -1
- package/dist/client/assets/collection-detail-BltlsBDt.js +0 -1
- package/dist/client/assets/commerce-onboarding-CVXvwgis.js +0 -1
- package/dist/client/assets/config-Bhu5kCwB.js +0 -1
- package/dist/client/assets/connection-detail-CdS57-hi.js +0 -1
- package/dist/client/assets/connections-4JE1f-NA.js +0 -1
- package/dist/client/assets/dropdown-menu-U_vACpBP.js +0 -1
- package/dist/client/assets/file-explorer-BQ3uCYfn.js +0 -2
- package/dist/client/assets/general-MN_YuUqq.js +0 -1
- package/dist/client/assets/github-repo-picker-BqSmN9CA.js +0 -1
- package/dist/client/assets/index-BbuG8Jbg.js +0 -1
- package/dist/client/assets/index-BpfHCkMo.js +0 -1
- package/dist/client/assets/members-DArjgHPY.js +0 -1
- package/dist/client/assets/post-calendar-CwOyzayg.js +0 -1
- package/dist/client/assets/post-editor-CMogJsWz.js +0 -1
- package/dist/client/assets/project-app-view-CU0pWUxg.js +0 -1
- package/dist/client/assets/record-editor-B5zgmpPT.js +0 -1
- package/dist/client/assets/redirect-editor-CBQTBNAl.js +0 -1
- package/dist/client/assets/registry-CT7qFX2T.js +0 -2
- package/dist/client/assets/review-settings-hF6_ejz-.js +0 -1
- package/dist/client/assets/roles-DNg-v40Q.js +0 -1
- package/dist/client/assets/self-tool-result-CnLvIY_a.js +0 -1
- package/dist/client/assets/seo-editor-C771IjDu.js +0 -1
- package/dist/client/assets/store-registry-417KFpib.js +0 -2
- package/dist/client/assets/synced-repos-C9zoHXsA.js +0 -1
- package/dist/client/assets/task-key-n93QwSK2.js +0 -1
- package/dist/client/assets/tasks-CLCpAm24.js +0 -1
- package/dist/client/assets/use-commerce-diagnostic-Brb2fqiq.js +0 -1
- package/dist/client/assets/use-task-board-items-DhOTd2ok.js +0 -1
- package/dist/client/assets/useInfiniteQuery-1rU8yXy8.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DiMhuD_T.js +0 -1
- package/dist/client/assets/variant-calendar-C9x2S-wB.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as st,b as Dt,r as w,n as Ue,j as n,aH as Zn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Co,t as q,K as Po}from"./index-66BUlUCq.js";import{b as Mo}from"./chat-context-cfHPN5ei.js";import{au as ts,av as Lo,aw as Ko,ax as Bo,ay as Io,ab as ns,ac as Xt,az as ss,aA as os,ad as as,ae as is,aB as rs,aC as Oo,al as ls,am as cs,aD as Fo,aE as $o,aF as us,P as zo,af as ds,ag as Lt,aj as ms,ak as fs,ah as ps,ar as gs,aG as Ho,aH as Kt,aI as hs,aJ as Uo,aK as Go,aL as qo,aM as Wo,aN as Jo,F as Yo,G as Qo,aO as Xo,aP as Zo,aQ as ea,aR as ta,aS as Bn,aT as na,aU as sa,aV as oa,ap as qt,aW as aa,aX as ia,aY as Wt,aZ as ra,a_ as St,a$ as Ct,b0 as la,b1 as ca,b2 as nt,b3 as In,b4 as ua,H as da,b5 as On,b6 as ma,b7 as fa,b8 as Pt,b9 as Jt,ba as Fn,bb as pa,bc as fn,bd as ga,be as ht,bf as Et,bg as ha,bh as va,bi as ba,bj as Sa,bk as ya,bl as yt,bm as xa,bn as _a,bo as ja,J as Ea,bp as $n,bq as Mt,br as zn,bs as Hn,bt as Ra,bu as wa,bv as ka,bw as Ta,bx as pn,by as Un,bz as Gn,bA as Rt,bB as Yt,bC as qn,bD as Da,bE as gn,bF as Va,bG as Na,bH as Aa,bI as Ca,bJ as Pa}from"./index-CXN6bmWL.js";import{t as Ma}from"./ChevronDown-RrKk7H6I.js";import{ag as vn,u as La,T as vs,D as Ka,r as Ba,an as Ia,o as Oa}from"./agent-icon-Dk522vgR.js";import{i as Fa}from"./ChevronRight-B3-5oKsn.js";import{n as $a}from"./ChevronUp-7BeD5K4q.js";import{i as za}from"./Globe01-DZMulFU5.js";import{S as Qt}from"./scroll-area-5vzmt2fx.js";import{b as Ha,h as Ua,a as Ga,c as qa,d as Wa,e as Ja}from"./dialog-qy0Z1aJp.js";import{I as Ya}from"./input-DSNlRZp-.js";import{a as bs}from"./Copy01-DH1C4T5n.js";import{i as Qa}from"./Settings02-EAB5l-Jo.js";import{s as Xa}from"./Eye-BP8ZftGB.js";import{s as Za}from"./TrendUp01-CYU0S4zQ.js";import{s as bn}from"./Plus-BAv6QwTj.js";import{s as Ss}from"./Trash01-CxXI4uLo.js";import{i as ei}from"./Zap-DrubYVJC.js";import{D as ys,a as vt,c as xs,b as _s,i as ti}from"./dropdown-menu-U_vACpBP.js";import{a as ni,P as si,b as oi}from"./page-seo-form-CqsF5lXU.js";import{b as ai}from"./Tool01-Bi7x_pFT.js";import{u as ii,A as ri}from"./use-section-preview-base-DNZmvPJ8.js";import"./tab-id-rV9ba-P7.js";import"./Check-yS6TBRKx.js";import"./Download01-uGF8VQkc.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-BQCR9h_s.js";import"./use-mcp-client-DPpSkRNd.js";import"./constants-dLUUoWH7.js";import"./auth-XA3XVIU6.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-JfBMouUo.js";import"./task-board-U9ekmgf6.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CE8tx9or.js";import"./use-ai-providers-Dnx2BwXA.js";import"./use-decopilot-events-BKdVQlWj.js";import"./use-organization-settings-DyKnNOU1.js";import"./ArrowUp-CHCWVGsK.js";import"./automation-runs-DHi91GZY.js";import"./useInfiniteQuery-1rU8yXy8.js";import"./use-infinite-scroll--Ew0plMX.js";import"./use-connection-lpB7Ak3D.js";import"./table-BaBcwP7i.js";import"./empty-state-jsXC5kwN.js";import"./use-members-ZgUYxfoN.js";import"./use-org-auth-client-s5DfOquz.js";import"./AlertCircle-hiOqJcW5.js";import"./CheckCircle-DUmezbyG.js";import"./DotsVertical-DL_xKTby.js";import"./XCircle-DbIIvoOs.js";import"./use-automations-hHGlxB3Q.js";import"./useSuspenseInfiniteQuery-DiMhuD_T.js";import"./avatar-BKEDMSnX.js";import"./User01-Bs6_V_tl.js";import"./Tool02-BahI2w-F.js";import"./Stars01-CqDHtnom.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-cPUcRSDk.js";import"./monaco-editor-doGausTU.js";import"./spinner-5kJIZwhC.js";import"./types-Dptm8vRS.js";import"./XClose-BWO2zbra.js";import"./Share07-D3k-RSTq.js";import"./Monitor01-i2p8_gzb.js";import"./SearchMd-BsqgJ4OR.js";import"./shell-layout-BAPiuVCF.js";import"./Users03-xamSOp-f.js";import"./SearchLg-C-Eqo4y8.js";import"./Stars02-DvnkqIQI.js";import"./FilterLines-DQxyjNBq.js";import"./required-auth-layout-CHGHhIp4.js";import"./use-org-sso-4XYfaR1R.js";import"./LinkExternal01--8l2Mzfp.js";import"./integration-icon-DgpBd9x9.js";import"./Palette-xsvHNVzX.js";import"./use-navigate-to-agent-BDnGtSYT.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-Ck_FKld6.js";import"./index-B069nvZi.js";import"./form-YGkaTcsZ.js";import"./label-CqOwuXw5.js";import"./file-type-icon-Qndp-c2z.js";import"./drawer-Ba-RJ-Vm.js";import"./collection-search-Bw_HysKr.js";import"./Upload01-Dx6t-7oj.js";import"./select-BxxMay64.js";import"./UserSquare-BaeuOy58.js";import"./ArrowLeft-DEFSUc-V.js";import"./tabs-C4RG823b.js";import"./toggle-group-BjESUsiw.js";import"./use-commerce-diagnostic-Brb2fqiq.js";import"./popover-B-hxuR7_.js";import"./self-tool-result-CnLvIY_a.js";import"./alert-dialog-C7gi43qw.js";import"./extract-connection-data-C4yVX3dU.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-C1RgoEO7.js";import"./authenticate-and-persist-oauth-C4F2LaiG.js";import"./mcp-oauth-CCK0vzqY.js";import"./track-CLV6okT5.js";import"./toolbar-B7xp1f_g.js";import"./github-repo-picker-BqSmN9CA.js";import"./LockUnlocked01-DiNL4sfs.js";import"./use-mcp-tools-BgQkZEa9.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-qmGgp48y.js";import"./use-registry-connections-CumAXYCD.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BJRhlIeX.js";import"./connection-form-helpers-CEN5IzSB.js";import"./collection-tabs-B_gvi_U1.js";import"./badge-BVOT5cY1.js";import"./select-model-3PUtzWOF.js";import"./checkbox-hfjBf94F.js";import"./ChevronSelectorVertical-CqILirh0.js";import"./Key01-DLwJ7Ckf.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-XUuMSfqb.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Lkn4Z7sU.js";import"./ZapSquare-BWMDlPC4.js";import"./use-file-configs-CwqLdhuz.js";import"./pt-BR-CLy76QW2.js";import"./Play-BAPfXOmA.js";import"./use-debounced-autosave-BTblZwgG.js";import"./search-input-fSMW29Ha.js";import"./use-mcp-auth-status-5BY6Nzu_.js";import"./switch-DranR37-.js";import"./Users01-UmcM8Jww.js";import"./use-secrets-Dv8l4-qt.js";import"./AreaChart-BqfhkmRW.js";import"./use-task-board-items-DhOTd2ok.js";import"./config-Bhu5kCwB.js";import"./Shield01-XqMu5Nf3.js";import"./breadcrumb-DcuBWgU6.js";import"./SwitchHorizontal01-V4kh4_ID.js";import"./command-DmgErSks.js";import"./index-B_cjnmHp.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-mKLoUee7.js";import"./task-key-n93QwSK2.js";import"./automation-list-row-CmUv79s4.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-BVrqXPPs.js";import"./CreditCard01-DxOjVad1.js";import"./Globe04-DCtFs4xl.js";import"./HardDrive-BLuff5wS.js";import"./LogOut01-DDaRu_3P.js";import"./Sun-BArbxBTe.js";function li(d){return d.schema?.definitions??d.schema?.$defs??{}}function js(d,e){const a=li(e),u=a[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=a[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function ci(d,e){for(const a of js(d,e)){const u=typeof a.image=="string"?a.image:void 0;if(u?.includes("{{{"))return u}}function ui(d,e){if(!e)return;const a=ts(d);if(!a)return;const u=ci(a.resolveType,e);if(!u)return;const p=Lo(u,a.data);if(p)return Ko(p)}const di={escape:Io};function mi(d,e){for(const a of js(d,e)){const u=typeof a.title=="string"?a.title:void 0;if(u?.includes("{{"))return u}}function fi(d,e){if(!e)return;const a=ts(d);if(a)try{const u=mi(a.resolveType,e);return u&&Bo.render(u,a.data,{},di).trim()||void 0}catch{return}}const pi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",gi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Wn(d){return Array.from({length:d},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Es(d){return d.map((e,a)=>({...e,index:a}))}function hi(d,e){if(e===d.length)return d;if(e<d.length)return Es(d.slice(0,e));const a=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...a]}function Rs(d){const e=st.c(25),{section:a,raw:u,meta:p}=d,x=a.isSavedBlock===!0,j=a.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?ui(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?fi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(La,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let D;e[11]!==j||e[12]!==x?(D=x?{color:zo}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=D):D=e[13];let c;e[14]!==D?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:D}),e[14]=D,e[15]=c):c=e[15];const S=a.isHidden&&"line-through opacity-50";let R;e[16]!==S?(R=Ue("min-w-0 flex-1 truncate text-sm font-medium",S),e[16]=S,e[17]=R):R=e[17];const l=k??a.label;let V;e[18]!==R||e[19]!==l?(V=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=V):V=e[20];let i;return e[21]!==V||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,V]}),e[21]=V,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const vi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",bi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Si="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?vi:d?Si:bi)}function ws(d,e){const a=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?pi:u?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function yi(d){const e=st.c(82),{section:a,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:K,onToggleLazy:M,onAddVariant:D,onDetach:c}=d,S=Dt(),R=u?rs(u.__resolveType??""):!1,l=a.isHidden===!0,V=R||l;let i;e[0]!==a?(i=Oo(a),e[0]=a,e[1]=i):i=e[1];const J=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:Ri},e[2]=x,e[3]=U):U=e[3];const{attributes:Le,listeners:Y,setNodeRef:m,transform:P,isDragging:we}=ls(U);let N;e[4]!==P?(N=cs.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const ae=T;let B;e[9]!==a?(B=Fo(a),e[9]=a,e[10]=B):B=e[10];const Ce=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let Q;e[13]!==a||e[14]!==j||e[15]!==de?(Q=Ue("touch-none transition-colors",de,ws(a,j)),e[13]=a,e[14]=j,e[15]=de,e[16]=Q):Q=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==a?(ie=n.jsx(Rs,{section:a,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=a,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==S?(ye=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=S,e[23]=ye):ye=e[23];let re;e[24]!==K?(re=_=>{_.stopPropagation(),K()},e[24]=K,e[25]=re):re=e[25];let L;e[26]!==l?(L=l?n.jsx(Qa,{className:"h-3.5 w-3.5"}):n.jsx(Xa,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=L):L=e[27];let qe;e[28]!==l||e[29]!==S?(qe=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=S,e[30]=qe):qe=e[30];let Ke;e[31]!==qe?(Ke=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Ke):Ke=e[32];const Ie=xs,ke=ys,F=!0,te=tt,Oe="button",Pe="ghost",xe="icon";let ne;e[33]!==S?(ne=S("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=S,e[34]=ne):ne=e[34];const me=Ue(hn(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Oe,variant:Pe,size:xe,"aria-label":ne,className:me,onClick:_i,onPointerDown:xi,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(bs,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==S?(je=S("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=S,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==J||e[52]!==D||e[53]!==S?(I=J&&n.jsxs(vt,{className:$o,onClick:_=>{_.stopPropagation(),D()},children:[n.jsx(Za,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=J,e[52]=D,e[53]=S,e[54]=I):I=e[54];let Ee;e[55]!==Ce||e[56]!==k||e[57]!==S?(Ee=Ce&&n.jsxs(vt,{className:gi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Ce,e[56]=k,e[57]=S,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==a.isMultivariate||e[61]!==a.isSavedBlock||e[62]!==S?(ge=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=a.isMultivariate,e[61]=a.isSavedBlock,e[62]=S,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(Ss,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==S?(X=S("sectionsEditor.sectionList.deleteMenuItem"),e[67]=S,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(_s,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Ie||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Ie,{children:[pe,ve]}),e[78]=Ie,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:ae,...Le,...Y,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:Q,children:[ie,!a.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(V,R)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ei,children:n.jsx(ei,{className:Ue("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(hn(V,l)),onClick:re,onPointerDown:ji,children:L})}),Ke]}),Te]})}function xi(d){return d.stopPropagation()}function _i(d){return d.stopPropagation()}function ji(d){return d.stopPropagation()}function Ei(d){return d.stopPropagation()}function Ri(){return!1}function wi(d){const e=st.c(104),{listKey:a,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:K,onToggleHidden:M,onToggleLazy:D,onAddVariant:c,onDetach:S,onAddSection:R,canAddSection:l}=d,V=l===void 0?!0:l,i=Dt();let J;e[0]!==p.length?(J=()=>Wn(p.length),e[0]=p.length,e[1]=J):J=e[1];const[U,Le]=w.useState(J),[Y,m]=w.useState(null),[P,we]=w.useState(a),[N,Z]=w.useState(p.length),T=w.useRef(!1);P!==a?(we(a),Z(p.length),Le(Wn(p.length))):N!==p.length&&(Z(p.length),Le(Te=>hi(Te,p.length)));let ae;e[2]===Symbol.for("react.memo_cache_sentinel")?(ae={activationConstraint:{distance:8}},e[2]=ae):ae=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ds},e[3]=B):B=e[3];const Ce=ns(Xt(is,ae),Xt(as,B));let ee;e[4]!==U?(ee=U.map(ki),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=Te=>{m(String(Te.active.id))},e[6]=Q):Q=e[6];const ie=Q;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:be}=Te;if(!be||_.id===be.id)return;const oe=de.indexOf(String(_.id)),De=de.indexOf(String(be.id));oe===-1||De===-1||(Le(Fe=>Es(Lt([...Fe],oe,De))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(oe,De))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{m(null)},e[10]=L):L=e[10];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==Y||e[12]!==V||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==S||e[21]!==k||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==D||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Ce||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==Y||e[47]!==V||e[48]!==U||e[49]!==R||e[50]!==u||e[51]!==p||e[52]!==i){const _=Y?U.find(be=>be.id===Y):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let be;e[56]!==i?(be=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=be):be=e[57];let oe;e[58]!==be?(oe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=oe):oe=e[59];const De=!V;let Fe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsx(bn,{size:14}),e[60]=Fe):Fe=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let Ve;e[63]!==R||e[64]!==De||e[65]!==ct?(Ve=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:De,onClick:R,children:[Fe,ct]}),e[63]=R,e[64]=De,e[65]=ct,e[66]=Ve):Ve=e[66];let Xe;e[67]!==oe||e[68]!==Ve?(Xe=n.jsxs("div",{className:"space-y-2",children:[oe,Ve]}),e[67]=oe,e[68]=Ve,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=Y,e[47]=V,e[48]=U,e[49]=R,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Ie=ms,xe=Ce,ne=fs,me=ie,_e=re,fe=qe,Ke=ps,Oe=de,Pe=gs,Me="space-y-1",te=U.map(_=>{const be=p[_.index];return be?n.jsx(yi,{sortableId:_.id,section:be,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>K(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>D(_.index),onAddVariant:()=>c(_.index),onDetach:()=>S(_.index)},_.id):null})}e[11]=Y,e[12]=V,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=R,e[18]=c,e[19]=g,e[20]=S,e[21]=k,e[22]=K,e[23]=v,e[24]=M,e[25]=D,e[26]=u,e[27]=p,e[28]=j,e[29]=Ce,e[30]=i,e[31]=Ke,e[32]=Ie,e[33]=ke,e[34]=F,e[35]=te,e[36]=Oe,e[37]=Pe,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Ke=e[31],Ie=e[32],ke=e[33],F=e[34],te=e[35],Oe=e[36],Pe=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Ke||e[74]!==Oe||e[75]!==Pe||e[76]!==je?(le=n.jsx(Ke,{items:Oe,strategy:Pe,children:je}),e[73]=Ke,e[74]=Oe,e[75]=Pe,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ws(F,!1)),children:n.jsx(Rs,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Ie||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Ie,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Ie,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!V;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(bn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==R||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:R,children:[he,X]}),e[96]=R,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function ki(d){return d.id}function Jn(d){const e=st.c(57),{open:a,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Dt(),[k,K]=w.useState(u),[M,D]=w.useState(a);a!==M&&(D(a),a&&K(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const S=c;let R;e[3]!==y||e[4]!==k||e[5]!==j?(R=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=R):R=e[6];const l=R;let V;e[7]!==g?(V=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=V):V=e[8];let i;e[9]!==V?(i=n.jsx(Ha,{children:V}),e[9]=V,e[10]=i):i=e[10];let J;e[11]!==p||e[12]!==g?(J=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=J):J=e[13];let U;e[14]!==J?(U=n.jsx(Ua,{children:J}),e[14]=J,e[15]=U):U=e[15];let Le;e[16]!==i||e[17]!==U?(Le=n.jsxs(Ga,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Le):Le=e[18];let Y;e[19]!==g?(Y=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=Y):Y=e[20];let m;e[21]!==Y?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:Y}),e[21]=Y,e[22]=m):m=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=ie=>K(ie.target.value),e[23]=P):P=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Ya,{id:"variant-rename-name",value:k,onChange:P,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let ae;e[35]!==y||e[36]!==Z||e[37]!==T?(ae=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=ae):ae=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Ce;e[42]!==y||e[43]!==B?(Ce=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Ce):Ce=e[44];let ee;e[45]!==ae||e[46]!==Ce?(ee=n.jsxs(qa,{children:[ae,Ce]}),e[45]=ae,e[46]=Ce,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Le?(de=n.jsx(Wa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Le,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Le,e[52]=de):de=e[52];let Q;return e[53]!==S||e[54]!==a||e[55]!==de?(Q=n.jsx(Ja,{open:a,onOpenChange:S,children:de}),e[53]=S,e[54]=a,e[55]=de,e[56]=Q):Q=e[56],Q}function ks(d){const e=st.c(5),{rule:a,matchers:u}=d,p=a?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??Ho(p);x=Ka(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Yn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function Qn(d){return d.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Ti(d,e){const a=new Map;for(const u of d){const p=a.get(u.variant.label);p?p.push(u):a.set(u.variant.label,[u])}return e.map((u,p)=>({id:a.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Di(d){return d.map((e,a)=>({...e,index:a}))}function Ts(d){const e=st.c(17),{label:a,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(ks,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==a?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=M):M=e[4];let D;e[5]!==x||e[6]!==j||e[7]!==a||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(D=!j&&n.jsxs(xs,{children:[n.jsx(ys,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ni,onPointerDown:Vi,children:n.jsx(vs,{size:14})})}),n.jsxs(_s,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:S=>{S.stopPropagation(),v?.()},children:[n.jsx(ai,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:S=>{S.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ti,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:S=>{S.stopPropagation(),g?.()},children:[n.jsx(Ss,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=a,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=D):D=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==D?(c=n.jsxs(n.Fragment,{children:[K,M,D]}),e[13]=K,e[14]=M,e[15]=D,e[16]=c):c=e[16],c}function Vi(d){return d.stopPropagation()}function Ni(d){return d.stopPropagation()}function Ai(d){const e=st.c(33),{entry:a,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:K}=d;let M;e[0]!==a.id?(M={id:a.id,animateLayoutChanges:Ci},e[0]=a.id,e[1]=M):M=e[1];const{attributes:D,listeners:c,setNodeRef:S,transform:R,isDragging:l}=ls(M);let V;e[2]!==R?(V=cs.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=V):V=e[3];const i=l?0:void 0;let J;e[4]!==V||e[5]!==i?(J={transform:V,opacity:i},e[4]=V,e[5]=i,e[6]=J):J=e[6];const U=J,Le=j??void 0;let Y;e[7]!==x||e[8]!==a.variant.rule||e[9]!==Le?(Y=Kt(a.variant.rule,x,Le),e[7]=x,e[8]=a.variant.rule,e[9]=Le,e[10]=Y):Y=e[10];const m=Y;let P;e[11]!==y?(P=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=P):P=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?hs:us;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==a.variant.label||e[19]!==v||e[20]!==K||e[21]!==k||e[22]!==g?(T=n.jsx(Ts,{label:a.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:K}),e[16]=p,e[17]=m,e[18]=a.variant.label,e[19]=v,e[20]=K,e[21]=k,e[22]=g,e[23]=T):T=e[23];let ae;return e[24]!==D||e[25]!==c||e[26]!==y||e[27]!==S||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==P?(ae=n.jsx("div",{ref:S,style:U,...D,...c,onClick:y,onKeyDown:P,className:Z,children:T}),e[24]=D,e[25]=c,e[26]=y,e[27]=S,e[28]=U,e[29]=Z,e[30]=T,e[31]=P,e[32]=ae):ae=e[32],ae}function Ci(){return!1}function Pi(d){const e=st.c(9),{variant:a,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==a.rule?(v=Kt(a.rule,u,j),e[0]=u,e[1]=j,e[2]=a.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==a.label?(k=n.jsx("div",{className:g,children:n.jsx(Ts,{label:a.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=a.label,e[8]=k):k=e[8],k}function Mi(d){const e=st.c(91),{listKey:a,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:K,onDelete:M,onAdd:D}=d,c=Dt();let S;e[0]!==u?(S=()=>Qn(u),e[0]=u,e[1]=S):S=e[1];const[R,l]=w.useState(S),[V,i]=w.useState(null),[J,U]=w.useState(a),[Le,Y]=w.useState(u.length);let m;e[2]!==u?(m=()=>Yn(u),e[2]=u,e[3]=m):m=e[3];const[P,we]=w.useState(m),N=w.useRef(!1),Z=Yn(u);J!==a?(U(a),Y(u.length),we(Z),l(Qn(u))):(Le!==u.length||P!==Z)&&(Y(u.length),we(Z),l(ge=>Ti(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let ae;e[5]===Symbol.for("react.memo_cache_sentinel")?(ae={coordinateGetter:ds},e[5]=ae):ae=e[5];const B=ns(Xt(is,T),Xt(as,ae));let Ce;e[6]!==R?(Ce=R.map(Li),e[6]=R,e[7]=Ce):Ce=e[7];const ee=Ce,de=u.length>1;let Q;e[8]!==R?(Q=ge=>{const ce=String(ge.active.id);i(R.find(he=>he.id===ce)??null)},e[8]=R,e[9]=Q):Q=e[9];const ie=Q;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Di(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(null)},e[13]=L):L=e[13];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==R||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==D||e[24]!==M||e[25]!==K||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=oe=>{N.current||y(oe)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==D||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:D,children:ue})}),e[50]=D,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let be;e[57]!==ve||e[58]!==_?(be=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=be):be=e[59],e[60]!==he||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,be]}),e[60]=he,e[61]=be,e[62]=fe):fe=e[62],Ie=ms,Oe=B,Pe=fs,xe=ie,ne=re,me=qe,Ke=ps,F=ee,te=gs,pe="space-y-0.5",ke=R.map(oe=>n.jsx(Ai,{entry:oe,isActive:oe.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(oe.index),onRename:()=>k(oe.index),onDuplicate:()=>K(oe.index),onDelete:()=>M(oe.index)},oe.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=R,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=D,e[24]=M,e[25]=K,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Ke,e[31]=Ie,e[32]=ke,e[33]=F,e[34]=te,e[35]=Oe,e[36]=Pe,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Ke=e[30],Ie=e[31],ke=e[32],F=e[33],te=e[34],Oe=e[35],Pe=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Ke||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Ke,{items:F,strategy:te,children:se}),e[66]=Ke,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==V||e[72]!==x||e[73]!==v||e[74]!==j?(je=V?n.jsx(Pi,{variant:V.variant,decofile:x,meta:j,matchers:v}):null,e[71]=V,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Ie||e[79]!==Oe||e[80]!==Pe||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Ie,{sensors:Oe,collisionDetection:Pe,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Ie,e[79]=Oe,e[80]=Pe,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Li(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:a,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:K,formKey:M,formWrapperClassName:D,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l}=d;let V;e[0]!==p||e[1]!==u||e[2]!==a||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(V=n.jsx(Uo,{currentRt:a,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=a,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=V):V=e[7];let i;e[8]!==S||e[9]!==M||e[10]!==k||e[11]!==D||e[12]!==c||e[13]!==K||e[14]!==R||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:D,children:n.jsx(Go,{schema:g,value:k,onChange:K,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=S,e[9]=M,e[10]=k,e[11]=D,e[12]=c,e[13]=K,e[14]=R,e[15]=l,e[16]=g,e[17]=i):i=e[17];let J;return e[18]!==V||e[19]!==i?(J=n.jsxs(n.Fragment,{children:[V,i]}),e[18]=V,e[19]=i,e[20]=J):J=e[20],J}function Dc({orgSlug:d,virtualMcpId:e,branch:a,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:D}){const c=Dt(),S=Mo()?.taskId??null,R=u?{orgSlug:d,virtualMcpId:e,branch:a,threadId:S,previewUrl:p}:null,{data:l,isLoading:V}=qo(R),{data:i,isLoading:J}=Wo(R),U=Jo(),Le=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,Y=ii({virtualMcpId:e,sandboxUrl:p}),[m,P]=w.useState(null),[we,N]=w.useState(null),[Z,T]=w.useState(null),[ae,B]=w.useState(0),[Ce,ee]=w.useState(void 0),[de,Q]=w.useState(null),[ie,ye]=w.useState(null),[re,L]=w.useState([]),qe=w.useRef(null),[Ke,Ie]=w.useState(re.length);Ke!==re.length&&(Ie(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=w.useState(0),[te,Oe]=w.useState(null),[Pe,xe]=w.useState(null),[ne,me]=w.useState(null),[_e,fe]=w.useState(!0),[pe,se]=w.useState(!1),[Me,je]=w.useState(!1),le=w.useRef(null),[I,Ee]=w.useState(k),[ge,ce]=w.useState(k);k&&!ge&&(ce(!0),Ee(!0),P(null),N(null),T(null),L([])),!k&&ge&&ce(!1);const[he,X]=w.useState(null),[ue,ve]=w.useState(void 0),[Te,_]=w.useState([]),[be,oe]=w.useState(0),[De,Fe]=w.useState(0),[ct,Ve]=w.useState(null),[Xe,We]=w.useState(null),[Sn,yn]=w.useState(null),Ds=Co(),Vs=`${d}/${e}/${a}`,Zt=Yo({orgSlug:d,virtualMcpId:e,branch:a}),[Ns,As]=w.useState(x),[Cs,Ps]=w.useState(j),[Ms,Ls]=w.useState(v);(Ns!==x||Cs!==j||Ms!==v)&&(queueMicrotask(()=>Zt.flush()),As(x),Ps(j),Ls(v),P(null),N(null),T(null),B(0),Q(null),ye(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),oe(t=>t+1));const Ne=Qo({orgSlug:d,virtualMcpId:e,branch:a}),Bt=Ea((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:o=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),en=Xo({orgSlug:d,virtualMcpId:e,branch:a}),[Vt,It]=w.useState(!1),ze=w.useRef(null),ot=w.useRef(null),at=w.useRef(null),tn=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||V||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ks=Zo(l),Ae=!!v,Je=Ae?null:ea(Ks,x,j),E=Ae?v:Je?.key??null,nn=Ae&&v?l[v]:void 0,xn=Ae&&v&&nn?ta(v,nn):Ae&&v?v:"",Ot=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Je?Bn(l,{kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},i):null,Bs=I?Ot?.seo:void 0,on=ue!==void 0?ue:Bs,Is=I?na(on):void 0,Os=sn?.seoTypeOptions??[],Fs=I&&i?sa(i):"",_n=he??Is??{},an=I&&sn?ni(_n,sn):null,$s=I&&an&&oa(on)?qt(an,i):null,zs=I?aa(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:ia(Ot?.sections,l??{}),Ft=Ge.length>1,$e=Math.min(ae,Ge.length-1),ut=Ge[$e],z=ut?.sections??[],He=Wt(z,l),jn=!Ae&&ra(Ot?.sections);if(Ae&&v&&Sn!==v){yn(v);const t=z[0],s=He[0];if(t&&s){P(0),Fe(0),L([]);const o=St(t,s,l);o&&(N(o.data),T(o.resolveType),We(null),Ve(null))}}!Ae&&Sn!==null&&yn(null),Ze.current={rawSections:z,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:De,selectedSectionIndex:m};const Hs=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!D)return;if(!E||!jn||t.length<=1){D(null);return}const o=qn(E,{multivariate:!0,index:s,variants:t},l,i);D(o.length>0?o:null)},xt=(t,s,o)=>{if(!D)return;if(!E){D(null);return}const r=Hs(),f=qn(E,r,l,i);if(!t||s<0){D(f.length>0?f:null);return}const b=Da({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:l,meta:i}),h=[...f,...b];D(h.length>0?h:null)},dt=(t,s,o,r=m??-1,f=!1)=>{const b=nt(t,s);if(!b){N(null),T(null),We(null),Ve(null),f&&xt(null,r,o);return}const A=In(b,ht)[o];if(!A){N(null),T(null),We(null),Ve(null),f&&xt(null,r,o);return}const W=ha(A.value,l);N(W?.data??null),T(W?.resolveType??null);const{resolveType:C,formValue:O}=Ct(A.rule,l,i??void 0);We(C),Ve(O),f&&xt(b,r,o)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==Ce&&(ee(y?.seq??null),typeof Nt=="number")){const t=z[Nt],s=He[Nt];if(t&&s)if(P(Nt),Fe(0),L([]),F(o=>o+1),s.isMultivariate)dt(t,s,0,Nt);else{const o=St(t,s,l);o?(N(o.data),T(o.resolveType)):(N(null),T(null)),We(null),Ve(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:a,threadId:S,previewUrl:p??void 0,siteSlug:Le},rn=Z&&i?qt(Z,i):null,Ye=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(l,E,t,$e,Ge);Ne.mutate({blockKey:E,data:o},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{P(null),N(null),T(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1)},Us=(t,s)=>{ze.current&&clearTimeout(ze.current);const o=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current,C=r[s];if(!C)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const H=O.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;Ne.mutate({blockKey:H,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...b[h]},Re=[...r];if(O.isMultivariate){const H=nt(C,O);if(!H||!h)return;const G=Na(H,o,t);Re[s]=yt(C,O,G)}else if(O.isHidden){const H=rs(C.__resolveType),G=H?{...C.section}:{...C},Be=Array.isArray(G.variants)?[...G.variants]:[];Be[0]&&(Be[0]={...Be[0],value:t}),G.variants=Be,H?Re[s]={...C,section:G}:Re[s]=G}else O.isLazy?Re[s]={...C,section:t}:Re[s]=t;if(A.length>1){const H=$.sections,G=[...H?.variants??[]];G[W]&&(G[W]={...G[W],value:Re}),$.sections={...H,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:H=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:H.message}))})},gn)},Gs=t=>{P(t),Fe(0),L([]),F(f=>f+1);const s=z[t],o=He[t];if(!s||!o)return;if(o.isMultivariate){dt(s,o,0,t);return}const r=St(s,o,l);if(!r){N(null),T(null),We(null),Ve(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),Ve(null),xt(null,t,0)},Rn=t=>{const s=t;N(s),m!==null&&Us(s,m)},ln=t=>{if(!E||!l||!i||!Je)return;const s={kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},o=Bn(l,s,i);o&&Zt.save(E,()=>{const r=Ds.getQueryData(Po.decofile(Vs))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?oi(s,o,f,t.inner):f})},qs=(t,s)=>{E&&(tn.current[t]=s,ln())},Ws=(t,s)=>{if(!E)return;const o=Lt([...z],t,s);m!==null&&(m===t?P(s):t<m&&s>=m?P(m-1):t>m&&s<=m&&P(m+1)),Ye(o)},Js=t=>{if(!E)return;const s=z.filter((o,r)=>r!==t);m===t?_t():m!==null&&m>t&&P(m-1),Ye(s)},Ys=t=>{if(!E)return;const s=z[t];if(!s)return;const o=[...z];o.splice(t+1,0,Ta(s)),m!==null&&m>t&&P(m+1),Ye(o)},Qs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o)return;const r=o.isHidden?wa(s):ka(s);if(!r)return;const f=[...z];f[t]=r,m===t&&_t(),Ye(f)},Xs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o||o.isMultivariate)return;const r=Ra(s);if(!r)return;const f=[...z];f[t]=r,m===t&&_t(),Ye(f)},Zs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o?.isSavedBlock)return;const r=St(s,o,l);if(!r?.data)return;const{name:f,...b}=r.data,h=[...z];o.isLazy?h[t]={...s,section:b}:h[t]=b,m===t&&_t(),Ye(h)},eo=t=>{if(!E)return;const s=[...z,{__resolveType:t.resolveType}],o=s.length-1;Ye(s,{onSuccess:()=>{se(!1),P(o),Fe(0),L([]),F(h=>h+1);const r=s[o],f=Wt(s,l)[o];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const b=St(r,f,l);if(!b){N(null),T(null),We(null),Ve(null);return}N(b.data),T(b.resolveType),We(null),Ve(null)}})},wn=t=>{le.current=t.append,se(!0)},to=t=>{const s=le.current;if(!s){eo(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},no=t=>{if(m===null)return;const s=z[m],o=He[m];!s||!o?.isMultivariate||(Fe(t),L([]),F(r=>r+1),dt(s,o,t,m,!0))},so=t=>{if(m===null||!E)return;const s=z[m],o=He[m];if(!s||!o?.isMultivariate)return;const r=nt(s,o);if(!r)return;const f=_a(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const b=[...z];b[m]=yt(s,o,f);const h=f.variants;let A=De;t===De?A=Math.min(t,h.length-1):t<De&&(A=De-1),Fe(A),L([]),F(W=>W+1),dt(b[m],o,A),Ye(b)},oo=t=>{if(m===null||!E)return;const s=z[m],o=He[m];if(!s||!o?.isMultivariate)return;const r=nt(s,o);if(!r)return;const f=ja(r,t),b=[...z];b[m]=yt(s,o,f);const h=t+1;Fe(h),L([]),F(A=>A+1),dt(b[m],o,h),Ye(b)},ao=(t,s)=>{if(m===null||!E||t===s)return;const o=z[m],r=He[m];if(!o||!r?.isMultivariate)return;const f=nt(o,r);if(!f)return;const b=ya(f,t,s),h=[...z];h[m]=yt(o,r,b);let A=De;De===t?A=s:t<De&&s>=De?A=De-1:t>De&&s<=De&&(A=De+1),Fe(A),dt(h[m],r,A),Ye(h)},cn=t=>{const s=t??m;if(s===null||!E)return;const o=z[s],r=He[s];if(!o||!r)return;const f=va(o,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const b=[...z];b[s]=f.section;const h=Wt(b,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}P(s),Fe(f.newVariantIndex),L([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Ye(b)},io=()=>{if(m===null||!E)return;const t=z[m],s=He[m];if(!t||!s?.isMultivariate)return;const o=nt(t,s);if(!o)return;const r=xa(t,s,o);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...z];f[m]=r;const b=Wt(f,l)[m];if(!b)return;Fe(0),We(null),Ve(null),L([]),F(A=>A+1);const h=St(r,b,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Ye(f)},ro=async t=>{if(te===null||!E)return;const s=pn(t,l);if(s){q.error(s);return}const o=z[te],r=He[te];if(!o||!r)return;const f=St(o,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const b={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:b});const h=[...z];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Mt(l,E,h,$e,Ge)}),m===te&&_t(),Oe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&m===null&&ie===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);ye(t),Q(s)}const zt=i?la(i):[],Tn=i&&l?ca(i,l):[],lo=!Ae&&!!(Y&&i&&l),co=ie&&i?qt(ie,i):null,jt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},At=async(t,s)=>{if(!(Va(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(o){q.error(o instanceof Error?o.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:r}=Ze.current;if(!s)return;const f={...o[s]},b={...f.sections},h=[...b.variants??[]],A=h[r],W=A?.rule;if(Et(W,o,i)){const C=W?.__resolveType??"",O=o[C],$=typeof O?.name=="string"?O.name:C,{__resolveType:Re,...H}=t;Ne.mutate({blockKey:C,data:Rt(Re??"",H,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...b,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},gn)},uo=t=>{ye(t);const s=t?zn(t,i):{__resolveType:Hn};Q(t?s:{}),Dn(s)},mo=t=>{const s=t;Q(s);const o=ie?{__resolveType:ie,...s}:{...s};Dn(o)},fo=async t=>{jt();const{activePageKey:s,decofile:o,variantIndex:r}=Ze.current;if(!s)return;const f=o[s],b=f?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[r];if(!W)return;const C=Pt(W.rule,o,i),O=Yt(t);A[r]={...W,rule:O};const $={...o,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:H}=Ct(O,$,i??void 0);ye(Re),Q(H);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),C&&C!==t&&await At(C,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=Ze.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const H=($.variants??[])[o]?.rule;if(Et(H,b,i)){const Se=H?.__resolveType??"",Qe=b[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:Se,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=$n($,o,t),Be=[...r];Be[s]=yt(C,O,G);const et=Mt(b,h,Be,W,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:Se=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},po=t=>{We(t);const s=t?zn(t,i):{__resolveType:Hn};Ve(t?s:{}),Vn(s)},go=t=>{const s=t;Ve(s);const o=Xe?{__resolveType:Xe,...s}:{...s};Vn(o)},ho=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(s===null||!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],H=Pt(Re[o]?.rule,b,i),G=Yt(t),Be=$n($,o,G),et=[...r];et[s]=yt(C,O,Be);const Se=Mt(b,h,et,W,A),Qe={...b,[h]:Se},{resolveType:rt,formValue:pt}=Ct(G,Qe,i??void 0);We(rt),Ve(pt);try{await Ne.mutateAsync({blockKey:h,data:Se}),H&&H!==t&&await At(H,Qe),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,Nn=m!==null?z[m]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,bt=An?In(An,ht):[],un=Math.min(De,Math.max(bt.length-1,0)),Ht=bt[un]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&we)),vo=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||vo,bo=Ae?xn:mt?.label??"",So=Xe&&i?qt(Xe,i):null,dn=Ut&&(!Ae||re.length>0)?Ae?[xn,...re]:[Je.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],yo=I&&Je?[Je.name,"SEO",...Te]:[],Gt=I?yo:it?dn.length>0?dn:[bo]:dn,xo=!I&&!Ae&&ft&&re.length===0,Pn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=ba(t.sections,z);if(!s)return;const o=Sa(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(o),P(null),N(null),T(null),L([]),Q(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,o)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const b=f;if(!Array.isArray(b.variants))return;const h=t([...b.variants]);if(!h)return;const A=Aa(b,h),W={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:W[E]},{onSuccess:()=>{s?.(),o&&At(o,W)},onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},_o=t=>{xe(null),B(t),P(null),N(null),T(null),L([]);const s=Ge[t]?.rule,{resolveType:o,formValue:r}=Ct(s,l??{},i??void 0);ye(o),Q(r),En(Ge.map(f=>({rule:f.rule})),t)},jo=(t,s)=>{if(t===s)return;let o=$e;$e===t?o=s:t<$e&&s>=$e?o=$e-1:t>$e&&s<=$e&&(o=$e+1),B(o);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);En(r,o),mn(f=>Lt(f,t,s))},Eo=t=>{const s=Ge[t]?.rule,o=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<$e?B($e-1):t===$e&&B(Math.max(0,t-1)),P(null),N(null),T(null),L([]),Q(null),ye(null)},o)},Ro=t=>{mn(s=>Ca(s,t),()=>{B(t+1),P(null),N(null),T(null),L([]),Q(null),ye(null)})},wo=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const o=Ze.current.activePageKey,r=Ze.current.decofile;if(!o)return;const f=r[o],b=f.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[t];if(!W?.rule||typeof W.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=W.rule,O=s.trim();It(!0);try{if(!O){if(!Et(C,r,i)){xe(null);return}const et=C.__resolveType??"";A[t]={...W,rule:Un(C,r,i)};const Se={...r,[o]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:o,data:Se[o]}),await At(et,Se),xe(null),g?.();return}const $=Gn(C,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=fn(O),H=pn(Re,r);if(H){q.error(H);return}const G=Rt($.resolveType,$.data,O);let Be=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Be=Re,A[t]={...W,rule:Yt(Re)},await Ne.mutateAsync({blockKey:o,data:{...f,sections:{...h,variants:A}}}),Be=null}catch(et){throw Be&&await en.mutateAsync({blockKey:Be}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},ko=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:o,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(o===null||!h)return;const C=r[o],O=f[o];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],H=Re[t];if(!H?.rule||typeof H.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=H.rule,Be=s.trim();It(!0);const et=async Se=>{const Qe={...$,variants:Se},rt=[...r];rt[o]=yt(C,O,Qe);const pt=Mt(b,h,rt,W,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...b,[h]:pt}};try{if(!Be){if(!Et(G,b,i)){me(null);return}const gt=G.__resolveType??"",Kn=[...Re];Kn[t]={...H,rule:Un(G,b,i)};const Ao=await et(Kn);await At(gt,Ao),me(null),g?.();return}const Se=Gn(G,b,i);if(!Se){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Rt(Se.resolveType,Se.data,Be)}),me(null),g?.();return}const Qe=fn(Be),rt=pn(Qe,b);if(rt){q.error(rt);return}const pt=Rt(Se.resolveType,Se.data,Be);let lt=null;try{await Ne.mutateAsync({blockKey:Qe,data:pt}),lt=Qe;const gt=[...Re];gt[t]={...H,rule:Yt(Qe)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),g?.()}catch(Se){q.error(Se instanceof Error?Se.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},To=t=>{X(t),ln({inner:t})},Do=t=>{ve(t),ln({raw:t})},Vo=()=>{X(null),_([])},No=()=>oe(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),oe(o=>o+1),K?.();return}if(t===1){_([]),oe(o=>o+1);return}_(Te.slice(0,t-1)),oe(o=>o+1);return}if(Ae){L(re.slice(0,t)),F(o=>o+1);return}if(t===0){Mn();return}if(t===1){L([]),F(o=>o+1);return}if(ft&&t===2){L([]),F(o=>o+1);return}const s=ft?2:1;L(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Pa(Gt.length,{isMultivariateSectionTop:xo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ba,{className:"size-4"})}),!Ae&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ua),children:[n.jsx(ks,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const o=s===Gt.length-1,r=da(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Fa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(za,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(On,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(ma,{pageKey:E,initialName:Je.name,initialPath:Je.path,onFieldChange:qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Ia,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M(E):je(!0),children:n.jsx(Oa,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(On,{onClick:Pn})]})}),I?n.jsx(Qt,{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:Ot&&E?n.jsx(si,{rawSeo:on,innerSeo:_n,defaultResolveType:Fs,seoSchema:$s,activeResolveType:an,seoTypeOptions:Os,formResetKey:be,siteDefaultSeo:zs,onBreadcrumbChange:_,onPersistRaw:Do,onInnerChange:To,onClearForm:Vo,onBumpFormKey:No}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&bt.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(fa,{listKey:`${E??""}:${m??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:no,onRename:me,onDuplicate:oo,onDelete:so,onRemoveAll:io,onReorder:ao,onAdd:()=>cn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Xe??"",currentLabel:Jt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:po,onSelectGlobal:ho,schema:So,formValue:ct,onChange:go,formKey:`${m??"none"}:${un}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})]},"editor-section-form"):Ae?n.jsx(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&E&&n.jsx(Mi,{listKey:E,variants:Ge,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:_o,onReorder:jo,onRename:xe,onDuplicate:Ro,onDelete:Eo,onAdd:Pn}),Ft&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx($a,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ma,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Jt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:uo,onSelectGlobal:fo,schema:co,formValue:de,onChange:mo,formKey:`${$e}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(wi,{listKey:`${E??""}-${$e}`,rawSections:z,sections:He,meta:i,selectedIndex:m,onSelect:Gs,onReorder:Ws,onDelete:Js,onDuplicate:Ys,onMakeReusable:Oe,onToggleHidden:Qs,onToggleLazy:Xs,onAddVariant:cn,onDetach:Zs,onAddSection:()=>se(!0),canAddSection:lo})})]},"editor-section-list"),n.jsx(pa,{open:te!==null,onOpenChange:t=>{t||Oe(null)},defaultBlockId:te!==null?fn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ro}),Y&&n.jsx(ri,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:Y,onSelect:to}),Me&&E&&l&&n.jsx(ga,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Pe!==null&&n.jsx(Jn,{open:!0,initialName:Et(Ge[Pe]?.rule,l??{},i??void 0)?Jt(Ge[Pe]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(Ge[Pe]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wo(Pe,t)},onOpenChange:t=>{!t&&!Vt&&xe(null)}}),ne!==null&&n.jsx(Jn,{open:!0,initialName:Et(bt[ne]?.rule,l??{},i??void 0)?Jt(bt[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(bt[ne]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await ko(ne,t)},onOpenChange:t=>{!t&&!Vt&&me(null)}})]})}export{Dc as SectionsEditor};
|
|
1
|
+
import{c as st,b as Dt,r as w,n as Ue,j as n,aH as Zn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Co,t as q,K as Po}from"./index-ZtSDBa1M.js";import{b as Mo}from"./chat-context-xMr_4Axs.js";import{au as ts,av as Lo,aw as Ko,ax as Bo,ay as Io,ab as ns,ac as Xt,az as ss,aA as os,ad as as,ae as is,aB as rs,aC as Oo,al as ls,am as cs,aD as Fo,aE as $o,aF as us,P as zo,af as ds,ag as Lt,aj as ms,ak as fs,ah as ps,ar as gs,aG as Ho,aH as Kt,aI as hs,aJ as Uo,aK as Go,aL as qo,aM as Wo,aN as Jo,F as Yo,G as Qo,aO as Xo,aP as Zo,aQ as ea,aR as ta,aS as Bn,aT as na,aU as sa,aV as oa,ap as qt,aW as aa,aX as ia,aY as Wt,aZ as ra,a_ as St,a$ as Ct,b0 as la,b1 as ca,b2 as nt,b3 as In,b4 as ua,H as da,b5 as On,b6 as ma,b7 as fa,b8 as Pt,b9 as Jt,ba as Fn,bb as pa,bc as fn,bd as ga,be as ht,bf as Et,bg as ha,bh as va,bi as ba,bj as Sa,bk as ya,bl as yt,bm as xa,bn as _a,bo as ja,J as Ea,bp as $n,bq as Mt,br as zn,bs as Hn,bt as Ra,bu as wa,bv as ka,bw as Ta,bx as pn,by as Un,bz as Gn,bA as Rt,bB as Yt,bC as qn,bD as Da,bE as gn,bF as Va,bG as Na,bH as Aa,bI as Ca,bJ as Pa}from"./index-_P3U4SZO.js";import{t as Ma}from"./ChevronDown-lhRoz8ve.js";import{ac as vn,u as La,T as vs,D as Ka,r as Ba,aj as Ia,o as Oa}from"./agent-icon-BWc_2R02.js";import{i as Fa}from"./ChevronRight-PA4SrDe8.js";import{n as $a}from"./ChevronUp-CjB5cNrn.js";import{i as za}from"./Globe01-BJregYun.js";import{S as Qt}from"./scroll-area-I0x16PDc.js";import{b as Ha,h as Ua,a as Ga,c as qa,d as Wa,e as Ja}from"./dialog-DROTnc8B.js";import{I as Ya}from"./input-DF-XKSRq.js";import{a as bs}from"./Copy01-rjZTF0JK.js";import{i as Qa}from"./Settings02-D2DQzPhq.js";import{s as Xa}from"./Eye-Dwcpfw8S.js";import{s as Za}from"./Flag01-BeOUsooU.js";import{s as bn}from"./Plus-B-dc60nq.js";import{s as Ss}from"./Trash01-jS-aJOE_.js";import{i as ei}from"./Zap-BWNllArR.js";import{D as ys,a as vt,c as xs,b as _s,i as ti}from"./dropdown-menu-B4M2oT-i.js";import{a as ni,P as si,b as oi}from"./page-seo-form-BG0L-bvt.js";import{b as ai}from"./Tool01-Du0WeBXL.js";import{u as ii,A as ri}from"./use-section-preview-base-DfPlaDKY.js";import"./tab-id-9f5Elcwo.js";import"./Check-B-T1OdyM.js";import"./Download01-B29-DAMF.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-RMH7Z-XL.js";import"./use-mcp-client-4vfKAZII.js";import"./constants-dLUUoWH7.js";import"./auth-CLHX9XFE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BxpeMujQ.js";import"./task-board-BU3VhW_R.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-B6Y0d6n-.js";import"./use-ai-providers-D88F4M9N.js";import"./use-decopilot-events-BlGPRpvB.js";import"./use-organization-settings-DYWZmbib.js";import"./ArrowUp-ClPk-tEL.js";import"./automation-runs-Z0iz6dal.js";import"./useInfiniteQuery-Dive_90S.js";import"./use-infinite-scroll-Dh44_qVU.js";import"./use-connection-CC36uLn5.js";import"./table-L3_2rt8c.js";import"./empty-state-CUXmv4-D.js";import"./use-members-BThWW8DN.js";import"./use-org-auth-client-CvXr6xpG.js";import"./AlertCircle-CWbbvCE8.js";import"./CheckCircle-Di9U5M_3.js";import"./Circle-0WhMTazG.js";import"./XCircle-BiZVJH8A.js";import"./use-automations-DVpA7X4y.js";import"./useSuspenseInfiniteQuery-CV0LhXLD.js";import"./avatar-BwzKyp1i.js";import"./User01-CRCcS7B3.js";import"./Tool02-FNZ9nQDs.js";import"./Stars01-Dd5b7TNK.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DdEgqbGk.js";import"./monaco-editor-Dz28X6On.js";import"./spinner-DG-xe-ih.js";import"./types-DBBMfbWD.js";import"./XClose-CF46faeu.js";import"./Share07-C7EQRNeA.js";import"./Monitor01-Dbzqlbm3.js";import"./SearchMd-BkU5uvZ3.js";import"./shell-layout-C_ZyBlX2.js";import"./Users03-DgFiBAG1.js";import"./SearchLg-BR5Nvvey.js";import"./Stars02-U_TQPDnJ.js";import"./FilterLines-T3vrjlCu.js";import"./required-auth-layout-Cw5XELIs.js";import"./use-org-sso-dXFz_XEn.js";import"./LinkExternal01-GY6MBjsu.js";import"./integration-icon-DjGRurnq.js";import"./Palette-2Z9yrBrj.js";import"./use-navigate-to-agent-B7O4mdOp.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-C0_sgo02.js";import"./index-Tc1_kaTc.js";import"./form-Cedy9Kwp.js";import"./label-CLXgBrTK.js";import"./file-type-icon-t6saePJP.js";import"./drawer-BXgwQk-w.js";import"./collection-search-BBBLCvXm.js";import"./Upload01-CbBPEmg7.js";import"./select-DbwWg8mr.js";import"./ThumbsUp-DsTVql5w.js";import"./ArrowLeft-yxeobg0v.js";import"./tabs-DT4yo0dz.js";import"./toggle-group-B64JMRC7.js";import"./use-commerce-diagnostic-CWLq3qkc.js";import"./popover-Dac8KJD5.js";import"./self-tool-result-xpNWJZXF.js";import"./alert-dialog-BGVZQi8t.js";import"./extract-connection-data-BLs-F9MR.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./Tag01-hM9BONIh.js";import"./use-debounced-value-DPpXL-7f.js";import"./authenticate-and-persist-oauth-DI4W2xjU.js";import"./mcp-oauth-CCo8zz0v.js";import"./track-D52qjC2J.js";import"./toolbar-H9jBvos0.js";import"./github-icon-Dz4xNzgo.js";import"./github-repo-picker-BziyF4os.js";import"./LockUnlocked01-Dy5fUMBA.js";import"./use-mcp-tools-kLeUVQb5.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-Cr01Ig2w.js";import"./use-registry-connections-Dp-yVGrd.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Dak8L16r.js";import"./UserSquare-CZDBDZu6.js";import"./connection-form-helpers-BBbhpert.js";import"./collection-tabs-BhNVbQRQ.js";import"./badge-QK4_b8m3.js";import"./select-model-2tHFqpDQ.js";import"./checkbox-BBAE_NPI.js";import"./ChevronSelectorVertical-BVHuvXcc.js";import"./Key01-Dw14FM0z.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-CVa-fA_N.js";import"./DotsVertical-BK4JkTfJ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-taT8tvJS.js";import"./ZapSquare-hz2fwhYk.js";import"./TrendUp01-BTPOrFwv.js";import"./use-file-configs-CbqZjK3e.js";import"./pt-BR-CLy76QW2.js";import"./Play-C8DX3MNw.js";import"./use-debounced-autosave-B1A8E_zm.js";import"./search-input-D0Xkp13F.js";import"./use-mcp-auth-status-BojxBf39.js";import"./switch-Dy2L3YiE.js";import"./Users01-D3bzr0SJ.js";import"./use-secrets-07Tequ4i.js";import"./AreaChart-BxPMYD6n.js";import"./super-agent-icon-DcTJHa3h.js";import"./task-filters-C6nXtRnq.js";import"./command-dzcaI1yG.js";import"./index-Bkh-xk2l.js";import"./get-initials-D-f_fDFw.js";import"./config-n1zSHZqO.js";import"./Shield01-CE7mb3Ix.js";import"./breadcrumb-WBjlnhkt.js";import"./SwitchHorizontal01-Ba8D7M8C.js";import"./use-tags-p0LvS31V.js";import"./automation-list-row-CNNkrJuI.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CdgqxwZ1.js";import"./CreditCard01-CEJXC95D.js";import"./Globe04-CzbTyKcv.js";import"./HardDrive-KdEZynii.js";import"./LogOut01-LLXPIQBH.js";import"./Sun-Bv9Ylpqk.js";function li(d){return d.schema?.definitions??d.schema?.$defs??{}}function js(d,e){const a=li(e),u=a[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=a[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function ci(d,e){for(const a of js(d,e)){const u=typeof a.image=="string"?a.image:void 0;if(u?.includes("{{{"))return u}}function ui(d,e){if(!e)return;const a=ts(d);if(!a)return;const u=ci(a.resolveType,e);if(!u)return;const p=Lo(u,a.data);if(p)return Ko(p)}const di={escape:Io};function mi(d,e){for(const a of js(d,e)){const u=typeof a.title=="string"?a.title:void 0;if(u?.includes("{{"))return u}}function fi(d,e){if(!e)return;const a=ts(d);if(a)try{const u=mi(a.resolveType,e);return u&&Bo.render(u,a.data,{},di).trim()||void 0}catch{return}}const pi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",gi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Wn(d){return Array.from({length:d},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Es(d){return d.map((e,a)=>({...e,index:a}))}function hi(d,e){if(e===d.length)return d;if(e<d.length)return Es(d.slice(0,e));const a=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...a]}function Rs(d){const e=st.c(25),{section:a,raw:u,meta:p}=d,x=a.isSavedBlock===!0,j=a.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?ui(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?fi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(La,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let D;e[11]!==j||e[12]!==x?(D=x?{color:zo}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=D):D=e[13];let c;e[14]!==D?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:D}),e[14]=D,e[15]=c):c=e[15];const S=a.isHidden&&"line-through opacity-50";let R;e[16]!==S?(R=Ue("min-w-0 flex-1 truncate text-sm font-medium",S),e[16]=S,e[17]=R):R=e[17];const l=k??a.label;let V;e[18]!==R||e[19]!==l?(V=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=V):V=e[20];let i;return e[21]!==V||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,V]}),e[21]=V,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const vi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",bi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Si="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?vi:d?Si:bi)}function ws(d,e){const a=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?pi:u?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function yi(d){const e=st.c(82),{section:a,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:K,onToggleLazy:M,onAddVariant:D,onDetach:c}=d,S=Dt(),R=u?rs(u.__resolveType??""):!1,l=a.isHidden===!0,V=R||l;let i;e[0]!==a?(i=Oo(a),e[0]=a,e[1]=i):i=e[1];const J=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:Ri},e[2]=x,e[3]=U):U=e[3];const{attributes:Le,listeners:Y,setNodeRef:m,transform:P,isDragging:we}=ls(U);let N;e[4]!==P?(N=cs.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const ae=T;let B;e[9]!==a?(B=Fo(a),e[9]=a,e[10]=B):B=e[10];const Ce=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let Q;e[13]!==a||e[14]!==j||e[15]!==de?(Q=Ue("touch-none transition-colors",de,ws(a,j)),e[13]=a,e[14]=j,e[15]=de,e[16]=Q):Q=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==a?(ie=n.jsx(Rs,{section:a,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=a,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==S?(ye=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=S,e[23]=ye):ye=e[23];let re;e[24]!==K?(re=_=>{_.stopPropagation(),K()},e[24]=K,e[25]=re):re=e[25];let L;e[26]!==l?(L=l?n.jsx(Qa,{className:"h-3.5 w-3.5"}):n.jsx(Xa,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=L):L=e[27];let qe;e[28]!==l||e[29]!==S?(qe=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=S,e[30]=qe):qe=e[30];let Ke;e[31]!==qe?(Ke=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Ke):Ke=e[32];const Ie=xs,ke=ys,F=!0,te=tt,Oe="button",Pe="ghost",xe="icon";let ne;e[33]!==S?(ne=S("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=S,e[34]=ne):ne=e[34];const me=Ue(hn(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Oe,variant:Pe,size:xe,"aria-label":ne,className:me,onClick:_i,onPointerDown:xi,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(bs,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==S?(je=S("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=S,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==J||e[52]!==D||e[53]!==S?(I=J&&n.jsxs(vt,{className:$o,onClick:_=>{_.stopPropagation(),D()},children:[n.jsx(Za,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=J,e[52]=D,e[53]=S,e[54]=I):I=e[54];let Ee;e[55]!==Ce||e[56]!==k||e[57]!==S?(Ee=Ce&&n.jsxs(vt,{className:gi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Ce,e[56]=k,e[57]=S,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==a.isMultivariate||e[61]!==a.isSavedBlock||e[62]!==S?(ge=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=a.isMultivariate,e[61]=a.isSavedBlock,e[62]=S,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(Ss,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==S?(X=S("sectionsEditor.sectionList.deleteMenuItem"),e[67]=S,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(_s,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Ie||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Ie,{children:[pe,ve]}),e[78]=Ie,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:ae,...Le,...Y,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:Q,children:[ie,!a.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(V,R)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ei,children:n.jsx(ei,{className:Ue("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(hn(V,l)),onClick:re,onPointerDown:ji,children:L})}),Ke]}),Te]})}function xi(d){return d.stopPropagation()}function _i(d){return d.stopPropagation()}function ji(d){return d.stopPropagation()}function Ei(d){return d.stopPropagation()}function Ri(){return!1}function wi(d){const e=st.c(104),{listKey:a,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:K,onToggleHidden:M,onToggleLazy:D,onAddVariant:c,onDetach:S,onAddSection:R,canAddSection:l}=d,V=l===void 0?!0:l,i=Dt();let J;e[0]!==p.length?(J=()=>Wn(p.length),e[0]=p.length,e[1]=J):J=e[1];const[U,Le]=w.useState(J),[Y,m]=w.useState(null),[P,we]=w.useState(a),[N,Z]=w.useState(p.length),T=w.useRef(!1);P!==a?(we(a),Z(p.length),Le(Wn(p.length))):N!==p.length&&(Z(p.length),Le(Te=>hi(Te,p.length)));let ae;e[2]===Symbol.for("react.memo_cache_sentinel")?(ae={activationConstraint:{distance:8}},e[2]=ae):ae=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ds},e[3]=B):B=e[3];const Ce=ns(Xt(is,ae),Xt(as,B));let ee;e[4]!==U?(ee=U.map(ki),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=Te=>{m(String(Te.active.id))},e[6]=Q):Q=e[6];const ie=Q;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:be}=Te;if(!be||_.id===be.id)return;const oe=de.indexOf(String(_.id)),De=de.indexOf(String(be.id));oe===-1||De===-1||(Le(Fe=>Es(Lt([...Fe],oe,De))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(oe,De))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{m(null)},e[10]=L):L=e[10];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==Y||e[12]!==V||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==S||e[21]!==k||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==D||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Ce||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==Y||e[47]!==V||e[48]!==U||e[49]!==R||e[50]!==u||e[51]!==p||e[52]!==i){const _=Y?U.find(be=>be.id===Y):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let be;e[56]!==i?(be=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=be):be=e[57];let oe;e[58]!==be?(oe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=oe):oe=e[59];const De=!V;let Fe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsx(bn,{size:14}),e[60]=Fe):Fe=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let Ve;e[63]!==R||e[64]!==De||e[65]!==ct?(Ve=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:De,onClick:R,children:[Fe,ct]}),e[63]=R,e[64]=De,e[65]=ct,e[66]=Ve):Ve=e[66];let Xe;e[67]!==oe||e[68]!==Ve?(Xe=n.jsxs("div",{className:"space-y-2",children:[oe,Ve]}),e[67]=oe,e[68]=Ve,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=Y,e[47]=V,e[48]=U,e[49]=R,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Ie=ms,xe=Ce,ne=fs,me=ie,_e=re,fe=qe,Ke=ps,Oe=de,Pe=gs,Me="space-y-1",te=U.map(_=>{const be=p[_.index];return be?n.jsx(yi,{sortableId:_.id,section:be,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>K(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>D(_.index),onAddVariant:()=>c(_.index),onDetach:()=>S(_.index)},_.id):null})}e[11]=Y,e[12]=V,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=R,e[18]=c,e[19]=g,e[20]=S,e[21]=k,e[22]=K,e[23]=v,e[24]=M,e[25]=D,e[26]=u,e[27]=p,e[28]=j,e[29]=Ce,e[30]=i,e[31]=Ke,e[32]=Ie,e[33]=ke,e[34]=F,e[35]=te,e[36]=Oe,e[37]=Pe,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Ke=e[31],Ie=e[32],ke=e[33],F=e[34],te=e[35],Oe=e[36],Pe=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Ke||e[74]!==Oe||e[75]!==Pe||e[76]!==je?(le=n.jsx(Ke,{items:Oe,strategy:Pe,children:je}),e[73]=Ke,e[74]=Oe,e[75]=Pe,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ws(F,!1)),children:n.jsx(Rs,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Ie||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Ie,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Ie,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!V;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(bn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==R||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:R,children:[he,X]}),e[96]=R,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function ki(d){return d.id}function Jn(d){const e=st.c(57),{open:a,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Dt(),[k,K]=w.useState(u),[M,D]=w.useState(a);a!==M&&(D(a),a&&K(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const S=c;let R;e[3]!==y||e[4]!==k||e[5]!==j?(R=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=R):R=e[6];const l=R;let V;e[7]!==g?(V=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=V):V=e[8];let i;e[9]!==V?(i=n.jsx(Ha,{children:V}),e[9]=V,e[10]=i):i=e[10];let J;e[11]!==p||e[12]!==g?(J=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=J):J=e[13];let U;e[14]!==J?(U=n.jsx(Ua,{children:J}),e[14]=J,e[15]=U):U=e[15];let Le;e[16]!==i||e[17]!==U?(Le=n.jsxs(Ga,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Le):Le=e[18];let Y;e[19]!==g?(Y=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=Y):Y=e[20];let m;e[21]!==Y?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:Y}),e[21]=Y,e[22]=m):m=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=ie=>K(ie.target.value),e[23]=P):P=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Ya,{id:"variant-rename-name",value:k,onChange:P,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let ae;e[35]!==y||e[36]!==Z||e[37]!==T?(ae=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=ae):ae=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Ce;e[42]!==y||e[43]!==B?(Ce=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Ce):Ce=e[44];let ee;e[45]!==ae||e[46]!==Ce?(ee=n.jsxs(qa,{children:[ae,Ce]}),e[45]=ae,e[46]=Ce,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Le?(de=n.jsx(Wa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Le,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Le,e[52]=de):de=e[52];let Q;return e[53]!==S||e[54]!==a||e[55]!==de?(Q=n.jsx(Ja,{open:a,onOpenChange:S,children:de}),e[53]=S,e[54]=a,e[55]=de,e[56]=Q):Q=e[56],Q}function ks(d){const e=st.c(5),{rule:a,matchers:u}=d,p=a?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??Ho(p);x=Ka(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Yn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function Qn(d){return d.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Ti(d,e){const a=new Map;for(const u of d){const p=a.get(u.variant.label);p?p.push(u):a.set(u.variant.label,[u])}return e.map((u,p)=>({id:a.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Di(d){return d.map((e,a)=>({...e,index:a}))}function Ts(d){const e=st.c(17),{label:a,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(ks,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==a?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=M):M=e[4];let D;e[5]!==x||e[6]!==j||e[7]!==a||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(D=!j&&n.jsxs(xs,{children:[n.jsx(ys,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ni,onPointerDown:Vi,children:n.jsx(vs,{size:14})})}),n.jsxs(_s,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:S=>{S.stopPropagation(),v?.()},children:[n.jsx(ai,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:S=>{S.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ti,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:S=>{S.stopPropagation(),g?.()},children:[n.jsx(Ss,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=a,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=D):D=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==D?(c=n.jsxs(n.Fragment,{children:[K,M,D]}),e[13]=K,e[14]=M,e[15]=D,e[16]=c):c=e[16],c}function Vi(d){return d.stopPropagation()}function Ni(d){return d.stopPropagation()}function Ai(d){const e=st.c(33),{entry:a,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:K}=d;let M;e[0]!==a.id?(M={id:a.id,animateLayoutChanges:Ci},e[0]=a.id,e[1]=M):M=e[1];const{attributes:D,listeners:c,setNodeRef:S,transform:R,isDragging:l}=ls(M);let V;e[2]!==R?(V=cs.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=V):V=e[3];const i=l?0:void 0;let J;e[4]!==V||e[5]!==i?(J={transform:V,opacity:i},e[4]=V,e[5]=i,e[6]=J):J=e[6];const U=J,Le=j??void 0;let Y;e[7]!==x||e[8]!==a.variant.rule||e[9]!==Le?(Y=Kt(a.variant.rule,x,Le),e[7]=x,e[8]=a.variant.rule,e[9]=Le,e[10]=Y):Y=e[10];const m=Y;let P;e[11]!==y?(P=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=P):P=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?hs:us;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==a.variant.label||e[19]!==v||e[20]!==K||e[21]!==k||e[22]!==g?(T=n.jsx(Ts,{label:a.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:K}),e[16]=p,e[17]=m,e[18]=a.variant.label,e[19]=v,e[20]=K,e[21]=k,e[22]=g,e[23]=T):T=e[23];let ae;return e[24]!==D||e[25]!==c||e[26]!==y||e[27]!==S||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==P?(ae=n.jsx("div",{ref:S,style:U,...D,...c,onClick:y,onKeyDown:P,className:Z,children:T}),e[24]=D,e[25]=c,e[26]=y,e[27]=S,e[28]=U,e[29]=Z,e[30]=T,e[31]=P,e[32]=ae):ae=e[32],ae}function Ci(){return!1}function Pi(d){const e=st.c(9),{variant:a,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==a.rule?(v=Kt(a.rule,u,j),e[0]=u,e[1]=j,e[2]=a.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==a.label?(k=n.jsx("div",{className:g,children:n.jsx(Ts,{label:a.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=a.label,e[8]=k):k=e[8],k}function Mi(d){const e=st.c(91),{listKey:a,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:K,onDelete:M,onAdd:D}=d,c=Dt();let S;e[0]!==u?(S=()=>Qn(u),e[0]=u,e[1]=S):S=e[1];const[R,l]=w.useState(S),[V,i]=w.useState(null),[J,U]=w.useState(a),[Le,Y]=w.useState(u.length);let m;e[2]!==u?(m=()=>Yn(u),e[2]=u,e[3]=m):m=e[3];const[P,we]=w.useState(m),N=w.useRef(!1),Z=Yn(u);J!==a?(U(a),Y(u.length),we(Z),l(Qn(u))):(Le!==u.length||P!==Z)&&(Y(u.length),we(Z),l(ge=>Ti(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let ae;e[5]===Symbol.for("react.memo_cache_sentinel")?(ae={coordinateGetter:ds},e[5]=ae):ae=e[5];const B=ns(Xt(is,T),Xt(as,ae));let Ce;e[6]!==R?(Ce=R.map(Li),e[6]=R,e[7]=Ce):Ce=e[7];const ee=Ce,de=u.length>1;let Q;e[8]!==R?(Q=ge=>{const ce=String(ge.active.id);i(R.find(he=>he.id===ce)??null)},e[8]=R,e[9]=Q):Q=e[9];const ie=Q;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Di(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(null)},e[13]=L):L=e[13];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==R||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==D||e[24]!==M||e[25]!==K||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=oe=>{N.current||y(oe)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==D||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:D,children:ue})}),e[50]=D,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let be;e[57]!==ve||e[58]!==_?(be=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=be):be=e[59],e[60]!==he||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,be]}),e[60]=he,e[61]=be,e[62]=fe):fe=e[62],Ie=ms,Oe=B,Pe=fs,xe=ie,ne=re,me=qe,Ke=ps,F=ee,te=gs,pe="space-y-0.5",ke=R.map(oe=>n.jsx(Ai,{entry:oe,isActive:oe.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(oe.index),onRename:()=>k(oe.index),onDuplicate:()=>K(oe.index),onDelete:()=>M(oe.index)},oe.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=R,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=D,e[24]=M,e[25]=K,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Ke,e[31]=Ie,e[32]=ke,e[33]=F,e[34]=te,e[35]=Oe,e[36]=Pe,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Ke=e[30],Ie=e[31],ke=e[32],F=e[33],te=e[34],Oe=e[35],Pe=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Ke||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Ke,{items:F,strategy:te,children:se}),e[66]=Ke,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==V||e[72]!==x||e[73]!==v||e[74]!==j?(je=V?n.jsx(Pi,{variant:V.variant,decofile:x,meta:j,matchers:v}):null,e[71]=V,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Ie||e[79]!==Oe||e[80]!==Pe||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Ie,{sensors:Oe,collisionDetection:Pe,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Ie,e[79]=Oe,e[80]=Pe,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Li(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:a,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:K,formKey:M,formWrapperClassName:D,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l}=d;let V;e[0]!==p||e[1]!==u||e[2]!==a||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(V=n.jsx(Uo,{currentRt:a,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=a,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=V):V=e[7];let i;e[8]!==S||e[9]!==M||e[10]!==k||e[11]!==D||e[12]!==c||e[13]!==K||e[14]!==R||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:D,children:n.jsx(Go,{schema:g,value:k,onChange:K,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=S,e[9]=M,e[10]=k,e[11]=D,e[12]=c,e[13]=K,e[14]=R,e[15]=l,e[16]=g,e[17]=i):i=e[17];let J;return e[18]!==V||e[19]!==i?(J=n.jsxs(n.Fragment,{children:[V,i]}),e[18]=V,e[19]=i,e[20]=J):J=e[20],J}function Pc({orgSlug:d,virtualMcpId:e,branch:a,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:D}){const c=Dt(),S=Mo()?.taskId??null,R=u?{orgSlug:d,virtualMcpId:e,branch:a,threadId:S,previewUrl:p}:null,{data:l,isLoading:V}=qo(R),{data:i,isLoading:J}=Wo(R),U=Jo(),Le=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,Y=ii({virtualMcpId:e,sandboxUrl:p}),[m,P]=w.useState(null),[we,N]=w.useState(null),[Z,T]=w.useState(null),[ae,B]=w.useState(0),[Ce,ee]=w.useState(void 0),[de,Q]=w.useState(null),[ie,ye]=w.useState(null),[re,L]=w.useState([]),qe=w.useRef(null),[Ke,Ie]=w.useState(re.length);Ke!==re.length&&(Ie(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=w.useState(0),[te,Oe]=w.useState(null),[Pe,xe]=w.useState(null),[ne,me]=w.useState(null),[_e,fe]=w.useState(!0),[pe,se]=w.useState(!1),[Me,je]=w.useState(!1),le=w.useRef(null),[I,Ee]=w.useState(k),[ge,ce]=w.useState(k);k&&!ge&&(ce(!0),Ee(!0),P(null),N(null),T(null),L([])),!k&&ge&&ce(!1);const[he,X]=w.useState(null),[ue,ve]=w.useState(void 0),[Te,_]=w.useState([]),[be,oe]=w.useState(0),[De,Fe]=w.useState(0),[ct,Ve]=w.useState(null),[Xe,We]=w.useState(null),[Sn,yn]=w.useState(null),Ds=Co(),Vs=`${d}/${e}/${a}`,Zt=Yo({orgSlug:d,virtualMcpId:e,branch:a}),[Ns,As]=w.useState(x),[Cs,Ps]=w.useState(j),[Ms,Ls]=w.useState(v);(Ns!==x||Cs!==j||Ms!==v)&&(queueMicrotask(()=>Zt.flush()),As(x),Ps(j),Ls(v),P(null),N(null),T(null),B(0),Q(null),ye(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),oe(t=>t+1));const Ne=Qo({orgSlug:d,virtualMcpId:e,branch:a}),Bt=Ea((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:o=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),en=Xo({orgSlug:d,virtualMcpId:e,branch:a}),[Vt,It]=w.useState(!1),ze=w.useRef(null),ot=w.useRef(null),at=w.useRef(null),tn=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||V||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ks=Zo(l),Ae=!!v,Je=Ae?null:ea(Ks,x,j),E=Ae?v:Je?.key??null,nn=Ae&&v?l[v]:void 0,xn=Ae&&v&&nn?ta(v,nn):Ae&&v?v:"",Ot=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Je?Bn(l,{kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},i):null,Bs=I?Ot?.seo:void 0,on=ue!==void 0?ue:Bs,Is=I?na(on):void 0,Os=sn?.seoTypeOptions??[],Fs=I&&i?sa(i):"",_n=he??Is??{},an=I&&sn?ni(_n,sn):null,$s=I&&an&&oa(on)?qt(an,i):null,zs=I?aa(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:ia(Ot?.sections,l??{}),Ft=Ge.length>1,$e=Math.min(ae,Ge.length-1),ut=Ge[$e],z=ut?.sections??[],He=Wt(z,l),jn=!Ae&&ra(Ot?.sections);if(Ae&&v&&Sn!==v){yn(v);const t=z[0],s=He[0];if(t&&s){P(0),Fe(0),L([]);const o=St(t,s,l);o&&(N(o.data),T(o.resolveType),We(null),Ve(null))}}!Ae&&Sn!==null&&yn(null),Ze.current={rawSections:z,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:De,selectedSectionIndex:m};const Hs=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!D)return;if(!E||!jn||t.length<=1){D(null);return}const o=qn(E,{multivariate:!0,index:s,variants:t},l,i);D(o.length>0?o:null)},xt=(t,s,o)=>{if(!D)return;if(!E){D(null);return}const r=Hs(),f=qn(E,r,l,i);if(!t||s<0){D(f.length>0?f:null);return}const b=Da({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:l,meta:i}),h=[...f,...b];D(h.length>0?h:null)},dt=(t,s,o,r=m??-1,f=!1)=>{const b=nt(t,s);if(!b){N(null),T(null),We(null),Ve(null),f&&xt(null,r,o);return}const A=In(b,ht)[o];if(!A){N(null),T(null),We(null),Ve(null),f&&xt(null,r,o);return}const W=ha(A.value,l);N(W?.data??null),T(W?.resolveType??null);const{resolveType:C,formValue:O}=Ct(A.rule,l,i??void 0);We(C),Ve(O),f&&xt(b,r,o)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==Ce&&(ee(y?.seq??null),typeof Nt=="number")){const t=z[Nt],s=He[Nt];if(t&&s)if(P(Nt),Fe(0),L([]),F(o=>o+1),s.isMultivariate)dt(t,s,0,Nt);else{const o=St(t,s,l);o?(N(o.data),T(o.resolveType)):(N(null),T(null)),We(null),Ve(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:a,threadId:S,previewUrl:p??void 0,siteSlug:Le},rn=Z&&i?qt(Z,i):null,Ye=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(l,E,t,$e,Ge);Ne.mutate({blockKey:E,data:o},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{P(null),N(null),T(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1)},Us=(t,s)=>{ze.current&&clearTimeout(ze.current);const o=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current,C=r[s];if(!C)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const H=O.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;Ne.mutate({blockKey:H,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...b[h]},Re=[...r];if(O.isMultivariate){const H=nt(C,O);if(!H||!h)return;const G=Na(H,o,t);Re[s]=yt(C,O,G)}else if(O.isHidden){const H=rs(C.__resolveType),G=H?{...C.section}:{...C},Be=Array.isArray(G.variants)?[...G.variants]:[];Be[0]&&(Be[0]={...Be[0],value:t}),G.variants=Be,H?Re[s]={...C,section:G}:Re[s]=G}else O.isLazy?Re[s]={...C,section:t}:Re[s]=t;if(A.length>1){const H=$.sections,G=[...H?.variants??[]];G[W]&&(G[W]={...G[W],value:Re}),$.sections={...H,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:H=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:H.message}))})},gn)},Gs=t=>{P(t),Fe(0),L([]),F(f=>f+1);const s=z[t],o=He[t];if(!s||!o)return;if(o.isMultivariate){dt(s,o,0,t);return}const r=St(s,o,l);if(!r){N(null),T(null),We(null),Ve(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),Ve(null),xt(null,t,0)},Rn=t=>{const s=t;N(s),m!==null&&Us(s,m)},ln=t=>{if(!E||!l||!i||!Je)return;const s={kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},o=Bn(l,s,i);o&&Zt.save(E,()=>{const r=Ds.getQueryData(Po.decofile(Vs))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?oi(s,o,f,t.inner):f})},qs=(t,s)=>{E&&(tn.current[t]=s,ln())},Ws=(t,s)=>{if(!E)return;const o=Lt([...z],t,s);m!==null&&(m===t?P(s):t<m&&s>=m?P(m-1):t>m&&s<=m&&P(m+1)),Ye(o)},Js=t=>{if(!E)return;const s=z.filter((o,r)=>r!==t);m===t?_t():m!==null&&m>t&&P(m-1),Ye(s)},Ys=t=>{if(!E)return;const s=z[t];if(!s)return;const o=[...z];o.splice(t+1,0,Ta(s)),m!==null&&m>t&&P(m+1),Ye(o)},Qs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o)return;const r=o.isHidden?wa(s):ka(s);if(!r)return;const f=[...z];f[t]=r,m===t&&_t(),Ye(f)},Xs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o||o.isMultivariate)return;const r=Ra(s);if(!r)return;const f=[...z];f[t]=r,m===t&&_t(),Ye(f)},Zs=t=>{if(!E)return;const s=z[t],o=He[t];if(!s||!o?.isSavedBlock)return;const r=St(s,o,l);if(!r?.data)return;const{name:f,...b}=r.data,h=[...z];o.isLazy?h[t]={...s,section:b}:h[t]=b,m===t&&_t(),Ye(h)},eo=t=>{if(!E)return;const s=[...z,{__resolveType:t.resolveType}],o=s.length-1;Ye(s,{onSuccess:()=>{se(!1),P(o),Fe(0),L([]),F(h=>h+1);const r=s[o],f=Wt(s,l)[o];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const b=St(r,f,l);if(!b){N(null),T(null),We(null),Ve(null);return}N(b.data),T(b.resolveType),We(null),Ve(null)}})},wn=t=>{le.current=t.append,se(!0)},to=t=>{const s=le.current;if(!s){eo(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},no=t=>{if(m===null)return;const s=z[m],o=He[m];!s||!o?.isMultivariate||(Fe(t),L([]),F(r=>r+1),dt(s,o,t,m,!0))},so=t=>{if(m===null||!E)return;const s=z[m],o=He[m];if(!s||!o?.isMultivariate)return;const r=nt(s,o);if(!r)return;const f=_a(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const b=[...z];b[m]=yt(s,o,f);const h=f.variants;let A=De;t===De?A=Math.min(t,h.length-1):t<De&&(A=De-1),Fe(A),L([]),F(W=>W+1),dt(b[m],o,A),Ye(b)},oo=t=>{if(m===null||!E)return;const s=z[m],o=He[m];if(!s||!o?.isMultivariate)return;const r=nt(s,o);if(!r)return;const f=ja(r,t),b=[...z];b[m]=yt(s,o,f);const h=t+1;Fe(h),L([]),F(A=>A+1),dt(b[m],o,h),Ye(b)},ao=(t,s)=>{if(m===null||!E||t===s)return;const o=z[m],r=He[m];if(!o||!r?.isMultivariate)return;const f=nt(o,r);if(!f)return;const b=ya(f,t,s),h=[...z];h[m]=yt(o,r,b);let A=De;De===t?A=s:t<De&&s>=De?A=De-1:t>De&&s<=De&&(A=De+1),Fe(A),dt(h[m],r,A),Ye(h)},cn=t=>{const s=t??m;if(s===null||!E)return;const o=z[s],r=He[s];if(!o||!r)return;const f=va(o,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const b=[...z];b[s]=f.section;const h=Wt(b,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}P(s),Fe(f.newVariantIndex),L([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Ye(b)},io=()=>{if(m===null||!E)return;const t=z[m],s=He[m];if(!t||!s?.isMultivariate)return;const o=nt(t,s);if(!o)return;const r=xa(t,s,o);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...z];f[m]=r;const b=Wt(f,l)[m];if(!b)return;Fe(0),We(null),Ve(null),L([]),F(A=>A+1);const h=St(r,b,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Ye(f)},ro=async t=>{if(te===null||!E)return;const s=pn(t,l);if(s){q.error(s);return}const o=z[te],r=He[te];if(!o||!r)return;const f=St(o,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const b={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:b});const h=[...z];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Mt(l,E,h,$e,Ge)}),m===te&&_t(),Oe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&m===null&&ie===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);ye(t),Q(s)}const zt=i?la(i):[],Tn=i&&l?ca(i,l):[],lo=!Ae&&!!(Y&&i&&l),co=ie&&i?qt(ie,i):null,jt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},At=async(t,s)=>{if(!(Va(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(o){q.error(o instanceof Error?o.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:r}=Ze.current;if(!s)return;const f={...o[s]},b={...f.sections},h=[...b.variants??[]],A=h[r],W=A?.rule;if(Et(W,o,i)){const C=W?.__resolveType??"",O=o[C],$=typeof O?.name=="string"?O.name:C,{__resolveType:Re,...H}=t;Ne.mutate({blockKey:C,data:Rt(Re??"",H,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...b,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},gn)},uo=t=>{ye(t);const s=t?zn(t,i):{__resolveType:Hn};Q(t?s:{}),Dn(s)},mo=t=>{const s=t;Q(s);const o=ie?{__resolveType:ie,...s}:{...s};Dn(o)},fo=async t=>{jt();const{activePageKey:s,decofile:o,variantIndex:r}=Ze.current;if(!s)return;const f=o[s],b=f?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[r];if(!W)return;const C=Pt(W.rule,o,i),O=Yt(t);A[r]={...W,rule:O};const $={...o,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:H}=Ct(O,$,i??void 0);ye(Re),Q(H);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),C&&C!==t&&await At(C,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=Ze.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const H=($.variants??[])[o]?.rule;if(Et(H,b,i)){const Se=H?.__resolveType??"",Qe=b[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:Se,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=$n($,o,t),Be=[...r];Be[s]=yt(C,O,G);const et=Mt(b,h,Be,W,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:Se=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},po=t=>{We(t);const s=t?zn(t,i):{__resolveType:Hn};Ve(t?s:{}),Vn(s)},go=t=>{const s=t;Ve(s);const o=Xe?{__resolveType:Xe,...s}:{...s};Vn(o)},ho=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(s===null||!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],H=Pt(Re[o]?.rule,b,i),G=Yt(t),Be=$n($,o,G),et=[...r];et[s]=yt(C,O,Be);const Se=Mt(b,h,et,W,A),Qe={...b,[h]:Se},{resolveType:rt,formValue:pt}=Ct(G,Qe,i??void 0);We(rt),Ve(pt);try{await Ne.mutateAsync({blockKey:h,data:Se}),H&&H!==t&&await At(H,Qe),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,Nn=m!==null?z[m]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,bt=An?In(An,ht):[],un=Math.min(De,Math.max(bt.length-1,0)),Ht=bt[un]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&we)),vo=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||vo,bo=Ae?xn:mt?.label??"",So=Xe&&i?qt(Xe,i):null,dn=Ut&&(!Ae||re.length>0)?Ae?[xn,...re]:[Je.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],yo=I&&Je?[Je.name,"SEO",...Te]:[],Gt=I?yo:it?dn.length>0?dn:[bo]:dn,xo=!I&&!Ae&&ft&&re.length===0,Pn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=ba(t.sections,z);if(!s)return;const o=Sa(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(o),P(null),N(null),T(null),L([]),Q(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,o)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const b=f;if(!Array.isArray(b.variants))return;const h=t([...b.variants]);if(!h)return;const A=Aa(b,h),W={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:W[E]},{onSuccess:()=>{s?.(),o&&At(o,W)},onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},_o=t=>{xe(null),B(t),P(null),N(null),T(null),L([]);const s=Ge[t]?.rule,{resolveType:o,formValue:r}=Ct(s,l??{},i??void 0);ye(o),Q(r),En(Ge.map(f=>({rule:f.rule})),t)},jo=(t,s)=>{if(t===s)return;let o=$e;$e===t?o=s:t<$e&&s>=$e?o=$e-1:t>$e&&s<=$e&&(o=$e+1),B(o);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);En(r,o),mn(f=>Lt(f,t,s))},Eo=t=>{const s=Ge[t]?.rule,o=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<$e?B($e-1):t===$e&&B(Math.max(0,t-1)),P(null),N(null),T(null),L([]),Q(null),ye(null)},o)},Ro=t=>{mn(s=>Ca(s,t),()=>{B(t+1),P(null),N(null),T(null),L([]),Q(null),ye(null)})},wo=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const o=Ze.current.activePageKey,r=Ze.current.decofile;if(!o)return;const f=r[o],b=f.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[t];if(!W?.rule||typeof W.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=W.rule,O=s.trim();It(!0);try{if(!O){if(!Et(C,r,i)){xe(null);return}const et=C.__resolveType??"";A[t]={...W,rule:Un(C,r,i)};const Se={...r,[o]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:o,data:Se[o]}),await At(et,Se),xe(null),g?.();return}const $=Gn(C,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=fn(O),H=pn(Re,r);if(H){q.error(H);return}const G=Rt($.resolveType,$.data,O);let Be=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Be=Re,A[t]={...W,rule:Yt(Re)},await Ne.mutateAsync({blockKey:o,data:{...f,sections:{...h,variants:A}}}),Be=null}catch(et){throw Be&&await en.mutateAsync({blockKey:Be}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},ko=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:o,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(o===null||!h)return;const C=r[o],O=f[o];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],H=Re[t];if(!H?.rule||typeof H.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=H.rule,Be=s.trim();It(!0);const et=async Se=>{const Qe={...$,variants:Se},rt=[...r];rt[o]=yt(C,O,Qe);const pt=Mt(b,h,rt,W,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...b,[h]:pt}};try{if(!Be){if(!Et(G,b,i)){me(null);return}const gt=G.__resolveType??"",Kn=[...Re];Kn[t]={...H,rule:Un(G,b,i)};const Ao=await et(Kn);await At(gt,Ao),me(null),g?.();return}const Se=Gn(G,b,i);if(!Se){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Rt(Se.resolveType,Se.data,Be)}),me(null),g?.();return}const Qe=fn(Be),rt=pn(Qe,b);if(rt){q.error(rt);return}const pt=Rt(Se.resolveType,Se.data,Be);let lt=null;try{await Ne.mutateAsync({blockKey:Qe,data:pt}),lt=Qe;const gt=[...Re];gt[t]={...H,rule:Yt(Qe)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),g?.()}catch(Se){q.error(Se instanceof Error?Se.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},To=t=>{X(t),ln({inner:t})},Do=t=>{ve(t),ln({raw:t})},Vo=()=>{X(null),_([])},No=()=>oe(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),oe(o=>o+1),K?.();return}if(t===1){_([]),oe(o=>o+1);return}_(Te.slice(0,t-1)),oe(o=>o+1);return}if(Ae){L(re.slice(0,t)),F(o=>o+1);return}if(t===0){Mn();return}if(t===1){L([]),F(o=>o+1);return}if(ft&&t===2){L([]),F(o=>o+1);return}const s=ft?2:1;L(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Pa(Gt.length,{isMultivariateSectionTop:xo})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ba,{className:"size-4"})}),!Ae&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ua),children:[n.jsx(ks,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const o=s===Gt.length-1,r=da(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Fa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(za,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(On,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(ma,{pageKey:E,initialName:Je.name,initialPath:Je.path,onFieldChange:qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Ia,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M(E):je(!0),children:n.jsx(Oa,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(On,{onClick:Pn})]})}),I?n.jsx(Qt,{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:Ot&&E?n.jsx(si,{rawSeo:on,innerSeo:_n,defaultResolveType:Fs,seoSchema:$s,activeResolveType:an,seoTypeOptions:Os,formResetKey:be,siteDefaultSeo:zs,onBreadcrumbChange:_,onPersistRaw:Do,onInnerChange:To,onClearForm:Vo,onBumpFormKey:No}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&bt.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(fa,{listKey:`${E??""}:${m??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:no,onRename:me,onDuplicate:oo,onDelete:so,onRemoveAll:io,onReorder:ao,onAdd:()=>cn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Xe??"",currentLabel:Jt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:po,onSelectGlobal:ho,schema:So,formValue:ct,onChange:go,formKey:`${m??"none"}:${un}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})]},"editor-section-form"):Ae?n.jsx(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&E&&n.jsx(Mi,{listKey:E,variants:Ge,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:_o,onReorder:jo,onRename:xe,onDuplicate:Ro,onDelete:Eo,onAdd:Pn}),Ft&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx($a,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Ma,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Jt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:uo,onSelectGlobal:fo,schema:co,formValue:de,onChange:mo,formKey:`${$e}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(wi,{listKey:`${E??""}-${$e}`,rawSections:z,sections:He,meta:i,selectedIndex:m,onSelect:Gs,onReorder:Ws,onDelete:Js,onDuplicate:Ys,onMakeReusable:Oe,onToggleHidden:Qs,onToggleLazy:Xs,onAddVariant:cn,onDetach:Zs,onAddSection:()=>se(!0),canAddSection:lo})})]},"editor-section-list"),n.jsx(pa,{open:te!==null,onOpenChange:t=>{t||Oe(null)},defaultBlockId:te!==null?fn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ro}),Y&&n.jsx(ri,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:Y,onSelect:to}),Me&&E&&l&&n.jsx(ga,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Pe!==null&&n.jsx(Jn,{open:!0,initialName:Et(Ge[Pe]?.rule,l??{},i??void 0)?Jt(Ge[Pe]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(Ge[Pe]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wo(Pe,t)},onOpenChange:t=>{!t&&!Vt&&xe(null)}}),ne!==null&&n.jsx(Jn,{open:!0,initialName:Et(bt[ne]?.rule,l??{},i??void 0)?Jt(bt[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(bt[ne]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await ko(ne,t)},onOpenChange:t=>{!t&&!Vt&&me(null)}})]})}export{Pc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bn as st,bl as Ne,j as i,dM as rt,bp as Ie,bm as k,dN as lt,bi as j,bo as P,cs as $,dO as at,aH as Ee,dP as Re,bj as ct,cm as it,dQ as dt,cu as ut,dR as pt,dS as ft,dT as mt,dU as ht,dV as gt,bk as vt,dW as xt,dX as St,dY as wt,c as ee,n as oe}from"./index-66BUlUCq.js";import{i as yt}from"./Check-yS6TBRKx.js";import{t as je}from"./ChevronDown-RrKk7H6I.js";import{n as Ct}from"./ChevronUp-7BeD5K4q.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,Tt]=ct(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[Nt,G]=ne(Q),[Pt,_t]=ne(Q),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[U,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:Q}),[F,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:w,form:S,children:[F===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(J,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(J,t),[x,U]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>U(f)),[O,F]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(F(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Ue,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(J,t),r=Y(J,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=F.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-F.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[U,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Ue.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),U=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Fe.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Je,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Qe=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Je,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Qe.displayName=Ce;var Je=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ut.displayName=zt;var be="SelectArrow",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ft.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Fe,Jt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Qe;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Qt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Jt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|
|
1
|
+
import{r as d,bn as st,bl as Ne,j as i,dM as rt,bp as Ie,bm as k,dN as lt,bi as j,bo as P,cs as $,dO as at,aH as Ee,dP as Re,bj as ct,cm as it,dQ as dt,cu as ut,dR as pt,dS as ft,dT as mt,dU as ht,dV as gt,bk as vt,dW as xt,dX as St,dY as wt,c as ee,n as oe}from"./index-ZtSDBa1M.js";import{i as yt}from"./Check-B-T1OdyM.js";import{t as je}from"./ChevronDown-lhRoz8ve.js";import{n as Ct}from"./ChevronUp-CjB5cNrn.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,Tt]=ct(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[Nt,G]=ne(Q),[Pt,_t]=ne(Q),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[U,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:Q}),[F,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:w,form:S,children:[F===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(J,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(J,t),[x,U]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>U(f)),[O,F]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(F(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Ue,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(J,t),r=Y(J,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=F.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-F.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[U,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Ue.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),U=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Fe.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Je,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Qe=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Je,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Qe.displayName=Ce;var Je=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ut.displayName=zt;var be="SelectArrow",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ft.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Fe,Jt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Qe;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Qt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Jt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|