decocms 4.571.0 → 4.572.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cbs5Ab1P.js → AlertCircle-kYtqXGU8.js} +1 -1
- package/dist/client/assets/{AreaChart-CToSouiR.js → AreaChart-DDNkWSZu.js} +1 -1
- package/dist/client/assets/{ArrowLeft-2ggpgqb0.js → ArrowLeft-B1m5qQi9.js} +1 -1
- package/dist/client/assets/{ArrowUp-cgUvwam2.js → ArrowUp-DcYpepHk.js} +1 -1
- package/dist/client/assets/{CartesianChart-CQdu8PPi.js → CartesianChart-BfCEFz3y.js} +1 -1
- package/dist/client/assets/{CategoricalChart-B5fszPCD.js → CategoricalChart-Bp-vLaQf.js} +1 -1
- package/dist/client/assets/{CheckCircle-D2qom1Qe.js → CheckCircle-B4NfGYxe.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CSCxxcTv.js → ChevronSelectorVertical-EqyUOMMk.js} +1 -1
- package/dist/client/assets/{ChevronUp-DPwvtZ7T.js → ChevronUp-DRG0w_P4.js} +1 -1
- package/dist/client/assets/{CreditCard01-BeIdgKm8.js → CreditCard01-BLl0RgXC.js} +1 -1
- package/dist/client/assets/{Globe04-BNjS8hE_.js → Globe04--FaZazgw.js} +1 -1
- package/dist/client/assets/{Key01-Bb2fYsyQ.js → Key01-D0Pq98hT.js} +1 -1
- package/dist/client/assets/{LinkBroken01-a5oI2X-K.js → LinkBroken01-C9GtmpYY.js} +1 -1
- package/dist/client/assets/{Minus-HfQUebB7.js → Minus-eGpg4-RN.js} +1 -1
- package/dist/client/assets/{Monitor01-D0NO-K1o.js → Monitor01-Su614Ctg.js} +1 -1
- package/dist/client/assets/{Play-UerN5i51.js → Play-D_ph4pZ0.js} +1 -1
- package/dist/client/assets/{Plus-BqBCvRtk.js → Plus-D8rFucQH.js} +1 -1
- package/dist/client/assets/{ReferenceLine-8Od-_LqW.js → ReferenceLine-BsZk9TgE.js} +1 -1
- package/dist/client/assets/{SearchMd-ip9BTueQ.js → SearchMd-2MPq0KPN.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Z5jujKnF.js → ShoppingBag01-DDCYsqx9.js} +1 -1
- package/dist/client/assets/{Sun-BqxGPQ7c.js → Sun-Dvv08Urq.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-xah_f_KH.js → SwitchHorizontal01-D7HAXgYP.js} +1 -1
- package/dist/client/assets/{Tool01-CAgFzAvv.js → Tool01-BTDYOKsB.js} +1 -1
- package/dist/client/assets/{Tooltip-2CGCyakg.js → Tooltip-CPoCGNVz.js} +1 -1
- package/dist/client/assets/{Trash01-C7v1fWGY.js → Trash01-CHCe7_6o.js} +1 -1
- package/dist/client/assets/{Upload01-7apXt8L7.js → Upload01-Q6ECKQXp.js} +1 -1
- package/dist/client/assets/{UserSquare-Dfda7sxk.js → UserSquare-BJHrMhrM.js} +1 -1
- package/dist/client/assets/{Users01-DGaGzIcz.js → Users01-DHfg9AEk.js} +1 -1
- package/dist/client/assets/{XClose-DaTfQwji.js → XClose-BDiB_Nvo.js} +1 -1
- package/dist/client/assets/{Zap-CmFvKOKc.js → Zap-DpvU6Dp2.js} +1 -1
- package/dist/client/assets/{access-gate-DSrHE9mR.js → access-gate-BjRwuLrP.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-sfNoRM_t.js → add-connection-dialog-Bh0vHlQ5.js} +1 -1
- package/dist/client/assets/agent-app-IWHPMxEK.js +1 -0
- package/dist/client/assets/{agent-assets-BOBiAU4U.js → agent-assets-BZWSLrfd.js} +1 -1
- package/dist/client/assets/{agent-automation-JSDOOiNt.js → agent-automation-C1Vdho1R.js} +1 -1
- package/dist/client/assets/{agent-automations-dSGzVGTE.js → agent-automations-BOxoQlGs.js} +1 -1
- package/dist/client/assets/{agent-calendar-JsZQH9DJ.js → agent-calendar-CdFd9RbD.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CuOmNgv3.js → agent-capabilities-C80Nj8dH.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-f0poJHtj.js → agent-connect-sources-CEmlztKl.js} +1 -1
- package/dist/client/assets/agent-deck-CtBABaGT.js +1 -0
- package/dist/client/assets/{agent-e2e-DsNy3BsN.js → agent-e2e-CFF1rulz.js} +1 -1
- package/dist/client/assets/agent-experiments-ui7FfvYG.js +1 -0
- package/dist/client/assets/{agent-file-Y-EO6Btn.js → agent-file-Cq3onOpE.js} +1 -1
- package/dist/client/assets/{agent-hosting-BS_jB6we.js → agent-hosting-vCUxyXYf.js} +1 -1
- package/dist/client/assets/{agent-icon-BGTckvlP.js → agent-icon-DqjTL3cE.js} +1 -1
- package/dist/client/assets/agent-library-CrZB4N_E.js +1 -0
- package/dist/client/assets/agent-library-file-BOxLy0sn.js +1 -0
- package/dist/client/assets/agent-overview-BcgCBEmB.js +1 -0
- package/dist/client/assets/{agent-releases-B_K3FIWy.js → agent-releases-aYJGzx-T.js} +1 -1
- package/dist/client/assets/agent-settings-CxJPBxUl.js +1 -0
- package/dist/client/assets/agent-site-editor-code-CLO4vASe.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DwQjPdJR.js +1 -0
- package/dist/client/assets/{agent-site-editor-CiaB1f7K.js → agent-site-editor-gGRvmvu9.js} +1 -1
- package/dist/client/assets/agent-site-editor-preview-DVAXUJER.js +1 -0
- package/dist/client/assets/agent-view-BWBpZVUF.js +1 -0
- package/dist/client/assets/{agent-view-guard-H_xpaENl.js → agent-view-guard-Bppi7Mra.js} +1 -1
- package/dist/client/assets/{ai-providers-OlLaxP2V.js → ai-providers-JXuyHqZ0.js} +1 -1
- package/dist/client/assets/{alert-CWtTJO7c.js → alert-Cddl0pAs.js} +1 -1
- package/dist/client/assets/{analytics-sections-DH9U0O99.js → analytics-sections-DFGgGKah.js} +1 -1
- package/dist/client/assets/{api-keys-B4joTgKi.js → api-keys-CyRPnxt1.js} +1 -1
- package/dist/client/assets/api-keys-G9chtY31.js +1 -0
- package/dist/client/assets/{app-editor-BrdqMvUA.js → app-editor-XjHMyWR2.js} +1 -1
- package/dist/client/assets/{asset-utils-BO-AcYFX.js → asset-utils-Cekn7DV3.js} +1 -1
- package/dist/client/assets/{auth-catchall-CU4VU9mW.js → auth-catchall-BEu29rgq.js} +1 -1
- package/dist/client/assets/{auth-entry-CuJQjZjM.js → auth-entry-C-rkFm2s.js} +1 -1
- package/dist/client/assets/{auth-BExDXNDY.js → auth-qAWEiaXq.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BCXGVZBW.js → auth-split-layout-E78PPbPV.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-vexqf63k.js → authenticate-and-persist-oauth-D7iMHNSW.js} +1 -1
- package/dist/client/assets/{automation-list-row-Bp87yYiZ.js → automation-list-row-guzwZg5A.js} +1 -1
- package/dist/client/assets/{automation-runs-DiRDWuN3.js → automation-runs-BHP_sOU-.js} +1 -1
- package/dist/client/assets/{automations-DMWU0I6x.js → automations-BgweD4e5.js} +1 -1
- package/dist/client/assets/{autosend-DL4CutFR.js → autosend-_WPHuuuS.js} +1 -1
- package/dist/client/assets/{badge-CVFmvf1e.js → badge-DtxRsHGH.js} +1 -1
- package/dist/client/assets/{block-document-BENHfkyr.js → block-document-CT7wSVO4.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-EXsoCHPE.js → blocks-preview-workspace-context-BoHWp5NJ.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-Of3CFRB8.js → blocks-tab-states-2A_KUVRA.js} +1 -1
- package/dist/client/assets/{blog-schema-BG9a5NjF.js → blog-schema-DyhIMTKN.js} +1 -1
- package/dist/client/assets/{buckets-CC28Un34.js → buckets-B6SQeYKj.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BISiPdsN.js → build-improve-prompt-doc--GJGk9lj.js} +1 -1
- package/dist/client/assets/{calendar-9d4oM3ql.js → calendar-gF784tOB.js} +1 -1
- package/dist/client/assets/{capability-load-error-ByWk_AoZ.js → capability-load-error-gokttFVD.js} +1 -1
- package/dist/client/assets/{category-editor-7CKgp_eM.js → category-editor-DH5eEcV-.js} +1 -1
- package/dist/client/assets/{chart-DXLoDuxi.js → chart-2s7SvZtT.js} +1 -1
- package/dist/client/assets/{chat-context-WEEHZlsn.js → chat-context-aSjAR9mm.js} +1 -1
- package/dist/client/assets/{chat-draft-CeM2nWLu.js → chat-draft-C4Ql1o7U.js} +1 -1
- package/dist/client/assets/{checkbox-KpsWsk0_.js → checkbox-CBfkrmis.js} +1 -1
- package/dist/client/assets/{choose-editor-PfXE6_H8.js → choose-editor-DOrF20ax.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C2W_huzL.js → cli-auth-success-B188GHrd.js} +1 -1
- package/dist/client/assets/{client-icons-CCN4dFtx.js → client-icons-CGEm3mRa.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-CdGJgv0b.js → cms-settings-editor-CLowE0HB.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-dVKFaKA7.js → cms-store-drafts-CSMnfrKb.js} +1 -1
- package/dist/client/assets/{collapsible-B14xMZuR.js → collapsible-C6tkGF0M.js} +1 -1
- package/dist/client/assets/{collection-detail-pdnHCRF6.js → collection-detail-EKABwIVL.js} +1 -1
- package/dist/client/assets/{collection-display-button-CRiNqITy.js → collection-display-button-CiexA8e6.js} +1 -1
- package/dist/client/assets/{collection-search-Ck-1gfFY.js → collection-search-iHJVqUHB.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BlhppHAs.js → collection-table-wrapper-Dw3f1ge7.js} +1 -1
- package/dist/client/assets/{collection-tabs-6FzXiv6G.js → collection-tabs-Trcf-II9.js} +1 -1
- package/dist/client/assets/{combobox-fgtxpSsO.js → combobox-DqTAA7CX.js} +1 -1
- package/dist/client/assets/{command-C37DfioB.js → command-CtR4gjCr.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-pEyer4h1.js → companion-mcps-section-CMxxXZB8.js} +1 -1
- package/dist/client/assets/{config-C_d2w75d.js → config-BpJVAl-p.js} +1 -1
- package/dist/client/assets/{connect-CyzT5SDn.js → connect-DjUzAPce.js} +1 -1
- package/dist/client/assets/{connect-layout-DCavpmFh.js → connect-layout-atO8SWTe.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-MOlb_mGB.js → connect-source-dialog-CpTTYi_l.js} +1 -1
- package/dist/client/assets/{connection-BjCYlDIW.js → connection-CZHWvxVM.js} +1 -1
- package/dist/client/assets/{connection-card-qC58rx0g.js → connection-card-Dt4OQ0Zk.js} +1 -1
- package/dist/client/assets/{connection-detail-CnaYuh7u.js → connection-detail-weWLbsDk.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-9PE7Ghza.js → connection-form-helpers-KX0UMFtC.js} +1 -1
- package/dist/client/assets/{connection-slug-DgmEtT2x.js → connection-slug-BQwcAWfG.js} +1 -1
- package/dist/client/assets/{connections-DG7FZ0U7.js → connections-i22Te-Si.js} +1 -1
- package/dist/client/assets/{content-tab-Ce8Q2_t2.js → content-tab-CxWiT9yK.js} +3 -3
- package/dist/client/assets/{context-BB5j-Jdw.js → context-BHoetvxj.js} +1 -1
- package/dist/client/assets/{context-menu-BrSBg_ox.js → context-menu-CmlGLO8r.js} +1 -1
- package/dist/client/assets/{context-shell-D7i0aANg.js → context-shell-PkAxZmyt.js} +3 -3
- package/dist/client/assets/{core.esm-FUcIa7Fp.js → core.esm-DkzVh4mV.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D_0hk2gK.js → create-organization-dialog-_VIsUUpV.js} +1 -1
- package/dist/client/assets/{device-hint-CyMFSeT8.js → device-hint-CdtW8Ayx.js} +1 -1
- package/dist/client/assets/{discover-DJRtlG9n.js → discover-DylE9QvC.js} +1 -1
- package/dist/client/assets/{domain-settings-Y_vTNHIA.js → domain-settings-BuPEVvED.js} +1 -1
- package/dist/client/assets/{drawer-C8tQ9pS2.js → drawer-ChCkx76W.js} +1 -1
- package/dist/client/assets/{editor-QJRHEQ16.js → editor-BKO3Ouyu.js} +1 -1
- package/dist/client/assets/{editor-classes-B6F-sROj.js → editor-classes-BNXGx3Ep.js} +1 -1
- package/dist/client/assets/{empty-state-BCvL-1M3.js → empty-state-DiGOrU7G.js} +1 -1
- package/dist/client/assets/{empty-state-DKsEkDWT.js → empty-state-ajQCApN0.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CbV3SQAK.js → experiments-tab-choice-BUQKBcCh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Co4igpCy.js → extract-connection-data-CTb_9Cpr.js} +1 -1
- package/dist/client/assets/{feature-gate-CS539brz.js → feature-gate-DReJia4Z.js} +1 -1
- package/dist/client/assets/{feature-paywall-BVeAB8_F.js → feature-paywall-DbaCusI2.js} +1 -1
- package/dist/client/assets/{feedback-DF1F9BRw.js → feedback-CVUSSdB5.js} +1 -1
- package/dist/client/assets/{file-explorer-Sdd0azAq.js → file-explorer-CgN8XtEL.js} +1 -1
- package/dist/client/assets/{file-preview-BQioSlJw.js → file-preview-CO8Jx_5T.js} +1 -1
- package/dist/client/assets/{file-share-button-Dq-dVjtE.js → file-share-button-B1R4GS_L.js} +1 -1
- package/dist/client/assets/{file-type-icon-CNDz0hBy.js → file-type-icon-Bo3Nsgdh.js} +1 -1
- package/dist/client/assets/{folder-icon-U2FEFXsO.js → folder-icon-DHVgg162.js} +1 -1
- package/dist/client/assets/{form-DXyLAoEr.js → form-BhXakrt_.js} +1 -1
- package/dist/client/assets/{general-DxPErvh9.js → general-BvxlAOrY.js} +1 -1
- package/dist/client/assets/{github-icon-DTSso41S.js → github-icon-BBNizm_E.js} +1 -1
- package/dist/client/assets/{home-C-LgRFYa.js → home-CppOBOPg.js} +1 -1
- package/dist/client/assets/{home-overview-BLmq-j06.js → home-overview-6RI8kIqs.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BRk5mz3x.js → hosted-reconcile-C9_-UERm.js} +1 -1
- package/dist/client/assets/{icon-button-B4XnwraP.js → icon-button-muPqJd-h.js} +1 -1
- package/dist/client/assets/{index-B6AqVyRx.js → index-2LwpmkET.js} +1 -1
- package/dist/client/assets/{index-kwATYZnP.js → index-878qqrH2.js} +1 -1
- package/dist/client/assets/{index-DObYgDqg.js → index-8ANyj4B7.js} +1 -1
- package/dist/client/assets/{index-BgFyWMUk.js → index-A822oipr.js} +1 -1
- package/dist/client/assets/{index-DovyWo-R.js → index-B6_lV1vO.js} +1 -1
- package/dist/client/assets/{index-RQA3UZ8F.js → index-BRwiTdyd.js} +1 -1
- package/dist/client/assets/{index-cE8Cg_AR.js → index-Bcy7_FA1.js} +1 -1
- package/dist/client/assets/{index-CQ63loJV.js → index-BlAiq0AL.js} +1 -1
- package/dist/client/assets/{index-Bgkjt4vy.js → index-CcqLnTyv.js} +5 -5
- package/dist/client/assets/{index-DP8sH5of.js → index-D146teOp.js} +1 -1
- package/dist/client/assets/{index-BFve9Wi8.js → index-DCh3kkGn.js} +1 -1
- package/dist/client/assets/{index-D3t73ds8.js → index-DhM4mrtt.js} +1 -1
- package/dist/client/assets/{index-D08mzr4H.js → index-GYpV5EH9.js} +1 -1
- package/dist/client/assets/{index-DxfUJlA4.js → index-QDvBZCSy.js} +1 -1
- package/dist/client/assets/{index-BMlrWTB1.js → index-TupjNSVk.js} +1 -1
- package/dist/client/assets/{index-C7lWWhIU.js → index-n9xCS6Sf.js} +1 -1
- package/dist/client/assets/{index-redirect-CcWBc9jM.js → index-redirect-BUCPvmVN.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-X5CcDr9j.js → infiniteQueryObserver-uDA4YvYL.js} +1 -1
- package/dist/client/assets/{infra-billing-DFPWiYwa.js → infra-billing-Bql8vBuZ.js} +1 -1
- package/dist/client/assets/{input-B1ylvcHV.js → input-BDAmWj4c.js} +3 -3
- package/dist/client/assets/{input-BYA2vxZm.js → input-COtL628i.js} +1 -1
- package/dist/client/assets/{integration-icon-C7bRwcH_.js → integration-icon-ChQEBlMz.js} +1 -1
- package/dist/client/assets/{jira-icon-DGCOmFp6.js → jira-icon-CJhoZQuc.js} +1 -1
- package/dist/client/assets/{label-D25-0Wh6.js → label-CsfAEF08.js} +1 -1
- package/dist/client/assets/{layout-DnoCv7Y5.js → layout-B-LTaCR7.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-C5jspcJW.js → legacy-agents-deep-B3LnX3dE.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D7NT1WBZ.js → legacy-main-redirect-KlovZkVM.js} +1 -1
- package/dist/client/assets/library-B2C1_FfB.js +1 -0
- package/dist/client/assets/{library-tab-tbFrXHgR.js → library-tab-DdqY20-1.js} +1 -1
- package/dist/client/assets/{login-Cn8-U1Kv.js → login-DRAz2Byx.js} +1 -1
- package/dist/client/assets/{markdown-12a9C6gs.js → markdown-CPuTm6Mv.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D5couJ6l.js → mcp-app-renderer-Cigj7X9N.js} +1 -1
- package/dist/client/assets/{mcp-oauth-a2WNYr35.js → mcp-oauth-BU_Qloaj.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BaddOlGq.js → mcp-oauth-ChfuZkYU.js} +1 -1
- package/dist/client/assets/{members-CZ44ad9P.js → members-BDBxWp17.js} +1 -1
- package/dist/client/assets/{memory-C6DEVRSO.js → memory-B9jEAxkU.js} +1 -1
- package/dist/client/assets/{mock-board-DfUD0CJt.js → mock-board-Bsls4MQk.js} +3 -3
- package/dist/client/assets/{monaco-editor-Cn1TEUmq.js → monaco-editor-XS1Vx7aB.js} +1 -1
- package/dist/client/assets/{monitoring-z5KlpAiC.js → monitoring-B3WSTrVO.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B_RviRp-.js → monitoring-stats-row-CuWemrnJ.js} +1 -1
- package/dist/client/assets/{multi-select-DAJzscc4.js → multi-select-C2R3RZPE.js} +1 -1
- package/dist/client/assets/{mustache-BYgEr74H.js → mustache-ByRkTjky.js} +1 -1
- package/dist/client/assets/{named-rule-view-a6Af9Y_h.js → named-rule-view-D9J5jfxv.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DZScwreb.js → new-project-dialog-C_1Rs0SG.js} +1 -1
- package/dist/client/assets/{oauth-callback-CssoBuAl.js → oauth-callback-Du4CoqhX.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DeW99Mbt.js → oauth-callback-ai-provider-CGOatJwS.js} +1 -1
- package/dist/client/assets/{oauth-consent-3FbtrQ-O.js → oauth-consent-DP5dM3Bl.js} +1 -1
- package/dist/client/assets/{onboarding-idlA3-zh.js → onboarding-CNJgq5g8.js} +1 -1
- package/dist/client/assets/{openai-conversation-C88BC7Je.js → openai-conversation-RmvHRGWP.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-C-XQYFtN.js → optimistic-project-sidebar-views-BF6tqK9w.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DRh7v9Pq.js → order-monitor-day-Cs26_K8M.js} +1 -1
- package/dist/client/assets/{organization-choice-D8HF6Nft.js → organization-choice-Bntbf3d6.js} +1 -1
- package/dist/client/assets/{orgs-HEuftt--.js → orgs-CGfTnYKc.js} +1 -1
- package/dist/client/assets/own-accounts-section-Dv_Ox_cI.js +1 -0
- package/dist/client/assets/{pair-Ct1xgxut.js → pair-h0916MQd.js} +1 -1
- package/dist/client/assets/{parse-sections-D-35SZIB.js → parse-sections-BhaTg9vA.js} +3 -3
- package/dist/client/assets/{plan-CfTunmR6.js → plan-GL1imSbx.js} +1 -1
- package/dist/client/assets/{plan-ladder-iJPGG0mc.js → plan-ladder-BLc0_1i8.js} +1 -1
- package/dist/client/assets/{plan-usage-card-CPmF1Mdc.js → plan-usage-card-DWVVT2WQ.js} +1 -1
- package/dist/client/assets/{popover-CRX5tFOb.js → popover-BQnTqyWU.js} +1 -1
- package/dist/client/assets/{post-calendar-BJXCzebc.js → post-calendar-HNq1Smaq.js} +1 -1
- package/dist/client/assets/{post-editor-wf3j_7Z5.js → post-editor-B1Q3Pcgn.js} +1 -1
- package/dist/client/assets/{preview-content-BSZZr-mZ.js → preview-content-DHz0okBk.js} +1 -1
- package/dist/client/assets/{preview-dialog-BcxXfQ6o.js → preview-dialog-geLovY3F.js} +1 -1
- package/dist/client/assets/{preview-panel-Ce1qZOdd.js → preview-panel-5qTld6rM.js} +1 -1
- package/dist/client/assets/{preview-tab-ClX_Bl94.js → preview-tab-DTmM7FWc.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-Q92D1y36.js → product-picker-dialog-CkKwZuBF.js} +1 -1
- package/dist/client/assets/{profile-CERW1LgW.js → profile-DDg9c8sx.js} +1 -1
- package/dist/client/assets/{project-app-view-CEubGD1t.js → project-app-view-BTrJDLFt.js} +1 -1
- package/dist/client/assets/{project-apps-C951mymv.js → project-apps-sFKq8oaX.js} +1 -1
- package/dist/client/assets/{project-icon-CzcU3Mqg.js → project-icon-BlOLnUr2.js} +1 -1
- package/dist/client/assets/{project-index-BJwudS3v.js → project-index-C12cl71J.js} +1 -1
- package/dist/client/assets/project-reports-AxUmLNIH.js +1 -0
- package/dist/client/assets/project-tasks-CAr2Cqy5.js +1 -0
- package/dist/client/assets/{projects-DYDXJVDD.js → projects-APtBmhWY.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DQUhcI6R.js → projects-empty-state-B_-RYmNY.js} +1 -1
- package/dist/client/assets/{prompts-Pr-m_FAx.js → prompts-rGT4H9HS.js} +1 -1
- package/dist/client/assets/record-editor-Ci0iG6uP.js +1 -0
- package/dist/client/assets/{redirect-editor-BGvUBqUv.js → redirect-editor-CMuoDESV.js} +1 -1
- package/dist/client/assets/{reports-DzbfP0a1.js → reports-B5SaRV3H.js} +1 -1
- package/dist/client/assets/reports-D-qIr9kO.js +1 -0
- package/dist/client/assets/{reports-onboarding-fdfwoC5Y.js → reports-onboarding-C3O3uPM5.js} +1 -1
- package/dist/client/assets/{reports-tab-DsenaOP3.js → reports-tab-BU0ZPXc5.js} +2 -2
- package/dist/client/assets/repositories-DcYP84R5.js +1 -0
- package/dist/client/assets/{repositories-BKBt9Cjw.js → repositories-EzK0gp8T.js} +1 -1
- package/dist/client/assets/{repository-binding-SOF1batH.js → repository-binding-CuR-5wbj.js} +1 -1
- package/dist/client/assets/{repository-picker-DL7LhDyE.js → repository-picker-DEa_L5X-.js} +1 -1
- package/dist/client/assets/{require-capability-CulwBmL_.js → require-capability-s4T8ky9G.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bbj3yijQ.js → required-auth-layout-BnfTNype.js} +1 -1
- package/dist/client/assets/{reset-password-CEDutYaS.js → reset-password-DyQQJ8dn.js} +1 -1
- package/dist/client/assets/{resizable-BF1q0sZm.js → resizable-G0IV9sBv.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BZMbKk3n.js → resolve-tab-icon-73RgcuQe.js} +1 -1
- package/dist/client/assets/{review-settings-ZkiMBoaj.js → review-settings-CuOWj38_.js} +1 -1
- package/dist/client/assets/{role-color-C9uhwzF-.js → role-color-DsX-V5ks.js} +1 -1
- package/dist/client/assets/{roles-CEON3RQs.js → roles-Dx9qwbnQ.js} +1 -1
- package/dist/client/assets/{route-DEPx9jGW.js → route-BhRhH95H.js} +1 -1
- package/dist/client/assets/route-CSMzYXoN.js +1 -0
- package/dist/client/assets/{route-iWPPipTt.js → route-DyaXyBfS.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Cuu6DFTF.js → sandbox-lifecycle-context-BbXRjeM5.js} +1 -1
- package/dist/client/assets/{schema-DJM5djBQ.js → schema-D4ZSsKIV.js} +1 -1
- package/dist/client/assets/{schema-DCIk1LTk.js → schema-DyZV-W0g.js} +1 -1
- package/dist/client/assets/{scroll-area-jAJHvOhj.js → scroll-area-Dc2A2LkE.js} +1 -1
- package/dist/client/assets/{search-input-DVDThqIB.js → search-input-DFXG_UYw.js} +1 -1
- package/dist/client/assets/{search-toggle-CI-y0p8p.js → search-toggle-B9QbSQeA.js} +1 -1
- package/dist/client/assets/{secret-picker-popVUrUL.js → secret-picker-DmxIms9y.js} +1 -1
- package/dist/client/assets/{secrets-DalYwIr1.js → secrets-AGU75gav.js} +1 -1
- package/dist/client/assets/{section-array-field-DC06wjHY.js → section-array-field-ClWKGp_4.js} +1 -1
- package/dist/client/assets/{sections-D1hA-xOU.js → sections-BVT_1GZf.js} +1 -1
- package/dist/client/assets/{sections-editor-D78O6u_r.js → sections-editor-CYlxI1p5.js} +1 -1
- package/dist/client/assets/{select-lF0wcoip.js → select-DQqbq83t.js} +1 -1
- package/dist/client/assets/{select-model-D7HU-f3b.js → select-model-DrY_3vXN.js} +1 -1
- package/dist/client/assets/{seo-editor-CtzJbmZQ.js → seo-editor-BlBhyBAl.js} +1 -1
- package/dist/client/assets/{separator-C_6waQwt.js → separator-C0H8Yj6d.js} +1 -1
- package/dist/client/assets/settings-tab-DWTMFT0X.js +1 -0
- package/dist/client/assets/{sheet-B-HfTX7L.js → sheet-B2jsXlHJ.js} +1 -1
- package/dist/client/assets/{shell-layout-DJhfQde-.js → shell-layout-CBX9BtMX.js} +1 -1
- package/dist/client/assets/{site-draft-actions-CMHnwxCd.js → site-draft-actions-CD85gRfI.js} +1 -1
- package/dist/client/assets/{site-draft-view-CwjjGmMd.js → site-draft-view-D0hJTk9N.js} +1 -1
- package/dist/client/assets/site-editor-CWVoX5OY.js +1 -0
- package/dist/client/assets/{site-editor-toast-CFZ3g20k.js → site-editor-toast-CIOA7Zq3.js} +1 -1
- package/dist/client/assets/{skills-TRY4s8Yy.js → skills-XkOrIlnS.js} +1 -1
- package/dist/client/assets/{slider-DGqHqKd3.js → slider-84yNNCUP.js} +1 -1
- package/dist/client/assets/{sortable.esm-DwDHqu2Z.js → sortable.esm-BHALCXRV.js} +1 -1
- package/dist/client/assets/{sso-Am4Nf_A1.js → sso-6pnL0iJa.js} +1 -1
- package/dist/client/assets/{suggestion-9_dojs-y.js → suggestion-C3enCUG8.js} +1 -1
- package/dist/client/assets/{switch-Bh4leDQ8.js → switch-2cMTOO8e.js} +1 -1
- package/dist/client/assets/{synced-repos-lK4skxC9.js → synced-repos-bmkfQV3e.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DQowlddo.js → tab-icon-glyph-lzQzl_Ov.js} +1 -1
- package/dist/client/assets/{table-BVlqjzf4.js → table-DvZCTg5z.js} +1 -1
- package/dist/client/assets/{tabs-CE50d848.js → tabs-BzwzpfZ1.js} +1 -1
- package/dist/client/assets/{task-board-D_hXj2Vy.js → task-board-DcTNURQy.js} +1 -1
- package/dist/client/assets/{task-route-Be5seRTj.js → task-route-DfbZq1yE.js} +1 -1
- package/dist/client/assets/{task-status-1axt5dZB.js → task-status-CxLWWnTs.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-r6HixYm_.js → taskboard-analytics-Cmr5hCm9.js} +1 -1
- package/dist/client/assets/tasks-140YlmT4.js +1 -0
- package/dist/client/assets/{tasks-CdxgNM_V.js → tasks-CzV2b6I-.js} +1 -1
- package/dist/client/assets/{textarea-DnFolSR6.js → textarea-CpPhDLVU.js} +1 -1
- package/dist/client/assets/{thread-analytics-BoSR9_dC.js → thread-analytics-9huoP8m_.js} +1 -1
- package/dist/client/assets/{thread-intent-W-PQxNVd.js → thread-intent-pegObLq9.js} +1 -1
- package/dist/client/assets/{thread-route-B-6djUfH.js → thread-route-D5E5K-lU.js} +1 -1
- package/dist/client/assets/{thread-route-mCuisQJI.js → thread-route-DORnlP1l.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C1IbmVK3.js → thread-sheet-body-BFBUt-Sx.js} +1 -1
- package/dist/client/assets/{time-range-picker-DihnOOBB.js → time-range-picker-CO070soZ.js} +1 -1
- package/dist/client/assets/{toggle-group-DErjWYXo.js → toggle-group-D9bXIbAb.js} +1 -1
- package/dist/client/assets/{tool-namespace-Dwob85yl.js → tool-namespace-BQSaNq7N.js} +1 -1
- package/dist/client/assets/{tool-set-selector-C4XbxKMC.js → tool-set-selector-DM-ejAZy.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CuzSG6Ep.js → toolbar-icon-button-CTRAa2ng.js} +1 -1
- package/dist/client/assets/{tooltip-BP38juWI.js → tooltip-AKf-E49i.js} +1 -1
- package/dist/client/assets/{tooltipContext-BmU0TqD4.js → tooltipContext-C6xZbBgY.js} +1 -1
- package/dist/client/assets/{track-auFJ_XdC.js → track-ClB7tKVt.js} +1 -1
- package/dist/client/assets/{types-8U8D-Y9v.js → types-BQOtvCBo.js} +1 -1
- package/dist/client/assets/{url-slug-CvXmCpJZ.js → url-slug-ihGFL5bo.js} +1 -1
- package/dist/client/assets/{usage-stats-C-iZo0BZ.js → usage-stats-CVX23WNU.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BIh1KBLl.js → use-ai-providers-BrqJh5BT.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-Cp8bLYtd.js → use-apply-named-rule-BVdRelp-.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-CtKzpyFU.js +1 -0
- package/dist/client/assets/{use-automations-BomrPGWU.js → use-automations-B64sqUmg.js} +1 -1
- package/dist/client/assets/{use-autosave-CwfHnqn6.js → use-autosave-CXs3BFTf.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BPQNHFav.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-BJFKgYgw.js → use-chat-layout-state-Be9vIJ9A.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BqHNyOA0.js → use-cms-publish-actions-_yzMD1wJ.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B9Lrc-HW.js → use-connect-companion-CB7F6AWc.js} +1 -1
- package/dist/client/assets/{use-connection-BT_OOtuG.js → use-connection-CECJF8rf.js} +1 -1
- package/dist/client/assets/{use-content-sync-B0MN54yQ.js → use-content-sync-D6gXnizV.js} +1 -1
- package/dist/client/assets/{use-copy-DrB0tWuk.js → use-copy-CtSedmtg.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BBt-5tGJ.js → use-date-fns-locale-DQTvoMF-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DsHXF_za.js → use-debounced-autosave-BLJ3k7wG.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CekhRquV.js → use-debounced-value-CcMMD4Qy.js} +1 -1
- package/dist/client/assets/{use-deco-credits-qwzMk2Ai.js → use-deco-credits-C6qbWrOQ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dd92yoAZ.js → use-decopilot-events-Dc1L96mp.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D-UTTC0v.js → use-delete-connection-Cw1Qu4uu.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DE1jKIDx.js → use-deployment-admin-D9sSgOb1.js} +1 -1
- package/dist/client/assets/{use-entitlements-BWZ6Su0L.js → use-entitlements-BKF4jYfc.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cqws--qI.js → use-fast-preview-draft-url-TUtYOptx.js} +1 -1
- package/dist/client/assets/{use-file-configs-DpxzYxst.js → use-file-configs-D7-mFpqA.js} +1 -1
- package/dist/client/assets/{use-id-selection-BGnSfWFf.js → use-id-selection-JEuFRU8t.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-lQA3V0xG.js → use-inbox-feed-RrCfNvIm.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-wFaFK15q.js → use-infinite-scroll-Z_9MLZyx.js} +1 -1
- package/dist/client/assets/{use-join-requests-BdaV0Rjj.js → use-join-requests-CANHKzNj.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Dk8fH1fE.js → use-main-panel-tabs-DA6Ypr8r.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Ck3Se_Y3.js → use-mcp-auth-status-CMC6AisX.js} +1 -1
- package/dist/client/assets/{use-mcp-client-IMgoLgFY.js → use-mcp-client-DvDomB9A.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Bk_g-v-0.js → use-mcp-prompts-CgDM8qHG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CtpSFCmz.js → use-mcp-tools-mI5K7YKF.js} +1 -1
- package/dist/client/assets/{use-mobile-CW7DCn5M.js → use-mobile-BgN1E82d.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DfaBs3sc.js → use-move-blocks-CPMJkp5h.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DUsfLcvr.js → use-navigate-to-agent-DmfSMV3R.js} +1 -1
- package/dist/client/assets/{use-org-fs-DDvKBG9i.js → use-org-fs-BWA2rFQC.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-C4JLwrAt.js → use-org-repo-syncs-CTHMawzN.js} +1 -1
- package/dist/client/assets/{use-org-sso-BH_ZUFcu.js → use-org-sso-CGB_T6WF.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Ca4qUgyM.js → use-organization-settings-sxurgilE.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-4sY_IqcV.js → use-project-native-view-presence-CwgTlxOv.js} +1 -1
- package/dist/client/assets/{use-project-scope-CxaJ6AcP.js → use-project-scope-Cb4T7-Pe.js} +1 -1
- package/dist/client/assets/{use-recent-apps-kdlh-9NG.js → use-recent-apps-DD97o_H1.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DYAFraaD.js → use-reports-diagnostic-BA9L8p6c.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-Bv6EHRzy.js → use-sandbox-events-CdAdPYjL.js} +1 -1
- package/dist/client/assets/{use-secrets-BwcJJCVK.js → use-secrets-rjK8WMv5.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CWdiCrj1.js → use-section-preview-base-DcuAqWGB.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CEHXblGy.js → use-sidebar-collapsed-B34u6RwD.js} +1 -1
- package/dist/client/assets/{use-tags-CoD8SrC4.js → use-tags-0YxcWwJI.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-B7geh4Sd.js → use-task-board-analytics-tpDvOzAs.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CVDrlP1V.js → use-task-board-events-CGZxY00s.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BrtOevur.js → use-task-board-item-prs-B6YW8nsa.js} +1 -1
- package/dist/client/assets/{use-task-board-items-COv-bhs6.js → use-task-board-items-BcL-6L6N.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-Dx8vM0fR.js → use-task-board-prompts-B9dDmO_e.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DPZ7Y524.js → use-task-metadata-hgLXNv36.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Pm3V0nbB.js → use-thread-outputs-X5IsW797.js} +1 -1
- package/dist/client/assets/{use-voice-input-DwO5kNPT.js → use-voice-input-DmZaOhTZ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-WRSkkanY.js +1 -0
- package/dist/client/assets/{useQueries-CvrSJ4L5.js → useQueries-BbhbAWNG.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B1s2URZC.js +1 -0
- package/dist/client/assets/{users-B-jZ9pgk.js → users-BNwLmtY6.js} +1 -1
- package/dist/client/assets/{utils-CnVlph4k.js → utils-KeMhVvdQ.js} +1 -1
- package/dist/client/assets/{variant-calendar-DSMYmXmT.js → variant-calendar-VCJbhkWd.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DCs6FrU7.js → variant-matcher-override-DLQRivi9.js} +1 -1
- package/dist/client/assets/{view-header-CggAPEpA.js → view-header-cnfShdRT.js} +1 -1
- package/dist/client/assets/{virtual-mcp-knTda3gw.js → virtual-mcp-YmAa-VVd.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CjiXfMh2.js → watch-sse-pool-CYcZM1HP.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-B_xuQBe4.js +0 -1
- package/dist/client/assets/agent-deck-DrS8cvv6.js +0 -1
- package/dist/client/assets/agent-experiments-BmXzB7sO.js +0 -1
- package/dist/client/assets/agent-library-BeOICuv4.js +0 -1
- package/dist/client/assets/agent-library-file-BLEe6X-g.js +0 -1
- package/dist/client/assets/agent-overview-DK7iRg_t.js +0 -1
- package/dist/client/assets/agent-settings-BjOD_o2l.js +0 -1
- package/dist/client/assets/agent-site-editor-code--mSzyNhn.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CxN1Ldoy.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-RW-nzlvn.js +0 -1
- package/dist/client/assets/agent-view-DaSIF8yy.js +0 -1
- package/dist/client/assets/api-keys-CI8mz52i.js +0 -1
- package/dist/client/assets/library-B8KAYORe.js +0 -1
- package/dist/client/assets/own-accounts-section-BoGn4pOO.js +0 -1
- package/dist/client/assets/project-reports-BfKeLcLP.js +0 -1
- package/dist/client/assets/project-tasks-Dn-Gv_TR.js +0 -1
- package/dist/client/assets/record-editor-DBJCnSL6.js +0 -1
- package/dist/client/assets/reports-DR2YJPbu.js +0 -1
- package/dist/client/assets/repositories-ByhK-3bU.js +0 -1
- package/dist/client/assets/route-D7DW4Q6o.js +0 -1
- package/dist/client/assets/settings-tab-udmQO91m.js +0 -1
- package/dist/client/assets/site-editor-DG5keOVm.js +0 -1
- package/dist/client/assets/tasks-BWjB_1VS.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BvyYDdXE.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-iz2iNvo9.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Sda1zjLQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CscGJh0l.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-C-iZo0BZ.js";import{gs as ye,he as Ce,gr as Se,hf as Re,hg as Ee,hh as Te,hi as Oe,hj as Ie,gu as Ae,fj as Me,r as C,bQ as ze}from"./index-Bgkjt4vy.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
1
|
+
import{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-CVX23WNU.js";import{gs as ye,he as Ce,gr as Se,hf as Re,hg as Ee,hh as Te,hi as Oe,hj as Ie,gu as Ae,fj as Me,r as C,bQ as ze}from"./index-CcqLnTyv.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,ar as oe,at as re,b as se,a5 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-Bgkjt4vy.js";import{u as pe}from"./use-mobile-CW7DCn5M.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-CEHXblGy.js";import{a as ie,R as je,b as Se}from"./resizable-BF1q0sZm.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-BJFKgYgw.js";import{L as Le,q as Ne}from"./agent-icon-BGTckvlP.js";import{c as Q,T as X,a as ee}from"./tooltip-BP38juWI.js";import{T as te}from"./toolbar-icon-button-CuzSG6Ep.js";import{u as we}from"./use-project-scope-CxaJ6AcP.js";import{b as Pe}from"./repository-binding-SOF1batH.js";function ne(o,e){const a=typeof o=="number"?o:Number(o);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(o,e){const a=w.c(8);let l;a[0]!==e?(l=c=>ne(c,e),a[0]=e,a[1]=l):l=a[1];const[t,i]=oe(o,l);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const o=w.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),o[0]=e):e=o[0],ze(e,_e)}function Ee(o){const e=w.c(64),{actions:a,navigation:l}=o,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=le();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Re},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const q=P,W=(!L||N)&&"md:hidden";let _;e[39]!==W?(_=ue(W),e[39]=W,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let R;e[48]!==t?(R=t("page.expandSidebar"),e[48]=t,e[49]=R):R=e[49];let M;e[50]!==R?(M=s.jsx(ee,{side:"bottom",children:R}),e[50]=R,e[51]=M):M=e[51];let k;e[52]!==E||e[53]!==M?(k=s.jsxs(Q,{children:[E,M]}),e[52]=E,e[53]=M,e[54]=k):k=e[54];let I;e[55]!==q||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,q]}),e[55]=q,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==l||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:l}),e[58]=a,e[59]=g,e[60]=l,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Re(o){return o.matches.findLast(Me)?.staticData}function Me(o){return o.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function le(){return D.use(G)}function U(){const o=D.use(G);if(!o)throw new Error("ChatLayout regions require a ChatLayout");return o}function Ie(o){const e=w.c(23),{children:a,...l}=o,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=l,r=ve(l),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:l,threadVisibilityExplicit:l.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==l||e[2]!==x?(y={...l,isMobile:t,mobileSurface:x},e[0]=t,e[1]=l,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==l||e[6]!==i||e[7]!==d||e[8]!==j?(S=!l.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):l.toggleThread()}}),e[4]=t,e[5]=l,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(o){const e=w.c(16),{children:a,topbar:l}=o,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==l?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[l,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=l,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==l?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[l,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=l,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:o,routeId:e}){return o}function Y(o){const e=w.c(23),{children:a,actions:l,drawer:t,aside:i}=o,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==l||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:l}),e[0]=l,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const o=w.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),o[0]=e):e=o[0],e}function Ae(o){const e=w.c(18),{error:a,reset:l}=o,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==l||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:l,children:d}),e[11]=l,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:le},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
|
|
1
|
+
import{c as w,ar as oe,at as re,b as se,a5 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-CcqLnTyv.js";import{u as pe}from"./use-mobile-BgN1E82d.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-B34u6RwD.js";import{a as ie,R as je,b as Se}from"./resizable-G0IV9sBv.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-Be9vIJ9A.js";import{L as Le,q as Ne}from"./agent-icon-DqjTL3cE.js";import{c as Q,T as X,a as ee}from"./tooltip-AKf-E49i.js";import{T as te}from"./toolbar-icon-button-CTRAa2ng.js";import{u as we}from"./use-project-scope-Cb4T7-Pe.js";import{b as Pe}from"./repository-binding-CuR-5wbj.js";function ne(o,e){const a=typeof o=="number"?o:Number(o);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(o,e){const a=w.c(8);let l;a[0]!==e?(l=c=>ne(c,e),a[0]=e,a[1]=l):l=a[1];const[t,i]=oe(o,l);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const o=w.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),o[0]=e):e=o[0],ze(e,_e)}function Ee(o){const e=w.c(64),{actions:a,navigation:l}=o,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=le();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Re},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const q=P,W=(!L||N)&&"md:hidden";let _;e[39]!==W?(_=ue(W),e[39]=W,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let R;e[48]!==t?(R=t("page.expandSidebar"),e[48]=t,e[49]=R):R=e[49];let M;e[50]!==R?(M=s.jsx(ee,{side:"bottom",children:R}),e[50]=R,e[51]=M):M=e[51];let k;e[52]!==E||e[53]!==M?(k=s.jsxs(Q,{children:[E,M]}),e[52]=E,e[53]=M,e[54]=k):k=e[54];let I;e[55]!==q||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,q]}),e[55]=q,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==l||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:l}),e[58]=a,e[59]=g,e[60]=l,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Re(o){return o.matches.findLast(Me)?.staticData}function Me(o){return o.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function le(){return D.use(G)}function U(){const o=D.use(G);if(!o)throw new Error("ChatLayout regions require a ChatLayout");return o}function Ie(o){const e=w.c(23),{children:a,...l}=o,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=l,r=ve(l),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:l,threadVisibilityExplicit:l.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==l||e[2]!==x?(y={...l,isMobile:t,mobileSurface:x},e[0]=t,e[1]=l,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==l||e[6]!==i||e[7]!==d||e[8]!==j?(S=!l.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):l.toggleThread()}}),e[4]=t,e[5]=l,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(o){const e=w.c(16),{children:a,topbar:l}=o,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==l?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[l,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=l,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==l?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[l,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=l,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:o,routeId:e}){return o}function Y(o){const e=w.c(23),{children:a,actions:l,drawer:t,aside:i}=o,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==l||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:l}),e[0]=l,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const o=w.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),o[0]=e):e=o[0],e}function Ae(o){const e=w.c(18),{error:a,reset:l}=o,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==l||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:l,children:d}),e[11]=l,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:le},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,b as U,r as Y,m as B,j as t,a5 as Ke,d as Ge,aB as Je,l as Ve,H as Qe,ar as Pe,L as Me,$ as Ze,E as ge,at as We,aC as et,P as tt}from"./index-Bgkjt4vy.js";import{u as ke,c as He,i as st,j as it,k as nt,l as rt}from"./use-sidebar-collapsed-CEHXblGy.js";import{S as lt,a as ot,b as at}from"./sheet-B-HfTX7L.js";import{u as ct}from"./use-mobile-CW7DCn5M.js";import{u as dt,a as ut,D as ft,c as mt,C as ht,P as gt}from"./core.esm-FUcIa7Fp.js";import{S as pt,v as xt,u as bt}from"./sortable.esm-DwDHqu2Z.js";import{i as jt}from"./Tool01-CAgFzAvv.js";import{B as vt,A as yt,C as De,l as St}from"./agent-icon-BGTckvlP.js";import{s as wt}from"./Plus-BqBCvRtk.js";import{i as Ct}from"./UserSquare-Dfda7sxk.js";import{s as Ot}from"./XClose-DaTfQwji.js";import{a as pe,T as xe,c as be}from"./tooltip-BP38juWI.js";import{C as Le,f as _t,g as zt,e as Rt}from"./context-menu-BrSBg_ox.js";import{a as Nt,O as Be,w as Tt,b as Lt,c as Et,E as Pt,r as we,d as kt,e as At,h as Dt,t as It,f as Fe,m as $t,o as Kt}from"./shell-layout-DJhfQde-.js";import{C as Mt}from"./create-organization-dialog-D_0hk2gK.js";import{P as Wt}from"./project-apps-C951mymv.js";import{u as Ht,a as Bt}from"./use-recent-apps-kdlh-9NG.js";import{a as Ft}from"./use-navigate-to-agent-DUsfLcvr.js";import{a as Xt,u as Yt}from"./use-project-scope-CxaJ6AcP.js";import{C as Ie,a as Ut,b as qt,c as Gt,d as Jt}from"./command-C37DfioB.js";import{u as Vt}from"./use-debounced-value-CekhRquV.js";function Qt(n){const e=H.c(48),{open:s,onOpenChange:i,orgs:l,currentSlug:c,onSelect:r}=n,o=U(),[a,u]=Y.useState("");let g;e[0]!==a?(g=a.trim(),e[0]=a,e[1]=g):g=e[1];const h=g,m=Vt(h,150),f=h.length>0,d=m===h,{hits:b,isSearching:x,isStale:w,isError:y}=Nt(f?m:""),j=f?b:l;let S;e[2]!==i?(S=k=>{i(k),k||u("")},e[2]=i,e[3]=S):S=e[3];const p=S;let v;e[4]!==o?(v=o("sidebar.rail.searchOrganizations"),e[4]=o,e[5]=v):v=e[5];let C;e[6]!==o?(C=o("sidebar.rail.searchPlaceholder"),e[6]=o,e[7]=C):C=e[7];let N;e[8]!==o?(N=o("sidebar.rail.searchPlaceholder"),e[8]=o,e[9]=N):N=e[9];let O;e[10]!==a||e[11]!==N?(O=t.jsx(Ut,{value:a,onValueChange:u,placeholder:N}),e[10]=a,e[11]=N,e[12]=O):O=e[12];const P=f&&(w||!d)&&"opacity-50";let R;e[13]!==P?(R=B(P),e[13]=P,e[14]=R):R=e[14];let _;e[15]!==y||e[16]!==f||e[17]!==o?(_=f&&y&&t.jsx(Ie,{children:o("sidebar.rail.searchFailed")}),e[15]=y,e[16]=f,e[17]=o,e[18]=_):_=e[18];let T;e[19]!==y||e[20]!==x||e[21]!==j.length||e[22]!==d||e[23]!==o?(T=!y&&d&&!x&&j.length===0&&t.jsx(Ie,{children:o("sidebar.rail.searchEmpty")}),e[19]=y,e[20]=x,e[21]=j.length,e[22]=d,e[23]=o,e[24]=T):T=e[24];let L;if(e[25]!==c||e[26]!==r||e[27]!==p||e[28]!==j||e[29]!==o){let k;e[31]!==c||e[32]!==r||e[33]!==p||e[34]!==o?(k=A=>t.jsxs(qt,{value:A.slug,onSelect:()=>{p(!1),A.slug!==c&&r(A.slug)},className:"gap-2.5",children:[t.jsx(Be,{org:A,size:"sm"}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:A.name}),A.slug===c&&t.jsx("span",{className:"text-meta shrink-0",children:o("sidebar.rail.currentOrganization")})]},A.id),e[31]=c,e[32]=r,e[33]=p,e[34]=o,e[35]=k):k=e[35],L=j.map(k),e[25]=c,e[26]=r,e[27]=p,e[28]=j,e[29]=o,e[30]=L}else L=e[30];let z;e[36]!==T||e[37]!==L||e[38]!==R||e[39]!==_?(z=t.jsxs(Gt,{className:R,children:[_,T,L]}),e[36]=T,e[37]=L,e[38]=R,e[39]=_,e[40]=z):z=e[40];let D;return e[41]!==s||e[42]!==p||e[43]!==z||e[44]!==v||e[45]!==C||e[46]!==O?(D=t.jsxs(Jt,{open:s,onOpenChange:p,title:v,description:C,shouldFilter:!1,children:[O,z]}),e[41]=s,e[42]=p,e[43]=z,e[44]=v,e[45]=C,e[46]=O,e[47]=D):D=e[47],D}function Ce(n){const e=H.c(11),{active:s,label:i,children:l}=n,c=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let r;e[0]!==c?(r=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:t.jsx("span",{className:r})}),e[2]=r,e[3]=o):o=e[3];let a;e[4]!==s||e[5]!==i?(a=i&&t.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:i}),e[4]=s,e[5]=i,e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==a?(u=t.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[o,l,a]}),e[7]=l,e[8]=o,e[9]=a,e[10]=u):u=e[10],u}function Zt(n){return globalThis.addEventListener("resize",n),()=>globalThis.removeEventListener("resize",n)}const es=()=>Fe(globalThis.innerHeight),ts=()=>Fe(0);function ss(n){const e=H.c(59),{org:s,active:i,onSelect:l,pinned:c,onOpenSettings:r,onTogglePin:o,onHide:a}=n,u=U();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:h,listeners:m,transform:f,transition:d,isDragging:b}=bt(g);let x;e[2]!==f?(x=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=x):x=e[3];const w=b?1:void 0,y=`rail-org-${s.slug}`;let j;e[4]!==x||e[5]!==w||e[6]!==y||e[7]!==d?(j={transform:x,transition:d,zIndex:w,viewTransitionName:y},e[4]=x,e[5]=w,e[6]=y,e[7]=d,e[8]=j):j=e[8];const S=s.name,p=i||void 0,v=i?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",C=l&&"cursor-pointer";let N;e[9]!==v||e[10]!==C?(N=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,C),e[9]=v,e[10]=C,e[11]=N):N=e[11];let O;e[12]!==s?(O=t.jsx(Be,{org:s,size:"lg"}),e[12]=s,e[13]=O):O=e[13];let P;e[14]!==c?(P=c&&t.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:t.jsx(De,{size:9})}),e[14]=c,e[15]=P):P=e[15];let R;e[16]!==l||e[17]!==s.name||e[18]!==N||e[19]!==O||e[20]!==P||e[21]!==p?(R=t.jsx(xe,{asChild:!0,children:t.jsx(_t,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":S,"aria-current":p,onClick:l,className:N,children:[O,P]})})}),e[16]=l,e[17]=s.name,e[18]=N,e[19]=O,e[20]=P,e[21]=p,e[22]=R):R=e[22];let _;e[23]!==s.name?(_=t.jsx(pe,{side:"right",children:s.name}),e[23]=s.name,e[24]=_):_=e[24];let T;e[25]!==R||e[26]!==_?(T=t.jsxs(be,{children:[R,_]}),e[25]=R,e[26]=_,e[27]=T):T=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(St,{}),e[28]=L):L=e[28];let z;e[29]!==u?(z=u("sidebar.rail.organizationSettings"),e[29]=u,e[30]=z):z=e[30];let D;e[31]!==r||e[32]!==z?(D=t.jsxs(Le,{onSelect:r,children:[L,z]}),e[31]=r,e[32]=z,e[33]=D):D=e[33];let k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{}),e[34]=k):k=e[34];let A;e[35]!==c||e[36]!==u?(A=u(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=u,e[37]=A):A=e[37];let K;e[38]!==o||e[39]!==A?(K=t.jsxs(Le,{onSelect:o,children:[k,A]}),e[38]=o,e[39]=A,e[40]=K):K=e[40];let M;e[41]!==a||e[42]!==u?(M=a&&t.jsxs(Le,{onSelect:a,children:[t.jsx(jt,{}),u("sidebar.rail.hideOrganization")]}),e[41]=a,e[42]=u,e[43]=M):M=e[43];let F;e[44]!==D||e[45]!==K||e[46]!==M?(F=t.jsxs(zt,{children:[D,K,M]}),e[44]=D,e[45]=K,e[46]=M,e[47]=F):F=e[47];let $;e[48]!==T||e[49]!==F?($=t.jsxs(Rt,{children:[T,F]}),e[48]=T,e[49]=F,e[50]=$):$=e[50];let W;e[51]!==i||e[52]!==$?(W=t.jsx(Ce,{active:i,children:$}),e[51]=i,e[52]=$,e[53]=W):W=e[53];let X;return e[54]!==m||e[55]!==h||e[56]!==W||e[57]!==j?(X=t.jsx("div",{ref:h,...m,style:j,className:"w-full shrink-0 touch-none",children:W}),e[54]=m,e[55]=h,e[56]=W,e[57]=j,e[58]=X):X=e[58],X}function is(n){const e=H.c(64),{project:s,orgSlug:i,active:l,onClose:c,onNavigate:r}=n,o=U();let a,u,g,h,m,f,d,b,x,w,y;if(e[0]!==l||e[1]!==r||e[2]!==i||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const k=vt(s.icon,s.title);y="group/rail relative flex w-full flex-col items-center gap-1",g=be,u=xe,w=!0,a=Me,h=Ze.root,e[17]!==i||e[18]!==s.id?(m={org:i,agentId:s.id},e[17]=i,e[18]=s.id,e[19]=m):m=e[19],f=s.title,d=l||void 0,e[20]!==r?(b=()=>{ge("org_rail_recent_project_opened"),r?.()},e[20]=r,e[21]=b):b=e[21],x=B("flex shrink-0 rounded-lg focus-ring",k.text,l&&"ring-[1.5px] ring-current"),e[0]=l,e[1]=r,e[2]=i,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=a,e[7]=u,e[8]=g,e[9]=h,e[10]=m,e[11]=f,e[12]=d,e[13]=b,e[14]=x,e[15]=w,e[16]=y}else a=e[6],u=e[7],g=e[8],h=e[9],m=e[10],f=e[11],d=e[12],b=e[13],x=e[14],w=e[15],y=e[16];let j;e[22]!==s.icon||e[23]!==s.title?(j=t.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=j):j=e[24];let S;e[25]!==a||e[26]!==h||e[27]!==m||e[28]!==f||e[29]!==d||e[30]!==b||e[31]!==x||e[32]!==j?(S=t.jsx(a,{to:h,params:m,"aria-label":f,"aria-current":d,onClick:b,className:x,children:j}),e[25]=a,e[26]=h,e[27]=m,e[28]=f,e[29]=d,e[30]=b,e[31]=x,e[32]=j,e[33]=S):S=e[33];let p;e[34]!==u||e[35]!==S||e[36]!==w?(p=t.jsx(u,{asChild:w,children:S}),e[34]=u,e[35]=S,e[36]=w,e[37]=p):p=e[37];let v;e[38]!==s.title?(v=t.jsx(pe,{side:"right",children:s.title}),e[38]=s.title,e[39]=v):v=e[39];let C;e[40]!==g||e[41]!==p||e[42]!==v?(C=t.jsxs(g,{children:[p,v]}),e[40]=g,e[41]=p,e[42]=v,e[43]=C):C=e[43];const N=l?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let O;e[44]!==N?(O=B("line-clamp-2 w-full text-center text-2xs break-words transition-colors",N),e[44]=N,e[45]=O):O=e[45];let P;e[46]!==s.title||e[47]!==O?(P=t.jsx("span",{"aria-hidden":!0,className:O,children:s.title}),e[46]=s.title,e[47]=O,e[48]=P):P=e[48];let R;e[49]!==s.title||e[50]!==o?(R=o("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=o,e[51]=R):R=e[51];let _;e[52]!==c?(_=()=>{ge("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=_):_=e[53];let T,L;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=B("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),L=t.jsx(Ot,{size:10}),e[54]=T,e[55]=L):(T=e[54],L=e[55]);let z;e[56]!==R||e[57]!==_?(z=t.jsx("button",{type:"button","aria-label":R,onClick:_,className:T,children:L}),e[56]=R,e[57]=_,e[58]=z):z=e[58];let D;return e[59]!==C||e[60]!==P||e[61]!==z||e[62]!==y?(D=t.jsxs("div",{className:y,children:[C,P,z]}),e[59]=C,e[60]=P,e[61]=z,e[62]=y,e[63]=D):D=e[63],D}const ns={"site-editor":"/site-editor"};function rs(n){const e=H.c(26),{app:s}=n,i=U(),l=Wt[s],c=ns[s];if(!l||!c)return null;let r;e[0]!==l.labelKey||e[1]!==i?(r=i(l.labelKey),e[0]=l.labelKey,e[1]=i,e[2]=r):r=e[2];let o;e[3]!==l.labelKey||e[4]!==i?(o=i(l.labelKey),e[3]=l.labelKey,e[4]=i,e[5]=o):o=e[5];let a;e[6]!==l.tone?(a=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",l.tone),e[6]=l.tone,e[7]=a):a=e[7];let u;e[8]!==l.Icon?(u=t.jsx(l.Icon,{size:18}),e[8]=l.Icon,e[9]=u):u=e[9];let g;e[10]!==o||e[11]!==a||e[12]!==u||e[13]!==c?(g=t.jsx(xe,{asChild:!0,children:t.jsx(Me,{to:c,"aria-label":o,"aria-current":"page","data-testid":"org-rail-local-app",className:a,children:u})}),e[10]=o,e[11]=a,e[12]=u,e[13]=c,e[14]=g):g=e[14];let h;e[15]!==l.labelKey||e[16]!==i?(h=i(l.labelKey),e[15]=l.labelKey,e[16]=i,e[17]=h):h=e[17];let m;e[18]!==h?(m=t.jsx(pe,{side:"right",children:h}),e[18]=h,e[19]=m):m=e[19];let f;e[20]!==g||e[21]!==m?(f=t.jsxs(be,{children:[g,m]}),e[20]=g,e[21]=m,e[22]=f):f=e[22];let d;return e[23]!==r||e[24]!==f?(d=t.jsx(Ce,{active:!0,label:r,children:f}),e[23]=r,e[24]=f,e[25]=d):d=e[25],d}function ls(){const{org:n}=Ke();return Ht(n.slug),null}function Xe(n){const e=H.c(76),{onNavigate:s}=n===void 0?{}:n,i=U(),l=Ge(),{org:c}=Ke(),r=Je();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ds},e[0]=o):o=e[0];const a=Ve(o);let u;e[1]!==a||e[2]!==r?(u=a?r({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=a,e[2]=r,e[3]=u):u=e[3];const g=u,h=g?g.org:c.slug,{data:m}=Qe(),[f,d]=Y.useState(!1),[b,x]=Y.useState(!1),w=ke(),{recent:y,forget:j}=Ft(c.slug),{projects:S}=Xt(),p=Yt(),v=Bt(),C=v&&v.projectId===null?v.app:null,N=C?[]:y.flatMap(E=>S.filter(I=>I.id===E)),O=Tt(m??[],c),{recent:P}=Lt(),R=Et();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=We.railOrgPrefs(),e[4]=_):_=e[4];const[T,L]=Pe(_,Pt),z=we(T),D=Y.useSyncExternalStore(Zt,es,ts),{shown:k}=kt(At(O,z,c.slug),P,c.slug,D,z.pinned);let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={activationConstraint:{distance:8}},e[5]=A):A=e[5];const K=dt(ut(gt,A)),M=E=>{const{active:I,over:Ae}=E;Ae&&(ge("org_rail_reordered"),L(qe=>$t(we(qe),k.map(cs),String(I.id),String(Ae.id))))},F=E=>{s?.(),l({to:"/$org/home",params:{org:E},viewTransition:!0})},$=E=>{ge("org_rail_travel"),s?.(),R(E,k.map(as))},W=()=>{if(ge("org_rail_search_opened"),!c.id){x(!0);return}s?.(),Kt()},X=!w&&"border-r border-sidebar-border";let q;e[6]!==X?(q=B("flex w-[68px] shrink-0 flex-col bg-sidebar",X),e[6]=X,e[7]=q):q=e[7];const Ue="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let G;e[8]!==i?(G=i("sidebar.rail.ariaLabel"),e[8]=i,e[9]=G):G=e[9];const Oe=ft,_e=mt,ze=pt,Re=k.map(os),Ne=xt,Te=k.map(E=>t.jsxs(Y.Fragment,{children:[t.jsx(ss,{org:E,active:E.slug===h,pinned:z.pinned.includes(E.slug),onSelect:E.slug!==c.slug?()=>$(E.slug):p?()=>F(E.slug):void 0,onOpenSettings:()=>{s?.(),l({to:"/$org/settings",params:{org:E.slug}})},onTogglePin:()=>L(I=>It(we(I),E.slug)),onHide:E.slug===c.slug?void 0:()=>L(I=>Dt(we(I),E.slug))}),E.slug===c.slug&&N.length>0&&t.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:N.map(I=>t.jsx(is,{project:I,orgSlug:c.slug,active:p===I.id,onClose:()=>j(I.id),onNavigate:s},I.id))})]},E.id));let J;e[10]!==ze||e[11]!==Re||e[12]!==Ne||e[13]!==Te?(J=t.jsx(ze,{items:Re,strategy:Ne,children:Te}),e[10]=ze,e[11]=Re,e[12]=Ne,e[13]=Te,e[14]=J):J=e[14];let V;e[15]!==Oe||e[16]!==M||e[17]!==K||e[18]!==_e||e[19]!==J?(V=t.jsx(Oe,{sensors:K,collisionDetection:_e,onDragEnd:M,children:J}),e[15]=Oe,e[16]=M,e[17]=K,e[18]=_e,e[19]=J,e[20]=V):V=e[20];let Q;e[21]!==C?(Q=C&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),t.jsx(rs,{app:C})]}),e[21]=C,e[22]=Q):Q=e[22];let Z;e[23]!==V||e[24]!==Q||e[25]!==G?(Z=t.jsxs("div",{className:Ue,"aria-label":G,children:[V,Q]}),e[23]=V,e[24]=Q,e[25]=G,e[26]=Z):Z=e[26];let ee;e[27]!==i?(ee=i("sidebar.rail.search"),e[27]=i,e[28]=ee):ee=e[28];let je;e[29]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx(Ct,{size:18}),e[29]=je):je=e[29];let te;e[30]!==W||e[31]!==ee?(te=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":ee,"aria-keyshortcuts":"Meta+K Control+K",onClick:W,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:je})}),e[30]=W,e[31]=ee,e[32]=te):te=e[32];let se;e[33]!==i?(se=i("sidebar.rail.search"),e[33]=i,e[34]=se):se=e[34];let ve;e[35]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("span",{className:"ml-2 text-muted-foreground",children:et.commandPalette.keys.join("")}),e[35]=ve):ve=e[35];let ie;e[36]!==se?(ie=t.jsxs(pe,{side:"right",children:[se,ve]}),e[36]=se,e[37]=ie):ie=e[37];let ne;e[38]!==te||e[39]!==ie?(ne=t.jsx(Ce,{active:!1,children:t.jsxs(be,{children:[te,ie]})}),e[38]=te,e[39]=ie,e[40]=ne):ne=e[40];let re;e[41]!==i?(re=i("sidebar.picker.newOrganization"),e[41]=i,e[42]=re):re=e[42];let le;e[43]!==d?(le=()=>d(!0),e[43]=d,e[44]=le):le=e[44];let ye;e[45]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(wt,{size:18}),e[45]=ye):ye=e[45];let oe;e[46]!==re||e[47]!==le?(oe=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":re,onClick:le,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ye})}),e[46]=re,e[47]=le,e[48]=oe):oe=e[48];let ae;e[49]!==i?(ae=i("sidebar.picker.newOrganization"),e[49]=i,e[50]=ae):ae=e[50];let ce;e[51]!==ae?(ce=t.jsx(pe,{side:"right",children:ae}),e[51]=ae,e[52]=ce):ce=e[52];let de;e[53]!==oe||e[54]!==ce?(de=t.jsx(Ce,{active:!1,children:t.jsxs(be,{children:[oe,ce]})}),e[53]=oe,e[54]=ce,e[55]=de):de=e[55];let ue;e[56]!==ne||e[57]!==de?(ue=t.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ne,de]}),e[56]=ne,e[57]=de,e[58]=ue):ue=e[58];let fe;e[59]!==Z||e[60]!==ue||e[61]!==q?(fe=t.jsxs("div",{className:q,children:[Z,ue]}),e[59]=Z,e[60]=ue,e[61]=q,e[62]=fe):fe=e[62];let me;e[63]!==c.slug||e[64]!==O||e[65]!==b||e[66]!==x||e[67]!==$?(me=t.jsx(Qt,{open:b,onOpenChange:x,orgs:O,currentSlug:c.slug,onSelect:$}),e[63]=c.slug,e[64]=O,e[65]=b,e[66]=x,e[67]=$,e[68]=me):me=e[68];let he;e[69]!==f||e[70]!==d?(he=t.jsx(Mt,{open:f,onOpenChange:d}),e[69]=f,e[70]=d,e[71]=he):he=e[71];let Se;return e[72]!==fe||e[73]!==me||e[74]!==he?(Se=t.jsxs(t.Fragment,{children:[fe,me,he]}),e[72]=fe,e[73]=me,e[74]=he,e[75]=Se):Se=e[75],Se}function os(n){return n.slug}function as(n){return n.slug}function cs(n){return n.slug}function ds(n){return n.isLoading}function us(n){const e=H.c(15),{width:s,minWidth:i,maxWidth:l,onPointerDown:c,onKeyDown:r,onDoubleClick:o}=n,a=U(),{isMobile:u}=He(),g=ke();if(u||g)return null;let h;e[0]!==a?(h=a("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=a,e[1]=h):h=e[1];let m;e[2]!==a?(m=a("sidebar.sidebarResizeHandle.title"),e[2]=a,e[3]=m):m=e[3];let f,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},d=t.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=d):(f=e[4],d=e[5]);let b;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==r||e[10]!==c||e[11]!==h||e[12]!==m||e[13]!==s?(b=t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":s,"aria-valuemin":i,"aria-valuemax":l,title:m,tabIndex:0,onPointerDown:c,onKeyDown:r,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:d}),e[6]=l,e[7]=i,e[8]=o,e[9]=r,e[10]=c,e[11]=h,e[12]=m,e[13]=s,e[14]=b):b=e[14],b}const Ee=400,$e=16,fs="sidebar.width.v2";function ms(){const n=H.c(14),e=hs;let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=d=>typeof d=="number"?e(d):192,n[0]=s):s=n[0];const[i,l]=Pe(fs,s),c=Y.useRef(null);let r;n[1]!==l||n[2]!==i?(r=d=>{d.preventDefault();const b=d.clientX,x=e(i),w=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),y=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of y)p.style.transition="none";const j=p=>{const v=e(x+(p.clientX-b));w?.style.setProperty("--sidebar-width",`${v}px`)},S=p=>{const v=e(x+(p.clientX-b));l(v);for(const C of y)C.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},n[1]=l,n[2]=i,n[3]=r):r=n[3];const o=r;let a;n[4]!==l?(a=()=>{l(192)},n[4]=l,n[5]=a):a=n[5];const u=a;let g;n[6]!==l||n[7]!==i?(g=d=>{if(d.key==="ArrowLeft")l(e(i-$e));else if(d.key==="ArrowRight")l(e(i+$e));else if(d.key==="Home")l(192);else if(d.key==="End")l(Ee);else return;d.preventDefault()},n[6]=l,n[7]=i,n[8]=g):g=n[8];const h=g,m=e(i);let f;return n[9]!==h||n[10]!==o||n[11]!==u||n[12]!==m?(f={width:m,minWidth:192,maxWidth:Ee,wrapperRef:c,onStartResize:o,onKeyDownResize:h,resetWidth:u},n[9]=h,n[10]=o,n[11]=u,n[12]=m,n[13]=f):f=n[13],f}function hs(n){return Math.max(192,Math.min(Ee,n))}const Ye=Y.createContext(null);function gs(){const n=Y.use(Ye);if(!n)throw new Error("Layout regions require a Layout");return n}function ps({children:n,notice:e,outsideOrg:s}){const i=ct(),[l,c]=Pe(We.sidebarOpen(),!0),r=ms();return t.jsx(Ye,{value:{isMobile:i,resize:r},children:t.jsx(st,{open:l,onOpenChange:c,children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,t.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!s&&t.jsx(ls,{}),!i&&(s?.rail??!0)&&t.jsx(Xe,{}),t.jsx(it,{ref:r.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${r.width}px`,"--sidebar-width-icon":"0px"},children:t.jsx(nt,{children:n})})]})]})})})}function xs(n){const e=H.c(36),{children:s,renderMobile:i}=n,l=U(),{isMobile:c,resize:r}=gs(),{openMobile:o,setOpenMobile:a}=He(),u=ke();let g;e[0]!==a?(g=()=>a(!1),e[0]=a,e[1]=g):g=e[1];const h=g;if(!c){let S;e[2]!==s||e[3]!==u?(S=t.jsx("div",{className:"contents",inert:u,children:s}),e[2]=s,e[3]=u,e[4]=S):S=e[4];let p;e[5]!==r.maxWidth||e[6]!==r.minWidth||e[7]!==r.onKeyDownResize||e[8]!==r.onStartResize||e[9]!==r.resetWidth||e[10]!==r.width?(p=t.jsx(us,{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,onPointerDown:r.onStartResize,onKeyDown:r.onKeyDownResize,onDoubleClick:r.resetWidth}),e[5]=r.maxWidth,e[6]=r.minWidth,e[7]=r.onKeyDownResize,e[8]=r.onStartResize,e[9]=r.resetWidth,e[10]=r.width,e[11]=p):p=e[11];let v;return e[12]!==S||e[13]!==p?(v=t.jsxs(t.Fragment,{children:[S,p]}),e[12]=S,e[13]=p,e[14]=v):v=e[14],v}let m;e[15]!==l?(m=l("layouts.shellControls.navigationTitle"),e[15]=l,e[16]=m):m=e[16];let f;e[17]!==m?(f=t.jsx(lt,{className:"sr-only",children:m}),e[17]=m,e[18]=f):f=e[18];let d;e[19]!==h?(d=t.jsx(Xe,{onNavigate:h}),e[19]=h,e[20]=d):d=e[20];let b;e[21]!==h||e[22]!==i?(b=i({onClose:h}),e[21]=h,e[22]=i,e[23]=b):b=e[23];let x;e[24]!==b?(x=t.jsx("div",{className:"min-w-0 flex-1",children:b}),e[24]=b,e[25]=x):x=e[25];let w;e[26]!==d||e[27]!==x?(w=t.jsxs("div",{className:"flex h-full min-h-0",children:[d,x]}),e[26]=d,e[27]=x,e[28]=w):w=e[28];let y;e[29]!==f||e[30]!==w?(y=t.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:bs,children:[f,w]}),e[29]=f,e[30]=w,e[31]=y):y=e[31];let j;return e[32]!==o||e[33]!==a||e[34]!==y?(j=t.jsx(at,{open:o,onOpenChange:a,children:y}),e[32]=o,e[33]=a,e[34]=y,e[35]=j):j=e[35],j}function bs(n){return n.preventDefault()}function js(n){const e=H.c(3),{children:s}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={background:"transparent",containerType:"inline-size"},e[0]=i):i=e[0];let l;return e[1]!==s?(l=t.jsx(rt,{className:"flex flex-col min-h-0",style:i,children:t.jsx(tt,{variant:"plain",className:"bg-sidebar",children:t.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=l):l=e[2],l}const Ws=Object.assign(ps,{Sidebar:xs,Content:js});export{Ws as L};
|
|
1
|
+
import{c as H,b as U,r as Y,m as B,j as t,a5 as Ke,d as Ge,aB as Je,l as Ve,H as Qe,ar as Pe,L as Me,$ as Ze,E as ge,at as We,aC as et,P as tt}from"./index-CcqLnTyv.js";import{u as ke,c as He,i as st,j as it,k as nt,l as rt}from"./use-sidebar-collapsed-B34u6RwD.js";import{S as lt,a as ot,b as at}from"./sheet-B2jsXlHJ.js";import{u as ct}from"./use-mobile-BgN1E82d.js";import{u as dt,a as ut,D as ft,c as mt,C as ht,P as gt}from"./core.esm-DkzVh4mV.js";import{S as pt,v as xt,u as bt}from"./sortable.esm-BHALCXRV.js";import{i as jt}from"./Tool01-BTDYOKsB.js";import{B as vt,A as yt,C as De,l as St}from"./agent-icon-DqjTL3cE.js";import{s as wt}from"./Plus-D8rFucQH.js";import{i as Ct}from"./UserSquare-BJHrMhrM.js";import{s as Ot}from"./XClose-BDiB_Nvo.js";import{a as pe,T as xe,c as be}from"./tooltip-AKf-E49i.js";import{C as Le,f as _t,g as zt,e as Rt}from"./context-menu-CmlGLO8r.js";import{a as Nt,O as Be,w as Tt,b as Lt,c as Et,E as Pt,r as we,d as kt,e as At,h as Dt,t as It,f as Fe,m as $t,o as Kt}from"./shell-layout-CBX9BtMX.js";import{C as Mt}from"./create-organization-dialog-_VIsUUpV.js";import{P as Wt}from"./project-apps-sFKq8oaX.js";import{u as Ht,a as Bt}from"./use-recent-apps-DD97o_H1.js";import{a as Ft}from"./use-navigate-to-agent-DmfSMV3R.js";import{a as Xt,u as Yt}from"./use-project-scope-Cb4T7-Pe.js";import{C as Ie,a as Ut,b as qt,c as Gt,d as Jt}from"./command-CtR4gjCr.js";import{u as Vt}from"./use-debounced-value-CcMMD4Qy.js";function Qt(n){const e=H.c(48),{open:s,onOpenChange:i,orgs:l,currentSlug:c,onSelect:r}=n,o=U(),[a,u]=Y.useState("");let g;e[0]!==a?(g=a.trim(),e[0]=a,e[1]=g):g=e[1];const h=g,m=Vt(h,150),f=h.length>0,d=m===h,{hits:b,isSearching:x,isStale:w,isError:y}=Nt(f?m:""),j=f?b:l;let S;e[2]!==i?(S=k=>{i(k),k||u("")},e[2]=i,e[3]=S):S=e[3];const p=S;let v;e[4]!==o?(v=o("sidebar.rail.searchOrganizations"),e[4]=o,e[5]=v):v=e[5];let C;e[6]!==o?(C=o("sidebar.rail.searchPlaceholder"),e[6]=o,e[7]=C):C=e[7];let N;e[8]!==o?(N=o("sidebar.rail.searchPlaceholder"),e[8]=o,e[9]=N):N=e[9];let O;e[10]!==a||e[11]!==N?(O=t.jsx(Ut,{value:a,onValueChange:u,placeholder:N}),e[10]=a,e[11]=N,e[12]=O):O=e[12];const P=f&&(w||!d)&&"opacity-50";let R;e[13]!==P?(R=B(P),e[13]=P,e[14]=R):R=e[14];let _;e[15]!==y||e[16]!==f||e[17]!==o?(_=f&&y&&t.jsx(Ie,{children:o("sidebar.rail.searchFailed")}),e[15]=y,e[16]=f,e[17]=o,e[18]=_):_=e[18];let T;e[19]!==y||e[20]!==x||e[21]!==j.length||e[22]!==d||e[23]!==o?(T=!y&&d&&!x&&j.length===0&&t.jsx(Ie,{children:o("sidebar.rail.searchEmpty")}),e[19]=y,e[20]=x,e[21]=j.length,e[22]=d,e[23]=o,e[24]=T):T=e[24];let L;if(e[25]!==c||e[26]!==r||e[27]!==p||e[28]!==j||e[29]!==o){let k;e[31]!==c||e[32]!==r||e[33]!==p||e[34]!==o?(k=A=>t.jsxs(qt,{value:A.slug,onSelect:()=>{p(!1),A.slug!==c&&r(A.slug)},className:"gap-2.5",children:[t.jsx(Be,{org:A,size:"sm"}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:A.name}),A.slug===c&&t.jsx("span",{className:"text-meta shrink-0",children:o("sidebar.rail.currentOrganization")})]},A.id),e[31]=c,e[32]=r,e[33]=p,e[34]=o,e[35]=k):k=e[35],L=j.map(k),e[25]=c,e[26]=r,e[27]=p,e[28]=j,e[29]=o,e[30]=L}else L=e[30];let z;e[36]!==T||e[37]!==L||e[38]!==R||e[39]!==_?(z=t.jsxs(Gt,{className:R,children:[_,T,L]}),e[36]=T,e[37]=L,e[38]=R,e[39]=_,e[40]=z):z=e[40];let D;return e[41]!==s||e[42]!==p||e[43]!==z||e[44]!==v||e[45]!==C||e[46]!==O?(D=t.jsxs(Jt,{open:s,onOpenChange:p,title:v,description:C,shouldFilter:!1,children:[O,z]}),e[41]=s,e[42]=p,e[43]=z,e[44]=v,e[45]=C,e[46]=O,e[47]=D):D=e[47],D}function Ce(n){const e=H.c(11),{active:s,label:i,children:l}=n,c=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let r;e[0]!==c?(r=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:t.jsx("span",{className:r})}),e[2]=r,e[3]=o):o=e[3];let a;e[4]!==s||e[5]!==i?(a=i&&t.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:i}),e[4]=s,e[5]=i,e[6]=a):a=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==a?(u=t.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[o,l,a]}),e[7]=l,e[8]=o,e[9]=a,e[10]=u):u=e[10],u}function Zt(n){return globalThis.addEventListener("resize",n),()=>globalThis.removeEventListener("resize",n)}const es=()=>Fe(globalThis.innerHeight),ts=()=>Fe(0);function ss(n){const e=H.c(59),{org:s,active:i,onSelect:l,pinned:c,onOpenSettings:r,onTogglePin:o,onHide:a}=n,u=U();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:h,listeners:m,transform:f,transition:d,isDragging:b}=bt(g);let x;e[2]!==f?(x=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=x):x=e[3];const w=b?1:void 0,y=`rail-org-${s.slug}`;let j;e[4]!==x||e[5]!==w||e[6]!==y||e[7]!==d?(j={transform:x,transition:d,zIndex:w,viewTransitionName:y},e[4]=x,e[5]=w,e[6]=y,e[7]=d,e[8]=j):j=e[8];const S=s.name,p=i||void 0,v=i?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",C=l&&"cursor-pointer";let N;e[9]!==v||e[10]!==C?(N=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,C),e[9]=v,e[10]=C,e[11]=N):N=e[11];let O;e[12]!==s?(O=t.jsx(Be,{org:s,size:"lg"}),e[12]=s,e[13]=O):O=e[13];let P;e[14]!==c?(P=c&&t.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:t.jsx(De,{size:9})}),e[14]=c,e[15]=P):P=e[15];let R;e[16]!==l||e[17]!==s.name||e[18]!==N||e[19]!==O||e[20]!==P||e[21]!==p?(R=t.jsx(xe,{asChild:!0,children:t.jsx(_t,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":S,"aria-current":p,onClick:l,className:N,children:[O,P]})})}),e[16]=l,e[17]=s.name,e[18]=N,e[19]=O,e[20]=P,e[21]=p,e[22]=R):R=e[22];let _;e[23]!==s.name?(_=t.jsx(pe,{side:"right",children:s.name}),e[23]=s.name,e[24]=_):_=e[24];let T;e[25]!==R||e[26]!==_?(T=t.jsxs(be,{children:[R,_]}),e[25]=R,e[26]=_,e[27]=T):T=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(St,{}),e[28]=L):L=e[28];let z;e[29]!==u?(z=u("sidebar.rail.organizationSettings"),e[29]=u,e[30]=z):z=e[30];let D;e[31]!==r||e[32]!==z?(D=t.jsxs(Le,{onSelect:r,children:[L,z]}),e[31]=r,e[32]=z,e[33]=D):D=e[33];let k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(De,{}),e[34]=k):k=e[34];let A;e[35]!==c||e[36]!==u?(A=u(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=u,e[37]=A):A=e[37];let K;e[38]!==o||e[39]!==A?(K=t.jsxs(Le,{onSelect:o,children:[k,A]}),e[38]=o,e[39]=A,e[40]=K):K=e[40];let M;e[41]!==a||e[42]!==u?(M=a&&t.jsxs(Le,{onSelect:a,children:[t.jsx(jt,{}),u("sidebar.rail.hideOrganization")]}),e[41]=a,e[42]=u,e[43]=M):M=e[43];let F;e[44]!==D||e[45]!==K||e[46]!==M?(F=t.jsxs(zt,{children:[D,K,M]}),e[44]=D,e[45]=K,e[46]=M,e[47]=F):F=e[47];let $;e[48]!==T||e[49]!==F?($=t.jsxs(Rt,{children:[T,F]}),e[48]=T,e[49]=F,e[50]=$):$=e[50];let W;e[51]!==i||e[52]!==$?(W=t.jsx(Ce,{active:i,children:$}),e[51]=i,e[52]=$,e[53]=W):W=e[53];let X;return e[54]!==m||e[55]!==h||e[56]!==W||e[57]!==j?(X=t.jsx("div",{ref:h,...m,style:j,className:"w-full shrink-0 touch-none",children:W}),e[54]=m,e[55]=h,e[56]=W,e[57]=j,e[58]=X):X=e[58],X}function is(n){const e=H.c(64),{project:s,orgSlug:i,active:l,onClose:c,onNavigate:r}=n,o=U();let a,u,g,h,m,f,d,b,x,w,y;if(e[0]!==l||e[1]!==r||e[2]!==i||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const k=vt(s.icon,s.title);y="group/rail relative flex w-full flex-col items-center gap-1",g=be,u=xe,w=!0,a=Me,h=Ze.root,e[17]!==i||e[18]!==s.id?(m={org:i,agentId:s.id},e[17]=i,e[18]=s.id,e[19]=m):m=e[19],f=s.title,d=l||void 0,e[20]!==r?(b=()=>{ge("org_rail_recent_project_opened"),r?.()},e[20]=r,e[21]=b):b=e[21],x=B("flex shrink-0 rounded-lg focus-ring",k.text,l&&"ring-[1.5px] ring-current"),e[0]=l,e[1]=r,e[2]=i,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=a,e[7]=u,e[8]=g,e[9]=h,e[10]=m,e[11]=f,e[12]=d,e[13]=b,e[14]=x,e[15]=w,e[16]=y}else a=e[6],u=e[7],g=e[8],h=e[9],m=e[10],f=e[11],d=e[12],b=e[13],x=e[14],w=e[15],y=e[16];let j;e[22]!==s.icon||e[23]!==s.title?(j=t.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=j):j=e[24];let S;e[25]!==a||e[26]!==h||e[27]!==m||e[28]!==f||e[29]!==d||e[30]!==b||e[31]!==x||e[32]!==j?(S=t.jsx(a,{to:h,params:m,"aria-label":f,"aria-current":d,onClick:b,className:x,children:j}),e[25]=a,e[26]=h,e[27]=m,e[28]=f,e[29]=d,e[30]=b,e[31]=x,e[32]=j,e[33]=S):S=e[33];let p;e[34]!==u||e[35]!==S||e[36]!==w?(p=t.jsx(u,{asChild:w,children:S}),e[34]=u,e[35]=S,e[36]=w,e[37]=p):p=e[37];let v;e[38]!==s.title?(v=t.jsx(pe,{side:"right",children:s.title}),e[38]=s.title,e[39]=v):v=e[39];let C;e[40]!==g||e[41]!==p||e[42]!==v?(C=t.jsxs(g,{children:[p,v]}),e[40]=g,e[41]=p,e[42]=v,e[43]=C):C=e[43];const N=l?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let O;e[44]!==N?(O=B("line-clamp-2 w-full text-center text-2xs break-words transition-colors",N),e[44]=N,e[45]=O):O=e[45];let P;e[46]!==s.title||e[47]!==O?(P=t.jsx("span",{"aria-hidden":!0,className:O,children:s.title}),e[46]=s.title,e[47]=O,e[48]=P):P=e[48];let R;e[49]!==s.title||e[50]!==o?(R=o("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=o,e[51]=R):R=e[51];let _;e[52]!==c?(_=()=>{ge("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=_):_=e[53];let T,L;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=B("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),L=t.jsx(Ot,{size:10}),e[54]=T,e[55]=L):(T=e[54],L=e[55]);let z;e[56]!==R||e[57]!==_?(z=t.jsx("button",{type:"button","aria-label":R,onClick:_,className:T,children:L}),e[56]=R,e[57]=_,e[58]=z):z=e[58];let D;return e[59]!==C||e[60]!==P||e[61]!==z||e[62]!==y?(D=t.jsxs("div",{className:y,children:[C,P,z]}),e[59]=C,e[60]=P,e[61]=z,e[62]=y,e[63]=D):D=e[63],D}const ns={"site-editor":"/site-editor"};function rs(n){const e=H.c(26),{app:s}=n,i=U(),l=Wt[s],c=ns[s];if(!l||!c)return null;let r;e[0]!==l.labelKey||e[1]!==i?(r=i(l.labelKey),e[0]=l.labelKey,e[1]=i,e[2]=r):r=e[2];let o;e[3]!==l.labelKey||e[4]!==i?(o=i(l.labelKey),e[3]=l.labelKey,e[4]=i,e[5]=o):o=e[5];let a;e[6]!==l.tone?(a=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",l.tone),e[6]=l.tone,e[7]=a):a=e[7];let u;e[8]!==l.Icon?(u=t.jsx(l.Icon,{size:18}),e[8]=l.Icon,e[9]=u):u=e[9];let g;e[10]!==o||e[11]!==a||e[12]!==u||e[13]!==c?(g=t.jsx(xe,{asChild:!0,children:t.jsx(Me,{to:c,"aria-label":o,"aria-current":"page","data-testid":"org-rail-local-app",className:a,children:u})}),e[10]=o,e[11]=a,e[12]=u,e[13]=c,e[14]=g):g=e[14];let h;e[15]!==l.labelKey||e[16]!==i?(h=i(l.labelKey),e[15]=l.labelKey,e[16]=i,e[17]=h):h=e[17];let m;e[18]!==h?(m=t.jsx(pe,{side:"right",children:h}),e[18]=h,e[19]=m):m=e[19];let f;e[20]!==g||e[21]!==m?(f=t.jsxs(be,{children:[g,m]}),e[20]=g,e[21]=m,e[22]=f):f=e[22];let d;return e[23]!==r||e[24]!==f?(d=t.jsx(Ce,{active:!0,label:r,children:f}),e[23]=r,e[24]=f,e[25]=d):d=e[25],d}function ls(){const{org:n}=Ke();return Ht(n.slug),null}function Xe(n){const e=H.c(76),{onNavigate:s}=n===void 0?{}:n,i=U(),l=Ge(),{org:c}=Ke(),r=Je();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ds},e[0]=o):o=e[0];const a=Ve(o);let u;e[1]!==a||e[2]!==r?(u=a?r({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=a,e[2]=r,e[3]=u):u=e[3];const g=u,h=g?g.org:c.slug,{data:m}=Qe(),[f,d]=Y.useState(!1),[b,x]=Y.useState(!1),w=ke(),{recent:y,forget:j}=Ft(c.slug),{projects:S}=Xt(),p=Yt(),v=Bt(),C=v&&v.projectId===null?v.app:null,N=C?[]:y.flatMap(E=>S.filter(I=>I.id===E)),O=Tt(m??[],c),{recent:P}=Lt(),R=Et();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=We.railOrgPrefs(),e[4]=_):_=e[4];const[T,L]=Pe(_,Pt),z=we(T),D=Y.useSyncExternalStore(Zt,es,ts),{shown:k}=kt(At(O,z,c.slug),P,c.slug,D,z.pinned);let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A={activationConstraint:{distance:8}},e[5]=A):A=e[5];const K=dt(ut(gt,A)),M=E=>{const{active:I,over:Ae}=E;Ae&&(ge("org_rail_reordered"),L(qe=>$t(we(qe),k.map(cs),String(I.id),String(Ae.id))))},F=E=>{s?.(),l({to:"/$org/home",params:{org:E},viewTransition:!0})},$=E=>{ge("org_rail_travel"),s?.(),R(E,k.map(as))},W=()=>{if(ge("org_rail_search_opened"),!c.id){x(!0);return}s?.(),Kt()},X=!w&&"border-r border-sidebar-border";let q;e[6]!==X?(q=B("flex w-[68px] shrink-0 flex-col bg-sidebar",X),e[6]=X,e[7]=q):q=e[7];const Ue="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let G;e[8]!==i?(G=i("sidebar.rail.ariaLabel"),e[8]=i,e[9]=G):G=e[9];const Oe=ft,_e=mt,ze=pt,Re=k.map(os),Ne=xt,Te=k.map(E=>t.jsxs(Y.Fragment,{children:[t.jsx(ss,{org:E,active:E.slug===h,pinned:z.pinned.includes(E.slug),onSelect:E.slug!==c.slug?()=>$(E.slug):p?()=>F(E.slug):void 0,onOpenSettings:()=>{s?.(),l({to:"/$org/settings",params:{org:E.slug}})},onTogglePin:()=>L(I=>It(we(I),E.slug)),onHide:E.slug===c.slug?void 0:()=>L(I=>Dt(we(I),E.slug))}),E.slug===c.slug&&N.length>0&&t.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:N.map(I=>t.jsx(is,{project:I,orgSlug:c.slug,active:p===I.id,onClose:()=>j(I.id),onNavigate:s},I.id))})]},E.id));let J;e[10]!==ze||e[11]!==Re||e[12]!==Ne||e[13]!==Te?(J=t.jsx(ze,{items:Re,strategy:Ne,children:Te}),e[10]=ze,e[11]=Re,e[12]=Ne,e[13]=Te,e[14]=J):J=e[14];let V;e[15]!==Oe||e[16]!==M||e[17]!==K||e[18]!==_e||e[19]!==J?(V=t.jsx(Oe,{sensors:K,collisionDetection:_e,onDragEnd:M,children:J}),e[15]=Oe,e[16]=M,e[17]=K,e[18]=_e,e[19]=J,e[20]=V):V=e[20];let Q;e[21]!==C?(Q=C&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),t.jsx(rs,{app:C})]}),e[21]=C,e[22]=Q):Q=e[22];let Z;e[23]!==V||e[24]!==Q||e[25]!==G?(Z=t.jsxs("div",{className:Ue,"aria-label":G,children:[V,Q]}),e[23]=V,e[24]=Q,e[25]=G,e[26]=Z):Z=e[26];let ee;e[27]!==i?(ee=i("sidebar.rail.search"),e[27]=i,e[28]=ee):ee=e[28];let je;e[29]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx(Ct,{size:18}),e[29]=je):je=e[29];let te;e[30]!==W||e[31]!==ee?(te=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":ee,"aria-keyshortcuts":"Meta+K Control+K",onClick:W,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:je})}),e[30]=W,e[31]=ee,e[32]=te):te=e[32];let se;e[33]!==i?(se=i("sidebar.rail.search"),e[33]=i,e[34]=se):se=e[34];let ve;e[35]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("span",{className:"ml-2 text-muted-foreground",children:et.commandPalette.keys.join("")}),e[35]=ve):ve=e[35];let ie;e[36]!==se?(ie=t.jsxs(pe,{side:"right",children:[se,ve]}),e[36]=se,e[37]=ie):ie=e[37];let ne;e[38]!==te||e[39]!==ie?(ne=t.jsx(Ce,{active:!1,children:t.jsxs(be,{children:[te,ie]})}),e[38]=te,e[39]=ie,e[40]=ne):ne=e[40];let re;e[41]!==i?(re=i("sidebar.picker.newOrganization"),e[41]=i,e[42]=re):re=e[42];let le;e[43]!==d?(le=()=>d(!0),e[43]=d,e[44]=le):le=e[44];let ye;e[45]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(wt,{size:18}),e[45]=ye):ye=e[45];let oe;e[46]!==re||e[47]!==le?(oe=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":re,onClick:le,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:ye})}),e[46]=re,e[47]=le,e[48]=oe):oe=e[48];let ae;e[49]!==i?(ae=i("sidebar.picker.newOrganization"),e[49]=i,e[50]=ae):ae=e[50];let ce;e[51]!==ae?(ce=t.jsx(pe,{side:"right",children:ae}),e[51]=ae,e[52]=ce):ce=e[52];let de;e[53]!==oe||e[54]!==ce?(de=t.jsx(Ce,{active:!1,children:t.jsxs(be,{children:[oe,ce]})}),e[53]=oe,e[54]=ce,e[55]=de):de=e[55];let ue;e[56]!==ne||e[57]!==de?(ue=t.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ne,de]}),e[56]=ne,e[57]=de,e[58]=ue):ue=e[58];let fe;e[59]!==Z||e[60]!==ue||e[61]!==q?(fe=t.jsxs("div",{className:q,children:[Z,ue]}),e[59]=Z,e[60]=ue,e[61]=q,e[62]=fe):fe=e[62];let me;e[63]!==c.slug||e[64]!==O||e[65]!==b||e[66]!==x||e[67]!==$?(me=t.jsx(Qt,{open:b,onOpenChange:x,orgs:O,currentSlug:c.slug,onSelect:$}),e[63]=c.slug,e[64]=O,e[65]=b,e[66]=x,e[67]=$,e[68]=me):me=e[68];let he;e[69]!==f||e[70]!==d?(he=t.jsx(Mt,{open:f,onOpenChange:d}),e[69]=f,e[70]=d,e[71]=he):he=e[71];let Se;return e[72]!==fe||e[73]!==me||e[74]!==he?(Se=t.jsxs(t.Fragment,{children:[fe,me,he]}),e[72]=fe,e[73]=me,e[74]=he,e[75]=Se):Se=e[75],Se}function os(n){return n.slug}function as(n){return n.slug}function cs(n){return n.slug}function ds(n){return n.isLoading}function us(n){const e=H.c(15),{width:s,minWidth:i,maxWidth:l,onPointerDown:c,onKeyDown:r,onDoubleClick:o}=n,a=U(),{isMobile:u}=He(),g=ke();if(u||g)return null;let h;e[0]!==a?(h=a("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=a,e[1]=h):h=e[1];let m;e[2]!==a?(m=a("sidebar.sidebarResizeHandle.title"),e[2]=a,e[3]=m):m=e[3];let f,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},d=t.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=d):(f=e[4],d=e[5]);let b;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==r||e[10]!==c||e[11]!==h||e[12]!==m||e[13]!==s?(b=t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":s,"aria-valuemin":i,"aria-valuemax":l,title:m,tabIndex:0,onPointerDown:c,onKeyDown:r,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:d}),e[6]=l,e[7]=i,e[8]=o,e[9]=r,e[10]=c,e[11]=h,e[12]=m,e[13]=s,e[14]=b):b=e[14],b}const Ee=400,$e=16,fs="sidebar.width.v2";function ms(){const n=H.c(14),e=hs;let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=d=>typeof d=="number"?e(d):192,n[0]=s):s=n[0];const[i,l]=Pe(fs,s),c=Y.useRef(null);let r;n[1]!==l||n[2]!==i?(r=d=>{d.preventDefault();const b=d.clientX,x=e(i),w=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),y=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of y)p.style.transition="none";const j=p=>{const v=e(x+(p.clientX-b));w?.style.setProperty("--sidebar-width",`${v}px`)},S=p=>{const v=e(x+(p.clientX-b));l(v);for(const C of y)C.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},n[1]=l,n[2]=i,n[3]=r):r=n[3];const o=r;let a;n[4]!==l?(a=()=>{l(192)},n[4]=l,n[5]=a):a=n[5];const u=a;let g;n[6]!==l||n[7]!==i?(g=d=>{if(d.key==="ArrowLeft")l(e(i-$e));else if(d.key==="ArrowRight")l(e(i+$e));else if(d.key==="Home")l(192);else if(d.key==="End")l(Ee);else return;d.preventDefault()},n[6]=l,n[7]=i,n[8]=g):g=n[8];const h=g,m=e(i);let f;return n[9]!==h||n[10]!==o||n[11]!==u||n[12]!==m?(f={width:m,minWidth:192,maxWidth:Ee,wrapperRef:c,onStartResize:o,onKeyDownResize:h,resetWidth:u},n[9]=h,n[10]=o,n[11]=u,n[12]=m,n[13]=f):f=n[13],f}function hs(n){return Math.max(192,Math.min(Ee,n))}const Ye=Y.createContext(null);function gs(){const n=Y.use(Ye);if(!n)throw new Error("Layout regions require a Layout");return n}function ps({children:n,notice:e,outsideOrg:s}){const i=ct(),[l,c]=Pe(We.sidebarOpen(),!0),r=ms();return t.jsx(Ye,{value:{isMobile:i,resize:r},children:t.jsx(st,{open:l,onOpenChange:c,children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,t.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!s&&t.jsx(ls,{}),!i&&(s?.rail??!0)&&t.jsx(Xe,{}),t.jsx(it,{ref:r.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${r.width}px`,"--sidebar-width-icon":"0px"},children:t.jsx(nt,{children:n})})]})]})})})}function xs(n){const e=H.c(36),{children:s,renderMobile:i}=n,l=U(),{isMobile:c,resize:r}=gs(),{openMobile:o,setOpenMobile:a}=He(),u=ke();let g;e[0]!==a?(g=()=>a(!1),e[0]=a,e[1]=g):g=e[1];const h=g;if(!c){let S;e[2]!==s||e[3]!==u?(S=t.jsx("div",{className:"contents",inert:u,children:s}),e[2]=s,e[3]=u,e[4]=S):S=e[4];let p;e[5]!==r.maxWidth||e[6]!==r.minWidth||e[7]!==r.onKeyDownResize||e[8]!==r.onStartResize||e[9]!==r.resetWidth||e[10]!==r.width?(p=t.jsx(us,{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,onPointerDown:r.onStartResize,onKeyDown:r.onKeyDownResize,onDoubleClick:r.resetWidth}),e[5]=r.maxWidth,e[6]=r.minWidth,e[7]=r.onKeyDownResize,e[8]=r.onStartResize,e[9]=r.resetWidth,e[10]=r.width,e[11]=p):p=e[11];let v;return e[12]!==S||e[13]!==p?(v=t.jsxs(t.Fragment,{children:[S,p]}),e[12]=S,e[13]=p,e[14]=v):v=e[14],v}let m;e[15]!==l?(m=l("layouts.shellControls.navigationTitle"),e[15]=l,e[16]=m):m=e[16];let f;e[17]!==m?(f=t.jsx(lt,{className:"sr-only",children:m}),e[17]=m,e[18]=f):f=e[18];let d;e[19]!==h?(d=t.jsx(Xe,{onNavigate:h}),e[19]=h,e[20]=d):d=e[20];let b;e[21]!==h||e[22]!==i?(b=i({onClose:h}),e[21]=h,e[22]=i,e[23]=b):b=e[23];let x;e[24]!==b?(x=t.jsx("div",{className:"min-w-0 flex-1",children:b}),e[24]=b,e[25]=x):x=e[25];let w;e[26]!==d||e[27]!==x?(w=t.jsxs("div",{className:"flex h-full min-h-0",children:[d,x]}),e[26]=d,e[27]=x,e[28]=w):w=e[28];let y;e[29]!==f||e[30]!==w?(y=t.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:bs,children:[f,w]}),e[29]=f,e[30]=w,e[31]=y):y=e[31];let j;return e[32]!==o||e[33]!==a||e[34]!==y?(j=t.jsx(at,{open:o,onOpenChange:a,children:y}),e[32]=o,e[33]=a,e[34]=y,e[35]=j):j=e[35],j}function bs(n){return n.preventDefault()}function js(n){const e=H.c(3),{children:s}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={background:"transparent",containerType:"inline-size"},e[0]=i):i=e[0];let l;return e[1]!==s?(l=t.jsx(rt,{className:"flex flex-col min-h-0",style:i,children:t.jsx(tt,{variant:"plain",className:"bg-sidebar",children:t.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=l):l=e[2],l}const Ws=Object.assign(ps,{Sidebar:xs,Content:js});export{Ws as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,a5 as h,gX as d,j as g,N as m,af as p,a2 as j}from"./index-
|
|
1
|
+
import{c as f,a5 as h,gX as d,j as g,N as m,af as p,a2 as j}from"./index-CcqLnTyv.js";import{L as v}from"./legacy-main-redirect-KlovZkVM.js";import"./thread-route-D5E5K-lU.js";const x=j("/shell/$org/org-shell/");function L(){const t=f.c(19),{org:a}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let e;t[0]!==i||t[1]!==a.slug||t[2]!==l||t[3]!==o?(e=d({org:a.slug,agentId:o,main:i,search:l}),t[0]=i,t[1]=a.slug,t[2]=l,t[3]=o,t[4]=e):e=t[4];const s=e;if(s?.kind==="canonical"){let r;return t[5]!==s?(r=g.jsx(v,{target:s}),t[5]=s,t[6]=r):r=t[6],r}}let n;t[7]!==o?(n=o?.trim()||null,t[7]=o,t[8]=n):n=t[8];const u=n;if(u){let e;t[9]!==a.slug||t[10]!==u?(e={org:a.slug,agentId:u},t[9]=a.slug,t[10]=u,t[11]=e):e=t[11];let s;t[12]!==l?(s={...l,virtualmcpid:void 0},t[12]=l,t[13]=s):s=t[13];let r;return t[14]!==e||t[15]!==s?(r=g.jsx(m,{to:p.projects,params:e,search:s,hash:!0,replace:!0}),t[14]=e,t[15]=s,t[16]=r):r=t[16],r}let c;return t[17]!==a.slug?(c=g.jsx(m,{to:p.home,params:{org:a.slug},search:N,hash:!0,replace:!0}),t[17]=a.slug,t[18]=c):c=t[18],c}function N(t){return{...t,virtualmcpid:void 0}}export{L as default};
|