decocms 4.452.0 → 4.453.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/{AlertCircle-CQkRRGSg.js → AlertCircle-CEMA0Bvd.js} +1 -1
- package/dist/client/assets/{AreaChart-B-RuYs_G.js → AreaChart-8vV4Kg9S.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DR8lCUOF.js → ArrowLeft-ClaYlAQG.js} +1 -1
- package/dist/client/assets/{ArrowUp-7FgpFlyY.js → ArrowUp-Qd-i2-49.js} +1 -1
- package/dist/client/assets/{Building02-7V26SUA6.js → Building02-BUecYuXE.js} +1 -1
- package/dist/client/assets/{CartesianChart-D2qv7oNB.js → CartesianChart-CL_165ab.js} +1 -1
- package/dist/client/assets/{Check-CZYLh537.js → Check-C_aMX7t2.js} +1 -1
- package/dist/client/assets/{CheckCircle-BcqKkSj5.js → CheckCircle-C6ETLc3W.js} +1 -1
- package/dist/client/assets/{ChevronUp-riNbaljB.js → ChevronUp-fov6fTvP.js} +1 -1
- package/dist/client/assets/{Copy01-DFthUWqM.js → Copy01-Cw8fg08h.js} +1 -1
- package/dist/client/assets/{CreditCard01-CyYVeRD3.js → CreditCard01-DonRfmZs.js} +1 -1
- package/dist/client/assets/{DotsVertical-rzfqPSdm.js → DotsVertical-CiyNIODL.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DQp6cg0w.js → ErrorBarContext-D3ln1Qux.js} +1 -1
- package/dist/client/assets/{Image01-CmS6lPNM.js → Image01-C6kIG40J.js} +1 -1
- package/dist/client/assets/{Key01-CkznrEPX.js → Key01-mqoanGCm.js} +1 -1
- package/dist/client/assets/{Line-TP8KMdrq.js → Line-BnskvTci.js} +1 -1
- package/dist/client/assets/{Link01-BK2WDfDE.js → Link01-DCc5IbpQ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DE5GGQ-P.js → LinkBroken01-IuDtBjP9.js} +1 -1
- package/dist/client/assets/{LinkExternal01-YQUR5lT6.js → LinkExternal01-BUIYn1FY.js} +1 -1
- package/dist/client/assets/{Monitor01-mscEQ6pB.js → Monitor01-BwDPakqY.js} +1 -1
- package/dist/client/assets/{Palette-U32cX76w.js → Palette-mTXvODQx.js} +1 -1
- package/dist/client/assets/{Plus-B1zA6p-4.js → Plus-pL-Cxk_o.js} +1 -1
- package/dist/client/assets/{SearchMd-nUFR-fun.js → SearchMd-DOSqMq9d.js} +1 -1
- package/dist/client/assets/{Sector-IJN93tJL.js → Sector-CKlIrF7r.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-xjymcct3.js → ShoppingBag01-aVl-vLxD.js} +1 -1
- package/dist/client/assets/{Sun-CCW_4qiv.js → Sun-D1NpJs3y.js} +1 -1
- package/dist/client/assets/{Tool01-B62In8iq.js → Tool01-TDnGQxAF.js} +1 -1
- package/dist/client/assets/{Trash01-C2tQl3wO.js → Trash01-CXleTtSn.js} +1 -1
- package/dist/client/assets/{Upload01-BWT4v0Wi.js → Upload01-W_mLs4wd.js} +1 -1
- package/dist/client/assets/{User01-CjZ2I7BX.js → User01-Wzce_50B.js} +1 -1
- package/dist/client/assets/{UserSquare-CWUXupRN.js → UserSquare-DUQ7Xo7f.js} +1 -1
- package/dist/client/assets/{Users01-BCGnPOxS.js → Users01-DCxJNeLw.js} +1 -1
- package/dist/client/assets/{X-CHFG7-mU.js → X-DcGBk4Cg.js} +1 -1
- package/dist/client/assets/{XAxis-DIIA1eR_.js → XAxis-Bf2ZQHMv.js} +1 -1
- package/dist/client/assets/{XClose-DTOuD_e7.js → XClose-DRl0M6hN.js} +1 -1
- package/dist/client/assets/{ZoomOut-CTvv0VFv.js → ZoomOut-DIp9W39x.js} +1 -1
- package/dist/client/assets/{access-gate-YoCC2cak.js → access-gate-apKa1Dth.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BJoFO4TU.js → add-connection-dialog-CT97RDq-.js} +1 -1
- package/dist/client/assets/{agent-analytics-pKyZniYD.js → agent-analytics-Bs4xdplR.js} +1 -1
- package/dist/client/assets/agent-app-u-k1Acvh.js +1 -0
- package/dist/client/assets/{agent-assets-BBuETSa3.js → agent-assets-CnasIGi5.js} +1 -1
- package/dist/client/assets/{agent-automation-Gf_403yV.js → agent-automation-B3x0gi2a.js} +1 -1
- package/dist/client/assets/{agent-automations-DHEWASaU.js → agent-automations-CEoICIyo.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BJfN-vfW.js → agent-connect-sources-Cy7N-aEH.js} +1 -1
- package/dist/client/assets/agent-deck-BavY-3q6.js +1 -0
- package/dist/client/assets/{agent-e2e-BUPuBpdn.js → agent-e2e-CGJaiLf6.js} +1 -1
- package/dist/client/assets/{agent-experiments-DvP2aKwk.js → agent-experiments-OtkEDfX0.js} +1 -1
- package/dist/client/assets/{agent-file-CDAQ3_2M.js → agent-file-BzEV4zeA.js} +1 -1
- package/dist/client/assets/{agent-git-B3crMGWs.js → agent-git-DAD_cN7d.js} +1 -1
- package/dist/client/assets/{agent-hosting-MCkMzhov.js → agent-hosting-7PcPfQNU.js} +1 -1
- package/dist/client/assets/{agent-icon-BJAncODg.js → agent-icon-tpETiP8G.js} +1 -1
- package/dist/client/assets/agent-library-BLlUzuVS.js +1 -0
- package/dist/client/assets/agent-library-file-BFIubt4W.js +1 -0
- package/dist/client/assets/{agent-monitor-CAKsywMv.js → agent-monitor-DdaqgTGF.js} +1 -1
- package/dist/client/assets/{agent-overview-BeUwu-KG.js → agent-overview-ZOOCT356.js} +1 -1
- package/dist/client/assets/agent-settings-Em2WMz2L.js +1 -0
- package/dist/client/assets/{agent-site-editor-CiGatYz3.js → agent-site-editor-43gksAjF.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Az-_Q38z.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CStkXfya.js → agent-site-editor-content-LWy9uCXZ.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-D9pvz5fY.js → agent-site-editor-preview-CPHDMnI5.js} +3 -3
- package/dist/client/assets/agent-view-DEeIjnrM.js +1 -0
- package/dist/client/assets/{agent-view-guard-H46J6I2J.js → agent-view-guard-CIPdHkhl.js} +1 -1
- package/dist/client/assets/{agents-list-CfV4zbeg.js → agents-list-jZ3c2m0H.js} +1 -1
- package/dist/client/assets/{ai-providers-BN2hQMhH.js → ai-providers-B746GoBX.js} +1 -1
- package/dist/client/assets/{alert-DAHFLojl.js → alert-C9MxwXfU.js} +1 -1
- package/dist/client/assets/{alert-dialog-DfTPgIPX.js → alert-dialog-DzhIuzD3.js} +1 -1
- package/dist/client/assets/{analytics-sections-yoOoelxF.js → analytics-sections-Bw_MAORy.js} +1 -1
- package/dist/client/assets/api-keys-DOlCRBOn.js +1 -0
- package/dist/client/assets/{api-keys-NZUBfE--.js → api-keys-QDy8i9ju.js} +1 -1
- package/dist/client/assets/app-editor-D9oHDBPc.js +1 -0
- package/dist/client/assets/{asset-utils-Dg_L4rgJ.js → asset-utils-ZPxZfOx1.js} +1 -1
- package/dist/client/assets/{auth-g-eeEO2I.js → auth-BudRCkYA.js} +1 -1
- package/dist/client/assets/{auth-catchall-CQNM5IYs.js → auth-catchall-Df5Vdz21.js} +1 -1
- package/dist/client/assets/{auth-entry-Bg2aCMAm.js → auth-entry-fgyXn6La.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BHWXJwAv.js → auth-split-layout-Dp6KFq3y.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D01FuEWu.js → authenticate-and-persist-oauth-BW2IqeYG.js} +1 -1
- package/dist/client/assets/{automation-list-row-CyxwTlrF.js → automation-list-row-DG08QIT_.js} +1 -1
- package/dist/client/assets/{automation-runs-xCwcCJC2.js → automation-runs-Dbmd75zG.js} +1 -1
- package/dist/client/assets/{automations-Ab2pgU9k.js → automations-DfuViWva.js} +1 -1
- package/dist/client/assets/{autosend-5ui8IdtF.js → autosend-CGKXRCNb.js} +1 -1
- package/dist/client/assets/{avatar-CmjVNkwN.js → avatar-BIZUAEfG.js} +1 -1
- package/dist/client/assets/{badge-DRRTtn5O.js → badge-BBA0IXoD.js} +1 -1
- package/dist/client/assets/{block-document-Cu1B3Znw.js → block-document-B1t8aJoD.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DKUHWFsF.js → blocks-preview-workspace-context-CcdEwyP0.js} +1 -1
- package/dist/client/assets/{blog-schema-DsqMhqVM.js → blog-schema-CjaQx-UD.js} +1 -1
- package/dist/client/assets/{buckets-yskqiFUf.js → buckets-DGaH5qio.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Czr7rpOn.js → build-improve-prompt-doc-YiYNDXQD.js} +1 -1
- package/dist/client/assets/{calendar-hQQyUCsj.js → calendar-COb6HpUA.js} +1 -1
- package/dist/client/assets/{capability-load-error-CbMIev40.js → capability-load-error-CGB3fnAm.js} +1 -1
- package/dist/client/assets/{category-editor-CERa-ic1.js → category-editor-B8JquZk0.js} +1 -1
- package/dist/client/assets/{chart-V4xaiNPC.js → chart-wPnpt4js.js} +1 -1
- package/dist/client/assets/{chat-context-oxL7wGnz.js → chat-context-zIc_5Of2.js} +1 -1
- package/dist/client/assets/{chat-draft-Djy3dkUg.js → chat-draft-BHnR2Kiv.js} +1 -1
- package/dist/client/assets/{checkbox-D7WjpuVv.js → checkbox-B9bSLyqY.js} +1 -1
- package/dist/client/assets/{choose-editor-BEgt8mUY.js → choose-editor-Ce7eM40n.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-D-j3nn-u.js → claim-phase-copy-Cm4rl8Au.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CDTAwVf_.js → cli-auth-success-DGrfBhwj.js} +1 -1
- package/dist/client/assets/{client-icons-BRCUVaWX.js → client-icons-BFWqZZeZ.js} +1 -1
- package/dist/client/assets/{collapsible-DIaN6Srf.js → collapsible-DLOvLnOt.js} +1 -1
- package/dist/client/assets/{collection-detail-DJ79vvsb.js → collection-detail-CLdl4-aR.js} +1 -1
- package/dist/client/assets/{collection-display-button-D_MeUzdg.js → collection-display-button-DNuZT2Aw.js} +1 -1
- package/dist/client/assets/{collection-search-CKIe33RH.js → collection-search-BqS-92Fa.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BU7gTJT1.js → collection-table-wrapper-BcIqSXK-.js} +1 -1
- package/dist/client/assets/{collection-tabs-Br7caoEY.js → collection-tabs-BZny_p4g.js} +1 -1
- package/dist/client/assets/{column-rules-C4SSRzGe.js → column-rules-BAl8D2FC.js} +1 -1
- package/dist/client/assets/{combobox-ZWRPqCmz.js → combobox-ChZXI9Ns.js} +1 -1
- package/dist/client/assets/{command-CBb61KwU.js → command-Y_VN6QLL.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B4YWrazT.js → companion-mcps-section-D7_VXU7i.js} +1 -1
- package/dist/client/assets/{config-e26AxbQy.js → config-CwiubMQL.js} +1 -1
- package/dist/client/assets/{connect-Cis4Tapn.js → connect-G54Zan1i.js} +1 -1
- package/dist/client/assets/{connect-layout-Dcio3Lf-.js → connect-layout-BgdC6j1R.js} +1 -1
- package/dist/client/assets/{connection-BHqwT0eD.js → connection-DsG9p9us.js} +1 -1
- package/dist/client/assets/{connection-card-C2EkxrBF.js → connection-card-D9XtmB2r.js} +1 -1
- package/dist/client/assets/{connection-detail-jcDwf2ZX.js → connection-detail-Bx7t6-az.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-9n8ribSs.js → connection-form-helpers-l3jF0jFE.js} +1 -1
- package/dist/client/assets/{connections-D7jA8LjW.js → connections-DytLd7kj.js} +1 -1
- package/dist/client/assets/{context-izLsg2u9.js → context-Du85EZ17.js} +1 -1
- package/dist/client/assets/{context-menu-DerEN04P.js → context-menu-CjwDiOQP.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CYAsWdo6.js → create-organization-dialog-DCL5zhlj.js} +1 -1
- package/dist/client/assets/{daily-pulse-CnVCBpq0.js → daily-pulse-o38xt-IE.js} +1 -1
- package/dist/client/assets/{decopilot-BLnyHUyj.js → decopilot-DnP_zYfD.js} +1 -1
- package/dist/client/assets/{device-hint-BELnE8gL.js → device-hint-Dn6yYj_i.js} +1 -1
- package/dist/client/assets/{dialog-BrqxKGpn.js → dialog-ZcwKjVui.js} +1 -1
- package/dist/client/assets/{discover-CkexzJr8.js → discover-Cz6MnBB6.js} +1 -1
- package/dist/client/assets/{domain-settings-BZKJb9dL.js → domain-settings-D0ybfO-h.js} +1 -1
- package/dist/client/assets/{download-app-dialog-D4fZwg6L.js → download-app-dialog-Cu_s98d6.js} +1 -1
- package/dist/client/assets/{drawer-DnzsJxQZ.js → drawer-lDRzP_hv.js} +1 -1
- package/dist/client/assets/{editor-CTFiwz0O.js → editor-BeO_QXvn.js} +1 -1
- package/dist/client/assets/{empty-state-CIlXqsAy.js → empty-state-BR4chggO.js} +1 -1
- package/dist/client/assets/{empty-state-L-fapaGY.js → empty-state-JyDL0jP9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BojttbHn.js → extract-connection-data-C-wVYlh_.js} +1 -1
- package/dist/client/assets/{feature-gate-n8g4g4zp.js → feature-gate-DGhvni3E.js} +1 -1
- package/dist/client/assets/{feature-paywall-KXd0tDN_.js → feature-paywall-b_xZtVai.js} +1 -1
- package/dist/client/assets/{file-explorer-BKwSFv0S.js → file-explorer-CcWIZ3Vk.js} +1 -1
- package/dist/client/assets/{file-preview-DTF7cqq1.js → file-preview-B_pB93I1.js} +1 -1
- package/dist/client/assets/{file-share-button-YKzQ30pm.js → file-share-button-zgum1wJq.js} +1 -1
- package/dist/client/assets/{file-type-icon-DH3SCrZf.js → file-type-icon-D_8KJuPI.js} +1 -1
- package/dist/client/assets/flat-project-CXeIPazF.js +1 -0
- package/dist/client/assets/{folder-icon-mDaDXy1F.js → folder-icon-DoG3TUrW.js} +1 -1
- package/dist/client/assets/{form-CwmR-nDp.js → form-DuE5nX8V.js} +1 -1
- package/dist/client/assets/{gateway-client-BUVeQ8TP.js → gateway-client-O_xs-D_Z.js} +1 -1
- package/dist/client/assets/{general-pHKX0mlj.js → general-DG3BlXQV.js} +1 -1
- package/dist/client/assets/{home-DpJ0l_4_.js → home-D99IKgAZ.js} +1 -1
- package/dist/client/assets/{icon-button-CLFo5Lxf.js → icon-button-bLhE-IOt.js} +1 -1
- package/dist/client/assets/{index-BQrJviGi.js → index-BTHKMk1Z.js} +1 -1
- package/dist/client/assets/{index-q1e9PWXS.js → index-BlKDkcFH.js} +1 -1
- package/dist/client/assets/{index-DxdM0E0B.js → index-BvyVBdHz.js} +1 -1
- package/dist/client/assets/index-Cbfax9Cz.js +64 -0
- package/dist/client/assets/{index-5Z-O-IC_.js → index-CdoF9ypd.js} +1 -1
- package/dist/client/assets/{index-D7BAQWSU.js → index-CmLW3QcD.js} +1 -1
- package/dist/client/assets/{index-BTRkPuaE.js → index-D7wkC5M7.js} +4 -4
- package/dist/client/assets/{index-CskCkMle.js → index-DHb-_VsB.js} +39 -39
- package/dist/client/assets/{index-D7EpZIyR.js → index-DS8N1Y7c.js} +1 -1
- package/dist/client/assets/{index-NRQboip2.js → index-DamjlIDy.js} +1 -1
- package/dist/client/assets/index-Dszga1s3.css +1 -0
- package/dist/client/assets/{index-DktJOqdm.js → index-FVnUm1rm.js} +1 -1
- package/dist/client/assets/{index-Cmukyu5i.js → index-a4u4ygl3.js} +1 -1
- package/dist/client/assets/{index-BwZnKcdF.js → index-cxIHsmct.js} +1 -1
- package/dist/client/assets/{index-B_3n7z-z.js → index-m8MnV04D.js} +1 -1
- package/dist/client/assets/{index-redirect-ClcE1C-w.js → index-redirect-DYShpbCG.js} +1 -1
- package/dist/client/assets/{index-BOU4FVnf.js → index-ulIO8Pkx.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DDM1TL4D.js → infiniteQueryObserver-OMRTCwgN.js} +1 -1
- package/dist/client/assets/{infra-billing-CNDnR1FE.js → infra-billing-fc03Y3En.js} +1 -1
- package/dist/client/assets/{input-_e15nvFZ.js → input-BjFlMBld.js} +1 -1
- package/dist/client/assets/{input-C7ggWsLT.js → input-C9EZWo1i.js} +1 -1
- package/dist/client/assets/{input-BkhtMOai.js → input-Cq-BjzFO.js} +3 -3
- package/dist/client/assets/{integration-icon-C5Hxx8nt.js → integration-icon-COmuKwMQ.js} +1 -1
- package/dist/client/assets/{label-7CUu5Nng.js → label-Dq1lTv5Q.js} +1 -1
- package/dist/client/assets/{layout-l5Dybhax.js → layout-CJPxoU3i.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CdAR76HP.js → legacy-agents-deep-C3C1-pOx.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-FsmMt53b.js → legacy-main-redirect-K_7Ds35I.js} +1 -1
- package/dist/client/assets/library-sN-7M-1q.js +1 -0
- package/dist/client/assets/{library-tab-D8YaxhRw.js → library-tab-eUOw6UcR.js} +1 -1
- package/dist/client/assets/{login-C-bgG6Sh.js → login-DT9F99eX.js} +1 -1
- package/dist/client/assets/{markdown-B6rsJl8D.js → markdown-CMkHKmDN.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-C1z0J9GI.js → mcp-app-renderer-CyxAS2iI.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DiCqLrTx.js → mcp-oauth-lfwDwZZb.js} +1 -1
- package/dist/client/assets/{members-CP1FamHG.js → members-D2EkJ2kY.js} +1 -1
- package/dist/client/assets/{memory-CFfQuPfj.js → memory-NI7VZxEa.js} +1 -1
- package/dist/client/assets/{message-templates-BLkI2XAu.js → message-templates-nZjiZlCR.js} +1 -1
- package/dist/client/assets/{mini-report-page-DoPdD9qO.js → mini-report-page-BwiV1qi2.js} +1 -1
- package/dist/client/assets/{mock-board-BTXd0sAw.js → mock-board-ix2KqZev.js} +1 -1
- package/dist/client/assets/{monaco-editor-DynJau-q.js → monaco-editor-ChCt06qo.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DEGIuizb.js → monitoring-stats-row-JvqCu96Y.js} +1 -1
- package/dist/client/assets/{multi-select-BSBfkzHR.js → multi-select-B9xVEumB.js} +1 -1
- package/dist/client/assets/{mustache-C6B9oTBs.js → mustache-Co6L7J6w.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Ch4HsoZn.js → new-project-dialog-CBWMYtjm.js} +1 -1
- package/dist/client/assets/{oauth-callback-KXWSibnc.js → oauth-callback-DCspRl8h.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C9UxxVbB.js → oauth-callback-ai-provider-KCF4Genf.js} +1 -1
- package/dist/client/assets/{onboarding-NRECAyIG.js → onboarding-r3Hjzmax.js} +1 -1
- package/dist/client/assets/{openai-conversation-CeIvqTTz.js → openai-conversation-DTbvAwsF.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BSGhW_VM.js → optimistic-project-sidebar-views-DCGv0qlc.js} +1 -1
- package/dist/client/assets/{org-file-open-context-BXXF2r_W.js → org-file-open-context-jLsqeqSh.js} +1 -1
- package/dist/client/assets/{organization-choice-B4UdP9Qv.js → organization-choice-Ct95DR8q.js} +1 -1
- package/dist/client/assets/{orgs-B1zsOJOt.js → orgs-CdQcR1HB.js} +1 -1
- package/dist/client/assets/{page-seo-form-_-ijKB5k.js → page-seo-form-DcMNEGM0.js} +1 -1
- package/dist/client/assets/{pair-BCFdDbiP.js → pair-jTITfyXq.js} +1 -1
- package/dist/client/assets/{plan-ladder-CsmVoXQQ.js → plan-ladder-PntzlGKT.js} +1 -1
- package/dist/client/assets/{popover-CrZxQ_WL.js → popover-BPjYWaX6.js} +1 -1
- package/dist/client/assets/{post-calendar-D7geM2YK.js → post-calendar-eKJX_s_a.js} +1 -1
- package/dist/client/assets/{post-editor-ChtR1Ltr.js → post-editor-Pysa8f7p.js} +1 -1
- package/dist/client/assets/{preview-content-BvBDv3Fi.js → preview-content-Boimqppj.js} +1 -1
- package/dist/client/assets/{preview-dialog-COx6Lotq.js → preview-dialog-CN7AjqGG.js} +1 -1
- package/dist/client/assets/{profile-Bc9S2aAt.js → profile-BiAxQchj.js} +1 -1
- package/dist/client/assets/{project-app-view-ObUx-R3J.js → project-app-view-B0IzMBfg.js} +1 -1
- package/dist/client/assets/{project-feed-27M9wFaD.js → project-feed-BVHH5w-x.js} +1 -1
- package/dist/client/assets/{project-icon-DfxqT1AH.js → project-icon-CuANjNq9.js} +1 -1
- package/dist/client/assets/project-reports-CtAgGwQM.js +1 -0
- package/dist/client/assets/project-tasks-CtfScy-U.js +1 -0
- package/dist/client/assets/{projects-70vA9Ztg.js → projects-Cr_apGsd.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DXeCmI_E.js → projects-empty-state-D-bqMD-C.js} +1 -1
- package/dist/client/assets/{prompts-DEQvjN3W.js → prompts-DvidBSYs.js} +1 -1
- package/dist/client/assets/record-editor-4N7K4RP3.js +1 -0
- package/dist/client/assets/{redirect-editor-nH8dYkmn.js → redirect-editor-CSsFAdru.js} +1 -1
- package/dist/client/assets/reports-DFBPHTtD.js +1 -0
- package/dist/client/assets/{reports-BXOZrkbg.js → reports-Dj7anJoc.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DL82A2cU.js → reports-onboarding-BJMIvwV2.js} +1 -1
- package/dist/client/assets/{reports-tab-DO_Lp8eH.js → reports-tab-CRIp1Hgv.js} +2 -2
- package/dist/client/assets/{repositories-CMKipbLK.js → repositories-4R7S92Vo.js} +1 -1
- package/dist/client/assets/{repository-binding-Bbkm6nc1.js → repository-binding-BsOX976J.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Cag3a6oY.js → repository-import-picker-C3kXDtGM.js} +1 -1
- package/dist/client/assets/{repository-picker-CfTYgBDn.js → repository-picker-BBPsPem-.js} +1 -1
- package/dist/client/assets/{require-capability-DwsTiirz.js → require-capability-BQRXcKZf.js} +1 -1
- package/dist/client/assets/{required-auth-layout-yl3jbIxV.js → required-auth-layout-CY5-fsQx.js} +1 -1
- package/dist/client/assets/{reset-password-C5EXdCC7.js → reset-password-m2F-cAwU.js} +1 -1
- package/dist/client/assets/{resizable-CtYj4VXu.js → resizable-DQ1JinUF.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-COPKEIag.js → resolve-tab-icon-CqPFcsOb.js} +1 -1
- package/dist/client/assets/{review-settings-Dpq07FB5.js → review-settings-Cowp8hPh.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CDJeP4n9.js → rich-text-link-control-Btb_gPEm.js} +1 -1
- package/dist/client/assets/{roles-BCA_WGIg.js → roles-DijQei9u.js} +1 -1
- package/dist/client/assets/{route-BIN7HFum.js → route-G2ODtkgy.js} +1 -1
- package/dist/client/assets/{route-DR7xqOI0.js → route-c0oRuyA2.js} +1 -1
- package/dist/client/assets/route-vD_-x8ra.js +1 -0
- package/dist/client/assets/{runnable-block-editor-BaDSgAAv.js → runnable-block-editor-DkhNyqfT.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-AU726rjo.js → sandbox-lifecycle-context-jb4ybKyW.js} +1 -1
- package/dist/client/assets/{schema-CUw1risJ.js → schema-Q2jogyqX.js} +1 -1
- package/dist/client/assets/{scroll-area-C2S3fcxE.js → scroll-area-DR0CVAH-.js} +1 -1
- package/dist/client/assets/{search-input-Dd4B3qzf.js → search-input-EHmnvbpf.js} +1 -1
- package/dist/client/assets/{search-toggle-CsGviyR_.js → search-toggle-DJRb7yKK.js} +1 -1
- package/dist/client/assets/{secret-picker-oakuwK6W.js → secret-picker-CTAKJWNS.js} +1 -1
- package/dist/client/assets/{secrets-CXgB5-m9.js → secrets-DOyckzyZ.js} +1 -1
- package/dist/client/assets/{sections-editor-D8pxq_yu.js → sections-editor-BRGeM8NH.js} +1 -1
- package/dist/client/assets/{select-C350dwBx.js → select-51Zv-9Cd.js} +1 -1
- package/dist/client/assets/{select-model-CRWgLGNx.js → select-model-rJBFoveT.js} +1 -1
- package/dist/client/assets/{seo-editor-1V2gYAl_.js → seo-editor-Dl7p4VcN.js} +1 -1
- package/dist/client/assets/{separator-CDghQ8gc.js → separator-cPXLd5-L.js} +1 -1
- package/dist/client/assets/{settings-tab-CAkBws58.js → settings-tab-Dfk4u-hh.js} +1 -1
- package/dist/client/assets/{sheet-B2gAUp07.js → sheet-Ca0-oyIA.js} +1 -1
- package/dist/client/assets/{shell-layout-DT24w4k_.js → shell-layout-ClWpKxS6.js} +1 -1
- package/dist/client/assets/{skills-CyVOwqjn.js → skills-B3kD70y0.js} +1 -1
- package/dist/client/assets/{sso-CfVGd8zI.js → sso-CJf-0xYd.js} +1 -1
- package/dist/client/assets/{suggestion-yycalltA.js → suggestion-vXi1dOEx.js} +1 -1
- package/dist/client/assets/{switch-C4OygJ1j.js → switch-VMLT9Tz5.js} +1 -1
- package/dist/client/assets/{synced-repos-CRCUc2yM.js → synced-repos-CpDmCstt.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CnzBc78s.js → tab-icon-glyph-DnbRcmb2.js} +1 -1
- package/dist/client/assets/{table-BVqziFMU.js → table-C88-Bjzx.js} +1 -1
- package/dist/client/assets/{tabs-M4EGpP-K.js → tabs-FJP-o-3i.js} +1 -1
- package/dist/client/assets/{task-board-Dy1oP9tV.js → task-board-Bgv00oY-.js} +1 -1
- package/dist/client/assets/{task-route-Dya6D_p7.js → task-route-C2C70zzc.js} +1 -1
- package/dist/client/assets/{task-status-uh1TpLCM.js → task-status-26T0TGYu.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-dQI3iomY.js → taskboard-analytics-C9T1ymBl.js} +1 -1
- package/dist/client/assets/tasks-Cif5DICN.js +1 -0
- package/dist/client/assets/{tasks-D70uWBSC.js → tasks-CjQjz-C4.js} +1 -1
- package/dist/client/assets/{textarea-NMcEOyOg.js → textarea-_DbTnBu4.js} +1 -1
- package/dist/client/assets/{thread-analytics-B54AXYt6.js → thread-analytics-BQpe9Fst.js} +1 -1
- package/dist/client/assets/{thread-button-CgP5Z586.js → thread-button-CYDl6zgk.js} +1 -1
- package/dist/client/assets/{thread-intent-Jf2tKMef.js → thread-intent-koDe9mSM.js} +1 -1
- package/dist/client/assets/{thread-route-DxzVtF_c.js → thread-route-C9nowE2r.js} +1 -1
- package/dist/client/assets/{thread-route-IxUDda00.js → thread-route-CUC3R_MC.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-B8X3wACw.js → thread-sheet-body-4suIsvHl.js} +1 -1
- package/dist/client/assets/{toggle-group-DpTIfIjE.js → toggle-group-BJqqNUY3.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-C_PK_Noh.js → toolbar-icon-button-Dhq4cEQa.js} +1 -1
- package/dist/client/assets/{tooltip-BJNrweFg.js → tooltip-BwSylFMO.js} +1 -1
- package/dist/client/assets/{track-BtwjnpVQ.js → track-DMES-u1F.js} +1 -1
- package/dist/client/assets/{types-Zvb_HNLy.js → types-BsxWm7iK.js} +1 -1
- package/dist/client/assets/{usage-stats-N89KL5SR.js → usage-stats-CvgH3ARf.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bb-AtX2R.js → use-ai-providers-CfVbyz3K.js} +1 -1
- package/dist/client/assets/{use-automations-CySFN-Fc.js → use-automations-CQ2t-uGr.js} +1 -1
- package/dist/client/assets/{use-autosave-DG37V9_z.js → use-autosave-BgL0kqSO.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CmdNghlG.js → use-chat-layout-state-D7yGzp_y.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BPnWxYd_.js → use-clock-tick-wYAsKqfz.js} +1 -1
- package/dist/client/assets/{use-connect-companion-ECuWJz0C.js → use-connect-companion-DMunbKbE.js} +1 -1
- package/dist/client/assets/{use-connection-C0aQTMeC.js → use-connection-tG--PiPC.js} +1 -1
- package/dist/client/assets/{use-copy-BVWEkCC-.js → use-copy-BY3mmy_J.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DEMYuYyB.js → use-create-virtual-mcp-DrE82RSw.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Bd8PyfIy.js → use-date-fns-locale-NPvv0TyY.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DXb_Ac1O.js → use-debounced-autosave-7rLd-s_e.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DBJBbNih.js → use-debounced-value-DR-Gfjk_.js} +1 -1
- package/dist/client/assets/{use-deco-credits-_QhU-dhT.js → use-deco-credits-BxP5SLfN.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D3bXKKWM.js → use-decopilot-events-CwQnc79t.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DSFkVlnh.js → use-delete-connection-_bhfuBZz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BruYSdMh.js → use-deployment-admin-DKHU71Hf.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-ZFU-P35J.js → use-fast-preview-draft-url-C21NI266.js} +1 -1
- package/dist/client/assets/{use-file-configs-RTbLyPOX.js → use-file-configs-91HhaIM5.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-opYdDO9U.js → use-infinite-scroll-DqTPX32H.js} +1 -1
- package/dist/client/assets/{use-join-requests-c0wYTiAF.js → use-join-requests-DJpUhmHK.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DLoT5JrG.js → use-main-panel-tabs-De14HaMu.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Bc_ELMHW.js → use-mcp-auth-status-BNZOESd0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DAfDiXAH.js → use-mcp-client-DFuDBl-N.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CDl0wJU0.js → use-mcp-prompts-De3nG5XH.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C7pm9vnU.js → use-mcp-tools-B2ZjrWX-.js} +1 -1
- package/dist/client/assets/{use-members-CyU3kEXW.js → use-members-DHBXtBtG.js} +1 -1
- package/dist/client/assets/{use-mobile-DgFuzdmq.js → use-mobile-1i92y7fh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DrZpt_-x.js → use-navigate-to-agent-NTIA_MML.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-PycmjtEq.js +1 -0
- package/dist/client/assets/{use-open-billing-url-C-if4cJf.js → use-open-billing-url-B273AzTs.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C7_w-QfK.js → use-org-auth-client-Dk1S2UHu.js} +1 -1
- package/dist/client/assets/{use-org-fs-CKHreXlO.js → use-org-fs-B3fd2ZY9.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CdOm1Gkh.js → use-org-repo-syncs-GpPZ08uf.js} +1 -1
- package/dist/client/assets/{use-org-sso-CbL4kkEg.js → use-org-sso-M_5W5ztC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DQ43ZVi5.js → use-organization-roles-C-VtDx77.js} +1 -1
- package/dist/client/assets/{use-organization-settings-_CCzAfB0.js → use-organization-settings-CC6Gps4k.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DJawwVTN.js → use-panel-navigate-HcmlU8nx.js} +1 -1
- package/dist/client/assets/{use-project-scope-BTHyRdHp.js → use-project-scope-kqhGY-a6.js} +1 -1
- package/dist/client/assets/{use-releases-BWJN6YTw.js → use-releases-CiAhnOV9.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CiKeDiTH.js → use-reports-diagnostic-DtUhZ7mz.js} +1 -1
- package/dist/client/assets/{use-secrets-CSjuIq4b.js → use-secrets-uy0vK3Ad.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CeoNtR7i.js → use-section-preview-base-BgNDH0or.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Wyvnx53o.js → use-session-runtime-CpCboJak.js} +1 -1
- package/dist/client/assets/{use-tags-C3diByDZ.js → use-tags-D_kMdi6T.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Csh4rD2k.js → use-task-board-analytics-BevmBjnv.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BwC1dILR.js → use-task-board-events-BPQGAtRx.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DzFvwyIV.js → use-task-metadata-Cykx139z.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DXqO4MwU.js → use-thread-analytics-DibD9VpB.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-C05qBJbv.js → use-thread-outputs-D4tzU9Ws.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BgB-4a9I.js +1 -0
- package/dist/client/assets/{useQueries-BcxNFZiu.js → useQueries-B5Zt_QWP.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKhoFoKJ.js +1 -0
- package/dist/client/assets/{users-Cc-KY6pD.js → users-dCrSS50o.js} +1 -1
- package/dist/client/assets/{utils-DPdaJHGR.js → utils-CzmbMTk-.js} +1 -1
- package/dist/client/assets/{variant-calendar-BJjVTz4W.js → variant-calendar-B1kPGJgC.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CwgRSkJP.js → variant-matcher-override-Bj0QjVtq.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CQqizETf.js → view-mode-toggle-BAOg0Uje.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BdXZSyI0.js → virtual-mcp-BTCWI931.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DwiMM2IP.js +0 -1
- package/dist/client/assets/agent-deck-E2P9m0dI.js +0 -1
- package/dist/client/assets/agent-library-Be8pU2hW.js +0 -1
- package/dist/client/assets/agent-library-file-CY8i2CE4.js +0 -1
- package/dist/client/assets/agent-settings-CuDtw36W.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DRE7bc_V.js +0 -2
- package/dist/client/assets/agent-view-CI9PvOjo.js +0 -1
- package/dist/client/assets/api-keys-CKqJk5_6.js +0 -1
- package/dist/client/assets/app-editor-DS_J4EUn.js +0 -1
- package/dist/client/assets/flat-project-zMUH6pEW.js +0 -1
- package/dist/client/assets/index-CYfmFyzv.js +0 -64
- package/dist/client/assets/index-DoNIk522.css +0 -1
- package/dist/client/assets/library-8wHr6YwM.js +0 -1
- package/dist/client/assets/project-reports-CYg2nuJI.js +0 -1
- package/dist/client/assets/project-tasks-C8uyyfmf.js +0 -1
- package/dist/client/assets/record-editor-_3tMo9Zr.js +0 -1
- package/dist/client/assets/reports-Bf-BvYhy.js +0 -1
- package/dist/client/assets/route-DTM6T9N4.js +0 -1
- package/dist/client/assets/tasks-W04QS25_.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CD7nCSQB.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DZS3Aawa.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DGDEkzHG.js +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{c as $,b as j,r as E,j as x,l as K,t as ue,X as Tt,m as vt,K as At,aR as Mt,h as Xe}from"./index-BTRkPuaE.js";import{a as St,E as ie,j as Ct,h as Je,S as Rt,r as P,t as Et,v as $t,w as Ye,x as N,y as Ee,z as _t,A as Lt,B as $e,C as It,G as Z,N as D,m as H,H as Y,T as et,R as ke,I as be,J as zt,K as Pt,L as Ht,O as jt,s as Nt,Q as Ot,U as Bt,u as Dt,b as Ft}from"./index-DktJOqdm.js";import{T as _,n as qt,i as Wt,E as Ut}from"./rich-text-link-control-CDJeP4n9.js";import{a as Gt,e as tt,s as Zt,S as Kt}from"./suggestion-yycalltA.js";import{B as Vt,c as Qt,t as Xt,C as nt,f as Jt,g as _e,s as Yt,m as Le,a as Ie,b as en,d as ze,e as tn,h as nn,i as rn,j as sn,k as an,l as on,n as ln}from"./index-BwZnKcdF.js";import{ac as cn,ad as un,af as hn,I as dn,b7 as pn,aX as fn}from"./agent-icon-BJAncODg.js";import{i as gn}from"./XClose-DTOuD_e7.js";import{i as mn}from"./Check-CZYLh537.js";import{i as kn}from"./Link01-BK2WDfDE.js";import{s as bn}from"./Trash01-C2tQl3wO.js";import{i as xn,b as wn}from"./use-org-fs-CKHreXlO.js";import{E as Pe,i as rt,a as yn,b as Tn,A as vn,c as An,m as Mn,d as Sn,e as Cn}from"./markdown-B6rsJl8D.js";import{i as st}from"./X-CHFG7-mU.js";import{A as Rn}from"./avatar-CmjVNkwN.js";import{f as En,C as $n,c as _n,a as Ln,b as In}from"./command-CBb61KwU.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-C7_w-QfK.js";import{I as Hn}from"./icon-button-CLFo5Lxf.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,c]=E.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const h=u;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),c(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=qt(a);if(M===""){g();return}if(!Wt(M)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),c(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:K("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(mn,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=St(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let c;e[4]!==r?(c=r("markdownEditor.heading2"),e[4]=r,e[5]=c):c=e[5];let u;e[6]!==r?(u=r("markdownEditor.heading3"),e[6]=r,e[7]=u):u=e[7];let h;e[8]!==o||e[9]!==c||e[10]!==u?(h={1:o,2:c,3:u},e[8]=o,e[9]=c,e[10]=u,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Vt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(cn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(dn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=rt(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const c=l?yn:Tn,u=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:c,files:[new File([a],u,{type:a.type})]}),r(`${c}/${u}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Je("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Ct({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Kn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,c=t.state.doc.resolve(e),u=c.parent.textBetween(Math.max(0,c.parentOffset-1),c.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...u&&!/\s/.test(u)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Rt.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=rt(g);Kn(h,Zn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Vn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:V,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
1
|
+
import{c as $,b as j,r as E,j as x,l as q,t as ue,X as Tt,m as vt,K as At,aR as Mt,h as Xe}from"./index-D7wkC5M7.js";import{a as St,E as ie,j as Ct,h as Je,S as Rt,r as P,t as Et,v as $t,w as Ye,x as N,y as Ee,z as _t,A as Lt,B as $e,C as It,G as K,N as D,m as H,H as Y,T as et,R as ke,I as be,J as zt,K as Pt,L as Ht,O as jt,s as Nt,Q as Ot,U as Bt,u as Dt,b as Ft}from"./index-FVnUm1rm.js";import{T as _,n as qt,i as Wt,E as Ut}from"./rich-text-link-control-Btb_gPEm.js";import{a as Gt,e as tt,s as Zt,S as Kt}from"./suggestion-vXi1dOEx.js";import{B as Vt,c as Qt,t as Xt,C as nt,f as Jt,g as _e,s as Yt,m as Le,a as Ie,b as en,d as ze,e as tn,h as nn,i as rn,j as sn,k as an,l as on,n as ln}from"./index-cxIHsmct.js";import{ac as cn,ad as un,af as dn,I as hn,b7 as pn,aX as fn}from"./agent-icon-tpETiP8G.js";import{i as gn}from"./XClose-DRl0M6hN.js";import{i as mn}from"./Check-C_aMX7t2.js";import{i as kn}from"./Link01-DCc5IbpQ.js";import{s as bn}from"./Trash01-CXleTtSn.js";import{i as xn,b as wn}from"./use-org-fs-B3fd2ZY9.js";import{E as Pe,i as rt,a as yn,b as Tn,A as vn,c as An,m as Mn,d as Sn,e as Cn}from"./markdown-CMkHKmDN.js";import{i as st}from"./X-DcGBk4Cg.js";import{A as Rn}from"./avatar-BIZUAEfG.js";import{f as En,C as $n,c as _n,a as Ln,b as In}from"./command-Y_VN6QLL.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-Dk1S2UHu.js";import{I as Hn}from"./icon-button-bLhE-IOt.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const d=c;let h;e[2]!==n||e[3]!==s?(h=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=h):h=e[4];const f=h;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=qt(a);if(M===""){g();return}if(!Wt(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==d||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:d,label:w,onClick:f,children:y}),e[14]=d,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==d||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(mn,{size:14})}),d&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=d,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=St(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let d;e[8]!==o||e[9]!==u||e[10]!==c?(d={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=d):d=e[11];const h=d;let f;e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Vt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(cn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(hn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:h[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=rt(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Je("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Ct({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function de(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Kn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),d=()=>i.text(" "),h=l.isInline?[...c&&!/\s/.test(c)?[d()]:[],l,d()]:l,f=t.state.tr.replaceWith(e,e,h);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Rt.near(f.doc.resolve(k));o&&f.setSelection(y),s&&de(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=d=>{a.current+=d,i(a.current)},o=(d,h,f)=>{if(!t||h.length===0)return!1;l(h.length);const p=Symbol("upload");return d.dispatch(de(d.state.tr,p,f)),(async()=>{for(const g of h)try{const m=await r.current(g);if(!m||d.isDestroyed)continue;const k=rt(g);Kn(d,Zn(d.state,p)??d.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}d.isDestroyed||d.dispatch(de(d.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(d,h)=>{const f=Vn(h.clipboardData);return f.length===0?!1:(h.stopPropagation(),o(d,f,d.state.selection.to))},handleDrop:(d,h,f,p)=>{if(p)return!1;const g=Array.from(h.dataTransfer?.files??[]);if(g.length===0)return!1;const m=d.posAtCoords({left:h.clientX,top:h.clientY})?.pos;return m===void 0?!1:(h.stopPropagation(),o(d,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:V,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ut=/^( {2,}|\\)\n(?!\s*$)/,hr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),dt=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ht=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=A(ht,"u").replace(/punct/g,W).getRegex(),br=A(ht,"u").replace(/punct/g,dt).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(pt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),wr=A(pt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,dt).getRegex(),yr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Tr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=A(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Mr=A(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=A(ve).replace("(?:-->|$)","-->").getRegex(),Rr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),gt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=A("reflink|nolink(?!\\()","g").replace("reflink",ft).replace("nolink",gt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:ut,code:dr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:xr,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:gt,punctuation:pr,reflink:ft,reflinkSearch:$r,tag:Rr,text:hr,url:O},_r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},he={...Se,emStrongRDelimAst:wr,emStrongLDelim:br,delLDelim:Tr,delRDelim:Ar,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ne).getRegex()},Lr={...he,br:A(ut).replace("{2,}","*").getRegex(),text:A(he.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},U={normal:Se,gfm:he,breaks:Lr,pedantic:_r},Ir={"&":"&","<":"<",">":">",'"':""","'":"'"},Oe=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function G(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
|
-
`)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:
|
|
5
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Hr(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=
|
|
6
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=
|
|
4
|
+
`)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:G(n,`
|
|
5
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Hr(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=G(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:G(e[0],`
|
|
6
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=G(e[0],`
|
|
7
7
|
`).split(`
|
|
8
|
-
`),r="",s="",i=[];for(;n.length>0;){let a=!1,l=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))l.push(n[o]),a=!0;else if(!a)l.push(n[o]);else break;n=n.slice(o);let
|
|
9
|
-
`),u
|
|
8
|
+
`),r="",s="",i=[];for(;n.length>0;){let a=!1,l=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))l.push(n[o]),a=!0;else if(!a)l.push(n[o]);else break;n=n.slice(o);let u=l.join(`
|
|
9
|
+
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
10
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
-
${
|
|
12
|
-
${
|
|
11
|
+
${u}`:u,s=s?`${s}
|
|
12
|
+
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=d,n.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let f=h,p=f.raw+`
|
|
13
13
|
`+n.join(`
|
|
14
|
-
`),g=this.blockquote(p);i[i.length-1]=g,r=r.substring(0,r.length-f.raw.length)+g.raw,s=s.substring(0,s.length-f.text.length)+g.text;break}else if(
|
|
14
|
+
`),g=this.blockquote(p);i[i.length-1]=g,r=r.substring(0,r.length-f.raw.length)+g.raw,s=s.substring(0,s.length-f.text.length)+g.text;break}else if(h?.type==="list"){let f=h,p=f.raw+`
|
|
15
15
|
`+n.join(`
|
|
16
|
-
`),g=this.list(p);i[i.length-1]=g,r=r.substring(0,r.length-
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),a=!1;for(;t;){let o=!1,
|
|
18
|
-
`,1)[0],e[1].length),
|
|
19
|
-
`,1)[0],f=!
|
|
20
|
-
`,t=t.substring(
|
|
21
|
-
`,1)[0],v;if(
|
|
22
|
-
`+v.slice(p);else{if(f||
|
|
23
|
-
`+
|
|
24
|
-
`,t=t.substring(b.length+1),
|
|
16
|
+
`),g=this.list(p);i[i.length-1]=g,r=r.substring(0,r.length-h.raw.length)+g.raw,s=s.substring(0,s.length-f.raw.length)+g.raw,n=p.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),a=!1;for(;t;){let o=!1,u="",c="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let d=Pr(e[2].split(`
|
|
18
|
+
`,1)[0],e[1].length),h=t.split(`
|
|
19
|
+
`,1)[0],f=!d.trim(),p=0;if(this.options.pedantic?(p=2,c=d.trimStart()):f?p=e[1].length+1:(p=d.search(this.rules.other.nonSpaceChar),p=p>4?1:p,c=d.slice(p),p+=e[1].length),f&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
20
|
+
`,t=t.substring(h.length+1),o=!0),!o){let g=this.rules.other.nextBulletRegex(p),m=this.rules.other.hrRegex(p),k=this.rules.other.fencesBeginRegex(p),w=this.rules.other.headingBeginRegex(p),y=this.rules.other.htmlBeginRegex(p),T=this.rules.other.blockquoteBeginRegex(p);for(;t;){let b=t.split(`
|
|
21
|
+
`,1)[0],v;if(h=b,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),v=h):v=h.replace(this.rules.other.tabCharGlobal," "),k.test(h)||w.test(h)||y.test(h)||T.test(h)||g.test(h)||m.test(h))break;if(v.search(this.rules.other.nonSpaceChar)>=p||!h.trim())c+=`
|
|
22
|
+
`+v.slice(p);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(d)||w.test(d)||m.test(d))break;c+=`
|
|
23
|
+
`+h}f=!h.trim(),u+=b+`
|
|
24
|
+
`,t=t.substring(b.length+1),d=v.slice(p)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),s.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=u}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let o of s.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=c.checked,s.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=c.raw+o.tokens[0].raw,o.tokens[0].text=c.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(c)):o.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):o.tokens.unshift(c)}}if(!s.loose){let u=o.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=c}}if(s.loose)for(let o of s.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=De(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push(De(a,i.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[o]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=G(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=zr(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Fe(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Fe(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,a,l=s,o=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+s);(r=u.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){o+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+o);let c=[...r[0]][0].length,d=t.slice(0,s+r.index+c+a);if(Math.min(s,a)%2){let f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,a,l=s,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+s);(r=o.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==s))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let u=[...r[0]][0].length,c=t.slice(0,s+r.index+u+a),d=c.slice(s,-s);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},L=class pe{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:R,block:Q.normal,inline:U.normal};this.options.pedantic?(n.block=Q.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=Q.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:Q,inline:U}}static lex(e,n){return new pe(n).lex(e)}static lexInline(e,n){return new pe(n).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=n.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
|
|
28
28
|
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
@@ -31,13 +31,13 @@ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
31
31
|
`+s.text,this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
32
32
|
`)?"":`
|
|
33
33
|
`)+s.raw,a.text+=`
|
|
34
|
-
`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(
|
|
34
|
+
`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},l),typeof o=="number"&&o>=0&&(a=Math.min(a,o))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
35
35
|
`)?"":`
|
|
36
36
|
`)+s.raw,a.text+=`
|
|
37
37
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+s.raw,a.text+=`
|
|
40
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let o;if(this.options.extensions?.inline?.some(
|
|
40
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=n.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,r,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,r,l)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},d),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),a=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):n.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},re=class{options;parser;constructor(t){this.options=t||F}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(R.notSpaceStart)?.[0],s=t.replace(R.endingNewline,"")+`
|
|
41
41
|
`;return r?'<pre><code class="language-'+z(r)+'">'+(n?s:z(s,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(n?s:z(s,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -55,29 +55,29 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
55
55
|
`}tablerow({text:t}){return`<tr>
|
|
56
56
|
${t}</tr>
|
|
57
57
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=Be(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+z(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Be(t);if(s===null)return z(n);t=s;let i=`<img src="${t}" alt="${z(n)}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Ce=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},I=class fe{options;renderer;textRenderer;constructor(e){this.options=e||F,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ce}static parse(e,n){return new fe(n).parse(e)}static parseInline(e,n){return new fe(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},B=new jr;function S(t,e){return B.parse(t,e)}S.options=S.setOptions=function(t){return B.setOptions(t),S.defaults=B.defaults,at(S.defaults),S};S.getDefaults=xe;S.defaults=F;S.use=function(...t){return B.use(...t),S.defaults=B.defaults,at(S.defaults),S};S.walkTokens=function(t,e){return B.walkTokens(t,e)};S.parseInline=B.parseInline;S.Parser=I;S.parser=I.parse;S.Renderer=re;S.TextRenderer=Ce;S.Lexer=L;S.lexer=L.lex;S.Tokenizer=ne;S.Hooks=
|
|
58
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=Be(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+z(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Be(t);if(s===null)return z(n);t=s;let i=`<img src="${t}" alt="${z(n)}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},Ce=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},I=class fe{options;renderer;textRenderer;constructor(e){this.options=e||F,this.options.renderer=this.options.renderer||new re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ce}static parse(e,n){return new fe(n).parse(e)}static parseInline(e,n){return new fe(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},Z=class{options;block;constructor(t){this.options=t||F}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?L.lex:L.lexInline}provideParser(t=this.block){return t?I.parse:I.parseInline}},jr=class{defaults=xe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=re;TextRenderer=Ce;Lexer=L;Tokenizer=ne;Hooks=Z;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let a=s[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new re(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=n.renderer[a],o=s[a];s[a]=(...u)=>{let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new ne(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=n.tokenizer[a],o=s[a];s[a]=(...u)=>{let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Z;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=n.hooks[a],o=s[a];Z.passThroughHooks.has(i)?s[a]=u=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await l.call(s,u);return o.call(s,d)})();let c=l.call(s,u);return o.call(s,c)}:s[a]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(s,u);return d===!1&&(d=await o.apply(s,u)),d})();let c=l.apply(s,u);return c===!1&&(c=o.apply(s,u)),c}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return I.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?L.lex:L.lexInline)(a,s),o=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(o,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser(t):t?I.parse:I.parseInline)(o,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(t):t?L.lex:L.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?I.parse:I.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},B=new jr;function S(t,e){return B.parse(t,e)}S.options=S.setOptions=function(t){return B.setOptions(t),S.defaults=B.defaults,at(S.defaults),S};S.getDefaults=xe;S.defaults=F;S.use=function(...t){return B.use(...t),S.defaults=B.defaults,at(S.defaults),S};S.walkTokens=function(t,e){return B.walkTokens(t,e)};S.parseInline=B.parseInline;S.Parser=I;S.parser=I.parse;S.Renderer=re;S.TextRenderer=Ce;S.Lexer=L;S.lexer=L.lex;S.Tokenizer=ne;S.Hooks=Z;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;I.parse;L.lex;const Nr=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function Or(t){return t.flatMap((e,n)=>{var r;if(e.type==="space"||((r=t[n+1])===null||r===void 0?void 0:r.type)==="space")return[e];const s=(e.raw||"").match(Nr);return s?[{...e,raw:(e.raw||"").slice(0,-s[0].length)},{type:"space",raw:s[0]}]:[e]})}function Br(t,e){const n=e.split(`
|
|
60
60
|
`).flatMap(r=>[r,""]).map(r=>`${t}${r}`).join(`
|
|
61
|
-
`);return n.slice(0,n.length-1)}function Dr(t,e){const n=[];return Array.from(t.entries()).forEach(([r,s])=>{if(!e){n.push(r);return}(e.marks||[]).find(i=>i.type===r&&
|
|
62
|
-
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,r),a=this.normalizeParseResult(i);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>ce(l).isTask),n=t.items.some(l=>!ce(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:
|
|
61
|
+
`);return n.slice(0,n.length-1)}function Dr(t,e){const n=[];return Array.from(t.entries()).forEach(([r,s])=>{if(!e){n.push(r);return}(e.marks||[]).find(i=>i.type===r&&K(i.attrs,s.attrs))||n.push(r)}),n}function Fr(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{const i=t.get(r);(!i||!K(i.attrs,s.attrs))&&n.push({type:r,mark:s})}),n}function qr(t,e,n,r){const s=!n,i=n&&(!n.marks||n.marks.length===0),a=n&&n.marks&&!r(e,new Map(n.marks.map(o=>[o.type,o]))),l=[];return(s||i||a)&&(n&&n.marks?Array.from(t.entries()).reverse().forEach(([o,u])=>{n.marks.find(c=>c.type===o&&K(c.attrs,u.attrs))||l.push(o)}):(s||i)&&l.push(...Array.from(t.keys()).reverse())),l}function Wr(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=e(r,t.get(r));s&&(n=s+n)}),t.clear(),n}function Ur(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const a=n(s,i);a&&(r+=a),e.set(s,i)}),r}function ce(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function X(t,e){return typeof t!="string"?"json":e}const Gr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Zr=/<\/?([a-zA-Z][\w-]*)/g;function Kr(t){const e=[];let n;for(;(n=Zr.exec(t))!==null;)e.push(n[1].toLowerCase());return e}function Vr(t){const e=t.toLowerCase();return e.includes("-")?!1:!Gr.has(e)}function Qr(t,e){return Kr(t).some(n=>Vr(n)?!e.has(n):!1)}var qe=class{constructor(t){var e,n,r,s,i;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t?.marked)!==null&&e!==void 0?e:S,this.indentStyle=(n=t==null||(r=t.indentation)===null||r===void 0?void 0:r.style)!==null&&n!==void 0?n:"space",this.indentSize=(s=t==null||(i=t.indentation)===null||i===void 0?void 0:i.size)!==null&&s!==void 0?s:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,Et($t(t.extensions)).forEach(a=>this.registerExtension(a)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,n;this.extensions.push(t);const r=Ye(N(t,"code")),s=t.name;r&&this.codeTypes.add(s),this.extensionRanks.has(s)||this.extensionRanks.set(s,this.extensionRanks.size);const i=N(t,"markdownTokenName")||s,a=N(t,"parseMarkdown"),l=N(t,"renderMarkdown"),o=N(t,"markdownTokenizer"),u=(e=N(t,"markdownOptions"))!==null&&e!==void 0?e:null,c={tokenName:i,nodeName:s,parseMarkdown:a,renderMarkdown:l,isIndenting:(n=u?.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:u?.htmlReopen,tokenizer:o};if(i&&a){const d=this.registry.get(i)||[];d.push(c),this.registry.set(i,d)}if(l){const d=this.nodeTypeRegistry.get(s)||[];d.push(c),this.nodeTypeRegistry.set(s,d)}o&&this.hasMarked()&&this.registerTokenizer(o)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!==null&&e!==void 0?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,i=this.createTokenizerHelpers.bind(this),a=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:u=>u.indexOf(n):l=u=>{const c=s(u,[],this.createTokenizerHelpers(this.createLexer()));return c&&c.raw?u.indexOf(c.raw):-1};const o={name:e,level:r,start:l,tokenizer(u,c){const d=this.lexer?i(this.lexer):i(a()),h=s(u,c,d);if(h&&h.type)return{...h,type:h.type||e,raw:h.raw||"",tokens:h.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[o]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const r=n.lex(t);return{type:"doc",content:this.parseTokens(r,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const n=e?Or(t):t,r=n.reduce((a,l,o)=>(l.type!=="space"&&a.push(o),a),[]);let s=-1,i=0;return n.flatMap((a,l)=>{for(;i<r.length&&r[i]<l;)s=r[i],i+=1;if(e&&a.type==="space"){var o;const c=(o=r[i])!==null&&o!==void 0?o:-1;return this.createImplicitEmptyParagraphsFromSpace(a,s,c)}const u=this.parseToken(a,e);return u===null?[]:Array.isArray(u)?u:[u]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const s=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:s},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
|
|
62
|
+
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,r),a=this.normalizeParseResult(i);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>ce(l).isTask),n=t.items.some(l=>!ce(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const o=t.items[l],{isTask:u,checked:c,indentLevel:d}=ce(o);let h=o;if(u){const p=(o.raw||o.text||"").split(`
|
|
63
63
|
`),g=p[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),m=g?g[2]:"";let k=[];if(p.length>1&&p.slice(1).join(`
|
|
64
64
|
`).trim()){const w=p.slice(1),y=w.filter(T=>T.trim());if(y.length>0){const T=Math.min(...y.map(v=>v.length-v.trimStart().length)),b=w.map(v=>v.trim()?v.slice(T):"").join(`
|
|
65
65
|
`).trim();b&&(k=this.markedInstance.lexer(`${b}
|
|
66
|
-
`))}}d={type:"taskItem",raw:"",mainContent:m,indentLevel:h,checked:u??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=c?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[d],i=f):s.push(d)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],c={...t,type:o.type,items:o.items},u=this.parseToken(c);u&&(Array.isArray(u)?a.push(...u):a.push(u))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a<t.length;a+=1){const l=t[a];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(o),u=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(o)){const d=u[1],f=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const w=t[k],y=((s=(i=w.raw)!==null&&i!==void 0?i:w.text)!==null&&s!==void 0?s:"").toString();if(m.push(y),w.type==="html"&&p.test(y)){g=k;break}}if(g!==-1){const k=m.join(""),w={type:"html",raw:k,text:k,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}a=g;continue}}const h=this.parseHTMLToken(l);if(h){const d=this.normalizeParseResult(h);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const c=this.createParseHelpers(),u=o.parseMarkdown(l,c);if(this.isMarkResult(u)){const h=this.applyMarkToContent(u.mark,u.content,u.attrs);e.push(...h)}else{const h=this.normalizeParseResult(u);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const c=l.marks||[],u=o.marks||[];_t(c,u)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=Lt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Qr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(It(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(u,h)=>{const d=a.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,d):this.renderNodes(u,t,h||"",n,d)},renderChild:(u,h)=>{const d=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,t,h,d)},indent:u=>this.indentString+u,wrapInBlock:Br},c={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,c))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,c)=>{const u=c<t.length-1?t[c+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(b=>[b.type,b])),f=this.getMarksToOpenForSerialization(i,d,u),p=Dr(d,u),g=p.filter(b=>i.has(b)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const b=h.match(/(\s+)$/);b&&(k=b[1],h=h.slice(0,-k.length))}m||p.slice().reverse().forEach(b=>{if(!i.has(b))return;const v=d.get(b),M=this.getMarkClosing(b,v,l.get(b));M&&(h+=M),i.has(b)&&(i.delete(b),l.delete(b))});let w="";if(f.length>0){const b=h.match(/^(\s+)/);b&&(w=b[1],h=h.slice(w.length))}f.forEach(({type:b,mark:v})=>{const M=a.has(b)?"html":"markdown",C=this.getMarkOpening(b,v,M);C&&(h=C+h),l.set(b,M),a.delete(b)}),m||f.slice().reverse().forEach(({type:b,mark:v})=>{i.set(b,v)}),h=w+h;let y;if(m){const b=new Set((u?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{b.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const v=Array.from(i.keys()),M=g.slice().sort((C,yt)=>v.indexOf(yt)-v.indexOf(C));y=[...f.map(C=>C.type),...M]}else y=qr(i,d,u,this.markSetsEqual.bind(this));let T="";if(y.length>0){const b=h.match(/(\s+)$/);b&&(T=b[1],h=h.slice(0,-T.length))}y.forEach(b=>{var v;const M=(v=i.get(b))!==null&&v!==void 0?v:d.get(b),C=this.getMarkClosing(b,M,l.get(b));C&&(h+=C),i.delete(b),l.delete(b)}),h+=T,h+=k,s.push(h)}else{const h=new Set((o.marks||[]).map(k=>k.type)),d=new Map,f=new Map;i.forEach((k,w)=>{if(h.has(w)){var y;d.set(w,k),f.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=Wr(i,(k,w)=>this.getMarkClosing(k,w,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,c,r),m=o.type==="hardBreak"?"":Ur(d,i,(k,w)=>{var y;const T=(y=f.get(k))!==null&&y!==void 0?y:"markdown";return l.set(k,T),this.getMarkOpening(k,w,T)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:u=>u,wrapInBlock:(u,h)=>u+h},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(a);return c>=0?o.substring(0,c):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),c=o.indexOf(a),u=c+33;return c>=0?o.substring(u):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{const s=e.get(n);return s&&Z(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Fr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(c,u)=>s.some(h=>h.type===c&&Z(h.attrs,u)),a=(c,u)=>{var h,d;const f=(h=this.extensionRanks.get(c.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return f!==p?p-f:c.type.localeCompare(u.type)},l=r.filter(c=>!i(c.type,c.mark.attrs)).sort(a),o=r.filter(c=>i(c.type,c.mark.attrs)).sort(a);return[...l,...o]}};const Xr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,n)}}},addStorage(){return{manager:new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function se(t){return t==="left"||t==="right"||t==="center"?t:null}function Jr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Yr(t){return se(t?.align)}function mt(){return{default:null,parseHTML:t=>Jr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function es(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function kt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):es(t)}const ts=/[ \t\r\n\f]+/g;function bt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(ts,"")===""}function xt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ns=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:kt},align:mt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>xt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:kt},align:mt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>xt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),ss=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function We(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const c=t.firstChild;if(c!==null)for(let d=0,f=0;d<c.childCount;d+=1){const{colspan:p,colwidth:g}=c.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],w=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==w){const[y,T]=ge(r,k);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,b]=ge(r,k);y.style.setProperty(T,b),e.appendChild(y)}}}for(;o;){var u;const d=o.nextSibling;(u=o.parentNode)===null||u===void 0||u.removeChild(o),o=d}const h=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!h?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var is=class{constructor(t,e,n,r={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),We(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,We(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function as(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let u=0,h=0;u<l.childCount;u+=1){const{colspan:d,colwidth:f}=l.child(u).attrs;for(let p=0;p<d;p+=1,h+=1){const g=n===h?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",c=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:c}}function Ue(t,e){return t.createAndFill()}function os(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function ls(t,e,n,r,s){const i=os(t),a=[],l=[];for(let c=0;c<n;c+=1){const u=Ue(i.cell);if(u&&l.push(u),r){const h=Ue(i.header_cell);h&&a.push(h)}}const o=[];for(let c=0;c<e;c+=1)o.push(i.row.createChecked(null,r&&c===0?a:l));return i.table.createChecked(null,o)}function cs(t){return t instanceof nt}const J=({editor:t})=>{const{selection:e}=t.state;if(!cs(e))return!1;let n=0;const r=Y(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ge(t,e){const n=t.mapping.map(e),r=Y(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(et.near(t.doc.resolve(i),-1))}function us(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function hs(t){return t.split(`
|
|
66
|
+
`))}}h={type:"taskItem",raw:"",mainContent:m,indentLevel:d,checked:c??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=u?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[h],i=f):s.push(h)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],u={...t,type:o.type,items:o.items},c=this.parseToken(u);c&&(Array.isArray(c)?a.push(...c):a.push(c))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a<t.length;a+=1){const l=t[a];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&c&&!/\/>$/.test(o)){const h=c[1],f=this.escapeRegex(h),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const w=t[k],y=((s=(i=w.raw)!==null&&i!==void 0?i:w.text)!==null&&s!==void 0?s:"").toString();if(m.push(y),w.type==="html"&&p.test(y)){g=k;break}}if(g!==-1){const k=m.join(""),w={type:"html",raw:k,text:k,block:!1},y=this.parseHTMLToken(w);if(y){const T=this.normalizeParseResult(y);Array.isArray(T)?e.push(...T):T&&e.push(T)}a=g;continue}}const d=this.parseHTMLToken(l);if(d){const h=this.normalizeParseResult(d);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const u=this.createParseHelpers(),c=o.parseMarkdown(l,u);if(this.isMarkResult(c)){const d=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...d)}else{const d=this.normalizeParseResult(c);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const u=l.marks||[],c=o.marks||[];_t(u,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=Lt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Qr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(It(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,d)=>{const h=a.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,d||"",n,h):this.renderNodes(c,t,d||"",n,h)},renderChild:(c,d)=>{const h=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,d,h)},indent:c=>this.indentString+c,wrapInBlock:Br},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,u)=>{const c=u<t.length-1?t[u+1]:null;if(o.type)if(o.type==="text"){let d=this.encodeTextForMarkdown(o.text||"",o,e);const h=new Map((o.marks||[]).map(b=>[b.type,b])),f=this.getMarksToOpenForSerialization(i,h,c),p=Dr(h,c),g=p.filter(b=>i.has(b)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const b=d.match(/(\s+)$/);b&&(k=b[1],d=d.slice(0,-k.length))}m||p.slice().reverse().forEach(b=>{if(!i.has(b))return;const v=h.get(b),M=this.getMarkClosing(b,v,l.get(b));M&&(d+=M),i.has(b)&&(i.delete(b),l.delete(b))});let w="";if(f.length>0){const b=d.match(/^(\s+)/);b&&(w=b[1],d=d.slice(w.length))}f.forEach(({type:b,mark:v})=>{const M=a.has(b)?"html":"markdown",C=this.getMarkOpening(b,v,M);C&&(d=C+d),l.set(b,M),a.delete(b)}),m||f.slice().reverse().forEach(({type:b,mark:v})=>{i.set(b,v)}),d=w+d;let y;if(m){const b=new Set((c?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{b.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const v=Array.from(i.keys()),M=g.slice().sort((C,yt)=>v.indexOf(yt)-v.indexOf(C));y=[...f.map(C=>C.type),...M]}else y=qr(i,h,c,this.markSetsEqual.bind(this));let T="";if(y.length>0){const b=d.match(/(\s+)$/);b&&(T=b[1],d=d.slice(0,-T.length))}y.forEach(b=>{var v;const M=(v=i.get(b))!==null&&v!==void 0?v:h.get(b),C=this.getMarkClosing(b,M,l.get(b));C&&(d+=C),i.delete(b),l.delete(b)}),d+=T,d+=k,s.push(d)}else{const d=new Set((o.marks||[]).map(k=>k.type)),h=new Map,f=new Map;i.forEach((k,w)=>{if(d.has(w)){var y;h.set(w,k),f.set(w,(y=l.get(w))!==null&&y!==void 0?y:"markdown")}});const p=Wr(i,(k,w)=>this.getMarkClosing(k,w,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,u,r),m=o.type==="hardBreak"?"":Ur(h,i,(k,w)=>{var y;const T=(y=f.get(k))!==null&&y!==void 0?y:"markdown";return l.set(k,T),this.getMarkOpening(k,w,T)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:c=>c,wrapInBlock:(c,d)=>c+d},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a);return u>=0?o.substring(0,u):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,h)=>d+h},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a),c=u+33;return u>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{const s=e.get(n);return s&&K(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Fr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(u,c)=>s.some(d=>d.type===u&&K(d.attrs,c)),a=(u,c)=>{var d,h;const f=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,p=(h=this.extensionRanks.get(c.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER;return f!==p?p-f:u.type.localeCompare(c.type)},l=r.filter(u=>!i(u.type,u.mark.attrs)).sort(a),o=r.filter(u=>i(u.type,u.mark.attrs)).sort(a);return[...l,...o]}};const Xr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,n)}}},addStorage(){return{manager:new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new qe({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function se(t){return t==="left"||t==="right"||t==="center"?t:null}function Jr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Yr(t){return se(t?.align)}function mt(){return{default:null,parseHTML:t=>Jr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function es(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function kt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):es(t)}const ts=/[ \t\r\n\f]+/g;function bt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(ts,"")===""}function xt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ns=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:kt},align:mt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>xt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:kt},align:mt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>bt(t)?{}:!1,getContent:(t,e)=>xt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),ss=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function We(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const u=t.firstChild;if(u!==null)for(let h=0,f=0;h<u.childCount;h+=1){const{colspan:p,colwidth:g}=u.child(h).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],w=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==w){const[y,T]=ge(r,k);o.style.setProperty(y,T)}o=o.nextSibling}else{const y=document.createElement("col"),[T,b]=ge(r,k);y.style.setProperty(T,b),e.appendChild(y)}}}for(;o;){var c;const h=o.nextSibling;(c=o.parentNode)===null||c===void 0||c.removeChild(o),o=h}const d=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!d?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var is=class{constructor(t,e,n,r={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),We(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,We(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function as(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let c=0,d=0;c<l.childCount;c+=1){const{colspan:h,colwidth:f}=l.child(c).attrs;for(let p=0;p<h;p+=1,d+=1){const g=n===d?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",u=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:u}}function Ue(t,e){return t.createAndFill()}function os(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function ls(t,e,n,r,s){const i=os(t),a=[],l=[];for(let u=0;u<n;u+=1){const c=Ue(i.cell);if(c&&l.push(c),r){const d=Ue(i.header_cell);d&&a.push(d)}}const o=[];for(let u=0;u<e;u+=1)o.push(i.row.createChecked(null,r&&u===0?a:l));return i.table.createChecked(null,o)}function cs(t){return t instanceof nt}const J=({editor:t})=>{const{selection:e}=t.state;if(!cs(e))return!1;let n=0;const r=Y(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ge(t,e){const n=t.mapping.map(e),r=Y(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(et.near(t.doc.resolve(i),-1))}function us(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function ds(t){return t.split(`
|
|
67
67
|
`).map(e=>!e.includes("|")||!e.includes("`")?e:us(e)).join(`
|
|
68
|
-
`)}function
|
|
69
|
-
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",T=Yr(m.attrs);g.push({text:w,isHeader:y,align:T})}),i.push(g)});const a=i.reduce((p,g)=>Math.max(p,g.length),0);if(a===0)return"";const l=Array.from({length:a}).fill(0);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;const k=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;k>l[m]&&(l[m]=k),l[m]<3&&(l[m]=3)}});const o=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),
|
|
70
|
-
`;const f=Array.from({length:a}).map((p,g)=>u
|
|
71
|
-
`,
|
|
72
|
-
`,(
|
|
73
|
-
`}),
|
|
68
|
+
`)}function hs(t){return(t||"").replace(/\s+/g," ").trim()}function ps(t,e,n={}){var r;const s=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";const i=[];t.content.forEach(p=>{const g=[];p.content&&p.content.forEach(m=>{let k="";m.content&&Array.isArray(m.content)&&m.content.length>1?k=m.content.map(b=>e.renderChildren(b)).join(s):k=m.content?e.renderChildren(m.content):"";const w=hs(k.split(s).join(`
|
|
69
|
+
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",T=Yr(m.attrs);g.push({text:w,isHeader:y,align:T})}),i.push(g)});const a=i.reduce((p,g)=>Math.max(p,g.length),0);if(a===0)return"";const l=Array.from({length:a}).fill(0);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;const k=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;k>l[m]&&(l[m]=k),l[m]<3&&(l[m]=3)}});const o=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),u=i[0],c=u.some(p=>p.isHeader),d=Array.from({length:a}).fill(null);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;!d[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(d[m]=p[m].align)}});let h=`
|
|
70
|
+
`;const f=Array.from({length:a}).map((p,g)=>c&&u[g]&&u[g].text||"");return h+=`| ${f.map((p,g)=>o(p,l[g])).join(" | ")} |
|
|
71
|
+
`,h+=`| ${l.map((p,g)=>{const m=Math.max(3,p),k=d[g];return k==="left"?`:${"-".repeat(m)}`:k==="right"?`${"-".repeat(m)}:`:k==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} |
|
|
72
|
+
`,(c?i.slice(1):i).forEach(p=>{h+=`| ${Array.from({length:a}).fill(0).map((g,m)=>o(p[m]&&p[m].text||"",l[m])).join(" | ")} |
|
|
73
|
+
`}),h}const fs=D.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:is,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:s}=as(t,this.options.cellMinWidth),i=e.style;function a(){return i||(r?`width: ${r}`:`min-width: ${s}`)}const l=["table",H(this.options.HTMLAttributes,e,{style:a()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},l]:l},parseMarkdown:(t,e)=>{const n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){const s=[];t.header.forEach((i,a)=>{var l;const o=se((l=r[a])!==null&&l!==void 0?l:i.align),u=o?{align:o}:{};s.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},s))}return t.rows&&t.rows.forEach(s=>{const i=[];s.forEach((a,l)=>{var o;const u=se((o=r[l])!==null&&o!==void 0?o:a.align),c=u?{align:u}:{};i.push(e.createNode("tableCell",c,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>ps(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(`
|
|
74
74
|
`);if(e.length<2)return-1;const n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){const r=t.indexOf(`
|
|
75
75
|
|
|
76
76
|
`),s=r>=0?t.slice(0,r):t,i=s.split(`
|
|
77
|
-
`);if(i.length<2)return;const a=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const l=
|
|
78
|
-
`).length,
|
|
79
|
-
`).slice(0,
|
|
80
|
-
`);return{...o,raw:
|
|
81
|
-
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Es(n.doc,s.from,s.text.length)===s.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(wt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Gt(e)]}})}const Ve=256,_s=40,Qe=280,Ls=140;function Is(t){const e=$.c(4),{store:n}=t,r=E.useSyncExternalStore(n.subscribe,n.getSnapshot),s=r.range!==null;let i;return e[0]!==s||e[1]!==r||e[2]!==n?(i=s?x.jsx(zs,{store:n,state:r}):null,e[0]=s,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}function zs({store:t,state:e}){const n=j(),{members:r,loading:s}=Ss(!0),[i,a]=E.useState(e.query),[l,o]=E.useState(null),
|
|
77
|
+
`);if(i.length<2)return;const a=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const l=ds(s);if(l===s)return;const o=n.blockTokens(l)[0];if(o?.type!=="table"||!o.raw)return;const u=o.raw.split(`
|
|
78
|
+
`).length,c=t.split(`
|
|
79
|
+
`).slice(0,u).join(`
|
|
80
|
+
`);return{...o,raw:c}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:s,editor:i})=>{const a=ls(i.schema,t,e,n);if(s){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(et.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>ln(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>on(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,r=>r.type.name==="table");return an(t,e&&(r=>{n&&Ge(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>sn(t,e),addRowAfter:()=>({state:t,dispatch:e})=>rn(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const n=Y(t.selection.$from,r=>r.type.name==="table");return nn(t,e&&(r=>{n&&Ge(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>tn(t,e),mergeCells:()=>({state:t,dispatch:e})=>Le(t,e),splitCell:()=>({state:t,dispatch:e})=>Ie(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ze("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ze("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>en(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Le(t,e)?!0:Ie(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Yt(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>_e(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>_e(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Jt(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=nt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:J,"Mod-Backspace":J,Delete:J,"Mod-Delete":J}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Qt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Xt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:s})=>{const i=H(this.options.HTMLAttributes,s);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Ye(N(t,"tableRole",e))}}}),gs=ie.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(fs.configure(this.options.table)),this.options.tableCell!==!1&&t.push(ns.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(rs.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(ss.configure(this.options.tableRow)),t}});function ms(t){const e=$.c(13),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==u?(c=q(vn,"select-none",u),e[0]=u,e[1]=c):c=e[1];let d;e[2]!==i||e[3]!==s.isEditable||e[4]!==a?(d=s.isEditable&&x.jsx("button",{type:"button","aria-label":a("markdownEditor.removeFile"),onMouseDown:ks,onClick:i,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:x.jsx(st,{size:14})}),e[2]=i,e[3]=s.isEditable,e[4]=a,e[5]=d):d=e[5];let h;e[6]!==l||e[7]!==o||e[8]!==d?(h=x.jsx(An,{href:l,name:o,children:d}),e[6]=l,e[7]=o,e[8]=d,e[9]=h):h=e[9];let f;return e[10]!==c||e[11]!==h?(f=x.jsx(be,{as:"span",className:c,children:h}),e[10]=c,e[11]=h,e[12]=f):f=e[12],f}function ks(t){return t.preventDefault()}function bs(t){return t.replace(/([[\]])/g,"\\$1")}const xs=D.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]"}]},renderHTML({HTMLAttributes:t,node:e}){return["a",H(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${bs(n)}](${e})`},addNodeView(){return ke(ms)}});function ws(t){const e=$.c(5),{node:n,selected:r}=t,s=typeof n.attrs.name=="string"?n.attrs.name:"",i=r&&"ring-2 ring-ring";let a;e[0]!==i?(a=q("select-none rounded px-1 font-medium text-primary","bg-primary/10",i),e[0]=i,e[1]=a):a=e[1];let l;return e[2]!==s||e[3]!==a?(l=x.jsxs(be,{as:"span","data-testid":"mention-chip",className:a,children:["@",s]}),e[2]=s,e[3]=a,e[4]=l):l=e[4],l}const ys=D.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",H(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?Mn(e,n):`@${n}`},addNodeView(){return ke(ws)}}),Ts="studio.mention-members.",me=new Map;function Ze(t){const e=me.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const r=JSON.parse(n);if(!Array.isArray(r))return;const s=r.filter(i=>!!i&&typeof i.id=="string"&&typeof i.name=="string");return me.set(t,s),s}catch{return}}function vs(t,e){me.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function As(t,e){if(!t?.length)return e;const n=new Map(t.map(r=>[r.id,r]));return e.map(r=>{const s=n.get(r.id);return s&&s.name===r.name&&s.email===r.email&&s.image===r.image?s:r})}function Ms(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function Ss(t){const e=$.c(17),{locator:n}=Tt(),r=Pn(),s=`${Ts}${n}`;let i;e[0]!==n?(i=At.mentionMembers(n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=()=>Ze(s),e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r||e[5]!==s?(l=async()=>{const f=await r.organization.listMembers(),p=As(Ze(s),Ms(f?.data?.members??[]));return vs(s,p),p},e[4]=r,e[5]=s,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==i||e[9]!==a||e[10]!==l?(o={queryKey:i,enabled:t,staleTime:0,placeholderData:a,queryFn:l},e[7]=t,e[8]=i,e[9]=a,e[10]=l,e[11]=o):o=e[11];const u=vt(o);let c;e[12]!==u.data?(c=u.data??[],e[12]=u.data,e[13]=c):c=e[13];const d=u.isFetching&&!u.data;let h;return e[14]!==c||e[15]!==d?(h={members:c,loading:d},e[14]=c,e[15]=d,e[16]=h):h=e[16],h}const Ke={query:"",range:null,rect:null,editor:null};class Cs{state=Ke;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(Ke)}}const Re=new Je("markdownEditorMention");function Rs(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),tt(t.view,Re)}function Es(t,e,n){const r=Math.min(e+n,t.content.size);return e>=r?"":t.textBetween(e,r,"","")}function wt(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),tt(t.view,Re)}function $s(t){return ie.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Re,allowedPrefixes:[" ",`
|
|
81
|
+
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Es(n.doc,s.from,s.text.length)===s.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(wt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Gt(e)]}})}const Ve=256,_s=40,Qe=280,Ls=140;function Is(t){const e=$.c(4),{store:n}=t,r=E.useSyncExternalStore(n.subscribe,n.getSnapshot),s=r.range!==null;let i;return e[0]!==s||e[1]!==r||e[2]!==n?(i=s?x.jsx(zs,{store:n,state:r}):null,e[0]=s,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}function zs({store:t,state:e}){const n=j(),{members:r,loading:s}=Ss(!0),[i,a]=E.useState(e.query),[l,o]=E.useState(null),u=Ps(e.editor),c=u.getBoundingClientRect(),d=u===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):c,h=e.rect?.()??new DOMRect(0,0,0,0),f=d.bottom-h.bottom,p=f<Qe&&h.top-d.top>f,g=(p?h.top-d.top:f)-8,m=Math.min(Qe,Math.max(g,Ls))-_s,k={position:"absolute",width:Ve,left:Math.min(h.left,d.right-Ve-8)-c.left,...p?{bottom:c.bottom-h.top+6}:{top:h.bottom-c.top+6}},w=()=>{e.editor&&wt(e.editor,t),t.close()},y=b=>{const v=b.relatedTarget;if((!v||e.editor?.view.dom.contains(v)===!0)&&t.latched){l?.focus();return}w()},T=b=>{!e.editor||!e.range||(Rs(e.editor,e.range,b),t.close())};return Mt.createPortal(x.jsx("div",{style:k,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg border border-border bg-popover shadow-md",children:x.jsxs(En,{onKeyDown:b=>{b.key==="Escape"&&(b.preventDefault(),w(),e.editor?.commands.focus())},children:[x.jsx($n,{ref:o,autoFocus:!0,onFocus:()=>{t.latched=!0},value:i,onValueChange:a,placeholder:n("markdownEditor.mentionSearch"),onBlur:y}),x.jsxs(_n,{style:{maxHeight:m},children:[s?x.jsx("div",{className:"flex items-center justify-center py-6",children:x.jsx(Xe,{size:"sm"})}):x.jsx(Ln,{children:n("markdownEditor.mentionEmpty")}),r.map(b=>x.jsxs(In,{value:`${b.name} ${b.email}`,onSelect:()=>T(b),onMouseDown:v=>v.preventDefault(),className:"gap-2",children:[x.jsx(Rn,{url:b.image??void 0,fallback:zn(b.name),shape:"circle",size:"xs"}),x.jsx("span",{className:"min-w-0 flex-1 truncate",children:b.name})]},b.id))]})]})}),u)}function Ps(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}const Hs=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,js=D.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",H(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,a;const l=(e=(n=t.attrs)===null||n===void 0?void 0:n.src)!==null&&e!==void 0?e:"",o=(r=(s=t.attrs)===null||s===void 0?void 0:s.alt)!==null&&r!==void 0?r:"",u=(i=(a=t.attrs)===null||a===void 0?void 0:a.title)!==null&&i!==void 0?i:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,s=new Set(["src","width","height"]);return({node:i,getPos:a,HTMLAttributes:l,editor:o})=>{const u=document.createElement("img");u.draggable=!1;const c=H(this.options.HTMLAttributes,l);Object.entries(c).forEach(([k,w])=>{if(w!=null)switch(k){case"src":case"width":case"height":break;default:u.setAttribute(k,w)}}),c.src!==null&&(u.src=c.src);let d={...l};const h=k=>{if(typeof k=="string"&&k!==""){u.getAttribute("src")!==k&&(u.src=k);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};h(l.src);const f=k=>{if(k.type!==i.type)return!1;const w=o.extensionManager.attributes.filter(T=>T.type===k.type.name),y=Ht(k,w);return Object.keys(d).forEach(T=>{!s.has(T)&&!(T in y)&&u.removeAttribute(T)}),Object.entries(y).forEach(([T,b])=>{s.has(T)||(b!=null?u.setAttribute(T,b):u.removeAttribute(T))}),h(y.src),d=y,!0},p=new Pt({element:u,editor:o,node:i,getPos:a,onResize:(k,w)=>{u.style.width=`${k}px`,u.style.height=`${w}px`},onCommit:(k,w)=>{const y=a();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:k,height:w}).run()},onUpdate:f,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),g=p.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",u.complete&&u.naturalWidth>0?m():(u.onload=m,u.onerror=m),p}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[zt({find:Hs,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Ns=js;function Os(t){const e=$.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let u;e[0]!==o||e[1]!==a?(u=o||a("markdownEditor.imageAltFallback"),e[0]=o,e[1]=a,e[2]=u):u=e[2];const c=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let d;e[3]!==c?(d=q("max-h-[420px] max-w-full rounded-lg border border-border object-contain",c),e[3]=c,e[4]=d):d=e[4];let h;e[5]!==l||e[6]!==u||e[7]!==d?(h=x.jsx("img",{src:l,alt:u,draggable:!1,className:d}),e[5]=l,e[6]=u,e[7]=d,e[8]=h):h=e[8];let f;e[9]!==i||e[10]!==s.isEditable||e[11]!==a?(f=s.isEditable&&x.jsx("button",{type:"button","aria-label":a("markdownEditor.removeImage"),onMouseDown:Bs,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:x.jsx(st,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=a,e[12]=f):f=e[12];let p;return e[13]!==h||e[14]!==f?(p=x.jsxs(be,{className:"group/image relative my-3 w-fit max-w-full",children:[h,f]}),e[13]=h,e[14]=f,e[15]=p):p=e[15],p}function Bs(t){return t.preventDefault()}const Ds=Ns.extend({addNodeView(){return ke(Os)}}).configure({inline:!1,allowBase64:!1}),Fs={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},qs=Bt.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(Sn(n))return e.createNode("attachment",{href:n,name:t.text??""});const r=Cn(n);return r?e.createNode("mention",{id:r,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Ws(t="",e){return[Nt.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),qs.configure(Fs),Zt.configure({placeholder:t}),gs,jt,Ot.configure({nested:!0}),Ds,xs,Gn,ys,...e?[$s(e)]:[],Xr.configure({markedOptions:{breaks:!0}})]}const Us=/^(\s*)([-*+]|\d+[.)])\s+\S/,Gs=/^\s*(```|~~~)/,Zs=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Ks(t){const e=[];let n=!1,r=!1;for(const s of t.split(`
|
|
82
82
|
`)){if(Gs.test(s)){n=!n,r=!1,e.push(s);continue}if(n){e.push(s);continue}if(Us.test(s)){r=!0,e.push(s);continue}if(!s.trim()){r=!1,e.push(s);continue}if(r&&Zs.test(s)){e[e.length-1]=`${e[e.length-1]} ${s.trim()}`;continue}r=!1,e.push(s)}return e.join(`
|
|
83
|
-
`)}function Vs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=x.jsx(fn,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let
|
|
83
|
+
`)}function Vs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=x.jsx(fn,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let u;e[4]!==r||e[5]!==a?(u=x.jsx(Hn,{type:"button",label:a,disabled:r,onClick:l,children:o}),e[4]=r,e[5]=a,e[6]=u):u=e[6];let c;e[7]!==n?(c=x.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:h=>{const f=Array.from(h.target.files??[]);h.target.value="",f.length>0&&n(f)}}),e[7]=n,e[8]=c):c=e[8];let d;return e[9]!==u||e[10]!==c?(d=x.jsxs(x.Fragment,{children:[u,c]}),e[9]=u,e[10]=c,e[11]=d):d=e[11],d}function Qs(t){const e=$.c(6),{pending:n}=t,r=j();if(n===0)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=x.jsx(Xe,{className:"size-3"}),e[0]=s):s=e[0];let i;e[1]!==n||e[2]!==r?(i=n===1?r("markdownEditor.uploading"):r("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==i?(a=x.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[s,i]}),e[4]=i,e[5]=a):a=e[5],a}const Xs=["outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-[13px]","[&_pre_code]:bg-transparent [&_pre_code]:p-0",Ut,"[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),Js=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function Ys(t){const e=$.c(10),{editor:n,mentions:r}=t,s=r.items;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["markdown-editor-mentions"],e[0]=i):i=e[0];let a;e[1]!==s?(a=u=>{const{query:c}=u,d=c.trim().toLowerCase();return Promise.resolve(d?s.filter(h=>`${h.name} ${h.title??""}`.toLowerCase().includes(d)):s)},e[1]=s,e[2]=a):a=e[2];let l;e[3]!==n?(l=u=>{const{range:c,item:d}=u;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${d.name} `}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==r.emptyLabel||e[7]!==a||e[8]!==l?(o=x.jsx(Kt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:i,queryFn:a,emptyLabel:r.emptyLabel,renderItem:ei,onSelect:l}),e[5]=n,e[6]=r.emptyLabel,e[7]=a,e[8]=l,e[9]=o):o=e[9],o}function ei(t){return x.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[x.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&x.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function xi({defaultValue:t,onChange:e,placeholder:n,editable:r=!0,attachments:s=!0,mentions:i,inline:a=!1}){const l=Qn(s),[o]=E.useState(()=>new Cs),u=E.useRef(e);u.current=e;const c=Dt({extensions:Ws(n,i?void 0:o),content:Ks(t),contentType:"markdown",editable:r,autofocus:a?"end":!1,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:q(Xs,!a&&"min-h-[200px] sm:min-h-[320px]",Js)},handlePaste:l.handlePaste,handleDrop:l.handleDrop},onUpdate:({editor:d,transaction:h})=>{h.docChanged&&u.current(d.getMarkdown())}});return c?x.jsxs("div",{className:"flex flex-col",children:[x.jsx(On,{editor:c}),!i&&x.jsx(Is,{store:o}),x.jsx(Ft,{editor:c,className:q(a?"text-sm text-foreground":"text-[15px] text-muted-foreground")}),r&&i&&x.jsx(Ys,{editor:c,mentions:i}),x.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[r&&i?.hint&&x.jsx("span",{children:i.hint}),r&&s&&x.jsx(Vs,{onFiles:d=>l.uploadInto(c.view,d,c.state.selection.to)}),x.jsx(Qs,{pending:l.pending})]})]}):null}export{Vs as A,Cs as M,Gn as U,ys as a,Xr as b,Ds as c,xs as d,Re as e,Is as f,xi as g,Qs as h,$s as m,Qn as u};
|