decocms 4.535.0 → 4.535.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-D7qvNsrj.js → ActiveShapeUtils-DU-J2JOI.js} +1 -1
- package/dist/client/assets/{AlertCircle-h7CqbZc4.js → AlertCircle-CQDuYbHx.js} +1 -1
- package/dist/client/assets/{AreaChart-D-NUwbVj.js → AreaChart-BAfvTawV.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D1aeCElv.js → ArrowLeft-CQV-OFXB.js} +1 -1
- package/dist/client/assets/{ArrowUp-kvfi1BA-.js → ArrowUp-BoU1ERbw.js} +1 -1
- package/dist/client/assets/{BarChart-BkyfeCAj.js → BarChart--Ja0-zvd.js} +1 -1
- package/dist/client/assets/{Building02-BPLVFm4s.js → Building02-BIRm8BPt.js} +1 -1
- package/dist/client/assets/{CartesianChart-CCQ9R-g2.js → CartesianChart-5_Kpllvp.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BKERzdnn.js → CategoricalChart-C4G7a2u4.js} +1 -1
- package/dist/client/assets/{CheckCircle-BW7x42OJ.js → CheckCircle-D3D41Pik.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-EacCcohh.js → ChevronSelectorVertical-BsI2BvZW.js} +1 -1
- package/dist/client/assets/{ChevronUp-BZS5K0sE.js → ChevronUp-DWPDxPyO.js} +1 -1
- package/dist/client/assets/{Copy01-BgR3A9bu.js → Copy01-DS9lGb58.js} +1 -1
- package/dist/client/assets/{CreditCard01-BX1DsWKy.js → CreditCard01-hd-oFdcf.js} +1 -1
- package/dist/client/assets/{DotsVertical-DRqYjcEJ.js → DotsVertical-r0-ueEFT.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BQrbyX9T.js → ErrorBarContext-C6hvNFGf.js} +1 -1
- package/dist/client/assets/{Globe04-C6T-v1E1.js → Globe04-ChxDgA5I.js} +1 -1
- package/dist/client/assets/{Image01-DemwGDZp.js → Image01-Cvoerggt.js} +1 -1
- package/dist/client/assets/{Key01-yOdxx1sq.js → Key01-DngMmJw0.js} +1 -1
- package/dist/client/assets/{Link01-DQotNCgV.js → Link01-BAoePdIy.js} +1 -1
- package/dist/client/assets/{LinkBroken01-c1btH10E.js → LinkBroken01-CR5rvaUu.js} +1 -1
- package/dist/client/assets/{Minus-UcZ_8vud.js → Minus-C3iyYMPp.js} +1 -1
- package/dist/client/assets/{Monitor01-DDw29wMJ.js → Monitor01-3T2xT1z_.js} +1 -1
- package/dist/client/assets/{Play-BXAkytjF.js → Play-FJBV2LIw.js} +1 -1
- package/dist/client/assets/{Plus-BtmzbqvB.js → Plus-B0PQxljQ.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DylQl7dL.js → ReferenceLine-CbAHGoP6.js} +1 -1
- package/dist/client/assets/{SearchMd-CKk9nYcQ.js → SearchMd-CMexoeE6.js} +1 -1
- package/dist/client/assets/{Sector-DCllPuEx.js → Sector-CTb-njCu.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-D-Zbzi6Y.js → ShoppingBag01-BXOuVd17.js} +1 -1
- package/dist/client/assets/{Sun-CDq9V0s9.js → Sun-Co7E93aF.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BPjNUu0G.js → SwitchHorizontal01-zY1Mo909.js} +1 -1
- package/dist/client/assets/{Tool01-BhPghDfH.js → Tool01-CeUuQ3Bv.js} +1 -1
- package/dist/client/assets/{Trash01-PBDL2Ian.js → Trash01-BbOQUio8.js} +1 -1
- package/dist/client/assets/{Upload01-CpMwTjPo.js → Upload01-nRiRcfq_.js} +1 -1
- package/dist/client/assets/{UserSquare-TLzz_r-8.js → UserSquare-BpxduWsZ.js} +1 -1
- package/dist/client/assets/{Users01-C5lPBi9w.js → Users01-DK48xnSB.js} +1 -1
- package/dist/client/assets/{XClose-DnlVgLPc.js → XClose-Cjq1Yd0C.js} +1 -1
- package/dist/client/assets/{ZoomOut-BUzePeS3.js → ZoomOut-OKmGcwkm.js} +1 -1
- package/dist/client/assets/{access-gate-Bb8cNo-7.js → access-gate-CqqLCVpV.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Jb5UqRgL.js → add-connection-dialog-DeIX0b2D.js} +1 -1
- package/dist/client/assets/{agent-analytics-Cf50Iml2.js → agent-analytics-Cmkjb_bu.js} +1 -1
- package/dist/client/assets/agent-app-B-0K9MrS.js +1 -0
- package/dist/client/assets/{agent-assets-DwRP8tfn.js → agent-assets-C1XaCHII.js} +1 -1
- package/dist/client/assets/{agent-automation-UPKLRS5O.js → agent-automation-DONBp14w.js} +1 -1
- package/dist/client/assets/{agent-automations-Bf0bbZdV.js → agent-automations-B1HeLxEj.js} +1 -1
- package/dist/client/assets/{agent-calendar-BE3ZoYz2.js → agent-calendar-BANmAd_K.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BLaCODek.js → agent-connect-sources-r4XwHFC0.js} +1 -1
- package/dist/client/assets/agent-deck-R-kKxQys.js +1 -0
- package/dist/client/assets/{agent-e2e-faKK8MA8.js → agent-e2e-B1UYj0m9.js} +1 -1
- package/dist/client/assets/agent-experiments-BmjNIO9y.js +1 -0
- package/dist/client/assets/{agent-file-CMy4kfgR.js → agent-file-C7jjD_-6.js} +1 -1
- package/dist/client/assets/{agent-hosting-C3SD9R34.js → agent-hosting-9GGZyn-F.js} +1 -1
- package/dist/client/assets/{agent-icon-C43vsTCs.js → agent-icon-C6UYAbL1.js} +1 -1
- package/dist/client/assets/agent-library-Cb4N5dkP.js +1 -0
- package/dist/client/assets/agent-library-file-B-WrdQNg.js +1 -0
- package/dist/client/assets/agent-monitor-DHV5ahU9.js +1 -0
- package/dist/client/assets/{agent-overview-Dg7f2fHn.js → agent-overview-CVASmjvD.js} +1 -1
- package/dist/client/assets/{agent-releases-Bf4I7Hek.js → agent-releases-_Y5af5qx.js} +1 -1
- package/dist/client/assets/agent-settings-DpgtFOoh.js +1 -0
- package/dist/client/assets/agent-site-editor-code-ChijPX-0.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Dz5ZGCox.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DEfLPOFy.js +1 -0
- package/dist/client/assets/{agent-site-editor-DPHf-V4N.js → agent-site-editor-wpPWtVyI.js} +1 -1
- package/dist/client/assets/agent-view-CfbooWpf.js +1 -0
- package/dist/client/assets/{agent-view-guard-C52gcr5j.js → agent-view-guard-cYyvkfs1.js} +1 -1
- package/dist/client/assets/{agents-list-BzP-jThW.js → agents-list-NALo8ZUC.js} +1 -1
- package/dist/client/assets/{ai-providers-fEsvnId7.js → ai-providers-5oTeVo-Z.js} +1 -1
- package/dist/client/assets/{alert-jtk8bhst.js → alert-BmUX_3YW.js} +1 -1
- package/dist/client/assets/{analytics-sections-DKQvRCtq.js → analytics-sections-lL3oTQKk.js} +1 -1
- package/dist/client/assets/{api-keys-MvsyI87R.js → api-keys-BSJ-1hs6.js} +1 -1
- package/dist/client/assets/api-keys-CECA-P47.js +1 -0
- package/dist/client/assets/{app-editor-DumMAteQ.js → app-editor-CvD75myL.js} +1 -1
- package/dist/client/assets/{asset-utils-en14Y63W.js → asset-utils-g7JZN6Jx.js} +1 -1
- package/dist/client/assets/{auth-CSe1VqaK.js → auth-DslO7-2v.js} +1 -1
- package/dist/client/assets/{auth-catchall-P9pcT3uN.js → auth-catchall-Cw78J41z.js} +1 -1
- package/dist/client/assets/{auth-entry-DptUU-KH.js → auth-entry-DUYYn-qd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-MR6RaWg8.js → auth-split-layout-CZrx7xH8.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-2gkgug8h.js → authenticate-and-persist-oauth-_2Sr61D2.js} +1 -1
- package/dist/client/assets/{automation-list-row-yUxK9A_c.js → automation-list-row-hzcyGRPw.js} +1 -1
- package/dist/client/assets/{automation-runs-IS37NY8Q.js → automation-runs-CRbIzYY9.js} +1 -1
- package/dist/client/assets/{automations-Cl9OOxjF.js → automations-nVMFN19-.js} +1 -1
- package/dist/client/assets/{autosend-DAw2R789.js → autosend-CEM0KXFN.js} +1 -1
- package/dist/client/assets/{badge-BZz5g910.js → badge-CX1RcN27.js} +1 -1
- package/dist/client/assets/{block-document-CnN3SLBE.js → block-document-DGPQ_Cd0.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CJzuCmzI.js → blocks-preview-workspace-context-CkQBueEd.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BUsqtXKs.js → blocks-tab-states-WjUIQWw0.js} +1 -1
- package/dist/client/assets/{blog-schema-mbkiAQjv.js → blog-schema-C4-hWPG4.js} +1 -1
- package/dist/client/assets/{buckets-DcyUPR4L.js → buckets-DLFo9Vtm.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-ClfZ_sHC.js → build-improve-prompt-doc-nxm2S5Pu.js} +1 -1
- package/dist/client/assets/{calendar-DNX-y5sv.js → calendar-Chh-3FJ-.js} +1 -1
- package/dist/client/assets/{capability-load-error-bvnDyd4a.js → capability-load-error-BVE_zx9d.js} +1 -1
- package/dist/client/assets/{category-editor-DCxX7FGC.js → category-editor-DmJX1r_b.js} +1 -1
- package/dist/client/assets/{cdn-tab-DRYAdcEv.js → cdn-tab-BL72vemH.js} +1 -1
- package/dist/client/assets/{chart-DGXwd4Jz.js → chart-DnbaqPhj.js} +1 -1
- package/dist/client/assets/{chat-context-9RCHH93Q.js → chat-context-sl1KTpQd.js} +1 -1
- package/dist/client/assets/{chat-draft-BaRF4CRI.js → chat-draft-LiDr80Vh.js} +1 -1
- package/dist/client/assets/{checkbox-D8I8sdEP.js → checkbox-B4why7U2.js} +1 -1
- package/dist/client/assets/{choose-editor-BbFmFIBH.js → choose-editor-3gjjlo_q.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CgxczXNS.js → cli-auth-success-B7fgkWWJ.js} +1 -1
- package/dist/client/assets/{client-icons-CY1c5MEM.js → client-icons-D6YU6guR.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-B3ayuuyr.js → cms-settings-editor-sv1gPV42.js} +1 -1
- package/dist/client/assets/{collapsible-DXiOWhJA.js → collapsible-DzbXktcT.js} +1 -1
- package/dist/client/assets/{collection-detail-Dah_OIWq.js → collection-detail-B1OMoSQJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-B4mRdVtH.js → collection-display-button-CbSoCk_e.js} +1 -1
- package/dist/client/assets/{collection-search-6Ow5M6mo.js → collection-search-BcqK6hVT.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cht_r_Mb.js → collection-table-wrapper-BS_BGGVq.js} +1 -1
- package/dist/client/assets/{collection-tabs-BOiDA_ZP.js → collection-tabs-OauVxAju.js} +1 -1
- package/dist/client/assets/{column-rules-CyQYsCm2.js → column-rules-C2q_2RPU.js} +1 -1
- package/dist/client/assets/{combobox-go7fYj_7.js → combobox-CmwkyFSn.js} +1 -1
- package/dist/client/assets/{command-DcKpfmPL.js → command-BNuC9MU2.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-SxBTAQxY.js → companion-mcps-section-AmKV3Vuy.js} +1 -1
- package/dist/client/assets/{config-D8svKpbW.js → config-DgWxtnKx.js} +1 -1
- package/dist/client/assets/{connect-C-1CGl5m.js → connect-DiSbmmkN.js} +1 -1
- package/dist/client/assets/{connect-layout-BdR7muo1.js → connect-layout-Cq7Hrzmu.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Dg3ZgaVY.js → connect-source-dialog-Bgo11B0N.js} +1 -1
- package/dist/client/assets/{connection-CSue-IVc.js → connection-3GzCgGT8.js} +1 -1
- package/dist/client/assets/{connection-card-CsGgE996.js → connection-card-dJ4rD6pz.js} +1 -1
- package/dist/client/assets/{connection-detail-Dvr86oBD.js → connection-detail-D1Tls69P.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dto5qDcq.js → connection-form-helpers-DyowCZUL.js} +1 -1
- package/dist/client/assets/{connections-Big96-pY.js → connections-CDf312Ng.js} +1 -1
- package/dist/client/assets/{content-tab-BCEzKPpb.js → content-tab-Cgo1MlY7.js} +3 -3
- package/dist/client/assets/{context-nD4A3QXp.js → context-Ch90QvXc.js} +1 -1
- package/dist/client/assets/{context-menu-eDfGyhE1.js → context-menu-C1CiSvLI.js} +1 -1
- package/dist/client/assets/{context-shell-BEBXs_qa.js → context-shell-C1LeAlI_.js} +3 -3
- package/dist/client/assets/{core.esm-eT1Gixd6.js → core.esm-OXFIZWpS.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DiiE7rCS.js → create-organization-dialog-BRErkbxx.js} +1 -1
- package/dist/client/assets/{daily-pulse-B9Drselw.js → daily-pulse-D18xpih6.js} +1 -1
- package/dist/client/assets/{discover-D52teqhE.js → discover-DfHt6Qn7.js} +1 -1
- package/dist/client/assets/{domain-settings-CCa5YkNE.js → domain-settings-RPr1rFV3.js} +1 -1
- package/dist/client/assets/{drawer-BEc1Kapc.js → drawer-Bus2z-u1.js} +1 -1
- package/dist/client/assets/{editor-CS8_WWkt.js → editor-BarPw5uJ.js} +1 -1
- package/dist/client/assets/{editor-classes-smrmmLLF.js → editor-classes-SUCbHYjm.js} +1 -1
- package/dist/client/assets/{empty-state-Bazy-CUt.js → empty-state-BSi85_uG.js} +1 -1
- package/dist/client/assets/{empty-state-BM2gy_w8.js → empty-state-Bdz8ZYtm.js} +1 -1
- package/dist/client/assets/{experiments-tab-CduqDhVr.js → experiments-tab-DhjqdM8p.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-B01LanJg.js → experiments-tab-choice-CUMCZamw.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DWYmGYfU.js → extract-connection-data-DKCvR6nI.js} +1 -1
- package/dist/client/assets/{feature-gate-M-4nTs63.js → feature-gate-f5rOMfv1.js} +1 -1
- package/dist/client/assets/{feature-paywall-DdJkvocH.js → feature-paywall-Ce3iwCZE.js} +1 -1
- package/dist/client/assets/{file-explorer-B3GWctzv.js → file-explorer-JkDroiqT.js} +1 -1
- package/dist/client/assets/{file-preview-BS78KkyO.js → file-preview-D73r-xXC.js} +1 -1
- package/dist/client/assets/{file-share-button-BHueHFCa.js → file-share-button-5a7ER95I.js} +1 -1
- package/dist/client/assets/{file-type-icon-DfyQcFpd.js → file-type-icon-2pGdNJEW.js} +1 -1
- package/dist/client/assets/{folder-icon-CsMt4ucb.js → folder-icon-Cqx6Ff_K.js} +1 -1
- package/dist/client/assets/{form-C43Dz8DE.js → form-CZ-DjqQe.js} +1 -1
- package/dist/client/assets/{general-KWTHkdSK.js → general-Bj3b3W0o.js} +1 -1
- package/dist/client/assets/{held-block-view-Bo7aZcZ_.js → held-block-view--N8mZk1q.js} +3 -3
- package/dist/client/assets/{home-DHt7quoy.js → home-Bx6frvr8.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-D9ABfqaX.js → hosted-publish-feedback-UB55aTs0.js} +1 -1
- package/dist/client/assets/{icon-button-D8AAeLMp.js → icon-button-B-KIq-fr.js} +1 -1
- package/dist/client/assets/{index-DC1he-Jq.js → index--agIVlsB.js} +1 -1
- package/dist/client/assets/{index-DD5krcor.js → index-B34335eJ.js} +1 -1
- package/dist/client/assets/{index-BOrJJ5G0.js → index-BpZqQCv-.js} +1 -1
- package/dist/client/assets/{index-Cpq2VjWs.js → index-CA5RM9Ec.js} +1 -1
- package/dist/client/assets/{index-CE3ui28Z.js → index-CQthnPWF.js} +1 -1
- package/dist/client/assets/{index-CDSCbGe7.js → index-CT6eD4mz.js} +1 -1
- package/dist/client/assets/{index-B_MQ2hvy.js → index-CecMoWY8.js} +1 -1
- package/dist/client/assets/{index-B1YVE0lV.js → index-CgBepWXx.js} +1 -1
- package/dist/client/assets/{index-BTW29fPm.js → index-CrA3tQ-9.js} +1 -1
- package/dist/client/assets/{index-lebYkUmm.js → index-Dn6q5XKw.js} +1 -1
- package/dist/client/assets/{index-DV7sUAFw.js → index-DuFiNoN1.js} +1 -1
- package/dist/client/assets/{index-C-7u3Q1p.js → index-EliiQy8F.js} +3 -3
- package/dist/client/assets/{index-BNIM9pwz.js → index-PuRuPRnS.js} +1 -1
- package/dist/client/assets/{index-B8IlKF5i.js → index-mKT_d3AB.js} +1 -1
- package/dist/client/assets/{index-redirect-DKYLeOLr.js → index-redirect-CuDDJcb6.js} +1 -1
- package/dist/client/assets/{index-DG4hutrU.js → index-vMyA_V3k.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D4WsMzcK.js → infiniteQueryObserver-D6cV9HaR.js} +1 -1
- package/dist/client/assets/{infra-billing-B30MPLgF.js → infra-billing-BIqiTsnF.js} +1 -1
- package/dist/client/assets/{input-Dcmw-7pr.js → input-B0c9nfkY.js} +3 -3
- package/dist/client/assets/{input-jaCu0A3n.js → input-rsmTEOVU.js} +1 -1
- package/dist/client/assets/{integration-icon-H1U01E5M.js → integration-icon-VQ6MFcQg.js} +1 -1
- package/dist/client/assets/{jira-icon-hlxk_m9K.js → jira-icon-mPCk-e5A.js} +1 -1
- package/dist/client/assets/{label-CN_20N5i.js → label-1jelUIHf.js} +1 -1
- package/dist/client/assets/{layout-Bz0exeSZ.js → layout-DpOt51nT.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DuBsIWuq.js → legacy-agents-deep-5AVy7Dyx.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-WaVrNd3c.js → legacy-main-redirect-B84xEGTX.js} +1 -1
- package/dist/client/assets/library-1SYfXV-T.js +1 -0
- package/dist/client/assets/{login-J0hVRlJs.js → login-CythSrIS.js} +1 -1
- package/dist/client/assets/{markdown-Q4WPLNzO.js → markdown-CJLAbu6m.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CVng9nwq.js → mcp-app-renderer-CsT44wZ0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-vNc23eQ1.js → mcp-oauth-7oWaySV-.js} +1 -1
- package/dist/client/assets/{mcp-oauth-OMGrMWG6.js → mcp-oauth-DUd2f4kQ.js} +1 -1
- package/dist/client/assets/{members-DXuEPU8c.js → members-CXDZ4olf.js} +1 -1
- package/dist/client/assets/{memory-DTgCXWjY.js → memory-CLXH7axm.js} +1 -1
- package/dist/client/assets/{mini-report-page-D6U026UX.js → mini-report-page-De1Tc_QD.js} +1 -1
- package/dist/client/assets/{mock-board-BjKvDN-v.js → mock-board-EcFIU6_w.js} +3 -3
- package/dist/client/assets/{monaco-editor-BaMnxRY9.js → monaco-editor-Du_wWYY7.js} +1 -1
- package/dist/client/assets/monitoring-jzJ0qstN.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-CBUcWOPw.js → monitoring-stats-row-DyR7yUcM.js} +1 -1
- package/dist/client/assets/{multi-select-mVQ06NF1.js → multi-select-Cw_6INgL.js} +1 -1
- package/dist/client/assets/{mustache-NovEkIud.js → mustache-BsDmglfY.js} +1 -1
- package/dist/client/assets/{named-rule-uses-DRPwv8rN.js → named-rule-uses-DhwSOcYH.js} +1 -1
- package/dist/client/assets/{new-project-dialog-HTIQ78eR.js → new-project-dialog-BZZpSwA-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BlkA8CMt.js → oauth-callback-ai-provider-BlBf-7oY.js} +1 -1
- package/dist/client/assets/{oauth-callback-BxxnouYm.js → oauth-callback-n0RYtIAG.js} +1 -1
- package/dist/client/assets/{onboarding-5dC_qng2.js → onboarding-C8oHCA5d.js} +1 -1
- package/dist/client/assets/{openai-conversation-5vAZvji2.js → openai-conversation-CqmcR6pZ.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CCXk5XGC.js → optimistic-project-sidebar-views-DxwHLA5N.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BQt0zUEA.js → order-monitor-day-B7KaVTQm.js} +1 -1
- package/dist/client/assets/{organization-choice-CzcLI13q.js → organization-choice-E7zq7DVR.js} +1 -1
- package/dist/client/assets/{orgs-BLTjOvan.js → orgs-B2nPbBOe.js} +1 -1
- package/dist/client/assets/{page-seo-form-DuxOt1qc.js → page-seo-form-DMhK1wkF.js} +1 -1
- package/dist/client/assets/{pair-DhXixf1k.js → pair-DOPlzDd4.js} +1 -1
- package/dist/client/assets/{parse-sections-CCWksuWu.js → parse-sections-D2uPfizD.js} +1 -1
- package/dist/client/assets/{plan-BxbJSiNv.js → plan-A1_WEVyd.js} +1 -1
- package/dist/client/assets/{plan-ladder-BFYs9Yna.js → plan-ladder-1-Y0pztZ.js} +1 -1
- package/dist/client/assets/{popover-DDX1JrVX.js → popover-B3zmxk6Q.js} +1 -1
- package/dist/client/assets/{post-calendar-Lxo3B22H.js → post-calendar-DhPx5EiY.js} +1 -1
- package/dist/client/assets/{post-editor-ClVJa16I.js → post-editor-CMFc7vL0.js} +1 -1
- package/dist/client/assets/{preview-content-Bd1rU9jS.js → preview-content-B-_3eTxG.js} +1 -1
- package/dist/client/assets/{preview-dialog-TbawBrlR.js → preview-dialog-CUTHFrjI.js} +1 -1
- package/dist/client/assets/{preview-panel-BY_Zmr6J.js → preview-panel-DHk_P0a0.js} +1 -1
- package/dist/client/assets/{preview-tab-BRFlwbm4.js → preview-tab-CUUurWrZ.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DAe6nrHe.js → product-picker-dialog-DAR7PLXE.js} +1 -1
- package/dist/client/assets/{profile-BPPkf-va.js → profile-B2kDv2BN.js} +1 -1
- package/dist/client/assets/{project-app-view-DTju7uV5.js → project-app-view-BC4kBu7Z.js} +1 -1
- package/dist/client/assets/{project-apps-dxWxQ0qF.js → project-apps-Lq1M5-7q.js} +1 -1
- package/dist/client/assets/{project-feed-D0HiMI8H.js → project-feed-DeoXRUyG.js} +1 -1
- package/dist/client/assets/{project-icon-Cn10NATp.js → project-icon-CH8PzkOZ.js} +1 -1
- package/dist/client/assets/project-reports-DTdChErS.js +1 -0
- package/dist/client/assets/project-tasks-Dv-zyxMa.js +1 -0
- package/dist/client/assets/{projects-go32z_44.js → projects-_zsvjJdm.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BMKOblYq.js → projects-empty-state-BwBQ9JoR.js} +1 -1
- package/dist/client/assets/{prompts-noYH-MTl.js → prompts-lE5vbSda.js} +1 -1
- package/dist/client/assets/record-editor-B6bFvya9.js +1 -0
- package/dist/client/assets/{redirect-editor-DegAvWrz.js → redirect-editor-C2MF6tGF.js} +1 -1
- package/dist/client/assets/{releases-api-BaGbKR8Z.js → releases-api-CLvsvszH.js} +1 -1
- package/dist/client/assets/{reports-BQMThdJ4.js → reports-B-Iz9Pvp.js} +1 -1
- package/dist/client/assets/reports-D9z9j-rH.js +1 -0
- package/dist/client/assets/{reports-onboarding-E3NYUvW4.js → reports-onboarding-BeOUvYBa.js} +1 -1
- package/dist/client/assets/{reports-tab-CTsWXPlZ.js → reports-tab-NEBhaHXp.js} +2 -2
- package/dist/client/assets/{repositories-DyBplk7y.js → repositories-BEy9rabY.js} +1 -1
- package/dist/client/assets/repositories-BuB2TyIo.js +1 -0
- package/dist/client/assets/{repository-binding-YWa5Aj2B.js → repository-binding-DeVr2_qp.js} +1 -1
- package/dist/client/assets/{repository-import-picker-B4f_LYYL.js → repository-import-picker-C_XrxsQw.js} +1 -1
- package/dist/client/assets/{repository-picker-BzOPziBN.js → repository-picker-kswXqrhy.js} +1 -1
- package/dist/client/assets/{require-capability-RDyhoz9d.js → require-capability-Xn-e7Ydu.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B4Oy4qY6.js → required-auth-layout-DXz6YWOV.js} +1 -1
- package/dist/client/assets/{reset-password-PZkcJSVc.js → reset-password-N3gKnVlq.js} +1 -1
- package/dist/client/assets/{resizable-Baza1MW1.js → resizable-CutHeLA4.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-HnczyISb.js → resolve-tab-icon-DM9P4slQ.js} +1 -1
- package/dist/client/assets/{review-settings-BhtJDbge.js → review-settings-BfEZbhDZ.js} +1 -1
- package/dist/client/assets/{roles-BbONh7nw.js → roles-9IbbXcHH.js} +1 -1
- package/dist/client/assets/{route-C8Bdwgsj.js → route-Bc8zEdHS.js} +1 -1
- package/dist/client/assets/{route-CJPdTq0n.js → route-CcnNtuAp.js} +1 -1
- package/dist/client/assets/route-_dB1y933.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-CKFO0e99.js → sandbox-lifecycle-context-jhvRQRer.js} +1 -1
- package/dist/client/assets/{schema-DwQK1HS7.js → schema-BCxy_r83.js} +1 -1
- package/dist/client/assets/{schema-nSo7eNGL.js → schema-DeMY_MYw.js} +1 -1
- package/dist/client/assets/{scroll-area-CxRBbD4-.js → scroll-area-BcXnWQAA.js} +1 -1
- package/dist/client/assets/{search-input-BMFiSJGq.js → search-input-ByLZvxmh.js} +1 -1
- package/dist/client/assets/{search-toggle-DTgkR1bz.js → search-toggle-B-L502qP.js} +1 -1
- package/dist/client/assets/{secret-picker-CQbM3CUU.js → secret-picker-B6Dx-RBX.js} +1 -1
- package/dist/client/assets/{secrets-DW0cLQfQ.js → secrets-BqMwbZum.js} +1 -1
- package/dist/client/assets/{section-array-field-BXrjQJHb.js → section-array-field-CincMGhf.js} +1 -1
- package/dist/client/assets/{sections-NTQj5HsK.js → sections-Bcz112dE.js} +1 -1
- package/dist/client/assets/{sections-editor-B_j-5sVx.js → sections-editor-_SdgwHLx.js} +1 -1
- package/dist/client/assets/{select-BcXPhann.js → select-BD6nyHzt.js} +1 -1
- package/dist/client/assets/{select-model-CH-sB2C_.js → select-model-WMNDIml8.js} +1 -1
- package/dist/client/assets/{seo-editor-iev_ikUW.js → seo-editor-xL6eZPWX.js} +1 -1
- package/dist/client/assets/{separator-9Dxyom4v.js → separator-6iF02ERp.js} +1 -1
- package/dist/client/assets/settings-tab-Po4hJoji.js +1 -0
- package/dist/client/assets/{sheet-DqnY8b_E.js → sheet-tPLtd5I9.js} +1 -1
- package/dist/client/assets/{shell-layout-3NhLlP30.js → shell-layout-C_jaX4Op.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BJA_HcSQ.js → site-draft-actions-DljxjUY5.js} +1 -1
- package/dist/client/assets/{site-draft-view-CGLuIp7i.js → site-draft-view-DJG6m-d3.js} +2 -2
- package/dist/client/assets/site-editor-CI9fwGQz.js +1 -0
- package/dist/client/assets/{site-editor-toast-B_jO1x9a.js → site-editor-toast-DNKTJ9Hj.js} +1 -1
- package/dist/client/assets/site-slug-o7Vv7Ck8.js +1 -0
- package/dist/client/assets/{skills-f0Fn4F54.js → skills-C8K6Du5y.js} +1 -1
- package/dist/client/assets/{slider-BRJ4E5qc.js → slider-HtJk13_z.js} +1 -1
- package/dist/client/assets/{sortable.esm-XBRFR4h3.js → sortable.esm-B3SgohOr.js} +1 -1
- package/dist/client/assets/{sso-ptFVOUSY.js → sso-BTfRVkoq.js} +1 -1
- package/dist/client/assets/{suggestion-x8Vmk3c0.js → suggestion-BuBMXsQG.js} +1 -1
- package/dist/client/assets/{switch-BjxQhX9I.js → switch-DfOtypgl.js} +1 -1
- package/dist/client/assets/{symbol-CoMY1cUV.js → symbol-CBnirETN.js} +1 -1
- package/dist/client/assets/{synced-repos-DTLxgzUB.js → synced-repos-Hz0jX6kq.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BTAPTcev.js → tab-icon-glyph-B_0CwFMG.js} +1 -1
- package/dist/client/assets/{table-DYRz1EbZ.js → table-BKKxhQ_d.js} +1 -1
- package/dist/client/assets/{tabs-yi8sIGnO.js → tabs-CORjkMEF.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-am1U5NCJ.js → task-assignee-avatar-BwB_J47Q.js} +1 -1
- package/dist/client/assets/{task-board-3G25YC4T.js → task-board-dne5ekjX.js} +1 -1
- package/dist/client/assets/{task-route-CDnyGq_i.js → task-route-BL-xHFP_.js} +1 -1
- package/dist/client/assets/{task-status-CfHELMPD.js → task-status-D6AvW1nk.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CKG3X2PM.js → taskboard-analytics-CAEIU40P.js} +1 -1
- package/dist/client/assets/{tasks-Cx58Wp6u.js → tasks-Cbur_lAa.js} +1 -1
- package/dist/client/assets/tasks-CvkTvbwq.js +1 -0
- package/dist/client/assets/{textarea-B0GR4qKq.js → textarea-BvV_cNLl.js} +1 -1
- package/dist/client/assets/{thread-analytics-0TfofeTB.js → thread-analytics-CLDP8Eo6.js} +1 -1
- package/dist/client/assets/{thread-intent-BnUeABjp.js → thread-intent-D3tgb7QP.js} +1 -1
- package/dist/client/assets/{thread-route-bBUdr9Y4.js → thread-route-BCrX53C9.js} +1 -1
- package/dist/client/assets/{thread-route-DcC6uChG.js → thread-route-CL0KLr9P.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BtettYB9.js → thread-sheet-body-BP496g_w.js} +1 -1
- package/dist/client/assets/{time-range-picker-BBlt80xV.js → time-range-picker-BznhLk0I.js} +1 -1
- package/dist/client/assets/{toggle-group-DwvE7PQ4.js → toggle-group-CE0WeWgb.js} +1 -1
- package/dist/client/assets/{tool-namespace-CO8PzHHz.js → tool-namespace-Cgkt4ubz.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DwRQRctK.js → toolbar-icon-button-YbqBAwgD.js} +1 -1
- package/dist/client/assets/{tooltip-Cy6Sov0G.js → tooltip-BdAcWCQB.js} +1 -1
- package/dist/client/assets/{tooltipContext-BVRJdRrv.js → tooltipContext-D6ivquCn.js} +1 -1
- package/dist/client/assets/{track-BtYPIKfL.js → track-CbO1-iGg.js} +1 -1
- package/dist/client/assets/{types-C6oU-bLE.js → types-mw-B7ZyE.js} +1 -1
- package/dist/client/assets/{url-slug-DN7U5t_n.js → url-slug-DG4ofUf-.js} +1 -1
- package/dist/client/assets/{usage-stats-BuXXTMUo.js → usage-stats-BOyKAWNQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-LTOcsB5I.js → use-ai-providers-Ciop1Z20.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DFnlRqxz.js → use-apply-named-rule-CzN_Q8u_.js} +1 -1
- package/dist/client/assets/{use-automations-CEfhDpFt.js → use-automations-DURh6HPa.js} +1 -1
- package/dist/client/assets/{use-autosave-etT9F--7.js → use-autosave-CO2SFEWu.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-6Xils4BP.js → use-chat-layout-state-BA-SUqJB.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BJu_EAYE.js → use-clock-tick-BhFHy3Sj.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-vTb7Bh7l.js → use-cms-publish-actions-BlQ9MPma.js} +1 -1
- package/dist/client/assets/{use-connect-companion-VOK1bF67.js → use-connect-companion-C8aOmQav.js} +1 -1
- package/dist/client/assets/{use-connection-wZfo70Pr.js → use-connection-B48U4I0u.js} +1 -1
- package/dist/client/assets/{use-copy-Bd4nlJu3.js → use-copy-DVWZxbU6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dow8wUFK.js → use-create-virtual-mcp-qbzjQjpI.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-q7n6xDQy.js → use-date-fns-locale-BwQalXLU.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BHNo2seb.js → use-debounced-autosave-CrRvv2Rw.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C-CkBgdO.js → use-debounced-value-Aaz50L2R.js} +1 -1
- package/dist/client/assets/{use-deco-credits-yau7Phzq.js → use-deco-credits-OQ9LXXDC.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Cui_pV3_.js → use-decopilot-events-BVppfqa_.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CBWZ4Ufq.js → use-delete-connection-CaHaffVx.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Dee8ZSMm.js → use-deployment-admin-SWAoQ8Nx.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-D30HdMdW.js → use-fast-preview-draft-url-BRovWAM_.js} +1 -1
- package/dist/client/assets/{use-file-configs-C8r4YgS2.js → use-file-configs-C3N0WOWX.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DNxRLMji.js → use-inbox-feed-Dpkw_y-b.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CRvRC0XQ.js → use-infinite-scroll-Dbv8EZVp.js} +1 -1
- package/dist/client/assets/{use-join-requests-DjFqbO25.js → use-join-requests-CXvpXmx9.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Bb4PQE31.js → use-main-panel-tabs-JIoF9zc9.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-ByZDc3lx.js → use-mcp-auth-status-Dr-3roio.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C1SQi6vD.js → use-mcp-client-65fBiITE.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BQbTGlaB.js → use-mcp-prompts-DVkjtK5z.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BLfLR0Gp.js → use-mcp-tools-Wz1w7-h4.js} +1 -1
- package/dist/client/assets/{use-mobile-C9z3xinJ.js → use-mobile-RfYnH7Kg.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CEHBET7i.js → use-move-blocks-BzIrNJp5.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D69hbGQZ.js → use-navigate-to-agent-_nUw_yzG.js} +1 -1
- package/dist/client/assets/{use-org-fs-C6oVHwOc.js → use-org-fs-CDBJkmmk.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BReEDse3.js → use-org-repo-syncs-ChcKHn5t.js} +1 -1
- package/dist/client/assets/{use-org-sso-D4k-Q4Ea.js → use-org-sso-D0PKMzaC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D-pet1FM.js → use-organization-roles-5HZbwYWE.js} +1 -1
- package/dist/client/assets/{use-organization-settings-KUBGCxko.js → use-organization-settings-CzOI8f3j.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BNJlLsDc.js → use-panel-navigate-BQgIP8By.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-G3mg-vda.js → use-project-native-view-presence-D2dN0nXP.js} +1 -1
- package/dist/client/assets/{use-project-scope-YPUrzmdF.js → use-project-scope-B5PWWx8O.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DLluKGu2.js → use-recent-apps-C8yvrn2T.js} +1 -1
- package/dist/client/assets/{use-releases-Cjh0ABKw.js → use-releases-BawYSl5n.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BLiBMOkJ.js → use-reports-diagnostic-DtrRIZWr.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-J6-5PDD-.js → use-sandbox-events-BEO7JBdt.js} +1 -1
- package/dist/client/assets/{use-secrets-CHU-tS18.js → use-secrets-CehHe8BZ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CSU-NzXp.js → use-section-preview-base-LRaSul5j.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CUBTL6o_.js → use-session-runtime-W1lGtTrc.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-Bcmk6G24.js → use-sidebar-collapsed-bSn7ZzoI.js} +1 -1
- package/dist/client/assets/{use-tags-Cmr3QV3q.js → use-tags-Bq8QQM1p.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CulDCRRv.js → use-task-board-analytics-3OGQCi8q.js} +1 -1
- package/dist/client/assets/{use-task-board-events-C36Q7KH3.js → use-task-board-events-CdZKcZ1E.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CMDFfiqU.js → use-task-board-item-prs-BDM0jP9N.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Cf7VjOzS.js → use-task-metadata-BKSU_5ko.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DTGlYGzE.js → use-thread-analytics-DiVxRXvQ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-P1v_AD_L.js → use-thread-outputs-DVkH4nOR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-wQNAXyiV.js +1 -0
- package/dist/client/assets/{useQueries-CJ8bR8wz.js → useQueries-BPCK0ik_.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-YLjK0oOB.js +1 -0
- package/dist/client/assets/{users-Cr5GuBAQ.js → users-DfeqvKcj.js} +1 -1
- package/dist/client/assets/{utils-Cs5W6q5G.js → utils-DtMi2WDq.js} +1 -1
- package/dist/client/assets/{variant-calendar-CuO4reRM.js → variant-calendar-DVW9FNhi.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CYw1ZV1P.js → variant-matcher-override-BM9zcWu0.js} +1 -1
- package/dist/client/assets/{view-header-BHTvfRiF.js → view-header-CYzcYU6r.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BezQjCmB.js → virtual-mcp-CkBWr_pr.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-C1eAjILo.js → watch-sse-pool-C4lJ-KFb.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-BOkPx7WN.js +0 -1
- package/dist/client/assets/agent-deck-Cc30uoKg.js +0 -1
- package/dist/client/assets/agent-experiments-xN3gLz4H.js +0 -1
- package/dist/client/assets/agent-library-CNWFStAg.js +0 -1
- package/dist/client/assets/agent-library-file-BMZT70Jj.js +0 -1
- package/dist/client/assets/agent-monitor-ihmpXXJ6.js +0 -1
- package/dist/client/assets/agent-settings-B8g-yyGv.js +0 -1
- package/dist/client/assets/agent-site-editor-code-L57hIXIr.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CqzM_g8P.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-C6gDJS00.js +0 -1
- package/dist/client/assets/agent-view-mGVmNxG9.js +0 -1
- package/dist/client/assets/api-keys-BWU-e_Ip.js +0 -1
- package/dist/client/assets/library-CHmvjnge.js +0 -1
- package/dist/client/assets/monitoring-DQUKJ9PK.js +0 -1
- package/dist/client/assets/project-reports-CpCs5MD2.js +0 -1
- package/dist/client/assets/project-tasks-DvEoEwbQ.js +0 -1
- package/dist/client/assets/record-editor-t54cUuxh.js +0 -1
- package/dist/client/assets/reports-CZid9oXp.js +0 -1
- package/dist/client/assets/repositories-BgonDJY1.js +0 -1
- package/dist/client/assets/route-DscYZmQa.js +0 -1
- package/dist/client/assets/settings-tab-DYTzRyPk.js +0 -1
- package/dist/client/assets/site-editor-Dg4giIAV.js +0 -1
- package/dist/client/assets/site-slug-DebpOoQq.js +0 -1
- package/dist/client/assets/tasks-KxHkiUit.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CPje-klv.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B07pK2vg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,b as B,H as oe,a as U,r as I,j as s,ap as re,n as M,a4 as q,h as ne,l as W,L as ye,C as Z,aq as _e,K as Se,m as Ne,B as ve,ad as ke}from"./index-C-7u3Q1p.js";import{C as we}from"./index-Cpq2VjWs.js";import{b as ie}from"./input-Dcmw-7pr.js";import{D as le,a as ae}from"./chat-context-9RCHH93Q.js";import{a as ce}from"./use-organization-settings-KUBGCxko.js";import{C as me,u as $e,F as Ce,R as He,M as Te,a as Ae,b as Pe,P as Ee}from"./project-feed-D0HiMI8H.js";import{I as Be}from"./icon-button-D8AAeLMp.js";import{a as De,T as X}from"./toggle-group-DwvE7PQ4.js";import{P as Me,A as Ie}from"./agent-icon-C43vsTCs.js";import{i as Fe}from"./sprints-C1z9xhcL.js";import{F as Le}from"./file-preview-BS78KkyO.js";import{u as J,a as Oe}from"./use-org-fs-C6oVHwOc.js";import{L as Re}from"./preview-dialog-TbawBrlR.js";import{a as ze,r as Ge,s as Ke}from"./daily-pulse-B9Drselw.js";import{N as Ye}from"./new-project-dialog-HTIQ78eR.js";import{P as Ue}from"./projects-empty-state-BMKOblYq.js";import{b as fe}from"./task-route-CDnyGq_i.js";import{u as qe}from"./use-inbox-feed-DNxRLMji.js";import{b as We}from"./use-recent-apps-DLluKGu2.js";import{s as ue}from"./use-project-scope-YPUrzmdF.js";import{b as de}from"./repository-binding-YWa5Aj2B.js";import{s as Ze}from"./Plus-BtmzbqvB.js";import{i as Ve}from"./UserSquare-TLzz_r-8.js";import{E as Xe}from"./empty-state-Bazy-CUt.js";import{R as Je}from"./repository-import-picker-B4f_LYYL.js";import{o as Qe}from"./shell-layout-3NhLlP30.js";import{i as et,n as tt}from"./ArrowUp-kvfi1BA-.js";import{u as st}from"./use-navigate-to-agent-D69hbGQZ.js";import{s as ot,r as rt}from"./project-profile-Cc4MG3QN.js";import{i as nt}from"./LinkBroken01-c1btH10E.js";import"./use-mobile-C9z3xinJ.js";import"./use-sidebar-collapsed-Bcmk6G24.js";import"./use-chat-layout-state-6Xils4BP.js";import"./thread-route-DcC6uChG.js";import"./use-panel-navigate-BNJlLsDc.js";import"./thread-intent-BnUeABjp.js";import"./use-mcp-client-C1SQi6vD.js";import"./auth-CSe1VqaK.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C1eAjILo.js";import"./task-board-3G25YC4T.js";import"./schema-DwQK1HS7.js";import"./slugify-CEUa2lfQ.js";import"./tooltip-Cy6Sov0G.js";import"./index-lebYkUmm.js";import"./toolbar-icon-button-DwRQRctK.js";import"./sheet-DqnY8b_E.js";import"./resizable-Baza1MW1.js";import"./usage-stats-BuXXTMUo.js";import"./tool-namespace-CO8PzHHz.js";import"./form-C43Dz8DE.js";import"./label-CN_20N5i.js";import"./utils-CVEq3hMx.js";import"./markdown-Q4WPLNzO.js";import"./use-copy-Bd4nlJu3.js";import"./Copy01-BgR3A9bu.js";import"./ZoomOut-BUzePeS3.js";import"./location-V0VwTJTt.js";import"./use-decopilot-events-Cui_pV3_.js";import"./XClose-DnlVgLPc.js";import"./file-type-icon-DfyQcFpd.js";import"./autosend-DAw2R789.js";import"./chat-draft-BaRF4CRI.js";import"./use-session-runtime-CUBTL6o_.js";import"./ShoppingBag01-D-Zbzi6Y.js";import"./Image01-DemwGDZp.js";import"./Upload01-CpMwTjPo.js";import"./AlertCircle-h7CqbZc4.js";import"./select-BcXPhann.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BZS5K0sE.js";import"./ArrowLeft-D1aeCElv.js";import"./tabs-yi8sIGnO.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-yau7Phzq.js";import"./use-ai-providers-LTOcsB5I.js";import"./index-DG4hutrU.js";import"./checkbox-D8I8sdEP.js";import"./Minus-UcZ_8vud.js";import"./ChevronSelectorVertical-EacCcohh.js";import"./Key01-yOdxx1sq.js";import"./Tool01-BhPghDfH.js";import"./SearchMd-CKk9nYcQ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-DDw29wMJ.js";import"./popover-DDX1JrVX.js";import"./drawer-BEc1Kapc.js";import"./input-jaCu0A3n.js";import"./suggestion-x8Vmk3c0.js";import"./use-mcp-prompts-BQbTGlaB.js";import"./Link01-DQotNCgV.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DdJkvocH.js";import"./plan-ladder-BFYs9Yna.js";import"./add-connection-dialog-Jb5UqRgL.js";import"./collection-search-6Ow5M6mo.js";import"./extract-connection-data-DWYmGYfU.js";import"./metadata-D72DunRR.js";import"./connection-CSue-IVc.js";import"./url-slug-DN7U5t_n.js";import"./connection-card-CsGgE996.js";import"./useInfiniteQuery-CPje-klv.js";import"./infiniteQueryObserver-D4WsMzcK.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-H1U01E5M.js";import"./textarea-B0GR4qKq.js";import"./use-connection-wZfo70Pr.js";import"./schema-nSo7eNGL.js";import"./connection-form-helpers-Dto5qDcq.js";import"./Trash01-PBDL2Ian.js";import"./authenticate-and-persist-oauth-2gkgug8h.js";import"./mcp-oauth-vNc23eQ1.js";import"./mcp-oauth-OMGrMWG6.js";import"./collection-tabs-BOiDA_ZP.js";import"./badge-BZz5g910.js";import"./use-infinite-scroll-CRvRC0XQ.js";import"./useSuspenseInfiniteQuery-B07pK2vg.js";import"./use-task-board-events-C36Q7KH3.js";import"./client-icons-CY1c5MEM.js";import"./CheckCircle-BW7x42OJ.js";import"./chart-DGXwd4Jz.js";import"./index-B1YVE0lV.js";import"./symbol-CoMY1cUV.js";import"./CategoricalChart-BKERzdnn.js";import"./project-icon-Cn10NATp.js";import"./project-apps-dxWxQ0qF.js";import"./config-D8svKpbW.js";import"./core.esm-eT1Gixd6.js";import"./ReferenceLine-DylQl7dL.js";import"./CartesianChart-CCQ9R-g2.js";import"./BarChart-BkyfeCAj.js";import"./tooltipContext-BVRJdRrv.js";import"./ActiveShapeUtils-D7qvNsrj.js";import"./Sector-DCllPuEx.js";import"./ErrorBarContext-BQrbyX9T.js";import"./repository-picker-BzOPziBN.js";import"./use-debounced-value-C-CkBgdO.js";import"./task-assignee-avatar-am1U5NCJ.js";import"./task-key-BCHdFiOO.js";import"./Building02-BPLVFm4s.js";import"./CreditCard01-BX1DsWKy.js";import"./DotsVertical-DRqYjcEJ.js";import"./Globe04-C6T-v1E1.js";import"./SwitchHorizontal01-BPjNUu0G.js";import"./Sun-CDq9V0s9.js";import"./Play-BXAkytjF.js";import"./Users01-C5lPBi9w.js";import"./utils-Cs5W6q5G.js";import"./editor-CS8_WWkt.js";import"./preview-content-Bd1rU9jS.js";import"./file-share-button-BHueHFCa.js";import"./use-deployment-admin-Dee8ZSMm.js";import"./admin-fetch-BhTJlAsX.js";import"./use-clock-tick-BJu_EAYE.js";import"./command-DcKpfmPL.js";import"./index-BOrJJ5G0.js";import"./required-auth-layout-B4Oy4qY6.js";import"./use-org-sso-D4k-Q4Ea.js";const Y="home",pe="brief";function ge(t){return`users/${t}/brief`}function it(t,e){return`${t}/${e}.html`}function lt(t){const e=String(t.getFullYear()).padStart(4,"0"),o=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${e}-${o}-${i}`}function at(t){if(!t.endsWith(".html"))return null;const e=t.slice(0,-5);return Fe(e)?e:null}const ct=7;function he(t,e){return Math.round((Date.parse(`${e}T00:00:00Z`)-Date.parse(`${t}T00:00:00Z`))/864e5)}function mt(t,e){let o=null;for(const i of t){const n=at(i);if(!n||o&&n<=o.day)continue;const l=he(n,e);l>=0&&l<ct&&(o={name:i,day:n})}return o}const Q=t=>t.slice(t.lastIndexOf("/")+1);function ee(t,e,o,i){const n=o.filter(r=>r.kind==="file"),l=mt(n.map(r=>Q(r.path)),i),a=l&&n.find(r=>Q(r.path)===l.name);return l&&a?{scope:t,path:it(e,l.day),filename:l.name,size:a.size,day:l.day,ageDays:he(l.day,i)}:null}function ft({userId:t,personal:e,org:o,today:i}){return[t?ee("personal",ge(t),e,i):null,ee("org",pe,o,i)].filter(n=>n!==null)}function ut(t,e){return e===0?t("home.dailyBrief.today"):e===1?t("home.dailyBrief.yesterday"):t("home.dailyBrief.daysAgo",{count:e})}function dt(t,e){return new Date(`${e}T12:00:00Z`).toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"})}function pt(){const t=P.c(54),e=B(),[o]=oe(),{data:i}=U.useSession(),n=i?.user?.id,l=J(Y,pe),a=n??"";let r;t[0]!==a?(r=ge(a),t[0]=a,t[1]=r):r=t[1];const c=!!n;let m;t[2]!==c?(m={enabled:c},t[2]=c,t[3]=m):m=t[3];const f=J(Y,r,m),u=Oe(Y),[g,p]=I.useState(null),[j,x]=I.useState(!1);let b,h,d,_,y,S,N,C,v,w;if(t[4]!==l.data||t[5]!==f.data||t[6]!==o||t[7]!==u||t[8]!==g||t[9]!==e||t[10]!==n){_=Symbol.for("react.early_return_sentinel");e:{const E=ft({userId:n,personal:f.data??[],org:l.data??[],today:lt(new Date)});if(h=E.find(z=>z.scope===g)??E[0],!h){_=null;break e}w="flex flex-col overflow-hidden surface";let D;t[21]!==e?(D=e("home.dailyBrief.title"),t[21]=e,t[22]=D):D=t[22];const R=s.jsxs("h2",{className:"flex min-w-0 items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[D,s.jsxs("span",{className:"truncate text-xs font-normal text-muted-foreground",children:[ut(e,h.ageDays)," ·"," ",dt(o.language,h.day)]})]}),V=E.length>1&&s.jsxs(De,{type:"single",variant:"segmented",size:"sm",value:h.scope,onValueChange:z=>{(z==="personal"||z==="org")&&p(z)},children:[s.jsx(X,{value:"personal",className:"px-2.5 text-xs",children:e("home.dailyBrief.personal")}),s.jsx(X,{value:"org",className:"px-2.5 text-xs",children:e("home.dailyBrief.org")})]});let F;t[23]!==e?(F=e("home.dailyBrief.fullscreen"),t[23]=e,t[24]=F):F=t[24];let G,K;t[25]===Symbol.for("react.memo_cache_sentinel")?(G=()=>x(!0),K=s.jsx(Me,{size:14}),t[25]=G,t[26]=K):(G=t[25],K=t[26]);let L;t[27]!==F?(L=s.jsx(Be,{label:F,onClick:G,children:K}),t[27]=F,t[28]=L):L=t[28];let O;t[29]!==V||t[30]!==L?(O=s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[V,L]}),t[29]=V,t[30]=L,t[31]=O):O=t[31],t[32]!==R||t[33]!==O?(d=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[R,O]}),t[32]=R,t[33]=O,t[34]=d):d=t[34],v="h-[32rem]",b=Le,y=h.path,S=h.filename,N=h.size,C=u(h.path)}t[4]=l.data,t[5]=f.data,t[6]=o,t[7]=u,t[8]=g,t[9]=e,t[10]=n,t[11]=b,t[12]=h,t[13]=d,t[14]=_,t[15]=y,t[16]=S,t[17]=N,t[18]=C,t[19]=v,t[20]=w}else b=t[11],h=t[12],d=t[13],_=t[14],y=t[15],S=t[16],N=t[17],C=t[18],v=t[19],w=t[20];if(_!==Symbol.for("react.early_return_sentinel"))return _;let k;t[35]!==y||t[36]!==S||t[37]!==N||t[38]!==C?(k={key:y,filename:S,size:N,downloadUrl:C},t[35]=y,t[36]=S,t[37]=N,t[38]=C,t[39]=k):k=t[39];let $;t[40]!==b||t[41]!==k?($=s.jsx(b,{file:k}),t[40]=b,t[41]=k,t[42]=$):$=t[42];let H;t[43]!==$||t[44]!==v?(H=s.jsx("div",{className:v,children:$}),t[43]=$,t[44]=v,t[45]=H):H=t[45];let A;t[46]!==h||t[47]!==j?(A=j&&s.jsx(Re,{previewPath:`${Y}/${h.path}`,onClose:()=>x(!1),showSeeInLibrary:!0}),t[46]=h,t[47]=j,t[48]=A):A=t[48];let T;return t[49]!==d||t[50]!==H||t[51]!==A||t[52]!==w?(T=s.jsxs("section",{className:w,children:[d,H,A]}),t[49]=d,t[50]=H,t[51]=A,t[52]=w,t[53]=T):T=t[53],T}function xe(t){return t<12?"morning":t<18?"afternoon":"evening"}function je(t){const e=(t??"").trim().split(/\s+/)[0];return e||null}function gt(t,e){return e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long"})}function ht(t){return t==="morning"?"overnight":"today"}function xt(t,e){const o=new Date(e);return o.setHours(0,0,0,0),t==="morning"&&o.setHours(-6),o.getTime()}const jt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function bt(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ne,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function yt(t,e,o,i,n){const l=ht(o)==="overnight",a=[];if(e>0){const r=t(e===1?"home.brief.changeOne":"home.brief.changeMany",{count:e});a.push(t(l?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:r}))}else i===0&&a.push(t(n>0?"home.brief.working":l?"home.brief.quietNight":"home.brief.quietDay"));return a.push(i===0?t("home.brief.waitingNone"):t(i===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:i})),a.join(" ")}function _t(t){const e=P.c(41),{canManageProjects:o,eyebrow:i,greeting:n,slot:l}=t,a=B(),{org:r}=q(),{data:c}=U.useSession();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:1e3},e[0]=m):m=e[0];const f=de(m),u=$e(),g=qe(),{recent:p}=We(r.slug);let j,x;if(e[1]!==f||e[2]!==o||e[3]!==r.id){x=Symbol.for("react.early_return_sentinel");e:{let H;e[6]!==r.id?(H=T=>T.id!==r.id,e[6]=r.id,e[7]=H):H=e[7];const A=ue(f).filter(H);if(A.length===0){let T;e[8]!==o?(T=s.jsx(Ue,{canCreate:o}),e[8]=o,e[9]=T):T=e[9],x=T;break e}j=fe(A)}e[1]=f,e[2]=o,e[3]=r.id,e[4]=j,e[5]=x}else j=e[4],x=e[5];if(x!==Symbol.for("react.early_return_sentinel"))return x;const b=j;let h,d;e[10]!==c?.user?.id||e[11]!==l||e[12]!==a||e[13]!==u?(d=ze(u,c?.user?.id),h=yt(a,Ke(u,xt(l,new Date)),l,d.length,Ge(u).length),e[10]=c?.user?.id,e[11]=l,e[12]=a,e[13]=u,e[14]=h,e[15]=d):(h=e[14],d=e[15]);const _=h;let y;e[16]!==i?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[16]=i,e[17]=y):y=e[17];let S;e[18]!==_||e[19]!==n?(S=s.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[n," ",_]}),e[18]=_,e[19]=n,e[20]=S):S=e[20];let N;e[21]!==y||e[22]!==S?(N=s.jsxs("div",{className:"flex flex-col gap-1",children:[y,S]}),e[21]=y,e[22]=S,e[23]=N):N=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(pt,{}),e[24]=C):C=e[24];let v;e[25]!==g.updates||e[26]!==b||e[27]!==r.slug||e[28]!==u||e[29]!==d?(v=s.jsx(Ce,{waiting:d,tasks:u,mentions:g.updates,index:b,orgSlug:r.slug}),e[25]=g.updates,e[26]=b,e[27]=r.slug,e[28]=u,e[29]=d,e[30]=v):v=e[30];let w;e[31]!==r.slug||e[32]!==p?(w=s.jsx(He,{recent:p,orgSlug:r.slug}),e[31]=r.slug,e[32]=p,e[33]=w):w=e[33];let k;e[34]!==u?(k=s.jsx(Te,{tasks:u}),e[34]=u,e[35]=k):k=e[35];let $;return e[36]!==w||e[37]!==k||e[38]!==N||e[39]!==v?($=s.jsxs("div",{className:"flex flex-col gap-8",children:[N,C,v,w,k]}),e[36]=w,e[37]=k,e[38]=N,e[39]=v,e[40]=$):$=e[40],$}function St(){const t=P.c(25),e=B(),[o]=oe(),i=ce("home_task_intake_enabled"),{data:n}=U.useSession(),{granted:l}=re("agents:manage");let a,r,c;if(t[0]!==o.language||t[1]!==n?.user?.name||t[2]!==e){const d=new Date,_=je(n?.user?.name);r=xe(d.getHours());const y=jt[r];a=gt(o.language,d),c=_?e(y.named,{name:_}):e(y.bare),t[0]=o.language,t[1]=n?.user?.name,t[2]=e,t[3]=a,t[4]=r,t[5]=c}else a=t[3],r=t[4],c=t[5];const m=c;let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{}),t[6]=f):f=t[6];let u;t[7]!==l?(u=l&&s.jsx(Ye,{source:"org_home_header"}),t[7]=l,t[8]=u):u=t[8];let g;t[9]!==u?(g=s.jsx(M.Actions,{secondary:f,children:u}),t[9]=u,t[10]=g):g=t[10];let p;t[11]!==i?(p=i&&s.jsx(I.Suspense,{fallback:null,children:s.jsx(le,{children:s.jsx(ae,{children:s.jsx(ie,{homeTaskComposer:!0})})})}),t[11]=i,t[12]=p):p=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(bt,{}),t[13]=j):j=t[13];let x;t[14]!==l||t[15]!==a||t[16]!==m||t[17]!==r?(x=s.jsx(I.Suspense,{fallback:j,children:s.jsx(_t,{canManageProjects:l,eyebrow:a,greeting:m,slot:r})}),t[14]=l,t[15]=a,t[16]=m,t[17]=r,t[18]=x):x=t[18];let b;t[19]!==p||t[20]!==x?(b=s.jsx(M.Content,{children:s.jsxs(M.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[p,x]})}),t[19]=p,t[20]=x,t[21]=b):b=t[21];let h;return t[22]!==g||t[23]!==b?(h=s.jsxs(M,{children:[g,b]}),t[22]=g,t[23]=b,t[24]=h):h=t[24],h}function Nt(t){const e=P.c(13),{label:o,count:i,action:n,children:l}=t;let a;e[0]!==i?(a=i!==void 0&&i>0&&s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:i}),e[0]=i,e[1]=a):a=e[1];let r;e[2]!==o||e[3]!==a?(r=s.jsxs("h2",{className:"flex items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[o,a]}),e[2]=o,e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n||e[6]!==r?(c=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[r,n]}),e[5]=n,e[6]=r,e[7]=c):c=e[7];let m;e[8]!==l?(m=s.jsx("ul",{className:"flex flex-col divide-y divide-border/70",children:l}),e[8]=l,e[9]=m):m=e[9];let f;return e[10]!==c||e[11]!==m?(f=s.jsxs("section",{className:"@container flex flex-col overflow-hidden surface",children:[c,m]}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f}function be(t){const e=P.c(5),{children:o,className:i}=t;let n;e[0]!==i?(n=W("px-5 py-3.5 transition-colors hover:bg-accent",i),e[0]=i,e[1]=n):n=e[1];let l;return e[2]!==o||e[3]!==n?(l=s.jsx("li",{className:n,children:o}),e[2]=o,e[3]=n,e[4]=l):l=e[4],l}const vt=56,kt=16;function wt(t){const e=P.c(28),{series:o,className:i,label:n,height:l,stretch:a}=t,r=l===void 0?kt:l,c=a===void 0?!1:a,m=Math.max(...o);if(o.length<2||m<=0)return null;const f=c?o.length*8:vt,u=f/(o.length-1);let g;if(e[0]!==r||e[1]!==m||e[2]!==o||e[3]!==u){let N;e[5]!==r||e[6]!==m||e[7]!==u?(N=(v,w)=>({x:w*u,y:r-1-v/m*(r-2)}),e[5]=r,e[6]=m,e[7]=u,e[8]=N):N=e[8],g=o.map(N).map($t).join(" "),e[0]=r,e[1]=m,e[2]=o,e[3]=u,e[4]=g}else g=e[4];const p=g,j=`0 0 ${f} ${r}`,x=c?void 0:f,b=c?"none":void 0,h=c?"w-full":"shrink-0 overflow-visible";let d;e[9]!==i||e[10]!==h?(d=W(h,i),e[9]=i,e[10]=h,e[11]=d):d=e[11];let _;e[12]!==r||e[13]!==p||e[14]!==c||e[15]!==f?(_=c&&s.jsx("polygon",{points:`0,${r} ${p} ${f},${r}`,fill:"currentColor",opacity:.12}),e[12]=r,e[13]=p,e[14]=c,e[15]=f,e[16]=_):_=e[16];let y;e[17]!==p?(y=s.jsx("polyline",{points:p,fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[17]=p,e[18]=y):y=e[18];let S;return e[19]!==r||e[20]!==n||e[21]!==y||e[22]!==j||e[23]!==x||e[24]!==b||e[25]!==d||e[26]!==_?(S=s.jsxs("svg",{viewBox:j,width:x,height:r,role:"img","aria-label":n,preserveAspectRatio:b,className:d,children:[_,y]}),e[19]=r,e[20]=n,e[21]=y,e[22]=j,e[23]=x,e[24]=b,e[25]=d,e[26]=_,e[27]=S):S=e[27],S}function $t(t){const{x:e,y:o}=t;return`${e.toFixed(1)},${o.toFixed(1)}`}const Ct={waiting:{labelKey:"home.projects.headlineWaiting",className:"text-foreground"},failed:{labelKey:"home.projects.headlineFailed",className:"text-destructive"},shipped:{labelKey:"home.projects.headlineShipped",className:"text-muted-foreground"},open:{labelKey:"home.projects.headlineOpen",className:"text-muted-foreground"}},te=6;function Ht(t){const e=P.c(10),{value:o,previous:i}=t,n=o-i;if(n===0)return null;const l=n>0?et:tt,a=n>0?"text-success":"text-muted-foreground";let r;e[0]!==a?(r=W("inline-flex items-center text-xs tabular-nums",a),e[0]=a,e[1]=r):r=e[1];let c;e[2]!==l?(c=s.jsx(l,{width:11,height:11,"aria-hidden":!0}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==n?(m=Math.abs(n),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==r||e[7]!==c||e[8]!==m?(f=s.jsxs("span",{className:r,children:[c,m]}),e[6]=r,e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Tt(t){const e=P.c(52),{project:o,summary:i,series:n}=t,l=B(),a=st();let r;e[0]!==o?(r=ot(rt(o).storeUrl),e[0]=o,e[1]=r):r=e[1];const c=r,m=i&&i.kind!=="quiet"?Ct[i.kind]:null,f=n.reduce(Et,0),u=Math.floor(n.length/2);let g;e[2]!==u||e[3]!==n?(g=n.slice(0,u).reduce(Pt,0),e[2]=u,e[3]=n,e[4]=g):g=e[4];const p=g;let j;e[5]!==u||e[6]!==n?(j=n.slice(u).reduce(At,0),e[5]=u,e[6]=n,e[7]=j):j=e[7];const x=j,b=o.title;let h;e[8]!==a||e[9]!==o.id?(h=()=>{Z("org_home_project_clicked"),a(o.id)},e[8]=a,e[9]=o.id,e[10]=h):h=e[10];let d;e[11]!==o.icon||e[12]!==o.title?(d=s.jsx(Ie,{icon:o.icon,name:o.title,size:"xs"}),e[11]=o.icon,e[12]=o.title,e[13]=d):d=e[13];let _;e[14]!==o.title?(_=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:o.title}),e[14]=o.title,e[15]=_):_=e[15];let y;e[16]!==m||e[17]!==c||e[18]!==i||e[19]!==l?(y=m&&i?l(m.labelKey,{count:i.count}):c??l("home.projects.quiet"),e[16]=m,e[17]=c,e[18]=i,e[19]=l,e[20]=y):y=e[20];let S;e[21]!==y?(S=s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:y}),e[21]=y,e[22]=S):S=e[22];let N;e[23]!==_||e[24]!==S?(N=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[_,S]}),e[23]=_,e[24]=S,e[25]=N):N=e[25];let C;e[26]!==o.title||e[27]!==l?(C=l("home.projects.rhythm",{name:o.title}),e[26]=o.title,e[27]=l,e[28]=C):C=e[28];let v;e[29]!==n||e[30]!==C?(v=s.jsx(wt,{series:n,className:"text-muted-foreground/60",label:C}),e[29]=n,e[30]=C,e[31]=v):v=e[31];const w=f>0?"text-foreground":"text-muted-foreground";let k;e[32]!==w?(k=W("text-sm tabular-nums",w),e[32]=w,e[33]=k):k=e[33];let $;e[34]!==f||e[35]!==k?($=s.jsx("span",{className:k,children:f}),e[34]=f,e[35]=k,e[36]=$):$=e[36];let H;e[37]!==x||e[38]!==p?(H=s.jsx(Ht,{value:x,previous:p}),e[37]=x,e[38]=p,e[39]=H):H=e[39];let A;e[40]!==$||e[41]!==H?(A=s.jsxs("span",{className:"flex w-10 shrink-0 flex-col items-end",children:[$,H]}),e[40]=$,e[41]=H,e[42]=A):A=e[42];let T;e[43]!==v||e[44]!==A?(T=s.jsxs("span",{className:"flex shrink-0 items-center gap-2.5",children:[v,A]}),e[43]=v,e[44]=A,e[45]=T):T=e[45];let E;return e[46]!==o.title||e[47]!==N||e[48]!==T||e[49]!==h||e[50]!==d?(E=s.jsx(be,{className:"transition-colors hover:bg-accent",children:s.jsxs("button",{type:"button","aria-label":b,onClick:h,className:"flex w-full min-w-0 items-center gap-3 text-left",children:[d,N,T]})}),e[46]=o.title,e[47]=N,e[48]=T,e[49]=h,e[50]=d,e[51]=E):E=e[51],E}function At(t,e){return t+e}function Pt(t,e){return t+e}function Et(t,e){return t+e}const Bt=new Map,Dt=new Map;function Mt(t){const e=P.c(30),{projects:o,summaries:i,series:n}=t,l=i===void 0?Bt:i,a=n===void 0?Dt:n,r=B(),{org:c}=q();let m,f,u,g,p,j;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==r){const h=[...o].sort(It).slice(0,te);f=o.length>te,m=Nt,e[10]!==r?(u=r("home.projects.heading"),e[10]=r,e[11]=u):u=e[11],g=o.length;let d;e[12]!==r?(d=r("home.projects.shippedCaption"),e[12]=r,e[13]=d):d=e[13],e[14]!==d?(p=s.jsx("span",{className:"hidden whitespace-nowrap text-xs text-muted-foreground @[19rem]:inline",children:d}),e[14]=d,e[15]=p):p=e[15];let _;e[16]!==a||e[17]!==l?(_=y=>s.jsx(Tt,{project:y,summary:l.get(y.id),series:a.get(y.id)??[]},y.id),e[16]=a,e[17]=l,e[18]=_):_=e[18],j=h.map(_),e[0]=o,e[1]=a,e[2]=l,e[3]=r,e[4]=m,e[5]=f,e[6]=u,e[7]=g,e[8]=p,e[9]=j}else m=e[4],f=e[5],u=e[6],g=e[7],p=e[8],j=e[9];let x;e[19]!==f||e[20]!==c||e[21]!==r?(x=f&&s.jsx(be,{className:"py-2",children:s.jsx(ye,{to:"/$org/settings/projects",params:{org:c.slug},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:r("home.projects.seeAll")})}),e[19]=f,e[20]=c,e[21]=r,e[22]=x):x=e[22];let b;return e[23]!==m||e[24]!==u||e[25]!==g||e[26]!==p||e[27]!==j||e[28]!==x?(b=s.jsxs(m,{label:u,count:g,action:p,children:[j,x]}),e[23]=m,e[24]=u,e[25]=g,e[26]=p,e[27]=j,e[28]=x,e[29]=b):b=e[29],b}function It(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ft(){const t=P.c(10),{org:e}=q(),o=_e();let i;t[0]!==e.id?(i=Se.orgHasSite(e.id),t[0]=e.id,t[1]=i):i=t[1];const n=!!e.id;let l;t[2]!==o?(l=()=>o.call("ORGANIZATION_HAS_SITE",{}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==i||t[5]!==n||t[6]!==l?(a={queryKey:i,staleTime:3e5,enabled:n,queryFn:l},t[4]=i,t[5]=n,t[6]=l,t[7]=a):a=t[7];const{data:r}=Ne(a),c=r?.hasSite??!1;let m;return t[8]!==c?(m={hasSite:c},t[8]=c,t[9]=m):m=t[9],m}const Lt="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function Ot(t){const e=P.c(4),{className:o}=t;let i,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),n=s.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),e[0]=i,e[1]=n):(i=e[0],n=e[1]);let l;return e[2]!==o?(l=s.jsxs("svg",{viewBox:"0 0 28 20",className:o,"aria-hidden":"true",focusable:"false",children:[i,n]}),e[2]=o,e[3]=l):l=e[3],l}function Rt(){const t=P.c(27),e=B(),{hasSite:o}=Ft();if(!o)return null;let i;t[0]!==e?(i=e("home.orgHome.trainingThumbnailAlt"),t[0]=e,t[1]=i):i=t[1];let n;t[2]!==i?(n=s.jsx("img",{src:"/cms-training.jpg",alt:i,className:"size-full object-cover"}),t[2]=i,t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:s.jsx(Ot,{className:"w-9"})}),t[4]=l):l=t[4];let a;t[5]!==n?(a=s.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[n,l]}),t[5]=n,t[6]=a):a=t[6];let r;t[7]!==e?(r=e("home.orgHome.trainingEyebrow"),t[7]=e,t[8]=r):r=t[8];let c;t[9]!==r?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:r}),t[9]=r,t[10]=c):c=t[10];let m;t[11]!==e?(m=e("home.orgHome.trainingTitle"),t[11]=e,t[12]=m):m=t[12];let f;t[13]!==m?(f=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:m}),t[13]=m,t[14]=f):f=t[14];let u;t[15]!==e?(u=e("home.orgHome.trainingDescription"),t[15]=e,t[16]=u):u=t[16];let g;t[17]!==u?(g=s.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=g):g=t[18];let p;t[19]!==c||t[20]!==f||t[21]!==g?(p=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,f,g]}),t[19]=c,t[20]=f,t[21]=g,t[22]=p):p=t[22];let j;t[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(nt,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[23]=j):j=t[23];let x;return t[24]!==p||t[25]!==a?(x=s.jsxs("a",{href:Lt,target:"_blank",rel:"noreferrer",onClick:zt,className:"group shadow-edge flex w-full items-center gap-4 rounded-2xl bg-card p-4 text-left transition-colors hover:bg-accent",children:[a,p,j]}),t[24]=p,t[25]=a,t[26]=x):x=t[26],x}function zt(){return Z("cms_training_opened",{source:"org_home"})}const Gt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Kt(){const t=P.c(8),e=B();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{className:"size-4 shrink-0 text-muted-foreground"}),t[0]=o):o=t[0];let i;t[1]!==e?(i=e("home.orgHome.searchPlaceholder"),t[1]=e,t[2]=i):i=t[2];let n;t[3]!==i?(n=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:i}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:"⌘K"}),t[5]=l):l=t[5];let a;return t[6]!==n?(a=s.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:Yt,className:"shadow-edge flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[o,n,l]}),t[6]=n,t[7]=a):a=t[7],a}function Yt(){Z("command_palette_opened",{source:"org_home_search"}),Qe()}function se(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ne,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Ut(t){const e=P.c(28),{canManageAgents:o}=t,i=B(),{org:n}=q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={pageSize:1e3},e[0]=l):l=e[0];const a=de(l),r=Ae();let c,m,f;if(e[1]!==a||e[2]!==o||e[3]!==n||e[4]!==i||e[5]!==r){f=Symbol.for("react.early_return_sentinel");e:{let x;if(e[9]!==n?(x=b=>b.id!==n.id,e[9]=n,e[10]=x):x=e[10],c=ue(a).filter(x),c.length===0){let b;e[11]!==i?(b=i("routes.agentsList.noAgentsYet"),e[11]=i,e[12]=b):b=e[12];let h;e[13]!==o||e[14]!==i?(h=i(o?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),e[13]=o,e[14]=i,e[15]=h):h=e[15];let d;e[16]!==b||e[17]!==h?(d=s.jsx("div",{className:"flex items-center justify-center py-10",children:s.jsx(Xe,{actions:!1,image:null,title:b,description:h})}),e[16]=b,e[17]=h,e[18]=d):d=e[18],f=d;break e}m=Pe(fe(c),r,null)}e[1]=a,e[2]=o,e[3]=n,e[4]=i,e[5]=r,e[6]=c,e[7]=m,e[8]=f}else c=e[6],m=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;const u=m.length>0;let g;e[19]!==c?(g=s.jsx(Mt,{projects:c}),e[19]=c,e[20]=g):g=e[20];let p;e[21]!==c||e[22]!==u||e[23]!==r?(p=u&&s.jsx(Ee,{projects:c,tasks:r}),e[21]=c,e[22]=u,e[23]=r,e[24]=p):p=e[24];let j;return e[25]!==g||e[26]!==p?(j=s.jsxs("div",{className:"flex flex-col gap-12",children:[g,p]}),e[25]=g,e[26]=p,e[27]=j):j=e[27],j}function qt(){const t=P.c(55),e=B(),o=ce("home_task_intake_enabled"),{data:i}=U.useSession(),[n,l]=I.useState(!1),{granted:a}=re("agents:manage");let r,c,m,f,u,g,p,j,x,b,h,d;if(t[0]!==a||t[1]!==i?.user?.name||t[2]!==e){const A=je(i?.user?.name),T=Gt[xe(new Date().getHours())];let E;t[15]!==e?(E=R=>s.jsxs(ve,{size:"sm",variant:"default",onClick:()=>{Z("agent_create_clicked",{source:R,method:"github"}),l(!0)},children:[s.jsx(Ze,{size:14}),e("home.orgAgents.importFromGitHub")]}),t[15]=e,t[16]=E):E=t[16];const D=E;m=M,t[17]!==a||t[18]!==D?(d=a&&s.jsx(M.Actions,{children:D("org_home")}),t[17]=a,t[18]=D,t[19]=d):d=t[19],c=M.Content,r=M.Container,b="reading",h="flex flex-col gap-12",p="flex flex-col items-center gap-12 text-center",t[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(me,{dense:!1}),x=s.jsx(Rt,{}),t[20]=j,t[21]=x):(j=t[20],x=t[21]),g="flex w-full flex-col items-center gap-5",f="text-3xl font-medium tracking-tight text-foreground",u=A?e(T.named,{name:A}):e(T.bare),t[0]=a,t[1]=i?.user?.name,t[2]=e,t[3]=r,t[4]=c,t[5]=m,t[6]=f,t[7]=u,t[8]=g,t[9]=p,t[10]=j,t[11]=x,t[12]=b,t[13]=h,t[14]=d}else r=t[3],c=t[4],m=t[5],f=t[6],u=t[7],g=t[8],p=t[9],j=t[10],x=t[11],b=t[12],h=t[13],d=t[14];let _;t[22]!==f||t[23]!==u?(_=s.jsx("h2",{className:f,children:u}),t[22]=f,t[23]=u,t[24]=_):_=t[24];let y;t[25]!==o?(y=o?s.jsx(I.Suspense,{fallback:s.jsx(se,{}),children:s.jsx(le,{children:s.jsx(ae,{children:s.jsx(ie,{homeTaskComposer:!0})})})}):s.jsx(Kt,{}),t[25]=o,t[26]=y):y=t[26];let S;t[27]!==y||t[28]!==g||t[29]!==_?(S=s.jsxs("div",{className:g,children:[_,y]}),t[27]=y,t[28]=g,t[29]=_,t[30]=S):S=t[30];let N;t[31]!==S||t[32]!==p||t[33]!==j||t[34]!==x?(N=s.jsxs("div",{className:p,children:[j,x,S]}),t[31]=S,t[32]=p,t[33]=j,t[34]=x,t[35]=N):N=t[35];let C;t[36]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(se,{}),t[36]=C):C=t[36];let v;t[37]!==a?(v=s.jsx(I.Suspense,{fallback:C,children:s.jsx(Ut,{canManageAgents:a})}),t[37]=a,t[38]=v):v=t[38];let w;t[39]!==r||t[40]!==N||t[41]!==v||t[42]!==b||t[43]!==h?(w=s.jsxs(r,{width:b,className:h,children:[N,v]}),t[39]=r,t[40]=N,t[41]=v,t[42]=b,t[43]=h,t[44]=w):w=t[44];let k;t[45]!==c||t[46]!==w?(k=s.jsx(c,{children:w}),t[45]=c,t[46]=w,t[47]=k):k=t[47];let $;t[48]!==n?($=s.jsx(Je,{open:n,onOpenChange:l}),t[48]=n,t[49]=$):$=t[49];let H;return t[50]!==m||t[51]!==k||t[52]!==$||t[53]!==d?(H=s.jsxs(m,{children:[d,k,$]}),t[50]=m,t[51]=k,t[52]=$,t[53]=d,t[54]=H):H=t[54],H}function Wt(){return ke()?s.jsx(St,{}):s.jsx(qt,{})}function qr(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(we.Content,{children:s.jsx(Wt,{})}),t[0]=e):e=t[0],e}export{qr as default};
|
|
1
|
+
import{c as P,b as B,H as oe,a as U,r as I,j as s,ap as re,n as M,a4 as q,h as ne,l as W,L as ye,C as Z,aq as _e,K as Se,m as Ne,B as ve,ad as ke}from"./index-EliiQy8F.js";import{C as we}from"./index-CA5RM9Ec.js";import{b as ie}from"./input-B0c9nfkY.js";import{D as le,a as ae}from"./chat-context-sl1KTpQd.js";import{a as ce}from"./use-organization-settings-CzOI8f3j.js";import{C as me,u as $e,F as Ce,R as He,M as Te,a as Ae,b as Pe,P as Ee}from"./project-feed-DeoXRUyG.js";import{I as Be}from"./icon-button-B-KIq-fr.js";import{a as De,T as X}from"./toggle-group-CE0WeWgb.js";import{P as Me,A as Ie}from"./agent-icon-C6UYAbL1.js";import{i as Fe}from"./sprints-C1z9xhcL.js";import{F as Le}from"./file-preview-D73r-xXC.js";import{u as J,a as Oe}from"./use-org-fs-CDBJkmmk.js";import{L as Re}from"./preview-dialog-CUTHFrjI.js";import{a as ze,r as Ge,s as Ke}from"./daily-pulse-D18xpih6.js";import{N as Ye}from"./new-project-dialog-BZZpSwA-.js";import{P as Ue}from"./projects-empty-state-BwBQ9JoR.js";import{b as fe}from"./task-route-BL-xHFP_.js";import{u as qe}from"./use-inbox-feed-Dpkw_y-b.js";import{b as We}from"./use-recent-apps-C8yvrn2T.js";import{s as ue}from"./use-project-scope-B5PWWx8O.js";import{b as de}from"./repository-binding-DeVr2_qp.js";import{s as Ze}from"./Plus-B0PQxljQ.js";import{i as Ve}from"./UserSquare-BpxduWsZ.js";import{E as Xe}from"./empty-state-BSi85_uG.js";import{R as Je}from"./repository-import-picker-C_XrxsQw.js";import{o as Qe}from"./shell-layout-C_jaX4Op.js";import{i as et,n as tt}from"./ArrowUp-BoU1ERbw.js";import{u as st}from"./use-navigate-to-agent-_nUw_yzG.js";import{s as ot,r as rt}from"./project-profile-Cc4MG3QN.js";import{i as nt}from"./LinkBroken01-CR5rvaUu.js";import"./use-mobile-RfYnH7Kg.js";import"./use-sidebar-collapsed-bSn7ZzoI.js";import"./use-chat-layout-state-BA-SUqJB.js";import"./thread-route-CL0KLr9P.js";import"./use-panel-navigate-BQgIP8By.js";import"./thread-intent-D3tgb7QP.js";import"./use-mcp-client-65fBiITE.js";import"./auth-DslO7-2v.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C4lJ-KFb.js";import"./task-board-dne5ekjX.js";import"./schema-BCxy_r83.js";import"./slugify-CEUa2lfQ.js";import"./tooltip-BdAcWCQB.js";import"./index-Dn6q5XKw.js";import"./toolbar-icon-button-YbqBAwgD.js";import"./sheet-tPLtd5I9.js";import"./resizable-CutHeLA4.js";import"./usage-stats-BOyKAWNQ.js";import"./tool-namespace-Cgkt4ubz.js";import"./form-CZ-DjqQe.js";import"./label-1jelUIHf.js";import"./utils-CVEq3hMx.js";import"./markdown-CJLAbu6m.js";import"./use-copy-DVWZxbU6.js";import"./Copy01-DS9lGb58.js";import"./ZoomOut-OKmGcwkm.js";import"./location-V0VwTJTt.js";import"./use-decopilot-events-BVppfqa_.js";import"./XClose-Cjq1Yd0C.js";import"./file-type-icon-2pGdNJEW.js";import"./autosend-CEM0KXFN.js";import"./chat-draft-LiDr80Vh.js";import"./use-session-runtime-W1lGtTrc.js";import"./ShoppingBag01-BXOuVd17.js";import"./Image01-Cvoerggt.js";import"./Upload01-nRiRcfq_.js";import"./AlertCircle-CQDuYbHx.js";import"./select-BD6nyHzt.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DWPDxPyO.js";import"./ArrowLeft-CQV-OFXB.js";import"./tabs-CORjkMEF.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-OQ9LXXDC.js";import"./use-ai-providers-Ciop1Z20.js";import"./index-vMyA_V3k.js";import"./checkbox-B4why7U2.js";import"./Minus-C3iyYMPp.js";import"./ChevronSelectorVertical-BsI2BvZW.js";import"./Key01-DngMmJw0.js";import"./Tool01-CeUuQ3Bv.js";import"./SearchMd-CMexoeE6.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-3T2xT1z_.js";import"./popover-B3zmxk6Q.js";import"./drawer-Bus2z-u1.js";import"./input-rsmTEOVU.js";import"./suggestion-BuBMXsQG.js";import"./use-mcp-prompts-DVkjtK5z.js";import"./Link01-BAoePdIy.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-Ce3iwCZE.js";import"./plan-ladder-1-Y0pztZ.js";import"./add-connection-dialog-DeIX0b2D.js";import"./collection-search-BcqK6hVT.js";import"./extract-connection-data-DKCvR6nI.js";import"./metadata-D72DunRR.js";import"./connection-3GzCgGT8.js";import"./url-slug-DG4ofUf-.js";import"./connection-card-dJ4rD6pz.js";import"./useInfiniteQuery-wQNAXyiV.js";import"./infiniteQueryObserver-D6cV9HaR.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-VQ6MFcQg.js";import"./textarea-BvV_cNLl.js";import"./use-connection-B48U4I0u.js";import"./schema-DeMY_MYw.js";import"./connection-form-helpers-DyowCZUL.js";import"./Trash01-BbOQUio8.js";import"./authenticate-and-persist-oauth-_2Sr61D2.js";import"./mcp-oauth-7oWaySV-.js";import"./mcp-oauth-DUd2f4kQ.js";import"./collection-tabs-OauVxAju.js";import"./badge-CX1RcN27.js";import"./use-infinite-scroll-Dbv8EZVp.js";import"./useSuspenseInfiniteQuery-YLjK0oOB.js";import"./use-task-board-events-CdZKcZ1E.js";import"./client-icons-D6YU6guR.js";import"./CheckCircle-D3D41Pik.js";import"./chart-DnbaqPhj.js";import"./index-CgBepWXx.js";import"./symbol-CBnirETN.js";import"./CategoricalChart-C4G7a2u4.js";import"./project-icon-CH8PzkOZ.js";import"./project-apps-Lq1M5-7q.js";import"./config-DgWxtnKx.js";import"./core.esm-OXFIZWpS.js";import"./ReferenceLine-CbAHGoP6.js";import"./CartesianChart-5_Kpllvp.js";import"./BarChart--Ja0-zvd.js";import"./tooltipContext-D6ivquCn.js";import"./ActiveShapeUtils-DU-J2JOI.js";import"./Sector-CTb-njCu.js";import"./ErrorBarContext-C6hvNFGf.js";import"./repository-picker-kswXqrhy.js";import"./use-debounced-value-Aaz50L2R.js";import"./task-assignee-avatar-BwB_J47Q.js";import"./task-key-BCHdFiOO.js";import"./Building02-BIRm8BPt.js";import"./CreditCard01-hd-oFdcf.js";import"./DotsVertical-r0-ueEFT.js";import"./Globe04-ChxDgA5I.js";import"./SwitchHorizontal01-zY1Mo909.js";import"./Sun-Co7E93aF.js";import"./Play-FJBV2LIw.js";import"./Users01-DK48xnSB.js";import"./utils-DtMi2WDq.js";import"./editor-BarPw5uJ.js";import"./preview-content-B-_3eTxG.js";import"./file-share-button-5a7ER95I.js";import"./use-deployment-admin-SWAoQ8Nx.js";import"./admin-fetch-BhTJlAsX.js";import"./use-clock-tick-BhFHy3Sj.js";import"./command-BNuC9MU2.js";import"./index-BpZqQCv-.js";import"./required-auth-layout-DXz6YWOV.js";import"./use-org-sso-D0PKMzaC.js";const Y="home",pe="brief";function ge(t){return`users/${t}/brief`}function it(t,e){return`${t}/${e}.html`}function lt(t){const e=String(t.getFullYear()).padStart(4,"0"),o=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${e}-${o}-${i}`}function at(t){if(!t.endsWith(".html"))return null;const e=t.slice(0,-5);return Fe(e)?e:null}const ct=7;function he(t,e){return Math.round((Date.parse(`${e}T00:00:00Z`)-Date.parse(`${t}T00:00:00Z`))/864e5)}function mt(t,e){let o=null;for(const i of t){const n=at(i);if(!n||o&&n<=o.day)continue;const l=he(n,e);l>=0&&l<ct&&(o={name:i,day:n})}return o}const Q=t=>t.slice(t.lastIndexOf("/")+1);function ee(t,e,o,i){const n=o.filter(r=>r.kind==="file"),l=mt(n.map(r=>Q(r.path)),i),a=l&&n.find(r=>Q(r.path)===l.name);return l&&a?{scope:t,path:it(e,l.day),filename:l.name,size:a.size,day:l.day,ageDays:he(l.day,i)}:null}function ft({userId:t,personal:e,org:o,today:i}){return[t?ee("personal",ge(t),e,i):null,ee("org",pe,o,i)].filter(n=>n!==null)}function ut(t,e){return e===0?t("home.dailyBrief.today"):e===1?t("home.dailyBrief.yesterday"):t("home.dailyBrief.daysAgo",{count:e})}function dt(t,e){return new Date(`${e}T12:00:00Z`).toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"})}function pt(){const t=P.c(54),e=B(),[o]=oe(),{data:i}=U.useSession(),n=i?.user?.id,l=J(Y,pe),a=n??"";let r;t[0]!==a?(r=ge(a),t[0]=a,t[1]=r):r=t[1];const c=!!n;let m;t[2]!==c?(m={enabled:c},t[2]=c,t[3]=m):m=t[3];const f=J(Y,r,m),u=Oe(Y),[g,p]=I.useState(null),[j,x]=I.useState(!1);let b,h,d,_,y,S,N,C,v,w;if(t[4]!==l.data||t[5]!==f.data||t[6]!==o||t[7]!==u||t[8]!==g||t[9]!==e||t[10]!==n){_=Symbol.for("react.early_return_sentinel");e:{const E=ft({userId:n,personal:f.data??[],org:l.data??[],today:lt(new Date)});if(h=E.find(z=>z.scope===g)??E[0],!h){_=null;break e}w="flex flex-col overflow-hidden surface";let D;t[21]!==e?(D=e("home.dailyBrief.title"),t[21]=e,t[22]=D):D=t[22];const R=s.jsxs("h2",{className:"flex min-w-0 items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[D,s.jsxs("span",{className:"truncate text-xs font-normal text-muted-foreground",children:[ut(e,h.ageDays)," ·"," ",dt(o.language,h.day)]})]}),V=E.length>1&&s.jsxs(De,{type:"single",variant:"segmented",size:"sm",value:h.scope,onValueChange:z=>{(z==="personal"||z==="org")&&p(z)},children:[s.jsx(X,{value:"personal",className:"px-2.5 text-xs",children:e("home.dailyBrief.personal")}),s.jsx(X,{value:"org",className:"px-2.5 text-xs",children:e("home.dailyBrief.org")})]});let F;t[23]!==e?(F=e("home.dailyBrief.fullscreen"),t[23]=e,t[24]=F):F=t[24];let G,K;t[25]===Symbol.for("react.memo_cache_sentinel")?(G=()=>x(!0),K=s.jsx(Me,{size:14}),t[25]=G,t[26]=K):(G=t[25],K=t[26]);let L;t[27]!==F?(L=s.jsx(Be,{label:F,onClick:G,children:K}),t[27]=F,t[28]=L):L=t[28];let O;t[29]!==V||t[30]!==L?(O=s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[V,L]}),t[29]=V,t[30]=L,t[31]=O):O=t[31],t[32]!==R||t[33]!==O?(d=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[R,O]}),t[32]=R,t[33]=O,t[34]=d):d=t[34],v="h-[32rem]",b=Le,y=h.path,S=h.filename,N=h.size,C=u(h.path)}t[4]=l.data,t[5]=f.data,t[6]=o,t[7]=u,t[8]=g,t[9]=e,t[10]=n,t[11]=b,t[12]=h,t[13]=d,t[14]=_,t[15]=y,t[16]=S,t[17]=N,t[18]=C,t[19]=v,t[20]=w}else b=t[11],h=t[12],d=t[13],_=t[14],y=t[15],S=t[16],N=t[17],C=t[18],v=t[19],w=t[20];if(_!==Symbol.for("react.early_return_sentinel"))return _;let k;t[35]!==y||t[36]!==S||t[37]!==N||t[38]!==C?(k={key:y,filename:S,size:N,downloadUrl:C},t[35]=y,t[36]=S,t[37]=N,t[38]=C,t[39]=k):k=t[39];let $;t[40]!==b||t[41]!==k?($=s.jsx(b,{file:k}),t[40]=b,t[41]=k,t[42]=$):$=t[42];let H;t[43]!==$||t[44]!==v?(H=s.jsx("div",{className:v,children:$}),t[43]=$,t[44]=v,t[45]=H):H=t[45];let A;t[46]!==h||t[47]!==j?(A=j&&s.jsx(Re,{previewPath:`${Y}/${h.path}`,onClose:()=>x(!1),showSeeInLibrary:!0}),t[46]=h,t[47]=j,t[48]=A):A=t[48];let T;return t[49]!==d||t[50]!==H||t[51]!==A||t[52]!==w?(T=s.jsxs("section",{className:w,children:[d,H,A]}),t[49]=d,t[50]=H,t[51]=A,t[52]=w,t[53]=T):T=t[53],T}function xe(t){return t<12?"morning":t<18?"afternoon":"evening"}function je(t){const e=(t??"").trim().split(/\s+/)[0];return e||null}function gt(t,e){return e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long"})}function ht(t){return t==="morning"?"overnight":"today"}function xt(t,e){const o=new Date(e);return o.setHours(0,0,0,0),t==="morning"&&o.setHours(-6),o.getTime()}const jt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function bt(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ne,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function yt(t,e,o,i,n){const l=ht(o)==="overnight",a=[];if(e>0){const r=t(e===1?"home.brief.changeOne":"home.brief.changeMany",{count:e});a.push(t(l?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:r}))}else i===0&&a.push(t(n>0?"home.brief.working":l?"home.brief.quietNight":"home.brief.quietDay"));return a.push(i===0?t("home.brief.waitingNone"):t(i===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:i})),a.join(" ")}function _t(t){const e=P.c(41),{canManageProjects:o,eyebrow:i,greeting:n,slot:l}=t,a=B(),{org:r}=q(),{data:c}=U.useSession();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:1e3},e[0]=m):m=e[0];const f=de(m),u=$e(),g=qe(),{recent:p}=We(r.slug);let j,x;if(e[1]!==f||e[2]!==o||e[3]!==r.id){x=Symbol.for("react.early_return_sentinel");e:{let H;e[6]!==r.id?(H=T=>T.id!==r.id,e[6]=r.id,e[7]=H):H=e[7];const A=ue(f).filter(H);if(A.length===0){let T;e[8]!==o?(T=s.jsx(Ue,{canCreate:o}),e[8]=o,e[9]=T):T=e[9],x=T;break e}j=fe(A)}e[1]=f,e[2]=o,e[3]=r.id,e[4]=j,e[5]=x}else j=e[4],x=e[5];if(x!==Symbol.for("react.early_return_sentinel"))return x;const b=j;let h,d;e[10]!==c?.user?.id||e[11]!==l||e[12]!==a||e[13]!==u?(d=ze(u,c?.user?.id),h=yt(a,Ke(u,xt(l,new Date)),l,d.length,Ge(u).length),e[10]=c?.user?.id,e[11]=l,e[12]=a,e[13]=u,e[14]=h,e[15]=d):(h=e[14],d=e[15]);const _=h;let y;e[16]!==i?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[16]=i,e[17]=y):y=e[17];let S;e[18]!==_||e[19]!==n?(S=s.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[n," ",_]}),e[18]=_,e[19]=n,e[20]=S):S=e[20];let N;e[21]!==y||e[22]!==S?(N=s.jsxs("div",{className:"flex flex-col gap-1",children:[y,S]}),e[21]=y,e[22]=S,e[23]=N):N=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(pt,{}),e[24]=C):C=e[24];let v;e[25]!==g.updates||e[26]!==b||e[27]!==r.slug||e[28]!==u||e[29]!==d?(v=s.jsx(Ce,{waiting:d,tasks:u,mentions:g.updates,index:b,orgSlug:r.slug}),e[25]=g.updates,e[26]=b,e[27]=r.slug,e[28]=u,e[29]=d,e[30]=v):v=e[30];let w;e[31]!==r.slug||e[32]!==p?(w=s.jsx(He,{recent:p,orgSlug:r.slug}),e[31]=r.slug,e[32]=p,e[33]=w):w=e[33];let k;e[34]!==u?(k=s.jsx(Te,{tasks:u}),e[34]=u,e[35]=k):k=e[35];let $;return e[36]!==w||e[37]!==k||e[38]!==N||e[39]!==v?($=s.jsxs("div",{className:"flex flex-col gap-8",children:[N,C,v,w,k]}),e[36]=w,e[37]=k,e[38]=N,e[39]=v,e[40]=$):$=e[40],$}function St(){const t=P.c(25),e=B(),[o]=oe(),i=ce("home_task_intake_enabled"),{data:n}=U.useSession(),{granted:l}=re("agents:manage");let a,r,c;if(t[0]!==o.language||t[1]!==n?.user?.name||t[2]!==e){const d=new Date,_=je(n?.user?.name);r=xe(d.getHours());const y=jt[r];a=gt(o.language,d),c=_?e(y.named,{name:_}):e(y.bare),t[0]=o.language,t[1]=n?.user?.name,t[2]=e,t[3]=a,t[4]=r,t[5]=c}else a=t[3],r=t[4],c=t[5];const m=c;let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{}),t[6]=f):f=t[6];let u;t[7]!==l?(u=l&&s.jsx(Ye,{source:"org_home_header"}),t[7]=l,t[8]=u):u=t[8];let g;t[9]!==u?(g=s.jsx(M.Actions,{secondary:f,children:u}),t[9]=u,t[10]=g):g=t[10];let p;t[11]!==i?(p=i&&s.jsx(I.Suspense,{fallback:null,children:s.jsx(le,{children:s.jsx(ae,{children:s.jsx(ie,{homeTaskComposer:!0})})})}),t[11]=i,t[12]=p):p=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(bt,{}),t[13]=j):j=t[13];let x;t[14]!==l||t[15]!==a||t[16]!==m||t[17]!==r?(x=s.jsx(I.Suspense,{fallback:j,children:s.jsx(_t,{canManageProjects:l,eyebrow:a,greeting:m,slot:r})}),t[14]=l,t[15]=a,t[16]=m,t[17]=r,t[18]=x):x=t[18];let b;t[19]!==p||t[20]!==x?(b=s.jsx(M.Content,{children:s.jsxs(M.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[p,x]})}),t[19]=p,t[20]=x,t[21]=b):b=t[21];let h;return t[22]!==g||t[23]!==b?(h=s.jsxs(M,{children:[g,b]}),t[22]=g,t[23]=b,t[24]=h):h=t[24],h}function Nt(t){const e=P.c(13),{label:o,count:i,action:n,children:l}=t;let a;e[0]!==i?(a=i!==void 0&&i>0&&s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:i}),e[0]=i,e[1]=a):a=e[1];let r;e[2]!==o||e[3]!==a?(r=s.jsxs("h2",{className:"flex items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[o,a]}),e[2]=o,e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n||e[6]!==r?(c=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[r,n]}),e[5]=n,e[6]=r,e[7]=c):c=e[7];let m;e[8]!==l?(m=s.jsx("ul",{className:"flex flex-col divide-y divide-border/70",children:l}),e[8]=l,e[9]=m):m=e[9];let f;return e[10]!==c||e[11]!==m?(f=s.jsxs("section",{className:"@container flex flex-col overflow-hidden surface",children:[c,m]}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f}function be(t){const e=P.c(5),{children:o,className:i}=t;let n;e[0]!==i?(n=W("px-5 py-3.5 transition-colors hover:bg-accent",i),e[0]=i,e[1]=n):n=e[1];let l;return e[2]!==o||e[3]!==n?(l=s.jsx("li",{className:n,children:o}),e[2]=o,e[3]=n,e[4]=l):l=e[4],l}const vt=56,kt=16;function wt(t){const e=P.c(28),{series:o,className:i,label:n,height:l,stretch:a}=t,r=l===void 0?kt:l,c=a===void 0?!1:a,m=Math.max(...o);if(o.length<2||m<=0)return null;const f=c?o.length*8:vt,u=f/(o.length-1);let g;if(e[0]!==r||e[1]!==m||e[2]!==o||e[3]!==u){let N;e[5]!==r||e[6]!==m||e[7]!==u?(N=(v,w)=>({x:w*u,y:r-1-v/m*(r-2)}),e[5]=r,e[6]=m,e[7]=u,e[8]=N):N=e[8],g=o.map(N).map($t).join(" "),e[0]=r,e[1]=m,e[2]=o,e[3]=u,e[4]=g}else g=e[4];const p=g,j=`0 0 ${f} ${r}`,x=c?void 0:f,b=c?"none":void 0,h=c?"w-full":"shrink-0 overflow-visible";let d;e[9]!==i||e[10]!==h?(d=W(h,i),e[9]=i,e[10]=h,e[11]=d):d=e[11];let _;e[12]!==r||e[13]!==p||e[14]!==c||e[15]!==f?(_=c&&s.jsx("polygon",{points:`0,${r} ${p} ${f},${r}`,fill:"currentColor",opacity:.12}),e[12]=r,e[13]=p,e[14]=c,e[15]=f,e[16]=_):_=e[16];let y;e[17]!==p?(y=s.jsx("polyline",{points:p,fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[17]=p,e[18]=y):y=e[18];let S;return e[19]!==r||e[20]!==n||e[21]!==y||e[22]!==j||e[23]!==x||e[24]!==b||e[25]!==d||e[26]!==_?(S=s.jsxs("svg",{viewBox:j,width:x,height:r,role:"img","aria-label":n,preserveAspectRatio:b,className:d,children:[_,y]}),e[19]=r,e[20]=n,e[21]=y,e[22]=j,e[23]=x,e[24]=b,e[25]=d,e[26]=_,e[27]=S):S=e[27],S}function $t(t){const{x:e,y:o}=t;return`${e.toFixed(1)},${o.toFixed(1)}`}const Ct={waiting:{labelKey:"home.projects.headlineWaiting",className:"text-foreground"},failed:{labelKey:"home.projects.headlineFailed",className:"text-destructive"},shipped:{labelKey:"home.projects.headlineShipped",className:"text-muted-foreground"},open:{labelKey:"home.projects.headlineOpen",className:"text-muted-foreground"}},te=6;function Ht(t){const e=P.c(10),{value:o,previous:i}=t,n=o-i;if(n===0)return null;const l=n>0?et:tt,a=n>0?"text-success":"text-muted-foreground";let r;e[0]!==a?(r=W("inline-flex items-center text-xs tabular-nums",a),e[0]=a,e[1]=r):r=e[1];let c;e[2]!==l?(c=s.jsx(l,{width:11,height:11,"aria-hidden":!0}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==n?(m=Math.abs(n),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==r||e[7]!==c||e[8]!==m?(f=s.jsxs("span",{className:r,children:[c,m]}),e[6]=r,e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Tt(t){const e=P.c(52),{project:o,summary:i,series:n}=t,l=B(),a=st();let r;e[0]!==o?(r=ot(rt(o).storeUrl),e[0]=o,e[1]=r):r=e[1];const c=r,m=i&&i.kind!=="quiet"?Ct[i.kind]:null,f=n.reduce(Et,0),u=Math.floor(n.length/2);let g;e[2]!==u||e[3]!==n?(g=n.slice(0,u).reduce(Pt,0),e[2]=u,e[3]=n,e[4]=g):g=e[4];const p=g;let j;e[5]!==u||e[6]!==n?(j=n.slice(u).reduce(At,0),e[5]=u,e[6]=n,e[7]=j):j=e[7];const x=j,b=o.title;let h;e[8]!==a||e[9]!==o.id?(h=()=>{Z("org_home_project_clicked"),a(o.id)},e[8]=a,e[9]=o.id,e[10]=h):h=e[10];let d;e[11]!==o.icon||e[12]!==o.title?(d=s.jsx(Ie,{icon:o.icon,name:o.title,size:"xs"}),e[11]=o.icon,e[12]=o.title,e[13]=d):d=e[13];let _;e[14]!==o.title?(_=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:o.title}),e[14]=o.title,e[15]=_):_=e[15];let y;e[16]!==m||e[17]!==c||e[18]!==i||e[19]!==l?(y=m&&i?l(m.labelKey,{count:i.count}):c??l("home.projects.quiet"),e[16]=m,e[17]=c,e[18]=i,e[19]=l,e[20]=y):y=e[20];let S;e[21]!==y?(S=s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:y}),e[21]=y,e[22]=S):S=e[22];let N;e[23]!==_||e[24]!==S?(N=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[_,S]}),e[23]=_,e[24]=S,e[25]=N):N=e[25];let C;e[26]!==o.title||e[27]!==l?(C=l("home.projects.rhythm",{name:o.title}),e[26]=o.title,e[27]=l,e[28]=C):C=e[28];let v;e[29]!==n||e[30]!==C?(v=s.jsx(wt,{series:n,className:"text-muted-foreground/60",label:C}),e[29]=n,e[30]=C,e[31]=v):v=e[31];const w=f>0?"text-foreground":"text-muted-foreground";let k;e[32]!==w?(k=W("text-sm tabular-nums",w),e[32]=w,e[33]=k):k=e[33];let $;e[34]!==f||e[35]!==k?($=s.jsx("span",{className:k,children:f}),e[34]=f,e[35]=k,e[36]=$):$=e[36];let H;e[37]!==x||e[38]!==p?(H=s.jsx(Ht,{value:x,previous:p}),e[37]=x,e[38]=p,e[39]=H):H=e[39];let A;e[40]!==$||e[41]!==H?(A=s.jsxs("span",{className:"flex w-10 shrink-0 flex-col items-end",children:[$,H]}),e[40]=$,e[41]=H,e[42]=A):A=e[42];let T;e[43]!==v||e[44]!==A?(T=s.jsxs("span",{className:"flex shrink-0 items-center gap-2.5",children:[v,A]}),e[43]=v,e[44]=A,e[45]=T):T=e[45];let E;return e[46]!==o.title||e[47]!==N||e[48]!==T||e[49]!==h||e[50]!==d?(E=s.jsx(be,{className:"transition-colors hover:bg-accent",children:s.jsxs("button",{type:"button","aria-label":b,onClick:h,className:"flex w-full min-w-0 items-center gap-3 text-left",children:[d,N,T]})}),e[46]=o.title,e[47]=N,e[48]=T,e[49]=h,e[50]=d,e[51]=E):E=e[51],E}function At(t,e){return t+e}function Pt(t,e){return t+e}function Et(t,e){return t+e}const Bt=new Map,Dt=new Map;function Mt(t){const e=P.c(30),{projects:o,summaries:i,series:n}=t,l=i===void 0?Bt:i,a=n===void 0?Dt:n,r=B(),{org:c}=q();let m,f,u,g,p,j;if(e[0]!==o||e[1]!==a||e[2]!==l||e[3]!==r){const h=[...o].sort(It).slice(0,te);f=o.length>te,m=Nt,e[10]!==r?(u=r("home.projects.heading"),e[10]=r,e[11]=u):u=e[11],g=o.length;let d;e[12]!==r?(d=r("home.projects.shippedCaption"),e[12]=r,e[13]=d):d=e[13],e[14]!==d?(p=s.jsx("span",{className:"hidden whitespace-nowrap text-xs text-muted-foreground @[19rem]:inline",children:d}),e[14]=d,e[15]=p):p=e[15];let _;e[16]!==a||e[17]!==l?(_=y=>s.jsx(Tt,{project:y,summary:l.get(y.id),series:a.get(y.id)??[]},y.id),e[16]=a,e[17]=l,e[18]=_):_=e[18],j=h.map(_),e[0]=o,e[1]=a,e[2]=l,e[3]=r,e[4]=m,e[5]=f,e[6]=u,e[7]=g,e[8]=p,e[9]=j}else m=e[4],f=e[5],u=e[6],g=e[7],p=e[8],j=e[9];let x;e[19]!==f||e[20]!==c||e[21]!==r?(x=f&&s.jsx(be,{className:"py-2",children:s.jsx(ye,{to:"/$org/settings/projects",params:{org:c.slug},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:r("home.projects.seeAll")})}),e[19]=f,e[20]=c,e[21]=r,e[22]=x):x=e[22];let b;return e[23]!==m||e[24]!==u||e[25]!==g||e[26]!==p||e[27]!==j||e[28]!==x?(b=s.jsxs(m,{label:u,count:g,action:p,children:[j,x]}),e[23]=m,e[24]=u,e[25]=g,e[26]=p,e[27]=j,e[28]=x,e[29]=b):b=e[29],b}function It(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ft(){const t=P.c(10),{org:e}=q(),o=_e();let i;t[0]!==e.id?(i=Se.orgHasSite(e.id),t[0]=e.id,t[1]=i):i=t[1];const n=!!e.id;let l;t[2]!==o?(l=()=>o.call("ORGANIZATION_HAS_SITE",{}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==i||t[5]!==n||t[6]!==l?(a={queryKey:i,staleTime:3e5,enabled:n,queryFn:l},t[4]=i,t[5]=n,t[6]=l,t[7]=a):a=t[7];const{data:r}=Ne(a),c=r?.hasSite??!1;let m;return t[8]!==c?(m={hasSite:c},t[8]=c,t[9]=m):m=t[9],m}const Lt="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function Ot(t){const e=P.c(4),{className:o}=t;let i,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),n=s.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),e[0]=i,e[1]=n):(i=e[0],n=e[1]);let l;return e[2]!==o?(l=s.jsxs("svg",{viewBox:"0 0 28 20",className:o,"aria-hidden":"true",focusable:"false",children:[i,n]}),e[2]=o,e[3]=l):l=e[3],l}function Rt(){const t=P.c(27),e=B(),{hasSite:o}=Ft();if(!o)return null;let i;t[0]!==e?(i=e("home.orgHome.trainingThumbnailAlt"),t[0]=e,t[1]=i):i=t[1];let n;t[2]!==i?(n=s.jsx("img",{src:"/cms-training.jpg",alt:i,className:"size-full object-cover"}),t[2]=i,t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:s.jsx(Ot,{className:"w-9"})}),t[4]=l):l=t[4];let a;t[5]!==n?(a=s.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[n,l]}),t[5]=n,t[6]=a):a=t[6];let r;t[7]!==e?(r=e("home.orgHome.trainingEyebrow"),t[7]=e,t[8]=r):r=t[8];let c;t[9]!==r?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:r}),t[9]=r,t[10]=c):c=t[10];let m;t[11]!==e?(m=e("home.orgHome.trainingTitle"),t[11]=e,t[12]=m):m=t[12];let f;t[13]!==m?(f=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:m}),t[13]=m,t[14]=f):f=t[14];let u;t[15]!==e?(u=e("home.orgHome.trainingDescription"),t[15]=e,t[16]=u):u=t[16];let g;t[17]!==u?(g=s.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=g):g=t[18];let p;t[19]!==c||t[20]!==f||t[21]!==g?(p=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,f,g]}),t[19]=c,t[20]=f,t[21]=g,t[22]=p):p=t[22];let j;t[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(nt,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[23]=j):j=t[23];let x;return t[24]!==p||t[25]!==a?(x=s.jsxs("a",{href:Lt,target:"_blank",rel:"noreferrer",onClick:zt,className:"group shadow-edge flex w-full items-center gap-4 rounded-2xl bg-card p-4 text-left transition-colors hover:bg-accent",children:[a,p,j]}),t[24]=p,t[25]=a,t[26]=x):x=t[26],x}function zt(){return Z("cms_training_opened",{source:"org_home"})}const Gt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Kt(){const t=P.c(8),e=B();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{className:"size-4 shrink-0 text-muted-foreground"}),t[0]=o):o=t[0];let i;t[1]!==e?(i=e("home.orgHome.searchPlaceholder"),t[1]=e,t[2]=i):i=t[2];let n;t[3]!==i?(n=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:i}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:"⌘K"}),t[5]=l):l=t[5];let a;return t[6]!==n?(a=s.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:Yt,className:"shadow-edge flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[o,n,l]}),t[6]=n,t[7]=a):a=t[7],a}function Yt(){Z("command_palette_opened",{source:"org_home_search"}),Qe()}function se(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ne,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Ut(t){const e=P.c(28),{canManageAgents:o}=t,i=B(),{org:n}=q();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={pageSize:1e3},e[0]=l):l=e[0];const a=de(l),r=Ae();let c,m,f;if(e[1]!==a||e[2]!==o||e[3]!==n||e[4]!==i||e[5]!==r){f=Symbol.for("react.early_return_sentinel");e:{let x;if(e[9]!==n?(x=b=>b.id!==n.id,e[9]=n,e[10]=x):x=e[10],c=ue(a).filter(x),c.length===0){let b;e[11]!==i?(b=i("routes.agentsList.noAgentsYet"),e[11]=i,e[12]=b):b=e[12];let h;e[13]!==o||e[14]!==i?(h=i(o?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),e[13]=o,e[14]=i,e[15]=h):h=e[15];let d;e[16]!==b||e[17]!==h?(d=s.jsx("div",{className:"flex items-center justify-center py-10",children:s.jsx(Xe,{actions:!1,image:null,title:b,description:h})}),e[16]=b,e[17]=h,e[18]=d):d=e[18],f=d;break e}m=Pe(fe(c),r,null)}e[1]=a,e[2]=o,e[3]=n,e[4]=i,e[5]=r,e[6]=c,e[7]=m,e[8]=f}else c=e[6],m=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;const u=m.length>0;let g;e[19]!==c?(g=s.jsx(Mt,{projects:c}),e[19]=c,e[20]=g):g=e[20];let p;e[21]!==c||e[22]!==u||e[23]!==r?(p=u&&s.jsx(Ee,{projects:c,tasks:r}),e[21]=c,e[22]=u,e[23]=r,e[24]=p):p=e[24];let j;return e[25]!==g||e[26]!==p?(j=s.jsxs("div",{className:"flex flex-col gap-12",children:[g,p]}),e[25]=g,e[26]=p,e[27]=j):j=e[27],j}function qt(){const t=P.c(55),e=B(),o=ce("home_task_intake_enabled"),{data:i}=U.useSession(),[n,l]=I.useState(!1),{granted:a}=re("agents:manage");let r,c,m,f,u,g,p,j,x,b,h,d;if(t[0]!==a||t[1]!==i?.user?.name||t[2]!==e){const A=je(i?.user?.name),T=Gt[xe(new Date().getHours())];let E;t[15]!==e?(E=R=>s.jsxs(ve,{size:"sm",variant:"default",onClick:()=>{Z("agent_create_clicked",{source:R,method:"github"}),l(!0)},children:[s.jsx(Ze,{size:14}),e("home.orgAgents.importFromGitHub")]}),t[15]=e,t[16]=E):E=t[16];const D=E;m=M,t[17]!==a||t[18]!==D?(d=a&&s.jsx(M.Actions,{children:D("org_home")}),t[17]=a,t[18]=D,t[19]=d):d=t[19],c=M.Content,r=M.Container,b="reading",h="flex flex-col gap-12",p="flex flex-col items-center gap-12 text-center",t[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(me,{dense:!1}),x=s.jsx(Rt,{}),t[20]=j,t[21]=x):(j=t[20],x=t[21]),g="flex w-full flex-col items-center gap-5",f="text-3xl font-medium tracking-tight text-foreground",u=A?e(T.named,{name:A}):e(T.bare),t[0]=a,t[1]=i?.user?.name,t[2]=e,t[3]=r,t[4]=c,t[5]=m,t[6]=f,t[7]=u,t[8]=g,t[9]=p,t[10]=j,t[11]=x,t[12]=b,t[13]=h,t[14]=d}else r=t[3],c=t[4],m=t[5],f=t[6],u=t[7],g=t[8],p=t[9],j=t[10],x=t[11],b=t[12],h=t[13],d=t[14];let _;t[22]!==f||t[23]!==u?(_=s.jsx("h2",{className:f,children:u}),t[22]=f,t[23]=u,t[24]=_):_=t[24];let y;t[25]!==o?(y=o?s.jsx(I.Suspense,{fallback:s.jsx(se,{}),children:s.jsx(le,{children:s.jsx(ae,{children:s.jsx(ie,{homeTaskComposer:!0})})})}):s.jsx(Kt,{}),t[25]=o,t[26]=y):y=t[26];let S;t[27]!==y||t[28]!==g||t[29]!==_?(S=s.jsxs("div",{className:g,children:[_,y]}),t[27]=y,t[28]=g,t[29]=_,t[30]=S):S=t[30];let N;t[31]!==S||t[32]!==p||t[33]!==j||t[34]!==x?(N=s.jsxs("div",{className:p,children:[j,x,S]}),t[31]=S,t[32]=p,t[33]=j,t[34]=x,t[35]=N):N=t[35];let C;t[36]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(se,{}),t[36]=C):C=t[36];let v;t[37]!==a?(v=s.jsx(I.Suspense,{fallback:C,children:s.jsx(Ut,{canManageAgents:a})}),t[37]=a,t[38]=v):v=t[38];let w;t[39]!==r||t[40]!==N||t[41]!==v||t[42]!==b||t[43]!==h?(w=s.jsxs(r,{width:b,className:h,children:[N,v]}),t[39]=r,t[40]=N,t[41]=v,t[42]=b,t[43]=h,t[44]=w):w=t[44];let k;t[45]!==c||t[46]!==w?(k=s.jsx(c,{children:w}),t[45]=c,t[46]=w,t[47]=k):k=t[47];let $;t[48]!==n?($=s.jsx(Je,{open:n,onOpenChange:l}),t[48]=n,t[49]=$):$=t[49];let H;return t[50]!==m||t[51]!==k||t[52]!==$||t[53]!==d?(H=s.jsxs(m,{children:[d,k,$]}),t[50]=m,t[51]=k,t[52]=$,t[53]=d,t[54]=H):H=t[54],H}function Wt(){return ke()?s.jsx(St,{}):s.jsx(qt,{})}function qr(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(we.Content,{children:s.jsx(Wt,{})}),t[0]=e):e=t[0],e}export{qr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,q as b,eT as c,t as g}from"./index-
|
|
1
|
+
import{c as p,q as b,eT as c,t as g}from"./index-EliiQy8F.js";import{u as y,D as E,au as m,ad as d,av as v,aw as P,ar as w}from"./site-editor-toast-DNKTJ9Hj.js";function $(t){const e=p.c(11),s=b(),{orgSlug:o,virtualMcpId:n,branch:i}=t,u=y(n,i);let a;e[0]!==i||e[1]!==o||e[2]!==n?(a=i?{orgSlug:o,virtualMcpId:n,branch:i}:null,e[0]=i,e[1]=o,e[2]=n,e[3]=a):a=e[3];const l=E(a)||null;let r;return e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s||e[8]!==l||e[9]!==n?(r={queryClient:s,orgSlug:o,virtualMcpId:n,branch:i,backend:u,cacheKey:l},e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l,e[9]=n,e[10]=r):r=e[10],r}class h extends Error{constructor(e,s){super(e),this.code=s,this.name="HostedPublishError"}code}async function f(t,e,s={}){const o=await fetch(t,{method:"POST",headers:{"content-type":"application/json",...s},body:JSON.stringify(e)}),n=await o.json().catch(()=>({}));if(!o.ok){const i=n.error??n.code??null;throw new h(i??`HTTP ${o.status}`,i)}return n}function H(t,e){return f(`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/publish`,{note:e},c("v8"))}async function R(t){const e=await fetch(`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/publish/review`,{cache:"no-store",headers:c("v8")});if(!e.ok)throw new Error(`publish review read failed: ${e.status}`);const s=await e.json();return{alsoChanged:Array.isArray(s.alsoChanged)?s.alsoChanged.filter(o=>typeof o=="string"):[]}}function k(t,e){return t.result==="merged"&&t.draftEtag?{branch:e,draftEtag:t.draftEtag}:null}function D(t,e){return f(`/api/${t.orgSlug}/hosted/${encodeURIComponent(t.virtualMcpId)}/releases/retry`,e??{})}function O(t,e,s){if(e.result==="up-to-date"){g.message(t("siteEditor.publish.nothingToPublish"),{...P,id:v,description:t("siteEditor.publish.everythingPublished")});return}if(e.release==="current"){w(t);return}S(t,null,s)}function S(t,e,s){m(t,{tone:"warning",headline:t("siteEditor.publish.savedNotPublished"),body:t("siteEditor.publish.savedNotPublishedBody"),detail:d(e),retry:s})}function U(t,e){return e instanceof h&&e.code==="main-moved"?{message:t("siteEditor.publish.publishedMeanwhile"),detail:null}:{message:t("siteEditor.publish.failed"),detail:d(e)}}export{h as H,D as a,S as b,U as h,k,O as n,H as p,R as r,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as p,B as h}from"./index-
|
|
1
|
+
import{c as f,j as p,B as h}from"./index-EliiQy8F.js";import{T as j,a as v,c as T}from"./tooltip-BdAcWCQB.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
|
|
@@ -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-BuXXTMUo.js";import{gh as ye,gY as Ce,gg as Se,gZ as Re,g_ as Ee,g$ as Te,h0 as Oe,h1 as Ie,gj as Ae,fc as Me,r as C,bQ as ze}from"./index-C-7u3Q1p.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-BOyKAWNQ.js";import{gh as ye,gY as Ce,gg as Se,gZ as Re,g_ as Ee,g$ as Te,h0 as Oe,h1 as Ie,gj as Ae,fc as Me,r as C,bQ as ze}from"./index-EliiQy8F.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};
|