aitu-app 0.6.76 → 0.6.78
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/README.md +3 -3
- package/assets/CanvasAudioPlayer-DutgwdiU.js +2 -0
- package/assets/ChatDrawer-E6Fog16I.js +11 -0
- package/assets/{ChatMessagesArea-CZkiRzmW.js → ChatMessagesArea-Bgwiz_XP.js} +3 -3
- package/assets/DeferredAIInputBar-CPkD8Cv9.js +8 -0
- package/assets/DeferredAIInputBar-szBPHiNW.css +1 -0
- package/assets/DrawnixDeferredFeatures-Cul76-88.js +2 -0
- package/assets/{KnowledgeBaseContent-Dan2DUqY.js → KnowledgeBaseContent-DcX5Jofx.js} +6 -6
- package/assets/{MVCreator-Dzjl2fXA.js → MVCreator-DllHozYg.js} +8 -8
- package/assets/{ModelBenchmarkWorkbench-oy2wue1u.js → ModelBenchmarkWorkbench-Dv9SNYTi.js} +2 -2
- package/assets/MusicAnalyzer-CHcQ5t4P.js +1 -0
- package/assets/{MusicAnalyzer-BO44f-db.js → MusicAnalyzer-DDeT6g3c.js} +2 -2
- package/assets/ResizableDivider-CaG9JQbJ.js +1 -0
- package/assets/TaskQueuePanel-BNhNzGp5.js +1 -0
- package/assets/{VideoAnalyzer-iiJpoWb6.js → VideoAnalyzer-BSLz1FaI.js} +2 -2
- package/assets/ai-generation-preferences-service-BF7QkuJp.js +1 -0
- package/assets/arc-BU2KKCa_.js +1 -0
- package/assets/arc-DmGoDCEL.js +1 -0
- package/assets/{batch-image-generation-B2R0hJW_.js → batch-image-generation-Bg68r_Ql.js} +5 -5
- package/assets/{blockDiagram-38ab4fdb-BmWPnNuS.js → blockDiagram-38ab4fdb-BCGEnMME.js} +1 -1
- package/assets/{blockDiagram-38ab4fdb-trArAOFP.js → blockDiagram-38ab4fdb-CsZR5uC5.js} +1 -1
- package/assets/board-utils-CpAtoKn2.js +1 -0
- package/assets/{browser-Dya3c6_X.js → browser-DpICcNby.js} +1 -1
- package/assets/{c4Diagram-3d4e48cf-Cvj3RMOv.js → c4Diagram-3d4e48cf-9fuiuFdV.js} +1 -1
- package/assets/{c4Diagram-3d4e48cf-CqJrO4Za.js → c4Diagram-3d4e48cf-WM4wd_GR.js} +1 -1
- package/assets/{canvas-insertion-Dq3gR9Nw.js → canvas-insertion-CdUQF7IV.js} +3 -3
- package/assets/channel-CZjE-WNp.js +1 -0
- package/assets/channel-SXZD6bG3.js +1 -0
- package/assets/classDiagram-70f12bd4-CBVHTwQu.js +2 -0
- package/assets/{classDiagram-70f12bd4-DvrRZ41d.js → classDiagram-70f12bd4-DcYDedz1.js} +2 -2
- package/assets/classDiagram-v2-f2320105-CsxWGkSy.js +2 -0
- package/assets/classDiagram-v2-f2320105-jpCwaHEd.js +2 -0
- package/assets/{clipper-B4i11tN1.js → clipper-jvd5rF5a.js} +1 -1
- package/assets/clone-C4mvvMDb.js +1 -0
- package/assets/{createText-2e5e7dd3-D7dXlVes.js → createText-2e5e7dd3-CkXS3l7I.js} +2 -2
- package/assets/{createText-2e5e7dd3-B8gnT5hD.js → createText-2e5e7dd3-x5lOIwut.js} +1 -1
- package/assets/edges-e0da2a9e-CbrF4nbD.js +4 -0
- package/assets/{edges-e0da2a9e-CyRAzEMi.js → edges-e0da2a9e-Ch6PBwWs.js} +2 -2
- package/assets/{erDiagram-9861fffd-D8yYsjoN.js → erDiagram-9861fffd-Bq07elcI.js} +3 -3
- package/assets/{erDiagram-9861fffd-BHbAa_Ka.js → erDiagram-9861fffd-DSlNVuAZ.js} +4 -4
- package/assets/{flowDb-956e92f1-DAqb8wjP.js → flowDb-956e92f1-BqPCJlZp.js} +3 -3
- package/assets/{flowDb-956e92f1-f30uG4pp.js → flowDb-956e92f1-Ti5YC4Vv.js} +3 -3
- package/assets/{flowDiagram-66a62f08-C4Gz9mOM.js → flowDiagram-66a62f08-CPDuG3rY.js} +3 -3
- package/assets/{flowDiagram-66a62f08-CBXypoEi.js → flowDiagram-66a62f08-D3GSABFi.js} +1 -1
- package/assets/flowDiagram-v2-96b9c2cf-BCcJ-cre.js +1 -0
- package/assets/flowDiagram-v2-96b9c2cf-DCVaFEgV.js +1 -0
- package/assets/{flowchart-elk-definition-4a651766-CSm5diF6.js → flowchart-elk-definition-4a651766-BH09NeLA.js} +1 -1
- package/assets/{flowchart-elk-definition-4a651766-BHB7pRxm.js → flowchart-elk-definition-4a651766-BLaLPCDV.js} +1 -1
- package/assets/{ganttDiagram-c361ad54-CU9a9DsJ.js → ganttDiagram-c361ad54-DL9ZeaEc.js} +4 -4
- package/assets/ganttDiagram-c361ad54-Sp9M1KHP.js +257 -0
- package/assets/{gitGraphDiagram-72cf32ee-B2zj8Xnu.js → gitGraphDiagram-72cf32ee-BSf1fsDV.js} +1 -1
- package/assets/{gitGraphDiagram-72cf32ee-BWOgrFeh.js → gitGraphDiagram-72cf32ee-BWwmRKo-.js} +1 -1
- package/assets/{graph-Bnmq4jgf.js → graph--nPw8zXQ.js} +1 -1
- package/assets/graph-g-2U7grQ.js +1 -0
- package/assets/{index-3862675e-CQLKy6RO.js → index-3862675e-BXwbZ2pz.js} +1 -1
- package/assets/{index-3862675e-BSxxidV_.js → index-3862675e-D6Zy95zZ.js} +1 -1
- package/assets/index-3eqA7Bag.js +1 -0
- package/assets/{index-D1ORCZqJ.js → index-7Q-aiwln.js} +2 -2
- package/assets/index-B2dttXd7.js +1 -0
- package/assets/index-B7V7-Vxz.js +1 -0
- package/assets/index-BHPTfCZM.js +1 -0
- package/assets/{index-vvV37Q1S.js → index-BP77pG9S.js} +4 -4
- package/assets/index-BPR_DyGD.js +1 -0
- package/assets/index-BWrcsh8u.js +1 -0
- package/assets/{index-D4qm_1m5.js → index-BXzGHPXz.js} +1 -1
- package/assets/index-BaCHOxhI.js +1 -0
- package/assets/{index-BoglETHF.js → index-Bq8mPedC.js} +2 -2
- package/assets/index-BqHZCcen.js +2 -0
- package/assets/index-Bti3m-iW.js +1 -0
- package/assets/{index-sPNG1_UN.js → index-BwSnJN93.js} +5 -5
- package/assets/{index-D5qxbeGT.js → index-C3qD42ws.js} +1 -1
- package/assets/{index-VzDb_AHs.js → index-C5eu4uSl.js} +5 -5
- package/assets/index-CLJUfzvO.js +1 -0
- package/assets/index-CfgvFFx3.js +271 -0
- package/assets/index-CmyOpFTN.js +1 -0
- package/assets/index-D4pIkh3S.js +1 -0
- package/assets/index-D7b5fX1d.js +1 -0
- package/assets/index-DH12_HTj.js +13 -0
- package/assets/index-DI0OV6F8.js +7 -0
- package/assets/index-DIiIUyb-.js +1 -0
- package/assets/index-DcZrElEK.js +2 -0
- package/assets/index-DllL1sx1.js +1 -0
- package/assets/index-DqMndQiP.js +1 -0
- package/assets/index-Dz8sghkK.js +1 -0
- package/assets/index-QkP3EC02.js +1 -0
- package/assets/index-TkfyNewx.js +1 -0
- package/assets/index-ZrVeQUWo.js +1 -0
- package/assets/index-eZfwJ9bV.js +3 -0
- package/assets/{index-VarwiJlL.js → index-gQ7LgvSv.js} +1 -1
- package/assets/{infoDiagram-f8f76790-d-BYTW2w.js → infoDiagram-f8f76790-DpFqCCNv.js} +3 -3
- package/assets/{infoDiagram-f8f76790-BMsVq8O_.js → infoDiagram-f8f76790-G2JpJJP7.js} +3 -3
- package/assets/{journeyDiagram-49397b02-DCtCkoaC.js → journeyDiagram-49397b02-BdESGMrv.js} +1 -1
- package/assets/{journeyDiagram-49397b02-CBqb8-ml.js → journeyDiagram-49397b02-DLLTobRM.js} +1 -1
- package/assets/{layout-DKqEkE_W.js → layout-CVkuImk4.js} +1 -1
- package/assets/layout-WSR0vNPO.js +1 -0
- package/assets/line-D3bnG227.js +1 -0
- package/assets/line-DQuMJveY.js +1 -0
- package/assets/{linear-C6OQYT56.js → linear-CciP-97N.js} +1 -1
- package/assets/linear-Z6vFvuwc.js +1 -0
- package/assets/{main-i0s2IJTn.css → main-8DNjLY6L.css} +1 -1
- package/assets/main-BFEkxCOK.js +56 -0
- package/assets/{mermaid.core-CI-VJEiw.js → mermaid.core-CwZQb0ud.js} +5 -5
- package/assets/{mindmap-definition-fc14e90a-k_RSypuP.js → mindmap-definition-fc14e90a-BnJ8OOTI.js} +1 -1
- package/assets/{mindmap-definition-fc14e90a-DrtlQLES.js → mindmap-definition-fc14e90a-CxQMydCW.js} +1 -1
- package/assets/model-benchmark-launcher-Ct3lYXVq.js +1 -0
- package/assets/photo-wall-splitter-BZ88W5Zy.js +1 -0
- package/assets/{pieDiagram-8a3498a8-CdknGxKY.js → pieDiagram-8a3498a8-BSDdkTeu.js} +5 -5
- package/assets/{pieDiagram-8a3498a8-Bpr5V3o5.js → pieDiagram-8a3498a8-D6VtAoja.js} +4 -4
- package/assets/ppt-generation-FzjP_rp0.js +48 -0
- package/assets/{quadrantDiagram-120e2f19-Dx3qoKDx.js → quadrantDiagram-120e2f19-BbFV0VXY.js} +3 -3
- package/assets/{quadrantDiagram-120e2f19-pVIXp9i6.js → quadrantDiagram-120e2f19-C8k2xuBd.js} +3 -3
- package/assets/{requirementDiagram-deff3bca-hM4oekUG.js → requirementDiagram-deff3bca-C3xMdzJV.js} +1 -1
- package/assets/{requirementDiagram-deff3bca-DD6NY75P.js → requirementDiagram-deff3bca-CpjqKjYZ.js} +1 -1
- package/assets/{sankeyDiagram-04a897e0-BsvEG71N.js → sankeyDiagram-04a897e0-BBJJgsFv.js} +5 -5
- package/assets/{sankeyDiagram-04a897e0-C9uf1jU5.js → sankeyDiagram-04a897e0-Bjvig9bW.js} +4 -4
- package/assets/{sequenceDiagram-704730f1-CNEBmz1G.js → sequenceDiagram-704730f1-DX1MmBN_.js} +4 -4
- package/assets/{sequenceDiagram-704730f1-Bpg54z74.js → sequenceDiagram-704730f1-PFC_9IFI.js} +4 -4
- package/assets/settings-dialog-CQM4v791.js +1 -0
- package/assets/{skill-dsl-parser-DS3VOBFI.js → skill-dsl-parser-syNWYxFu.js} +10 -10
- package/assets/{stateDiagram-587899a1-BN2ZP-3x.js → stateDiagram-587899a1-Dc3mI_B_.js} +1 -1
- package/assets/stateDiagram-587899a1-SFMUVAam.js +1 -0
- package/assets/{stateDiagram-v2-d93cdb3a-BtV1Ziy9.js → stateDiagram-v2-d93cdb3a-DmnBjHpC.js} +1 -1
- package/assets/{stateDiagram-v2-d93cdb3a-BLwIM8s1.js → stateDiagram-v2-d93cdb3a-P4Yt2p_j.js} +1 -1
- package/assets/{styles-6aaf32cf-aFVlX_lA.js → styles-6aaf32cf-C3jnr3hV.js} +1 -1
- package/assets/{styles-6aaf32cf-CGp3i5qu.js → styles-6aaf32cf-b6AdP7fu.js} +1 -1
- package/assets/{styles-9a916d00-BK7pejCH.js → styles-9a916d00-BUiD9iBe.js} +4 -4
- package/assets/{styles-9a916d00-CSwFWVnr.js → styles-9a916d00-ii0XTdIm.js} +1 -1
- package/assets/styles-c10674c1-Bt89Yy8Q.js +116 -0
- package/assets/styles-c10674c1-DbTSpy3W.js +116 -0
- package/assets/{svgDrawCommon-08f97a94-Cr4rWU-W.js → svgDrawCommon-08f97a94-BK6lD4D6.js} +1 -1
- package/assets/{svgDrawCommon-08f97a94-DypvMDvH.js → svgDrawCommon-08f97a94-D4gIV05W.js} +1 -1
- package/assets/{timeline-definition-85554ec2-D3-lXEL5.js → timeline-definition-85554ec2-Bl2y548G.js} +1 -1
- package/assets/{timeline-definition-85554ec2-DIwHE15c.js → timeline-definition-85554ec2-CWKg_JxG.js} +3 -3
- package/assets/{tool-windows-B-a9r3G3.css → tool-windows-CUNbW1Tz.css} +1 -1
- package/assets/tool-windows-DOIu9TAD.js +2975 -0
- package/assets/ttd-dialog-DI4kQSg8.js +99 -0
- package/assets/{useCharacters-DsZ779l-.js → useCharacters-Chv4Ky7x.js} +3 -3
- package/assets/useWorkflowSubmission-BizuDmuw.js +70 -0
- package/assets/video-analyze-6v3Y-rUE.js +1 -0
- package/assets/{video-generation-C7qCz-ZF.js → video-generation-DnmTlWnm.js} +2 -2
- package/assets/video-recovery-service-BeRoh0s2.js +1 -0
- package/assets/workflow-generation-utils-me381Cax.js +3 -0
- package/assets/workflow-submission-service-YOpo7g37.js +4 -0
- package/assets/{xychartDiagram-e933f94c-B17Evxfw.js → xychartDiagram-e933f94c-CJX9_9WF.js} +4 -4
- package/assets/{xychartDiagram-e933f94c-Dln5PJtU.js → xychartDiagram-e933f94c-Cep8CQEH.js} +3 -3
- package/changelog.json +50 -0
- package/idle-prefetch-manifest.json +300 -316
- package/manifest.json +3 -3
- package/package.json +1 -1
- package/precache-manifest.json +8 -8
- package/sw.js +5 -5
- package/version.json +19 -3
- package/assets/CanvasAudioPlayer-DwM6PU4W.js +0 -2
- package/assets/ChatDrawer-BQTaa6r6.js +0 -11
- package/assets/DeferredAIInputBar-BmPgFhXr.css +0 -1
- package/assets/DeferredAIInputBar-ObyfJQ0O.js +0 -7
- package/assets/DrawnixDeferredFeatures-CFHVLxc5.js +0 -2
- package/assets/ModelDropdown-CQTTHEI7.css +0 -1
- package/assets/ModelDropdown-DjvIvi8O.js +0 -1
- package/assets/MusicAnalyzer-BU5l2wPR.js +0 -1
- package/assets/ResizableDivider-CBgTphcS.js +0 -1
- package/assets/TaskQueuePanel-CTDuSScf.js +0 -1
- package/assets/ai-generation-preferences-service-CqwXb9Cs.js +0 -5
- package/assets/arc-BBE0LXa1.js +0 -1
- package/assets/arc-h476db6P.js +0 -1
- package/assets/channel-DMTz1UNN.js +0 -1
- package/assets/channel-DQOY3XLe.js +0 -1
- package/assets/classDiagram-70f12bd4-5ACx619h.js +0 -2
- package/assets/classDiagram-v2-f2320105-4zQ4jrwi.js +0 -2
- package/assets/classDiagram-v2-f2320105-CB4rof84.js +0 -2
- package/assets/clone-fuaXEdc-.js +0 -1
- package/assets/edges-e0da2a9e-DZalSm7f.js +0 -4
- package/assets/flowDiagram-v2-96b9c2cf-C-DFFh54.js +0 -1
- package/assets/flowDiagram-v2-96b9c2cf-CWjydvHB.js +0 -1
- package/assets/ganttDiagram-c361ad54-DDnbMkWm.js +0 -257
- package/assets/graph-BsYIlc-B.js +0 -1
- package/assets/index-B10kMZoq.js +0 -1
- package/assets/index-B2_XRj3U.js +0 -1
- package/assets/index-B4lLv-Sz.js +0 -1
- package/assets/index-BFZNUUCR.js +0 -1
- package/assets/index-BTSYG2Vy.js +0 -1
- package/assets/index-BY5Kvjqg.js +0 -1
- package/assets/index-Blf7J5yW.js +0 -1
- package/assets/index-BoQA7VaE.js +0 -3
- package/assets/index-BzqQ69oU.js +0 -1
- package/assets/index-CD2D1BYc.js +0 -2
- package/assets/index-CLRs5cWt.js +0 -1
- package/assets/index-CLU4LJjR.js +0 -1
- package/assets/index-CPDfMZkS.js +0 -1
- package/assets/index-CPfhqyDz.js +0 -316
- package/assets/index-CU4ySaQE.js +0 -1
- package/assets/index-CsCwwmYY.js +0 -1
- package/assets/index-Cyz_w8KS.js +0 -7
- package/assets/index-D489cJtb.js +0 -1
- package/assets/index-D6DebbcI.js +0 -1
- package/assets/index-DDtPG6Km.js +0 -1
- package/assets/index-DKhTnUBU.js +0 -1
- package/assets/index-DMIwLDS8.js +0 -13
- package/assets/index-DgsUJgRJ.js +0 -1
- package/assets/index-oT8mbA3U.js +0 -2
- package/assets/layout-B1ePJO5V.js +0 -1
- package/assets/line-C_jmJ6v1.js +0 -1
- package/assets/line-DfhCgsyz.js +0 -1
- package/assets/linear-ChY5Iu43.js +0 -1
- package/assets/main-LCg1nQGB.js +0 -69
- package/assets/model-benchmark-launcher-B2MsZXmV.js +0 -1
- package/assets/model-benchmark-service-CkIRp-Sq.js +0 -1
- package/assets/model-selection-BvdXmVGX.js +0 -1
- package/assets/photo-wall-splitter-CVrfkWnh.js +0 -1
- package/assets/prompt-optimize-dialog-DLdL2_a1.css +0 -1
- package/assets/settings-dialog-CAhU3cfG.js +0 -1
- package/assets/stateDiagram-587899a1-CMylUAYu.js +0 -1
- package/assets/styles-c10674c1-KfJINP7I.js +0 -116
- package/assets/styles-c10674c1-cccyjRUz.js +0 -116
- package/assets/tool-windows-CtLXQDGF.js +0 -2847
- package/assets/ttd-dialog-BRg3XE5k.js +0 -99
- package/assets/use-runtime-models-BH9r4Yc1.js +0 -1
- package/assets/use-runtime-models-BgWWl4Ng.css +0 -1
- package/assets/useWorkflowSubmission-BeJQ3BuO.js +0 -70
- package/assets/video-analyze-aDVIfgUi.js +0 -1
- package/assets/video-recovery-service-Dy0xiPr8.js +0 -1
- package/assets/workflow-generation-utils-CpMilOwA.js +0 -3
- package/assets/workflow-submission-service-CmBBMIis.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tool-windows-
|
|
2
|
-
var bC=n=>{throw TypeError(n)};var n1=(n,e,t)=>e.has(n)||bC("Cannot "+t);var C=(n,e,t)=>(n1(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(n,e,t)=>e.has(n)?bC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(n1(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Qd=(n,e,t)=>(n1(n,e,"access private method"),t);import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tool-windows-CUNbW1Tz.css","./MediaLibrarySidebar-CNCXXhfY.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var bC=n=>{throw TypeError(n)};var n1=(n,e,t)=>e.has(n)||bC("Cannot "+t);var C=(n,e,t)=>(n1(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(n,e,t)=>e.has(n)?bC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(n1(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Qd=(n,e,t)=>(n1(n,e,"access private method"),t);import{ak as N,ic as Kg,id as Uw,ie as Jl,ig as zr,ih as Kw,ii as E3,ij as wC,ik as O3,aj as le,aH as MA,ar as Lt,ai as Se,il as I3,im as TA,io as AA,ip as _A,b_ as Ny,fa as D3,iq as Ry,ir as Gw,is as N3,it as R3,iu as L3,iv as P3,ax as B3,bN as F3}from"./tool-windows-DOIu9TAD.js";import EA from"./katex-Cu_Erd72.js";import{c as Km,t as OA,d as H3,u as Ly,r as Py,o as st,a as _c,b as Jw,n as gd,e as _,f as Yw,g as Zh,m as yi,h as $3,i as Le,j as V3,k as Mi,l as Wr,s as i1,p as z3,q as hi,v as Ca,w as W3}from"./index-BXzGHPXz.js";/* empty css */var Zn=(n=>(n.docTypeError="docTypeError",n.contextNotFound="contextNotFound",n.timerNotFound="timerNotFound",n.ctxCallOutOfScope="ctxCallOutOfScope",n.createNodeInParserFail="createNodeInParserFail",n.stackOverFlow="stackOverFlow",n.parserMatchError="parserMatchError",n.serializerMatchError="serializerMatchError",n.getAtomFromSchemaFail="getAtomFromSchemaFail",n.expectDomTypeError="expectDomTypeError",n.callCommandBeforeEditorView="callCommandBeforeEditorView",n.missingRootElement="missingRootElement",n.missingNodeInSchema="missingNodeInSchema",n.missingMarkInSchema="missingMarkInSchema",n.ctxNotBind="ctxNotBind",n.missingYjsDoc="missingYjsDoc",n))(Zn||{});class bi extends Error{constructor(e,t){super(t),this.name="MilkdownError",this.code=e}}const q3=(n,e)=>typeof e=="function"?"[Function]":e,Gg=n=>JSON.stringify(n,q3);function j3(n){return new bi(Zn.docTypeError,`Doc type error, unsupported type: ${Gg(n)}`)}function U3(n){return new bi(Zn.contextNotFound,`Context "${n}" not found, do you forget to inject it?`)}function K3(n){return new bi(Zn.timerNotFound,`Timer "${n}" not found, do you forget to record it?`)}function Jg(){return new bi(Zn.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function G3(n,e,t){const r=`Cannot create node for ${"name"in n?n.name:n}`,s=u=>{if(u==null)return"null";if(Array.isArray(u))return`[${u.map(s).join(", ")}]`;if(typeof u=="object")return"toJSON"in u&&typeof u.toJSON=="function"?JSON.stringify(u.toJSON()):"spec"in u?JSON.stringify(u.spec):JSON.stringify(u);if(typeof u=="string"||typeof u=="number"||typeof u=="boolean")return JSON.stringify(u);if(typeof u=="function")return`[Function: ${u.name||"anonymous"}]`;try{return String(u)}catch{return"[Unserializable]"}},o=["[Description]",r],l=["[Attributes]",e],a=["[Content]",(t??[]).map(u=>u?typeof u=="object"&&"type"in u?`${u}`:s(u):"null")],c=[o,l,a].reduce((u,[h,f])=>{const d=`${h}: ${s(f)}.`;return u.concat(d)},[]);return new bi(Zn.createNodeInParserFail,c.join(`
|
|
3
3
|
`))}function IA(){return new bi(Zn.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function J3(n){return new bi(Zn.parserMatchError,`Cannot match target parser for node: ${Gg(n)}.`)}function Y3(n){return new bi(Zn.serializerMatchError,`Cannot match target serializer for node: ${Gg(n)}.`)}function X3(n,e){return new bi(Zn.getAtomFromSchemaFail,`Cannot get ${n}: ${e} from schema.`)}function cr(n){return new bi(Zn.expectDomTypeError,`Expect to be a dom, but get: ${Gg(n)}.`)}function r1(){return new bi(Zn.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function Z3(n){return new bi(Zn.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${n}" in schema.`)}function Q3(n){return new bi(Zn.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${n}" in schema.`)}class DA{constructor(){this.sliceMap=new Map,this.get=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(i=>i.type.name===e):this.sliceMap.get(e.id);if(!t){const i=typeof e=="string"?e:e.name;throw U3(i)}return t},this.remove=e=>{const t=typeof e=="string"?[...this.sliceMap.values()].find(i=>i.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}}var Ki,bs,ec,SA;let eL=(SA=class{constructor(e,t,i){G(this,Ki);G(this,bs);G(this,ec);R(this,Ki,[]),R(this,ec,()=>{C(this,Ki).forEach(r=>r(C(this,bs)))}),this.set=r=>{R(this,bs,r),C(this,ec).call(this)},this.get=()=>C(this,bs),this.update=r=>{R(this,bs,r(C(this,bs))),C(this,ec).call(this)},this.type=i,R(this,bs,t),e.set(i.id,this)}on(e){return C(this,Ki).push(e),()=>{R(this,Ki,C(this,Ki).filter(t=>t!==e))}}once(e){const t=this.on(i=>{e(i),t()});return t}off(e){R(this,Ki,C(this,Ki).filter(t=>t!==e))}offAll(){R(this,Ki,[])}},Ki=new WeakMap,bs=new WeakMap,ec=new WeakMap,SA);class tL{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw Jg()}}create(e,t=this._defaultValue){return new eL(e,t,this)}}const qe=(n,e)=>new tL(n,e);var zf,Wf,qf,Cl,tc,po,nc,ic,rc;class nL{constructor(e,t,i){G(this,zf);G(this,Wf);G(this,qf);G(this,Cl);G(this,tc);G(this,po);G(this,nc);G(this,ic);G(this,rc);R(this,Cl,new Set),R(this,tc,new Set),R(this,po,new Map),R(this,nc,new Map),this.read=()=>({metadata:C(this,zf),injectedSlices:[...C(this,Cl)].map(r=>({name:typeof r=="string"?r:r.name,value:C(this,ic).call(this,r)})),consumedSlices:[...C(this,tc)].map(r=>({name:typeof r=="string"?r:r.name,value:C(this,ic).call(this,r)})),recordedTimers:[...C(this,po)].map(([r,{duration:s}])=>({name:r.name,duration:s,status:C(this,rc).call(this,r)})),waitTimers:[...C(this,nc)].map(([r,{duration:s}])=>({name:r.name,duration:s,status:C(this,rc).call(this,r)}))}),this.onRecord=r=>{C(this,po).set(r,{start:Date.now(),duration:0})},this.onClear=r=>{C(this,po).delete(r)},this.onDone=r=>{const s=C(this,po).get(r);s&&(s.duration=Date.now()-s.start)},this.onWait=(r,s)=>{const o=Date.now();s.finally(()=>{C(this,nc).set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{C(this,Cl).add(r)},this.onRemove=r=>{C(this,Cl).delete(r)},this.onUse=r=>{C(this,tc).add(r)},R(this,ic,r=>C(this,Wf).get(r).get()),R(this,rc,r=>C(this,qf).get(r).status),R(this,Wf,e),R(this,qf,t),R(this,zf,i)}}zf=new WeakMap,Wf=new WeakMap,qf=new WeakMap,Cl=new WeakMap,tc=new WeakMap,po=new WeakMap,nc=new WeakMap,ic=new WeakMap,rc=new WeakMap;var ws,ks,jf,vi;const cC=class cC{constructor(e,t,i){G(this,ws);G(this,ks);G(this,jf);G(this,vi);this.produce=r=>r&&Object.keys(r).length?new cC(C(this,ws),C(this,ks),{...r}):this,this.inject=(r,s)=>{var l;const o=r.create(C(this,ws).sliceMap);return s!=null&&o.set(s),(l=C(this,vi))==null||l.onInject(r),this},this.remove=r=>{var s;return C(this,ws).remove(r),(s=C(this,vi))==null||s.onRemove(r),this},this.record=r=>{var s;return r.create(C(this,ks).store),(s=C(this,vi))==null||s.onRecord(r),this},this.clearTimer=r=>{var s;return C(this,ks).remove(r),(s=C(this,vi))==null||s.onClear(r),this},this.isInjected=r=>C(this,ws).has(r),this.isRecorded=r=>C(this,ks).has(r),this.use=r=>{var s;return(s=C(this,vi))==null||s.onUse(r),C(this,ws).get(r)},this.get=r=>this.use(r).get(),this.set=(r,s)=>this.use(r).set(s),this.update=(r,s)=>this.use(r).update(s),this.timer=r=>C(this,ks).get(r),this.done=r=>{var s;this.timer(r).done(),(s=C(this,vi))==null||s.onDone(r)},this.wait=r=>{var o;const s=this.timer(r).start();return(o=C(this,vi))==null||o.onWait(r,s),s},this.waitTimers=async r=>{await Promise.all(this.get(r).map(s=>this.wait(s)))},R(this,ws,e),R(this,ks,t),R(this,jf,i),i&&R(this,vi,new nL(e,t,i))}get meta(){return C(this,jf)}get inspector(){return C(this,vi)}};ws=new WeakMap,ks=new WeakMap,jf=new WeakMap,vi=new WeakMap;let By=cC;class iL{constructor(){this.store=new Map,this.get=e=>{const t=this.store.get(e.id);if(!t)throw K3(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}}var sc,mo,oc,vs,lc,Uf;class rL{constructor(e,t){G(this,sc);G(this,mo);G(this,oc);G(this,vs);G(this,lc);G(this,Uf);R(this,sc,null),R(this,mo,null),R(this,vs,"pending"),this.start=()=>(C(this,sc)??R(this,sc,new Promise((i,r)=>{R(this,mo,s=>{s instanceof CustomEvent&&s.detail.id===C(this,oc)&&(R(this,vs,"resolved"),C(this,lc).call(this),s.stopImmediatePropagation(),i())}),C(this,Uf).call(this,()=>{C(this,vs)==="pending"&&R(this,vs,"rejected"),C(this,lc).call(this),r(new Error(`Timing ${this.type.name} timeout.`))}),R(this,vs,"pending"),addEventListener(this.type.name,C(this,mo))})),C(this,sc)),this.done=()=>{const i=new CustomEvent(this.type.name,{detail:{id:C(this,oc)}});dispatchEvent(i)},R(this,lc,()=>{C(this,mo)&&removeEventListener(this.type.name,C(this,mo))}),R(this,Uf,i=>{setTimeout(()=>{i()},this.type.timeout)}),R(this,oc,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return C(this,vs)}}sc=new WeakMap,mo=new WeakMap,oc=new WeakMap,vs=new WeakMap,lc=new WeakMap,Uf=new WeakMap;class sL{constructor(e,t=3e3){this.create=i=>new rL(i,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}}const Xr=(n,e=3e3)=>new sL(n,e);function sn(n){this.content=n}sn.prototype={constructor:sn,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,r=i.find(n),s=i.content.slice();return r==-1?s.push(t||n,e):(s[r+1]=e,t&&(s[r]=t)),new sn(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new sn(t)},addToStart:function(n,e){return new sn([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new sn(t)},addBefore:function(n,e,t){var i=this.remove(e),r=i.content.slice(),s=i.find(n);return r.splice(s==-1?r.length:s,0,e,t),new sn(r)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=sn.from(n),n.size?new sn(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=sn.from(n),n.size?new sn(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=sn.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};sn.from=function(n){if(n instanceof sn)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new sn(e)};function NA(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let r=n.child(i),s=e.child(i);if(r==s){t+=r.nodeSize;continue}if(!r.sameMarkup(s))return t;if(r.isText&&r.text!=s.text){for(let o=0;r.text[o]==s.text[o];o++)t++;return t}if(r.content.size||s.content.size){let o=NA(r.content,s.content,t+1);if(o!=null)return o}t+=r.nodeSize}}function RA(n,e,t,i){for(let r=n.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:t,b:i};let o=n.child(--r),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,i-=a;continue}if(!o.sameMarkup(l))return{a:t,b:i};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,i--;return{a:t,b:i}}if(o.content.size||l.content.size){let c=RA(o.content,l.content,t-1,i-1);if(c)return c}t-=a,i-=a}}let X=class An{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,r=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&i(a,r+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),i,r+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,r){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?r?typeof r=="function"?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&i&&(o?o=!1:s+=i),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(i)&&(r[r.length-1]=t.withText(t.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new An(r,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],r=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),i.push(l),r+=l.nodeSize),o=a}return new An(i,r)}cutByIndex(e,t){return e==t?An.empty:e==0&&t==this.content.length?this:new An(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let r=this.content.slice(),s=this.size+t.nodeSize-i.nodeSize;return r[e]=t,new An(r,s)}addToStart(e){return new An([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new An(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let r=this.content[t];e(r,i,t),i+=r.nodeSize}}findDiffStart(e,t=0){return NA(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return RA(this,e,t,i)}findIndex(e){if(e==0)return ep(0,e);if(e==this.size)return ep(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let r=this.child(t),s=i+r.nodeSize;if(s>=e)return s==e?ep(t+1,s):ep(t,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return An.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new An(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return An.empty;let t,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(t||(t=e.slice(0,r)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new An(t||e,i)}static from(e){if(!e)return An.empty;if(e instanceof An)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new An([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};X.empty=new X([],0);const s1={index:0,offset:0};function ep(n,e){return s1.index=n,s1.offset=e,s1}function Gm(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!Gm(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!Gm(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}class He{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),i=!0),t&&t.push(s)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=i.create(t.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return He.none;if(e instanceof He)return[e];let t=e.slice();return t.sort((i,r)=>i.type.rank-r.type.rank),t}}He.none=[];class Jm extends Error{}class ee{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=PA(this.content,e+this.openStart,t);return i&&new ee(i,this.openStart,this.openEnd)}removeBetween(e,t){return new ee(LA(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ee.empty;let i=t.openStart||0,r=t.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ee(X.fromJSON(e,t.content),i,r)}static maxOpen(e,t=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)r++;return new ee(e,i,r)}}ee.empty=new ee(X.empty,0,0);function LA(n,e,t){let{index:i,offset:r}=n.findIndex(e),s=n.maybeChild(i),{index:o,offset:l}=n.findIndex(t);if(r==e||s.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(i,s.copy(LA(s.content,e-r-1,t-r-1)))}function PA(n,e,t,i){let{index:r,offset:s}=n.findIndex(e),o=n.maybeChild(r);if(s==e||o.isText)return i&&!i.canReplace(r,r,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=PA(o.content,e-s-1,t,o);return l&&n.replaceChild(r,o.copy(l))}function oL(n,e,t){if(t.openStart>n.depth)throw new Jm("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Jm("Inconsistent open depths");return BA(n,e,t,0)}function BA(n,e,t,i){let r=n.index(i),s=n.node(i);if(r==e.index(i)&&i<n.depth-t.openStart){let o=BA(n,e,t,i+1);return s.copy(s.content.replaceChild(r,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let o=n.parent,l=o.content;return Pl(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=lL(t,n);return Pl(s,HA(n,o,l,e,i))}else return Pl(s,Ym(n,e,i))}function FA(n,e){if(!e.type.compatibleContent(n.type))throw new Jm("Cannot join "+e.type.name+" onto "+n.type.name)}function Fy(n,e,t){let i=n.node(t);return FA(i,e.node(t)),i}function Ll(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Mh(n,e,t,i){let r=(e||n).node(t),s=0,o=e?e.index(t):r.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Ll(n.nodeAfter,i),s++));for(let l=s;l<o;l++)Ll(r.child(l),i);e&&e.depth==t&&e.textOffset&&Ll(e.nodeBefore,i)}function Pl(n,e){return n.type.checkContent(e),n.copy(e)}function HA(n,e,t,i,r){let s=n.depth>r&&Fy(n,e,r+1),o=i.depth>r&&Fy(t,i,r+1),l=[];return Mh(null,n,r,l),s&&o&&e.index(r)==t.index(r)?(FA(s,o),Ll(Pl(s,HA(n,e,t,i,r+1)),l)):(s&&Ll(Pl(s,Ym(n,e,r+1)),l),Mh(e,t,r,l),o&&Ll(Pl(o,Ym(t,i,r+1)),l)),Mh(i,null,r,l),new X(l)}function Ym(n,e,t){let i=[];if(Mh(null,n,t,i),n.depth>t){let r=Fy(n,e,t+1);Ll(Pl(r,Ym(n,e,t+1)),i)}return Mh(e,null,t,i),new X(i)}function lL(n,e){let t=e.depth-n.openStart,r=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)r=e.node(s).copy(X.from(r));return{start:r.resolveNoCache(n.openStart+t),end:r.resolveNoCache(r.content.size-n.openEnd-t)}}class Qh{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=e.child(t);return i?e.child(t).cut(i):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return He.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),r=e.maybeChild(t);if(!i){let l=i;i=r,r=l}let s=i.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!r||!s[o].isInSet(r.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new $A(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],r=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(i.push(o,l,r+a),!c||(o=o.child(l),o.isText))break;s=c-1,r+=a+1}return new Qh(t,i,s)}static resolveCached(e,t){let i=kC.get(e);if(i)for(let s=0;s<i.elts.length;s++){let o=i.elts[s];if(o.pos==t)return o}else kC.set(e,i=new aL);let r=i.elts[i.i]=Qh.resolve(e,t);return i.i=(i.i+1)%cL,r}}class aL{constructor(){this.elts=[],this.i=0}}const cL=12,kC=new WeakMap;class $A{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uL=Object.create(null);class Di{constructor(e,t,i,r=He.none){this.type=e,this.attrs=t,this.marks=r,this.content=i||X.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,r=0){this.content.nodesBetween(e,t,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,r){return this.content.textBetween(e,t,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&Gm(this.attrs,t||e.defaultAttrs||uL)&&He.sameSet(this.marks,i||He.none)}copy(e=null){return e==this.content?this:new Di(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Di(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return ee.empty;let r=this.resolve(e),s=this.resolve(t),o=i?0:r.sharedDepth(t),l=r.start(o),c=r.node(o).content.cut(r.pos-l,s.pos-l);return new ee(c,r.depth-o,s.depth-o)}replace(e,t,i){return oL(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let r=this.content.child(t-1);return{node:r,index:t-1,offset:i-r.nodeSize}}resolve(e){return Qh.resolveCached(this,e)}resolveNoCache(e){return Qh.resolve(this,e)}rangeHasMark(e,t,i){let r=!1;return t>e&&this.nodesBetween(e,t,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),VA(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=X.empty,r=0,s=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,r,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=r;a<s;a++)if(!this.type.allowsMarks(i.child(a).marks))return!1;return!0}canReplaceWith(e,t,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=He.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!He.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let r=X.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,r,i);return s.type.checkAttrs(s.attrs),s}}Di.prototype.text=void 0;let hL=class Hy extends Di{constructor(e,t,i,r){if(super(e,t,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):VA(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Hy(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Hy(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function VA(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Yl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new fL(e,t);if(i.next==null)return Yl.empty;let r=zA(i);i.next&&i.err("Unexpected trailing text");let s=wL(bL(r));return kL(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let r=this;for(let s=t;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let r=[this];function s(o,l){let a=o.matchFragment(e,i);if(a&&(!t||a.validEnd))return X.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:h}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&r.indexOf(h)==-1){r.push(h);let f=s(h,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let o=[];for(let l=r;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!r.type||a.validEnd)&&(i.push({match:l.contentMatch,type:l,via:r}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&t(i.next[r].next)}return t(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)s+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return s}).join(`
|
|
4
4
|
`)}}Yl.empty=new Yl(!0);class fL{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function zA(n){let e=[];do e.push(dL(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function dL(n){let e=[];do e.push(pL(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pL(n){let e=yL(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=mL(n,e);else break;return e}function vC(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function mL(n,e){let t=vC(n),i=t;return n.eat(",")&&(n.next!="}"?i=vC(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function gL(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let r=[];for(let s in t){let o=t[s];o.isInGroup(e)&&r.push(o)}return r.length==0&&n.err("No node type or group '"+e+"' found"),r}function yL(n){if(n.eat("(")){let e=zA(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=gL(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function bL(n){let e=[[]];return r(s(n,0),t()),e;function t(){return e.push([])-1}function i(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function r(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;r(c,l=t())}else if(o.type=="star"){let a=t();return i(l,a),r(s(o.expr,a),a),[i(a)]}else if(o.type=="plus"){let a=t();return r(s(o.expr,l),a),r(s(o.expr,a),a),[i(a)]}else{if(o.type=="opt")return[i(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();r(s(o.expr,a),u),a=u}if(o.max==-1)r(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();i(a,u),r(s(o.expr,a),u),a=u}return[i(a)]}else{if(o.type=="name")return[i(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function WA(n,e){return e-n}function xC(n,e){let t=[];return i(e),t.sort(WA);function i(r){let s=n[r];if(s.length==1&&!s[0].term)return i(s[0].to);t.push(r);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&t.indexOf(a)==-1&&i(a)}}}function wL(n){let e=Object.create(null);return t(xC(n,0));function t(i){let r=[];i.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<r.length;u++)r[u][0]==l&&(c=r[u][1]);xC(n,a).forEach(u=>{c||r.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[i.join(",")]=new Yl(i.indexOf(n.length-1)>-1);for(let o=0;o<r.length;o++){let l=r[o][1].sort(WA);s.next.push({type:r[o][0],next:e[l.join(",")]||t(l)})}return s}}function kL(n,e){for(let t=0,i=[n];t<i.length;t++){let r=i[t],s=!r.validEnd,o=[];for(let l=0;l<r.next.length;l++){let{type:a,next:c}=r.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),i.indexOf(c)==-1&&i.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function qA(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function jA(n,e){let t=Object.create(null);for(let i in n){let r=e&&e[i];if(r===void 0){let s=n[i];if(s.hasDefault)r=s.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=r}return t}function UA(n,e,t,i){for(let r in e)if(!(r in n))throw new RangeError(`Unsupported attribute ${r} for ${t} of type ${r}`);for(let r in n){let s=n[r];s.validate&&s.validate(e[r])}}function KA(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new xL(n,i,e[i]);return t}let Xm=class GA{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=KA(e,i.attrs),this.defaultAttrs=qA(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jA(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Di(this,this.computeAttrs(e),X.from(t),He.setFrom(i))}createChecked(e=null,t,i){return t=X.from(t),this.checkContent(t),new Di(this,this.computeAttrs(e),t,He.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=X.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let r=this.contentMatch.matchFragment(t),s=r&&r.fillBefore(X.empty,!0);return s?new Di(this,e,t.append(s),He.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){UA(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:He.none:e}static compile(e,t){let i=Object.create(null);e.forEach((s,o)=>i[s]=new GA(s,t,o));let r=t.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function vL(n,e,t){let i=t.split("|");return r=>{let s=r===null?"null":typeof r;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${s}`)}}class xL{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?vL(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Yg{constructor(e,t,i,r){this.name=e,this.rank=t,this.schema=i,this.spec=r,this.attrs=KA(e,r.attrs),this.excluded=null;let s=qA(this.attrs);this.instance=s?new He(this,s):null}create(e=null){return!e&&this.instance?this.instance:new He(this,jA(this.attrs,e))}static compile(e,t){let i=Object.create(null),r=0;return e.forEach((s,o)=>i[s]=new Yg(s,r++,t,o)),i}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){UA(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class JA{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=sn.from(e.nodes),t.marks=sn.from(e.marks||{}),this.nodes=Xm.compile(this.spec.nodes,this),this.marks=Yg.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let s=this.nodes[r],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[o]||(i[o]=Yl.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?CC(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let r in this.marks){let s=this.marks[r],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:CC(this,o.split(" "))}this.nodeFromJSON=r=>Di.fromJSON(this,r),this.markFromJSON=r=>He.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Xm){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,i,r)}text(e,t){let i=this.nodes.text;return new hL(i,i.defaultAttrs,e,He.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function CC(n,e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],s=n.marks[r],o=s;if(s)t.push(s);else for(let l in n.marks){let a=n.marks[l];(r=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(r)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function CL(n){return n.tag!=null}function SL(n){return n.style!=null}class _o{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(r=>{if(CL(r))this.tags.push(r);else if(SL(r)){let s=/[^=]*/.exec(r.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let s=e.nodes[r.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let i=new MC(this,t,!1);return i.addAll(e,He.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new MC(this,t,!0);return i.addAll(e,He.none,t.from,t.to),ee.maxOpen(i.finish())}matchTag(e,t,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let s=this.tags[r];if(AL(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,i,r){for(let s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!i.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function i(r){let s=r.priority==null?50:r.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,r)}for(let r in e.marks){let s=e.marks[r].spec.parseDOM;s&&s.forEach(o=>{i(o=TC(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in e.nodes){let s=e.nodes[r].spec.parseDOM;s&&s.forEach(o=>{i(o=TC(o)),o.node||o.ignore||o.mark||(o.node=r)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _o(e,_o.schemaRules(e)))}}const YA={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ML={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},XA={ol:!0,ul:!0},ef=1,$y=2,Th=4;function SC(n,e,t){return e!=null?(e?ef:0)|(e==="full"?$y:0):n&&n.whitespace=="pre"?ef|$y:t&~Th}class tp{constructor(e,t,i,r,s,o){this.type=e,this.attrs=t,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=He.none,this.match=s||(o&Th?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(X.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ef)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-r[0].length))}}let t=X.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(X.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!YA.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}let MC=class{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=t.topNode,s,o=SC(null,t.preserveWhitespace,0)|(i?Th:0);r?s=new tp(r.type,r.attrs,He.none,!0,t.topMatch||r.type.contentMatch,o):i?s=new tp(null,null,He.none,!0,null,o):s=new tp(e.schema.topNodeType,null,He.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let i=e.nodeValue,r=this.top,s=r.options&$y?"full":this.localPreserveWS||(r.options&ef)>0,{schema:o}=this.parser;if(s==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,`
|
|
5
5
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=r.content[r.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let r=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;XA.hasOwnProperty(o)&&this.parser.normalizeLists&&TL(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,i));e:if(a?a.ignore:ML.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(YA.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let h=a&&a.skip?t:this.readStyles(e,t);h&&this.addAll(e,h),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
@@ -52,7 +52,7 @@ var bC=n=>{throw TypeError(n)};var n1=(n,e,t)=>e.has(n)||bC("Cannot "+t);var C=(
|
|
|
52
52
|
`))};if((se.mac||se.android)&&h.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:l,to:a,insert:Ze.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);zk(e,h,H.single(this.toEditorPos(i.selectionStart,f),this.toEditorPos(i.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(me.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:BO.of(me.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=wf(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ne{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||q8(e.parent)||document,this.viewState=new w2(e.state||Ge.create(e)),e.scrollTo&&e.scrollTo.is(ap)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ba).map(r=>new R1(r));for(let r of this.plugins)r.update(this);this.observer=new f6(this),this.inputState=new LB(this),this.inputState.ensureHandlers(this.plugins),this.docView=new s2(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Ft?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(e5))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=t5(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Ge.phrases)!=this.state.facet(Ge.phrases))return this.setState(s);r=ug.create(this,s,e),r.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new Ka(d.empty?d:H.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(ap)&&(h=d.value.clip(this.state))}this.viewState.update(r,h),this.bidiCache=pg.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(th)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(pp)!=r.state.facet(pp)&&(this.viewState.mustMeasureContent=!0),(t||i||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(Bb))try{f(r)}catch(d){Kn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!KO(this,u)&&c.force&&Ua(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new w2(e),this.plugins=e.facet(Ba).map(i=>new R1(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new s2(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ba),i=e.state.facet(Ba);if(t!=i){let r=[];for(let s of i){let o=t.indexOf(s);if(o<0)r.push(new R1(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){Kn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(kO(i))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(p){return Kn(this.state,p),S2}}),h=ug.create(this,this.state,[]),f=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=S2)try{let p=c[d];p.write&&p.write(u[d],this)}catch(p){Kn(this.state,p)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){r=r+p,i.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Bb))l(t)}get themeClasses(){return Wb+" "+(this.state.facet(zb)?s5:r5)+" "+this.state.facet(pp)}updateAttrs(){let e=M2(this,FO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ms)?"true":"false",class:"cm-content",style:`${se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),M2(this,Hk,t);let i=this.observer.ignore(()=>{let r=QS(this.contentDOM,this.contentAttrs,t),s=QS(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(ne.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(th);let e=this.state.facet(ne.cspNonce);No.mount(this.root,this.styleModules.concat(u6).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return F1(this,e,o2(this,e,t,i))}moveByGroup(e,t){return F1(this,e,o2(this,e,t,i=>TB(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return H.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return MB(this,e,t,i)}moveVertically(e,t,i){return F1(this,e,AB(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=$b(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),$b(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[_s.find(s,e-r.from,-1,t)];return kf(i,o.dir==pt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(RO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>m6)return TO(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||MO(s.isolates,i=n2(this,e))))return s.order;i||(i=n2(this,e));let r=Z8(e.text,t,i);return this.bidiCache.push(new pg(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{wO(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return ap.of(new Ka(typeof e=="number"?H.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return ap.of(new Ka(H.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Dt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Dt.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=No.newName(),r=[pp.of(i),th.of(qb(`.${i}`,e))];return t&&t.dark&&r.push(zb.of(!0)),r}static baseTheme(e){return zo.lowest(th.of(qb("."+Wb,e,o5)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Ht.get(i)||Ht.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}ne.styleModule=th;ne.inputHandler=DO;ne.clipboardInputFilter=Bk;ne.clipboardOutputFilter=Fk;ne.scrollHandler=PO;ne.focusChangeEffect=NO;ne.perLineTextDirection=RO;ne.exceptionSink=IO;ne.updateListener=Bb;ne.editable=Ms;ne.mouseSelectionStyle=OO;ne.dragMovesSelection=EO;ne.clickAddsSelectionRange=_O;ne.decorations=u0;ne.blockWrappers=HO;ne.outerDecorations=$k;ne.atomicRanges=Sd;ne.bidiIsolatedRanges=$O;ne.scrollMargins=VO;ne.darkTheme=zb;ne.cspNonce=ie.define({combine:n=>n.length?n[0]:""});ne.contentAttributes=Hk;ne.editorAttributes=FO;ne.lineWrapping=ne.contentAttributes.of({class:"cm-lineWrapping"});ne.announce=Re.define();const m6=4096,S2={};class pg{constructor(e,t,i,r,s,o){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:pt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&i.push(new pg(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function M2(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(n):s;o&&Rk(o,t)}return t}const g6=se.mac?"mac":se.windows?"win":se.linux?"linux":"key";function y6(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function mp(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const b6=zo.default(ne.domEventHandlers({keydown(n,e){return a5(l5(e.state),n,e,"editor")}})),Xc=ie.define({enables:b6}),T2=new WeakMap;function l5(n){let e=n.facet(Xc),t=T2.get(e);return t||T2.set(e,t=v6(e.reduce((i,r)=>i.concat(r),[]))),t}function w6(n,e,t){return a5(l5(n.state),e,n,t)}let uo=null;const k6=4e3;function v6(n,e=g6){let t=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var h,f;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>y6(y,e));for(let y=1;y<p.length;y++){let b=p.slice(0,y).join(" ");r(b,!0),d[b]||(d[b]={preventDefault:!0,stopPropagation:!1,run:[w=>{let x=uo={view:w,prefix:b,scope:o};return setTimeout(()=>{uo==x&&(uo=null)},k6),!0}]})}let m=p.join(" ");r(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(d=>h(d,jb))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let jb=null;function a5(n,e,t,i){jb=e;let r=J_(e),s=qn(r,0),o=Ir(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;uo&&uo.view==t&&uo.scope==i&&(l=uo.prefix+" ",YO.indexOf(e.keyCode)<0&&(c=!0,uo=null));let h=new Set,f=g=>{if(g){for(let y of g.run)if(!h.has(y)&&(h.add(y),y(t)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},d=n[i],p,m;return d&&(f(d[l+mp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(se.windows&&e.ctrlKey&&e.altKey)&&!(se.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Rs[e.keyCode])&&p!=r?(f(d[l+mp(p,e,!0)])||e.shiftKey&&(m=sf[e.keyCode])!=r&&m!=p&&f(d[l+mp(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(d[l+mp(r,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),jb=null,a}class Md{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=c5(e);return[new Md(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return x6(e,t,i)}}function c5(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==pt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function A2(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=n.posAtCoords({x:s.left+1,y:o}),a=n.posAtCoords({x:s.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function x6(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==pt.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=c5(n),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=l.right-(u?parseInt(u.paddingRight):0),d=Hb(n,i,1),p=Hb(n,r,-1),m=d.type==hn.Text?d:null,g=p.type==hn.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=A2(n,i,1,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=A2(n,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return b(w(t.from,t.to,m));{let k=m?w(t.from,null,m):x(d,!1),T=g?w(null,t.to,g):x(p,!0),A=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&k.bottom+n.defaultLineHeight/2<T.top?A.push(y(h,k.bottom,f,T.top)):k.bottom<T.top&&n.elementAtHeight((k.bottom+T.top)/2).type==hn.Text&&(k.bottom=T.top=(k.bottom+T.top)/2),b(k).concat(A).concat(b(T))}function y(k,T,A,B){return new Md(e,k-a.left,T-a.top,A-k,B-T)}function b({top:k,bottom:T,horizontal:A}){let B=[];for(let W=0;W<A.length;W+=2)B.push(y(A[W],k,A[W+1],T));return B}function w(k,T,A){let B=1e9,W=-1e9,E=[];function U(ke,Me,Ne,lt,oe){let ae=n.coordsAtPos(ke,ke==A.to?-2:2),Ae=n.coordsAtPos(Ne,Ne==A.from?2:-2);!ae||!Ae||(B=Math.min(ae.top,Ae.top,B),W=Math.max(ae.bottom,Ae.bottom,W),oe==pt.LTR?E.push(s&&Me?h:ae.left,s&<?f:Ae.right):E.push(!s&<?h:Ae.left,!s&&Me?f:ae.right))}let L=k??A.from,ge=T??A.to;for(let ke of n.visibleRanges)if(ke.to>L&&ke.from<ge)for(let Me=Math.max(ke.from,L),Ne=Math.min(ke.to,ge);;){let lt=n.state.doc.lineAt(Me);for(let oe of n.bidiSpans(lt)){let ae=oe.from+lt.from,Ae=oe.to+lt.from;if(ae>=Ne)break;Ae>Me&&U(Math.max(ae,Me),k==null&&ae<=L,Math.min(Ae,Ne),T==null&&Ae>=ge,oe.dir)}if(Me=lt.to+1,Me>=Ne)break}return E.length==0&&U(L,k==null,ge,T==null,n.textDirection),{top:B,bottom:W,horizontal:E}}function x(k,T){let A=l.top+(T?k.top:k.bottom);return{top:A,bottom:A,horizontal:[]}}}function C6(n,e){return n.constructor==e.constructor&&n.eq(e)}class S6{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(dm)!=e.state.facet(dm)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(dm);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!C6(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,se.safari&&se.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const dm=ie.define();function u5(n){return[Dt.define(e=>new S6(e,n)),dm.of(n)]}const xf=ie.define({combine(n){return Zr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function h5(n={}){return[xf.of(n),M6,T6,A6,LO.of(!0)]}function f5(n){return n.startState.facet(xf)!=n.state.facet(xf)}const M6=u5({above:!0,markers(n){let{state:e}=n,t=e.facet(xf),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:H.cursor(r.head,r.head>r.anchor?-1:1);for(let a of Md.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=f5(n);return t&&_2(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){_2(e.state,n)},class:"cm-cursorLayer"});function _2(n,e){e.style.animationDuration=n.facet(xf).cursorBlinkRate+"ms"}const T6=u5({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Md.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||f5(n)},class:"cm-selectionLayer"}),A6=zo.highest(ne.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),d5=Re.define({map(n,e){return n==null?null:e.mapPos(n)}}),rh=Qt.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(d5)?i.value:t,n)}}),_6=Dt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(rh);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(rh)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(rh),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(rh)!=n&&this.view.dispatch({effects:d5.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function E6(){return[rh,_6]}function E2(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),o=t,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function O6(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class I6{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(l,a,c,u)=>r(u,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,u)=>{let h=i(l,a,c);h&&u(c,c+l[0].length,h)};else if(i)this.addMatch=(l,a,c,u)=>u(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new Ps,i=t.add.bind(t);for(let{from:r,to:s}of O6(e,this.maxLength))E2(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),r=Math.max(a,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let a=e.state.doc.lineAt(o),c=a.to<l?e.state.doc.lineAt(l):a,u=Math.max(s.from,a.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){u=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){h=l;break}}let f=[],d,p=(m,g,y)=>f.push(y.range(m,g));if(a==c)for(this.regexp.lastIndex=u-a.from;(d=this.regexp.exec(a.text))&&d.index<h-a.from;)this.addMatch(d,e,d.index+a.from,p);else E2(e.state.doc,this.regexp,u,h,(m,g)=>this.addMatch(g,e,m,p));t=t.update({filterFrom:u,filterTo:h,filter:(m,g)=>m<u||g>h,add:f})}}return t}}const Ub=/x/.unicode!=null?"gu":"g",D6=new RegExp(`[\0-\b
|
|
53
53
|
--\u2028\u2029\uFEFF-]`,Ub),N6={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let V1=null;function R6(){var n;if(V1==null&&typeof document<"u"&&document.body){let e=document.body.style;V1=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return V1||!1}const pm=ie.define({combine(n){let e=Zr(n,{render:null,specialChars:D6,addSpecialChars:null});return(e.replaceTabs=!R6())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ub)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ub)),e}});function L6(n={}){return[pm.of(n),P6()]}let O2=null;function P6(){return O2||(O2=Dt.fromClass(class{constructor(n){this.view=n,this.decorations=me.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(pm)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new I6({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=qn(e[0],0);if(s==9){let o=r.lineAt(i),l=t.state.tabSize,a=Yc(o.text,l,i-o.from);return me.replace({widget:new $6((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=me.replace({widget:new H6(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(pm);n.startState.facet(pm)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const B6="•";function F6(n){return n>=32?B6:n==10?"":String.fromCharCode(9216+n)}class H6 extends fr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=F6(this.code),i=e.state.phrase("Control character")+" "+(N6[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class $6 extends fr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function V6(){return W6}const z6=me.line({class:"cm-activeLine"}),W6=Dt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(z6.range(r.from)),e=r.from)}return me.set(t)}},{decorations:n=>n.decorations});class q6 extends fr{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Hh(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=kf(t[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function Mee(n){let e=Dt.fromClass(class{constructor(t){this.view=t,this.placeholder=n?me.set([me.widget({widget:new q6(n),side:1}).range(0)]):me.none}get decorations(){return this.view.state.doc.length?me.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,ne.contentAttributes.of({"aria-placeholder":n})]:e}const Kb=2e3;function j6(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>Kb||t.off>Kb||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=l&&s.push(H.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),u=Tb(c.text,o,n.tabSize,!0);if(u<0)s.push(H.cursor(c.to));else{let h=Tb(c.text,l,n.tabSize);s.push(H.range(c.from+u,c.from+h))}}}return s}function U6(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function I2(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>Kb?-1:r==i.length?U6(n,e.clientX):Yc(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function K6(n,e){let t=I2(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=I2(n,r);if(!l)return i;let a=j6(n.state,t,l);return a.length?o?H.create(a.concat(i.ranges)):H.create(a):i}}:null}function G6(n){let e=(t=>t.altKey&&t.button==0);return ne.mouseSelectionStyle.of((t,i)=>e(i)?K6(t,i):null)}const J6={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},Y6={style:"cursor: crosshair"};function X6(n={}){let[e,t]=J6[n.key||"Alt"],i=Dt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,ne.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?Y6:null})]}const gp="-10000px";class p5{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(u=h)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let h=o[a]=this.tooltipViews[u];l&&(l[a]=t[u]),h.update&&h.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,c)=>t[c]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function Z6(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const z1=ie.define({combine:n=>{var e,t,i;return{position:se.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Z6}}}),D2=new WeakMap,jk=Dt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(z1);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new p5(n,Uk,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(z1);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=gp,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(se.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Vk(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(z1).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,h=n.pos[l],f=n.size[l];if(!h||a.clip!==!1&&(h.bottom<=Math.max(t.top,i.top)||h.top>=Math.min(t.bottom,i.bottom)||h.right<Math.max(t.left,i.left)-.1||h.left>Math.min(t.right,i.right)+.1)){u.style.top=gp;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=f.right-f.left,g=(e=D2.get(c))!==null&&e!==void 0?e:f.bottom-f.top,y=c.offset||eF,b=this.view.textDirection==pt.LTR,w=f.width>i.right-i.left?b?i.left:i.right-f.width:b?Math.max(i.left,Math.min(h.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,h.left-m+(d?14:0)-y.x),i.right-m),x=this.above[l];!a.strictSide&&(x?h.top-g-p-y.y<i.top:h.bottom+g+p+y.y>i.bottom)&&x==i.bottom-h.bottom>h.top-i.top&&(x=this.above[l]=!x);let k=(x?h.top-i.top:i.bottom-h.bottom)-p;if(k<g&&c.resize!==!1){if(k<this.view.defaultLineHeight){u.style.top=gp;continue}D2.set(c,g),u.style.height=(g=k)/s+"px"}else u.style.height&&(u.style.height="");let T=x?h.top-g-p-y.y:h.bottom+p+y.y,A=w+m;if(c.overlap!==!0)for(let B of o)B.left<A&&B.right>w&&B.top<T+g&&B.bottom>T&&(T=x?B.top-g-2-p:B.bottom+p+2);if(this.position=="absolute"?(u.style.top=(T-n.parent.top)/s+"px",N2(u,(w-n.parent.left)/r)):(u.style.top=T/s+"px",N2(u,w/r)),d){let B=h.left+(b?y.x:-y.x)-(w+14-7);d.style.left=B/r+"px"}c.overlap!==!0&&o.push({left:w,top:T,right:A,bottom:T+g}),u.classList.toggle("cm-tooltip-above",x),u.classList.toggle("cm-tooltip-below",!x),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=gp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function N2(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const Q6=ne.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),eF={x:0,y:0},Uk=ie.define({enables:[jk,Q6]}),mg=ie.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class p0{static create(e){return new p0(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new p5(e,mg,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const tF=Uk.compute([mg],n=>{let e=n.facet(mg);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:p0.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class nF{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let l=e.coordsAtPos(r);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=a&&a.dir==pt.RTL?-1:1;s=t.x<l.left?-c:c}let o=this.source(e,r,s);if(o!=null&&o.then){let l=this.pending={pos:r};o.then(a=>{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Kn(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(jk),t=e?e.manager.tooltips.findIndex(i=>i.create==p0.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!iF(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!rF(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const yp=4;function iF(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=t-yp&&e.clientX<=i+yp&&e.clientY>=r-yp&&e.clientY<=s+yp}function rF(n,e,t,i,r,s){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=n.posAtCoords({x:i,y:r},!1);return a>=e&&a<=t}function sF(n,e={}){let t=Re.define(),i=Qt.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let l of r){let a=s.changes.mapPos(l.pos,-1,cn.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),l);c.pos=a,c.end!=null&&(c.end=s.changes.mapPos(c.end)),o.push(c)}}r=o}for(let o of s.effects)o.is(t)&&(r=o.value),o.is(oF)&&(r=[]);return r},provide:r=>mg.from(r)});return{active:i,extension:[i,Dt.define(r=>new nF(r,n,i,t,e.hoverTime||300)),tF]}}function m5(n,e){let t=n.plugin(jk);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const oF=Re.define(),R2=ie.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Kk(n,e){let t=n.plugin(g5),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const g5=Dt.fromClass(class{constructor(n){this.input=n.state.facet(Cf),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(R2);this.top=new bp(n,!0,e.topContainer),this.bottom=new bp(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(R2);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new bp(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new bp(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Cf);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(n.view),l.push(u)):(u=this.panels[c],u.update&&u.update(n)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>ne.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class bp{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=L2(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=L2(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function L2(n){let e=n.nextSibling;return n.remove(),e}const Cf=ie.define({enables:g5});function lF(n,e){let t,i=new Promise(o=>t=o),r=o=>aF(o,e,t);n.state.field(W1,!1)?n.dispatch({effects:y5.of(r)}):n.dispatch({effects:Re.appendConfig.of(W1.init(()=>[r]))});let s=b5.of(r);return{close:s,result:i.then(o=>((n.win.queueMicrotask||(a=>n.win.setTimeout(a,10)))(()=>{n.state.field(W1).indexOf(r)>-1&&n.dispatch({effects:s})}),o))}}const W1=Qt.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(y5)?n=[t.value].concat(n):t.is(b5)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Cf.computeN([n],e=>e.field(n))}),y5=Re.define(),b5=Re.define();function aF(n,e,t){let i=e.content?e.content(n,()=>o(null)):null;if(!i){if(i=at("form"),e.input){let l=at("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(at("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(at("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l<r.length;l++){let a=r[l];a.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(a))}),a.addEventListener("submit",c=>{c.preventDefault(),o(a)})}let s=at("div",i,at("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Fs extends Do{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Fs.prototype.elementClass="";Fs.prototype.toDOM=void 0;Fs.prototype.mapMode=cn.TrackBefore;Fs.prototype.startSide=Fs.prototype.endSide=-1;Fs.prototype.point=!0;const mm=ie.define(),cF=ie.define(),uF={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>je.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},zh=ie.define();function hF(n){return[w5(),zh.of({...uF,...n})]}const P2=ie.define({combine:n=>n.some(e=>e)});function w5(n){return[fF]}const fF=Dt.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(zh).map(e=>new F2(n,e)),this.fixed=!n.state.facet(P2);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(P2)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=je.iter(this.view.state.facet(mm),this.view.viewport.from),i=[],r=this.gutters.map(s=>new dF(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==hn.Text&&o){Gb(t,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==hn.Text){Gb(t,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(zh),t=n.state.facet(zh),i=n.docChanged||n.heightChanged||n.viewportChanged||!je.eq(n.startState.facet(mm),n.state.facet(mm),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new F2(this.view,s)):(this.gutters[o].update(n),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>ne.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==pt.LTR?{left:i,right:r}:{right:i,left:r}})});function B2(n){return Array.isArray(n)?n:[n]}function Gb(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class dF{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=je.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let l=new k5(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];Gb(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(cF)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class F2{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=B2(t.markers(e)),t.initialSpacer&&(this.spacer=new k5(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=B2(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!je.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class k5{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),pF(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<t.length?t[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(a)){l=h,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let h=r.nextSibling;r.remove(),r=h}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function pF(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const mF=ie.define(),gF=ie.define(),Fa=ie.define({combine(n){return Zr(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let s=i[r],o=t[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}});class q1 extends Fs{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function j1(n,e){return n.state.facet(Fa).formatNumber(e,n.state)}const yF=zh.compute([Fa],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(mF)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new q1(j1(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(gF)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Fa)!=e.state.facet(Fa),initialSpacer(e){return new q1(j1(e,H2(e.state.doc.lines)))},updateSpacer(e,t){let i=j1(t.view,H2(t.view.state.doc.lines));return i==e.number?e:new q1(i)},domEventHandlers:n.facet(Fa).domEventHandlers,side:"before"}));function bF(n={}){return[Fa.of(n),w5(),yF]}function H2(n){let e=9;for(;e<n;)e=e*10+9;return e}const wF=new class extends Fs{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},kF=mm.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(wF.range(r)))}return je.of(e)});function vF(){return kF}let xF=0;class Si{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=xF++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Si&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Si(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new gg(e);return i=>i.modified.indexOf(t)>-1?i:gg.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let CF=0;class gg{constructor(e){this.name=e,this.instances=[],this.id=CF++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&SF(t,l.modified));if(i)return i;let r=[],s=new Si(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=MF(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(gg.get(l,a));return s}}function SF(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function MF(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function TF(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let h=0;;){if(l=="..."&&h>0&&h+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==r.length)break;let d=r[h++];if(h==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(h)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new Sf(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return v5.add(e)}const v5=new We({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Sf(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}});class Sf{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Sf.empty=new Sf([],2,null);function x5(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function AF(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function _F(n,e,t,i=0,r=n.length){let s=new EF(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class EF{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=OF(e)||Sf.empty,h=AF(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(r+=(r?" ":"")+h)),this.startSpan(Math.max(t,l),c),u.opaque)return;let f=e.tree&&e.tree.prop(We.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let b=g<f.overlay.length?f.overlay[g]:null,w=b?b.from+l:a,x=Math.max(t,y),k=Math.min(i,w);if(x<k&&m)for(;e.from<k&&(this.highlightRange(e,x,k,r,s),this.startSpan(Math.min(k,e.to),c),!(e.to>=w||!e.nextSibling())););if(!b||w>i)break;y=b.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,b.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function OF(n){let e=n.type.prop(v5);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const te=Si.define,wp=te(),no=te(),$2=te(no),V2=te(no),io=te(),kp=te(io),U1=te(io),Sr=te(),Yo=te(Sr),kr=te(),vr=te(),Jb=te(),Au=te(Jb),vp=te(),P={comment:wp,lineComment:te(wp),blockComment:te(wp),docComment:te(wp),name:no,variableName:te(no),typeName:$2,tagName:te($2),propertyName:V2,attributeName:te(V2),className:te(no),labelName:te(no),namespace:te(no),macroName:te(no),literal:io,string:kp,docString:te(kp),character:te(kp),attributeValue:te(kp),number:U1,integer:te(U1),float:te(U1),bool:te(io),regexp:te(io),escape:te(io),color:te(io),url:te(io),keyword:kr,self:te(kr),null:te(kr),atom:te(kr),unit:te(kr),modifier:te(kr),operatorKeyword:te(kr),controlKeyword:te(kr),definitionKeyword:te(kr),moduleKeyword:te(kr),operator:vr,derefOperator:te(vr),arithmeticOperator:te(vr),logicOperator:te(vr),bitwiseOperator:te(vr),compareOperator:te(vr),updateOperator:te(vr),definitionOperator:te(vr),typeOperator:te(vr),controlOperator:te(vr),punctuation:Jb,separator:te(Jb),bracket:Au,angleBracket:te(Au),squareBracket:te(Au),paren:te(Au),brace:te(Au),content:Sr,heading:Yo,heading1:te(Yo),heading2:te(Yo),heading3:te(Yo),heading4:te(Yo),heading5:te(Yo),heading6:te(Yo),contentSeparator:te(Sr),list:te(Sr),quote:te(Sr),emphasis:te(Sr),strong:te(Sr),link:te(Sr),monospace:te(Sr),strikethrough:te(Sr),inserted:te(),deleted:te(),changed:te(),invalid:te(),meta:vp,documentMeta:te(vp),annotation:te(vp),processingInstruction:te(vp),definition:Si.defineModifier("definition"),constant:Si.defineModifier("constant"),function:Si.defineModifier("function"),standard:Si.defineModifier("standard"),local:Si.defineModifier("local"),special:Si.defineModifier("special")};for(let n in P){let e=P[n];e instanceof Si&&(e.name=n)}x5([{tag:P.link,class:"tok-link"},{tag:P.heading,class:"tok-heading"},{tag:P.emphasis,class:"tok-emphasis"},{tag:P.strong,class:"tok-strong"},{tag:P.keyword,class:"tok-keyword"},{tag:P.atom,class:"tok-atom"},{tag:P.bool,class:"tok-bool"},{tag:P.url,class:"tok-url"},{tag:P.labelName,class:"tok-labelName"},{tag:P.inserted,class:"tok-inserted"},{tag:P.deleted,class:"tok-deleted"},{tag:P.literal,class:"tok-literal"},{tag:P.string,class:"tok-string"},{tag:P.number,class:"tok-number"},{tag:[P.regexp,P.escape,P.special(P.string)],class:"tok-string2"},{tag:P.variableName,class:"tok-variableName"},{tag:P.local(P.variableName),class:"tok-variableName tok-local"},{tag:P.definition(P.variableName),class:"tok-variableName tok-definition"},{tag:P.special(P.variableName),class:"tok-variableName2"},{tag:P.definition(P.propertyName),class:"tok-propertyName tok-definition"},{tag:P.typeName,class:"tok-typeName"},{tag:P.namespace,class:"tok-namespace"},{tag:P.className,class:"tok-className"},{tag:P.macroName,class:"tok-macroName"},{tag:P.propertyName,class:"tok-propertyName"},{tag:P.operator,class:"tok-operator"},{tag:P.comment,class:"tok-comment"},{tag:P.meta,class:"tok-meta"},{tag:P.invalid,class:"tok-invalid"},{tag:P.punctuation,class:"tok-punctuation"}]);var K1;const wl=new We;function C5(n){return ie.define({combine:n?e=>e.concat(n):void 0})}const IF=new We;class Ei{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ge.prototype.hasOwnProperty("tree")||Object.defineProperty(Ge.prototype,"tree",{get(){return fn(this)}}),this.parser=t,this.extension=[Lo.of(this),Ge.languageData.of((s,o,l)=>{let a=z2(s,o,l),c=a.type.prop(wl);if(!c)return[];let u=s.facet(c),h=a.type.prop(IF);if(h){let f=a.resolve(o-a.from,l);for(let d of h)if(d.test(f,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(i)}isActiveAt(e,t,i=-1){return z2(e,t,i).type.prop(wl)==this.data}findRegions(e){let t=e.facet(Lo);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(wl)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(We.mounted);if(l){if(l.tree.prop(wl)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof dt&&r(c,s.positions[a]+o)}};return r(fn(e),0),i}get allowsNesting(){return!0}}Ei.setState=Re.define();function z2(n,e,t){let i=n.facet(Lo),r=fn(n).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,t,ht.ExcludeBuffers|ht.EnterBracketed))s.type.isTop&&(r=s);return r}class Yb extends Ei{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=C5(e.languageData);return new Yb(t,e.parser.configure({props:[wl.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new Yb(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function fn(n){let e=n.field(Ei.state,!1);return e?e.tree:dt.empty}class DF{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let _u=null;class Fc{constructor(e,t,i=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Fc(e,t,[],dt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new DF(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=dt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Is.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Is.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=_u;_u=this;try{return e()}finally{_u=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=W2(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,h,f)=>a.push({fromA:c,toA:u,fromB:h,toB:f})),i=Is.applyChanges(i,a),r=dt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&l.push({from:u,to:h})}}}return new Fc(this.parser,t,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=W2(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends JE{createParse(t,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=_u;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new dt(Ln.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return _u}}function W2(n,e,t){return Is.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Hc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Hc(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Fc.create(e.facet(Lo).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Hc(i)}}Ei.state=Qt.define({create:Hc.init,update(n,e){for(let t of e.effects)if(t.is(Ei.setState))return t.value;return e.startState.facet(Lo)!=e.state.facet(Lo)?Hc.init(e.state):n.apply(e)}});let S5=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(S5=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const G1=typeof navigator<"u"&&(!((K1=navigator.scheduling)===null||K1===void 0)&&K1.isInputPending)?()=>navigator.scheduling.isInputPending():null,NF=Dt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ei.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ei.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=S5(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(Ei.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!G1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>G1&&G1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ei.setState.of(new Hc(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Kn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Lo=ie.define({combine(n){return n.length?n[0]:null},enables:n=>[Ei.state,NF,ne.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class RF{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class O{constructor(e,t,i,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new O(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}const LF=ie.define(),m0=ie.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function ia(n){let e=n.facet(m0);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Mf(n,e){let t="",i=n.tabSize,r=n.facet(m0)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s<e;s++)t+=r;return t}function Gk(n,e){n instanceof Ge&&(n=new g0(n));for(let i of n.state.facet(LF)){let r=i(n,e);if(r!==void 0)return r}let t=fn(n.state);return t.length>=e?PF(n,t,e):null}class g0{constructor(e,t={}){this.state=e,this.options=t,this.unit=ia(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Yc(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const M5=new We;function PF(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return T5(i,n,t)}function T5(n,e,t){for(let i=n;i;i=i.next){let r=FF(i.node);if(r)return r(Jk.create(e,t,i))}return 0}function BF(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function FF(n){let e=n.type.prop(M5);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(We.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>A5(o,!0,1,void 0,s&&!BF(o)?r.from:void 0)}return n.parent==null?HF:null}function HF(){return 0}class Jk extends g0{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Jk(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if($F(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return T5(this.context.next,this.base,this.pos)}}function $F(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function VF(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}l=a.to}}function Aee({closing:n,align:e=!0,units:t=1}){return i=>A5(i,e,t,n)}function A5(n,e,t,i,r){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==n.pos+o,a=e?VF(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const _ee=n=>n.baseIndent;function Eee({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const zF=200;function WF(){return Ge.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+zF)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==l)continue;l=u.from;let h=Gk(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],d=Mf(o,h);f!=d&&a.push({from:u.from,to:u.from+f.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const qF=ie.define(),jF=new We;function Oee(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function UF(n,e,t){let i=fn(n);if(i.length<t)return null;let r=i.resolveStack(t,1),s=null;for(let o=r;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(jF);if(a&&(l.to<i.length-50||i.length==n.doc.length||!KF(l))){let c=a(l,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function KF(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function yg(n,e,t){for(let i of n.facet(qF)){let r=i(n,e,t);if(r)return r}return UF(n,e,t)}function _5(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const y0=Re.define({map:_5}),Td=Re.define({map:_5});function E5(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const ra=Qt.define({create(){return me.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=q2(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(y0)&&!GF(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(D5),r=i?me.replace({widget:new tH(i(e.state,t.value))}):j2;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(Td)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=q2(n,e.selection.main.head)),n},provide:n=>ne.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],r=n[t++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(j2.range(i,r))}return me.set(e,!0)}});function q2(n,e,t=e){let i=!1;return n.between(e,t,(r,s)=>{r<t&&s>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):n}function bg(n,e,t){var i;let r=null;return(i=n.field(ra,!1))===null||i===void 0||i.between(e,t,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function GF(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function O5(n,e){return n.field(ra,!1)?e:e.concat(Re.appendConfig.of(N5()))}const JF=n=>{for(let e of E5(n)){let t=yg(n.state,e.from,e.to);if(t)return n.dispatch({effects:O5(n.state,[y0.of(t),I5(n,t)])}),!0}return!1},YF=n=>{if(!n.state.field(ra,!1))return!1;let e=[];for(let t of E5(n)){let i=bg(n.state,t.from,t.to);i&&e.push(Td.of(i),I5(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function I5(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return ne.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const XF=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let r=n.lineBlockAt(i),s=yg(e,r.from,r.to);s&&t.push(y0.of(s)),i=(s?n.lineBlockAt(s.to):r).to+1}return t.length&&n.dispatch({effects:O5(n.state,t)}),!!t.length},ZF=n=>{let e=n.state.field(ra,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(Td.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},QF=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:JF},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:YF},{key:"Ctrl-Alt-[",run:XF},{key:"Ctrl-Alt-]",run:ZF}],eH={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},D5=ie.define({combine(n){return Zr(n,eH)}});function N5(n){return[ra,rH]}function R5(n,e){let{state:t}=n,i=t.facet(D5),r=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=bg(n.state,l.from,l.to);a&&n.dispatch({effects:Td.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const j2=me.replace({widget:new class extends fr{toDOM(n){return R5(n,null)}}});class tH extends fr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return R5(e,this.value)}}const nH={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class J1 extends Fs{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function iH(n={}){let e={...nH,...n},t=new J1(e,!0),i=new J1(e,!1),r=Dt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Lo)!=o.state.facet(Lo)||o.startState.field(ra,!1)!=o.state.field(ra,!1)||fn(o.startState)!=fn(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new Ps;for(let a of o.viewportLineBlocks){let c=bg(o.state,a.from,a.to)?i:yg(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:s}=e;return[r,hF({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||je.empty},initialSpacer(){return new J1(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let c=bg(o.state,l.from,l.to);if(c)return o.dispatch({effects:Td.of(c)}),!0;let u=yg(o.state,l.from,l.to);return u?(o.dispatch({effects:y0.of(u)}),!0):!1}}}),N5()]}const rH=ne.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ad{constructor(e,t){this.specs=e;let i;function r(l){let a=No.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof Ei?l=>l.prop(wl)==o.data:o?l=>l==o:void 0,this.style=x5(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new No(i):null,this.themeType=t.themeType}static define(e,t){return new Ad(e,t||{})}}const Xb=ie.define(),L5=ie.define({combine(n){return n.length?[n[0]]:null}});function Y1(n){let e=n.facet(Xb);return e.length?e:n.facet(L5)}function P5(n,e){let t=[oH],i;return n instanceof Ad&&(n.module&&t.push(ne.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(L5.of(n)):i?t.push(Xb.computeN([ne.darkTheme],r=>r.facet(ne.darkTheme)==(i=="dark")?[n]:[])):t.push(Xb.of(n)),t}class sH{constructor(e){this.markCache=Object.create(null),this.tree=fn(e.state),this.decorations=this.buildDeco(e,Y1(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=fn(e.state),i=Y1(e.state),r=i!=Y1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return me.none;let i=new Ps;for(let{from:r,to:s}of e.visibleRanges)_F(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=me.mark({class:a})))},r,s);return i.finish()}}const oH=zo.high(Dt.fromClass(sH,{decorations:n=>n.decorations})),lH=Ad.define([{tag:P.meta,color:"#404740"},{tag:P.link,textDecoration:"underline"},{tag:P.heading,textDecoration:"underline",fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strong,fontWeight:"bold"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.keyword,color:"#708"},{tag:[P.atom,P.bool,P.url,P.contentSeparator,P.labelName],color:"#219"},{tag:[P.literal,P.inserted],color:"#164"},{tag:[P.string,P.deleted],color:"#a11"},{tag:[P.regexp,P.escape,P.special(P.string)],color:"#e40"},{tag:P.definition(P.variableName),color:"#00f"},{tag:P.local(P.variableName),color:"#30a"},{tag:[P.typeName,P.namespace],color:"#085"},{tag:P.className,color:"#167"},{tag:[P.special(P.variableName),P.macroName],color:"#256"},{tag:P.definition(P.propertyName),color:"#00c"},{tag:P.comment,color:"#940"},{tag:P.invalid,color:"#f00"}]),aH=ne.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),B5=1e4,F5="()[]{}",H5=ie.define({combine(n){return Zr(n,{afterCursor:!0,brackets:F5,maxScanDistance:B5,renderMatch:hH})}}),cH=me.mark({class:"cm-matchingBracket"}),uH=me.mark({class:"cm-nonmatchingBracket"});function hH(n){let e=[],t=n.matched?cH:uH;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const fH=Qt.define({create(){return me.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(H5);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=Br(e.state,r.head,-1,i)||r.head>0&&Br(e.state,r.head-1,1,i)||i.afterCursor&&(Br(e.state,r.head,1,i)||r.head<e.state.doc.length&&Br(e.state,r.head+1,-1,i));s&&(t=t.concat(i.renderMatch(s,e.state)))}return me.set(t,!0)},provide:n=>ne.decorations.from(n)}),dH=[fH,aH];function pH(n={}){return[H5.of(n),dH]}const mH=new We;function Zb(n,e,t){let i=n.prop(e<0?We.openedBy:We.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Qb(n){let e=n.type.prop(mH);return e?e(n.node):n}function Br(n,e,t,i={}){let r=i.maxScanDistance||B5,s=i.brackets||F5,o=fn(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=Zb(a.type,t,s);if(c&&a.from<a.to){let u=Qb(a);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return gH(n,e,t,a,u,c,s)}}return yH(n,e,t,o,l.type,r,s)}function gH(n,e,t,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l==null?void 0:l.cursor();if(u&&(t<0?u.childBefore(i.from):u.childAfter(i.to)))do if(t<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let h=Qb(u);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Zb(u.type,t,o))c++;else if(Zb(u.type,-t,o)){if(c==0){let h=Qb(u);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function yH(n,e,t,i,r,s,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=s;){let d=u.value;t<0&&(f+=d.length);let p=e+f*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=r))if(y%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};h--}}t>0&&(f+=d.length)}return u.done?{start:c,matched:!1}:null}function U2(n,e,t,i=0,r=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=r;for(let o=i;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class $5{constructor(e,t,i,r){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=U2(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:U2(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let r=o=>i?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function bH(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||wH,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Zk,mergeTokens:n.mergeTokens!==!1}}function wH(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const K2=new WeakMap;class Yk extends Ei{constructor(e){let t=C5(e.languageData),i=bH(e),r,s=new class extends JE{createParse(o,l,a){return new vH(r,o,l,a)}};super(t,s,[],e.name),this.topNode=SH(t,this),r=this,this.streamParser=i,this.stateAfter=new We({perNode:!0}),this.tokenTable=e.tokenTable?new q5(i.tokenTable):CH}static define(e){return new Yk(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=K2.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=Xk(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let a=e.state.doc.lineAt(s),c=Math.min(e.pos,a.to);if(a.length){let u=i?i(a.from):-1,h=new $5(a.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;h.pos<c-a.from;)z5(this.streamParser.token,h,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=a.to+1}let l=e.lineAt(e.pos);return i&&t==null&&K2.set(e.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function Xk(n,e,t,i,r){let s=t>=i&&t+e.length<=r&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],c=l instanceof dt&&a<r&&Xk(n,l,a,i,r);if(c)return c}return null}function V5(n,e,t,i,r){if(r&&t<=0&&i>=e.length)return e;!r&&t==0&&e.type==n.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(o<i&&l instanceof dt){if(!(a=V5(n,l,t-o,i-o,r)))break;return r?new dt(e.type,e.children.slice(0,s).concat(a),e.positions.slice(0,s+1),o+a.length):a}}return null}function kH(n,e,t,i,r){for(let s of e){let o=s.from+(s.openStart?25:0),l=s.to-(s.openEnd?25:0),a=o<=t&&l>t&&Xk(n,s.tree,0-s.offset,t,l),c;if(a&&a.pos<=i&&(c=V5(n,s.tree,t+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:c}}return{state:n.streamParser.startState(r?ia(r):4),tree:dt.empty}}class vH{constructor(e,t,i,r){this.lang=e,this.input=t,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Fc.get(),o=r[0].from,{state:l,tree:a}=kH(e,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&r.some(c=>c.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(ia(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Fc.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
54
54
|
`&&(t="");else{let i=t.indexOf(`
|
|
55
|
-
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new $5(t,e?e.state.tabSize:4,e?ia(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=z5(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=dt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:xH,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new dt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new dt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function z5(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let r=n(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const Zk=Object.create(null),Tf=[Ln.none],xH=new Mk(Tf),G2=[],J2=Object.create(null),W5=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])W5[n]=j5(Zk,e);class q5{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),W5)}resolve(e){return e?this.table[e]||(this.table[e]=j5(this.extra,e)):0}}const CH=new q5(Zk);function X1(n,e){G2.indexOf(n)>-1||(G2.push(n),console.warn(e))}function j5(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=n[c]||P[c];u?typeof u=="function"?a.length?a=a.map(u):X1(c,`Modifier ${c} used at start of tag`):a.length?X1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:X1(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(l=>l.id),s=J2[r];if(s)return s.id;let o=J2[r]=Ln.define({id:Tf.length,name:i,props:[TF({[i]:t})]});return Tf.push(o),o.id}function SH(n,e){let t=Ln.define({id:Tf.length,name:"Document",props:[wl.add(()=>n),M5.add(()=>i=>e.getIndent(i))],top:!0});return Tf.push(t),t}pt.RTL,pt.LTR;function V(n){return new RF(Yk.define(n))}function Ks(n){return N(()=>import("./index-BoglETHF.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const MH=[O.of({name:"C",extensions:["c","h","ino"],load(){return N(()=>import("./index-BFZNUUCR.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),O.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return N(()=>import("./index-BFZNUUCR.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),O.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ks("Cassandra")}}),O.of({name:"CSS",extensions:["css"],load(){return N(()=>import("./index-CLU4LJjR.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.css())}}),O.of({name:"Go",extensions:["go"],load(){return N(()=>import("./index-Cyz_w8KS.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.go())}}),O.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return N(()=>import("./index-B10kMZoq.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.html())}}),O.of({name:"Java",extensions:["java"],load(){return N(()=>import("./index-BY5Kvjqg.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.java())}}),O.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return N(()=>import("./index-DMIwLDS8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript())}}),O.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return N(()=>import("./index-DgsUJgRJ.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.jinja())}}),O.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return N(()=>import("./index-BTSYG2Vy.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.json())}}),O.of({name:"JSX",extensions:["jsx"],load(){return N(()=>import("./index-DMIwLDS8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),O.of({name:"LESS",extensions:["less"],load(){return N(()=>import("./index-CsCwwmYY.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.less())}}),O.of({name:"Liquid",extensions:["liquid"],load(){return N(()=>import("./index-Blf7J5yW.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.liquid())}}),O.of({name:"MariaDB SQL",load(){return Ks("MariaSQL")}}),O.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return N(()=>import("./index-sPNG1_UN.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.markdown())}}),O.of({name:"MS SQL",load(){return Ks("MSSQL")}}),O.of({name:"MySQL",load(){return Ks("MySQL")}}),O.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return N(()=>import("./index-CLRs5cWt.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.php())}}),O.of({name:"PLSQL",extensions:["pls"],load(){return Ks("PLSQL")}}),O.of({name:"PostgreSQL",load(){return Ks("PostgreSQL")}}),O.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return N(()=>import("./index-BoQA7VaE.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.python())}}),O.of({name:"Rust",extensions:["rs"],load(){return N(()=>import("./index-BzqQ69oU.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.rust())}}),O.of({name:"Sass",extensions:["sass"],load(){return N(()=>import("./index-D6DebbcI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass({indented:!0}))}}),O.of({name:"SCSS",extensions:["scss"],load(){return N(()=>import("./index-D6DebbcI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass())}}),O.of({name:"SQL",extensions:["sql"],load(){return Ks("StandardSQL")}}),O.of({name:"SQLite",load(){return Ks("SQLite")}}),O.of({name:"TSX",extensions:["tsx"],load(){return N(()=>import("./index-DMIwLDS8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),O.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return N(()=>import("./index-DMIwLDS8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),O.of({name:"WebAssembly",extensions:["wat","wast"],load(){return N(()=>import("./index-DKhTnUBU.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.wast())}}),O.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return N(()=>import("./index-B2_XRj3U.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.xml())}}),O.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return N(()=>import("./index-DDtPG6Km.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.yaml())}}),O.of({name:"APL",extensions:["dyalog","apl"],load(){return N(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(n=>V(n.apl))}}),O.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return N(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>V(n.asciiArmor))}}),O.of({name:"ASN.1",extensions:["asn","asn1"],load(){return N(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>V(n.asn1({})))}}),O.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return N(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>V(n.asterisk))}}),O.of({name:"Brainfuck",extensions:["b","bf"],load(){return N(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>V(n.brainfuck))}}),O.of({name:"Cobol",extensions:["cob","cpy"],load(){return N(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>V(n.cobol))}}),O.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.csharp))}}),O.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"ClojureScript",extensions:["cljs"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return N(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(n=>V(n.gss))}}),O.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return N(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>V(n.cmake))}}),O.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return N(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>V(n.coffeeScript))}}),O.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return N(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>V(n.commonLisp))}}),O.of({name:"Cypher",extensions:["cyp","cypher"],load(){return N(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>V(n.cypher))}}),O.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return N(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(n=>V(n.cython))}}),O.of({name:"Crystal",extensions:["cr"],load(){return N(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(n=>V(n.crystal))}}),O.of({name:"D",extensions:["d"],load(){return N(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(n=>V(n.d))}}),O.of({name:"Dart",extensions:["dart"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.dart))}}),O.of({name:"diff",extensions:["diff","patch"],load(){return N(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(n=>V(n.diff))}}),O.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return N(()=>import("./dockerfile-BKs6k2Af.js"),[],import.meta.url).then(n=>V(n.dockerFile))}}),O.of({name:"DTD",extensions:["dtd"],load(){return N(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>V(n.dtd))}}),O.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return N(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(n=>V(n.dylan))}}),O.of({name:"EBNF",load(){return N(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>V(n.ebnf))}}),O.of({name:"ECL",extensions:["ecl"],load(){return N(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(n=>V(n.ecl))}}),O.of({name:"edn",extensions:["edn"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"Eiffel",extensions:["e"],load(){return N(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>V(n.eiffel))}}),O.of({name:"Elm",extensions:["elm"],load(){return N(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(n=>V(n.elm))}}),O.of({name:"Erlang",extensions:["erl"],load(){return N(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>V(n.erlang))}}),O.of({name:"Esper",load(){return N(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>V(n.esper))}}),O.of({name:"Factor",extensions:["factor"],load(){return N(()=>import("./factor-kuTfRLto.js"),[],import.meta.url).then(n=>V(n.factor))}}),O.of({name:"FCL",load(){return N(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>V(n.fcl))}}),O.of({name:"Forth",extensions:["forth","fth","4th"],load(){return N(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(n=>V(n.forth))}}),O.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return N(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>V(n.fortran))}}),O.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.fSharp))}}),O.of({name:"Gas",extensions:["s"],load(){return N(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(n=>V(n.gas))}}),O.of({name:"Gherkin",extensions:["feature"],load(){return N(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>V(n.gherkin))}}),O.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return N(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>V(n.groovy))}}),O.of({name:"Haskell",extensions:["hs"],load(){return N(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>V(n.haskell))}}),O.of({name:"Haxe",extensions:["hx"],load(){return N(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>V(n.haxe))}}),O.of({name:"HXML",extensions:["hxml"],load(){return N(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>V(n.hxml))}}),O.of({name:"HTTP",load(){return N(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(n=>V(n.http))}}),O.of({name:"IDL",extensions:["pro"],load(){return N(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(n=>V(n.idl))}}),O.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return N(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>V(n.jsonld))}}),O.of({name:"Julia",extensions:["jl"],load(){return N(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(n=>V(n.julia))}}),O.of({name:"Kotlin",extensions:["kt","kts"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.kotlin))}}),O.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return N(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(n=>V(n.liveScript))}}),O.of({name:"Lua",extensions:["lua"],load(){return N(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(n=>V(n.lua))}}),O.of({name:"mIRC",extensions:["mrc"],load(){return N(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>V(n.mirc))}}),O.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return N(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>V(n.mathematica))}}),O.of({name:"Modelica",extensions:["mo"],load(){return N(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>V(n.modelica))}}),O.of({name:"MUMPS",extensions:["mps"],load(){return N(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(n=>V(n.mumps))}}),O.of({name:"Mbox",extensions:["mbox"],load(){return N(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>V(n.mbox))}}),O.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return N(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>V(n.nginx))}}),O.of({name:"NSIS",extensions:["nsh","nsi"],load(){return N(()=>import("./nsis-LdVXkNf5.js"),[],import.meta.url).then(n=>V(n.nsis))}}),O.of({name:"NTriples",extensions:["nt","nq"],load(){return N(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>V(n.ntriples))}}),O.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.objectiveC))}}),O.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.objectiveCpp))}}),O.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.oCaml))}}),O.of({name:"Octave",extensions:["m"],load(){return N(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>V(n.octave))}}),O.of({name:"Oz",extensions:["oz"],load(){return N(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(n=>V(n.oz))}}),O.of({name:"Pascal",extensions:["p","pas"],load(){return N(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(n=>V(n.pascal))}}),O.of({name:"Perl",extensions:["pl","pm"],load(){return N(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>V(n.perl))}}),O.of({name:"Pig",extensions:["pig"],load(){return N(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(n=>V(n.pig))}}),O.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return N(()=>import("./powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>V(n.powerShell))}}),O.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return N(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(n=>V(n.properties))}}),O.of({name:"ProtoBuf",extensions:["proto"],load(){return N(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(n=>V(n.protobuf))}}),O.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return N(()=>import("./pug-DeIclll2.js"),[],import.meta.url).then(n=>V(n.pug))}}),O.of({name:"Puppet",extensions:["pp"],load(){return N(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>V(n.puppet))}}),O.of({name:"Q",extensions:["q"],load(){return N(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(n=>V(n.q))}}),O.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return N(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>V(n.r))}}),O.of({name:"RPM Changes",load(){return N(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>V(n.rpmChanges))}}),O.of({name:"RPM Spec",extensions:["spec"],load(){return N(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>V(n.rpmSpec))}}),O.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return N(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(n=>V(n.ruby))}}),O.of({name:"SAS",extensions:["sas"],load(){return N(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(n=>V(n.sas))}}),O.of({name:"Scala",extensions:["scala"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.scala))}}),O.of({name:"Scheme",extensions:["scm","ss"],load(){return N(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(n=>V(n.scheme))}}),O.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return N(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>V(n.shell))}}),O.of({name:"Sieve",extensions:["siv","sieve"],load(){return N(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>V(n.sieve))}}),O.of({name:"Smalltalk",extensions:["st"],load(){return N(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>V(n.smalltalk))}}),O.of({name:"Solr",load(){return N(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(n=>V(n.solr))}}),O.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.sml))}}),O.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return N(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>V(n.sparql))}}),O.of({name:"Spreadsheet",alias:["excel","formula"],load(){return N(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>V(n.spreadsheet))}}),O.of({name:"Squirrel",extensions:["nut"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.squirrel))}}),O.of({name:"Stylus",extensions:["styl"],load(){return N(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(n=>V(n.stylus))}}),O.of({name:"Swift",extensions:["swift"],load(){return N(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(n=>V(n.swift))}}),O.of({name:"sTeX",load(){return N(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>V(n.stex))}}),O.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return N(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>V(n.stex))}}),O.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return N(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>V(n.verilog))}}),O.of({name:"Tcl",extensions:["tcl"],load(){return N(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>V(n.tcl))}}),O.of({name:"Textile",extensions:["textile"],load(){return N(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(n=>V(n.textile))}}),O.of({name:"TiddlyWiki",load(){return N(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>V(n.tiddlyWiki))}}),O.of({name:"Tiki wiki",load(){return N(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(n=>V(n.tiki))}}),O.of({name:"TOML",extensions:["toml"],load(){return N(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>V(n.toml))}}),O.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return N(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(n=>V(n.troff))}}),O.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return N(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>V(n.ttcn))}}),O.of({name:"TTCN_CFG",extensions:["cfg"],load(){return N(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>V(n.ttcnCfg))}}),O.of({name:"Turtle",extensions:["ttl"],load(){return N(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>V(n.turtle))}}),O.of({name:"Web IDL",extensions:["webidl"],load(){return N(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>V(n.webIDL))}}),O.of({name:"VB.NET",extensions:["vb"],load(){return N(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(n=>V(n.vb))}}),O.of({name:"VBScript",extensions:["vbs"],load(){return N(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>V(n.vbScript))}}),O.of({name:"Velocity",extensions:["vtl"],load(){return N(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(n=>V(n.velocity))}}),O.of({name:"Verilog",extensions:["v"],load(){return N(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>V(n.verilog))}}),O.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return N(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>V(n.vhdl))}}),O.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return N(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(n=>V(n.xQuery))}}),O.of({name:"Yacas",extensions:["ys"],load(){return N(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>V(n.yacas))}}),O.of({name:"Z80",extensions:["z80"],load(){return N(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>V(n.z80))}}),O.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.mscgen))}}),O.of({name:"Xù",extensions:["xu"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.xu))}}),O.of({name:"MsGenny",extensions:["msgenny"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.msgenny))}}),O.of({name:"Vue",extensions:["vue"],load(){return N(()=>import("./index-CPDfMZkS.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.vue())}}),O.of({name:"Angular Template",load(){return N(()=>import("./index-CU4ySaQE.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.angular())}})],TH="#e5c07b",Y2="#e06c75",AH="#56b6c2",_H="#ffffff",gm="#abb2bf",ew="#7d8799",EH="#61afef",OH="#98c379",X2="#d19a66",IH="#c678dd",DH="#21252b",Z2="#2c313a",Q2="#282c34",Z1="#353a42",NH="#3E4451",eM="#528bff",RH=ne.theme({"&":{color:gm,backgroundColor:Q2},".cm-content":{caretColor:eM},".cm-cursor, .cm-dropCursor":{borderLeftColor:eM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:NH},".cm-panels":{backgroundColor:DH,color:gm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Q2,color:ew,border:"none"},".cm-activeLineGutter":{backgroundColor:Z2},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Z1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Z1,borderBottomColor:Z1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Z2,color:gm}}},{dark:!0}),LH=Ad.define([{tag:P.keyword,color:IH},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:Y2},{tag:[P.function(P.variableName),P.labelName],color:EH},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:X2},{tag:[P.definition(P.name),P.separator],color:gm},{tag:[P.typeName,P.className,P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:TH},{tag:[P.operator,P.operatorKeyword,P.url,P.escape,P.regexp,P.link,P.special(P.string)],color:AH},{tag:[P.meta,P.comment],color:ew},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.link,color:ew,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:Y2},{tag:[P.atom,P.bool,P.special(P.variableName)],color:X2},{tag:[P.processingInstruction,P.string,P.inserted],color:OH},{tag:P.invalid,color:_H}]),PH=[RH,P5(LH)];function _d(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-block",...e}}),n}const BH=n=>!$r(t=>t.type.name==="table")(n),b0=ot({filterNodes:BH},"blockConfig");_d(b0,{displayName:"Ctx<blockConfig>"});function FH(n,e,t){var r;if(!n.dom.parentElement)return null;try{const s=(r=n.posAtCoords({left:e.x,top:e.y}))==null?void 0:r.inside;if(s==null||s<0)return null;let o=n.state.doc.resolve(s),l=n.state.doc.nodeAt(s),a=n.nodeDOM(s);const c=h=>{const f=o.depth>=1&&o.index(o.depth)===0;if(!(h||f))return;const p=o.before(o.depth);l=n.state.doc.nodeAt(p),a=n.nodeDOM(p),o=n.state.doc.resolve(p),t(o,l)||c(!0)},u=t(o,l);return c(!u),!a||!l?null:{node:l,$pos:o,el:a}}catch{return null}}const tM=ip.ie&&ip.ie_version<15||ip.ios&&ip.webkit_version<604,nM=20;var hc,Xf,El,Gi,fc,Ji,Xi,U5,sl,Ol,Il,Zf,dc,pc,mc,gc,Qf,yo;class HH{constructor(){G(this,Xi);G(this,hc);G(this,Xf);G(this,El);G(this,Gi);G(this,fc);G(this,Ji);G(this,Ol);G(this,Il);G(this,Zf);G(this,dc);G(this,pc);G(this,mc);G(this,gc);G(this,Qf);G(this,yo);R(this,Xf,()=>{if(!C(this,Gi))return null;const e=C(this,Gi),t=C(this,Xi,sl);if(t&&we.isSelectable(e.node)){const i=we.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(i)),t.focus(),R(this,El,i),i}return null}),R(this,El,null),R(this,Gi,null),R(this,fc,void 0),R(this,Ji,!1),R(this,Il,()=>{var e;(e=C(this,Ol))==null||e.call(this,{type:"hide"}),R(this,Gi,null)}),R(this,Zf,e=>{var t;R(this,Gi,e),(t=C(this,Ol))==null||t.call(this,{type:"show",active:e})}),this.bind=(e,t)=>{R(this,hc,e),R(this,Ol,t)},this.addEvent=e=>{e.addEventListener("mousedown",C(this,dc)),e.addEventListener("mouseup",C(this,pc)),e.addEventListener("dragstart",C(this,mc)),e.addEventListener("dragend",C(this,gc))},this.removeEvent=e=>{e.removeEventListener("mousedown",C(this,dc)),e.removeEventListener("mouseup",C(this,pc)),e.removeEventListener("dragstart",C(this,mc)),e.removeEventListener("dragend",C(this,gc))},this.unBind=()=>{R(this,Ol,void 0)},R(this,dc,()=>{var e;R(this,fc,(e=C(this,Gi))==null?void 0:e.el.getBoundingClientRect()),C(this,Xf).call(this)}),R(this,pc,()=>{if(!C(this,Ji)){requestAnimationFrame(()=>{var e;C(this,fc)&&((e=C(this,Xi,sl))==null||e.focus())});return}R(this,Ji,!1),R(this,El,null)}),R(this,mc,e=>{var r;R(this,Ji,!0);const t=C(this,Xi,sl);if(!t)return;t.dom.dataset.dragging="true";const i=C(this,El);if(e.dataTransfer&&i){const s=i.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:l}=t.serializeForClipboard(s);e.dataTransfer.clearData(),e.dataTransfer.setData(tM?"Text":"text/html",o.innerHTML),tM||e.dataTransfer.setData("text/plain",l);const a=(r=C(this,Gi))==null?void 0:r.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:s,move:!0}}}),R(this,gc,()=>{C(this,Xi,sl)&&C(this,yo).call(this,C(this,Xi,sl))}),this.keydownCallback=e=>(C(this,Il).call(this),R(this,Ji,!1),e.dom.dataset.dragging="false",!1),R(this,Qf,Kg((e,t)=>{if(!e.editable)return;const i=e.dom.getBoundingClientRect(),r=i.left+i.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){C(this,Il).call(this);return}const o=C(this,Xi,U5);if(!o)return;const l=FH(e,{x:r,y:t.clientY},o);if(!l){C(this,Il).call(this);return}C(this,Zf).call(this,l)},200)),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||C(this,Qf).call(this,e,t),!1),this.dragoverCallback=(e,t)=>{var i;if(C(this,Ji)){const r=(i=C(this,Xi,sl))==null?void 0:i.dom.parentElement;if(!r)return!1;const s=r.scrollHeight>r.clientHeight,o=r.getBoundingClientRect();if(s){if(r.scrollTop>0&&Math.abs(t.y-o.y)<nM){const c=r.scrollTop>10?r.scrollTop-10:0;return r.scrollTop=c,!1}const l=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(r.scrollTop+o.height)<l&&Math.abs(t.y-(o.height+o.y))<nM){const c=r.scrollTop+10;return r.scrollTop=c,!1}}}return!1},this.dragenterCallback=e=>{e.dragging&&(R(this,Ji,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const i=t.clientX,r=t.clientY;(i<0||r<0||i>window.innerWidth||r>window.innerHeight)&&(R(this,Gi,null),C(this,yo).call(this,e))},this.dropCallback=e=>(C(this,yo).call(this,e),!1),this.dragendCallback=e=>{C(this,yo).call(this,e)},R(this,yo,e=>{R(this,Ji,!1),e.dom.dataset.dragging="false"})}}hc=new WeakMap,Xf=new WeakMap,El=new WeakMap,Gi=new WeakMap,fc=new WeakMap,Ji=new WeakMap,Xi=new WeakSet,U5=function(){var e;try{return(e=C(this,hc))==null?void 0:e.get(b0.key).filterNodes}catch{return}},sl=function(){var e;return(e=C(this,hc))==null?void 0:e.get(rt)},Ol=new WeakMap,Il=new WeakMap,Zf=new WeakMap,dc=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,Qf=new WeakMap,yo=new WeakMap;const Qk=ot(()=>new HH,"blockService"),w0=ot({},"blockServiceInstance");_d(Qk,{displayName:"Ctx<blockService>"});_d(w0,{displayName:"Ctx<blockServiceInstance>"});const k0=ot({},"blockSpec");_d(k0,{displayName:"Ctx<blockSpec>"});const ev=$t(n=>{const e=new xt("MILKDOWN_BLOCK"),i=n.get(Qk.key)();n.set(w0.key,i);const r=n.get(k0.key);return new vt({key:e,...r,props:{...r.props,handleDOMEvents:{drop:s=>i.dropCallback(s),pointermove:(s,o)=>i.mousemoveCallback(s,o),keydown:s=>i.keydownCallback(s),dragover:(s,o)=>i.dragoverCallback(s,o),dragleave:(s,o)=>i.dragleaveCallback(s,o),dragenter:s=>i.dragenterCallback(s),dragend:s=>i.dragendCallback(s)}}})});_d(ev,{displayName:"Prose<block>"});var zn,Ss,Dl,Nl,ed,yc,td,nd,bc,wc,kc,qg,K5;class $H{constructor(e){G(this,qg);G(this,zn);G(this,Ss);G(this,Dl);G(this,Nl);G(this,ed);G(this,yc);G(this,td);G(this,nd);G(this,bc);G(this,wc);G(this,kc);R(this,Nl,null),R(this,yc,!1),this.update=()=>{requestAnimationFrame(()=>{if(!C(this,yc))try{Qd(this,qg,K5).call(this),R(this,yc,!0)}catch{}})},this.destroy=()=>{var t,i;(t=C(this,Dl))==null||t.unBind(),(i=C(this,Dl))==null||i.removeEvent(C(this,zn)),C(this,zn).remove()},this.show=t=>{const i=t.el,r=C(this,Ss).get(rt).dom,s={ctx:C(this,Ss),active:t,editorDom:r,blockDom:C(this,zn)},o={contextElement:i,getBoundingClientRect:()=>C(this,wc)?C(this,wc).call(this,s):i.getBoundingClientRect()},l=[Uw()];if(C(this,bc)){const a=C(this,bc).call(this,s),c=Jl(a);l.push(c)}zr(o,C(this,zn),{placement:C(this,kc)?C(this,kc).call(this,s):"left",middleware:[...l,...C(this,td)],...C(this,nd)}).then(({x:a,y:c})=>{Object.assign(C(this,zn).style,{left:`${a}px`,top:`${c}px`}),C(this,zn).dataset.show="true"}).catch(console.error)},this.hide=()=>{C(this,zn).dataset.show="false"},R(this,Ss,e.ctx),R(this,zn,e.content),R(this,bc,e.getOffset),R(this,wc,e.getPosition),R(this,kc,e.getPlacement),R(this,td,e.middleware??[]),R(this,nd,e.floatingUIOptions??{}),R(this,ed,e.root),this.hide()}get active(){return C(this,Nl)}}zn=new WeakMap,Ss=new WeakMap,Dl=new WeakMap,Nl=new WeakMap,ed=new WeakMap,yc=new WeakMap,td=new WeakMap,nd=new WeakMap,bc=new WeakMap,wc=new WeakMap,kc=new WeakMap,qg=new WeakSet,K5=function(){const e=C(this,Ss).get(rt);(C(this,ed)??e.dom.parentElement??document.body).appendChild(C(this,zn));const i=C(this,Ss).get(w0.key);i.bind(C(this,Ss),r=>{r.type==="hide"?(this.hide(),R(this,Nl,null)):r.type==="show"&&(this.show(r.active),R(this,Nl,r.active))}),R(this,Dl,i),C(this,Dl).addEvent(C(this,zn)),C(this,zn).draggable=!0};const v0=[k0,b0,Qk,w0,ev];v0.key=k0.key;v0.pluginKey=ev.key;function VH(n,e){return function(t,i){let{$from:r,$to:s,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(s))return!1;let l=r.node(-1);if(l.type!=n)return!1;if(r.parent.content.size==0&&r.node(-1).childCount==r.indexAfter(-1)){if(r.depth==3||r.node(-3).type!=n||r.index(-2)!=r.node(-2).childCount-1)return!1;if(i){let h=X.empty,f=r.index(-1)?1:r.index(-2)?2:3;for(let y=r.depth-f;y>=r.depth-3;y--)h=X.from(r.node(y).copy(h));let d=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;h=h.append(X.from(n.createAndFill()));let p=r.before(r.depth-(f-1)),m=t.tr.replace(p,r.after(-d),new ee(h,4-f,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(y,b)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=b+1)}),g>-1&&m.setSelection(De.near(m.doc.resolve(g))),i(m.scrollIntoView())}return!0}let a=s.pos==r.end()?l.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,s.pos),u=a?[null,{type:a}]:void 0;return Ah(c.doc,r.pos,2,u)?(i&&i(c.split(r.pos,2,u).scrollIntoView()),!0):!1}}function zH(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?WH(e,t,n,s):qH(e,t,s):!0:!1}}function WH(n,e,t,i){let r=n.tr,s=i.end,o=i.$to.end(i.depth);s<o&&(r.step(new bn(s-1,o,s,o,new ee(X.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new $A(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=Qg(i);if(l==null)return!1;r.lift(i,l);let a=r.doc.resolve(r.mapping.map(s,-1)-1);return e0(r.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&r.join(a.pos),e(r.scrollIntoView()),!0}function qH(n,e,t){let i=n.tr,r=t.parent;for(let d=t.end,p=t.endIndex-1,m=t.startIndex;p>m;p--)d-=r.child(p).nodeSize,i.delete(d-1,d+1);let s=i.doc.resolve(t.start),o=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==r.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?X.empty:X.from(r))))return!1;let h=s.pos,f=h+o.nodeSize;return i.step(new bn(h-(l?1:0),f+(a?1:0),h+1,f-1,new ee((l?X.empty:X.from(r.copy(X.empty))).append(a?X.empty:X.from(r.copy(X.empty))),l?0:1,a?0:1),l?0:1)),e(i.scrollIntoView()),!0}function jH(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=X.from(c?n.create():null),h=new ee(X.from(n.create(null,X.from(l.type.create(null,u)))),c?3:1,0),f=s.start,d=s.end;t(e.tr.step(new bn(f-(c?3:1),d,f,d,h,1,!0)).scrollIntoView())}return!0}}function UH(n){const e=new Map;if(!n||!n.type)throw new Error("mdast-util-definitions expected node");return Ho(n,"definition",function(i){const r=iM(i.identifier);r&&!e.get(r)&&e.set(r,i)}),t;function t(i){const r=iM(i);return e.get(r)}}function iM(n){return String(n||"").toUpperCase()}function KH(){return function(n){const e=UH(n);Ho(n,function(t,i,r){if(t.type==="definition"&&r!==void 0&&typeof i=="number")return r.children.splice(i,1),[Wy,i];if(t.type==="imageReference"||t.type==="linkReference"){const s=e(t.identifier);if(s&&r&&typeof i=="number")return r.children[i]=t.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:t.alt}:{type:"link",url:s.url,title:s.title,children:t.children},[Wy,i]}})}}function G5(n,e){var r;if(!(e.childCount>=1&&((r=e.lastChild)==null?void 0:r.type.name)==="hardbreak")){n.next(e.content);return}const i=[];e.content.forEach((s,o,l)=>{l!==e.childCount-1&&i.push(s)}),n.next(X.fromArray(i))}function F(n,e){return Object.assign(n,{meta:{package:"@milkdown/preset-commonmark",...e}}),n}const tv=vd("emphasis");F(tv,{displayName:"Attr<emphasis>",group:"Emphasis"});const aa=Jc("emphasis",n=>({attrs:{marker:{default:n.get(Oh).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",n.get(tv.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));F(aa.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});F(aa.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const x0=Ie("ToggleEmphasis",n=>()=>i0(aa.type(n)));F(x0,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const J5=Cn(n=>yd(/(?:^|[^*])\*([^*]+)\*$/,aa.type(n),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));F(J5,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const Y5=Cn(n=>yd(/\b_(?![_\s])(.*?[^_\s])_\b/,aa.type(n),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));F(Y5,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const nv=ei("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:n=>{const e=n.get(ce);return()=>e.call(x0.key)}}});F(nv.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});F(nv.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const iv=vd("strong");F(iv,{displayName:"Attr<strong>",group:"Strong"});const Zc=Jc("strong",n=>({attrs:{marker:{default:n.get(Oh).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",n.get(iv.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));F(Zc.mark,{displayName:"MarkSchema<strong>",group:"Strong"});F(Zc.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const C0=Ie("ToggleStrong",n=>()=>i0(Zc.type(n)));F(C0,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const X5=Cn(n=>yd(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Zc.type(n),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));F(X5,{displayName:"InputRule<strong>",group:"Strong"});const rv=ei("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:n=>{const e=n.get(ce);return()=>e.call(C0.key)}}});F(rv.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});F(rv.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const sv=vd("inlineCode");F(sv,{displayName:"Attr<inlineCode>",group:"InlineCode"});const Es=Jc("inlineCode",n=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:e=>["code",n.get(sv.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,t,i)=>{e.openMark(i),e.addText(t.value),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,t,i)=>{e.withMark(t,"inlineCode",i.text||"")}}}));F(Es.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});F(Es.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const S0=Ie("ToggleInlineCode",n=>()=>(e,t)=>{const{selection:i,tr:r}=e;if(i.empty)return!1;const{from:s,to:o}=i;return e.doc.rangeHasMark(s,o,Es.type(n))?(t==null||t(r.removeMark(s,o,Es.type(n))),!0):(Object.keys(e.schema.marks).filter(c=>c!==Es.type.name).map(c=>e.schema.marks[c]).forEach(c=>{r.removeMark(s,o,c)}),t==null||t(r.addMark(s,o,Es.type(n).create())),!0)});F(S0,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const Z5=Cn(n=>yd(/(?:`)([^`]+)(?:`)$/,Es.type(n)));F(Z5,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const ov=ei("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:n=>{const e=n.get(ce);return()=>e.call(S0.key)}}});F(ov.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});F(ov.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const lv=vd("link");F(lv,{displayName:"Attr<link>",group:"Link"});const ir=Jc("link",n=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...n.get(lv.key)(e),...e.attrs}],parseMarkdown:{match:e=>e.type==="link",runner:(e,t,i)=>{const r=t.url,s=t.title;e.openMark(i,{href:r,title:s}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));F(ir.mark,{displayName:"MarkSchema<link>",group:"Link"});const Q5=Ie("ToggleLink",n=>(e={})=>i0(ir.type(n),e));F(Q5,{displayName:"Command<toggleLinkCommand>",group:"Link"});const eI=Ie("UpdateLink",n=>(e={})=>(t,i)=>{if(!i)return!1;let r,s=-1;const{selection:o}=t,{from:l,to:a}=o;if(t.doc.nodesBetween(l,l===a?a+1:a,(p,m)=>{if(ir.type(n).isInSet(p.marks))return r=p,s=m,!1}),!r)return!1;const c=r.marks.find(({type:p})=>p===ir.type(n));if(!c)return!1;const u=s,h=s+r.nodeSize,{tr:f}=t,d=ir.type(n).create({...c.attrs,...e});return d?(i(f.removeMark(u,h,c).addMark(u,h,d).setSelection(new de(f.selection.$anchor)).scrollIntoView()),!0):!1});F(eI,{displayName:"Command<updateLinkCommand>",group:"Link"});const tI=Sk("doc",()=>({content:"block+",parseMarkdown:{match:({type:n})=>n==="root",runner:(n,e,t)=>{n.injectRoot(e,t)}},toMarkdown:{match:n=>n.type.name==="doc",runner:(n,e)=>{n.openNode("root"),n.next(e.content)}}}));F(tI,{displayName:"NodeSchema<doc>",group:"Doc"});function GH(n){return Zw(n,e=>{var t;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((t=e.value)==null?void 0:t.trim())},(e,t)=>{if(!t.length)return;const i=t[t.length-1];if(!i)return;const r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)},!0)}const M0=hr("remark-preserve-empty-line",()=>()=>GH);F(M0.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});F(M0.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const av=ur("paragraph");F(av,{displayName:"Attr<paragraph>",group:"Paragraph"});const dr=At("paragraph",n=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",n.get(av.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,t,i)=>{e.openNode(i),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,t)=>{var s;const r=(s=n.get(rt).state)==null?void 0:s.doc.lastChild;e.openNode("paragraph"),(!t.content||t.content.size===0)&&t!==r&&JH(n)?e.addNode("html",void 0,"<br />"):G5(e,t),e.closeNode()}}}));function JH(n){let e=!1;try{n.get(M0.id),e=!0}catch{e=!1}return e}F(dr.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});F(dr.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const cv=Ie("TurnIntoText",n=>()=>rf(dr.type(n)));F(cv,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const uv=ei("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:n=>{const e=n.get(ce);return()=>e.call(cv.key)}}});F(uv.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});F(uv.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const YH=Array(6).fill(0).map((n,e)=>e+1);function XH(n){return n.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const T0=ot(XH,"headingIdGenerator");F(T0,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const hv=ur("heading");F(hv,{displayName:"Attr<heading>",group:"Heading"});const ui=At("heading",n=>{const e=n.get(T0.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:YH.map(t=>({tag:`h${t}`,getAttrs:i=>{if(!(i instanceof HTMLElement))throw cr(i);return{level:t,id:i.id}}})),toDOM:t=>[`h${t.attrs.level}`,{...n.get(hv.key)(t),id:t.attrs.id||e(t)},0],parseMarkdown:{match:({type:t})=>t==="heading",runner:(t,i,r)=>{const s=i.depth;t.openNode(r,{level:s}),t.next(i.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="heading",runner:(t,i)=>{t.openNode("heading",void 0,{depth:i.attrs.level}),G5(t,i),t.closeNode()}}}});F(ui.node,{displayName:"NodeSchema<heading>",group:"Heading"});F(ui.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const nI=Cn(n=>fk(/^(?<hashes>#+)\s$/,ui.type(n),e=>{var o,l;const t=((l=(o=e.groups)==null?void 0:o.hashes)==null?void 0:l.length)||0,i=n.get(rt),{$from:r}=i.state.selection,s=r.node();if(s.type.name==="heading"){let a=Number(s.attrs.level)+Number(t);return a>6&&(a=6),{level:a}}return{level:t}}));F(nI,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const ro=Ie("WrapInHeading",n=>e=>(e??(e=1),e<1?rf(dr.type(n)):rf(ui.type(n),{level:e})));F(ro,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const fv=Ie("DowngradeHeading",n=>()=>(e,t,i)=>{const{$from:r}=e.selection,s=r.node();if(s.type!==ui.type(n)||!e.selection.empty||r.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(t==null||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):rf(dr.type(n))(e,t,i)});F(fv,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const dv=ei("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:n=>{const e=n.get(ce);return()=>e.call(fv.key)}}});F(dv.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});F(dv.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const pv=ur("blockquote");F(pv,{displayName:"Attr<blockquote>",group:"Blockquote"});const Qc=At("blockquote",n=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",n.get(pv.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,t,i)=>{e.openNode(i).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));F(Qc.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});F(Qc.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const iI=Cn(n=>hk(/^\s*>\s$/,Qc.type(n)));F(iI,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const mv=Ie("WrapInBlockquote",n=>()=>uk(Qc.type(n)));F(mv,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const gv=ei("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:n=>{const e=n.get(ce);return()=>e.call(mv.key)}}});F(gv.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});F(gv.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const yv=ur("codeBlock",()=>({pre:{},code:{}}));F(yv,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const Ur=At("code_block",n=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{language:e.dataset.language}}}],toDOM:e=>{const t=n.get(yv.key)(e),i=e.attrs.language,r=i&&i.length>0?{"data-language":i}:void 0;return["pre",{...t.pre,...r},["code",t.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,t,i)=>{const r=t.lang??"",s=t.value;e.openNode(i,{language:r}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,t)=>{var i;e.addNode("code",void 0,((i=t.content.firstChild)==null?void 0:i.text)||"",{lang:t.attrs.language})}}}));F(Ur.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});F(Ur.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const rI=Cn(n=>fk(/^```(?<language>[a-z]*)?[\s\n]$/,Ur.type(n),e=>{var t;return{language:((t=e.groups)==null?void 0:t.language)??""}}));F(rI,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const bv=Ie("CreateCodeBlock",n=>(e="")=>rf(Ur.type(n),{language:e}));F(bv,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});const ZH=Ie("UpdateCodeBlockLanguage",()=>({pos:n,language:e}={pos:-1,language:""})=>(t,i)=>n>=0?(i==null||i(t.tr.setNodeAttribute(n,"language",e)),!0):!1);F(ZH,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const wv=ei("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:n=>{const e=n.get(ce);return()=>e.call(bv.key)}}});F(wv.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});F(wv.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const kv=ur("image");F(kv,{displayName:"Attr<image>",group:"Image"});const ca=At("image",n=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...n.get(kv.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,t,i)=>{const r=t.url,s=t.alt,o=t.title;e.addNode(i,{src:r,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));F(ca.node,{displayName:"NodeSchema<image>",group:"Image"});F(ca.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const sI=Ie("InsertImage",n=>(e={})=>(t,i)=>{if(!i)return!0;const{src:r="",alt:s="",title:o=""}=e,l=ca.type(n).create({src:r,alt:s,title:o});return l&&i(t.tr.replaceSelectionWith(l).scrollIntoView()),!0});F(sI,{displayName:"Command<insertImageCommand>",group:"Image"});const oI=Ie("UpdateImage",n=>(e={})=>(t,i)=>{const r=Y4(t.selection,ca.type(n));if(!r)return!1;const{node:s,pos:o}=r,l={...s.attrs},{src:a,alt:c,title:u}=e;return a!==void 0&&(l.src=a),c!==void 0&&(l.alt=c),u!==void 0&&(l.title=u),i==null||i(t.tr.setNodeMarkup(o,void 0,l).scrollIntoView()),!0});F(oI,{displayName:"Command<updateImageCommand>",group:"Image"});const QH=Cn(n=>new Qn(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,t,i,r)=>{const[s,o,l="",a]=t;return s?e.tr.replaceWith(i,r,ca.type(n).create({src:l,alt:o,title:a})):null}));F(QH,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const wg=ur("hardbreak",n=>({"data-type":"hardbreak","data-is-inline":n.attrs.isInline}));F(wg,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const zl=At("hardbreak",n=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",n.get(wg.key)(e)," "]:["br",n.get(wg.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,t,i)=>{var r;e.addNode(i,{isInline:!!((r=t.data)!=null&&r.isInline)})}},leafText:()=>`
|
|
55
|
+
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new $5(t,e?e.state.tabSize:4,e?ia(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=z5(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=dt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:xH,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new dt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new dt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function z5(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let r=n(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const Zk=Object.create(null),Tf=[Ln.none],xH=new Mk(Tf),G2=[],J2=Object.create(null),W5=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])W5[n]=j5(Zk,e);class q5{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),W5)}resolve(e){return e?this.table[e]||(this.table[e]=j5(this.extra,e)):0}}const CH=new q5(Zk);function X1(n,e){G2.indexOf(n)>-1||(G2.push(n),console.warn(e))}function j5(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=n[c]||P[c];u?typeof u=="function"?a.length?a=a.map(u):X1(c,`Modifier ${c} used at start of tag`):a.length?X1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:X1(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(l=>l.id),s=J2[r];if(s)return s.id;let o=J2[r]=Ln.define({id:Tf.length,name:i,props:[TF({[i]:t})]});return Tf.push(o),o.id}function SH(n,e){let t=Ln.define({id:Tf.length,name:"Document",props:[wl.add(()=>n),M5.add(()=>i=>e.getIndent(i))],top:!0});return Tf.push(t),t}pt.RTL,pt.LTR;function V(n){return new RF(Yk.define(n))}function Ks(n){return N(()=>import("./index-Bq8mPedC.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const MH=[O.of({name:"C",extensions:["c","h","ino"],load(){return N(()=>import("./index-BaCHOxhI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),O.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return N(()=>import("./index-BaCHOxhI.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.cpp())}}),O.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ks("Cassandra")}}),O.of({name:"CSS",extensions:["css"],load(){return N(()=>import("./index-Dz8sghkK.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.css())}}),O.of({name:"Go",extensions:["go"],load(){return N(()=>import("./index-DI0OV6F8.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.go())}}),O.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return N(()=>import("./index-DIiIUyb-.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.html())}}),O.of({name:"Java",extensions:["java"],load(){return N(()=>import("./index-D4pIkh3S.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.java())}}),O.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return N(()=>import("./index-DH12_HTj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript())}}),O.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return N(()=>import("./index-DqMndQiP.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.jinja())}}),O.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return N(()=>import("./index-D7b5fX1d.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.json())}}),O.of({name:"JSX",extensions:["jsx"],load(){return N(()=>import("./index-DH12_HTj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),O.of({name:"LESS",extensions:["less"],load(){return N(()=>import("./index-TkfyNewx.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.less())}}),O.of({name:"Liquid",extensions:["liquid"],load(){return N(()=>import("./index-BPR_DyGD.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.liquid())}}),O.of({name:"MariaDB SQL",load(){return Ks("MariaSQL")}}),O.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return N(()=>import("./index-BwSnJN93.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.markdown())}}),O.of({name:"MS SQL",load(){return Ks("MSSQL")}}),O.of({name:"MySQL",load(){return Ks("MySQL")}}),O.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return N(()=>import("./index-3eqA7Bag.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.php())}}),O.of({name:"PLSQL",extensions:["pls"],load(){return Ks("PLSQL")}}),O.of({name:"PostgreSQL",load(){return Ks("PostgreSQL")}}),O.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return N(()=>import("./index-eZfwJ9bV.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.python())}}),O.of({name:"Rust",extensions:["rs"],load(){return N(()=>import("./index-DllL1sx1.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.rust())}}),O.of({name:"Sass",extensions:["sass"],load(){return N(()=>import("./index-QkP3EC02.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass({indented:!0}))}}),O.of({name:"SCSS",extensions:["scss"],load(){return N(()=>import("./index-QkP3EC02.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.sass())}}),O.of({name:"SQL",extensions:["sql"],load(){return Ks("StandardSQL")}}),O.of({name:"SQLite",load(){return Ks("SQLite")}}),O.of({name:"TSX",extensions:["tsx"],load(){return N(()=>import("./index-DH12_HTj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),O.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return N(()=>import("./index-DH12_HTj.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),O.of({name:"WebAssembly",extensions:["wat","wast"],load(){return N(()=>import("./index-Bti3m-iW.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.wast())}}),O.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return N(()=>import("./index-B7V7-Vxz.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.xml())}}),O.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return N(()=>import("./index-CmyOpFTN.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.yaml())}}),O.of({name:"APL",extensions:["dyalog","apl"],load(){return N(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(n=>V(n.apl))}}),O.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return N(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>V(n.asciiArmor))}}),O.of({name:"ASN.1",extensions:["asn","asn1"],load(){return N(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>V(n.asn1({})))}}),O.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return N(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>V(n.asterisk))}}),O.of({name:"Brainfuck",extensions:["b","bf"],load(){return N(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>V(n.brainfuck))}}),O.of({name:"Cobol",extensions:["cob","cpy"],load(){return N(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>V(n.cobol))}}),O.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.csharp))}}),O.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"ClojureScript",extensions:["cljs"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return N(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(n=>V(n.gss))}}),O.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return N(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>V(n.cmake))}}),O.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return N(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>V(n.coffeeScript))}}),O.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return N(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>V(n.commonLisp))}}),O.of({name:"Cypher",extensions:["cyp","cypher"],load(){return N(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>V(n.cypher))}}),O.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return N(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(n=>V(n.cython))}}),O.of({name:"Crystal",extensions:["cr"],load(){return N(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(n=>V(n.crystal))}}),O.of({name:"D",extensions:["d"],load(){return N(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(n=>V(n.d))}}),O.of({name:"Dart",extensions:["dart"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.dart))}}),O.of({name:"diff",extensions:["diff","patch"],load(){return N(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(n=>V(n.diff))}}),O.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return N(()=>import("./dockerfile-BKs6k2Af.js"),[],import.meta.url).then(n=>V(n.dockerFile))}}),O.of({name:"DTD",extensions:["dtd"],load(){return N(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>V(n.dtd))}}),O.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return N(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(n=>V(n.dylan))}}),O.of({name:"EBNF",load(){return N(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>V(n.ebnf))}}),O.of({name:"ECL",extensions:["ecl"],load(){return N(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(n=>V(n.ecl))}}),O.of({name:"edn",extensions:["edn"],load(){return N(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>V(n.clojure))}}),O.of({name:"Eiffel",extensions:["e"],load(){return N(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>V(n.eiffel))}}),O.of({name:"Elm",extensions:["elm"],load(){return N(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(n=>V(n.elm))}}),O.of({name:"Erlang",extensions:["erl"],load(){return N(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>V(n.erlang))}}),O.of({name:"Esper",load(){return N(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(n=>V(n.esper))}}),O.of({name:"Factor",extensions:["factor"],load(){return N(()=>import("./factor-kuTfRLto.js"),[],import.meta.url).then(n=>V(n.factor))}}),O.of({name:"FCL",load(){return N(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>V(n.fcl))}}),O.of({name:"Forth",extensions:["forth","fth","4th"],load(){return N(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(n=>V(n.forth))}}),O.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return N(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>V(n.fortran))}}),O.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.fSharp))}}),O.of({name:"Gas",extensions:["s"],load(){return N(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(n=>V(n.gas))}}),O.of({name:"Gherkin",extensions:["feature"],load(){return N(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>V(n.gherkin))}}),O.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return N(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>V(n.groovy))}}),O.of({name:"Haskell",extensions:["hs"],load(){return N(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>V(n.haskell))}}),O.of({name:"Haxe",extensions:["hx"],load(){return N(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>V(n.haxe))}}),O.of({name:"HXML",extensions:["hxml"],load(){return N(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>V(n.hxml))}}),O.of({name:"HTTP",load(){return N(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(n=>V(n.http))}}),O.of({name:"IDL",extensions:["pro"],load(){return N(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(n=>V(n.idl))}}),O.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return N(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>V(n.jsonld))}}),O.of({name:"Julia",extensions:["jl"],load(){return N(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(n=>V(n.julia))}}),O.of({name:"Kotlin",extensions:["kt","kts"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.kotlin))}}),O.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return N(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(n=>V(n.liveScript))}}),O.of({name:"Lua",extensions:["lua"],load(){return N(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(n=>V(n.lua))}}),O.of({name:"mIRC",extensions:["mrc"],load(){return N(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>V(n.mirc))}}),O.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return N(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>V(n.mathematica))}}),O.of({name:"Modelica",extensions:["mo"],load(){return N(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>V(n.modelica))}}),O.of({name:"MUMPS",extensions:["mps"],load(){return N(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(n=>V(n.mumps))}}),O.of({name:"Mbox",extensions:["mbox"],load(){return N(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>V(n.mbox))}}),O.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return N(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>V(n.nginx))}}),O.of({name:"NSIS",extensions:["nsh","nsi"],load(){return N(()=>import("./nsis-LdVXkNf5.js"),[],import.meta.url).then(n=>V(n.nsis))}}),O.of({name:"NTriples",extensions:["nt","nq"],load(){return N(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>V(n.ntriples))}}),O.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.objectiveC))}}),O.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.objectiveCpp))}}),O.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.oCaml))}}),O.of({name:"Octave",extensions:["m"],load(){return N(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>V(n.octave))}}),O.of({name:"Oz",extensions:["oz"],load(){return N(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(n=>V(n.oz))}}),O.of({name:"Pascal",extensions:["p","pas"],load(){return N(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(n=>V(n.pascal))}}),O.of({name:"Perl",extensions:["pl","pm"],load(){return N(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>V(n.perl))}}),O.of({name:"Pig",extensions:["pig"],load(){return N(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(n=>V(n.pig))}}),O.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return N(()=>import("./powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>V(n.powerShell))}}),O.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return N(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(n=>V(n.properties))}}),O.of({name:"ProtoBuf",extensions:["proto"],load(){return N(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(n=>V(n.protobuf))}}),O.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return N(()=>import("./pug-DeIclll2.js"),[],import.meta.url).then(n=>V(n.pug))}}),O.of({name:"Puppet",extensions:["pp"],load(){return N(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>V(n.puppet))}}),O.of({name:"Q",extensions:["q"],load(){return N(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(n=>V(n.q))}}),O.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return N(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(n=>V(n.r))}}),O.of({name:"RPM Changes",load(){return N(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>V(n.rpmChanges))}}),O.of({name:"RPM Spec",extensions:["spec"],load(){return N(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>V(n.rpmSpec))}}),O.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return N(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(n=>V(n.ruby))}}),O.of({name:"SAS",extensions:["sas"],load(){return N(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(n=>V(n.sas))}}),O.of({name:"Scala",extensions:["scala"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.scala))}}),O.of({name:"Scheme",extensions:["scm","ss"],load(){return N(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(n=>V(n.scheme))}}),O.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return N(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>V(n.shell))}}),O.of({name:"Sieve",extensions:["siv","sieve"],load(){return N(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>V(n.sieve))}}),O.of({name:"Smalltalk",extensions:["st"],load(){return N(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>V(n.smalltalk))}}),O.of({name:"Solr",load(){return N(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(n=>V(n.solr))}}),O.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return N(()=>import("./mllike-CXdrOF99.js"),[],import.meta.url).then(n=>V(n.sml))}}),O.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return N(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>V(n.sparql))}}),O.of({name:"Spreadsheet",alias:["excel","formula"],load(){return N(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>V(n.spreadsheet))}}),O.of({name:"Squirrel",extensions:["nut"],load(){return N(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(n=>V(n.squirrel))}}),O.of({name:"Stylus",extensions:["styl"],load(){return N(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(n=>V(n.stylus))}}),O.of({name:"Swift",extensions:["swift"],load(){return N(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(n=>V(n.swift))}}),O.of({name:"sTeX",load(){return N(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>V(n.stex))}}),O.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return N(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>V(n.stex))}}),O.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return N(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>V(n.verilog))}}),O.of({name:"Tcl",extensions:["tcl"],load(){return N(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>V(n.tcl))}}),O.of({name:"Textile",extensions:["textile"],load(){return N(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(n=>V(n.textile))}}),O.of({name:"TiddlyWiki",load(){return N(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>V(n.tiddlyWiki))}}),O.of({name:"Tiki wiki",load(){return N(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(n=>V(n.tiki))}}),O.of({name:"TOML",extensions:["toml"],load(){return N(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>V(n.toml))}}),O.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return N(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(n=>V(n.troff))}}),O.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return N(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>V(n.ttcn))}}),O.of({name:"TTCN_CFG",extensions:["cfg"],load(){return N(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>V(n.ttcnCfg))}}),O.of({name:"Turtle",extensions:["ttl"],load(){return N(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>V(n.turtle))}}),O.of({name:"Web IDL",extensions:["webidl"],load(){return N(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>V(n.webIDL))}}),O.of({name:"VB.NET",extensions:["vb"],load(){return N(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(n=>V(n.vb))}}),O.of({name:"VBScript",extensions:["vbs"],load(){return N(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>V(n.vbScript))}}),O.of({name:"Velocity",extensions:["vtl"],load(){return N(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(n=>V(n.velocity))}}),O.of({name:"Verilog",extensions:["v"],load(){return N(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>V(n.verilog))}}),O.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return N(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>V(n.vhdl))}}),O.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return N(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(n=>V(n.xQuery))}}),O.of({name:"Yacas",extensions:["ys"],load(){return N(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>V(n.yacas))}}),O.of({name:"Z80",extensions:["z80"],load(){return N(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>V(n.z80))}}),O.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.mscgen))}}),O.of({name:"Xù",extensions:["xu"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.xu))}}),O.of({name:"MsGenny",extensions:["msgenny"],load(){return N(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>V(n.msgenny))}}),O.of({name:"Vue",extensions:["vue"],load(){return N(()=>import("./index-CLJUfzvO.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.vue())}}),O.of({name:"Angular Template",load(){return N(()=>import("./index-ZrVeQUWo.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.angular())}})],TH="#e5c07b",Y2="#e06c75",AH="#56b6c2",_H="#ffffff",gm="#abb2bf",ew="#7d8799",EH="#61afef",OH="#98c379",X2="#d19a66",IH="#c678dd",DH="#21252b",Z2="#2c313a",Q2="#282c34",Z1="#353a42",NH="#3E4451",eM="#528bff",RH=ne.theme({"&":{color:gm,backgroundColor:Q2},".cm-content":{caretColor:eM},".cm-cursor, .cm-dropCursor":{borderLeftColor:eM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:NH},".cm-panels":{backgroundColor:DH,color:gm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Q2,color:ew,border:"none"},".cm-activeLineGutter":{backgroundColor:Z2},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Z1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Z1,borderBottomColor:Z1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Z2,color:gm}}},{dark:!0}),LH=Ad.define([{tag:P.keyword,color:IH},{tag:[P.name,P.deleted,P.character,P.propertyName,P.macroName],color:Y2},{tag:[P.function(P.variableName),P.labelName],color:EH},{tag:[P.color,P.constant(P.name),P.standard(P.name)],color:X2},{tag:[P.definition(P.name),P.separator],color:gm},{tag:[P.typeName,P.className,P.number,P.changed,P.annotation,P.modifier,P.self,P.namespace],color:TH},{tag:[P.operator,P.operatorKeyword,P.url,P.escape,P.regexp,P.link,P.special(P.string)],color:AH},{tag:[P.meta,P.comment],color:ew},{tag:P.strong,fontWeight:"bold"},{tag:P.emphasis,fontStyle:"italic"},{tag:P.strikethrough,textDecoration:"line-through"},{tag:P.link,color:ew,textDecoration:"underline"},{tag:P.heading,fontWeight:"bold",color:Y2},{tag:[P.atom,P.bool,P.special(P.variableName)],color:X2},{tag:[P.processingInstruction,P.string,P.inserted],color:OH},{tag:P.invalid,color:_H}]),PH=[RH,P5(LH)];function _d(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-block",...e}}),n}const BH=n=>!$r(t=>t.type.name==="table")(n),b0=ot({filterNodes:BH},"blockConfig");_d(b0,{displayName:"Ctx<blockConfig>"});function FH(n,e,t){var r;if(!n.dom.parentElement)return null;try{const s=(r=n.posAtCoords({left:e.x,top:e.y}))==null?void 0:r.inside;if(s==null||s<0)return null;let o=n.state.doc.resolve(s),l=n.state.doc.nodeAt(s),a=n.nodeDOM(s);const c=h=>{const f=o.depth>=1&&o.index(o.depth)===0;if(!(h||f))return;const p=o.before(o.depth);l=n.state.doc.nodeAt(p),a=n.nodeDOM(p),o=n.state.doc.resolve(p),t(o,l)||c(!0)},u=t(o,l);return c(!u),!a||!l?null:{node:l,$pos:o,el:a}}catch{return null}}const tM=ip.ie&&ip.ie_version<15||ip.ios&&ip.webkit_version<604,nM=20;var hc,Xf,El,Gi,fc,Ji,Xi,U5,sl,Ol,Il,Zf,dc,pc,mc,gc,Qf,yo;class HH{constructor(){G(this,Xi);G(this,hc);G(this,Xf);G(this,El);G(this,Gi);G(this,fc);G(this,Ji);G(this,Ol);G(this,Il);G(this,Zf);G(this,dc);G(this,pc);G(this,mc);G(this,gc);G(this,Qf);G(this,yo);R(this,Xf,()=>{if(!C(this,Gi))return null;const e=C(this,Gi),t=C(this,Xi,sl);if(t&&we.isSelectable(e.node)){const i=we.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(i)),t.focus(),R(this,El,i),i}return null}),R(this,El,null),R(this,Gi,null),R(this,fc,void 0),R(this,Ji,!1),R(this,Il,()=>{var e;(e=C(this,Ol))==null||e.call(this,{type:"hide"}),R(this,Gi,null)}),R(this,Zf,e=>{var t;R(this,Gi,e),(t=C(this,Ol))==null||t.call(this,{type:"show",active:e})}),this.bind=(e,t)=>{R(this,hc,e),R(this,Ol,t)},this.addEvent=e=>{e.addEventListener("mousedown",C(this,dc)),e.addEventListener("mouseup",C(this,pc)),e.addEventListener("dragstart",C(this,mc)),e.addEventListener("dragend",C(this,gc))},this.removeEvent=e=>{e.removeEventListener("mousedown",C(this,dc)),e.removeEventListener("mouseup",C(this,pc)),e.removeEventListener("dragstart",C(this,mc)),e.removeEventListener("dragend",C(this,gc))},this.unBind=()=>{R(this,Ol,void 0)},R(this,dc,()=>{var e;R(this,fc,(e=C(this,Gi))==null?void 0:e.el.getBoundingClientRect()),C(this,Xf).call(this)}),R(this,pc,()=>{if(!C(this,Ji)){requestAnimationFrame(()=>{var e;C(this,fc)&&((e=C(this,Xi,sl))==null||e.focus())});return}R(this,Ji,!1),R(this,El,null)}),R(this,mc,e=>{var r;R(this,Ji,!0);const t=C(this,Xi,sl);if(!t)return;t.dom.dataset.dragging="true";const i=C(this,El);if(e.dataTransfer&&i){const s=i.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:l}=t.serializeForClipboard(s);e.dataTransfer.clearData(),e.dataTransfer.setData(tM?"Text":"text/html",o.innerHTML),tM||e.dataTransfer.setData("text/plain",l);const a=(r=C(this,Gi))==null?void 0:r.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:s,move:!0}}}),R(this,gc,()=>{C(this,Xi,sl)&&C(this,yo).call(this,C(this,Xi,sl))}),this.keydownCallback=e=>(C(this,Il).call(this),R(this,Ji,!1),e.dom.dataset.dragging="false",!1),R(this,Qf,Kg((e,t)=>{if(!e.editable)return;const i=e.dom.getBoundingClientRect(),r=i.left+i.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){C(this,Il).call(this);return}const o=C(this,Xi,U5);if(!o)return;const l=FH(e,{x:r,y:t.clientY},o);if(!l){C(this,Il).call(this);return}C(this,Zf).call(this,l)},200)),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||C(this,Qf).call(this,e,t),!1),this.dragoverCallback=(e,t)=>{var i;if(C(this,Ji)){const r=(i=C(this,Xi,sl))==null?void 0:i.dom.parentElement;if(!r)return!1;const s=r.scrollHeight>r.clientHeight,o=r.getBoundingClientRect();if(s){if(r.scrollTop>0&&Math.abs(t.y-o.y)<nM){const c=r.scrollTop>10?r.scrollTop-10:0;return r.scrollTop=c,!1}const l=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(r.scrollTop+o.height)<l&&Math.abs(t.y-(o.height+o.y))<nM){const c=r.scrollTop+10;return r.scrollTop=c,!1}}}return!1},this.dragenterCallback=e=>{e.dragging&&(R(this,Ji,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const i=t.clientX,r=t.clientY;(i<0||r<0||i>window.innerWidth||r>window.innerHeight)&&(R(this,Gi,null),C(this,yo).call(this,e))},this.dropCallback=e=>(C(this,yo).call(this,e),!1),this.dragendCallback=e=>{C(this,yo).call(this,e)},R(this,yo,e=>{R(this,Ji,!1),e.dom.dataset.dragging="false"})}}hc=new WeakMap,Xf=new WeakMap,El=new WeakMap,Gi=new WeakMap,fc=new WeakMap,Ji=new WeakMap,Xi=new WeakSet,U5=function(){var e;try{return(e=C(this,hc))==null?void 0:e.get(b0.key).filterNodes}catch{return}},sl=function(){var e;return(e=C(this,hc))==null?void 0:e.get(rt)},Ol=new WeakMap,Il=new WeakMap,Zf=new WeakMap,dc=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,Qf=new WeakMap,yo=new WeakMap;const Qk=ot(()=>new HH,"blockService"),w0=ot({},"blockServiceInstance");_d(Qk,{displayName:"Ctx<blockService>"});_d(w0,{displayName:"Ctx<blockServiceInstance>"});const k0=ot({},"blockSpec");_d(k0,{displayName:"Ctx<blockSpec>"});const ev=$t(n=>{const e=new xt("MILKDOWN_BLOCK"),i=n.get(Qk.key)();n.set(w0.key,i);const r=n.get(k0.key);return new vt({key:e,...r,props:{...r.props,handleDOMEvents:{drop:s=>i.dropCallback(s),pointermove:(s,o)=>i.mousemoveCallback(s,o),keydown:s=>i.keydownCallback(s),dragover:(s,o)=>i.dragoverCallback(s,o),dragleave:(s,o)=>i.dragleaveCallback(s,o),dragenter:s=>i.dragenterCallback(s),dragend:s=>i.dragendCallback(s)}}})});_d(ev,{displayName:"Prose<block>"});var zn,Ss,Dl,Nl,ed,yc,td,nd,bc,wc,kc,qg,K5;class $H{constructor(e){G(this,qg);G(this,zn);G(this,Ss);G(this,Dl);G(this,Nl);G(this,ed);G(this,yc);G(this,td);G(this,nd);G(this,bc);G(this,wc);G(this,kc);R(this,Nl,null),R(this,yc,!1),this.update=()=>{requestAnimationFrame(()=>{if(!C(this,yc))try{Qd(this,qg,K5).call(this),R(this,yc,!0)}catch{}})},this.destroy=()=>{var t,i;(t=C(this,Dl))==null||t.unBind(),(i=C(this,Dl))==null||i.removeEvent(C(this,zn)),C(this,zn).remove()},this.show=t=>{const i=t.el,r=C(this,Ss).get(rt).dom,s={ctx:C(this,Ss),active:t,editorDom:r,blockDom:C(this,zn)},o={contextElement:i,getBoundingClientRect:()=>C(this,wc)?C(this,wc).call(this,s):i.getBoundingClientRect()},l=[Uw()];if(C(this,bc)){const a=C(this,bc).call(this,s),c=Jl(a);l.push(c)}zr(o,C(this,zn),{placement:C(this,kc)?C(this,kc).call(this,s):"left",middleware:[...l,...C(this,td)],...C(this,nd)}).then(({x:a,y:c})=>{Object.assign(C(this,zn).style,{left:`${a}px`,top:`${c}px`}),C(this,zn).dataset.show="true"}).catch(console.error)},this.hide=()=>{C(this,zn).dataset.show="false"},R(this,Ss,e.ctx),R(this,zn,e.content),R(this,bc,e.getOffset),R(this,wc,e.getPosition),R(this,kc,e.getPlacement),R(this,td,e.middleware??[]),R(this,nd,e.floatingUIOptions??{}),R(this,ed,e.root),this.hide()}get active(){return C(this,Nl)}}zn=new WeakMap,Ss=new WeakMap,Dl=new WeakMap,Nl=new WeakMap,ed=new WeakMap,yc=new WeakMap,td=new WeakMap,nd=new WeakMap,bc=new WeakMap,wc=new WeakMap,kc=new WeakMap,qg=new WeakSet,K5=function(){const e=C(this,Ss).get(rt);(C(this,ed)??e.dom.parentElement??document.body).appendChild(C(this,zn));const i=C(this,Ss).get(w0.key);i.bind(C(this,Ss),r=>{r.type==="hide"?(this.hide(),R(this,Nl,null)):r.type==="show"&&(this.show(r.active),R(this,Nl,r.active))}),R(this,Dl,i),C(this,Dl).addEvent(C(this,zn)),C(this,zn).draggable=!0};const v0=[k0,b0,Qk,w0,ev];v0.key=k0.key;v0.pluginKey=ev.key;function VH(n,e){return function(t,i){let{$from:r,$to:s,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(s))return!1;let l=r.node(-1);if(l.type!=n)return!1;if(r.parent.content.size==0&&r.node(-1).childCount==r.indexAfter(-1)){if(r.depth==3||r.node(-3).type!=n||r.index(-2)!=r.node(-2).childCount-1)return!1;if(i){let h=X.empty,f=r.index(-1)?1:r.index(-2)?2:3;for(let y=r.depth-f;y>=r.depth-3;y--)h=X.from(r.node(y).copy(h));let d=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;h=h.append(X.from(n.createAndFill()));let p=r.before(r.depth-(f-1)),m=t.tr.replace(p,r.after(-d),new ee(h,4-f,0)),g=-1;m.doc.nodesBetween(p,m.doc.content.size,(y,b)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=b+1)}),g>-1&&m.setSelection(De.near(m.doc.resolve(g))),i(m.scrollIntoView())}return!0}let a=s.pos==r.end()?l.contentMatchAt(0).defaultType:null,c=t.tr.delete(r.pos,s.pos),u=a?[null,{type:a}]:void 0;return Ah(c.doc,r.pos,2,u)?(i&&i(c.split(r.pos,2,u).scrollIntoView()),!0):!1}}function zH(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?WH(e,t,n,s):qH(e,t,s):!0:!1}}function WH(n,e,t,i){let r=n.tr,s=i.end,o=i.$to.end(i.depth);s<o&&(r.step(new bn(s-1,o,s,o,new ee(X.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new $A(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=Qg(i);if(l==null)return!1;r.lift(i,l);let a=r.doc.resolve(r.mapping.map(s,-1)-1);return e0(r.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&r.join(a.pos),e(r.scrollIntoView()),!0}function qH(n,e,t){let i=n.tr,r=t.parent;for(let d=t.end,p=t.endIndex-1,m=t.startIndex;p>m;p--)d-=r.child(p).nodeSize,i.delete(d-1,d+1);let s=i.doc.resolve(t.start),o=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==r.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?X.empty:X.from(r))))return!1;let h=s.pos,f=h+o.nodeSize;return i.step(new bn(h-(l?1:0),f+(a?1:0),h+1,f-1,new ee((l?X.empty:X.from(r.copy(X.empty))).append(a?X.empty:X.from(r.copy(X.empty))),l?0:1,a?0:1),l?0:1)),e(i.scrollIntoView()),!0}function jH(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=X.from(c?n.create():null),h=new ee(X.from(n.create(null,X.from(l.type.create(null,u)))),c?3:1,0),f=s.start,d=s.end;t(e.tr.step(new bn(f-(c?3:1),d,f,d,h,1,!0)).scrollIntoView())}return!0}}function UH(n){const e=new Map;if(!n||!n.type)throw new Error("mdast-util-definitions expected node");return Ho(n,"definition",function(i){const r=iM(i.identifier);r&&!e.get(r)&&e.set(r,i)}),t;function t(i){const r=iM(i);return e.get(r)}}function iM(n){return String(n||"").toUpperCase()}function KH(){return function(n){const e=UH(n);Ho(n,function(t,i,r){if(t.type==="definition"&&r!==void 0&&typeof i=="number")return r.children.splice(i,1),[Wy,i];if(t.type==="imageReference"||t.type==="linkReference"){const s=e(t.identifier);if(s&&r&&typeof i=="number")return r.children[i]=t.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:t.alt}:{type:"link",url:s.url,title:s.title,children:t.children},[Wy,i]}})}}function G5(n,e){var r;if(!(e.childCount>=1&&((r=e.lastChild)==null?void 0:r.type.name)==="hardbreak")){n.next(e.content);return}const i=[];e.content.forEach((s,o,l)=>{l!==e.childCount-1&&i.push(s)}),n.next(X.fromArray(i))}function F(n,e){return Object.assign(n,{meta:{package:"@milkdown/preset-commonmark",...e}}),n}const tv=vd("emphasis");F(tv,{displayName:"Attr<emphasis>",group:"Emphasis"});const aa=Jc("emphasis",n=>({attrs:{marker:{default:n.get(Oh).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",n.get(tv.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));F(aa.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});F(aa.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const x0=Ie("ToggleEmphasis",n=>()=>i0(aa.type(n)));F(x0,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const J5=Cn(n=>yd(/(?:^|[^*])\*([^*]+)\*$/,aa.type(n),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));F(J5,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const Y5=Cn(n=>yd(/\b_(?![_\s])(.*?[^_\s])_\b/,aa.type(n),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));F(Y5,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const nv=ei("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:n=>{const e=n.get(ce);return()=>e.call(x0.key)}}});F(nv.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});F(nv.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const iv=vd("strong");F(iv,{displayName:"Attr<strong>",group:"Strong"});const Zc=Jc("strong",n=>({attrs:{marker:{default:n.get(Oh).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>e==="bold"},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:e=>["strong",n.get(iv.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,t,i)=>{e.openMark(i,{marker:t.marker}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));F(Zc.mark,{displayName:"MarkSchema<strong>",group:"Strong"});F(Zc.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const C0=Ie("ToggleStrong",n=>()=>i0(Zc.type(n)));F(C0,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const X5=Cn(n=>yd(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),Zc.type(n),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));F(X5,{displayName:"InputRule<strong>",group:"Strong"});const rv=ei("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:n=>{const e=n.get(ce);return()=>e.call(C0.key)}}});F(rv.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});F(rv.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const sv=vd("inlineCode");F(sv,{displayName:"Attr<inlineCode>",group:"InlineCode"});const Es=Jc("inlineCode",n=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:e=>["code",n.get(sv.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,t,i)=>{e.openMark(i),e.addText(t.value),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,t,i)=>{e.withMark(t,"inlineCode",i.text||"")}}}));F(Es.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});F(Es.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const S0=Ie("ToggleInlineCode",n=>()=>(e,t)=>{const{selection:i,tr:r}=e;if(i.empty)return!1;const{from:s,to:o}=i;return e.doc.rangeHasMark(s,o,Es.type(n))?(t==null||t(r.removeMark(s,o,Es.type(n))),!0):(Object.keys(e.schema.marks).filter(c=>c!==Es.type.name).map(c=>e.schema.marks[c]).forEach(c=>{r.removeMark(s,o,c)}),t==null||t(r.addMark(s,o,Es.type(n).create())),!0)});F(S0,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const Z5=Cn(n=>yd(/(?:`)([^`]+)(?:`)$/,Es.type(n)));F(Z5,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const ov=ei("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:n=>{const e=n.get(ce);return()=>e.call(S0.key)}}});F(ov.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});F(ov.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const lv=vd("link");F(lv,{displayName:"Attr<link>",group:"Link"});const ir=Jc("link",n=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...n.get(lv.key)(e),...e.attrs}],parseMarkdown:{match:e=>e.type==="link",runner:(e,t,i)=>{const r=t.url,s=t.title;e.openMark(i,{href:r,title:s}),e.next(t.children),e.closeMark(i)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));F(ir.mark,{displayName:"MarkSchema<link>",group:"Link"});const Q5=Ie("ToggleLink",n=>(e={})=>i0(ir.type(n),e));F(Q5,{displayName:"Command<toggleLinkCommand>",group:"Link"});const eI=Ie("UpdateLink",n=>(e={})=>(t,i)=>{if(!i)return!1;let r,s=-1;const{selection:o}=t,{from:l,to:a}=o;if(t.doc.nodesBetween(l,l===a?a+1:a,(p,m)=>{if(ir.type(n).isInSet(p.marks))return r=p,s=m,!1}),!r)return!1;const c=r.marks.find(({type:p})=>p===ir.type(n));if(!c)return!1;const u=s,h=s+r.nodeSize,{tr:f}=t,d=ir.type(n).create({...c.attrs,...e});return d?(i(f.removeMark(u,h,c).addMark(u,h,d).setSelection(new de(f.selection.$anchor)).scrollIntoView()),!0):!1});F(eI,{displayName:"Command<updateLinkCommand>",group:"Link"});const tI=Sk("doc",()=>({content:"block+",parseMarkdown:{match:({type:n})=>n==="root",runner:(n,e,t)=>{n.injectRoot(e,t)}},toMarkdown:{match:n=>n.type.name==="doc",runner:(n,e)=>{n.openNode("root"),n.next(e.content)}}}));F(tI,{displayName:"NodeSchema<doc>",group:"Doc"});function GH(n){return Zw(n,e=>{var t;return e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes((t=e.value)==null?void 0:t.trim())},(e,t)=>{if(!t.length)return;const i=t[t.length-1];if(!i)return;const r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)},!0)}const M0=hr("remark-preserve-empty-line",()=>()=>GH);F(M0.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});F(M0.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const av=ur("paragraph");F(av,{displayName:"Attr<paragraph>",group:"Paragraph"});const dr=At("paragraph",n=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",n.get(av.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,t,i)=>{e.openNode(i),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,t)=>{var s;const r=(s=n.get(rt).state)==null?void 0:s.doc.lastChild;e.openNode("paragraph"),(!t.content||t.content.size===0)&&t!==r&&JH(n)?e.addNode("html",void 0,"<br />"):G5(e,t),e.closeNode()}}}));function JH(n){let e=!1;try{n.get(M0.id),e=!0}catch{e=!1}return e}F(dr.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});F(dr.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const cv=Ie("TurnIntoText",n=>()=>rf(dr.type(n)));F(cv,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const uv=ei("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:n=>{const e=n.get(ce);return()=>e.call(cv.key)}}});F(uv.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});F(uv.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const YH=Array(6).fill(0).map((n,e)=>e+1);function XH(n){return n.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const T0=ot(XH,"headingIdGenerator");F(T0,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const hv=ur("heading");F(hv,{displayName:"Attr<heading>",group:"Heading"});const ui=At("heading",n=>{const e=n.get(T0.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:YH.map(t=>({tag:`h${t}`,getAttrs:i=>{if(!(i instanceof HTMLElement))throw cr(i);return{level:t,id:i.id}}})),toDOM:t=>[`h${t.attrs.level}`,{...n.get(hv.key)(t),id:t.attrs.id||e(t)},0],parseMarkdown:{match:({type:t})=>t==="heading",runner:(t,i,r)=>{const s=i.depth;t.openNode(r,{level:s}),t.next(i.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="heading",runner:(t,i)=>{t.openNode("heading",void 0,{depth:i.attrs.level}),G5(t,i),t.closeNode()}}}});F(ui.node,{displayName:"NodeSchema<heading>",group:"Heading"});F(ui.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const nI=Cn(n=>fk(/^(?<hashes>#+)\s$/,ui.type(n),e=>{var o,l;const t=((l=(o=e.groups)==null?void 0:o.hashes)==null?void 0:l.length)||0,i=n.get(rt),{$from:r}=i.state.selection,s=r.node();if(s.type.name==="heading"){let a=Number(s.attrs.level)+Number(t);return a>6&&(a=6),{level:a}}return{level:t}}));F(nI,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const ro=Ie("WrapInHeading",n=>e=>(e??(e=1),e<1?rf(dr.type(n)):rf(ui.type(n),{level:e})));F(ro,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const fv=Ie("DowngradeHeading",n=>()=>(e,t,i)=>{const{$from:r}=e.selection,s=r.node();if(s.type!==ui.type(n)||!e.selection.empty||r.parentOffset!==0)return!1;const o=s.attrs.level-1;return o?(t==null||t(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:o})),!0):rf(dr.type(n))(e,t,i)});F(fv,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const dv=ei("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:n=>{const e=n.get(ce);return()=>e.call(ro.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:n=>{const e=n.get(ce);return()=>e.call(fv.key)}}});F(dv.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});F(dv.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const pv=ur("blockquote");F(pv,{displayName:"Attr<blockquote>",group:"Blockquote"});const Qc=At("blockquote",n=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",n.get(pv.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,t,i)=>{e.openNode(i).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));F(Qc.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});F(Qc.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const iI=Cn(n=>hk(/^\s*>\s$/,Qc.type(n)));F(iI,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const mv=Ie("WrapInBlockquote",n=>()=>uk(Qc.type(n)));F(mv,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const gv=ei("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:n=>{const e=n.get(ce);return()=>e.call(mv.key)}}});F(gv.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});F(gv.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const yv=ur("codeBlock",()=>({pre:{},code:{}}));F(yv,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const Ur=At("code_block",n=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{language:e.dataset.language}}}],toDOM:e=>{const t=n.get(yv.key)(e),i=e.attrs.language,r=i&&i.length>0?{"data-language":i}:void 0;return["pre",{...t.pre,...r},["code",t.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,t,i)=>{const r=t.lang??"",s=t.value;e.openNode(i,{language:r}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,t)=>{var i;e.addNode("code",void 0,((i=t.content.firstChild)==null?void 0:i.text)||"",{lang:t.attrs.language})}}}));F(Ur.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});F(Ur.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const rI=Cn(n=>fk(/^```(?<language>[a-z]*)?[\s\n]$/,Ur.type(n),e=>{var t;return{language:((t=e.groups)==null?void 0:t.language)??""}}));F(rI,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const bv=Ie("CreateCodeBlock",n=>(e="")=>rf(Ur.type(n),{language:e}));F(bv,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});const ZH=Ie("UpdateCodeBlockLanguage",()=>({pos:n,language:e}={pos:-1,language:""})=>(t,i)=>n>=0?(i==null||i(t.tr.setNodeAttribute(n,"language",e)),!0):!1);F(ZH,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const wv=ei("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:n=>{const e=n.get(ce);return()=>e.call(bv.key)}}});F(wv.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});F(wv.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const kv=ur("image");F(kv,{displayName:"Attr<image>",group:"Image"});const ca=At("image",n=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...n.get(kv.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,t,i)=>{const r=t.url,s=t.alt,o=t.title;e.addNode(i,{src:r,alt:s,title:o})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));F(ca.node,{displayName:"NodeSchema<image>",group:"Image"});F(ca.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const sI=Ie("InsertImage",n=>(e={})=>(t,i)=>{if(!i)return!0;const{src:r="",alt:s="",title:o=""}=e,l=ca.type(n).create({src:r,alt:s,title:o});return l&&i(t.tr.replaceSelectionWith(l).scrollIntoView()),!0});F(sI,{displayName:"Command<insertImageCommand>",group:"Image"});const oI=Ie("UpdateImage",n=>(e={})=>(t,i)=>{const r=Y4(t.selection,ca.type(n));if(!r)return!1;const{node:s,pos:o}=r,l={...s.attrs},{src:a,alt:c,title:u}=e;return a!==void 0&&(l.src=a),c!==void 0&&(l.alt=c),u!==void 0&&(l.title=u),i==null||i(t.tr.setNodeMarkup(o,void 0,l).scrollIntoView()),!0});F(oI,{displayName:"Command<updateImageCommand>",group:"Image"});const QH=Cn(n=>new Qn(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,t,i,r)=>{const[s,o,l="",a]=t;return s?e.tr.replaceWith(i,r,ca.type(n).create({src:l,alt:o,title:a})):null}));F(QH,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const wg=ur("hardbreak",n=>({"data-type":"hardbreak","data-is-inline":n.attrs.isInline}));F(wg,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const zl=At("hardbreak",n=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:e=>e.attrs.isInline?["span",n.get(wg.key)(e)," "]:["br",n.get(wg.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,t,i)=>{var r;e.addNode(i,{isInline:!!((r=t.data)!=null&&r.isInline)})}},leafText:()=>`
|
|
56
56
|
`,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,`
|
|
57
57
|
`):e.addNode("break")}}}));F(zl.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});F(zl.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const vv=Ie("InsertHardbreak",n=>()=>(e,t)=>{var s;const{selection:i,tr:r}=e;if(!(i instanceof de))return!1;if(i.empty){const o=i.$from.node();if(o.childCount>0&&((s=o.lastChild)==null?void 0:s.type.name)==="hardbreak")return t==null||t(r.replaceRangeWith(i.to-1,i.to,e.schema.node("paragraph")).setSelection(De.near(r.doc.resolve(i.to))).scrollIntoView()),!0}return t==null||t(r.setMeta("hardbreak",!0).replaceSelectionWith(zl.type(n).create()).scrollIntoView()),!0});F(vv,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const xv=ei("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:n=>{const e=n.get(ce);return()=>e.call(vv.key)}}});F(xv.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});F(xv.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const Cv=ur("hr");F(Cv,{displayName:"Attr<hr>",group:"Hr"});const eu=At("hr",n=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",n.get(Cv.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,t,i)=>{e.addNode(i)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));F(eu.node,{displayName:"NodeSchema<hr>",group:"Hr"});F(eu.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const lI=Cn(n=>new Qn(/^(?:---|___\s|\*\*\*\s)$/,(e,t,i,r)=>{const{tr:s}=e;return t[0]&&s.replaceWith(i-1,r,eu.type(n).create()),s}));F(lI,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const aI=Ie("InsertHr",n=>()=>(e,t)=>{if(!t)return!0;const i=dr.node.type(n).create(),{tr:r,selection:s}=e,{from:o}=s,l=eu.type(n).create();if(!l)return!0;const a=r.replaceSelectionWith(l).insert(o,i),c=De.findFrom(a.doc.resolve(o),1,!0);return c&&t(a.setSelection(c).scrollIntoView()),!0});F(aI,{displayName:"Command<insertHrCommand>",group:"Hr"});const Sv=ur("bulletList");F(Sv,{displayName:"Attr<bulletList>",group:"BulletList"});const ua=At("bullet_list",n=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...n.get(Sv.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!t,runner:(e,t,i)=>{const r=t.spread!=null?`${t.spread}`:"false";e.openNode(i,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));F(ua.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});F(ua.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const cI=Cn(n=>hk(/^\s*([-+*])\s$/,ua.type(n)));F(cI,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const Mv=Ie("WrapInBulletList",n=>()=>uk(ua.type(n)));F(Mv,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const Tv=ei("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:n=>{const e=n.get(ce);return()=>e.call(Mv.key)}}});F(Tv.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});F(Tv.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Av=ur("orderedList");F(Av,{displayName:"Attr<orderedList>",group:"OrderedList"});const ha=At("ordered_list",n=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...n.get(Av.key)(e),...e.attrs.order===1?{}:e.attrs.order,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e==="list"&&!!t,runner:(e,t,i)=>{const r=t.spread!=null?`${t.spread}`:"true";e.openNode(i,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:1,spread:t.attrs.spread==="true"}),e.next(t.content),e.closeNode()}}}));F(ha.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});F(ha.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const uI=Cn(n=>hk(/^\s*(\d+)\.\s$/,ha.type(n),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));F(uI,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const _v=Ie("WrapInOrderedList",n=>()=>uk(ha.type(n)));F(_v,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Ev=ei("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:n=>{const e=n.get(ce);return()=>e.call(_v.key)}}});F(Ev.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});F(Ev.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const Ov=ur("listItem");F(Ov,{displayName:"Attr<listItem>",group:"ListItem"});const pr=At("list_item",n=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw cr(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...n.get(Ov.key)(e),"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e})=>e==="listItem",runner:(e,t,i)=>{const r=t.label!=null?`${t.label}.`:"•",s=t.label!=null?"ordered":"bullet",o=t.spread!=null?`${t.spread}`:"true";e.openNode(i,{label:r,listType:s,spread:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="list_item",runner:(e,t)=>{e.openNode("listItem",void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));F(pr.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});F(pr.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const Iv=Ie("SinkListItem",n=>()=>jH(pr.type(n)));F(Iv,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const Dv=Ie("LiftListItem",n=>()=>zH(pr.type(n)));F(Dv,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const Nv=Ie("SplitListItem",n=>()=>VH(pr.type(n)));F(Nv,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function e$(n){return(e,t,i)=>{const{selection:r}=e;if(!(r instanceof de))return!1;const{empty:s,$from:o}=r;return!s||o.parentOffset!==0||o.node(-1).type!==pr.type(n)?!1:N_(e,t,i)}}const Rv=Ie("LiftFirstListItem",n=>()=>e$(n));F(Rv,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});const Lv=ei("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:n=>{const e=n.get(ce);return()=>e.call(Nv.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:n=>{const e=n.get(ce);return()=>e.call(Iv.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:n=>{const e=n.get(ce);return()=>e.call(Dv.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:n=>{const e=n.get(ce);return()=>e.call(Rv.key)}}});F(Lv.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});F(Lv.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const hI=Sk("text",()=>({group:"inline",parseMarkdown:{match:({type:n})=>n==="text",runner:(n,e)=>{n.addText(e.value)}},toMarkdown:{match:n=>n.type.name==="text",runner:(n,e)=>{n.addNode("text",void 0,e.text)}}}));F(hI,{displayName:"NodeSchema<text>",group:"Text"});const Pv=ur("html");F(Pv,{displayName:"Attr<html>",group:"Html"});const Bv=At("html",n=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{const t=document.createElement("span"),i={...n.get(Pv.key)(e),"data-value":e.attrs.value,"data-type":"html"};return t.textContent=e.attrs.value,["span",i,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,t,i)=>{e.addNode(i,{value:t.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}}));F(Bv.node,{displayName:"NodeSchema<html>",group:"Html"});F(Bv.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const t$=[tI,av,dr,T0,hv,ui,wg,zl,pv,Qc,yv,Ur,Cv,eu,kv,ca,Sv,ua,Av,ha,Ov,pr,tv,aa,iv,Zc,sv,Es,lv,ir,Pv,Bv,hI].flat(),n$=[iI,cI,uI,rI,lI,nI].flat(),i$=[J5,Y5,Z5,X5],Aa=Ie("IsMarkSelected",()=>n=>e=>{if(!n)return!1;const{doc:t,selection:i}=e;return t.rangeHasMark(i.from,i.to,n)}),fI=Ie("IsNoteSelected",()=>n=>e=>n?G_(e,n).hasNode:!1),rn=Ie("ClearTextInCurrentBlock",()=>()=>(n,e)=>{let t=n.tr;const{$from:i,$to:r}=t.selection,{pos:s}=i,{pos:o}=r,l=s-i.node().content.size;return l<0?!1:(t=t.deleteRange(l,o),e==null||e(t),!0)}),hs=Ie("SetBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;const s=e.tr,{from:o,to:l}=s.selection;try{s.setBlockType(o,l,i,r)}catch{return!1}return t==null||t(s),!0}),sh=Ie("WrapInBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;let s=e.tr;try{const{$from:o,$to:l}=s.selection,a=o.blockRange(l),c=a&&rk(a,i,r);if(!c)return!1;s=s.wrap(a,c)}catch{return!1}return t==null||t(s),!0}),oh=Ie("AddBlockType",()=>n=>(e,t)=>{const{nodeType:i,attrs:r=null}=n??{};if(!i)return!1;const s=e.tr;try{const o=i instanceof Di?i:i.createAndFill(r);if(!o)return!1;s.replaceSelectionWith(o)}catch{return!1}return t==null||t(s),!0}),dI=Ie("SelectTextNearPos",()=>n=>(e,t)=>{const{pos:i}=n??{};if(i==null)return!1;const r=(o,l,a)=>Math.min(Math.max(o,l),a),s=e.tr;try{const o=e.doc.resolve(r(i,0,e.doc.content.size));s.setSelection(de.near(o))}catch{return!1}return t==null||t(s.scrollIntoView()),!0}),r$=[cv,mv,ro,fv,bv,vv,aI,sI,oI,_v,Mv,Iv,Nv,Dv,Rv,x0,S0,C0,Q5,eI,Aa,fI,rn,hs,sh,oh,dI],s$=[gv,wv,xv,dv,Lv,Ev,Tv,uv,nv,ov,rv].flat(),Fv=hr("remarkAddOrderInList",()=>()=>n=>{Ho(n,"list",e=>{if(e.ordered){const t=e.start??1;e.children.forEach((i,r)=>{i.label=r+t})}})});F(Fv.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});F(Fv.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});const Hv=hr("remarkLineBreak",()=>()=>n=>{const e=/[\t ]*(?:\r?\n|\r)/g;Ho(n,"text",(t,i,r)=>{if(!t.value||typeof t.value!="string")return;const s=[];let o=0;e.lastIndex=0;let l=e.exec(t.value);for(;l;){const c=l.index;o!==c&&s.push({type:"text",value:t.value.slice(o,c)}),s.push({type:"break",data:{isInline:!0}}),o=c+l[0].length,l=e.exec(t.value)}if(s.length>0&&r&&typeof i=="number")return o<t.value.length&&s.push({type:"text",value:t.value.slice(o)}),r.children.splice(i,1,...s),i+s.length})});F(Hv.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});F(Hv.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});const $v=hr("remarkInlineLink",()=>KH);F($v.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});F($v.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});const o$=n=>!!n.children,l$=n=>n.type==="html";function a$(n,e){return t(n,0,null)[0];function t(i,r,s){if(o$(i)){const o=[];for(let l=0,a=i.children.length;l<a;l++){const c=i.children[l];if(c){const u=t(c,l,i);if(u)for(let h=0,f=u.length;h<f;h++){const d=u[h];d&&o.push(d)}}}i.children=o}return e(i,r,s)}}const c$=["root","blockquote","listItem"],Vv=hr("remarkHTMLTransformer",()=>()=>n=>{a$(n,(e,t,i)=>l$(e)?(i&&c$.includes(i.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])});F(Vv.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});F(Vv.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});const zv=hr("remarkMarker",()=>()=>(n,e)=>{const t=i=>e.value.charAt(i.position.start.offset);Ho(n,i=>["strong","emphasis"].includes(i.type),i=>{i.marker=t(i)})});F(zv.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});F(zv.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});const pI=$t(()=>{let n=!1;const e=new xt("MILKDOWN_INLINE_NODES_CURSOR"),t=new vt({key:e,state:{init(){return!1},apply(i){if(!i.selection.empty)return!1;const r=i.selection.$from,s=r.nodeBefore,o=r.nodeAfter;return!!(s&&o&&s.isInline&&!s.isText&&o.isInline&&!o.isText)}},props:{handleDOMEvents:{compositionend:(i,r)=>n?(n=!1,requestAnimationFrame(()=>{if(t.getState(i.state)){const o=i.state.selection.from;r.preventDefault(),i.dispatch(i.state.tr.insertText(r.data||"",o))}}),!0):!1,compositionstart:i=>(t.getState(i.state)&&(n=!0),!1),beforeinput:(i,r)=>{if(t.getState(i.state)&&r instanceof InputEvent&&r.data&&!n){const o=i.state.selection.from;return r.preventDefault(),i.dispatch(i.state.tr.insertText(r.data||"",o)),!0}return!1}},decorations(i){if(t.getState(i)){const o=i.selection.$from.pos,l=document.createElement("span"),a=Rn.widget(o,l,{side:-1}),c=document.createElement("span"),u=Rn.widget(o,c);return setTimeout(()=>{l.contentEditable="true",c.contentEditable="true"}),ft.create(i.doc,[a,u])}return ft.empty}}});return t});F(pI,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const mI=$t(n=>new vt({key:new xt("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,t,i)=>{if(!e.length)return;const[r]=e;if(!r)return;const[s]=r.steps;if(r.getMeta("hardbreak")){if(!(s instanceof Gt))return;const{from:a}=s;return i.tr.setNodeMarkup(a,zl.type(n),void 0,[])}if(s instanceof Ts){let a=i.tr;const{from:c,to:u}=s;return i.doc.nodesBetween(c,u,(h,f)=>{h.type===zl.type(n)&&(a=a.setNodeMarkup(f,zl.type(n),void 0,[]))}),a}}}));F(mI,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const Wv=ot(["table","code_block"],"hardbreakFilterNodes");F(Wv,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const gI=$t(n=>{const e=n.get(Wv.key);return new vt({key:new xt("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(t,i)=>{const r=t.getMeta("hardbreak"),[s]=t.steps;if(r&&s){const{from:o}=s,l=i.doc.resolve(o);let a=l.depth,c=!0;for(;a>0;)e.includes(l.node(a).type.name)&&(c=!1),a--;return c}return!0}})});F(gI,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const yI=$t(n=>{const e=new xt("MILKDOWN_HEADING_ID"),t=i=>{if(i.composing)return;const r=n.get(T0.key),s=i.state.tr.setMeta("addToHistory",!1);let o=!1;const l={};i.state.doc.descendants((a,c)=>{if(a.type===ui.type(n)){if(a.textContent.trim().length===0)return;const u=a.attrs;let h=r(a);l[h]?(l[h]+=1,h+=`-#${l[h]}`):l[h]=1,u.id!==h&&(o=!0,s.setMeta(e,!0).setNodeMarkup(c,void 0,{...u,id:h}))}}),o&&i.dispatch(s)};return new vt({key:e,view:i=>(t(i),{update:(r,s)=>{r.state.doc.eq(s.doc)||t(r)}})})});F(yI,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const bI=$t(n=>{const e=(t,i,r)=>{if(!r.selection||t.some(h=>h.getMeta("addToHistory")===!1||!h.isGeneric))return null;const s=ha.type(n),o=ua.type(n),l=pr.type(n),a=(h,f)=>{let d=!1;const p=`${f+1}.`;return h.label!==p&&(h.label=p,d=!0),d};let c=r.tr,u=!1;return r.doc.descendants((h,f,d,p)=>{if(h.type===o){const m=h.maybeChild(0);(m==null?void 0:m.type)===l&&m.attrs.listType==="ordered"&&(u=!0,c.setNodeMarkup(f,s,{spread:"true"}),h.descendants((g,y,b,w)=>{if(g.type===l){const x={...g.attrs};a(x,w)&&(c=c.setNodeMarkup(y,void 0,x))}return!1}))}else if(h.type===l&&(d==null?void 0:d.type)===s){const m={...h.attrs};let g=!1;m.listType!=="ordered"&&(m.listType="ordered",g=!0),(d==null?void 0:d.maybeChild(0))&&(g=a(m,p)),g&&(c=c.setNodeMarkup(f,void 0,m),u=!0)}}),u?c.setMeta("addToHistory",!1):null};return new vt({key:new xt("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});F(bI,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const u$=[mI,Wv,gI,pI,Fv,$v,Hv,Vv,zv,M0,yI,bI].flat(),h$=[t$,n$,i$,r$,s$,u$].flat();/**
|
|
58
58
|
* @vue/shared v3.5.27
|
|
@@ -683,4 +683,4 @@ Expected function or array of functions, received type ${typeof n}.`),Pi)}functi
|
|
|
683
683
|
|
|
684
684
|
${KQ(n)}
|
|
685
685
|
|
|
686
|
-
`}const zw="opentu-image:";function Wg(n){if(!n)return;const e=Number.parseInt(n,10);if(!(!Number.isFinite(e)||e<=0))return e}function C3(n){const e=Wg(n.width==null?null:String(n.width)),t=Wg(n.height==null?null:String(n.height)),i=(n.caption||"").trim();if(!e&&!t)return i||void 0;const r=new URLSearchParams;return e&&r.set("w",String(e)),t&&r.set("h",String(t)),i&&r.set("caption",i),`${zw}${r.toString()}`}function aC(n){const e=(n||"").trim();if(!e)return{caption:"",width:void 0,height:void 0};if(!e.startsWith(zw))return{caption:e,width:void 0,height:void 0};const t=new URLSearchParams(e.slice(zw.length));return{caption:t.get("caption")||"",width:Wg(t.get("w")),height:Wg(t.get("h"))}}function Vf(n){const e=(n||"").trim(),t=e.indexOf("|");if(t<0&&/^(image|video|audio)$/i.test(e))return{assetType:e.toLowerCase(),label:"",rawAlt:e,isAssetAlt:!0};if(t<=0)return{assetType:null,label:e,rawAlt:e,isAssetAlt:!1};const i=e.slice(0,t).trim(),r=e.slice(t+1).trim();return!i||!r?{assetType:null,label:e,rawAlt:e,isAssetAlt:!1}:{assetType:i,label:r,rawAlt:e,isAssetAlt:!0}}function mA(n){const e=(n||"").trim();return/^-?\d+(?:\.\d+)?$/.test(e)}function Iy(n){const e=n.url;if(!(e!=null&&e.startsWith(Ns)))return null;const t=e.slice(Ns.length),i=Vf(n.alt||""),r=i.assetType||"image";if(r==="image")return null;const s=aC(n.title),o=i.label||"";return{type:"assetEmbed",assetId:t,assetType:r,label:o,width:s.width,height:s.height}}function S3(n){if(n.children)for(let e=0;e<n.children.length;e++){const t=n.children[e];if(t.type==="image-block"){const i=Iy(t);if(i){n.children[e]=i;continue}}if(t.type==="paragraph"&&t.children){const i=[],r=[];for(const s of t.children){if(s.type==="image"){const o=Iy(s);if(o){i.push(o);continue}}r.push(s)}if(i.length>0){const s=[];r.length>0&&s.push({...t,children:r}),s.push(...i),n.children.splice(e,1,...s),e+=s.length-1;continue}}if(t.type==="image"){const i=Iy(t);if(i){n.children[e]=i;continue}}S3(t)}}const GQ=hr("remarkAssetEmbed",()=>()=>S3);function Ys(n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return Math.round(n);if(typeof n=="string"&&n.trim()){const e=Number.parseInt(n,10);if(Number.isFinite(e)&&e>0)return e}return null}const Ww=At("assetEmbed",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,atom:!0,attrs:{assetId:{default:""},assetType:{default:"image"},label:{default:""},width:{default:null},height:{default:null}},parseMarkdown:{match:n=>{var e;if(n.type==="assetEmbed")return!0;if(n.type==="image-block"&&((e=n.url)!=null&&e.startsWith(Ns))){const t=Vf(n.alt);if(t.assetType&&t.assetType!=="image")return!0}return!1},runner:(n,e,t)=>{if(e.type==="assetEmbed"){n.addNode(t,{assetId:e.assetId,assetType:e.assetType,label:e.label,width:Ys(e.width),height:Ys(e.height)});return}const i=e.url.slice(Ns.length),r=Vf(e.alt),s=aC(e.title);n.addNode(t,{assetId:i,assetType:r.assetType||"video",label:r.label||"",width:Ys(s.width),height:Ys(s.height)})}},toMarkdown:{match:n=>n.type.name==="assetEmbed",runner:(n,e)=>{const{assetId:t,assetType:i,label:r}=e.attrs,s=r?`${i}|${r}`:i,o=C3({width:Ys(e.attrs.width),height:Ys(e.attrs.height)});n.openNode("paragraph"),n.addNode("image",void 0,void 0,{url:`${Ns}${t}`,alt:s,title:o}),n.closeNode()}},toDOM:n=>["div",{"data-type":"asset-embed","data-asset-id":n.attrs.assetId,"data-asset-type":n.attrs.assetType,"data-label":n.attrs.label,"data-width":n.attrs.width??"","data-height":n.attrs.height??""}],parseDOM:[{tag:'div[data-type="asset-embed"]',getAttrs:n=>({assetId:n.getAttribute("data-asset-id")||"",assetType:n.getAttribute("data-asset-type")||"image",label:n.getAttribute("data-label")||"",width:Ys(n.getAttribute("data-width")),height:Ys(n.getAttribute("data-height"))})}]})),JQ=({asset:n,style:e})=>{const t=le.useMemo(()=>({id:`markdown-audio-${n.id}`,type:"audio",points:[[0,0],[340,128]],children:[],audioUrl:n.url,title:n.name,previewImageUrl:n.thumbnail,prompt:n.prompt,createdAt:n.createdAt}),[n]),i=le.useMemo(()=>[{elementId:t.id,audioUrl:n.url,title:n.name,previewImageUrl:n.thumbnail}],[n.name,n.thumbnail,n.url,t.id]);return Se.jsxDEV("div",{className:"collimind-markdown-audio-card",style:e,children:Se.jsxDEV(I3,{element:t,selected:!1,canvasQueue:i},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/MarkdownAudioAssetCard.tsx",lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/MarkdownAudioAssetCard.tsx",lineNumber:33,columnNumber:5},void 0)};function gi(n,e,t){return Math.min(Math.max(n,e),t)}function gA(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.round(n)}const qw=Math.round(Gw*1.15);function yA(n,e,t){let i=gi(n,t.minWidth,t.maxWidth),r=i/e;return(r<t.minHeight||r>t.maxHeight)&&(r=gi(r,t.minHeight,t.maxHeight),i=r*e),{width:gi(i,t.minWidth,t.maxWidth),height:gi(r,t.minHeight,t.maxHeight)}}function bA(n,e,t){let i=gi(n,t.minHeight,t.maxHeight),r=i*e;return(r<t.minWidth||r>t.maxWidth)&&(r=gi(r,t.minWidth,t.maxWidth),i=r/e),{width:gi(r,t.minWidth,t.maxWidth),height:gi(i,t.minHeight,t.maxHeight)}}function wA(n){return gi(Math.round(n*Gw/Ry),96,qw)}const YQ=({assetId:n,assetType:e,label:t,width:i,height:r,selected:s,readonly:o,updateAttrs:l})=>{const a=le.useSyncExternalStore(AA,_A),c=a.get(n),u=le.useRef(null),[h,f]=le.useState(null);le.useEffect(()=>{f(null)},[i,r]);const d=(h==null?void 0:h.width)??gA(i),p=(h==null?void 0:h.height)??gA(r),m=d??Ry,g=wA(m),y=e===Lt.AUDIO&&typeof p=="number"&&(p>240||p>m*.75),b=e===Lt.AUDIO?gi(y?g:p??g,96,qw):p,w=le.useMemo(()=>{const T={};return d?T.width=`${d}px`:e===Lt.AUDIO?T.width="min(100%, 560px)":T.maxWidth=e===Lt.AUDIO?"min(100%, 560px)":"min(100%, 520px)",e===Lt.AUDIO?T.height=`${b}px`:p&&(T.height=`${p}px`),T},[e,p,d,b]),x=le.useCallback(T=>A=>{if(o)return;const B=u.current;if(!B)return;A.preventDefault(),A.stopPropagation();const W=B.getBoundingClientRect();if(!W.width||!W.height)return;const E=B.closest(".ProseMirror"),U=Math.max(160,((E==null?void 0:E.getBoundingClientRect().width)??W.width)-32),L=e===Lt.AUDIO?qw:1600,ge=120,ke=e===Lt.AUDIO?96:80,Me={x:A.clientX,y:A.clientY,width:W.width,height:W.height};let Ne={width:Math.round(W.width),height:Math.round(W.height)};const lt=ae=>{const Ae=ae.clientX-Me.x,ye=ae.clientY-Me.y,Be=e!==Lt.AUDIO&&ae.shiftKey&&Me.width>0&&Me.height>0,be=T==="bottom"?Me.width:gi(Me.width+Ae,ge,U),et=T==="right"?Me.height:gi(Me.height+ye,ke,L);if(e===Lt.AUDIO){const Ee=T==="bottom"?gi(Math.round(et*(Ry/Gw)),120,U):Math.round(be),bt=wA(Ee);Ne={width:Ee,height:bt},f(Ne);return}if(Be){const Ee=Me.width/Me.height,bt={minWidth:ge,maxWidth:U,minHeight:ke,maxHeight:L};if(T==="right")Ne=yA(be,Ee,bt);else if(T==="bottom")Ne=bA(et,Ee,bt);else{const en=be/Me.width,pn=et/Me.height;Ne=Math.abs(en-1)>=Math.abs(pn-1)?yA(be,Ee,bt):bA(et,Ee,bt)}Ne={width:Math.round(Ne.width),height:Math.round(Ne.height)},f(Ne);return}Ne={width:Math.round(be),height:Math.round(et)},f(Ne)},oe=()=>{document.removeEventListener("pointermove",lt),document.removeEventListener("pointerup",oe),f(Ne),l({width:Ne.width,height:Ne.height})};document.addEventListener("pointermove",lt),document.addEventListener("pointerup",oe,{once:!0})},[e,o,l]),k=(T,A)=>Se.jsxDEV("div",{className:`collimind-asset-embed__shell ${s?"is-selected":""}`,"data-asset-type":e,"data-asset-id":n,children:[Se.jsxDEV("div",{ref:u,className:"collimind-asset-embed__frame",style:w,children:[T,!o&&s&&Se.jsxDEV(Se.Fragment,{children:[Se.jsxDEV("button",{type:"button","data-resize-handle":"right",className:"collimind-asset-embed__handle collimind-asset-embed__handle--right",onPointerDown:x("right"),"aria-label":`调整${e===Lt.AUDIO?"音频":"视频"}宽度`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:289,columnNumber:13},void 0),Se.jsxDEV("button",{type:"button","data-resize-handle":"bottom",className:"collimind-asset-embed__handle collimind-asset-embed__handle--bottom",onPointerDown:x("bottom"),"aria-label":`调整${e===Lt.AUDIO?"音频":"视频"}高度`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:296,columnNumber:13},void 0),Se.jsxDEV("button",{type:"button","data-resize-handle":"corner",className:"collimind-asset-embed__handle collimind-asset-embed__handle--corner",onPointerDown:x("corner"),"aria-label":`同时调整${e===Lt.AUDIO?"音频":"视频"}宽高`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:303,columnNumber:13},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:288,columnNumber:11},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:285,columnNumber:7},void 0),A&&Se.jsxDEV("div",{className:"collimind-asset-embed__caption",children:A},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:314,columnNumber:9},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:280,columnNumber:5},void 0);return c?c.type===Lt.IMAGE?Se.jsxDEV("img",{className:"collimind-asset-embed__image",src:Ny(c.url),alt:t||c.name||"素材图片"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:333,columnNumber:7},void 0):c.type===Lt.VIDEO?k(Se.jsxDEV("div",{className:"collimind-asset-embed__video-wrap",children:Se.jsxDEV(D3,{className:"collimind-asset-embed__video",src:c.url,poster:c.thumbnail,alt:t||c.name||"素材视频",thumbnailSize:"large",activateVideoOnClick:!0,playOnActivate:!0,videoProps:{controls:!0,preload:"metadata",playsInline:!0}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:344,columnNumber:9},void 0)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:343,columnNumber:7},void 0),t||c.name):c.type===Lt.AUDIO?k(Se.jsxDEV(JQ,{asset:c,style:{width:"100%",maxHeight:"100%"}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:365,columnNumber:7},void 0),t||c.name):null:a.size===0?Se.jsxDEV("div",{className:"collimind-asset-embed__loading",style:w},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:322,columnNumber:14},void 0):Se.jsxDEV("div",{className:"collimind-asset-embed__missing",style:w,children:["素材不存在或已删除 (",n.slice(0,8),"…)"]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:325,columnNumber:7},void 0)},XQ=la(Ww.node,()=>(n,e,t)=>{const i=document.createElement("div");i.className="collimind-asset-embed",i.setAttribute("data-asset-id",n.attrs.assetId);let r=n,s=!1,o=TA.createRoot(i);const l=c=>{if(!e.editable)return;const u=t();u!=null&&e.dispatch(e.state.tr.setNodeMarkup(u,void 0,{...r.attrs,...c}))},a=()=>{o==null||o.render(Se.jsxDEV(YQ,{assetId:r.attrs.assetId,assetType:r.attrs.assetType,label:r.attrs.label,width:r.attrs.width??null,height:r.attrs.height??null,selected:s,readonly:!e.editable,updateAttrs:l},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:401,columnNumber:9},void 0))};return a(),{dom:i,update:c=>c.type!==n.type?!1:(r=c,a(),!0),stopEvent:c=>{const u=c.target;return u instanceof HTMLElement?!!u.closest("[data-resize-handle]"):!1},selectNode:()=>{s=!0,i.classList.add("selected"),a()},deselectNode:()=>{s=!1,i.classList.remove("selected"),a()},destroy:()=>{if(o){const c=o;o=null,setTimeout(()=>c.unmount(),0)}}}}),ZQ=[GQ,Ww.node,Ww.ctx,XQ].flat();function zp(n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return Math.round(n);if(typeof n=="string"&&n.trim()){const e=Number.parseInt(n,10);if(Number.isFinite(e)&&e>0)return e}return null}const jw=At("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:""},alt:{default:""},caption:{default:""},ratio:{default:1},width:{default:null},height:{default:null}},parseMarkdown:{match:n=>{var e;if(n.type!=="image-block")return!1;if((e=n.url)!=null&&e.startsWith(Ns)){const t=Vf(n.alt);if(t.assetType&&t.assetType!=="image")return!1}return!0},runner:(n,e,t)=>{const i=typeof e.alt=="string"?e.alt:"",r=aC(e.title),s=mA(i)?Number.parseFloat(i):1;n.addNode(t,{src:e.url,alt:mA(i)?"":i,caption:r.caption,ratio:Number.isFinite(s)&&s>0?s:1,width:r.width??null,height:r.height??null})}},toMarkdown:{match:n=>n.type.name==="image-block",runner:(n,e)=>{const t=C3({width:zp(e.attrs.width),height:zp(e.attrs.height),caption:e.attrs.caption}),i=e.attrs.alt||(!e.attrs.width&&!e.attrs.height&&e.attrs.ratio&&e.attrs.ratio!==1?`${Number.parseFloat(String(e.attrs.ratio)).toFixed(2)}`:"");n.openNode("paragraph"),n.addNode("image",void 0,void 0,{title:t,url:e.attrs.src,alt:i}),n.closeNode()}},toDOM:n=>["div",{"data-type":"opentu-image-block","data-src":n.attrs.src,"data-alt":n.attrs.alt,"data-caption":n.attrs.caption,"data-ratio":n.attrs.ratio,"data-width":n.attrs.width??"","data-height":n.attrs.height??""}],parseDOM:[{tag:'div[data-type="opentu-image-block"]',getAttrs:n=>({src:n.getAttribute("data-src")||"",alt:n.getAttribute("data-alt")||"",caption:n.getAttribute("data-caption")||"",ratio:Number(n.getAttribute("data-ratio")??1)||1,width:zp(n.getAttribute("data-width")),height:zp(n.getAttribute("data-height"))})},{tag:'img[data-type="image-block"]',getAttrs:n=>({src:n.getAttribute("src")||"",alt:"",caption:n.getAttribute("caption")||"",ratio:Number(n.getAttribute("ratio")??1)||1,width:null,height:null})}]}));function Hr(n,e,t){return Math.min(Math.max(n,e),t)}function kA(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.round(n)}function vA(n,e,t){let i=Hr(n,t.minWidth,t.maxWidth),r=i/e;return(r<t.minHeight||r>t.maxHeight)&&(r=Hr(r,t.minHeight,t.maxHeight),i=r*e),{width:Hr(i,t.minWidth,t.maxWidth),height:Hr(r,t.minHeight,t.maxHeight)}}function xA(n,e,t){let i=Hr(n,t.minHeight,t.maxHeight),r=i*e;return(r<t.minWidth||r>t.maxWidth)&&(r=Hr(r,t.minWidth,t.maxWidth),i=r/e),{width:Hr(r,t.minWidth,t.maxWidth),height:Hr(i,t.minHeight,t.maxHeight)}}function QQ({attrs:n,readonly:e,config:t,updateAttrs:i}){const r=le.useRef(null),[s,o]=le.useState(n.src||""),[l,a]=le.useState(!1);le.useEffect(()=>{o(n.src||"")},[n.src]);const c=le.useCallback(()=>{i({src:s.trim()})},[s,i]),u=le.useCallback(async h=>{var d;const f=(d=h.target.files)==null?void 0:d[0];if(f)try{const p=await t.onUpload(f);if(!p)return;o(p),i({src:p})}catch(p){console.error("Failed to upload image block file",p)}finally{h.target.value=""}},[t,i]);return Se.jsxDEV("div",{className:"image-edit collimind-markdown-image-block__edit",children:[Se.jsxDEV("div",{className:"image-icon",children:t.imageIcon||"🌌"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:119,columnNumber:7},this),Se.jsxDEV("div",{className:`link-importer ${l?"focus":""}`,children:[Se.jsxDEV("input",{className:"link-input-area",value:s,disabled:e,onChange:h=>o(h.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),c())}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:121,columnNumber:9},this),!s&&Se.jsxDEV("div",{className:"placeholder",children:[Se.jsxDEV("input",{ref:r,className:"hidden",type:"file",accept:"image/*",disabled:e,onChange:u},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:137,columnNumber:13},this),Se.jsxDEV("button",{type:"button",className:"uploader",disabled:e,onMouseDown:h=>h.preventDefault(),onClick:()=>{var h;return(h=r.current)==null?void 0:h.click()},children:t.uploadButton||"Upload"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:145,columnNumber:13},this),Se.jsxDEV("span",{className:"text",children:t.uploadPlaceholderText},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:154,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:136,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:120,columnNumber:7},this),!!s&&Se.jsxDEV("button",{type:"button",className:"confirm",disabled:e,onMouseDown:h=>h.preventDefault(),onClick:c,children:t.confirmButton||"Confirm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:159,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:118,columnNumber:5},this)}function eee({attrs:n,selected:e,readonly:t,updateAttrs:i}){const r=le.useRef(null),s=le.useSyncExternalStore(AA,_A),[o,l]=le.useState(null);le.useEffect(()=>{l(null)},[n.width,n.height]);const a=le.useMemo(()=>UQ(n.src),[n.src]),c=a?s.get(a):void 0,u=le.useMemo(()=>Vf(n.alt),[n.alt]),h=a?u.label||(c==null?void 0:c.name)||"素材图片":n.alt||"图片",f=le.useMemo(()=>a?!c||c.type!==Lt.IMAGE?null:Ny(c.url):Ny(n.src),[c,a,n.src]),d=(o==null?void 0:o.width)??kA(n.width),p=(o==null?void 0:o.height)??kA(n.height),m=le.useMemo(()=>{const b={};return d?b.width=`${d}px`:b.maxWidth="min(100%, 420px)",p&&(b.height=`${p}px`),b},[p,d]),g=le.useMemo(()=>d&&p?{width:"100%",height:"100%",objectFit:"fill"}:d?{width:"100%",height:"auto"}:p?{width:"auto",height:"100%"}:{width:"100%",height:"auto"},[p,d]),y=le.useCallback(b=>w=>{if(t)return;const x=r.current;if(!x)return;w.preventDefault(),w.stopPropagation();const k=x.getBoundingClientRect();if(!k.width||!k.height)return;const T=x.closest(".ProseMirror"),A=Math.max(120,((T==null?void 0:T.getBoundingClientRect().width)??k.width)-32),B=80,W=80,E=1600,U={x:w.clientX,y:w.clientY,width:k.width,height:k.height};let L={width:Math.round(k.width),height:Math.round(k.height)};const ge=Me=>{const Ne=Me.clientX-U.x,lt=Me.clientY-U.y,oe=Me.shiftKey&&U.width>0&&U.height>0,ae=b==="bottom"?U.width:Hr(U.width+Ne,B,A),Ae=b==="right"?U.height:Hr(U.height+lt,W,E);if(oe){const ye=U.width/U.height,Be={minWidth:B,maxWidth:A,minHeight:W,maxHeight:E};if(b==="right")L=vA(ae,ye,Be);else if(b==="bottom")L=xA(Ae,ye,Be);else{const be=ae/U.width,et=Ae/U.height;L=Math.abs(be-1)>=Math.abs(et-1)?vA(ae,ye,Be):xA(Ae,ye,Be)}L={width:Math.round(L.width),height:Math.round(L.height)},l(L);return}L={width:Math.round(ae),height:Math.round(Ae)},l(L)},ke=()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",ke),l(L),i({width:L.width,height:L.height})};document.addEventListener("pointermove",ge),document.addEventListener("pointerup",ke,{once:!0})},[t,i]);return a&&!c&&s.size===0?Se.jsxDEV("div",{className:"collimind-markdown-image-block__loading"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:355,columnNumber:12},this):f?Se.jsxDEV("div",{className:`collimind-markdown-image-block__shell ${e?"is-selected":""}`,"data-asset-id":a||void 0,children:[Se.jsxDEV("div",{ref:r,className:"collimind-markdown-image-block__frame",style:m,children:[Se.jsxDEV("img",{className:"collimind-markdown-image-block__image",src:f,alt:h,draggable:!1,style:g},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:372,columnNumber:9},this),!t&&e&&Se.jsxDEV(Se.Fragment,{children:[Se.jsxDEV("button",{type:"button","data-resize-handle":"right",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--right",onPointerDown:y("right"),"aria-label":"调整图片宽度"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:381,columnNumber:13},this),Se.jsxDEV("button",{type:"button","data-resize-handle":"bottom",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--bottom",onPointerDown:y("bottom"),"aria-label":"调整图片高度"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:388,columnNumber:13},this),Se.jsxDEV("button",{type:"button","data-resize-handle":"corner",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--corner",onPointerDown:y("corner"),"aria-label":"同时调整图片宽高"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:395,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:380,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:371,columnNumber:7},this),n.caption&&Se.jsxDEV("div",{className:"collimind-markdown-image-block__caption",children:n.caption},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:406,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:367,columnNumber:5},this):Se.jsxDEV("div",{className:"collimind-markdown-image-block__missing",children:a?`图片素材不存在或已删除 (${a.slice(0,8)}…)`:"图片地址无效"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:360,columnNumber:7},this)}function tee(n){return n.attrs.src?Se.jsxDEV(eee,{...n},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:417,columnNumber:10},this):Se.jsxDEV(QQ,{...n},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:414,columnNumber:12},this)}const nee=la(jw.node,n=>{const e=n.get(Pd.key);return(t,i,r)=>{const s=document.createElement("div");s.className="milkdown-image-block collimind-markdown-image-block",s.draggable=!0;let o=t,l=!1,a=TA.createRoot(s);const c=f=>{if(!i.editable)return;const d=r();d!=null&&i.dispatch(i.state.tr.setNodeMarkup(d,void 0,{...o.attrs,...f}))},u=()=>{a==null||a.render(Se.jsxDEV(tee,{attrs:o.attrs,selected:l,readonly:!i.editable,config:e,updateAttrs:c},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:450,columnNumber:9},void 0))};u();const h=f=>{var p;const d=(p=f.detail)==null?void 0:p.src;d&&typeof d=="string"&&c({src:d})};return s.addEventListener("asset-commit",h),{dom:s,update:f=>f.type!==t.type?!1:(o=f,u(),!0),stopEvent:f=>{const d=f.target;return d instanceof HTMLElement?!!(d.closest(".image-edit")||d.closest("[data-resize-handle]")):!1},selectNode:()=>{l=!0,s.classList.add("selected"),u()},deselectNode:()=>{l=!1,s.classList.remove("selected"),u()},destroy:()=>{if(s.removeEventListener("asset-commit",h),a){const f=a;a=null,setTimeout(()=>f.unmount(),0)}}}}}),iee=[jw.node,jw.ctx,nee].flat();function Dy(n){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(typeof i.result=="string"?i.result:""),i.onerror=()=>t(i.error),i.readAsDataURL(n)})}function ree({markdown:n,onChange:e,placeholder:t,readOnly:i,editorRef:r,enableAssetEmbeds:s}){const o=le.useRef(e);le.useEffect(()=>{o.current=e},[e]);const l=le.useRef(n),a=le.useRef(null),c=le.useRef(null),u=le.useRef(null),{get:h,loading:f}=WQ(d=>{const p=new x3({root:d,defaultValue:n,features:{[Pe.CodeMirror]:!0,[Pe.ListItem]:!0,[Pe.LinkTooltip]:!0,[Pe.Cursor]:!0,[Pe.ImageBlock]:!0,[Pe.BlockEdit]:!0,[Pe.Toolbar]:!0,[Pe.Placeholder]:!0,[Pe.Table]:!0,[Pe.Latex]:!0},featureConfigs:{[Pe.Placeholder]:{text:t||"开始编辑..."},[Pe.Cursor]:{color:"#3b82f6",width:4},[Pe.ImageBlock]:{onUpload:Dy,inlineOnUpload:Dy,blockOnUpload:Dy},[Pe.Latex]:{katexOptions:{strict:"ignore"}}}});return p.editor.use(iee),s&&p.editor.use(ZQ),o.current&&p.on(m=>{m.markdownUpdated((g,y)=>{if(a.current&&clearTimeout(a.current),y!==l.current){l.current=y;const b=o.current,w=()=>{c.current=null,b==null||b(y)};c.current=w,a.current=setTimeout(w,50)}})}),u.current=p,p},[]);return le.useEffect(()=>{if(f)return;const d=u.current;if(d){if(i)try{d.setReadonly(!0)}catch{}return r.current={getMarkdown:()=>l.current,setMarkdown:p=>{var m;try{l.current=p,(m=d.editor)==null||m.action(OS(p))}catch{}},insertMarkdown:p=>{var m;try{(m=d.editor)==null||m.action(t8(p))}catch{}},focus:()=>{var p,m;try{(m=(p=d.editor)==null?void 0:p.ctx.get(rt))==null||m.focus()}catch{}}},()=>{var p;a.current&&(clearTimeout(a.current),a.current=null),(p=c.current)==null||p.call(c),c.current=null,r.current=null}}},[h,i,r,f]),le.useEffect(()=>{if(f)return;const d=u.current;if(d)try{d.setReadonly(!!i)}catch{}},[i,f]),le.useEffect(()=>{var p,m;if(f)return;const d=u.current;if(d)try{const g=l.current;n!==g&&(a.current&&(clearTimeout(a.current),a.current=null),(p=c.current)==null||p.call(c),l.current=n,(m=d.editor)==null||m.action(OS(n)))}catch{}},[n,f]),Se.jsxDEV(VQ,{},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:207,columnNumber:10},this)}const CA=le.memo(le.forwardRef(function({markdown:e,sourceMarkdown:t,onChange:i,placeholder:r="开始编辑...",readOnly:s=!1,className:o="",showModeSwitch:l=!0,initialMode:a="wysiwyg",enableAssetEmbeds:c=!1,enableAssetLibraryImagePicker:u=!1},h){const f=le.useContext(N3),d=le.useRef(null),p=le.useRef(null),m=le.useRef(null),g=le.useRef(null),[y,b]=le.useState(a),[w,x]=le.useState(t||e),[k,T]=le.useState(!1),[A,B]=le.useState(!1),[W,E]=le.useState(a!=="wysiwyg"),U=le.useRef(t||e),L=u&&!!f;le.useEffect(()=>{U.current=w},[w]),le.useEffect(()=>{if(y!=="wysiwyg"){E(!1);return}let oe=0,ae=!1;const Ae=()=>{const ye=m.current;if(!ae){if(ye!=null&&ye.isConnected){E(!0);return}oe=requestAnimationFrame(Ae)}};return Ae(),()=>{ae=!0,oe&&cancelAnimationFrame(oe)}},[y]);const ge=le.useCallback(oe=>{var ae,Ae;oe!==y&&(oe==="source"?x(t||((ae=d.current)==null?void 0:ae.getMarkdown())||e):t||((Ae=d.current)==null||Ae.setMarkdown(w),i==null||i(w)),b(oe))},[y,e,w,t,i]),ke=le.useCallback(oe=>{const ae=oe.target.value;x(ae),i==null||i(ae)},[i]),Me=le.useCallback(oe=>{var Ae,ye;if(!oe)return;const ae=y==="source"?U.current:t||((Ae=d.current)==null?void 0:Ae.getMarkdown())||U.current||e;if(y==="source"&&p.current){const Be=p.current,be=Be.selectionStart??ae.length,et=Be.selectionEnd??ae.length,Ee=`${ae.slice(0,be)}${oe}${ae.slice(et)}`;x(Ee),i==null||i(Ee),requestAnimationFrame(()=>{Be.focus();const bt=be+oe.length;Be.setSelectionRange(bt,bt)});return}(ye=d.current)==null||ye.insertMarkdown(oe),requestAnimationFrame(()=>{var be;const Be=(be=d.current)==null?void 0:be.getMarkdown();typeof Be=="string"&&x(Be)})},[e,y,i,t]);le.useImperativeHandle(h,()=>({getMarkdown:()=>{var oe;return y==="source"?w:((oe=d.current)==null?void 0:oe.getMarkdown())||w},setMarkdown:oe=>{var ae;x(oe),(ae=d.current)==null||ae.setMarkdown(oe)},insertMarkdown:Me,focus:()=>{var oe,ae;y==="source"?(oe=p.current)==null||oe.focus():(ae=d.current)==null||ae.focus()},getMode:()=>y,setMode:ge}),[ge,Me,y,w]),le.useEffect(()=>{const oe=t||e;oe!==w&&x(oe)},[e,w,t]);const Ne=le.useCallback(()=>{const oe=m.current;if(!oe){g.current=null,B(!1);return}const ae=oe.ownerDocument.activeElement,Ae=ae instanceof HTMLElement?ae.closest(".image-edit"):null,ye=Ae&&oe.contains(Ae)?Ae:oe.querySelector(".image-edit");g.current=ye??null,B(!!ye)},[]),lt=le.useCallback((oe,ae)=>{if(!oe)return!1;const Ae=oe.closest(".milkdown-image-block");return Ae?(Ae.dispatchEvent(new CustomEvent("asset-commit",{detail:{src:`asset://${ae}`}})),!0):!1},[]);return le.useEffect(()=>{if(!L||s||y!=="wysiwyg"||!m.current){g.current=null,B(!1);return}const oe=m.current;let ae=0;const Ae=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(Ne)},ye=be=>{const et=be.target;if(!(et instanceof HTMLElement))return;const Ee=et.closest(".image-edit");if(Ee&&oe.contains(Ee)){g.current=Ee,B(!0);return}Ae()};Ae(),oe.addEventListener("focusin",ye),oe.addEventListener("click",ye,!0);const Be=new MutationObserver(Ae);return Be.observe(oe,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(ae),Be.disconnect(),oe.removeEventListener("focusin",ye),oe.removeEventListener("click",ye,!0)}},[L,y,s,Ne]),Se.jsxDEV("div",{className:`collimind-markdown-editor ${o}`,"data-readonly":s,"data-mode":y,"data-asset-embeds":c,children:[L&&A&&Se.jsxDEV("button",{type:"button",className:"collimind-markdown-image-library-overlay",style:{right:l?68:8},onClick:()=>{Ne(),g.current&&T(!0)},children:[Se.jsxDEV(R3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:443,columnNumber:13},this),Se.jsxDEV("span",{children:"从素材库插图"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:444,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:432,columnNumber:11},this),l&&Se.jsxDEV("div",{className:"collimind-markdown-editor-mode-switch",children:[Se.jsxDEV("button",{type:"button",className:`collimind-markdown-editor-mode-btn ${y==="wysiwyg"?"active":""}`,onClick:()=>ge("wysiwyg"),title:"所见即所得模式",children:Se.jsxDEV(L3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:456,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:450,columnNumber:13},this),Se.jsxDEV("button",{type:"button",className:`collimind-markdown-editor-mode-btn ${y==="source"?"active":""}`,onClick:()=>ge("source"),title:"Markdown 源码模式",children:Se.jsxDEV(P3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:464,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:458,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:449,columnNumber:11},this),Se.jsxDEV("div",{ref:m,style:{display:y==="wysiwyg"?"contents":"none"},children:W&&Se.jsxDEV(zQ,{children:Se.jsxDEV(ree,{markdown:e,onChange:i,placeholder:r,readOnly:s,editorRef:d,enableAssetEmbeds:c},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:476,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:475,columnNumber:13},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:470,columnNumber:9},this),y==="source"&&Se.jsxDEV("textarea",{ref:p,className:"collimind-markdown-editor-source",value:w,onChange:ke,placeholder:r,readOnly:s||!!t,spellCheck:!1},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:490,columnNumber:11},this),L&&k&&Se.jsxDEV(B3,{isOpen:k,onClose:()=>{T(!1),Ne()},mode:F3.SELECT,filterType:Lt.IMAGE,onSelect:oe=>{var Ae;const ae=g.current??((Ae=m.current)==null?void 0:Ae.querySelector(".image-edit"))??null;if(!lt(ae,oe.id)){T(!1);return}T(!1),requestAnimationFrame(Ne)},selectButtonText:"插入素材库图片"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:502,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:425,columnNumber:7},this)})),Ree=Object.freeze(Object.defineProperty({__proto__:null,MarkdownEditor:CA,default:CA},Symbol.toStringTag,{value:"Module"}));export{jF as $,nY as A,G6 as B,X6 as C,V6 as D,Ge as E,BG as F,m0 as G,Xc as H,ne as I,aG as J,Mee as K,PH as L,Ws as M,Re as N,Ad as O,P,CA as Q,TF as R,Wy as S,Yb as T,Dee as U,fn as V,H as W,RF as X,Iee as Y,cJ as Z,M5 as _,Xg as a,Eee as a0,Aee as a1,_ee as a2,Oee as a3,IF as a4,C5 as a5,xee as a6,ht as a7,Cee as a8,mH as a9,JE as aa,Mk as ab,Ln as ac,n8 as ad,We as ae,dt as af,Si as ag,Ei as ah,Yc as ai,qF as aj,zo as ak,wl as al,sR as am,O as an,Fc as ao,Nee as ap,Ree as aq,aT as b,vn as c,JJ as d,sj as e,jN as f,QF as g,mK as h,mR as i,hY as j,bF as k,e_ as l,Vj as m,vF as n,L6 as o,oK as p,iH as q,h5 as r,rJ as s,E6 as t,WF as u,Zw as v,P5 as w,lH as x,pH as y,jJ as z};
|
|
686
|
+
`}const zw="opentu-image:";function Wg(n){if(!n)return;const e=Number.parseInt(n,10);if(!(!Number.isFinite(e)||e<=0))return e}function C3(n){const e=Wg(n.width==null?null:String(n.width)),t=Wg(n.height==null?null:String(n.height)),i=(n.caption||"").trim();if(!e&&!t)return i||void 0;const r=new URLSearchParams;return e&&r.set("w",String(e)),t&&r.set("h",String(t)),i&&r.set("caption",i),`${zw}${r.toString()}`}function aC(n){const e=(n||"").trim();if(!e)return{caption:"",width:void 0,height:void 0};if(!e.startsWith(zw))return{caption:e,width:void 0,height:void 0};const t=new URLSearchParams(e.slice(zw.length));return{caption:t.get("caption")||"",width:Wg(t.get("w")),height:Wg(t.get("h"))}}function Vf(n){const e=(n||"").trim(),t=e.indexOf("|");if(t<0&&/^(image|video|audio)$/i.test(e))return{assetType:e.toLowerCase(),label:"",rawAlt:e,isAssetAlt:!0};if(t<=0)return{assetType:null,label:e,rawAlt:e,isAssetAlt:!1};const i=e.slice(0,t).trim(),r=e.slice(t+1).trim();return!i||!r?{assetType:null,label:e,rawAlt:e,isAssetAlt:!1}:{assetType:i,label:r,rawAlt:e,isAssetAlt:!0}}function mA(n){const e=(n||"").trim();return/^-?\d+(?:\.\d+)?$/.test(e)}function Iy(n){const e=n.url;if(!(e!=null&&e.startsWith(Ns)))return null;const t=e.slice(Ns.length),i=Vf(n.alt||""),r=i.assetType||"image";if(r==="image")return null;const s=aC(n.title),o=i.label||"";return{type:"assetEmbed",assetId:t,assetType:r,label:o,width:s.width,height:s.height}}function S3(n){if(n.children)for(let e=0;e<n.children.length;e++){const t=n.children[e];if(t.type==="image-block"){const i=Iy(t);if(i){n.children[e]=i;continue}}if(t.type==="paragraph"&&t.children){const i=[],r=[];for(const s of t.children){if(s.type==="image"){const o=Iy(s);if(o){i.push(o);continue}}r.push(s)}if(i.length>0){const s=[];r.length>0&&s.push({...t,children:r}),s.push(...i),n.children.splice(e,1,...s),e+=s.length-1;continue}}if(t.type==="image"){const i=Iy(t);if(i){n.children[e]=i;continue}}S3(t)}}const GQ=hr("remarkAssetEmbed",()=>()=>S3);function Ys(n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return Math.round(n);if(typeof n=="string"&&n.trim()){const e=Number.parseInt(n,10);if(Number.isFinite(e)&&e>0)return e}return null}const Ww=At("assetEmbed",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,atom:!0,attrs:{assetId:{default:""},assetType:{default:"image"},label:{default:""},width:{default:null},height:{default:null}},parseMarkdown:{match:n=>{var e;if(n.type==="assetEmbed")return!0;if(n.type==="image-block"&&((e=n.url)!=null&&e.startsWith(Ns))){const t=Vf(n.alt);if(t.assetType&&t.assetType!=="image")return!0}return!1},runner:(n,e,t)=>{if(e.type==="assetEmbed"){n.addNode(t,{assetId:e.assetId,assetType:e.assetType,label:e.label,width:Ys(e.width),height:Ys(e.height)});return}const i=e.url.slice(Ns.length),r=Vf(e.alt),s=aC(e.title);n.addNode(t,{assetId:i,assetType:r.assetType||"video",label:r.label||"",width:Ys(s.width),height:Ys(s.height)})}},toMarkdown:{match:n=>n.type.name==="assetEmbed",runner:(n,e)=>{const{assetId:t,assetType:i,label:r}=e.attrs,s=r?`${i}|${r}`:i,o=C3({width:Ys(e.attrs.width),height:Ys(e.attrs.height)});n.openNode("paragraph"),n.addNode("image",void 0,void 0,{url:`${Ns}${t}`,alt:s,title:o}),n.closeNode()}},toDOM:n=>["div",{"data-type":"asset-embed","data-asset-id":n.attrs.assetId,"data-asset-type":n.attrs.assetType,"data-label":n.attrs.label,"data-width":n.attrs.width??"","data-height":n.attrs.height??""}],parseDOM:[{tag:'div[data-type="asset-embed"]',getAttrs:n=>({assetId:n.getAttribute("data-asset-id")||"",assetType:n.getAttribute("data-asset-type")||"image",label:n.getAttribute("data-label")||"",width:Ys(n.getAttribute("data-width")),height:Ys(n.getAttribute("data-height"))})}]})),JQ=({asset:n,style:e})=>{const t=le.useMemo(()=>({id:`markdown-audio-${n.id}`,type:"audio",points:[[0,0],[340,128]],children:[],audioUrl:n.url,title:n.name,previewImageUrl:n.thumbnail,prompt:n.prompt,createdAt:n.createdAt}),[n]),i=le.useMemo(()=>[{elementId:t.id,audioUrl:n.url,title:n.name,previewImageUrl:n.thumbnail}],[n.name,n.thumbnail,n.url,t.id]);return Se.jsxDEV("div",{className:"collimind-markdown-audio-card",style:e,children:Se.jsxDEV(I3,{element:t,selected:!1,canvasQueue:i},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/MarkdownAudioAssetCard.tsx",lineNumber:34,columnNumber:7},void 0)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/MarkdownAudioAssetCard.tsx",lineNumber:33,columnNumber:5},void 0)};function gi(n,e,t){return Math.min(Math.max(n,e),t)}function gA(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.round(n)}const qw=Math.round(Gw*1.15);function yA(n,e,t){let i=gi(n,t.minWidth,t.maxWidth),r=i/e;return(r<t.minHeight||r>t.maxHeight)&&(r=gi(r,t.minHeight,t.maxHeight),i=r*e),{width:gi(i,t.minWidth,t.maxWidth),height:gi(r,t.minHeight,t.maxHeight)}}function bA(n,e,t){let i=gi(n,t.minHeight,t.maxHeight),r=i*e;return(r<t.minWidth||r>t.maxWidth)&&(r=gi(r,t.minWidth,t.maxWidth),i=r/e),{width:gi(r,t.minWidth,t.maxWidth),height:gi(i,t.minHeight,t.maxHeight)}}function wA(n){return gi(Math.round(n*Gw/Ry),96,qw)}const YQ=({assetId:n,assetType:e,label:t,width:i,height:r,selected:s,readonly:o,updateAttrs:l})=>{const a=le.useSyncExternalStore(AA,_A),c=a.get(n),u=le.useRef(null),[h,f]=le.useState(null);le.useEffect(()=>{f(null)},[i,r]);const d=(h==null?void 0:h.width)??gA(i),p=(h==null?void 0:h.height)??gA(r),m=d??Ry,g=wA(m),y=e===Lt.AUDIO&&typeof p=="number"&&(p>240||p>m*.75),b=e===Lt.AUDIO?gi(y?g:p??g,96,qw):p,w=le.useMemo(()=>{const T={};return d?T.width=`${d}px`:e===Lt.AUDIO?T.width="min(100%, 560px)":T.maxWidth=e===Lt.AUDIO?"min(100%, 560px)":"min(100%, 520px)",e===Lt.AUDIO?T.height=`${b}px`:p&&(T.height=`${p}px`),T},[e,p,d,b]),x=le.useCallback(T=>A=>{if(o)return;const B=u.current;if(!B)return;A.preventDefault(),A.stopPropagation();const W=B.getBoundingClientRect();if(!W.width||!W.height)return;const E=B.closest(".ProseMirror"),U=Math.max(160,((E==null?void 0:E.getBoundingClientRect().width)??W.width)-32),L=e===Lt.AUDIO?qw:1600,ge=120,ke=e===Lt.AUDIO?96:80,Me={x:A.clientX,y:A.clientY,width:W.width,height:W.height};let Ne={width:Math.round(W.width),height:Math.round(W.height)};const lt=ae=>{const Ae=ae.clientX-Me.x,ye=ae.clientY-Me.y,Be=e!==Lt.AUDIO&&ae.shiftKey&&Me.width>0&&Me.height>0,be=T==="bottom"?Me.width:gi(Me.width+Ae,ge,U),et=T==="right"?Me.height:gi(Me.height+ye,ke,L);if(e===Lt.AUDIO){const Ee=T==="bottom"?gi(Math.round(et*(Ry/Gw)),120,U):Math.round(be),bt=wA(Ee);Ne={width:Ee,height:bt},f(Ne);return}if(Be){const Ee=Me.width/Me.height,bt={minWidth:ge,maxWidth:U,minHeight:ke,maxHeight:L};if(T==="right")Ne=yA(be,Ee,bt);else if(T==="bottom")Ne=bA(et,Ee,bt);else{const en=be/Me.width,pn=et/Me.height;Ne=Math.abs(en-1)>=Math.abs(pn-1)?yA(be,Ee,bt):bA(et,Ee,bt)}Ne={width:Math.round(Ne.width),height:Math.round(Ne.height)},f(Ne);return}Ne={width:Math.round(be),height:Math.round(et)},f(Ne)},oe=()=>{document.removeEventListener("pointermove",lt),document.removeEventListener("pointerup",oe),f(Ne),l({width:Ne.width,height:Ne.height})};document.addEventListener("pointermove",lt),document.addEventListener("pointerup",oe,{once:!0})},[e,o,l]),k=(T,A)=>Se.jsxDEV("div",{className:`collimind-asset-embed__shell ${s?"is-selected":""}`,"data-asset-type":e,"data-asset-id":n,children:[Se.jsxDEV("div",{ref:u,className:"collimind-asset-embed__frame",style:w,children:[T,!o&&s&&Se.jsxDEV(Se.Fragment,{children:[Se.jsxDEV("button",{type:"button","data-resize-handle":"right",className:"collimind-asset-embed__handle collimind-asset-embed__handle--right",onPointerDown:x("right"),"aria-label":`调整${e===Lt.AUDIO?"音频":"视频"}宽度`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:289,columnNumber:13},void 0),Se.jsxDEV("button",{type:"button","data-resize-handle":"bottom",className:"collimind-asset-embed__handle collimind-asset-embed__handle--bottom",onPointerDown:x("bottom"),"aria-label":`调整${e===Lt.AUDIO?"音频":"视频"}高度`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:296,columnNumber:13},void 0),Se.jsxDEV("button",{type:"button","data-resize-handle":"corner",className:"collimind-asset-embed__handle collimind-asset-embed__handle--corner",onPointerDown:x("corner"),"aria-label":`同时调整${e===Lt.AUDIO?"音频":"视频"}宽高`},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:303,columnNumber:13},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:288,columnNumber:11},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:285,columnNumber:7},void 0),A&&Se.jsxDEV("div",{className:"collimind-asset-embed__caption",children:A},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:314,columnNumber:9},void 0)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:280,columnNumber:5},void 0);return c?c.type===Lt.IMAGE?Se.jsxDEV("img",{className:"collimind-asset-embed__image",src:Ny(c.url),alt:t||c.name||"素材图片"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:333,columnNumber:7},void 0):c.type===Lt.VIDEO?k(Se.jsxDEV("div",{className:"collimind-asset-embed__video-wrap",children:Se.jsxDEV(D3,{className:"collimind-asset-embed__video",src:c.url,poster:c.thumbnail,alt:t||c.name||"素材视频",thumbnailSize:"large",activateVideoOnClick:!0,playOnActivate:!0,videoProps:{controls:!0,preload:"metadata",playsInline:!0}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:344,columnNumber:9},void 0)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:343,columnNumber:7},void 0),t||c.name):c.type===Lt.AUDIO?k(Se.jsxDEV(JQ,{asset:c,style:{width:"100%",maxHeight:"100%"}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:365,columnNumber:7},void 0),t||c.name):null:a.size===0?Se.jsxDEV("div",{className:"collimind-asset-embed__loading",style:w},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:322,columnNumber:14},void 0):Se.jsxDEV("div",{className:"collimind-asset-embed__missing",style:w,children:["素材不存在或已删除 (",n.slice(0,8),"…)"]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:325,columnNumber:7},void 0)},XQ=la(Ww.node,()=>(n,e,t)=>{const i=document.createElement("div");i.className="collimind-asset-embed",i.setAttribute("data-asset-id",n.attrs.assetId);let r=n,s=!1,o=TA.createRoot(i);const l=c=>{if(!e.editable)return;const u=t();u!=null&&e.dispatch(e.state.tr.setNodeMarkup(u,void 0,{...r.attrs,...c}))},a=()=>{o==null||o.render(Se.jsxDEV(YQ,{assetId:r.attrs.assetId,assetType:r.attrs.assetType,label:r.attrs.label,width:r.attrs.width??null,height:r.attrs.height??null,selected:s,readonly:!e.editable,updateAttrs:l},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/asset-embed-plugin/view.tsx",lineNumber:401,columnNumber:9},void 0))};return a(),{dom:i,update:c=>c.type!==n.type?!1:(r=c,a(),!0),stopEvent:c=>{const u=c.target;return u instanceof HTMLElement?!!u.closest("[data-resize-handle]"):!1},selectNode:()=>{s=!0,i.classList.add("selected"),a()},deselectNode:()=>{s=!1,i.classList.remove("selected"),a()},destroy:()=>{if(o){const c=o;o=null,setTimeout(()=>c.unmount(),0)}}}}),ZQ=[GQ,Ww.node,Ww.ctx,XQ].flat();function zp(n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return Math.round(n);if(typeof n=="string"&&n.trim()){const e=Number.parseInt(n,10);if(Number.isFinite(e)&&e>0)return e}return null}const jw=At("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:""},alt:{default:""},caption:{default:""},ratio:{default:1},width:{default:null},height:{default:null}},parseMarkdown:{match:n=>{var e;if(n.type!=="image-block")return!1;if((e=n.url)!=null&&e.startsWith(Ns)){const t=Vf(n.alt);if(t.assetType&&t.assetType!=="image")return!1}return!0},runner:(n,e,t)=>{const i=typeof e.alt=="string"?e.alt:"",r=aC(e.title),s=mA(i)?Number.parseFloat(i):1;n.addNode(t,{src:e.url,alt:mA(i)?"":i,caption:r.caption,ratio:Number.isFinite(s)&&s>0?s:1,width:r.width??null,height:r.height??null})}},toMarkdown:{match:n=>n.type.name==="image-block",runner:(n,e)=>{const t=C3({width:zp(e.attrs.width),height:zp(e.attrs.height),caption:e.attrs.caption}),i=e.attrs.alt||(!e.attrs.width&&!e.attrs.height&&e.attrs.ratio&&e.attrs.ratio!==1?`${Number.parseFloat(String(e.attrs.ratio)).toFixed(2)}`:"");n.openNode("paragraph"),n.addNode("image",void 0,void 0,{title:t,url:e.attrs.src,alt:i}),n.closeNode()}},toDOM:n=>["div",{"data-type":"opentu-image-block","data-src":n.attrs.src,"data-alt":n.attrs.alt,"data-caption":n.attrs.caption,"data-ratio":n.attrs.ratio,"data-width":n.attrs.width??"","data-height":n.attrs.height??""}],parseDOM:[{tag:'div[data-type="opentu-image-block"]',getAttrs:n=>({src:n.getAttribute("data-src")||"",alt:n.getAttribute("data-alt")||"",caption:n.getAttribute("data-caption")||"",ratio:Number(n.getAttribute("data-ratio")??1)||1,width:zp(n.getAttribute("data-width")),height:zp(n.getAttribute("data-height"))})},{tag:'img[data-type="image-block"]',getAttrs:n=>({src:n.getAttribute("src")||"",alt:"",caption:n.getAttribute("caption")||"",ratio:Number(n.getAttribute("ratio")??1)||1,width:null,height:null})}]}));function Hr(n,e,t){return Math.min(Math.max(n,e),t)}function kA(n){if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.round(n)}function vA(n,e,t){let i=Hr(n,t.minWidth,t.maxWidth),r=i/e;return(r<t.minHeight||r>t.maxHeight)&&(r=Hr(r,t.minHeight,t.maxHeight),i=r*e),{width:Hr(i,t.minWidth,t.maxWidth),height:Hr(r,t.minHeight,t.maxHeight)}}function xA(n,e,t){let i=Hr(n,t.minHeight,t.maxHeight),r=i*e;return(r<t.minWidth||r>t.maxWidth)&&(r=Hr(r,t.minWidth,t.maxWidth),i=r/e),{width:Hr(r,t.minWidth,t.maxWidth),height:Hr(i,t.minHeight,t.maxHeight)}}function QQ({attrs:n,readonly:e,config:t,updateAttrs:i}){const r=le.useRef(null),[s,o]=le.useState(n.src||""),[l,a]=le.useState(!1);le.useEffect(()=>{o(n.src||"")},[n.src]);const c=le.useCallback(()=>{i({src:s.trim()})},[s,i]),u=le.useCallback(async h=>{var d;const f=(d=h.target.files)==null?void 0:d[0];if(f)try{const p=await t.onUpload(f);if(!p)return;o(p),i({src:p})}catch(p){console.error("Failed to upload image block file",p)}finally{h.target.value=""}},[t,i]);return Se.jsxDEV("div",{className:"image-edit collimind-markdown-image-block__edit",children:[Se.jsxDEV("div",{className:"image-icon",children:t.imageIcon||"🌌"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:119,columnNumber:7},this),Se.jsxDEV("div",{className:`link-importer ${l?"focus":""}`,children:[Se.jsxDEV("input",{className:"link-input-area",value:s,disabled:e,onChange:h=>o(h.target.value),onFocus:()=>a(!0),onBlur:()=>a(!1),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),c())}},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:121,columnNumber:9},this),!s&&Se.jsxDEV("div",{className:"placeholder",children:[Se.jsxDEV("input",{ref:r,className:"hidden",type:"file",accept:"image/*",disabled:e,onChange:u},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:137,columnNumber:13},this),Se.jsxDEV("button",{type:"button",className:"uploader",disabled:e,onMouseDown:h=>h.preventDefault(),onClick:()=>{var h;return(h=r.current)==null?void 0:h.click()},children:t.uploadButton||"Upload"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:145,columnNumber:13},this),Se.jsxDEV("span",{className:"text",children:t.uploadPlaceholderText},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:154,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:136,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:120,columnNumber:7},this),!!s&&Se.jsxDEV("button",{type:"button",className:"confirm",disabled:e,onMouseDown:h=>h.preventDefault(),onClick:c,children:t.confirmButton||"Confirm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:159,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:118,columnNumber:5},this)}function eee({attrs:n,selected:e,readonly:t,updateAttrs:i}){const r=le.useRef(null),s=le.useSyncExternalStore(AA,_A),[o,l]=le.useState(null);le.useEffect(()=>{l(null)},[n.width,n.height]);const a=le.useMemo(()=>UQ(n.src),[n.src]),c=a?s.get(a):void 0,u=le.useMemo(()=>Vf(n.alt),[n.alt]),h=a?u.label||(c==null?void 0:c.name)||"素材图片":n.alt||"图片",f=le.useMemo(()=>a?!c||c.type!==Lt.IMAGE?null:Ny(c.url):Ny(n.src),[c,a,n.src]),d=(o==null?void 0:o.width)??kA(n.width),p=(o==null?void 0:o.height)??kA(n.height),m=le.useMemo(()=>{const b={};return d?b.width=`${d}px`:b.maxWidth="min(100%, 420px)",p&&(b.height=`${p}px`),b},[p,d]),g=le.useMemo(()=>d&&p?{width:"100%",height:"100%",objectFit:"fill"}:d?{width:"100%",height:"auto"}:p?{width:"auto",height:"100%"}:{width:"100%",height:"auto"},[p,d]),y=le.useCallback(b=>w=>{if(t)return;const x=r.current;if(!x)return;w.preventDefault(),w.stopPropagation();const k=x.getBoundingClientRect();if(!k.width||!k.height)return;const T=x.closest(".ProseMirror"),A=Math.max(120,((T==null?void 0:T.getBoundingClientRect().width)??k.width)-32),B=80,W=80,E=1600,U={x:w.clientX,y:w.clientY,width:k.width,height:k.height};let L={width:Math.round(k.width),height:Math.round(k.height)};const ge=Me=>{const Ne=Me.clientX-U.x,lt=Me.clientY-U.y,oe=Me.shiftKey&&U.width>0&&U.height>0,ae=b==="bottom"?U.width:Hr(U.width+Ne,B,A),Ae=b==="right"?U.height:Hr(U.height+lt,W,E);if(oe){const ye=U.width/U.height,Be={minWidth:B,maxWidth:A,minHeight:W,maxHeight:E};if(b==="right")L=vA(ae,ye,Be);else if(b==="bottom")L=xA(Ae,ye,Be);else{const be=ae/U.width,et=Ae/U.height;L=Math.abs(be-1)>=Math.abs(et-1)?vA(ae,ye,Be):xA(Ae,ye,Be)}L={width:Math.round(L.width),height:Math.round(L.height)},l(L);return}L={width:Math.round(ae),height:Math.round(Ae)},l(L)},ke=()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",ke),l(L),i({width:L.width,height:L.height})};document.addEventListener("pointermove",ge),document.addEventListener("pointerup",ke,{once:!0})},[t,i]);return a&&!c&&s.size===0?Se.jsxDEV("div",{className:"collimind-markdown-image-block__loading"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:355,columnNumber:12},this):f?Se.jsxDEV("div",{className:`collimind-markdown-image-block__shell ${e?"is-selected":""}`,"data-asset-id":a||void 0,children:[Se.jsxDEV("div",{ref:r,className:"collimind-markdown-image-block__frame",style:m,children:[Se.jsxDEV("img",{className:"collimind-markdown-image-block__image",src:f,alt:h,draggable:!1,style:g},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:372,columnNumber:9},this),!t&&e&&Se.jsxDEV(Se.Fragment,{children:[Se.jsxDEV("button",{type:"button","data-resize-handle":"right",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--right",onPointerDown:y("right"),"aria-label":"调整图片宽度"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:381,columnNumber:13},this),Se.jsxDEV("button",{type:"button","data-resize-handle":"bottom",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--bottom",onPointerDown:y("bottom"),"aria-label":"调整图片高度"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:388,columnNumber:13},this),Se.jsxDEV("button",{type:"button","data-resize-handle":"corner",className:"collimind-markdown-image-block__handle collimind-markdown-image-block__handle--corner",onPointerDown:y("corner"),"aria-label":"同时调整图片宽高"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:395,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:380,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:371,columnNumber:7},this),n.caption&&Se.jsxDEV("div",{className:"collimind-markdown-image-block__caption",children:n.caption},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:406,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:367,columnNumber:5},this):Se.jsxDEV("div",{className:"collimind-markdown-image-block__missing",children:a?`图片素材不存在或已删除 (${a.slice(0,8)}…)`:"图片地址无效"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:360,columnNumber:7},this)}function tee(n){return n.attrs.src?Se.jsxDEV(eee,{...n},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:417,columnNumber:10},this):Se.jsxDEV(QQ,{...n},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:414,columnNumber:12},this)}const nee=la(jw.node,n=>{const e=n.get(Pd.key);return(t,i,r)=>{const s=document.createElement("div");s.className="milkdown-image-block collimind-markdown-image-block",s.draggable=!0;let o=t,l=!1,a=TA.createRoot(s);const c=f=>{if(!i.editable)return;const d=r();d!=null&&i.dispatch(i.state.tr.setNodeMarkup(d,void 0,{...o.attrs,...f}))},u=()=>{a==null||a.render(Se.jsxDEV(tee,{attrs:o.attrs,selected:l,readonly:!i.editable,config:e,updateAttrs:c},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/image-block-plugin/view.tsx",lineNumber:450,columnNumber:9},void 0))};u();const h=f=>{var p;const d=(p=f.detail)==null?void 0:p.src;d&&typeof d=="string"&&c({src:d})};return s.addEventListener("asset-commit",h),{dom:s,update:f=>f.type!==t.type?!1:(o=f,u(),!0),stopEvent:f=>{const d=f.target;return d instanceof HTMLElement?!!(d.closest(".image-edit")||d.closest("[data-resize-handle]")):!1},selectNode:()=>{l=!0,s.classList.add("selected"),u()},deselectNode:()=>{l=!1,s.classList.remove("selected"),u()},destroy:()=>{if(s.removeEventListener("asset-commit",h),a){const f=a;a=null,setTimeout(()=>f.unmount(),0)}}}}}),iee=[jw.node,jw.ctx,nee].flat();function Dy(n){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(typeof i.result=="string"?i.result:""),i.onerror=()=>t(i.error),i.readAsDataURL(n)})}function ree({markdown:n,onChange:e,placeholder:t,readOnly:i,editorRef:r,enableAssetEmbeds:s}){const o=le.useRef(e);le.useEffect(()=>{o.current=e},[e]);const l=le.useRef(n),a=le.useRef(null),c=le.useRef(null),u=le.useRef(null),{get:h,loading:f}=WQ(d=>{const p=new x3({root:d,defaultValue:n,features:{[Pe.CodeMirror]:!0,[Pe.ListItem]:!0,[Pe.LinkTooltip]:!0,[Pe.Cursor]:!0,[Pe.ImageBlock]:!0,[Pe.BlockEdit]:!0,[Pe.Toolbar]:!0,[Pe.Placeholder]:!0,[Pe.Table]:!0,[Pe.Latex]:!0},featureConfigs:{[Pe.Placeholder]:{text:t||"开始编辑..."},[Pe.Cursor]:{color:"#3b82f6",width:4},[Pe.ImageBlock]:{onUpload:Dy,inlineOnUpload:Dy,blockOnUpload:Dy},[Pe.Latex]:{katexOptions:{strict:"ignore"}}}});return p.editor.use(iee),s&&p.editor.use(ZQ),o.current&&p.on(m=>{m.markdownUpdated((g,y)=>{if(a.current&&clearTimeout(a.current),y!==l.current){l.current=y;const b=o.current,w=()=>{c.current=null,b==null||b(y)};c.current=w,a.current=setTimeout(w,50)}})}),u.current=p,p},[]);return le.useEffect(()=>{if(f)return;const d=u.current;if(d){if(i)try{d.setReadonly(!0)}catch{}return r.current={getMarkdown:()=>l.current,setMarkdown:p=>{var m;try{l.current=p,(m=d.editor)==null||m.action(OS(p))}catch{}},insertMarkdown:p=>{var m;try{(m=d.editor)==null||m.action(t8(p))}catch{}},focus:()=>{var p,m;try{(m=(p=d.editor)==null?void 0:p.ctx.get(rt))==null||m.focus()}catch{}}},()=>{var p;a.current&&(clearTimeout(a.current),a.current=null),(p=c.current)==null||p.call(c),c.current=null,r.current=null}}},[h,i,r,f]),le.useEffect(()=>{if(f)return;const d=u.current;if(d)try{d.setReadonly(!!i)}catch{}},[i,f]),le.useEffect(()=>{var p,m;if(f)return;const d=u.current;if(d)try{const g=l.current;n!==g&&(a.current&&(clearTimeout(a.current),a.current=null),(p=c.current)==null||p.call(c),l.current=n,(m=d.editor)==null||m.action(OS(n)))}catch{}},[n,f]),Se.jsxDEV(VQ,{},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:207,columnNumber:10},this)}const CA=le.memo(le.forwardRef(function({markdown:e,sourceMarkdown:t,onChange:i,placeholder:r="开始编辑...",readOnly:s=!1,className:o="",showModeSwitch:l=!0,initialMode:a="wysiwyg",enableAssetEmbeds:c=!1,enableAssetLibraryImagePicker:u=!1},h){const f=le.useContext(N3),d=le.useRef(null),p=le.useRef(null),m=le.useRef(null),g=le.useRef(null),[y,b]=le.useState(a),[w,x]=le.useState(t||e),[k,T]=le.useState(!1),[A,B]=le.useState(!1),[W,E]=le.useState(a!=="wysiwyg"),U=le.useRef(t||e),L=u&&!!f;le.useEffect(()=>{U.current=w},[w]),le.useEffect(()=>{if(y!=="wysiwyg"){E(!1);return}let oe=0,ae=!1;const Ae=()=>{const ye=m.current;if(!ae){if(ye!=null&&ye.isConnected){E(!0);return}oe=requestAnimationFrame(Ae)}};return Ae(),()=>{ae=!0,oe&&cancelAnimationFrame(oe)}},[y]);const ge=le.useCallback(oe=>{var ae,Ae;oe!==y&&(oe==="source"?x(t||((ae=d.current)==null?void 0:ae.getMarkdown())||e):t||((Ae=d.current)==null||Ae.setMarkdown(w),i==null||i(w)),b(oe))},[y,e,w,t,i]),ke=le.useCallback(oe=>{const ae=oe.target.value;x(ae),i==null||i(ae)},[i]),Me=le.useCallback(oe=>{var Ae,ye;if(!oe)return;const ae=y==="source"?U.current:t||((Ae=d.current)==null?void 0:Ae.getMarkdown())||U.current||e;if(y==="source"&&p.current){const Be=p.current,be=Be.selectionStart??ae.length,et=Be.selectionEnd??ae.length,Ee=`${ae.slice(0,be)}${oe}${ae.slice(et)}`;x(Ee),i==null||i(Ee),requestAnimationFrame(()=>{Be.focus();const bt=be+oe.length;Be.setSelectionRange(bt,bt)});return}(ye=d.current)==null||ye.insertMarkdown(oe),requestAnimationFrame(()=>{var be;const Be=(be=d.current)==null?void 0:be.getMarkdown();typeof Be=="string"&&x(Be)})},[e,y,i,t]);le.useImperativeHandle(h,()=>({getMarkdown:()=>{var oe;return y==="source"?w:((oe=d.current)==null?void 0:oe.getMarkdown())||w},setMarkdown:oe=>{var ae;x(oe),(ae=d.current)==null||ae.setMarkdown(oe)},insertMarkdown:Me,focus:()=>{var oe,ae;y==="source"?(oe=p.current)==null||oe.focus():(ae=d.current)==null||ae.focus()},getMode:()=>y,setMode:ge}),[ge,Me,y,w]),le.useEffect(()=>{const oe=t||e;oe!==w&&x(oe)},[e,w,t]);const Ne=le.useCallback(()=>{const oe=m.current;if(!oe){g.current=null,B(!1);return}const ae=oe.ownerDocument.activeElement,Ae=ae instanceof HTMLElement?ae.closest(".image-edit"):null,ye=Ae&&oe.contains(Ae)?Ae:oe.querySelector(".image-edit");g.current=ye??null,B(!!ye)},[]),lt=le.useCallback((oe,ae)=>{if(!oe)return!1;const Ae=oe.closest(".milkdown-image-block");return Ae?(Ae.dispatchEvent(new CustomEvent("asset-commit",{detail:{src:`asset://${ae}`}})),!0):!1},[]);return le.useEffect(()=>{if(!L||s||y!=="wysiwyg"||!m.current){g.current=null,B(!1);return}const oe=m.current;let ae=0;const Ae=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(Ne)},ye=be=>{const et=be.target;if(!(et instanceof HTMLElement))return;const Ee=et.closest(".image-edit");if(Ee&&oe.contains(Ee)){g.current=Ee,B(!0);return}Ae()};Ae(),oe.addEventListener("focusin",ye),oe.addEventListener("click",ye,!0);const Be=new MutationObserver(Ae);return Be.observe(oe,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(ae),Be.disconnect(),oe.removeEventListener("focusin",ye),oe.removeEventListener("click",ye,!0)}},[L,y,s,Ne]),Se.jsxDEV("div",{className:`collimind-markdown-editor ${o}`,"data-readonly":s,"data-mode":y,"data-asset-embeds":c,children:[L&&A&&Se.jsxDEV("button",{type:"button",className:"collimind-markdown-image-library-overlay",style:{right:l?68:8},onClick:()=>{Ne(),g.current&&T(!0)},children:[Se.jsxDEV(R3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:443,columnNumber:13},this),Se.jsxDEV("span",{children:"从素材库插图"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:444,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:432,columnNumber:11},this),l&&Se.jsxDEV("div",{className:"collimind-markdown-editor-mode-switch",children:[Se.jsxDEV("button",{type:"button",className:`collimind-markdown-editor-mode-btn ${y==="wysiwyg"?"active":""}`,onClick:()=>ge("wysiwyg"),title:"所见即所得模式",children:Se.jsxDEV(L3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:456,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:450,columnNumber:13},this),Se.jsxDEV("button",{type:"button",className:`collimind-markdown-editor-mode-btn ${y==="source"?"active":""}`,onClick:()=>ge("source"),title:"Markdown 源码模式",children:Se.jsxDEV(P3,{className:"collimind-icon-sm"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:464,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:458,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:449,columnNumber:11},this),Se.jsxDEV("div",{ref:m,style:{display:y==="wysiwyg"?"contents":"none"},children:W&&Se.jsxDEV(zQ,{children:Se.jsxDEV(ree,{markdown:e,onChange:i,placeholder:r,readOnly:s,editorRef:d,enableAssetEmbeds:c},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:476,columnNumber:15},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:475,columnNumber:13},this)},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:470,columnNumber:9},this),y==="source"&&Se.jsxDEV("textarea",{ref:p,className:"collimind-markdown-editor-source",value:w,onChange:ke,placeholder:r,readOnly:s||!!t,spellCheck:!1},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:490,columnNumber:11},this),L&&k&&Se.jsxDEV(B3,{isOpen:k,onClose:()=>{T(!1),Ne()},mode:F3.SELECT,filterType:Lt.IMAGE,onSelect:oe=>{var Ae;const ae=g.current??((Ae=m.current)==null?void 0:Ae.querySelector(".image-edit"))??null;if(!lt(ae,oe.id)){T(!1);return}T(!1),requestAnimationFrame(Ne)},selectButtonText:"插入素材库图片"},void 0,!1,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:502,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/ljq/code/shuidiyu/aitu/packages/drawnix/src/components/MarkdownEditor/index.tsx",lineNumber:425,columnNumber:7},this)})),Ree=Object.freeze(Object.defineProperty({__proto__:null,MarkdownEditor:CA,default:CA},Symbol.toStringTag,{value:"Module"}));export{mK as $,Xc as A,m0 as B,wl as C,n8 as D,ne as E,sR as F,Ge as G,O as H,ht as I,Fc as J,Nee as K,Yb as L,CA as M,Mk as N,vn as O,JE as P,Xg as Q,Zw as R,Wy as S,dt as T,sj as U,aT as V,Vj as W,e_ as X,JJ as Y,jN as Z,rJ as _,Ln as a,QF as a0,mR as a1,hY as a2,bF as a3,vF as a4,L6 as a5,oK as a6,iH as a7,h5 as a8,E6 as a9,WF as aa,P5 as ab,lH as ac,pH as ad,jJ as ae,nY as af,G6 as ag,X6 as ah,V6 as ai,BG as aj,aG as ak,Mee as al,PH as am,Ws as an,Re as ao,Ad as ap,Ree as aq,We as b,RF as c,Eee as d,Iee as e,jF as f,cJ as g,fn as h,M5 as i,H as j,Aee as k,Oee as l,Dee as m,_ee as n,IF as o,Cee as p,C5 as q,xee as r,TF as s,P as t,mH as u,Si as v,Ei as w,Yc as x,qF as y,zo as z};
|