@thebase/ui 0.0.5 → 0.0.7
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/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/dist/baseui.esm.js +10 -10
- package/dist/baseui.min.css +1 -1
- package/dist/baseui.min.js +10 -10
- package/dist/baseui.registry.json +5 -6
- package/dist/runtime/milkdown/apl-A2CKMNHU.js +1 -0
- package/dist/runtime/milkdown/asciiarmor-LYWOUGA4.js +1 -0
- package/dist/runtime/milkdown/asn1-NB5F53MP.js +1 -0
- package/dist/runtime/milkdown/asterisk-SIDVUCAX.js +1 -0
- package/dist/runtime/milkdown/block-G2R773CV.js +1 -0
- package/dist/runtime/milkdown/brainfuck-K7DBLI5P.js +1 -0
- package/dist/runtime/milkdown/chunk-2EZOVVY4.js +13 -0
- package/dist/runtime/milkdown/chunk-2FDN6WYA.js +0 -0
- package/dist/runtime/milkdown/chunk-2TBUBNYK.js +3 -0
- package/dist/runtime/milkdown/chunk-2XECCVBE.js +3 -0
- package/dist/runtime/milkdown/chunk-5ILY25KD.js +1 -0
- package/dist/runtime/milkdown/chunk-7GZI2HGN.js +1 -0
- package/dist/runtime/milkdown/chunk-7YQMEBMQ.js +1 -0
- package/dist/runtime/milkdown/chunk-BJC3HW5B.js +1 -0
- package/dist/runtime/milkdown/chunk-CFWAU3WN.js +1 -0
- package/dist/runtime/milkdown/chunk-DLMWAKB5.js +0 -0
- package/dist/runtime/milkdown/chunk-DO4RO6KD.js +0 -0
- package/dist/runtime/milkdown/chunk-DWBFWB4X.js +1 -0
- package/dist/runtime/milkdown/chunk-ILE44FN6.js +1 -0
- package/dist/runtime/milkdown/chunk-IPNUYGNC.js +0 -0
- package/dist/runtime/milkdown/chunk-JA3LDFRC.js +1 -0
- package/dist/runtime/milkdown/chunk-K2ROPYIW.js +1 -0
- package/dist/runtime/milkdown/chunk-KP5VFDTE.js +1 -0
- package/dist/runtime/milkdown/chunk-LDCXUKI3.js +1 -0
- package/dist/runtime/milkdown/chunk-MYC7FIB2.js +4 -0
- package/dist/runtime/milkdown/chunk-NX66TKTH.js +1 -0
- package/dist/runtime/milkdown/chunk-NXQJDWPI.js +1 -0
- package/dist/runtime/milkdown/chunk-OF2BVG4E.js +1 -0
- package/dist/runtime/milkdown/chunk-OQJVATGH.js +4 -0
- package/dist/runtime/milkdown/chunk-R43NMSZO.js +1 -0
- package/dist/runtime/milkdown/chunk-SIRQEE7R.js +1 -0
- package/dist/runtime/milkdown/chunk-SZCOI4YV.js +1 -0
- package/dist/runtime/milkdown/chunk-TEMVRH7B.js +1 -0
- package/dist/runtime/milkdown/chunk-TFG5E5LZ.js +5 -0
- package/dist/runtime/{streaming-WPAF6YN6.js → milkdown/chunk-TOUPIB5N.js} +2 -2
- package/dist/runtime/milkdown/chunk-U6C7MJSD.js +0 -0
- package/dist/runtime/milkdown/chunk-VFZ7ST3H.js +1 -0
- package/dist/runtime/{chunk-SGGMD6DA.js → milkdown/chunk-VJBGANAS.js} +4 -4
- package/dist/runtime/milkdown/chunk-WMT3RNOX.js +13 -0
- package/dist/runtime/milkdown/chunk-XNCXGIZE.js +41 -0
- package/dist/runtime/milkdown/chunk-Y4CBBIL4.js +1 -0
- package/dist/runtime/{chunk-7R75J74M.js → milkdown/chunk-ZGHJJLEG.js} +1 -1
- package/dist/runtime/milkdown/chunk-ZIYJY6SA.js +1 -0
- package/dist/runtime/milkdown/clike-EOWJN572.js +1 -0
- package/dist/runtime/milkdown/clipboard-5NOA4E34.js +1 -0
- package/dist/runtime/milkdown/clojure-VLG72YFE.js +1 -0
- package/dist/runtime/milkdown/cmake-2PXWCEDK.js +1 -0
- package/dist/runtime/milkdown/cobol-PMRFKEKB.js +1 -0
- package/dist/runtime/milkdown/coffeescript-B5G6C2AR.js +1 -0
- package/dist/runtime/milkdown/commonlisp-CFTTVW6U.js +1 -0
- package/dist/runtime/milkdown/commonmark-263P63KC.js +1 -0
- package/dist/runtime/milkdown/core-T2SC7EXQ.js +1 -0
- package/dist/runtime/milkdown/crystal-M6S3MKED.js +1 -0
- package/dist/runtime/milkdown/css-HESFBL5J.js +1 -0
- package/dist/runtime/milkdown/cursor-Z4UWEH5V.js +1 -0
- package/dist/runtime/milkdown/cypher-IIJXY2ZS.js +1 -0
- package/dist/runtime/milkdown/d-ZHLFM7BM.js +1 -0
- package/dist/runtime/milkdown/diff-7YFE6XTG.js +1 -0
- package/dist/runtime/milkdown/diff-K3BORLOX.js +1 -0
- package/dist/runtime/milkdown/dist-24V6SL4V.js +1 -0
- package/dist/runtime/milkdown/dist-34ZP4UZ2.js +1 -0
- package/dist/runtime/milkdown/dist-3LQISA7E.js +3 -0
- package/dist/runtime/milkdown/dist-4QC5HFKT.js +1 -0
- package/dist/runtime/milkdown/dist-562GM6I6.js +1 -0
- package/dist/runtime/milkdown/dist-5QJ34QYN.js +1 -0
- package/dist/runtime/milkdown/dist-657PKZSF.js +1 -0
- package/dist/runtime/milkdown/dist-6TS6SSJR.js +1 -0
- package/dist/runtime/milkdown/dist-7JICPTVR.js +1 -0
- package/dist/runtime/milkdown/dist-DERKVUMC.js +1 -0
- package/dist/runtime/milkdown/dist-MK4VEXBD.js +1 -0
- package/dist/runtime/milkdown/dist-NYN7ZJXK.js +1 -0
- package/dist/runtime/milkdown/dist-OPQE4Z43.js +1 -0
- package/dist/runtime/milkdown/dist-P4TF777A.js +1 -0
- package/dist/runtime/milkdown/dist-PEJBUU6H.js +6 -0
- package/dist/runtime/milkdown/dist-R2X7SQDZ.js +2 -0
- package/dist/runtime/milkdown/dist-RE2FJN7S.js +1 -0
- package/dist/runtime/milkdown/dist-THIQIX3E.js +1 -0
- package/dist/runtime/milkdown/dist-VEPIKH2V.js +7 -0
- package/dist/runtime/milkdown/dist-X22ABN6K.js +1 -0
- package/dist/runtime/milkdown/dist-YH3NI4VG.js +1 -0
- package/dist/runtime/milkdown/dockerfile-2B5D6FTU.js +1 -0
- package/dist/runtime/milkdown/dtd-NPOQOSDS.js +1 -0
- package/dist/runtime/milkdown/dylan-KB7QIKGL.js +1 -0
- package/dist/runtime/milkdown/ebnf-TBCUHQC6.js +1 -0
- package/dist/runtime/milkdown/ecl-OXWKHIHJ.js +1 -0
- package/dist/runtime/milkdown/eiffel-WRBXQVBO.js +1 -0
- package/dist/runtime/milkdown/elm-MZAQSXJY.js +1 -0
- package/dist/runtime/milkdown/erlang-PNSW52ER.js +1 -0
- package/dist/runtime/milkdown/esm-H2D66MX5.js +997 -0
- package/dist/runtime/milkdown/factor-JBYSQG3O.js +1 -0
- package/dist/runtime/milkdown/fcl-6ZY3XINI.js +1 -0
- package/dist/runtime/milkdown/forth-BAIG3TGB.js +1 -0
- package/dist/runtime/milkdown/fortran-MQWYHO5L.js +1 -0
- package/dist/runtime/milkdown/gas-Q6YL6AQO.js +1 -0
- package/dist/runtime/milkdown/gfm-IHXC5DQO.js +1 -0
- package/dist/runtime/milkdown/gherkin-W5ZB2USN.js +1 -0
- package/dist/runtime/milkdown/groovy-JTF2GBED.js +1 -0
- package/dist/runtime/milkdown/haskell-HFE6BWET.js +1 -0
- package/dist/runtime/milkdown/haxe-WWIJK4Z5.js +1 -0
- package/dist/runtime/milkdown/history-VOPZ3HXQ.js +1 -0
- package/dist/runtime/milkdown/http-NZKSSIDP.js +1 -0
- package/dist/runtime/milkdown/idl-CMM2WWSO.js +1 -0
- package/dist/runtime/milkdown/indent-WYLZY3CZ.js +1 -0
- package/dist/runtime/milkdown/javascript-375RXK5M.js +1 -0
- package/dist/runtime/milkdown/julia-BMA4W7GB.js +1 -0
- package/dist/runtime/milkdown/lib-32AGHSKT.js +1 -0
- package/dist/runtime/milkdown/lib-QZEOHNSS.js +1 -0
- package/dist/runtime/milkdown/listener-GNT2L5RH.js +1 -0
- package/dist/runtime/milkdown/livescript-3UKKDN45.js +1 -0
- package/dist/runtime/milkdown/lua-SWEBXZV4.js +1 -0
- package/dist/runtime/milkdown/mathematica-CJOQYQFY.js +1 -0
- package/dist/runtime/milkdown/mbox-Y4XZOKOO.js +1 -0
- package/dist/runtime/{milkdown-editor.js → milkdown/milkdown-editor.js} +1 -1
- package/dist/runtime/milkdown/milkdown-text-editor.js +1 -0
- package/dist/runtime/milkdown/mirc-5HDV5JC4.js +1 -0
- package/dist/runtime/milkdown/mllike-2EOQGIBG.js +1 -0
- package/dist/runtime/milkdown/model-VKXPTJEQ.js +1 -0
- package/dist/runtime/milkdown/modelica-XKNFUSSN.js +1 -0
- package/dist/runtime/milkdown/mscgen-2X7TXJM6.js +1 -0
- package/dist/runtime/milkdown/mumps-R6QPEBAR.js +1 -0
- package/dist/runtime/milkdown/nginx-7TJP7GQA.js +1 -0
- package/dist/runtime/milkdown/nsis-XAIDIMGO.js +1 -0
- package/dist/runtime/milkdown/ntriples-SCDRUUH2.js +1 -0
- package/dist/runtime/milkdown/octave-RV2OSSMQ.js +1 -0
- package/dist/runtime/milkdown/oz-6VL77R5Z.js +1 -0
- package/dist/runtime/milkdown/pascal-TQWMLNUO.js +1 -0
- package/dist/runtime/milkdown/perl-MJLZUOI2.js +1 -0
- package/dist/runtime/milkdown/pig-MQKMXNXN.js +1 -0
- package/dist/runtime/milkdown/powershell-RJOL52GR.js +1 -0
- package/dist/runtime/milkdown/properties-XL2YBZDU.js +1 -0
- package/dist/runtime/milkdown/protobuf-NQWTK3Z6.js +1 -0
- package/dist/runtime/milkdown/pug-SMVC7NDW.js +1 -0
- package/dist/runtime/milkdown/puppet-POQGMO34.js +1 -0
- package/dist/runtime/milkdown/python-NMGCKPUX.js +1 -0
- package/dist/runtime/milkdown/q-ILHJCNOR.js +1 -0
- package/dist/runtime/milkdown/r-XNO7UDHK.js +1 -0
- package/dist/runtime/milkdown/rpm-TPSVG357.js +1 -0
- package/dist/runtime/milkdown/ruby-3ZLDCDCY.js +1 -0
- package/dist/runtime/milkdown/sas-X4IZVM55.js +1 -0
- package/dist/runtime/milkdown/scheme-JSRTR252.js +1 -0
- package/dist/runtime/milkdown/shell-IJ2JLDQQ.js +1 -0
- package/dist/runtime/milkdown/sieve-4ACSKBHV.js +1 -0
- package/dist/runtime/milkdown/slash-3TY5YM2E.js +1 -0
- package/dist/runtime/milkdown/smalltalk-AHTDIHSN.js +1 -0
- package/dist/runtime/milkdown/solr-HDS3YMCJ.js +1 -0
- package/dist/runtime/milkdown/sparql-OPR2SX5E.js +1 -0
- package/dist/runtime/milkdown/spreadsheet-YMJBRXJ6.js +1 -0
- package/dist/runtime/milkdown/sql-4LK5AARR.js +1 -0
- package/dist/runtime/milkdown/stex-CBOLYXFQ.js +1 -0
- package/dist/runtime/milkdown/streaming-S7JA52O3.js +1 -0
- package/dist/runtime/milkdown/stylus-5SYL4OMN.js +1 -0
- package/dist/runtime/milkdown/swift-W3IKYGAN.js +1 -0
- package/dist/runtime/milkdown/tcl-QKBH3MVM.js +1 -0
- package/dist/runtime/milkdown/textile-KRYPADXN.js +1 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/gapcursor/style/gapcursor.css +25 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/tables/style/tables.css +48 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/view/style/prosemirror.css +54 -0
- package/dist/runtime/milkdown/theme/common/ai.css +446 -0
- package/dist/runtime/milkdown/theme/common/block-edit.css +131 -0
- package/dist/runtime/milkdown/theme/common/code-mirror.css +347 -0
- package/dist/runtime/milkdown/theme/common/cursor.css +22 -0
- package/dist/runtime/milkdown/theme/common/diff.css +177 -0
- package/dist/runtime/milkdown/theme/common/image-block.css +384 -0
- package/dist/runtime/milkdown/theme/common/latex.css +42 -0
- package/dist/runtime/milkdown/theme/common/link-tooltip.css +107 -0
- package/dist/runtime/milkdown/theme/common/list-item.css +50 -0
- package/dist/runtime/milkdown/theme/common/placeholder.css +11 -0
- package/dist/runtime/milkdown/theme/common/prosemirror-virtual-cursor/style/virtual-cursor.css +51 -0
- package/dist/runtime/milkdown/theme/common/prosemirror.css +1 -0
- package/dist/runtime/milkdown/theme/common/reset.css +289 -0
- package/dist/runtime/milkdown/theme/common/style.css +15 -0
- package/dist/runtime/milkdown/theme/common/table.css +219 -0
- package/dist/runtime/milkdown/theme/common/toolbar.css +50 -0
- package/dist/runtime/milkdown/theme/common/top-bar.css +152 -0
- package/dist/runtime/milkdown/tiddlywiki-XNSPF27C.js +1 -0
- package/dist/runtime/milkdown/tiki-ZZLJUPPJ.js +1 -0
- package/dist/runtime/milkdown/toml-FCAM6ZFK.js +1 -0
- package/dist/runtime/milkdown/tooltip-5CTXOYIA.js +1 -0
- package/dist/runtime/milkdown/troff-7BWGQP4Z.js +1 -0
- package/dist/runtime/milkdown/ttcn-K3WYQPKS.js +1 -0
- package/dist/runtime/milkdown/ttcn-cfg-LDHTKWFO.js +1 -0
- package/dist/runtime/milkdown/turtle-6Q2P3NLY.js +1 -0
- package/dist/runtime/milkdown/upload-DA4OHNVQ.js +1 -0
- package/dist/runtime/milkdown/utils-H6AH4ARX.js +1 -0
- package/dist/runtime/milkdown/vb-BYDJL3EX.js +1 -0
- package/dist/runtime/milkdown/vbscript-WOMP2PYW.js +1 -0
- package/dist/runtime/milkdown/velocity-ZG7EESTK.js +1 -0
- package/dist/runtime/milkdown/verilog-MW2R7Q2Y.js +1 -0
- package/dist/runtime/milkdown/vhdl-GQOJ6JVT.js +1 -0
- package/dist/runtime/milkdown/webidl-5Q6QYACY.js +1 -0
- package/dist/runtime/milkdown/xquery-MD4ZCF7M.js +1 -0
- package/dist/runtime/milkdown/y-webrtc-VQGJXSXG.js +2 -0
- package/dist/runtime/milkdown/y-websocket-YOL5ECIU.js +2 -0
- package/dist/runtime/milkdown/yacas-EKNE7G24.js +1 -0
- package/dist/runtime/milkdown/yjs-H3MVN7TP.js +1 -0
- package/dist/runtime/milkdown/z80-44FRSRYD.js +1 -0
- package/docs/components/markdown.md +2 -2
- package/docs/components/text-editor.md +73 -7
- package/package.json +4 -2
- package/dist/runtime/block-N5MIBOMO.js +0 -1
- package/dist/runtime/chunk-6X7NT7KH.js +0 -2
- package/dist/runtime/chunk-7R5G6FRT.js +0 -1
- package/dist/runtime/chunk-EAFZBBCI.js +0 -10
- package/dist/runtime/chunk-GF2LJCG5.js +0 -1
- package/dist/runtime/chunk-HKUJH2VC.js +0 -1
- package/dist/runtime/chunk-KX3KYRT7.js +0 -1
- package/dist/runtime/chunk-OESZ7FEN.js +0 -1
- package/dist/runtime/chunk-P3WV3MLS.js +0 -35
- package/dist/runtime/chunk-URTGZHMG.js +0 -3
- package/dist/runtime/chunk-XLIC2WFB.js +0 -1
- package/dist/runtime/clipboard-6EHVQ6GB.js +0 -4
- package/dist/runtime/commonmark-FAT3C7WA.js +0 -1
- package/dist/runtime/core-IEFFKRMW.js +0 -1
- package/dist/runtime/cursor-3BFXMKNC.js +0 -1
- package/dist/runtime/diff-ALMDXB3Z.js +0 -1
- package/dist/runtime/gfm-JUXF3E6O.js +0 -5
- package/dist/runtime/history-OU6CQBOY.js +0 -1
- package/dist/runtime/indent-RP5Y5HNK.js +0 -1
- package/dist/runtime/lib-TTIE4EGJ.js +0 -1
- package/dist/runtime/listener-JBODN3BE.js +0 -1
- package/dist/runtime/prosemirror-text-editor.js +0 -1
- package/dist/runtime/slash-I56NP4SS.js +0 -1
- package/dist/runtime/tooltip-XDWVKIO5.js +0 -1
- package/dist/runtime/upload-MYBCHYBD.js +0 -1
- package/dist/runtime/y-webrtc-WDTQEBWZ.js +0 -1
- package/dist/runtime/yjs-SRZJJJEG.js +0 -1
- /package/dist/runtime/{marked.min.js → marked/marked.min.js} +0 -0
- /package/dist/runtime/{mermaid.esm.min.mjs → mermaid/mermaid.esm.min.mjs} +0 -0
- /package/dist/runtime/{chunk-23NN352E.js → milkdown/chunk-23NN352E.js} +0 -0
- /package/dist/runtime/{chunk-MAWHENWJ.js → milkdown/chunk-MAWHENWJ.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ue}from"./chunk-XLIC2WFB.js";import{Ab as B,B as Se,Ba as L,Bb as ae,Cb as p,Ea as ve,Fa as se,Fb as g,Ga as le,J as Te,K as we,M as Pe,Ma as Ve,Mb as Fe,O as Ye,Oa as K,Pb as Ee,Q as Ae,Qb as De,R as Ce,Rb as q,S as k,Sa as Re,Z as re,Za as W,_ as Me,a as xe,aa as Oe,b as I,c as _e,da as H,h as _,i as Y,ka as ie,rb as ce,s as be,sa as Ne,t as j,ta as J,ua as ke,xa as z,za as A}from"./chunk-SGGMD6DA.js";import{M as ne,N as oe,a as S,c as N,t as te,u as ge,v as ye,x as P,y as X}from"./chunk-EAFZBBCI.js";var h=new X("y-sync"),y=new X("y-undo"),v=new X("yjs-cursor");var Ge=/[\uD800-\uDBFF]/,Qe=/[\uDC00-\uDFFF]/,et=(t,e)=>{let o=0,n=0;for(;o<t.length&&o<e.length&&t[o]===e[o];)o++;for(o>0&&Ge.test(t[o-1])&&o--;n+o<t.length&&n+o<e.length&&t[t.length-n-1]===e[e.length-n-1];)n++;return n>0&&Qe.test(t[t.length-n])&&n--,{index:o,remove:t.length-o-n,insert:e.slice(o,e.length-n)}},Xe=et;var V=null,rt=()=>{let t=V;V=null,t.forEach((e,o)=>{let n=o.state.tr,r=h.getState(o.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((c,i)=>{n.setMeta(i,c)}),o.dispatch(n))})},de=(t,e,o)=>{V||(V=new Map,k(0,rt)),I(V,t,xe).set(e,o)},T=(t,e,o)=>{if(t===0)return L(e,0,e.length===0?-1:0);let n=e._first===null?null:e._first.content.type;for(;n!==null&&e!==n;){if(n instanceof g){if(n._length>=t)return L(n,t,e.length===0?-1:0);if(t-=n._length,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{do n=n._item===null?null:n._item.parent,t--;while(n!==e&&n!==null&&n._item!==null&&n._item.next===null);n!==null&&n!==e&&(n=n._item===null?null:n._item.next.content.type)}}else{let r=(o.get(n)||{nodeSize:0}).nodeSize;if(n._first!==null&&t<r)n=n._first.content.type,t--;else{if(t===1&&n._length===0&&r>1)return new z(n._item===null?null:n._item.id,n._item===null?J(n):null,null);if(t-=r,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{if(t===0)return n=n._item===null?n:n._item.parent,new z(n._item===null?null:n._item.id,n._item===null?J(n):null,null);do n=n._item.parent,t--;while(n!==e&&n._item.next===null);n!==e&&(n=n._item.next.content.type)}}}if(n===null)throw j();if(t===0&&n.constructor!==g&&n!==e)return it(n._item.parent,n._item)}return L(e,e._length,e.length===0?-1:0)},it=(t,e)=>{let o=null,n=null;return t._item===null?n=J(t):o=Ne(t._item.id.client,t._item.id.clock),new z(o,n,e.id)},b=(t,e,o,n)=>{let r=ve(o,t);if(r===null||r.type!==e&&!ke(e,r.type._item))return null;let c=r.type,i=0;if(c.constructor===g)i=r.index;else if(c._item===null||!c._item.deleted){let l=c._first,f=0;for(;f<c._length&&f<r.index&&l!==null;){if(!l.deleted){let s=l.content.type;f++,s instanceof g?i+=s._length:i+=n.get(s).nodeSize}l=l.right}i+=1}for(;c!==e&&c._item!==null;){let l=c._item.parent;if(l._item===null||!l._item.deleted){i+=1;let f=l._first;for(;f!==null;){let s=f.content.type;if(s===c)break;f.deleted||(s instanceof g?i+=s._length:i+=n.get(s).nodeSize),f=f.right}}c=l}return i-1},He=(t,e)=>{let o=t.toArray().map(n=>C(n,e,je())).filter(n=>n!==null);return S.fromArray(o)},st=(t,e)=>e.topNodeType.create(null,He(t,e));function lt(t,e="prosemirror"){let o=new H,n=o.get(e,ae);return n.doc?(Je(t,n),n.doc):o}function Je(t,e){let o=e||new ae,n=o.doc?o.doc:{transact:r=>r(void 0)};return M(n,o,t,{mapping:new Map,isOMark:new Map}),o}var x=(t,e)=>t>>>e|t<<32-e,at=t=>x(t,2)^x(t,13)^x(t,22),ft=t=>x(t,6)^x(t,11)^x(t,25),dt=t=>x(t,7)^x(t,18)^t>>>3,mt=t=>x(t,17)^x(t,19)^t>>>10,ut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ht=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),me=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(ht),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,o=this._W;for(let a=16;a<64;a++)o[a]=mt(o[a-2])+o[a-7]+dt(o[a-15])+o[a-16];let n=e[0],r=e[1],c=e[2],i=e[3],l=e[4],f=e[5],s=e[6],d=e[7];for(let a=0,m,u;a<64;a++)m=d+ft(l)+(l&f^~l&s)+ut[a]+o[a]>>>0,u=at(n)+(n&r^n&c^r&c)>>>0,d=s,s=f,f=l,l=i+m>>>0,i=c,c=r,r=n,n=m+u>>>0;e[0]+=n,e[1]+=r,e[2]+=c,e[3]+=i,e[4]+=l,e[5]+=f,e[6]+=s,e[7]+=d}digest(e){let o=0;for(;o+56<=e.length;){let i=0;for(;i<16&&o+3<e.length;i++)this._W[i]=e[o++]<<24|e[o++]<<16|e[o++]<<8|e[o++];if(o%64!==0){for(this._W.fill(0,i,16);o<e.length;)this._W[i]|=e[o]<<(3-o%4)*8,o++;this._W[i]|=128<<(3-o%4)*8}this._updateHash()}let n=o%64!==0;this._W.fill(0,0,16);let r=0;for(;o<e.length;r++)for(let i=3;i>=0&&o<e.length;i--)this._W[r]|=e[o++]<<i*8;n||(this._W[r-(o%4===0?0:1)]|=128<<(3-o%4)*8),this._W[14]=e.byteLength/536870912,this._W[15]=e.byteLength*8,this._updateHash();let c=new Uint8Array(32);for(let i=0;i<this._H.length;i++)for(let l=0;l<4;l++)c[i*4+l]=this._H[i]>>>(3-l)*8;return c}},ze=t=>new me().digest(t);var gt=t=>{for(let o=6;o<t.length;o++)t[o%6]=t[o%6]^t[o];return t.slice(0,6)},Le=t=>Ye(gt(ze(Ae(t))));var je=()=>({mapping:new Map,isOMark:new Map}),R=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Me(e.ds,t.id),_t=[{light:"#ecd44433",dark:"#ecd444"}],bt=(t,e,o)=>{if(!t.has(o)){if(t.size<e.length){let n=_e();t.forEach(r=>n.add(r)),e=e.filter(r=>!n.has(r))}t.set(o,Se(e))}return t.get(o)},St=(t,{colors:e=_t,colorMapping:o=new Map,permanentUserData:n=null,onFirstRender:r=()=>{},mapping:c}={})=>{let i=!1,l=new $(t,c),f=new P({props:{editable:s=>{let d=h.getState(s);return d.snapshot==null&&d.prevSnapshot==null}},key:h,state:{init:(s,d)=>({type:t,doc:t.doc,binding:l,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:o,permanentUserData:n}),apply:(s,d)=>{let a=s.getMeta(h);if(a!==void 0){d=Object.assign({},d);for(let m in a)d[m]=a[m]}return d.addToHistory=s.getMeta("addToHistory")!==!1,d.isChangeOrigin=a!==void 0&&!!a.isChangeOrigin,d.isUndoRedoOperation=a!==void 0&&!!a.isChangeOrigin&&!!a.isUndoRedoOperation,l.prosemirrorView!==null&&a!==void 0&&(a.snapshot!=null||a.prevSnapshot!=null)&&k(0,()=>{l.prosemirrorView!=null&&(a.restore==null?l._renderSnapshot(a.snapshot,a.prevSnapshot,d):(l._renderSnapshot(a.snapshot,a.snapshot,d),delete d.restore,delete d.snapshot,delete d.prevSnapshot,l.mux(()=>{l._prosemirrorChanged(l.prosemirrorView.state.doc)})))}),d}},view:s=>(l.initView(s),c==null&&l._forceRerender(),r(),{update:()=>{let d=f.getState(s.state);if(d.snapshot==null&&d.prevSnapshot==null&&(i||s.state.doc.content.findDiffStart(s.state.doc.type.createAndFill().content)!==null)){if(i=!0,d.addToHistory===!1&&!d.isChangeOrigin){let a=y.getState(s.state),m=a&&a.undoManager;m&&m.stopCapturing()}l.mux(()=>{d.doc.transact(a=>{a.meta.set("addToHistory",d.addToHistory),l._prosemirrorChanged(s.state.doc)},h)})}},destroy:()=>{l.destroy()}})});return f},Tt=(t,e,o)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new ye(t.doc));else if(e.type==="node"){let n=b(o.doc,o.type,e.anchor,o.mapping);t.setSelection(ge.create(t.doc,n))}else{let n=b(o.doc,o.type,e.anchor,o.mapping),r=b(o.doc,o.type,e.head,o.mapping);if(n!==null&&r!==null){let c=te.between(t.doc.resolve(n),t.doc.resolve(r));t.setSelection(c)}}},F=(t,e)=>({type:e.selection.jsonID,anchor:T(e.selection.anchor,t.type,t.mapping),head:T(e.selection.head,t.type,t.mapping)}),$=class{constructor(e,o=new Map){this.type=e,this.prosemirrorView=null,this.mux=Ue(),this.mapping=o,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=F(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Pe&&this._domSelectionInView===null&&(k(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let o=this.prosemirrorView._root.createRange();o.setStart(e.anchorNode,e.anchorOffset),o.setEnd(e.focusNode,e.focusOffset),o.getClientRects().length===0&&o.startContainer&&o.collapsed&&o.selectNodeContents(o.startContainer);let r=o.getBoundingClientRect(),c=Ce.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||c.clientWidth||0)&&r.top<=(window.innerHeight||c.clientHeight||0)}renderSnapshot(e,o){o||(o=Ve(Oe(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(h,{snapshot:e,prevSnapshot:o}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(n=>C(n,this.prosemirrorView.state.schema,this)).filter(n=>n!==null),o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(S.from(e),0,0));o.setMeta(h,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(o)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,o=this.type.toArray().map(r=>C(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(S.from(o),0,0));if(e){let r=_(Y(e.anchor,0),n.doc.content.size),c=_(Y(e.head,0),n.doc.content.size);n.setSelection(te.create(n.doc,r,c))}this.prosemirrorView.dispatch(n.setMeta(h,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,o,n){let r=this.doc,c=this.type;if(e||(e=K(this.doc)),e instanceof Uint8Array||o instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(o instanceof Uint8Array))&&j(),r=new H({gc:!1}),ie(r,o),o=K(r),ie(r,e),e=K(r),c._item===null){let i=Array.from(this.doc.share.keys()).find(l=>this.doc.share.get(l)===this.type);c=r.getXmlFragment(i)}else{let i=r.store.clients.get(c._item.id.client)??[],l=Re(i,c._item.id.clock);c=i[l].content.type}this.mapping.clear(),this.mux(()=>{r.transact(i=>{let l=n.permanentUserData;l&&l.dss.forEach(a=>{re(i,a,m=>{})});let f=(a,m)=>{let u=a==="added"?l.getUserByClientId(m.client):l.getUserByDeletedId(m);return{user:u,type:a,color:bt(n.colorMapping,n.colors,u)}},s=ce(c,new le(o.ds,e.sv)).map(a=>!a._item.deleted||R(a._item,e)||R(a._item,o)?C(a,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,o,f):null).filter(a=>a!==null),d=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(S.from(s),0,0));this.prosemirrorView.dispatch(d.setMeta(h,{isChangeOrigin:!0}))},h)})}_typeChanged(e,o){if(this.prosemirrorView==null)return;let n=h.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let r=(l,f)=>this.mapping.delete(f);re(o,o.deleteSet,l=>{if(l.constructor===q){let f=l.content.type;f&&this.mapping.delete(f)}}),o.changed.forEach(r),o.changedParentTypes.forEach(r);let c=this.type.toArray().map(l=>Be(l,this.prosemirrorView.state.schema,this)).filter(l=>l!==null),i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new N(S.from(c),0,0));Tt(i,this.beforeTransactionSelection,this),i=i.setMeta(h,{isChangeOrigin:!0,isUndoRedoOperation:o.origin instanceof W}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&i.scrollIntoView(),this.prosemirrorView.dispatch(i)})}_prosemirrorChanged(e){this.doc.transact(()=>{M(this.doc,this.type,e,this),this.beforeTransactionSelection=F(this,this.prosemirrorView.state)},h)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}},Be=(t,e,o,n,r,c)=>{let i=o.mapping.get(t);if(i===void 0){if(t instanceof p)return C(t,e,o,n,r,c);throw be()}return i},C=(t,e,o,n,r,c)=>{let i=[],l=f=>{if(f instanceof p){let s=Be(f,e,o,n,r,c);s!==null&&i.push(s)}else{let s=f._item.right?.content?.type;s instanceof B&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(f.applyDelta([{retain:f.length},...s.toDelta()]),s.doc.transact(a=>{s._item.delete(a)}));let d=wt(f,e,o,n,r,c);d!==null&&d.forEach(a=>{a!==null&&i.push(a)})}};n===void 0||r===void 0?t.toArray().forEach(l):ce(t,new le(r.ds,n.sv)).forEach(l);try{let f=t.getAttributes(n);n!==void 0&&(R(t._item,n)?R(t._item,r)||(f.ychange=c?c("added",t._item.id):{type:"added"}):f.ychange=c?c("removed",t._item.id):{type:"removed"});let s=e.node(t.nodeName,f,i);return o.mapping.set(t,s),s}catch{return t.doc.transact(s=>{t._item.delete(s)},h),o.mapping.delete(t),null}},wt=(t,e,o,n,r,c)=>{let i=[],l=t.toDelta(n,r,c);try{for(let f=0;f<l.length;f++){let s=l[f];i.push(e.text(s.insert,Ot(s.attributes,e)))}}catch{return t.doc.transact(s=>{t._item.delete(s)},h),null}return i},Pt=(t,e)=>{let o=new g,n=t.map(r=>({insert:r.text,attributes:$e(r.marks,e)}));return o.applyDelta(n),e.mapping.set(o,t),o},Yt=(t,e)=>{let o=new p(t.type.name);for(let n in t.attrs){let r=t.attrs[n];r!==null&&n!=="ychange"&&o.setAttribute(n,r)}return o.insert(0,G(t).map(n=>ue(n,e))),e.mapping.set(o,t),o},ue=(t,e)=>t instanceof Array?Pt(t,e):Yt(t,e),Ke=t=>typeof t=="object"&&t!==null,pe=(t,e)=>{let o=Object.keys(t).filter(r=>t[r]!==null),n=o.length===(e==null?0:Object.keys(e).filter(r=>e[r]!==null).length);for(let r=0;r<o.length&&n;r++){let c=o[r],i=t[c],l=e[c];n=c==="ychange"||i===l||Ke(i)&&Ke(l)&&pe(i,l)}return n},G=t=>{let e=t.content.content,o=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.isText){let c=[];for(let i=e[n];n<e.length&&i.isText;i=e[++n])c.push(i);n--,o.push(c)}else o.push(r)}return o},qe=(t,e)=>{let o=t.toDelta();return o.length===e.length&&o.every((n,r)=>n.insert===e[r].text&&Te(n.attributes||{}).length===e[r].marks.length&&we(n.attributes,(c,i)=>{let l=fe(i),f=e[r].marks;return pe(c,f.find(s=>s.type.name===l)?.attrs)}))},E=(t,e)=>{if(t instanceof p&&!(e instanceof Array)&&he(t,e)){let o=G(e);return t._length===o.length&&pe(t.getAttributes(),e.attrs)&&t.toArray().every((n,r)=>E(n,o[r]))}return t instanceof g&&e instanceof Array&&qe(t,e)},Z=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((o,n)=>e[n]===o),We=(t,e,o)=>{let n=t.toArray(),r=G(e),c=r.length,i=n.length,l=_(i,c),f=0,s=0,d=!1;for(;f<l;f++){let a=n[f],m=r[f];if(Z(o.mapping.get(a),m))d=!0;else if(!E(a,m))break}for(;f+s<l;s++){let a=n[i-s-1],m=r[c-s-1];if(Z(o.mapping.get(a),m))d=!0;else if(!E(a,m))break}return{equalityFactor:f+s,foundMappedChild:d}},At=t=>{let e="",o=t._start,n={};for(;o!==null;)o.deleted||(o.countable&&o.content instanceof Ee?e+=o.content.str:o.content instanceof Fe&&(n[o.content.key]=null)),o=o.right;return{str:e,nAttrs:n}},Ct=(t,e,o)=>{o.mapping.set(t,e);let{nAttrs:n,str:r}=At(t),c=e.map(s=>({insert:s.text,attributes:Object.assign({},n,$e(s.marks,o))})),{insert:i,remove:l,index:f}=Xe(r,c.map(s=>s.insert).join(""));t.delete(f,l),t.insert(f,i),t.applyDelta(c.map(s=>({retain:s.insert.length,attributes:s.attributes})))},Mt=/(.*)(--[a-zA-Z0-9+/=]{8})$/,fe=t=>Mt.exec(t)?.[1]??t,Ot=(t,e)=>{let o=[];for(let n in t)o.push(e.mark(fe(n),t[n]));return o},$e=(t,e)=>{let o={};return t.forEach(n=>{if(n.type.name!=="ychange"){let r=I(e.isOMark,n.type,()=>!n.type.excludes(n.type));o[r?`${n.type.name}--${Le(n.toJSON())}`:n.type.name]=n.attrs}}),o},M=(t,e,o,n)=>{if(e instanceof p&&e.nodeName!==o.type.name)throw new Error("node name mismatch!");if(n.mapping.set(e,o),e instanceof p){let a=e.getAttributes(),m=o.attrs;for(let u in m)m[u]!==null?a[u]!==m[u]&&u!=="ychange"&&e.setAttribute(u,m[u]):e.removeAttribute(u);for(let u in a)m[u]===void 0&&e.removeAttribute(u)}let r=G(o),c=r.length,i=e.toArray(),l=i.length,f=_(c,l),s=0,d=0;for(;s<f;s++){let a=i[s],m=r[s];if(!Z(n.mapping.get(a),m))if(E(a,m))n.mapping.set(a,m);else break}for(;d+s<f;d++){let a=i[l-d-1],m=r[c-d-1];if(!Z(n.mapping.get(a),m))if(E(a,m))n.mapping.set(a,m);else break}t.transact(()=>{for(;l-s-d>0&&c-s-d>0;){let m=i[s],u=r[s],w=i[l-d-1],O=r[c-d-1];if(m instanceof g&&u instanceof Array)qe(m,u)||Ct(m,u,n),s+=1;else{let D=m instanceof p&&he(m,u),U=w instanceof p&&he(w,O);if(D&&U){let Q=We(m,u,n),ee=We(w,O,n);Q.foundMappedChild&&!ee.foundMappedChild?U=!1:!Q.foundMappedChild&&ee.foundMappedChild||Q.equalityFactor<ee.equalityFactor?D=!1:U=!1}D?(M(t,m,u,n),s+=1):U?(M(t,w,O,n),d+=1):(n.mapping.delete(e.get(s)),e.delete(s,1),e.insert(s,[ue(u,n)]),s+=1)}}let a=l-s-d;if(l===1&&c===0&&i[0]instanceof g?(n.mapping.delete(i[0]),i[0].delete(0,i[0].length)):a>0&&(e.slice(s,s+a).forEach(m=>n.mapping.delete(m)),e.delete(s,a)),s+d<c){let m=[];for(let u=s;u<c-d;u++)m.push(ue(r[u],n));e.insert(s,m)}},h)},he=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;var Nt=(t,e,o)=>t!==e,kt=t=>{let e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);let o=document.createElement("div");o.setAttribute("style",`background-color: ${t.color}`),o.insertBefore(document.createTextNode(t.name),null);let n=document.createTextNode("\u2060"),r=document.createTextNode("\u2060");return e.insertBefore(n,null),e.insertBefore(o,null),e.insertBefore(r,null),e},vt=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),Vt=/^#[0-9a-fA-F]{6}$/,Ze=(t,e,o,n,r)=>{let c=h.getState(t),i=c.doc,l=[];return c.snapshot!=null||c.prevSnapshot!=null||c.binding.mapping.size===0?oe.create(t.doc,[]):(e.getStates().forEach((f,s)=>{if(o(i.clientID,s,f)&&f.cursor!=null){let d=f.user||{};d.color==null?d.color="#ffa500":Vt.test(d.color)||console.warn("A user uses an unsupported color format",d),d.name==null&&(d.name=`User: ${s}`);let a=b(i,c.type,A(f.cursor.anchor),c.binding.mapping),m=b(i,c.type,A(f.cursor.head),c.binding.mapping);if(a!==null&&m!==null){let u=Y(t.doc.content.size-1,0);a=_(a,u),m=_(m,u),l.push(ne.widget(m,()=>n(d,s),{key:s+"",side:10}));let w=_(a,m),O=Y(a,m);l.push(ne.inline(w,O,r(d,s),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),oe.create(t.doc,l))},hn=(t,{awarenessStateFilter:e=Nt,cursorBuilder:o=kt,selectionBuilder:n=vt,getSelection:r=i=>i.selection}={},c="cursor")=>new P({key:v,state:{init(i,l){return Ze(l,t,e,o,n)},apply(i,l,f,s){let d=h.getState(s),a=i.getMeta(v);return d&&d.isChangeOrigin||a&&a.awarenessUpdated?Ze(s,t,e,o,n):l.map(i.mapping,i.doc)}},props:{decorations:i=>v.getState(i)},view:i=>{let l=()=>{i.docView&&de(i,v,{awarenessUpdated:!0})},f=()=>{let s=h.getState(i.state),d=t.getLocalState()||{};if(i.hasFocus()){let a=r(i.state),m=T(a.anchor,s.type,s.binding.mapping),u=T(a.head,s.type,s.binding.mapping);(d.cursor==null||!se(A(d.cursor.anchor),m)||!se(A(d.cursor.head),u))&&t.setLocalStateField(c,{anchor:m,head:u})}else d.cursor!=null&&b(s.doc,s.type,A(d.cursor.anchor),s.binding.mapping)!==null&&t.setLocalStateField(c,null)};return t.on("change",l),i.dom.addEventListener("focusin",f),i.dom.addEventListener("focusout",f),{update:f,destroy:()=>{i.dom.removeEventListener("focusin",f),i.dom.removeEventListener("focusout",f),t.off("change",l),t.setLocalStateField(c,null)}}}});var Rt=t=>y.getState(t)?.undoManager?.undo()!=null,Ft=t=>y.getState(t)?.undoManager?.redo()!=null,bn=(t,e)=>e==null?y.getState(t)?.undoManager?.canUndo():Rt(t),Sn=(t,e)=>e==null?y.getState(t)?.undoManager?.canRedo():Ft(t),Et=new Set(["paragraph"]),Dt=(t,e)=>!(t instanceof q)||!(t.content instanceof De)||!(t.content.type instanceof B||t.content.type instanceof p&&e.has(t.content.type.nodeName))||t.content.type._length===0,Tn=({protectedNodes:t=Et,trackedOrigins:e=[],undoManager:o=null}={})=>new P({key:y,state:{init:(n,r)=>{let c=h.getState(r),i=o||new W(c.type,{trackedOrigins:new Set([h].concat(e)),deleteFilter:l=>Dt(l,t),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:i,prevSel:null,hasUndoOps:i.undoStack.length>0,hasRedoOps:i.redoStack.length>0}},apply:(n,r,c,i)=>{let l=h.getState(i).binding,f=r.undoManager,s=f.undoStack.length>0,d=f.redoStack.length>0;return l?{undoManager:f,prevSel:F(l,c),hasUndoOps:s,hasRedoOps:d}:s!==r.hasUndoOps||d!==r.hasRedoOps?Object.assign({},r,{hasUndoOps:f.undoStack.length>0,hasRedoOps:f.redoStack.length>0}):r}},view:n=>{let r=h.getState(n.state),c=y.getState(n.state).undoManager;return c.on("stack-item-added",({stackItem:i})=>{let l=r.binding;l&&i.meta.set(l,y.getState(n.state).prevSel)}),c.on("stack-item-popped",({stackItem:i})=>{let l=r.binding;l&&(l.beforeTransactionSelection=i.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{c.destroy()}}}});export{h as a,y as b,v as c,St as d,st as e,lt as f,Je as g,hn as h,Rt as i,Ft as j,bn as k,Sn as l,Tn as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function K(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var p=K;var _=typeof global=="object"&&global&&global.Object===Object&&global,w=_;var $=typeof self=="object"&&self&&self.Object===Object&&self,V=w||$||Function("return this")(),y=V;var X=function(){return y.Date.now()},b=X;var H=/\s/;function J(e){for(var t=e.length;t--&&H.test(e.charAt(t)););return t}var E=J;var Q=/^\s+/;function Y(e){return e&&e.slice(0,E(e)+1).replace(Q,"")}var R=Y;var Z=y.Symbol,m=Z;var A=Object.prototype,ee=A.hasOwnProperty,te=A.toString,g=m?m.toStringTag:void 0;function re(e){var t=ee.call(e,g),a=e[g];try{e[g]=void 0;var o=!0}catch{}var s=te.call(e);return o&&(t?e[g]=a:delete e[g]),s}var L=re;var ae=Object.prototype,oe=ae.toString;function fe(e){return oe.call(e)}var N=fe;var se="[object Null]",le="[object Undefined]",C=m?m.toStringTag:void 0;function ue(e){return e==null?e===void 0?le:se:C&&C in Object(e)?L(e):N(e)}var P=ue;function pe(e){return e!=null&&typeof e=="object"}var M=pe;var de="[object Symbol]";function me(e){return typeof e=="symbol"||M(e)&&P(e)==de}var z=me;var D=NaN,xe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,ce=parseInt;function ge(e){if(typeof e=="number")return e;if(z(e))return D;if(p(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=p(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=R(e);var a=ie.test(e);return a||ne.test(e)?ce(e.slice(2),a?2:8):xe.test(e)?D:+e}var v=ge;var he="Expected a function",ye=Math.max,be=Math.min;function Oe(e,t,a){var o,s,x,d,f,u,i=0,j=!1,n=!1,O=!0;if(typeof e!="function")throw new TypeError(he);t=v(t)||0,p(a)&&(j=!!a.leading,n="maxWait"in a,x=n?ye(v(a.maxWait)||0,t):x,O="trailing"in a?!!a.trailing:O);function I(r){var l=o,c=s;return o=s=void 0,i=r,d=e.apply(c,l),d}function F(r){return i=r,f=setTimeout(h,t),j?I(r):d}function q(r){var l=r-u,c=r-i,B=t-l;return n?be(B,x-c):B}function W(r){var l=r-u,c=r-i;return u===void 0||l>=t||l<0||n&&c>=x}function h(){var r=b();if(W(r))return k(r);f=setTimeout(h,q(r))}function k(r){return f=void 0,O&&o?I(r):(o=s=void 0,d)}function U(){f!==void 0&&clearTimeout(f),i=0,o=u=s=f=void 0}function G(){return f===void 0?d:k(b())}function T(){var r=b(),l=W(r);if(o=arguments,s=this,u=r,l){if(f===void 0)return F(u);if(n)return clearTimeout(f),f=setTimeout(h,t),I(u)}return f===void 0&&(f=setTimeout(h,t)),d}return T.cancel=U,T.flush=G,T}var S=Oe;var Ie="Expected a function";function Te(e,t,a){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Ie);return p(a)&&(o="leading"in a?!!a.leading:o,s="trailing"in a?!!a.trailing:s),S(e,t,{leading:o,maxWait:t,trailing:s})}var ve=Te;export{S as a,ve as b};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{B as Ki,C as Wi,I as Mn,J as Yi,K as Ji,O as Gi,b as Fn,e as Di,f as Vi,g as qi,n as Hi,p as $i,u as mr,w as Ui,x as Yt,y as Jt,z as Qi}from"./chunk-EAFZBBCI.js";import{b as va,c as Ta,d as Aa,f as g,g as C,h as y}from"./chunk-23NN352E.js";var Ts=va((Dg,vs)=>{"use strict";var er=Object.prototype.hasOwnProperty,Es=Object.prototype.toString,ys=Object.defineProperty,ws=Object.getOwnPropertyDescriptor,bs=function(n){return typeof Array.isArray=="function"?Array.isArray(n):Es.call(n)==="[object Array]"},Ss=function(n){if(!n||Es.call(n)!=="[object Object]")return!1;var t=er.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&er.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||er.call(n,i)},Cs=function(n,t){ys&&t.name==="__proto__"?ys(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},Is=function(n,t){if(t==="__proto__")if(er.call(n,t)){if(ws)return ws(n,t).value}else return;return n[t]};vs.exports=function e(){var n,t,r,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(n=arguments[u],n!=null)for(t in n)r=Is(a,t),i=Is(n,t),a!==i&&(c&&i&&(Ss(i)||(o=bs(i)))?(o?(o=!1,s=r&&bs(r)?r:[]):s=r&&Ss(r)?r:{},Cs(a,{name:t,newValue:e(c,s,i)})):typeof i<"u"&&Cs(a,{name:t,newValue:i}));return a}});var X=(function(e){return e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e.aiProviderError="aiProviderError",e.aiBuildContextError="aiBuildContextError",e})({}),Z=class extends Error{constructor(e,n,t){super(n,t),this.name="MilkdownError",this.code=e,t?.cause!==void 0&&(this.cause=t.cause)}},Pa=(e,n)=>typeof n=="function"?"[Function]":n,On=e=>JSON.stringify(e,Pa);function Xi(e){return new Z(X.docTypeError,`Doc type error, unsupported type: ${On(e)}`)}function Zi(e){return new Z(X.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function eo(e){return new Z(X.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function pt(){return new Z(X.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function to(e,n,t){let r=`Cannot create node for ${"name"in e?e.name:e}`,i=s=>{if(s==null)return"null";if(Array.isArray(s))return`[${s.map(i).join(", ")}]`;if(typeof s=="object")return"toJSON"in s&&typeof s.toJSON=="function"?JSON.stringify(s.toJSON()):"spec"in s?JSON.stringify(s.spec):JSON.stringify(s);if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return JSON.stringify(s);if(typeof s=="function")return`[Function: ${s.name||"anonymous"}]`;try{return String(s)}catch{return"[Unserializable]"}},o=[["[Description]",r],["[Attributes]",n],["[Content]",(t??[]).map(s=>s?typeof s=="object"&&"type"in s?`${s}`:i(s):"null")]].reduce((s,[a,u])=>{let l=`${a}: ${i(u)}.`;return s.concat(l)},[]);return new Z(X.createNodeInParserFail,o.join(`
|
|
2
|
-
`))}function dr(){return new Z(X.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function no(e){return new Z(X.parserMatchError,`Cannot match target parser for node: ${On(e)}.`)}function ro(e){return new Z(X.serializerMatchError,`Cannot match target serializer for node: ${On(e)}.`)}function io(e,n){return new Z(X.getAtomFromSchemaFail,`Cannot get ${e}: ${n} from schema.`)}function za(e){return new Z(X.expectDomTypeError,`Expect to be a dom, but get: ${On(e)}.`)}function Rn(){return new Z(X.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 Ec(e){return new Z(X.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function vc(e){return new Z(X.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}function Tc(){return new Z(X.ctxNotBind,"Context not bind, please make sure the plugin has been initialized.")}function Ac(){return new Z(X.missingYjsDoc,"Missing yjs doc, please make sure you have bind one.")}var gr=class{constructor(){this.sliceMap=new Map,this.get=e=>{let n=typeof e=="string"?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!n){let t=typeof e=="string"?e:e.name;throw Zi(t)}return n},this.remove=e=>{let n=typeof e=="string"?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);n&&this.sliceMap.delete(n.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(n=>n.type.name===e):this.sliceMap.has(e.id)}},xe,Te,mt,oo,_a=(oo=class{constructor(e,n,t){C(this,xe);C(this,Te);C(this,mt);y(this,xe,[]),y(this,mt,()=>{g(this,xe).forEach(r=>r(g(this,Te)))}),this.set=r=>{y(this,Te,r),g(this,mt).call(this)},this.get=()=>g(this,Te),this.update=r=>{y(this,Te,r(g(this,Te))),g(this,mt).call(this)},this.type=t,y(this,Te,n),e.set(t.id,this)}on(e){return g(this,xe).push(e),()=>{y(this,xe,g(this,xe).filter(n=>n!==e))}}once(e){let n=this.on(t=>{e(t),n()});return n}off(e){y(this,xe,g(this,xe).filter(n=>n!==e))}offAll(){y(this,xe,[])}},xe=new WeakMap,Te=new WeakMap,mt=new WeakMap,oo),Fa=class{constructor(e,n){this.id=Symbol(`Context-${n}`),this.name=n,this._defaultValue=e,this._typeInfo=()=>{throw pt()}}create(e,n=this._defaultValue){return new _a(e,n,this)}},O=(e,n)=>new Fa(e,n),Gt,Xt,Zt,We,dt,Re,gt,xt,kt,so,Ma=(so=class{constructor(e,n,t){C(this,Gt);C(this,Xt);C(this,Zt);C(this,We);C(this,dt);C(this,Re);C(this,gt);C(this,xt);C(this,kt);y(this,We,new Set),y(this,dt,new Set),y(this,Re,new Map),y(this,gt,new Map),this.read=()=>({metadata:g(this,Gt),injectedSlices:[...g(this,We)].map(r=>({name:typeof r=="string"?r:r.name,value:g(this,xt).call(this,r)})),consumedSlices:[...g(this,dt)].map(r=>({name:typeof r=="string"?r:r.name,value:g(this,xt).call(this,r)})),recordedTimers:[...g(this,Re)].map(([r,{duration:i}])=>({name:r.name,duration:i,status:g(this,kt).call(this,r)})),waitTimers:[...g(this,gt)].map(([r,{duration:i}])=>({name:r.name,duration:i,status:g(this,kt).call(this,r)}))}),this.onRecord=r=>{g(this,Re).set(r,{start:Date.now(),duration:0})},this.onClear=r=>{g(this,Re).delete(r)},this.onDone=r=>{let i=g(this,Re).get(r);i&&(i.duration=Date.now()-i.start)},this.onWait=(r,i)=>{let o=Date.now();i.finally(()=>{g(this,gt).set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{g(this,We).add(r)},this.onRemove=r=>{g(this,We).delete(r)},this.onUse=r=>{g(this,dt).add(r)},y(this,xt,r=>g(this,Xt).get(r).get()),y(this,kt,r=>g(this,Zt).get(r).status),y(this,Xt,e),y(this,Zt,n),y(this,Gt,t)}},Gt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,We=new WeakMap,dt=new WeakMap,Re=new WeakMap,gt=new WeakMap,xt=new WeakMap,kt=new WeakMap,so),Ae,Pe,en,he,yt,uo=(yt=class{constructor(n,t,r){C(this,Ae);C(this,Pe);C(this,en);C(this,he);this.produce=i=>i&&Object.keys(i).length?new yt(g(this,Ae),g(this,Pe),{...i}):this,this.inject=(i,o)=>{let s=i.create(g(this,Ae).sliceMap);return o!=null&&s.set(o),g(this,he)?.onInject(i),this},this.remove=i=>(g(this,Ae).remove(i),g(this,he)?.onRemove(i),this),this.record=i=>(i.create(g(this,Pe).store),g(this,he)?.onRecord(i),this),this.clearTimer=i=>(g(this,Pe).remove(i),g(this,he)?.onClear(i),this),this.isInjected=i=>g(this,Ae).has(i),this.isRecorded=i=>g(this,Pe).has(i),this.use=i=>(g(this,he)?.onUse(i),g(this,Ae).get(i)),this.get=i=>this.use(i).get(),this.set=(i,o)=>this.use(i).set(o),this.update=(i,o)=>this.use(i).update(o),this.timer=i=>g(this,Pe).get(i),this.done=i=>{this.timer(i).done(),g(this,he)?.onDone(i)},this.wait=i=>{let o=this.timer(i).start();return g(this,he)?.onWait(i,o),o},this.waitTimers=async i=>{await Promise.all(this.get(i).map(o=>this.wait(o)))},y(this,Ae,n),y(this,Pe,t),y(this,en,r),r&&y(this,he,new Ma(n,t,r))}get meta(){return g(this,en)}get inspector(){return g(this,he)}},Ae=new WeakMap,Pe=new WeakMap,en=new WeakMap,he=new WeakMap,yt),lo=class{constructor(){this.store=new Map,this.get=e=>{let n=this.store.get(e.id);if(!n)throw eo(e.name);return n},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},wt,Le,bt,ze,St,tn,ao,Oa=(ao=class{constructor(e,n){C(this,wt);C(this,Le);C(this,bt);C(this,ze);C(this,St);C(this,tn);y(this,wt,null),y(this,Le,null),y(this,ze,"pending"),this.start=()=>(g(this,wt)??y(this,wt,new Promise((t,r)=>{y(this,Le,i=>{i instanceof CustomEvent&&i.detail.id===g(this,bt)&&(y(this,ze,"resolved"),g(this,St).call(this),i.stopImmediatePropagation(),t())}),g(this,tn).call(this,()=>{g(this,ze)==="pending"&&y(this,ze,"rejected"),g(this,St).call(this),r(new Error(`Timing ${this.type.name} timeout.`))}),y(this,ze,"pending"),addEventListener(this.type.name,g(this,Le))})),g(this,wt)),this.done=()=>{let t=new CustomEvent(this.type.name,{detail:{id:g(this,bt)}});dispatchEvent(t)},y(this,St,()=>{g(this,Le)&&removeEventListener(this.type.name,g(this,Le))}),y(this,tn,t=>{setTimeout(()=>{t()},this.type.timeout)}),y(this,bt,Symbol(n.name)),this.type=n,e.set(n.id,this)}get status(){return g(this,ze)}},wt=new WeakMap,Le=new WeakMap,bt=new WeakMap,ze=new WeakMap,St=new WeakMap,tn=new WeakMap,ao),Ra=class{constructor(e,n=3e3){this.create=t=>new Oa(t,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=n}},ke=(e,n=3e3)=>new Ra(e,n);var La={};function Ye(e,n){let t=n||La,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return fo(e,r,i)}function fo(e,n,t){if(Ba(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return co(e.children,n,t)}return Array.isArray(e)?co(e,n,t):""}function co(e,n,t){let r=[],i=-1;for(;++i<e.length;)r[i]=fo(e[i],n,t);return r.join("")}function Ba(e){return!!(e&&typeof e=="object")}var ho=document.createElement("i");function Ct(e){let n="&"+e+";";ho.innerHTML=n;let t=ho.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function J(e,n,t,r){let i=e.length,o=0,s;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)s=Array.from(r),s.unshift(n,t),e.splice(...s);else for(t&&e.splice(n,t);o<r.length;)s=r.slice(o,o+1e4),s.unshift(n,0),e.splice(...s),o+=1e4,n+=1e4}function ee(e,n){return e.length>0?(J(e,e.length,0,n),e):n}var po={}.hasOwnProperty;function mo(e){let n={},t=-1;for(;++t<e.length;)Na(n,e[t]);return n}function Na(e,n){let t;for(t in n){let i=(po.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t],s;if(o)for(s in o){po.call(i,s)||(i[s]=[]);let a=o[s];ja(i[s],Array.isArray(a)?a:a?[a]:[])}}}function ja(e,n){let t=-1,r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);J(e,0,0,r)}function Ln(e,n){let t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"\uFFFD":String.fromCodePoint(t)}function _e(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ae=Be(/[A-Za-z]/),te=Be(/[\dA-Za-z]/),go=Be(/[#-'*+\--9=?A-Z^-~]/);function nn(e){return e!==null&&(e<32||e===127)}var rn=Be(/\d/),xo=Be(/[\dA-Fa-f]/),ko=Be(/[!-/:-@[-`{-~]/);function S(e){return e!==null&&e<-2}function Q(e){return e!==null&&(e<0||e===32)}function A(e){return e===-2||e===-1||e===32}var yo=Be(/\p{P}|\p{S}/u),wo=Be(/\s/);function Be(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function z(e,n,t,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return A(u)?(e.enter(t),a(u)):n(u)}function a(u){return A(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}var bo={tokenize:Da};function Da(e){let n=e.attempt(this.parser.constructs.contentInitial,r,i),t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),z(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return S(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var Co={tokenize:Va},So={tokenize:qa};function Va(e){let n=this,t=[],r=0,i,o,s;return a;function a(E){if(r<t.length){let L=t[r];return n.containerState=L[1],e.attempt(L[0].continuation,u,l)(E)}return l(E)}function u(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&q();let L=n.events.length,N=L,k;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type==="chunkFlow"){k=n.events[N][1].end;break}w(r);let j=L;for(;j<n.events.length;)n.events[j][1].end={...k},j++;return J(n.events,N+1,0,n.events.slice(L)),n.events.length=j,l(E)}return a(E)}function l(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return I(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(So,c,h)(E)}function c(E){return i&&q(),w(r),p(E)}function h(E){return n.parser.lazy[n.now().line]=r!==t.length,s=n.now().offset,I(E)}function p(E){return n.containerState={},e.attempt(So,f,I)(E)}function f(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function I(E){if(E===null){i&&q(),w(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(E)}function v(E){if(E===null){R(e.exit("chunkFlow"),!0),w(0),e.consume(E);return}return S(E)?(e.consume(E),R(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),v)}function R(E,L){let N=n.sliceStream(E);if(L&&N.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(N),n.parser.lazy[E.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;let j=n.events.length,$=j,B,H;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(B){H=n.events[$][1].end;break}B=!0}for(w(r),k=j;k<n.events.length;)n.events[k][1].end={...H},k++;J(n.events,$+1,0,n.events.slice(j)),n.events.length=k}}function w(E){let L=t.length;for(;L-- >E;){let N=t[L];n.containerState=N[1],N[0].exit.call(n,e)}t.length=E}function q(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function qa(e,n,t){return z(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function It(e){if(e===null||Q(e)||wo(e))return 1;if(yo(e))return 2}function Et(e,n,t){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}var on={name:"attention",resolveAll:Ha,tokenize:$a};function Ha(e,n){let t=-1,r,i,o,s,a,u,l,c;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;let h={...e[r][1].end},p={...e[t][1].start};Io(h,-u),Io(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[t][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ee(l,[["enter",e[r][1],n],["exit",e[r][1],n]])),l=ee(l,[["enter",i,n],["enter",s,n],["exit",s,n],["enter",o,n]]),l=ee(l,Et(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),l=ee(l,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,l=ee(l,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,J(e,r-1,t-r+3,l),t=r+l.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function $a(e,n){let t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=It(r),o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;let l=e.exit("attentionSequence"),c=It(u),h=!c||c===2&&i||t.includes(u),p=!i||i===2&&c||t.includes(r);return l._open=!!(o===42?h:h&&(i||!p)),l._close=!!(o===42?p:p&&(c||!h)),n(u)}}function Io(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}var xr={name:"autolink",tokenize:Ua};function Ua(e,n,t){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return ae(f)?(e.consume(f),s):f===64?t(f):l(f)}function s(f){return f===43||f===45||f===46||te(f)?(r=1,a(f)):l(f)}function a(f){return f===58?(e.consume(f),r=0,u):(f===43||f===45||f===46||te(f))&&r++<32?(e.consume(f),a):(r=0,l(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):f===null||f===32||f===60||nn(f)?t(f):(e.consume(f),u)}function l(f){return f===64?(e.consume(f),c):go(f)?(e.consume(f),l):t(f)}function c(f){return te(f)?h(f):t(f)}function h(f){return f===46?(e.consume(f),r=0,c):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):p(f)}function p(f){if((f===45||te(f))&&r++<63){let I=f===45?p:h;return e.consume(f),I}return t(f)}}var Ne={partial:!0,tokenize:Qa};function Qa(e,n,t){return r;function r(o){return A(o)?z(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||S(o)?n(o):t(o)}}var Bn={continuation:{tokenize:Wa},exit:Ya,name:"blockQuote",tokenize:Ka};function Ka(e,n,t){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return t(s)}function o(s){return A(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(s))}}function Wa(e,n,t){let r=this;return i;function i(s){return A(s)?z(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Bn,n,t)(s)}}function Ya(e){e.exit("blockQuote")}var Nn={name:"characterEscape",tokenize:Ja};function Ja(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return ko(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}var jn={name:"characterReference",tokenize:Ga};function Ga(e,n,t){let r=this,i=0,o,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=te,c(h))}function l(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=xo,c):(e.enter("characterReferenceValue"),o=7,s=rn,c(h))}function c(h){if(h===59&&i){let p=e.exit("characterReferenceValue");return s===te&&!Ct(r.sliceSerialize(p))?t(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return s(h)&&i++<o?(e.consume(h),c):t(h)}}var Eo={partial:!0,tokenize:Za},Dn={concrete:!0,name:"codeFenced",tokenize:Xa};function Xa(e,n,t){let r=this,i={partial:!0,tokenize:N},o=0,s=0,a;return u;function u(k){return l(k)}function l(k){let j=r.events[r.events.length-1];return o=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===a?(s++,e.consume(k),c):s<3?t(k):(e.exit("codeFencedFenceSequence"),A(k)?z(e,h,"whitespace")(k):h(k))}function h(k){return k===null||S(k)?(e.exit("codeFencedFence"),r.interrupt?n(k):e.check(Eo,v,L)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||S(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):A(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),z(e,f,"whitespace")(k)):k===96&&k===a?t(k):(e.consume(k),p)}function f(k){return k===null||S(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),I(k))}function I(k){return k===null||S(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===a?t(k):(e.consume(k),I)}function v(k){return e.attempt(i,L,R)(k)}function R(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return o>0&&A(k)?z(e,q,"linePrefix",o+1)(k):q(k)}function q(k){return k===null||S(k)?e.check(Eo,v,L)(k):(e.enter("codeFlowValue"),E(k))}function E(k){return k===null||S(k)?(e.exit("codeFlowValue"),q(k)):(e.consume(k),E)}function L(k){return e.exit("codeFenced"),n(k)}function N(k,j,$){let B=0;return H;function H(_){return k.enter("lineEnding"),k.consume(_),k.exit("lineEnding"),ce}function ce(_){return k.enter("codeFencedFence"),A(_)?z(k,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):D(_)}function D(_){return _===a?(k.enter("codeFencedFenceSequence"),T(_)):$(_)}function T(_){return _===a?(B++,k.consume(_),T):B>=s?(k.exit("codeFencedFenceSequence"),A(_)?z(k,F,"whitespace")(_):F(_)):$(_)}function F(_){return _===null||S(_)?(k.exit("codeFencedFence"),j(_)):$(_)}}}function Za(e,n,t){let r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?t(s):n(s)}}var sn={name:"codeIndented",tokenize:tu},eu={partial:!0,tokenize:nu};function tu(e,n,t){let r=this;return i;function i(l){return e.enter("codeIndented"),z(e,o,"linePrefix",5)(l)}function o(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):t(l)}function s(l){return l===null?u(l):S(l)?e.attempt(eu,s,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||S(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),n(l)}}function nu(e,n,t){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?t(s):S(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):z(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(s):S(s)?i(s):t(s)}}var kr={name:"codeText",previous:iu,resolve:ru,tokenize:ou};function ru(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function iu(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ou(e,n,t){let r=this,i=0,o,s;return a;function a(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),i++,u):(e.exit("codeTextSequence"),l(p))}function l(p){return p===null?t(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),l):p===96?(s=e.enter("codeTextSequence"),o=0,h(p)):S(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||S(p)?(e.exit("codeTextData"),l(p)):(e.consume(p),c)}function h(p){return p===96?(e.consume(p),o++,h):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(s.type="codeTextData",c(p))}}var Vn=class{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){let r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){let i=t||0;this.setCursor(Math.trunc(n));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&an(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),an(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),an(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){let t=this.left.splice(n,Number.POSITIVE_INFINITY);an(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);an(this.left,t.reverse())}}};function an(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function qn(e){let n={},t=-1,r,i,o,s,a,u,l,c=new Vn(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,su(c,t)),t=n[t],l=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return J(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function su(e,n){let t=e.get(n)[1],r=e.get(n)[2],i=n-1,o=[],s=t._tokenizer;s||(s=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,h,p=-1,f=t,I=0,v=0,R=[v];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(v=p+1,R.push(v),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):R.pop(),p=R.length;p--;){let w=a.slice(R[p],R[p+1]),q=o.pop();u.push([q,q+w.length-1]),e.splice(q,2,w)}for(u.reverse(),p=-1;++p<u.length;)l[I+u[p][0]]=I+u[p][1],I+=u[p][1]-u[p][0]-1;return l}var yr={resolve:uu,tokenize:lu},au={partial:!0,tokenize:cu};function uu(e){return qn(e),e}function lu(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):S(a)?e.check(au,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function s(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function cu(e,n,t){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),z(e,o,"linePrefix")}function o(s){if(s===null||S(s))return t(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(s):e.interrupt(r.parser.constructs.flow,t,n)(s)}}function Hn(e,n,t,r,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return h;function h(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),p):w===null||w===32||w===41||nn(w)?t(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(w))}function p(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||S(w)?t(w):(e.consume(w),w===92?I:f)}function I(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function v(w){return!c&&(w===null||w===41||Q(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),n(w)):c<l&&w===40?(e.consume(w),c++,v):w===41?(e.consume(w),c--,v):w===null||w===32||w===40||nn(w)?t(w):(e.consume(w),w===92?R:v)}function R(w){return w===40||w===41||w===92?(e.consume(w),v):v(w)}}function $n(e,n,t,r,i,o){let s=this,a=0,u;return l;function l(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),c}function c(f){return a>999||f===null||f===91||f===93&&!u||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?t(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):S(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||S(f)||a++>999?(e.exit("chunkString"),c(f)):(e.consume(f),u||(u=!A(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function Un(e,n,t,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,u):t(p)}function u(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),l(p))}function l(p){return p===s?(e.exit(o),u(s)):p===null?t(p):S(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),z(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||S(p)?(e.exit("chunkString"),l(p)):(e.consume(p),p===92?h:c)}function h(p){return p===s||p===92?(e.consume(p),c):c(p)}}function Je(e,n){let t;return r;function r(i){return S(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):A(i)?z(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}var wr={name:"definition",tokenize:hu},fu={partial:!0,tokenize:pu};function hu(e,n,t){let r=this,i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return $n.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=_e(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):t(f)}function u(f){return Q(f)?Je(e,l)(f):l(f)}function l(f){return Hn(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return e.attempt(fu,h,h)(f)}function h(f){return A(f)?z(e,p,"whitespace")(f):p(f)}function p(f){return f===null||S(f)?(e.exit("definition"),r.parser.defined.push(i),n(f)):t(f)}}function pu(e,n,t){return r;function r(a){return Q(a)?Je(e,i)(a):t(a)}function i(a){return Un(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return A(a)?z(e,s,"whitespace")(a):s(a)}function s(a){return a===null||S(a)?n(a):t(a)}}var br={name:"hardBreakEscape",tokenize:mu};function mu(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return S(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}var Sr={name:"headingAtx",resolve:du,tokenize:gu};function du(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},J(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function gu(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Q(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||S(c)?(e.exit("atxHeading"),n(c)):A(c)?z(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||Q(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var vo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Cr=["pre","script","style","textarea"];var Ir={concrete:!0,name:"htmlFlow",resolveTo:yu,tokenize:wu},xu={partial:!0,tokenize:Su},ku={partial:!0,tokenize:bu};function yu(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function wu(e,n,t){let r=this,i,o,s,a,u;return l;function l(d){return c(d)}function c(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),h}function h(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,v):d===63?(e.consume(d),i=3,r.interrupt?n:m):ae(d)?(e.consume(d),s=String.fromCharCode(d),R):t(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,I):ae(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function f(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function I(d){let oe="CDATA[";return d===oe.charCodeAt(a++)?(e.consume(d),a===oe.length?r.interrupt?n:D:I):t(d)}function v(d){return ae(d)?(e.consume(d),s=String.fromCharCode(d),R):t(d)}function R(d){if(d===null||d===47||d===62||Q(d)){let oe=d===47,Ue=s.toLowerCase();return!oe&&!o&&Cr.includes(Ue)?(i=1,r.interrupt?n(d):D(d)):vo.includes(s.toLowerCase())?(i=6,oe?(e.consume(d),w):r.interrupt?n(d):D(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?q(d):E(d))}return d===45||te(d)?(e.consume(d),s+=String.fromCharCode(d),R):t(d)}function w(d){return d===62?(e.consume(d),r.interrupt?n:D):t(d)}function q(d){return A(d)?(e.consume(d),q):H(d)}function E(d){return d===47?(e.consume(d),H):d===58||d===95||ae(d)?(e.consume(d),L):A(d)?(e.consume(d),E):H(d)}function L(d){return d===45||d===46||d===58||d===95||te(d)?(e.consume(d),L):N(d)}function N(d){return d===61?(e.consume(d),k):A(d)?(e.consume(d),N):E(d)}function k(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,j):A(d)?(e.consume(d),k):$(d)}function j(d){return d===u?(e.consume(d),u=null,B):d===null||S(d)?t(d):(e.consume(d),j)}function $(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||Q(d)?N(d):(e.consume(d),$)}function B(d){return d===47||d===62||A(d)?E(d):t(d)}function H(d){return d===62?(e.consume(d),ce):t(d)}function ce(d){return d===null||S(d)?D(d):A(d)?(e.consume(d),ce):t(d)}function D(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),fe):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),Se):S(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xu,Ce,T)(d)):d===null||S(d)?(e.exit("htmlFlowData"),T(d)):(e.consume(d),D)}function T(d){return e.check(ku,F,Ce)(d)}function F(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),_}function _(d){return d===null||S(d)?T(d):(e.enter("htmlFlowData"),D(d))}function U(d){return d===45?(e.consume(d),m):D(d)}function K(d){return d===47?(e.consume(d),s="",de):D(d)}function de(d){if(d===62){let oe=s.toLowerCase();return Cr.includes(oe)?(e.consume(d),fe):D(d)}return ae(d)&&s.length<8?(e.consume(d),s+=String.fromCharCode(d),de):D(d)}function Se(d){return d===93?(e.consume(d),m):D(d)}function m(d){return d===62?(e.consume(d),fe):d===45&&i===2?(e.consume(d),m):D(d)}function fe(d){return d===null||S(d)?(e.exit("htmlFlowData"),Ce(d)):(e.consume(d),fe)}function Ce(d){return e.exit("htmlFlow"),n(d)}}function bu(e,n,t){let r=this;return i;function i(s){return S(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):t(s)}function o(s){return r.parser.lazy[r.now().line]?t(s):n(s)}}function Su(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ne,n,t)}}var Er={name:"htmlText",tokenize:Cu};function Cu(e,n,t){let r=this,i,o,s;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),l):m===47?(e.consume(m),N):m===63?(e.consume(m),E):ae(m)?(e.consume(m),$):t(m)}function l(m){return m===45?(e.consume(m),c):m===91?(e.consume(m),o=0,I):ae(m)?(e.consume(m),q):t(m)}function c(m){return m===45?(e.consume(m),f):t(m)}function h(m){return m===null?t(m):m===45?(e.consume(m),p):S(m)?(s=h,K(m)):(e.consume(m),h)}function p(m){return m===45?(e.consume(m),f):h(m)}function f(m){return m===62?U(m):m===45?p(m):h(m)}function I(m){let fe="CDATA[";return m===fe.charCodeAt(o++)?(e.consume(m),o===fe.length?v:I):t(m)}function v(m){return m===null?t(m):m===93?(e.consume(m),R):S(m)?(s=v,K(m)):(e.consume(m),v)}function R(m){return m===93?(e.consume(m),w):v(m)}function w(m){return m===62?U(m):m===93?(e.consume(m),w):v(m)}function q(m){return m===null||m===62?U(m):S(m)?(s=q,K(m)):(e.consume(m),q)}function E(m){return m===null?t(m):m===63?(e.consume(m),L):S(m)?(s=E,K(m)):(e.consume(m),E)}function L(m){return m===62?U(m):E(m)}function N(m){return ae(m)?(e.consume(m),k):t(m)}function k(m){return m===45||te(m)?(e.consume(m),k):j(m)}function j(m){return S(m)?(s=j,K(m)):A(m)?(e.consume(m),j):U(m)}function $(m){return m===45||te(m)?(e.consume(m),$):m===47||m===62||Q(m)?B(m):t(m)}function B(m){return m===47?(e.consume(m),U):m===58||m===95||ae(m)?(e.consume(m),H):S(m)?(s=B,K(m)):A(m)?(e.consume(m),B):U(m)}function H(m){return m===45||m===46||m===58||m===95||te(m)?(e.consume(m),H):ce(m)}function ce(m){return m===61?(e.consume(m),D):S(m)?(s=ce,K(m)):A(m)?(e.consume(m),ce):B(m)}function D(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,T):S(m)?(s=D,K(m)):A(m)?(e.consume(m),D):(e.consume(m),F)}function T(m){return m===i?(e.consume(m),i=void 0,_):m===null?t(m):S(m)?(s=T,K(m)):(e.consume(m),T)}function F(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||Q(m)?B(m):(e.consume(m),F)}function _(m){return m===47||m===62||Q(m)?B(m):t(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),de}function de(m){return A(m)?z(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):Se(m)}function Se(m){return e.enter("htmlTextData"),s(m)}}var Ge={name:"labelEnd",resolveAll:Tu,resolveTo:Au,tokenize:Pu},Iu={tokenize:zu},Eu={tokenize:_u},vu={tokenize:Fu};function Tu(e){let n=-1,t=[];for(;++n<e.length;){let r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&J(e,0,e.length,t),e}function Au(e,n){let t=e.length,r=0,i,o,s,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=t);let u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,n],["enter",l,n]],a=ee(a,e.slice(o+1,o+r+3)),a=ee(a,[["enter",c,n]]),a=ee(a,Et(n.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),n)),a=ee(a,[["exit",c,n],e[s-2],e[s-1],["exit",l,n]]),a=ee(a,e.slice(s+1)),a=ee(a,[["exit",u,n]]),J(e,o,e.length,a),e}function Pu(e,n,t){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?h(p):(s=r.parser.defined.includes(_e(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(Iu,c,s?c:h)(p):p===91?e.attempt(Eu,c,s?l:h)(p):s?c(p):h(p)}function l(p){return e.attempt(vu,c,h)(p)}function c(p){return n(p)}function h(p){return o._balanced=!0,t(p)}}function zu(e,n,t){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Q(h)?Je(e,o)(h):o(h)}function o(h){return h===41?c(h):Hn(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Q(h)?Je(e,u)(h):c(h)}function a(h){return t(h)}function u(h){return h===34||h===39||h===40?Un(e,l,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function l(h){return Q(h)?Je(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),n):t(h)}}function _u(e,n,t){let r=this;return i;function i(a){return $n.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(_e(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function s(a){return t(a)}}function Fu(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}var vr={name:"labelStartImage",resolveAll:Ge.resolveAll,tokenize:Mu};function Mu(e,n,t){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):t(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}var Tr={name:"labelStartLink",resolveAll:Ge.resolveAll,tokenize:Ou};function Ou(e,n,t){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}var un={name:"lineEnding",tokenize:Ru};function Ru(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),z(e,n,"linePrefix")}}var Xe={name:"thematicBreak",tokenize:Lu};function Lu(e,n,t){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||S(l))?(e.exit("thematicBreak"),n(l)):t(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),A(l)?z(e,a,"whitespace")(l):a(l))}}var G={continuation:{tokenize:Du},exit:qu,name:"list",tokenize:ju},Bu={partial:!0,tokenize:Hu},Nu={partial:!0,tokenize:Vu};function ju(e,n,t){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){let I=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(I==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:rn(f)){if(r.containerState.type||(r.containerState.type=I,e.enter(I,{_container:!0})),I==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Xe,t,l)(f):l(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return t(f)}function u(f){return rn(f)&&++s<10?(e.consume(f),u):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),l(f)):t(f)}function l(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Ne,r.interrupt?t:c,e.attempt(Bu,p,h))}function c(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function h(f){return A(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):t(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(f)}}function Du(e,n,t){let r=this;return r.containerState._closeFlow=void 0,e.check(Ne,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,z(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!A(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nu,n,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,z(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Vu(e,n,t){let r=this;return z(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?n(o):t(o)}}function qu(e){e.exit(this.containerState.type)}function Hu(e,n,t){let r=this;return z(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!A(o)&&s&&s[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}var Qn={name:"setextUnderline",resolveTo:$u,tokenize:Uu};function $u(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,n]),e}function Uu(e,n,t){let r=this,i;return o;function o(l){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=l,s(l)):t(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),A(l)?z(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||S(l)?(e.exit("setextHeadingLine"),n(l)):t(l)}}var To={tokenize:Qu};function Qu(e){let n=this,t=e.attempt(Ne,r,e.attempt(this.parser.constructs.flowInitial,i,z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(yr,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}var Ao={resolveAll:Fo()},Po=_o("string"),zo=_o("text");function _o(e){return{resolveAll:Fo(e==="text"?Ku:void 0),tokenize:n};function n(t){let r=this,i=this.parser.constructs[e],o=t.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),u}function u(c){return l(c)?(t.exit("data"),o(c)):(t.consume(c),u)}function l(c){if(c===null)return!0;let h=i[c],p=-1;if(h)for(;++p<h.length;){let f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Fo(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Ku(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){let r=e[t-1][1],i=n.sliceStream(r),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){let l={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(t,0,["enter",l,n],["exit",l,n]),t+=2)}t++}return e}var Ar={};Ta(Ar,{attentionMarkers:()=>tl,contentInitial:()=>Yu,disable:()=>nl,document:()=>Wu,flow:()=>Gu,flowInitial:()=>Ju,insideSpan:()=>el,string:()=>Xu,text:()=>Zu});var Wu={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:Bn},Yu={91:wr},Ju={[-2]:sn,[-1]:sn,32:sn},Gu={35:Sr,42:Xe,45:[Qn,Xe],60:Ir,61:Qn,95:Xe,96:Dn,126:Dn},Xu={38:jn,92:Nn},Zu={[-5]:un,[-4]:un,[-3]:un,33:vr,38:jn,42:on,60:[xr,Er],91:Tr,92:[br,Nn],93:Ge,95:on,96:kr},el={null:[on,Ao]},tl={null:[42,95]},nl={null:[]};function Mo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:B(j),check:B($),consume:L,enter:N,exit:k,interrupt:B($,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:R,parser:e,previous:null,sliceSerialize:I,sliceStream:v,write:f},h=n.tokenize.call(c,l),p;return n.resolveAll&&o.push(n),c;function f(T){return s=ee(s,T),q(),s[s.length-1]!==null?[]:(H(n,0),c.events=Et(o,c.events,c),c.events)}function I(T,F){return il(v(T),F)}function v(T){return rl(s,T)}function R(){let{_bufferIndex:T,_index:F,line:_,column:U,offset:K}=r;return{_bufferIndex:T,_index:F,line:_,column:U,offset:K}}function w(T){i[T.line]=T.column,D()}function q(){let T;for(;r._index<s.length;){let F=s[r._index];if(typeof F=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<F.length;)E(F.charCodeAt(r._bufferIndex));else E(F)}}function E(T){u=void 0,p=T,h=h(T)}function L(T){S(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,D()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=T,u=!0}function N(T,F){let _=F||{};return _.type=T,_.start=R(),c.events.push(["enter",_,c]),a.push(_),_}function k(T){let F=a.pop();return F.end=R(),c.events.push(["exit",F,c]),F}function j(T,F){H(T,F.from)}function $(T,F){F.restore()}function B(T,F){return _;function _(U,K,de){let Se,m,fe,Ce;return Array.isArray(U)?oe(U):"tokenize"in U?oe([U]):d(U);function d(Y){return Qt;function Qt(Ie){let Qe=Ie!==null&&Y[Ie],ft=Ie!==null&&Y.null,pr=[...Array.isArray(Qe)?Qe:Qe?[Qe]:[],...Array.isArray(ft)?ft:ft?[ft]:[]];return oe(pr)(Ie)}}function oe(Y){return Se=Y,m=0,Y.length===0?de:Ue(Y[m])}function Ue(Y){return Qt;function Qt(Ie){return Ce=ce(),fe=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?_n(Ie):Y.tokenize.call(F?Object.assign(Object.create(c),F):c,l,hr,_n)(Ie)}}function hr(Y){return u=!0,T(fe,Ce),K}function _n(Y){return u=!0,Ce.restore(),++m<Se.length?Ue(Se[m]):de}}}function H(T,F){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&J(c.events,F,c.events.length-F,T.resolve(c.events.slice(F),c)),T.resolveTo&&(c.events=T.resolveTo(c.events,c))}function ce(){let T=R(),F=c.previous,_=c.currentConstruct,U=c.events.length,K=Array.from(a);return{from:U,restore:de};function de(){r=T,c.previous=F,c.currentConstruct=_,c.events.length=U,a=K,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function rl(e,n){let t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex,s;if(t===i)s=[e[t].slice(r,o)];else{if(s=e.slice(t,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function il(e,n){let t=-1,r=[],i;for(;++t<e.length;){let o=e[t],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
3
|
-
`;break}case-3:{s=`\r
|
|
4
|
-
`;break}case-2:{s=n?" ":" ";break}case-1:{if(!n&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Pr(e){let r={constructs:mo([Ar,...(e||{}).extensions||[]]),content:i(bo),defined:[],document:i(Co),flow:i(To),lazy:{},string:i(Po),text:i(zo)};return r;function i(o){return s;function s(a){return Mo(r,o,a)}}}function zr(e){for(;!qn(e););return e}var Oo=/[\0\t\n\r]/g;function _r(){let e=1,n="",t=!0,r;return i;function i(o,s,a){let u=[],l,c,h,p,f;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),h=0,n="",t&&(o.charCodeAt(0)===65279&&h++,t=void 0);h<o.length;){if(Oo.lastIndex=h,l=Oo.exec(o),p=l&&l.index!==void 0?l.index:o.length,f=o.charCodeAt(p),!l){n=o.slice(h);break}if(f===10&&h===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<p&&(u.push(o.slice(h,p)),e+=p-h),f){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}var ol=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Kn(e){return e.replace(ol,sl)}function sl(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){let i=t.charCodeAt(1),o=i===120||i===88;return Ln(t.slice(o?2:1),o?16:10)}return Ct(t)||e}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ro(e.position):"start"in e||"end"in e?Ro(e):"line"in e||"column"in e?Fr(e):""}function Fr(e){return Lo(e&&e.line)+":"+Lo(e&&e.column)}function Ro(e){return Fr(e&&e.start)+"-"+Fr(e&&e.end)}function Lo(e){return e&&typeof e=="number"?e:1}var No={}.hasOwnProperty;function Mr(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),al(t)(zr(Pr(t).document().write(_r()(e,n,!0))))}function al(e){let n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ni),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(Ri),blockQuote:o(Ie),characterEscape:B,characterReference:B,codeFenced:o(Qe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Qe,s),codeText:o(ft,s),codeTextData:B,data:B,codeFlowValue:B,definition:o(pr),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ya),hardBreakEscape:o(Li),hardBreakTrailing:o(Li),htmlFlow:o(Bi,s),htmlFlowData:B,htmlText:o(Bi,s),htmlTextData:B,image:o(wa),label:s,link:o(Ni),listItem:o(ba),listItemValue:p,listOrdered:o(ji,h),listUnordered:o(ji),paragraph:o(Sa),reference:d,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Ri),strong:o(Ca),thematicBreak:o(Ea)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:Qt,autolinkProtocol:Y,blockQuote:u(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Ue,characterReferenceMarkerNumeric:Ue,characterReferenceValue:hr,characterReference:_n,codeFenced:u(R),codeFencedFence:v,codeFencedFenceInfo:f,codeFencedFenceMeta:I,codeFlowValue:H,codeIndented:u(w),codeText:u(_),codeTextData:H,data:H,definition:u(),definitionDestinationString:L,definitionLabelString:q,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(D),hardBreakTrailing:u(D),htmlFlow:u(T),htmlFlowData:H,htmlText:u(F),htmlTextData:H,image:u(K),label:Se,labelText:de,lineEnding:ce,link:u(U),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:oe,resourceDestinationString:m,resourceTitleString:fe,resource:Ce,setextHeading:u($),setextHeadingLineSequence:j,setextHeadingText:k,strong:u(),thematicBreak:u()}};jo(n,(e||{}).mdastExtensions||[]);let t={};return r;function r(x){let b={type:"root",children:[]},P={stack:[b],tokenStack:[],config:n,enter:a,exit:l,buffer:s,resume:c,data:t},M=[],V=-1;for(;++V<x.length;)if(x[V][1].type==="listOrdered"||x[V][1].type==="listUnordered")if(x[V][0]==="enter")M.push(V);else{let ge=M.pop();V=i(x,ge,V)}for(V=-1;++V<x.length;){let ge=n[x[V][0]];No.call(ge,x[V][1].type)&&ge[x[V][1].type].call(Object.assign({sliceSerialize:x[V][2].sliceSerialize},P),x[V][1])}if(P.tokenStack.length>0){let ge=P.tokenStack[P.tokenStack.length-1];(ge[1]||Bo).call(P,void 0,ge[0])}for(b.position={start:De(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:De(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<n.transforms.length;)b=n.transforms[V](b)||b;return b}function i(x,b,P){let M=b-1,V=-1,ge=!1,Ke,Ee,Kt,Wt;for(;++M<=P;){let se=x[M];switch(se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{se[0]==="enter"?V++:V--,Wt=void 0;break}case"lineEndingBlank":{se[0]==="enter"&&(Ke&&!Wt&&!V&&!Kt&&(Kt=M),Wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Wt=void 0}if(!V&&se[0]==="enter"&&se[1].type==="listItemPrefix"||V===-1&&se[0]==="exit"&&(se[1].type==="listUnordered"||se[1].type==="listOrdered")){if(Ke){let ht=M;for(Ee=void 0;ht--;){let ve=x[ht];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;Ee&&(x[Ee][1].type="lineEndingBlank",ge=!0),ve[1].type="lineEnding",Ee=ht}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}Kt&&(!Ee||Kt<Ee)&&(Ke._spread=!0),Ke.end=Object.assign({},Ee?x[Ee][1].start:se[1].end),x.splice(Ee||M,0,["exit",Ke,se[2]]),M++,P++}if(se[1].type==="listItemPrefix"){let ht={type:"listItem",_spread:!1,start:Object.assign({},se[1].start),end:void 0};Ke=ht,x.splice(M,0,["enter",ht,se[2]]),M++,P++,Kt=void 0,Wt=!0}}}return x[b][1]._spread=ge,P}function o(x,b){return P;function P(M){a.call(this,x(M),M),b&&b.call(this,M)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(x,b,P){this.stack[this.stack.length-1].children.push(x),this.stack.push(x),this.tokenStack.push([b,P||void 0]),x.position={start:De(b.start),end:void 0}}function u(x){return b;function b(P){x&&x.call(this,P),l.call(this,P)}}function l(x,b){let P=this.stack.pop(),M=this.tokenStack.pop();if(M)M[0].type!==x.type&&(b?b.call(this,x,M[0]):(M[1]||Bo).call(this,x,M[0]));else throw new Error("Cannot close `"+x.type+"` ("+je({start:x.start,end:x.end})+"): it\u2019s not open");P.position.end=De(x.end)}function c(){return Ye(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(x){if(this.data.expectingFirstListItemValue){let b=this.stack[this.stack.length-2];b.start=Number.parseInt(this.sliceSerialize(x),10),this.data.expectingFirstListItemValue=void 0}}function f(){let x=this.resume(),b=this.stack[this.stack.length-1];b.lang=x}function I(){let x=this.resume(),b=this.stack[this.stack.length-1];b.meta=x}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function R(){let x=this.resume(),b=this.stack[this.stack.length-1];b.value=x.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let x=this.resume(),b=this.stack[this.stack.length-1];b.value=x.replace(/(\r?\n|\r)$/g,"")}function q(x){let b=this.resume(),P=this.stack[this.stack.length-1];P.label=b,P.identifier=_e(this.sliceSerialize(x)).toLowerCase()}function E(){let x=this.resume(),b=this.stack[this.stack.length-1];b.title=x}function L(){let x=this.resume(),b=this.stack[this.stack.length-1];b.url=x}function N(x){let b=this.stack[this.stack.length-1];if(!b.depth){let P=this.sliceSerialize(x).length;b.depth=P}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(x){let b=this.stack[this.stack.length-1];b.depth=this.sliceSerialize(x).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function B(x){let P=this.stack[this.stack.length-1].children,M=P[P.length-1];(!M||M.type!=="text")&&(M=Ia(),M.position={start:De(x.start),end:void 0},P.push(M)),this.stack.push(M)}function H(x){let b=this.stack.pop();b.value+=this.sliceSerialize(x),b.position.end=De(x.end)}function ce(x){let b=this.stack[this.stack.length-1];if(this.data.atHardBreak){let P=b.children[b.children.length-1];P.position.end=De(x.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(b.type)&&(B.call(this,x),H.call(this,x))}function D(){this.data.atHardBreak=!0}function T(){let x=this.resume(),b=this.stack[this.stack.length-1];b.value=x}function F(){let x=this.resume(),b=this.stack[this.stack.length-1];b.value=x}function _(){let x=this.resume(),b=this.stack[this.stack.length-1];b.value=x}function U(){let x=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=b,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function K(){let x=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=b,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function de(x){let b=this.sliceSerialize(x),P=this.stack[this.stack.length-2];P.label=Kn(b),P.identifier=_e(b).toLowerCase()}function Se(){let x=this.stack[this.stack.length-1],b=this.resume(),P=this.stack[this.stack.length-1];if(this.data.inReference=!0,P.type==="link"){let M=x.children;P.children=M}else P.alt=b}function m(){let x=this.resume(),b=this.stack[this.stack.length-1];b.url=x}function fe(){let x=this.resume(),b=this.stack[this.stack.length-1];b.title=x}function Ce(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function oe(x){let b=this.resume(),P=this.stack[this.stack.length-1];P.label=b,P.identifier=_e(this.sliceSerialize(x)).toLowerCase(),this.data.referenceType="full"}function Ue(x){this.data.characterReferenceType=x.type}function hr(x){let b=this.sliceSerialize(x),P=this.data.characterReferenceType,M;P?(M=Ln(b,P==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):M=Ct(b);let V=this.stack[this.stack.length-1];V.value+=M}function _n(x){let b=this.stack.pop();b.position.end=De(x.end)}function Y(x){H.call(this,x);let b=this.stack[this.stack.length-1];b.url=this.sliceSerialize(x)}function Qt(x){H.call(this,x);let b=this.stack[this.stack.length-1];b.url="mailto:"+this.sliceSerialize(x)}function Ie(){return{type:"blockquote",children:[]}}function Qe(){return{type:"code",lang:null,meta:null,value:""}}function ft(){return{type:"inlineCode",value:""}}function pr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ya(){return{type:"emphasis",children:[]}}function Ri(){return{type:"heading",depth:0,children:[]}}function Li(){return{type:"break"}}function Bi(){return{type:"html",value:""}}function wa(){return{type:"image",title:null,url:"",alt:null}}function Ni(){return{type:"link",title:null,url:"",children:[]}}function ji(x){return{type:"list",ordered:x.type==="listOrdered",start:null,spread:x._spread,children:[]}}function ba(x){return{type:"listItem",spread:x._spread,checked:null,children:[]}}function Sa(){return{type:"paragraph",children:[]}}function Ca(){return{type:"strong",children:[]}}function Ia(){return{type:"text",value:""}}function Ea(){return{type:"thematicBreak"}}}function De(e){return{line:e.line,column:e.column,offset:e.offset}}function jo(e,n){let t=-1;for(;++t<n.length;){let r=n[t];Array.isArray(r)?jo(e,r):ul(e,r)}}function ul(e,n){let t;for(t in n)if(No.call(n,t))switch(t){case"canContainEols":{let r=n[t];r&&e[t].push(...r);break}case"transforms":{let r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{let r=n[t];r&&Object.assign(e[t],r);break}}}function Bo(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+je({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is still open")}function vt(e){let n=this;n.parser=t;function t(r){return Mr(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}var Do={}.hasOwnProperty;function Vo(e,n){let t=n||{};function r(i,...o){let s=r.invalid,a=r.handlers;if(i&&Do.call(i,e)){let u=String(i[e]);s=Do.call(a,u)?a[u]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}var ll={}.hasOwnProperty;function Or(e,n){let t=-1,r;if(n.extensions)for(;++t<n.extensions.length;)Or(e,n.extensions[t]);for(r in n)if(ll.call(n,r))switch(r){case"extensions":break;case"unsafe":{qo(e[r],n[r]);break}case"join":{qo(e[r],n[r]);break}case"handlers":{cl(e[r],n[r]);break}default:e.options[r]=n[r]}return e}function qo(e,n){n&&e.push(...n)}function cl(e,n){n&&Object.assign(e,n)}function Ho(e,n,t,r){let i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);let s=t.indentLines(t.containerFlow(e,o.current()),fl);return i(),s}function fl(e,n,t){return">"+(t?"":" ")+e}function Wn(e,n){return $o(e,n.inConstruct,!0)&&!$o(e,n.notInConstruct,!1)}function $o(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function Rr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
|
|
5
|
-
`&&Wn(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
6
|
-
`}function Uo(e,n){let t=String(e),r=t.indexOf(n),i=r,o=0,s=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+n.length,r=t.indexOf(n,i);return s}function ln(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Qo(e){let n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Ko(e,n,t,r){let i=Qo(t),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ln(e,t)){let h=t.enter("codeIndented"),p=t.indentLines(o,hl);return h(),p}let a=t.createTracker(r),u=i.repeat(Math.max(Uo(o,i)+1,3)),l=t.enter("codeFenced"),c=a.move(u);if(e.lang){let h=t.enter(`codeFencedLang${s}`);c+=a.move(t.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){let h=t.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(t.safe(e.meta,{before:c,after:`
|
|
7
|
-
`,encode:["`"],...a.current()})),h()}return c+=a.move(`
|
|
8
|
-
`),o&&(c+=a.move(o+`
|
|
9
|
-
`)),c+=a.move(u),l(),c}function hl(e,n,t){return(t?"":" ")+e}function Tt(e){let n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Wo(e,n,t,r){let i=Tt(t),o=i==='"'?"Quote":"Apostrophe",s=t.enter("definition"),a=t.enter("label"),u=t.createTracker(r),l=u.move("[");return l+=u.move(t.safe(t.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(t.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=t.enter("destinationRaw"),l+=u.move(t.safe(e.url,{before:l,after:e.title?" ":`
|
|
10
|
-
`,...u.current()}))),a(),e.title&&(a=t.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(t.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function Yo(e){let n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ue(e){return"&#x"+e.toString(16).toUpperCase()+";"}function At(e,n,t){let r=It(e),i=It(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Lr.peek=pl;function Lr(e,n,t,r){let i=Yo(t),o=t.enter("emphasis"),s=t.createTracker(r),a=s.move(i),u=s.move(t.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=At(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=ue(l)+u.slice(1));let h=u.charCodeAt(u.length-1),p=At(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+ue(h));let f=s.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+f}function pl(e,n,t){return t.options.emphasis||"*"}var Pt=(function(e){if(e==null)return xl;if(typeof e=="function")return Yn(e);if(typeof e=="object")return Array.isArray(e)?ml(e):dl(e);if(typeof e=="string")return gl(e);throw new Error("Expected function, string, or object as test")});function ml(e){let n=[],t=-1;for(;++t<e.length;)n[t]=Pt(e[t]);return Yn(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function dl(e){let n=e;return Yn(t);function t(r){let i=r,o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function gl(e){return Yn(n);function n(t){return t&&t.type===e}}function Yn(e){return n;function n(t,r,i){return!!(kl(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function xl(){return!0}function kl(e){return e!==null&&typeof e=="object"&&"type"in e}var Jo=[],Jn=!0,Ze=!1,Gn="skip";function Br(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;let o=Pt(i),s=r?-1:1;a(e,void 0,[])();function a(u,l,c){let h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){let f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=Jo,I,v,R;if((!n||o(u,l,c[c.length-1]||void 0))&&(f=yl(t(u,c)),f[0]===Ze))return f;if("children"in u&&u.children){let w=u;if(w.children&&f[0]!==Gn)for(v=(r?w.children.length:-1)+s,R=c.concat(w);v>-1&&v<w.children.length;){let q=w.children[v];if(I=a(q,v,R)(),I[0]===Ze)return I;v=typeof I[1]=="number"?I[1]:v+s}}return f}}}function yl(e){return Array.isArray(e)?e:typeof e=="number"?[Jn,e]:e==null?Jo:[e]}function Nr(e,n,t,r){let i,o,s;typeof n=="function"&&typeof t!="function"?(o=void 0,s=n,i=t):(o=n,s=t,i=r),Br(e,o,a,i);function a(u,l){let c=l[l.length-1],h=c?c.children.indexOf(u):void 0;return s(u,h,c)}}function Xn(e,n){let t=!1;return Nr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Ze}),!!((!e.depth||e.depth<3)&&Ye(e)&&(n.options.setext||t))}function Go(e,n,t,r){let i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(Xn(e,t)){let c=t.enter("headingSetext"),h=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
|
|
11
|
-
`,after:`
|
|
12
|
-
`});return h(),c(),p+`
|
|
13
|
-
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
14
|
-
`))+1))}let s="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");o.move(s+" ");let l=t.containerPhrasing(e,{before:"# ",after:`
|
|
15
|
-
`,...o.current()});return/^[\t ]/.test(l)&&(l=ue(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,t.options.closeAtx&&(l+=" "+s),u(),a(),l}jr.peek=wl;function jr(e){return e.value||""}function wl(){return"<"}Dr.peek=bl;function Dr(e,n,t,r){let i=Tt(t),o=i==='"'?"Quote":"Apostrophe",s=t.enter("image"),a=t.enter("label"),u=t.createTracker(r),l=u.move("![");return l+=u.move(t.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(t.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=t.enter("destinationRaw"),l+=u.move(t.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=t.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(t.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function bl(){return"!"}Vr.peek=Sl;function Vr(e,n,t,r){let i=e.referenceType,o=t.enter("imageReference"),s=t.enter("label"),a=t.createTracker(r),u=a.move("!["),l=t.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=t.stack;t.stack=[],s=t.enter("reference");let h=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return s(),t.stack=c,o(),i==="full"||!l||l!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Sl(){return"!"}qr.peek=Cl;function qr(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){let s=t.unsafe[o],a=t.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function Cl(){return"`"}function Hr(e,n){let t=Ye(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$r.peek=Il;function $r(e,n,t,r){let i=Tt(t),o=i==='"'?"Quote":"Apostrophe",s=t.createTracker(r),a,u;if(Hr(e,t)){let c=t.stack;t.stack=[],a=t.enter("autolink");let h=s.move("<");return h+=s.move(t.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),t.stack=c,h}a=t.enter("link"),u=t.enter("label");let l=s.move("[");return l+=s.move(t.containerPhrasing(e,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(t.safe(e.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=t.enter("destinationRaw"),l+=s.move(t.safe(e.url,{before:l,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=t.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(t.safe(e.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function Il(e,n,t){return Hr(e,t)?"<":"["}Ur.peek=El;function Ur(e,n,t,r){let i=e.referenceType,o=t.enter("linkReference"),s=t.enter("label"),a=t.createTracker(r),u=a.move("["),l=t.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=t.stack;t.stack=[],s=t.enter("reference");let h=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return s(),t.stack=c,o(),i==="full"||!l||l!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function El(){return"["}function zt(e){let n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Xo(e){let n=zt(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Zo(e){let n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Zn(e){let n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function es(e,n,t,r){let i=t.enter("list"),o=t.bulletCurrent,s=e.ordered?Zo(t):zt(t),a=e.ordered?s==="."?")":".":Xo(t),u=n&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),Zn(t)===s&&c){let h=-1;for(;++h<e.children.length;){let p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),t.bulletCurrent=s;let l=t.containerFlow(e,r);return t.bulletLastUsed=s,t.bulletCurrent=o,i(),l}function ts(e){let n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function ns(e,n,t,r){let i=ts(t),o=t.bulletCurrent||zt(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=t.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=t.enter("listItem"),l=t.indentLines(t.containerFlow(e,a.current()),c);return u(),l;function c(h,p,f){return p?(f?"":" ".repeat(s))+h:(f?o:o+" ".repeat(s-o.length))+h}}function rs(e,n,t,r){let i=t.enter("paragraph"),o=t.enter("phrasing"),s=t.containerPhrasing(e,r);return o(),i(),s}var Qr=Pt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function is(e,n,t,r){return(e.children.some(function(s){return Qr(s)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function os(e){let n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Kr.peek=vl;function Kr(e,n,t,r){let i=os(t),o=t.enter("strong"),s=t.createTracker(r),a=s.move(i+i),u=s.move(t.containerPhrasing(e,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=At(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=ue(l)+u.slice(1));let h=u.charCodeAt(u.length-1),p=At(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+ue(h));let f=s.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+f}function vl(e,n,t){return t.options.strong||"*"}function ss(e,n,t,r){return t.safe(e.value,r)}function as(e){let n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function us(e,n,t){let r=(Zn(t)+(t.options.ruleSpaces?" ":"")).repeat(as(t));return t.options.ruleSpaces?r.slice(0,-1):r}var Wr={blockquote:Ho,break:Rr,code:Ko,definition:Wo,emphasis:Lr,hardBreak:Rr,heading:Go,html:jr,image:Dr,imageReference:Vr,inlineCode:qr,link:$r,linkReference:Ur,list:es,listItem:ns,paragraph:rs,root:is,strong:Kr,text:ss,thematicBreak:us};var ls=[Tl];function Tl(e,n,t,r){if(n.type==="code"&&ln(n,r)&&(e.type==="list"||e.type===n.type&&ln(e,r)))return!1;if("spread"in t&&typeof t.spread=="boolean")return e.type==="paragraph"&&(e.type===n.type||n.type==="definition"||n.type==="heading"&&Xn(n,r))?void 0:t.spread?1:0}var et=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],cs=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
16
|
-
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:et},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
17
|
-
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
18
|
-
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
19
|
-
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
20
|
-
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
21
|
-
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:et},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:et},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:et},{atBreak:!0,character:"~"}];function fs(e){return e.label||!e.identifier?e.label||"":Kn(e.identifier)}function hs(e){if(!e._compiled){let n=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function ps(e,n,t){let r=n.indexStack,i=e.children||[],o=[],s=-1,a=t.before,u;r.push(-1);let l=n.createTracker(t);for(;++s<i.length;){let c=i[s],h;if(r[r.length-1]=s,s+1<i.length){let I=n.handle.handlers[i[s+1].type];I&&I.peek&&(I=I.peek),h=I?I(i[s+1],e,n,{before:"",after:"",...l.current()}).charAt(0):""}else h=t.after;o.length>0&&(a==="\r"||a===`
|
|
22
|
-
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=n.createTracker(t),l.move(o.join("")));let p=n.handle(c,e,n,{...l.current(),after:h,before:a});u&&u===p.slice(0,1)&&(p=ue(u.charCodeAt(0))+p.slice(1));let f=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,u=void 0,f&&(o.length>0&&f.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+ue(a.charCodeAt(0))),f.after&&(u=h)),l.move(p),o.push(p),a=p.slice(-1)}return r.pop(),o.join("")}function ms(e,n,t){let r=n.indexStack,i=e.children||[],o=n.createTracker(t),s=[],a=-1;for(r.push(-1);++a<i.length;){let u=i[a];r[r.length-1]=a,s.push(o.move(n.handle(u,e,n,{before:`
|
|
23
|
-
`,after:`
|
|
24
|
-
`,...o.current()}))),u.type!=="list"&&(n.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(Al(u,i[a+1],e,n)))}return r.pop(),s.join("")}function Al(e,n,t,r){let i=r.join.length;for(;i--;){let o=r.join[i](e,n,t,r);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
25
|
-
`.repeat(1+o);if(o===!1)return`
|
|
26
|
-
|
|
27
|
-
<!---->
|
|
28
|
-
|
|
29
|
-
`}return`
|
|
30
|
-
|
|
31
|
-
`}var Pl=/\r?\n|\r/g;function ds(e,n){let t=[],r=0,i=0,o;for(;o=Pl.exec(e);)s(e.slice(r,o.index)),t.push(o[0]),r=o.index+o[0].length,i++;return s(e.slice(r)),t.join("");function s(a){t.push(n(a,i,!a))}}function xs(e,n,t){let r=(t.before||"")+(n||"")+(t.after||""),i=[],o=[],s={},a=-1;for(;++a<e.unsafe.length;){let c=e.unsafe[a];if(!Wn(e.stack,c))continue;let h=e.compilePattern(c),p;for(;p=h.exec(r);){let f="before"in c||!!c.atBreak,I="after"in c,v=p.index+(f?p[1].length:0);i.includes(v)?(s[v].before&&!f&&(s[v].before=!1),s[v].after&&!I&&(s[v].after=!1)):(i.push(v),s[v]={before:f,after:I})}}i.sort(zl);let u=t.before?t.before.length:0,l=r.length-(t.after?t.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(gs(r.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(r.charAt(c))&&(!t.encode||!t.encode.includes(r.charAt(c)))?o.push("\\"):(o.push(ue(r.charCodeAt(c))),u++))}return o.push(gs(r.slice(u,l),t.after)),o.join("")}function zl(e,n){return e-n}function gs(e,n){let t=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+n,s=-1,a=0,u;for(;u=t.exec(o);)r.push(u.index);for(;++s<r.length;)a!==r[s]&&i.push(e.slice(a,r[s])),i.push("\\"),a=r[s];return i.push(e.slice(a)),i.join("")}function ks(e){let n=e||{},t=n.now||{},r=n.lineShift||0,i=t.line||1,o=t.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:r}}function a(l){r+=l}function u(l){let c=l||"",h=c.split(/\r?\n|\r/g),p=h[h.length-1];return i+=h.length-1,o=h.length===1?o+p.length:1+p.length+r,c}}function Yr(e,n){let t=n||{},r={associationId:fs,containerPhrasing:Ol,containerFlow:Rl,createTracker:ks,compilePattern:hs,enter:o,handlers:{...Wr},handle:void 0,indentLines:ds,indexStack:[],join:[...ls],options:{},safe:Ll,stack:[],unsafe:[...cs]};Or(r,t),r.options.tightDefinitions&&r.join.push(Ml),r.handle=Vo("type",{invalid:_l,unknown:Fl,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
32
|
-
`,after:`
|
|
33
|
-
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
34
|
-
`),i;function o(s){return r.stack.push(s),a;function a(){r.stack.pop()}}}function _l(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function Fl(e){let n=e;throw new Error("Cannot handle unknown node `"+n.type+"`")}function Ml(e,n){if(e.type==="definition"&&e.type===n.type)return 0}function Ol(e,n){return ps(e,this,n)}function Rl(e,n){return ms(e,this,n)}function Ll(e,n){return xs(this,e,n)}function _t(e){let n=this;n.compiler=t;function t(r){return Yr(r,{...n.data("settings"),...e,extensions:n.data("toMarkdownExtensions")||[]})}}function Jr(e){if(e)throw e}var nr=Aa(Ts(),1);function cn(e){if(typeof e!="object"||e===null)return!1;let n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gr(){let e=[],n={run:t,use:r};return n;function t(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=e[++o],h=-1;if(u){s(u);return}for(;++h<i.length;)(l[h]===null||l[h]===void 0)&&(l[h]=i[h]);i=l,c?As(c,a)(...l):s(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function As(e,n){let t;return r;function r(...s){let a=e.length>s.length,u;a&&s.push(i);try{u=e.apply(this,s)}catch(l){let c=l;if(a&&t)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){t||(t=!0,n(s,...a))}function o(s){i(null,s)}}var W=class extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},s=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(s=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){let u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){let u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}let a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=je(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};W.prototype.file="";W.prototype.name="";W.prototype.reason="";W.prototype.message="";W.prototype.stack="";W.prototype.column=void 0;W.prototype.line=void 0;W.prototype.ancestors=void 0;W.prototype.cause=void 0;W.prototype.fatal=void 0;W.prototype.place=void 0;W.prototype.ruleId=void 0;W.prototype.source=void 0;var ye={basename:Bl,dirname:Nl,extname:jl,join:Dl,sep:"/"};function Bl(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');fn(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let s=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return t===r?r=s:r<0&&(r=e.length),e.slice(t,r)}function Nl(e){if(fn(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function jl(e){fn(e);let n=e.length,t=-1,r=0,i=-1,o=0,s;for(;n--;){let a=e.codePointAt(n);if(a===47){if(s){r=n+1;break}continue}t<0&&(s=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Dl(...e){let n=-1,t;for(;++n<e.length;)fn(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Vl(t)}function Vl(e){fn(e);let n=e.codePointAt(0)===47,t=ql(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function ql(e,n){let t="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=s,o=0;continue}}else if(t.length>0){t="",r=0,i=s,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,s):t=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return t}function fn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var Ps={cwd:Hl};function Hl(){return"/"}function Ft(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function zs(e){if(typeof e=="string")e=new URL(e);else if(!Ft(e)){let n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){let n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return $l(e)}function $l(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let n=e.pathname,t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){let r=n.codePointAt(t+2);if(r===70||r===102){let i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}var Xr=["history","path","basename","stem","extname","dirname"],hn=class{constructor(n){let t;n?Ft(n)?t={path:n}:typeof n=="string"||Ul(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Ps.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Xr.length;){let o=Xr[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)Xr.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ye.basename(this.path):void 0}set basename(n){ei(n,"basename"),Zr(n,"basename"),this.path=ye.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ye.dirname(this.path):void 0}set dirname(n){_s(this.basename,"dirname"),this.path=ye.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ye.extname(this.path):void 0}set extname(n){if(Zr(n,"extname"),_s(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ye.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Ft(n)&&(n=zs(n)),ei(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ye.basename(this.path,this.extname):void 0}set stem(n){ei(n,"stem"),Zr(n,"stem"),this.path=ye.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){let i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){let i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){let i=new W(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}};function Zr(e,n){if(e&&e.includes(ye.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ye.sep+"`")}function ei(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function _s(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Ul(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Fs=(function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o});var Ql={}.hasOwnProperty,ii=class e extends Fs{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Gr()}copy(){let n=new e,t=-1;for(;++t<this.attachers.length;){let r=this.attachers[t];n.use(...r)}return n.data((0,nr.default)(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(ri("data",this.frozen),this.namespace[n]=t,this):Ql.call(this.namespace,n)&&this.namespace[n]||void 0:n?(ri("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;let n=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();let t=tr(n),r=this.parser||this.Parser;return ti("parse",r),r(String(t),t)}process(n,t){let r=this;return this.freeze(),ti("process",this.parser||this.Parser),ni("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,s){let a=tr(n),u=r.parse(a);r.run(u,a,function(c,h,p){if(c||!h||!p)return l(c);let f=h,I=r.stringify(f,p);Wl(I)?p.value=I:p.result=I,l(c,p)});function l(c,h){c||!h?s(c):o?o(h):t(void 0,h)}}}processSync(n){let t=!1,r;return this.freeze(),ti("processSync",this.parser||this.Parser),ni("processSync",this.compiler||this.Compiler),this.process(n,i),Os("processSync","process",t),r;function i(o,s){t=!0,Jr(o),r=s}}run(n,t,r){Ms(n),this.freeze();let i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(s,a){let u=tr(t);i.run(n,u,l);function l(c,h,p){let f=h||n;c?a(c):s?s(f):r(void 0,f,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),Os("runSync","run",r),i;function o(s,a){Jr(s),i=a,r=!0}}stringify(n,t){this.freeze();let r=tr(t),i=this.compiler||this.Compiler;return ni("stringify",i),Ms(n),i(n,r)}use(n,...t){let r=this.attachers,i=this.namespace;if(ri("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):s(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...h]=l;u(c,h)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=(0,nr.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let h=l[c];o(h)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===l){p=h;break}if(p===-1)r.push([l,...c]);else if(c.length>0){let[f,...I]=c,v=r[p][1];cn(v)&&cn(f)&&(f=(0,nr.default)(!0,v,f)),r[p]=[l,f,...I]}}}},pn=new ii().freeze();function ti(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ni(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ri(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ms(e){if(!cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Os(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function tr(e){return Kl(e)?e:new hn(e)}function Kl(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Wl(e){return typeof e=="string"||Yl(e)}function Yl(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var pe=class{constructor(n,t,r={}){this.match=n,this.match=n,this.handler=typeof t=="string"?Jl(t):t,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};function Jl(e){return function(n,t,r,i){let o=e;if(t[1]){let s=t[0].lastIndexOf(t[1]);o+=t[0].slice(s+t[1].length),r+=s;let a=r-i;a>0&&(o=t[0].slice(s-a,s)+o,r=i)}return n.tr.insertText(o,r,i)}}var Rs=(e,n)=>{let t=e.plugins;for(let r=0;r<t.length;r++){let i=t[r],o;if(i.spec.isInputRules&&(o=i.getState(e))){if(n){let s=e.tr,a=o.transform;for(let u=a.steps.length-1;u>=0;u--)s.step(a.steps[u].invert(a.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else s.delete(o.from,o.to);n(s)}return!0}}return!1},kx=new pe(/--$/,"\u2014",{inCodeMark:!1}),yx=new pe(/\.\.\.$/,"\u2026",{inCodeMark:!1}),wx=new pe(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),bx=new pe(/"$/,"\u201D",{inCodeMark:!1}),Sx=new pe(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Cx=new pe(/'$/,"\u2019",{inCodeMark:!1});function Ix(e,n,t=null,r){return new pe(e,(i,o,s,a)=>{let u=t instanceof Function?t(o):t,l=i.tr.delete(s,a),c=l.doc.resolve(s),h=c.blockRange(),p=h&&Hi(h,n,u);if(!p)return null;l.wrap(h,p);let f=l.doc.resolve(s-1).nodeBefore;return f&&f.type==n&&$i(l.doc,s-1)&&(!r||r(o,f))&&l.join(s-1),l})}function Ex(e,n,t=null){return new pe(e,(r,i,o,s)=>{let a=r.doc.resolve(o),u=t instanceof Function?t(i):t;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),n)?r.tr.delete(o,s).setBlockType(o,o,n,u):null})}var Ve=typeof navigator<"u"?navigator:null,Ls=typeof document<"u"?document:null,qe=Ve&&Ve.userAgent||"",si=/Edge\/(\d+)/.exec(qe),Vs=/MSIE \d/.exec(qe),ai=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qe),rr=!!(Vs||ai||si),Gl=Vs?document.documentMode:ai?+ai[1]:si?+si[1]:0,qs=!rr&&/gecko\/(\d+)/i.test(qe),Xl=qs&&+(/Firefox\/(\d+)/.exec(qe)||[0,0])[1],ui=!rr&&/Chrome\/(\d+)/.exec(qe),Hs=!!ui,Zl=ui?+ui[1]:0,$s=!rr&&!!Ve&&/Apple Computer/.test(Ve.vendor),Us=$s&&(/Mobile\/\w+/.test(qe)||!!Ve&&Ve.maxTouchPoints>2),ec=Us||(Ve?/Mac/.test(Ve.platform):!1),Qs=/Android \d/.test(qe),Ks=!!Ls&&"webkitFontSmoothing"in Ls.documentElement.style,tc=Ks?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,_x=Object.freeze({__proto__:null,android:Qs,chrome:Hs,chrome_version:Zl,gecko:qs,gecko_version:Xl,ie:rr,ie_version:Gl,ios:Us,mac:ec,safari:$s,webkit:Ks,webkit_version:tc});function oi(e,n,t,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(n);if(a.parent.type.spec.code)return!1;let u=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,void 0,"\uFFFC")+r;for(let l of i){let c=l,h=c.match.exec(u),p=h&&h[0]&&c.handler(s,h,n-(h[0].length-r.length),t);if(p)return c.undoable!==!1&&p.setMeta(o,{transform:p,from:n,to:t,text:r}),e.dispatch(p),!0}return!1}var nc=new Jt("MILKDOWN_CUSTOM_INPUTRULES");function Ws({rules:e}){let n=new Yt({key:nc,isInputRules:!0,state:{init(){return null},apply(t,r){let i=t.getMeta(this);return i||(t.selectionSet||t.docChanged?null:r)}},props:{handleTextInput(t,r,i,o){return oi(t,r,i,o,e,n)},handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:r}=t.state.selection;r&&oi(t,r.pos,r.pos,"",e,n)}),!1),keydown:(t,r)=>!(Qs&&Hs&&r.key==="Enter")||t.composing?!1:t.someProp("handleKeyDown",i=>i(t,r))?(r.preventDefault(),!0):!1},handleKeyDown(t,r){if(r.key!=="Enter")return!1;let{$cursor:i}=t.state.selection;return i?oi(t,i.pos,i.pos,`
|
|
35
|
-
`,e,n):!1}}});return n}function Ys(e){return e.some(n=>n.type.spec.code)}function Bs(e,n,t){if(n>=t)return!1;let r=!1;return e.doc.nodesBetween(n,t,i=>(i.isInline&&Ys(i.marks)&&(r=!0),!r)),r}function rc(e,n){var t;return Ys((t=e.storedMarks)!=null?t:e.doc.resolve(n).marks())}function Fx(e,n,t={}){return new pe(e,(r,i,o,s)=>{var a,u,l,c;let{tr:h}=r,p=i.length,f=i[p-1],I=i[0],v=[],R,w={group:f,fullMatch:I,start:o,end:s},q=(a=t.updateCaptured)==null?void 0:a.call(t,w);if(Object.assign(w,q),{group:f,fullMatch:I,start:o,end:s}=w,I===null||f?.trim()==="")return null;if(f){let E=I.search(/\S/),L=o+I.indexOf(f),N=L+f.length,k=Bs(r,o+E,L),j=N<s&&Bs(r,N,s);if(k||j||rc(r,s))return null;v=(u=h.storedMarks)!=null?u:[],N<s&&h.delete(N,s),L>o&&h.delete(o+E,L),R=o+E+f.length;let $=(l=t.getAttr)==null?void 0:l.call(t,i);h.addMark(o,R,n.create($)),h.setStoredMarks(v),(c=t.beforeDispatch)==null||c.call(t,{match:i,start:o,end:s,tr:h})}return h})}var ic=Object.defineProperty,oc=Object.defineProperties,sc=Object.getOwnPropertyDescriptors,Ns=Object.getOwnPropertySymbols,ac=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable,js=(e,n,t)=>n in e?ic(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,lc=(e,n)=>{for(var t in n||(n={}))ac.call(n,t)&&js(e,t,n[t]);if(Ns)for(var t of Ns(n))uc.call(n,t)&&js(e,t,n[t]);return e},cc=(e,n)=>oc(e,sc(n));function Ds(e=0,n=0,t=0){return Math.min(Math.max(e,n),t)}function Mx(e,n,t){let i=e.state.doc.content.size,o=Ds(n,0,i),s=Ds(t,0,i),a=e.coordsAtPos(o),u=e.coordsAtPos(s,-1),l=Math.min(a.top,u.top),c=Math.max(a.bottom,u.bottom),h=Math.min(a.left,u.left),p=Math.max(a.right,u.right),f=p-h,I=c-l,w={top:l,bottom:c,left:h,right:p,width:f,height:I,x:h,y:l};return cc(lc({},w),{toJSON:()=>w})}function Ox(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function fc(e,n){return Array.isArray(e)&&e.includes(n.type)||n.type===e}function Rx(e){if(e.content.childCount===1){let n=e.content.firstChild;if(n?.type.name==="text"&&n.marks.length===0)return n;if(n?.type.name==="paragraph"&&n.childCount===1){let t=n.firstChild;if(t?.type.name==="text"&&t.marks.length===0)return t}}return!1}function hc(e){return n=>{for(let t=n.depth;t>0;t-=1){let r=n.node(t);if(e(r)){let i=n.before(t),o=n.after(t);return{from:i,to:o,node:r}}}}}function Lx(e,n){return hc(t=>t.type===n)(e)}function Bx(e,n){let t=n.nodes[e];if(!t)throw io("node",e);return t}function pc(e){return n=>{for(let t=n.depth;t>0;t--){let r=n.node(t);if(e(r))return{pos:n.before(t),start:n.start(t),depth:t,node:r}}}}function Nx(e){return n=>pc(e)(n.$from)}function jx(e,n){if(!(e instanceof mr))return;let{node:t,$from:r}=e;if(fc(n,t))return{node:t,pos:r.pos,start:r.start(r.depth),depth:r.depth}}var Dx=(e,n)=>{let{selection:t,doc:r}=e;if(t instanceof mr)return{hasNode:t.node.type===n,pos:t.from,target:t.node};let{from:i,to:o}=t,s=!1,a=-1,u=null;return r.nodesBetween(i,o,(l,c)=>u?!1:l.type===n?(s=!0,a=c,u=l,!1):!0),{hasNode:s,pos:a,target:u}};var Gs=class{},Xs=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw dr();return e}}},mc=class Zs extends Gs{constructor(n,t,r){super(),this.type=n,this.content=t,this.attrs=r}push(n,...t){this.content.push(n,...t)}pop(){return this.content.pop()}static create(n,t,r){return new Zs(n,t,r)}},we,Mt,mn,dn,gn,Ot,Rt,nt,ea=(nt=class extends Xs{constructor(t){super();C(this,we);C(this,Mt);C(this,mn);C(this,dn);C(this,gn);C(this,Ot);C(this,Rt);y(this,we,Fn.none),y(this,Mt,r=>r.isText),y(this,mn,(r,i)=>{if(g(this,Mt).call(this,r)&&g(this,Mt).call(this,i)&&Fn.sameSet(r.marks,i.marks))return this.schema.text(r.text+i.text,r.marks)}),y(this,dn,r=>{let i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.parseMarkdown.match(r));if(!i)throw no(r);return i}),y(this,gn,r=>{let i=g(this,dn).call(this,r);i.spec.parseMarkdown.runner(this,r,i)}),this.injectRoot=(r,i,o)=>(this.openNode(i,o),this.next(r.children),this),this.openNode=(r,i)=>(this.open(mc.create(r,[],i)),this),y(this,Ot,()=>{y(this,we,Fn.none);let r=this.close();return g(this,Rt).call(this,r.type,r.attrs,r.content)}),this.closeNode=()=>{try{g(this,Ot).call(this)}catch(r){console.error(r)}return this},y(this,Rt,(r,i,o)=>{let s=r.createAndFill(i,o,g(this,we));if(!s)throw to(r,i,o);return this.push(s),s}),this.addNode=(r,i,o)=>{try{g(this,Rt).call(this,r,i,o)}catch(s){console.error(s)}return this},this.openMark=(r,i)=>{let o=r.create(i);return y(this,we,o.addToSet(g(this,we))),this},this.closeMark=r=>(y(this,we,r.removeFromSet(g(this,we))),this),this.addText=r=>{try{let i=this.top();if(!i)throw dr();let o=i.pop(),s=this.schema.text(r,g(this,we));if(!o)return i.push(s),this;let a=g(this,mn).call(this,o,s);return a?(i.push(a),this):(i.push(o,s),this)}catch(i){return console.error(i),this}},this.build=()=>{let r;do r=g(this,Ot).call(this);while(this.size());return r},this.next=(r=[])=>([r].flat().forEach(i=>g(this,gn).call(this,i)),this),this.toDoc=()=>this.build(),this.run=(r,i)=>{let o=r.runSync(r.parse(i),i);return this.next(o),this},this.schema=t}},we=new WeakMap,Mt=new WeakMap,mn=new WeakMap,dn=new WeakMap,gn=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,nt.create=(t,r)=>{let i=new nt(t);return o=>(i.run(r,o),i.toDoc())},nt),rt,Js=(rt=class extends Gs{constructor(n,t,r,i={}){super(),this.type=n,this.children=t,this.value=r,this.props=i,this.push=(o,...s)=>{this.children||(this.children=[]),this.children.push(o,...s)},this.pop=()=>this.children?.pop()}},rt.create=(n,t,r,i={})=>new rt(n,t,r,i),rt),dc=e=>Object.prototype.hasOwnProperty.call(e,"size"),ne,Lt,xn,kn,yn,wn,Bt,Nt,bn,Sn,tt,He,Cn,jt,it,ta=(it=class extends Xs{constructor(t){super();C(this,ne);C(this,Lt);C(this,xn);C(this,kn);C(this,yn);C(this,wn);C(this,Bt);C(this,Nt);C(this,bn);C(this,Sn);C(this,tt);C(this,He);C(this,Cn);C(this,jt);y(this,ne,[]),y(this,Lt,r=>{let i=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.toMarkdown.match(r));if(!i)throw ro(r.type);return i}),y(this,xn,r=>g(this,Lt).call(this,r).spec.toMarkdown.runner(this,r)),y(this,kn,(r,i)=>g(this,Lt).call(this,r).spec.toMarkdown.runner(this,r,i)),y(this,yn,r=>{let i=a=>a.type.spec.priority??50,o=[...r].sort((a,u)=>i(a)-i(u)),s=[];return g(this,ne).forEach(({mark:a})=>{let u=o.findIndex(l=>l.eq(a));u>=0&&s.push(...o.splice(u,1))}),s.concat(o)}),y(this,wn,r=>{let i=r?.marks,o=0;for(;o<g(this,ne).length;){let{mark:s,spanning:a}=g(this,ne)[o];if(a&&i?.some(u=>u.eq(s)))o++;else break}for(let s=g(this,ne).length-1;s>=o;s--)g(this,jt).call(this,g(this,ne)[s].mark)}),y(this,Bt,(r,i)=>{g(this,yn).call(this,r.marks).every(o=>!g(this,kn).call(this,o,r))&&g(this,xn).call(this,r),g(this,wn).call(this,i)}),y(this,Nt,r=>{let{children:i}=r;return i&&(r.children=i.reduce((o,s,a)=>{if(a===0)return[s];let u=o.at(-1);if(u&&u.isMark&&s.isMark){let{children:l,...c}=s,{children:h,...p}=u;if(s.type===u.type&&l&&h&&JSON.stringify(c)===JSON.stringify(p)){let f={...p,children:[...h,...l]};return o.slice(0,-1).concat(g(this,Nt).call(this,f))}}return o.concat(s)},[])),r}),y(this,bn,r=>{let i={...r.props,type:r.type};return r.children&&(i.children=r.children),r.value&&(i.value=r.value),i}),this.openNode=(r,i,o)=>(this.open(Js.create(r,void 0,i,o)),this),y(this,Sn,(r,i)=>{let o="",s="",a=r.children;if(a){let l=a[0],c=a.at(-1);if(c&&c.type==="text"&&c.value.endsWith(" ")){let h=c.value,p=h.trimEnd();s=h.slice(p.length),c.value=p}if(l&&l.type==="text"&&l.value.startsWith(" ")){let h=l.value,p=h.trimStart();o=h.slice(0,h.length-p.length),l.value=p}}o.length&&g(this,He).call(this,"text",void 0,o);let u=i();return s.length&&g(this,He).call(this,"text",void 0,s),u}),y(this,tt,(r=!1)=>{let i=this.close(),o=()=>g(this,He).call(this,i.type,i.children,i.value,i.props);return r?g(this,Sn).call(this,i,o):o()}),this.closeNode=()=>(g(this,tt).call(this),this),y(this,He,(r,i,o,s)=>{let a=Js.create(r,i,o,s),u=g(this,Nt).call(this,g(this,bn).call(this,a));return this.push(u),u}),this.addNode=(r,i,o,s)=>(g(this,He).call(this,r,i,o,s),this),y(this,Cn,(r,i,o,s)=>g(this,ne).some(a=>a.mark.eq(r))?this:(g(this,ne).push({mark:r,spanning:o==null}),this.openNode(i,o,{...s,isMark:!0}))),y(this,jt,r=>{let i=-1;for(let o=g(this,ne).length-1;o>=0;o--)if(g(this,ne)[o].mark.eq(r)){i=o;break}i<0||(g(this,ne).splice(i,1),g(this,tt).call(this,!0))}),this.withMark=(r,i,o,s)=>(g(this,Cn).call(this,r,i,o,s),this),this.closeMark=r=>(g(this,jt).call(this,r),this),this.build=()=>{let r=null;do r=g(this,tt).call(this);while(this.size());return r},this.next=r=>dc(r)?(r.forEach((i,o,s)=>{g(this,Bt).call(this,i,r.maybeChild(s+1)??void 0)}),this):(g(this,Bt).call(this,r),this),this.toString=r=>r.stringify(this.build()),this.run=r=>(y(this,ne,[]),this.next(r),this),this.schema=t}},ne=new WeakMap,Lt=new WeakMap,xn=new WeakMap,kn=new WeakMap,yn=new WeakMap,wn=new WeakMap,Bt=new WeakMap,Nt=new WeakMap,bn=new WeakMap,Sn=new WeakMap,tt=new WeakMap,He=new WeakMap,Cn=new WeakMap,jt=new WeakMap,it.create=(t,r)=>{let i=new it(t);return o=>(i.run(o),i.toString(r))},it);function Oe(e,n){return e.meta={package:"@milkdown/core",group:"System",...n},e}var aa={text:(e,n,t,r)=>{let i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:t.safe(i,{...r,encode:[]})},strong:(e,n,t,r)=>{let i=e.marker||t.options.strong||"*",o=t.enter("strong"),s=t.createTracker(r),a=s.move(i+i);return a+=s.move(t.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i+i),o(),a},emphasis:(e,n,t,r)=>{let i=e.marker||t.options.emphasis||"*",o=t.enter("emphasis"),s=t.createTracker(r),a=s.move(i);return a+=s.move(t.containerPhrasing(e,{before:a,after:i,...s.current()})),a+=s.move(i),o(),a}},Dt=O({},"editorView"),In=O({},"editorState"),li=O([],"initTimer"),na=O({},"editor"),Ti=O([],"inputRules"),vn=O([],"prosePlugins"),Ai=O([],"remarkPlugins"),Pi=O([],"nodeView"),zi=O([],"markView"),ct=O(pn().use(vt).use(_t),"remark"),ci=O({handlers:aa,encode:[]},"remarkStringifyOptions"),ir=ke("ConfigReady");function gc(e){let n=t=>(t.record(ir),async()=>(await e(t),t.done(ir),()=>{t.clearTimer(ir)}));return Oe(n,{displayName:"Config"}),n}var En=ke("InitReady");function xc(e){let n=t=>(t.inject(na,e).inject(vn,[]).inject(Ai,[]).inject(Ti,[]).inject(Pi,[]).inject(zi,[]).inject(ci,{handlers:aa,encode:[]}).inject(ct,pn().use(vt).use(_t)).inject(li,[ir]).record(En),async()=>{await t.waitTimers(li);let r=t.get(ci);return t.set(ct,pn().use(vt).use(_t,r)),t.done(En),()=>{t.remove(na).remove(vn).remove(Ai).remove(Ti).remove(Pi).remove(zi).remove(ci).remove(ct).remove(li).clearTimer(En)}});return Oe(n,{displayName:"Init"}),n}var be=ke("SchemaReady"),fi=O([],"schemaTimer"),Vt=O({},"schema"),hi=O([],"nodes"),pi=O([],"marks");function ra(e){return{...e,parseDOM:e.parseDOM?.map(n=>({priority:e.priority,...n}))}}var ua=e=>(e.inject(Vt,{}).inject(hi,[]).inject(pi,[]).inject(fi,[En]).record(be),async()=>{await e.waitTimers(fi);let n=e.get(ct),t=e.get(Ai).reduce((s,a)=>s.use(a.plugin,a.options),n);e.set(ct,t);let r=Object.fromEntries(e.get(hi).map(([s,a])=>[s,ra(a)])),i=Object.fromEntries(e.get(pi).map(([s,a])=>[s,ra(a)])),o=new Vi({nodes:r,marks:i});return e.set(Vt,o),e.done(be),()=>{e.remove(Vt).remove(hi).remove(pi).remove(fi).clearTimer(be)}});Oe(ua,{displayName:"Schema"});var ot,me,oa,la=(oa=class{constructor(){C(this,ot);C(this,me);y(this,ot,new gr),y(this,me,null),this.setCtx=e=>{y(this,me,e)},this.chain=()=>{if(g(this,me)==null)throw Rn();let e=g(this,me),n=[],t=this.get.bind(this),r={run:()=>{let o=Mn(...n),s=e.get(Dt);return o(s.state,s.dispatch,s)},inline:o=>(n.push(o),r),pipe:i.bind(this)};function i(o,s){let a=t(o);return n.push(a(s)),r}return r}}get ctx(){return g(this,me)}create(e,n){let t=e.create(g(this,ot).sliceMap);return t.set(n),t}get(e){return g(this,ot).get(e).get()}remove(e){return g(this,ot).remove(e)}call(e,n){if(g(this,me)==null)throw Rn();let t=this.get(e)(n),r=g(this,me).get(Dt);return t(r.state,r.dispatch,r)}inline(e){if(g(this,me)==null)throw Rn();let n=g(this,me).get(Dt);return e(n.state,n.dispatch,n)}},ot=new WeakMap,me=new WeakMap,oa);function ak(e="cmdKey"){return O((()=>()=>!1),e)}var ia=O(new la,"commands"),mi=O([be],"commandsTimer"),or=ke("CommandsReady"),ca=e=>{let n=new la;return n.setCtx(e),e.inject(ia,n).inject(mi,[be]).record(or),async()=>(await e.waitTimers(mi),e.done(or),()=>{e.remove(ia).remove(mi).clearTimer(or)})};Oe(ca,{displayName:"Commands"});function kc(e){return e.Backspace=Mn(Rs,Qi,Ki,Wi),e}var st,re,sa,fa=(sa=class{constructor(){C(this,st);C(this,re);y(this,st,null),y(this,re,[]),this.setCtx=e=>{y(this,st,e)},this.add=e=>(g(this,re).push(e),()=>{y(this,re,g(this,re).filter(n=>n!==e))}),this.addObjectKeymap=e=>{let n=[];return Object.entries(e).forEach(([t,r])=>{if(typeof r=="function"){let i={key:t,onRun:()=>r};g(this,re).push(i),n.push(()=>{y(this,re,g(this,re).filter(o=>o!==i))})}else g(this,re).push(r),n.push(()=>{y(this,re,g(this,re).filter(i=>i!==r))})}),()=>{n.forEach(t=>t())}},this.addBaseKeymap=()=>{let e=kc(Yi);return this.addObjectKeymap(e)},this.build=()=>{let e={};return g(this,re).forEach(n=>{e[n.key]=[...e[n.key]||[],n]}),Object.fromEntries(Object.entries(e).map(([n,t])=>{let r=t.sort((o,s)=>(s.priority??50)-(o.priority??50));return[n,(o,s,a)=>{let u=g(this,st);if(u==null)throw pt();let l=r.map(c=>c.onRun(u));return Mn(...l)(o,s,a)}]}))}}get ctx(){return g(this,st)}},st=new WeakMap,re=new WeakMap,sa),_i=O(new fa,"keymap"),di=O([be],"keymapTimer"),sr=ke("KeymapReady"),yc=e=>{let n=new fa;return n.setCtx(e),e.inject(_i,n).inject(di,[be]).record(sr),async()=>(await e.waitTimers(di),e.done(sr),()=>{e.remove(_i).remove(di).clearTimer(sr)})},ar=ke("ParserReady"),ha=(()=>{throw pt()}),ur=O(ha,"parser"),gi=O([],"parserTimer"),pa=e=>(e.inject(ur,ha).inject(gi,[be]).record(ar),async()=>{await e.waitTimers(gi);let n=e.get(ct),t=e.get(Vt);return e.set(ur,ea.create(t,n)),e.done(ar),()=>{e.remove(ur).remove(gi).clearTimer(ar)}});Oe(pa,{displayName:"Parser"});var lr=ke("SerializerReady"),xi=O([],"serializerTimer"),ma=(()=>{throw pt()}),ki=O(ma,"serializer"),da=e=>(e.inject(ki,ma).inject(xi,[be]).record(lr),async()=>{await e.waitTimers(xi);let n=e.get(ct),t=e.get(Vt);return e.set(ki,ta.create(t,n)),e.done(lr),()=>{e.remove(ki).remove(xi).clearTimer(lr)}});Oe(da,{displayName:"Serializer"});var yi=O("","defaultValue"),wi=O(e=>e,"stateOptions"),bi=O([],"editorStateTimer"),cr=ke("EditorStateReady");function wc(e,n,t){if(typeof e=="string")return n(e);if(e.type==="html")return qi.fromSchema(t).parse(e.dom);if(e.type==="json")return Di.fromJSON(t,e.value);throw Xi(e)}var bc=new Jt("MILKDOWN_STATE_TRACKER"),ga=e=>(e.inject(yi,"").inject(In,{}).inject(wi,n=>n).inject(bi,[ar,lr,or,sr]).record(cr),async()=>{await e.waitTimers(bi);let n=e.get(Vt),t=e.get(ur),r=e.get(Ti),i=e.get(wi),o=e.get(vn),s=wc(e.get(yi),t,n),a=e.get(_i),u=a.addBaseKeymap(),l=[...o,new Yt({key:bc,state:{init:()=>{},apply:(p,f,I,v)=>{e.set(In,v)}}}),Ws({rules:r}),Ji(a.build())];e.set(vn,l);let c=i({schema:n,doc:s,plugins:l}),h=Ui.create(c);return e.set(In,h),e.done(cr),()=>{u(),e.remove(yi).remove(In).remove(wi).remove(bi).clearTimer(cr)}});Oe(ga,{displayName:"EditorState"});var Fi=O([],"pasteRule"),Si=O([be],"pasteRuleTimer"),fr=ke("PasteRuleReady"),xa=e=>(e.inject(Fi,[]).inject(Si,[be]).record(fr),async()=>(await e.waitTimers(Si),e.done(fr),()=>{e.remove(Fi).remove(Si).clearTimer(fr)}));Oe(xa,{displayName:"PasteRule"});var Ci=ke("EditorViewReady"),Ii=O([],"editorViewTimer"),Ei=O({},"editorViewOptions"),vi=O(null,"root"),Mi=O(null,"rootDOM"),Oi=O({},"rootAttrs");function Sc(e,n){let t=document.createElement("div");t.className="milkdown",e.appendChild(t),n.set(Mi,t);let r=n.get(Oi);return Object.entries(r).forEach(([i,o])=>t.setAttribute(i,o)),t}function Cc(e){e.classList.add("editor"),e.setAttribute("role","textbox")}var Ic=new Jt("MILKDOWN_VIEW_CLEAR"),ka=e=>(e.inject(vi,document.body).inject(Dt,{}).inject(Ei,{}).inject(Mi,null).inject(Oi,{}).inject(Ii,[cr,fr]).record(Ci),async()=>{await e.wait(En);let n=e.get(vi)||document.body,t=typeof n=="string"?document.querySelector(n):n;e.update(vn,u=>[new Yt({key:Ic,view:l=>{let c=t?Sc(t,e):void 0;return(()=>{if(c&&t){let p=l.dom;t.replaceChild(c,p),c.appendChild(p)}})(),{destroy:()=>{c?.parentNode&&c?.parentNode.replaceChild(l.dom,c),c?.remove()}}}}),...u]),await e.waitTimers(Ii);let r=e.get(In),i=e.get(Ei),o=Object.fromEntries(e.get(Pi)),s=Object.fromEntries(e.get(zi)),a=new Gi(t,{state:r,nodeViews:o,markViews:s,transformPasted:(u,l,c)=>(e.get(Fi).sort((h,p)=>(p.priority??50)-(h.priority??50)).map(h=>h.run).forEach(h=>{u=h(u,l,c)}),u),...i});return Cc(a.dom),e.set(Dt,a),e.done(Ci),()=>{a?.destroy(),e.remove(vi).remove(Dt).remove(Ei).remove(Mi).remove(Oi).remove(Ii).clearTimer(Ci)}});Oe(ka,{displayName:"EditorView"});var uk=(function(e){return e.Idle="Idle",e.OnCreate="OnCreate",e.Created="Created",e.OnDestroy="OnDestroy",e.Destroyed="Destroyed",e})({}),at,le,Fe,qt,Tn,An,ie,Me,ut,Pn,lt,Ht,zn,$e,$t,Ut,lk=(Ut=class{constructor(){C(this,at);C(this,le);C(this,Fe);C(this,qt);C(this,Tn);C(this,An);C(this,ie);C(this,Me);C(this,ut);C(this,Pn);C(this,lt);C(this,Ht);C(this,zn);C(this,$e);C(this,$t);y(this,at,!1),y(this,le,"Idle"),y(this,Fe,[]),y(this,qt,()=>{}),y(this,Tn,new gr),y(this,An,new lo),y(this,ie,new Map),y(this,Me,new Map),y(this,ut,new uo(g(this,Tn),g(this,An))),y(this,Pn,()=>{let n=gc(async r=>{await Promise.all(g(this,Fe).map(i=>Promise.resolve(i(r))))}),t=[ua,pa,da,ca,yc,xa,ga,ka,xc(this),n];g(this,lt).call(this,t,g(this,Me))}),y(this,lt,(n,t)=>{n.forEach(r=>{let i=g(this,ut).produce(g(this,at)?r.meta:void 0),o=r(i);t.set(r,{ctx:i,handler:o,cleanup:void 0})})}),y(this,Ht,(n,t=!1)=>Promise.all([n].flat().map(async r=>{let i=g(this,ie).get(r)?.cleanup;return t?g(this,ie).delete(r):g(this,ie).set(r,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof i=="function"?i():i}))),y(this,zn,async()=>{await Promise.all([...g(this,Me).entries()].map(async([n,{cleanup:t}])=>typeof t=="function"?t():t)),g(this,Me).clear()}),y(this,$e,n=>{y(this,le,n),g(this,qt).call(this,n)}),y(this,$t,n=>[...n.entries()].map(async([t,r])=>{let{ctx:i,handler:o}=r;if(!o)return;let s=await o();n.set(t,{ctx:i,handler:o,cleanup:s})})),this.enableInspector=(n=!0)=>(y(this,at,n),this),this.onStatusChange=n=>(y(this,qt,n),this),this.config=n=>(g(this,Fe).push(n),this),this.removeConfig=n=>(y(this,Fe,g(this,Fe).filter(t=>t!==n)),this),this.use=n=>{let t=[n].flat();return t.flat().forEach(r=>{g(this,ie).set(r,{ctx:void 0,handler:void 0,cleanup:void 0})}),g(this,le)==="Created"&&g(this,lt).call(this,t,g(this,ie)),this},this.remove=async n=>g(this,le)==="OnCreate"?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(t=>{setTimeout(()=>{t(this.remove(n))},50)})):(await g(this,Ht).call(this,[n].flat(),!0),this),this.create=async()=>g(this,le)==="OnCreate"?this:(g(this,le)==="Created"&&await this.destroy(),g(this,$e).call(this,"OnCreate"),g(this,Pn).call(this),g(this,lt).call(this,[...g(this,ie).keys()],g(this,ie)),await Promise.all([g(this,$t).call(this,g(this,Me)),g(this,$t).call(this,g(this,ie))].flat()),g(this,$e).call(this,"Created"),this),this.destroy=async(n=!1)=>g(this,le)==="Destroyed"||g(this,le)==="OnDestroy"?this:g(this,le)==="OnCreate"?new Promise(t=>{setTimeout(()=>{t(this.destroy(n))},50)}):(n&&y(this,Fe,[]),g(this,$e).call(this,"OnDestroy"),await g(this,Ht).call(this,[...g(this,ie).keys()],n),await g(this,zn).call(this),g(this,$e).call(this,"Destroyed"),this),this.action=n=>n(g(this,ut)),this.inspect=()=>g(this,at)?[...g(this,Me).values(),...g(this,ie).values()].map(({ctx:n})=>n?.inspector?.read()).filter(n=>!!n):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new Ut}get ctx(){return g(this,ut)}get status(){return g(this,le)}},at=new WeakMap,le=new WeakMap,Fe=new WeakMap,qt=new WeakMap,Tn=new WeakMap,An=new WeakMap,ie=new WeakMap,Me=new WeakMap,ut=new WeakMap,Pn=new WeakMap,lt=new WeakMap,Ht=new WeakMap,zn=new WeakMap,$e=new WeakMap,$t=new WeakMap,Ut);export{za as a,Ec as b,vc as c,Tc as d,Ac as e,O as f,ke as g,J as h,mo as i,_e as j,ae as k,te as l,nn as m,S as n,Q as o,A as p,yo as q,wo as r,z as s,It as t,Et as u,Ne as v,Pt as w,Gn as x,Br as y,Nr as z,Wr as A,pe as B,Ix as C,Ex as D,_x as E,Fx as F,Mx as G,Ox as H,Rx as I,hc as J,Lx as K,Bx as L,pc as M,Nx as N,jx as O,Dx as P,Dt as Q,In as R,li as S,na as T,Ti as U,vn as V,Ai as W,Pi as X,zi as Y,ct as Z,ci as _,ir as $,gc as aa,En as ba,xc as ca,be as da,fi as ea,Vt as fa,hi as ga,pi as ha,ua as ia,la as ja,ak as ka,ia as la,mi as ma,or as na,ca as oa,fa as pa,_i as qa,di as ra,sr as sa,yc as ta,ar as ua,ur as va,gi as wa,pa as xa,lr as ya,xi as za,ki as Aa,da as Ba,yi as Ca,wi as Da,bi as Ea,cr as Fa,wc as Ga,ga as Ha,Fi as Ia,Si as Ja,fr as Ka,xa as La,Ci as Ma,Ii as Na,Ei as Oa,vi as Pa,Mi as Qa,Oi as Ra,ka as Sa,uk as Ta,lk as Ua};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{e as yt,f as kt,g as ft}from"./chunk-7R5G6FRT.js";import{a as p,b as y,d as pe,e as D,g as ue,h as k,i as z,j as f,k as N,l as V,m as w}from"./chunk-GF2LJCG5.js";import{B as oe,C as X,D as se,F,O as gt,P as ht,Q as de,_ as me,a as M,la as c,x as ae,y as it,z as b}from"./chunk-P3WV3MLS.js";import{A as ct,F as J,G as K,H as Q,M as ie,N as le,a as lt,e as dt,j as mt,k as pt,n as ut,r as ne,t as W,x as H,y as O}from"./chunk-EAFZBBCI.js";function ce(t){let e=new Map;if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return b(t,"definition",function(a){let o=Nt(a.identifier);o&&!e.get(o)&&e.set(o,a)}),r;function r(a){let o=Nt(a);return e.get(o)}}function Nt(t){return String(t||"").toUpperCase()}function Z(){return function(t){let e=ce(t);b(t,function(r,a,o){if(r.type==="definition"&&o!==void 0&&typeof a=="number")return o.children.splice(a,1),[ae,a];if(r.type==="imageReference"||r.type==="linkReference"){let s=e(r.identifier);if(s&&o&&typeof a=="number")return o.children[a]=r.type==="imageReference"?{type:"image",url:s.url,title:s.title,alt:r.alt}:{type:"link",url:s.url,title:s.title,children:r.children},[ae,a]}})}}function It(t,e){if(!(e.childCount>=1&&e.lastChild?.type.name==="hardbreak")){t.next(e.content);return}let r=[];e.content.forEach((a,o,s)=>{s!==e.childCount-1&&r.push(a)}),t.next(lt.fromArray(r))}function n(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-commonmark",...e}}),t}var ge=V("emphasis");n(ge,{displayName:"Attr<emphasis>",group:"Emphasis"});var E=z("emphasis",t=>({attrs:{marker:{default:t.get(me).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>e==="italic"}],toDOM:e=>["em",t.get(ge.key)(e)],parseMarkdown:{match:e=>e.type==="emphasis",runner:(e,r,a)=>{e.openMark(a,{marker:r.marker}),e.next(r.children),e.closeMark(a)}},toMarkdown:{match:e=>e.type.name==="emphasis",runner:(e,r)=>{e.withMark(r,"emphasis",void 0,{marker:r.attrs.marker})}}}));n(E.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});n(E.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var he=p("ToggleEmphasis",t=>()=>Q(E.type(t)));n(he,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var vt=y(t=>F(/(?:^|[^*])\*([^*]+)\*$/,E.type(t),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:r})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:r+1}}));n(vt,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var Ct=y(t=>F(/\b_(?![_\s])(.*?[^_\s])_$/,E.type(t),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:r})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:r+1}}));n(Ct,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var ye=f("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:t=>{let e=t.get(c);return()=>e.call(he.key)}}});n(ye.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});n(ye.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var ke=V("strong");n(ke,{displayName:"Attr<strong>",group:"Strong"});var U=z("strong",t=>({attrs:{marker:{default:t.get(me).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",t.get(ke.key)(e)],parseMarkdown:{match:e=>e.type==="strong",runner:(e,r,a)=>{e.openMark(a,{marker:r.marker}),e.next(r.children),e.closeMark(a)}},toMarkdown:{match:e=>e.type.name==="strong",runner:(e,r)=>{e.withMark(r,"strong",void 0,{marker:r.attrs.marker})}}}));n(U.mark,{displayName:"MarkSchema<strong>",group:"Strong"});n(U.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var fe=p("ToggleStrong",t=>()=>Q(U.type(t)));n(fe,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var Mt=y(t=>F(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,U.type(t),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));n(Mt,{displayName:"InputRule<strong>",group:"Strong"});var Ne=f("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:t=>{let e=t.get(c);return()=>e.call(fe.key)}}});n(Ne.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});n(Ne.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var Ie=V("inlineCode");n(Ie,{displayName:"Attr<inlineCode>",group:"InlineCode"});var x=z("inlineCode",t=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:e=>["code",t.get(Ie.key)(e)],parseMarkdown:{match:e=>e.type==="inlineCode",runner:(e,r,a)=>{e.openMark(a),e.addText(r.value),e.closeMark(a)}},toMarkdown:{match:e=>e.type.name==="inlineCode",runner:(e,r,a)=>(e.withMark(r,"inlineCode",a.text||""),!0)}}));n(x.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});n(x.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var ve=p("ToggleInlineCode",t=>()=>(e,r)=>{let{selection:a,tr:o}=e;if(a.empty)return!1;let{from:s,to:i}=a;return e.doc.rangeHasMark(s,i,x.type(t))?(r?.(o.removeMark(s,i,x.type(t))),!0):(Object.keys(e.schema.marks).filter(l=>l!==x.type.name).map(l=>e.schema.marks[l]).forEach(l=>{o.removeMark(s,i,l)}),r?.(o.addMark(s,i,x.type(t).create())),!0)});n(ve,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var bt=y(t=>F(/(?:`)([^`]+)(?:`)$/,x.type(t)));n(bt,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var Ce=f("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:t=>{let e=t.get(c);return()=>e.call(ve.key)}}});n(Ce.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});n(Ce.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var Vt=new Set(["http:","https:","mailto:","tel:","ftp:"]);function Ut(t){return t<=32||t>=127&&t<=160||t>=8203&&t<=8205||t===8232||t===8233||t===65279}function Gt(t){let e="";for(let r of t)Ut(r.codePointAt(0)??0)||(e+=r);return e}function jt(t){if(typeof t!="string")return"";let e=t.trim();if(!e)return"";let r=Gt(e),a=/^([a-z][a-z0-9+.-]*):/i.exec(r)?.[1];return!a||Vt.has(`${a.toLowerCase()}:`)?e:""}var Me=V("link");n(Me,{displayName:"Attr<link>",group:"Link"});var P=z("link",t=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw M(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:e=>["a",{...t.get(Me.key)(e),...e.attrs,href:jt(e.attrs.href)}],parseMarkdown:{match:e=>e.type==="link",runner:(e,r,a)=>{let o=r.url,s=r.title;e.openMark(a,{href:o,title:s}),e.next(r.children),e.closeMark(a)}},toMarkdown:{match:e=>e.type.name==="link",runner:(e,r)=>{e.withMark(r,"link",void 0,{title:r.attrs.title,url:r.attrs.href})}}}));n(P.mark,{displayName:"MarkSchema<link>",group:"Link"});var Lt=p("ToggleLink",t=>(e={})=>Q(P.type(t),e));n(Lt,{displayName:"Command<toggleLinkCommand>",group:"Link"});var xt=p("UpdateLink",t=>(e={})=>(r,a)=>{if(!a)return!1;let o,s=-1,{selection:i}=r,{from:l,to:d}=i;if(r.doc.nodesBetween(l,l===d?d+1:d,(C,h)=>{if(P.type(t).isInSet(C.marks))return o=C,s=h,!1}),!o)return!1;let m=o.marks.find(({type:C})=>C===P.type(t));if(!m)return!1;let g=s,u=s+o.nodeSize,{tr:v}=r,I=P.type(t).create({...m.attrs,...e});return I?(a(v.removeMark(g,u,m).addMark(g,u,I).setSelection(new W(v.selection.$anchor)).scrollIntoView()),!0):!1});n(xt,{displayName:"Command<updateLinkCommand>",group:"Link"});var St=pe("doc",()=>({content:"block+",parseMarkdown:{match:({type:t})=>t==="root",runner:(t,e,r)=>{t.injectRoot(e,r)}},toMarkdown:{match:t=>t.type.name==="doc",runner:(t,e)=>{t.openNode("root"),t.next(e.content)}}}));n(St,{displayName:"NodeSchema<doc>",group:"Doc"});function Yt(t){return it(t,e=>e.type==="html"&&["<br />","<br>","<br >","<br/>"].includes(e.value?.trim()),(e,r)=>{if(!r.length)return;let a=r[r.length-1];if(!a)return;let o=a.children.indexOf(e);o!==-1&&a.children.splice(o,1)},!0)}var te=w("remark-preserve-empty-line",()=>()=>Yt);n(te.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});n(te.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var be=N("paragraph");n(be,{displayName:"Attr<paragraph>",group:"Paragraph"});var R=k("paragraph",t=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:e=>["p",t.get(be.key)(e),0],parseMarkdown:{match:e=>e.type==="paragraph",runner:(e,r,a)=>{e.openNode(a),r.children?e.next(r.children):e.addText(r.value||""),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="paragraph",runner:(e,r)=>{let a=t.get(de).state?.doc.lastChild;e.openNode("paragraph"),(!r.content||r.content.size===0)&&r!==a&&Jt(t)?e.addNode("html",void 0,"<br />"):It(e,r),e.closeNode()}}}));function Jt(t){let e=!1;try{t.get(te.id),e=!0}catch{e=!1}return e}n(R.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});n(R.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var Le=p("TurnIntoText",t=>()=>K(R.type(t)));n(Le,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var xe=f("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:t=>{let e=t.get(c);return()=>e.call(Le.key)}}});n(xe.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});n(xe.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var Qt=Array(6).fill(0).map((t,e)=>e+1);function Xt(t){return t.textContent.toLowerCase().trim().replace(/\s+/g,"-")}var re=ue(Xt,"headingIdGenerator");n(re,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var Se=N("heading");n(Se,{displayName:"Attr<heading>",group:"Heading"});var B=k("heading",t=>{let e=t.get(re.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:Qt.map(r=>({tag:`h${r}`,getAttrs:a=>{if(!(a instanceof HTMLElement))throw M(a);return{level:r,id:a.id}}})),toDOM:r=>[`h${r.attrs.level}`,{...t.get(Se.key)(r),id:r.attrs.id||e(r)},0],parseMarkdown:{match:({type:r})=>r==="heading",runner:(r,a,o)=>{let s=a.depth;r.openNode(o,{level:s}),r.next(a.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="heading",runner:(r,a)=>{r.openNode("heading",void 0,{depth:a.attrs.level}),It(r,a),r.closeNode()}}}});n(B.node,{displayName:"NodeSchema<heading>",group:"Heading"});n(B.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var wt=y(t=>se(/^(?<hashes>#+)\s$/,B.type(t),e=>{let r=e.groups?.hashes?.length||0,{$from:a}=t.get(de).state.selection,o=a.node();if(o.type.name==="heading"){let s=Number(o.attrs.level)+Number(r);return s>6&&(s=6),{level:s}}return{level:r}}));n(wt,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var L=p("WrapInHeading",t=>e=>(e??(e=1),e<1?K(R.type(t)):K(B.type(t),{level:e})));n(L,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var we=p("DowngradeHeading",t=>()=>(e,r,a)=>{let{$from:o}=e.selection,s=o.node();if(s.type!==B.type(t)||!e.selection.empty||o.parentOffset!==0)return!1;let i=s.attrs.level-1;return i?(r?.(e.tr.setNodeMarkup(e.selection.$from.before(),void 0,{...s.attrs,level:i})),!0):K(R.type(t))(e,r,a)});n(we,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var Ae=f("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:t=>{let e=t.get(c);return()=>e.call(L.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:t=>{let e=t.get(c);return()=>e.call(L.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:t=>{let e=t.get(c);return()=>e.call(L.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:t=>{let e=t.get(c);return()=>e.call(L.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:t=>{let e=t.get(c);return()=>e.call(L.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:t=>{let e=t.get(c);return()=>e.call(L.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:t=>{let e=t.get(c);return()=>e.call(we.key)}}});n(Ae.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});n(Ae.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var Re=N("blockquote");n(Re,{displayName:"Attr<blockquote>",group:"Blockquote"});var G=k("blockquote",t=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:e=>["blockquote",t.get(Re.key)(e),0],parseMarkdown:{match:({type:e})=>e==="blockquote",runner:(e,r,a)=>{e.openNode(a).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="blockquote",runner:(e,r)=>{e.openNode("blockquote").next(r.content).closeNode()}}}));n(G.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});n(G.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var At=y(t=>X(/^\s*>\s$/,G.type(t)));n(At,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var Be=p("WrapInBlockquote",t=>()=>J(G.type(t)));n(Be,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var Te=f("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:t=>{let e=t.get(c);return()=>e.call(Be.key)}}});n(Te.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});n(Te.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var He=N("codeBlock",()=>({pre:{},code:{}}));n(He,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var j=k("code_block",t=>({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 M(e);return{language:e.dataset.language}}}],toDOM:e=>{let r=t.get(He.key)(e),a=e.attrs.language,o=a&&a.length>0?{"data-language":a}:void 0;return["pre",{...r.pre,...o},["code",r.code,0]]},parseMarkdown:{match:({type:e})=>e==="code",runner:(e,r,a)=>{let o=r.lang??"",s=r.value;e.openNode(a,{language:o}),s&&e.addText(s),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="code_block",runner:(e,r)=>{e.addNode("code",void 0,r.content.firstChild?.text||"",{lang:r.attrs.language})}}}));n(j.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});n(j.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var Rt=y(t=>se(/^```(?<language>[a-z]*)?[\s\n]$/,j.type(t),e=>({language:e.groups?.language??""})));n(Rt,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var Oe=p("CreateCodeBlock",t=>(e="")=>K(j.type(t),{language:e}));n(Oe,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var Zt=p("UpdateCodeBlockLanguage",()=>({pos:t,language:e}={pos:-1,language:""})=>(r,a)=>t>=0?(a?.(r.tr.setNodeAttribute(t,"language",e)),!0):!1);n(Zt,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Ke=f("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:t=>{let e=t.get(c);return()=>e.call(Oe.key)}}});n(Ke.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});n(Ke.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var De=N("image");n(De,{displayName:"Attr<image>",group:"Image"});var _=k("image",t=>({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 M(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:e=>["img",{...t.get(De.key)(e),...e.attrs}],parseMarkdown:{match:({type:e})=>e==="image",runner:(e,r,a)=>{let o=r.url,s=r.alt,i=r.title;e.addNode(a,{src:o,alt:s,title:i})}},toMarkdown:{match:e=>e.type.name==="image",runner:(e,r)=>{e.addNode("image",void 0,void 0,{title:r.attrs.title,url:r.attrs.src,alt:r.attrs.alt})}}}));n(_.node,{displayName:"NodeSchema<image>",group:"Image"});n(_.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var Bt=p("InsertImage",t=>(e={})=>(r,a)=>{if(!a)return!0;let{src:o="",alt:s="",title:i=""}=e,l=_.type(t).create({src:o,alt:s,title:i});return l&&a(r.tr.replaceSelectionWith(l).scrollIntoView()),!0});n(Bt,{displayName:"Command<insertImageCommand>",group:"Image"});var Tt=p("UpdateImage",t=>(e={})=>(r,a)=>{let o=gt(r.selection,_.type(t));if(!o)return!1;let{node:s,pos:i}=o,l={...s.attrs},{src:d,alt:m,title:g}=e;return d!==void 0&&(l.src=d),m!==void 0&&(l.alt=m),g!==void 0&&(l.title=g),a?.(r.tr.setNodeMarkup(i,void 0,l).scrollIntoView()),!0});n(Tt,{displayName:"Command<updateImageCommand>",group:"Image"});var er=y(t=>new oe(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(e,r,a,o)=>{let[s,i,l="",d]=r;return s?e.tr.replaceWith(a,o,_.type(t).create({src:l,alt:i,title:d})):null}));n(er,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var ee=N("hardbreak",t=>({"data-type":"hardbreak","data-is-inline":t.attrs.isInline}));n(ee,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var A=k("hardbreak",t=>({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",t.get(ee.key)(e)," "]:["br",t.get(ee.key)(e)],parseMarkdown:{match:({type:e})=>e==="break",runner:(e,r,a)=>{e.addNode(a,{isInline:!!r.data?.isInline})}},leafText:()=>`
|
|
2
|
-
`,toMarkdown:{match:e=>e.type.name==="hardbreak",runner:(e,r)=>{r.attrs.isInline?e.addNode("text",void 0,`
|
|
3
|
-
`):e.addNode("break")}}}));n(A.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});n(A.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var Pe=p("InsertHardbreak",t=>()=>(e,r)=>{let{selection:a,tr:o}=e;if(!(a instanceof W))return!1;if(a.empty){let s=a.$from.node();if(s.childCount>0&&s.lastChild?.type.name==="hardbreak")return r?.(o.replaceRangeWith(a.to-1,a.to,e.schema.node("paragraph")).setSelection(ne.near(o.doc.resolve(a.to))).scrollIntoView()),!0}return r?.(o.setMeta("hardbreak",!0).replaceSelectionWith(A.type(t).create()).scrollIntoView()),!0});n(Pe,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var Ee=f("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:t=>{let e=t.get(c);return()=>e.call(Pe.key)}}});n(Ee.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});n(Ee.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var _e=N("hr");n(_e,{displayName:"Attr<hr>",group:"Hr"});var Y=k("hr",t=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:e=>["hr",t.get(_e.key)(e)],parseMarkdown:{match:({type:e})=>e==="thematicBreak",runner:(e,r,a)=>{e.addNode(a)}},toMarkdown:{match:e=>e.type.name==="hr",runner:e=>{e.addNode("thematicBreak")}}}));n(Y.node,{displayName:"NodeSchema<hr>",group:"Hr"});n(Y.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var Ht=y(t=>new oe(/^(?:---|___\s|\*\*\*\s)$/,(e,r,a,o)=>{let{tr:s}=e;return r[0]&&s.replaceWith(a-1,o,Y.type(t).create()),s}));n(Ht,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var Ot=p("InsertHr",t=>()=>(e,r)=>{if(!r)return!0;let a=R.node.type(t).create(),{tr:o,selection:s}=e,{from:i}=s,l=Y.type(t).create();if(!l)return!0;let d=o.replaceSelectionWith(l).insert(i,a),m=ne.findFrom(d.doc.resolve(i),1,!0);return m&&r(d.setSelection(m).scrollIntoView()),!0});n(Ot,{displayName:"Command<insertHrCommand>",group:"Hr"});var $e=N("bulletList");n($e,{displayName:"Attr<bulletList>",group:"BulletList"});var $=k("bullet_list",t=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw M(e);return{spread:e.dataset.spread==="true"}}}],toDOM:e=>["ul",{...t.get($e.key)(e),"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:r})=>e==="list"&&!r,runner:(e,r,a)=>{let o=r.spread??!1;e.openNode(a,{spread:o}).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="bullet_list",runner:(e,r)=>{e.openNode("list",void 0,{ordered:!1,spread:r.attrs.spread}).next(r.content).closeNode()}}}));n($.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});n($.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var Kt=y(t=>X(/^\s*([-+*])\s$/,$.type(t)));n(Kt,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var qe=p("WrapInBulletList",t=>()=>J($.type(t)));n(qe,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var We=f("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:t=>{let e=t.get(c);return()=>e.call(qe.key)}}});n(We.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});n(We.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var Fe=N("orderedList");n(Fe,{displayName:"Attr<orderedList>",group:"OrderedList"});var q=k("ordered_list",t=>({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 M(e);return{spread:e.dataset.spread==="true",order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:e=>["ol",{...t.get(Fe.key)(e),...e.attrs.order===1?{}:{start:e.attrs.order},"data-spread":e.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:r})=>e==="list"&&!!r,runner:(e,r,a)=>{let o=r.spread??!0;e.openNode(a,{spread:o,order:r.start??1}).next(r.children).closeNode()}},toMarkdown:{match:e=>e.type.name==="ordered_list",runner:(e,r)=>{e.openNode("list",void 0,{ordered:!0,start:r.attrs.order??1,spread:r.attrs.spread}),e.next(r.content),e.closeNode()}}}));n(q.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});n(q.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var Dt=y(t=>X(/^\s*(\d+)\.\s$/,q.type(t),e=>({order:Number(e[1])}),(e,r)=>r.childCount+r.attrs.order===Number(e[1])));n(Dt,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var ze=p("WrapInOrderedList",t=>()=>J(q.type(t)));n(ze,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var Ve=f("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:t=>{let e=t.get(c);return()=>e.call(ze.key)}}});n(Ve.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});n(Ve.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var Ue=N("listItem");n(Ue,{displayName:"Attr<listItem>",group:"ListItem"});var S=k("list_item",t=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"\u2022",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw M(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread==="true"}}}],toDOM:e=>["li",{...t.get(Ue.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,r,a)=>{let o=r.label!=null?`${r.label}.`:"\u2022",s=r.label!=null?"ordered":"bullet",i=r.spread??!0;e.openNode(a,{label:o,listType:s,spread:i}),e.next(r.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="list_item",runner:(e,r)=>{e.openNode("listItem",void 0,{spread:r.attrs.spread}),e.next(r.content),e.closeNode()}}}));n(S.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});n(S.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var Ge=p("SinkListItem",t=>()=>ft(S.type(t)));n(Ge,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var je=p("LiftListItem",t=>()=>kt(S.type(t)));n(je,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var Ye=p("SplitListItem",t=>()=>yt(S.type(t)));n(Ye,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function tr(t){return(e,r,a)=>{let{selection:o}=e;if(!(o instanceof W))return!1;let{empty:s,$from:i}=o;return!s||i.parentOffset!==0||i.node(-1).type!==S.type(t)?!1:ct(e,r,a)}}var Je=p("LiftFirstListItem",t=>()=>tr(t));n(Je,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var Qe=f("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:t=>{let e=t.get(c);return()=>e.call(Ye.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:t=>{let e=t.get(c);return()=>e.call(Ge.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:t=>{let e=t.get(c);return()=>e.call(je.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:t=>{let e=t.get(c);return()=>e.call(Je.key)}}});n(Qe.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});n(Qe.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var Pt=pe("text",()=>({group:"inline",parseMarkdown:{match:({type:t})=>t==="text",runner:(t,e)=>{t.addText(e.value)}},toMarkdown:{match:t=>t.type.name==="text",runner:(t,e)=>{t.addNode("text",void 0,e.text)}}}));n(Pt,{displayName:"NodeSchema<text>",group:"Text"});var Xe=N("html");n(Xe,{displayName:"Attr<html>",group:"Html"});var Ze=k("html",t=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:e=>{let r=document.createElement("span"),a={...t.get(Xe.key)(e),"data-value":e.attrs.value,"data-type":"html"};return r.textContent=e.attrs.value,["span",a,e.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>e==="html",runner:(e,r,a)=>{e.addNode(a,{value:r.value})}},toMarkdown:{match:e=>e.type.name==="html",runner:(e,r)=>{e.addNode("html",void 0,r.attrs.value)}}}));n(Ze.node,{displayName:"NodeSchema<html>",group:"Html"});n(Ze.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var rr=[St,be,R,re,Se,B,ee,A,Re,G,He,j,_e,Y,De,_,$e,$,Fe,q,Ue,S,ge,E,ke,U,Ie,x,Me,P,Xe,Ze,Pt].flat(),ar=[At,Kt,Dt,Rt,Ht,wt].flat(),nr=[vt,Ct,bt,Mt],or=p("IsMarkSelected",()=>t=>e=>{if(!t)return!1;let{doc:r,selection:a}=e;return r.rangeHasMark(a.from,a.to,t)}),sr=p("IsNoteSelected",()=>t=>e=>t?ht(e,t).hasNode:!1),ir=p("ClearTextInCurrentBlock",()=>()=>(t,e)=>{let r=t.tr,{$from:a,$to:o}=r.selection,{pos:s}=a,{pos:i}=o,l=s-a.node().content.size;return l<0?!1:(r=r.deleteRange(l,i),e?.(r),!0)}),lr=p("SetBlockType",()=>t=>(e,r)=>{let{nodeType:a,attrs:o=null}=t??{};if(!a)return!1;let s=e.tr,{from:i,to:l}=s.selection;try{s.setBlockType(i,l,a,o)}catch{return!1}return r?.(s),!0}),dr=p("WrapInBlockType",()=>t=>(e,r)=>{let{nodeType:a,attrs:o=null}=t??{};if(!a)return!1;let s=e.tr;try{let{$from:i,$to:l}=s.selection,d=i.blockRange(l),m=d&&ut(d,a,o);if(!m)return!1;s=s.wrap(d,m)}catch{return!1}return r?.(s),!0}),mr=p("AddBlockType",()=>t=>(e,r)=>{let{nodeType:a,attrs:o=null}=t??{};if(!a)return!1;let s=e.tr;try{let i=a instanceof dt?a:a.createAndFill(o);if(!i)return!1;s.replaceSelectionWith(i)}catch{return!1}return r?.(s),!0}),pr=p("SelectTextNearPos",()=>t=>(e,r)=>{let{pos:a}=t??{};if(a==null)return!1;let o=(i,l,d)=>Math.min(Math.max(i,l),d),s=e.tr;try{let i=e.doc.resolve(o(a,0,e.doc.content.size));s.setSelection(W.near(i))}catch{return!1}return r?.(s.scrollIntoView()),!0}),ur=[Le,Be,L,we,Oe,Pe,Ot,Bt,Tt,ze,qe,Ge,Ye,je,Je,he,ve,fe,Lt,xt,or,sr,ir,lr,dr,mr,pr],cr=[Te,Ke,Ee,Ae,Qe,Ve,We,xe,ye,Ce,Ne].flat(),et=w("remarkAddOrderInList",()=>()=>t=>{b(t,"list",e=>{if(e.ordered){let r=e.start??1;e.children.forEach((a,o)=>{a.label=o+r})}})});n(et.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});n(et.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var tt=w("remarkLineBreak",()=>()=>t=>{let e=/[\t ]*(?:\r?\n|\r)/g;b(t,"text",(r,a,o)=>{if(!r.value||typeof r.value!="string")return;let s=[],i=0;e.lastIndex=0;let l=e.exec(r.value);for(;l;){let d=l.index;i!==d&&s.push({type:"text",value:r.value.slice(i,d)}),s.push({type:"break",data:{isInline:!0}}),i=d+l[0].length,l=e.exec(r.value)}if(s.length>0&&o&&typeof a=="number")return i<r.value.length&&s.push({type:"text",value:r.value.slice(i)}),o.children.splice(a,1,...s),a+s.length})});n(tt.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});n(tt.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var rt=w("remarkInlineLink",()=>Z);n(rt.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});n(rt.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var gr=t=>!!t.children,hr=t=>t.type==="html";function yr(t,e){return r(t,0,null)[0];function r(a,o,s){if(gr(a)){let i=[];for(let l=0,d=a.children.length;l<d;l++){let m=a.children[l];if(m){let g=r(m,l,a);if(g)for(let u=0,v=g.length;u<v;u++){let I=g[u];I&&i.push(I)}}}a.children=i}return e(a,o,s)}}var kr=["root","blockquote","listItem"],at=w("remarkHTMLTransformer",()=>()=>t=>{yr(t,(e,r,a)=>hr(e)?(a&&kr.includes(a.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]):[e])});n(at.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});n(at.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var nt=w("remarkMarker",()=>()=>(t,e)=>{let r=a=>e.value.charAt(a.position.start.offset);b(t,a=>["strong","emphasis"].includes(a.type),a=>{a.marker=r(a)})});n(nt.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});n(nt.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var Et=D(()=>{let t=!1,e=new O("MILKDOWN_INLINE_NODES_CURSOR"),r=new H({key:e,state:{init(){return!1},apply(a){if(!a.selection.empty)return!1;let o=a.selection.$from,s=o.nodeBefore,i=o.nodeAfter;return!!(s&&i&&s.isInline&&!s.isText&&i.isInline&&!i.isText)}},props:{handleDOMEvents:{compositionend:(a,o)=>t?(t=!1,requestAnimationFrame(()=>{if(r.getState(a.state)){let s=a.state.selection.from;o.preventDefault(),a.dispatch(a.state.tr.insertText(o.data||"",s))}}),!0):!1,compositionstart:a=>(r.getState(a.state)&&(t=!0),!1),beforeinput:(a,o)=>{if(r.getState(a.state)&&o instanceof InputEvent&&o.data&&!t){let s=a.state.selection.from;return o.preventDefault(),a.dispatch(a.state.tr.insertText(o.data||"",s)),!0}return!1}},decorations(a){if(r.getState(a)){let o=a.selection.$from.pos,s=document.createElement("span"),i=ie.widget(o,s,{side:-1}),l=document.createElement("span"),d=ie.widget(o,l);return setTimeout(()=>{s.contentEditable="true",l.contentEditable="true"}),le.create(a.doc,[i,d])}return le.empty}}});return r});n(Et,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var _t=D(t=>new H({key:new O("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(e,r,a)=>{if(!e.length)return;let[o]=e;if(!o)return;let[s]=o.steps;if(o.getMeta("hardbreak")){if(!(s instanceof pt))return;let{from:i}=s;return a.tr.setNodeMarkup(i,A.type(t),void 0,[])}if(s instanceof mt){let i=a.tr,{from:l,to:d}=s;return a.doc.nodesBetween(l,d,(m,g)=>{m.type===A.type(t)&&(i=i.setNodeMarkup(g,A.type(t),void 0,[]))}),i}}}));n(_t,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var ot=ue(["table","code_block"],"hardbreakFilterNodes");n(ot,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var $t=D(t=>{let e=t.get(ot.key);return new H({key:new O("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(r,a)=>{let o=r.getMeta("hardbreak"),[s]=r.steps;if(o&&s){let{from:i}=s,l=a.doc.resolve(i),d=l.depth,m=!0;for(;d>0;)e.includes(l.node(d).type.name)&&(m=!1),d--;return m}return!0}})});n($t,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var qt=D(t=>{let e=new O("MILKDOWN_HEADING_ID"),r=a=>{if(a.composing)return;let o=t.get(re.key),s=a.state.tr.setMeta("addToHistory",!1),i=!1,l={};a.state.doc.descendants((d,m)=>{if(d.type===B.type(t)){if(d.textContent.trim().length===0)return;let g=d.attrs,u=o(d);l[u]?(l[u]+=1,u+=`-#${l[u]}`):l[u]=1,g.id!==u&&(i=!0,s.setMeta(e,!0).setNodeMarkup(m,void 0,{...g,id:u}))}}),i&&a.dispatch(s)};return new H({key:e,view:a=>(r(a),{update:(o,s)=>{o.state.doc.eq(s.doc)||r(o)}})})});n(qt,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var Wt=D(t=>{let e=(r,a,o)=>{if(!o.selection||r.some(u=>u.getMeta("addToHistory")===!1||!u.isGeneric))return null;let s=q.type(t),i=$.type(t),l=S.type(t),d=(u,v,I=1)=>{let C=!1,h=`${v+I}.`;return u.label!==h&&(u.label=h,C=!0),C},m=o.tr,g=!1;return o.doc.descendants((u,v,I,C)=>{if(u.type===i){let h=u.maybeChild(0);h?.type===l&&h.attrs.listType==="ordered"&&(g=!0,m.setNodeMarkup(v,s,{spread:!0}),u.descendants((T,Ft,Nr,zt)=>{if(T.type===l){let st={...T.attrs};d(st,zt)&&(m=m.setNodeMarkup(Ft,void 0,st))}return!1}))}else if(u.type===l&&I?.type===s){let h={...u.attrs},T=!1;h.listType!=="ordered"&&(h.listType="ordered",T=!0),I?.maybeChild(0)&&(T=d(h,C,I?.attrs.order??1)),T&&(m=m.setNodeMarkup(v,void 0,h),g=!0)}}),g?m.setMeta("addToHistory",!1):null};return new H({key:new O("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:e})});n(Wt,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var fr=[_t,ot,$t,Et,et,rt,tt,at,nt,te,qt,Wt].flat(),Fr=[rr,ar,nr,ur,cr,fr].flat();export{ge as a,E as b,he as c,vt as d,Ct as e,ye as f,ke as g,U as h,fe as i,Mt as j,Ne as k,Ie as l,x as m,ve as n,bt as o,Ce as p,jt as q,Me as r,P as s,Lt as t,xt as u,St as v,te as w,be as x,R as y,Le as z,xe as A,re as B,Se as C,B as D,wt as E,L as F,we as G,Ae as H,Re as I,G as J,At as K,Be as L,Te as M,He as N,j as O,Rt as P,Oe as Q,Zt as R,Ke as S,De as T,_ as U,Bt as V,Tt as W,er as X,ee as Y,A as Z,Pe as _,Ee as $,_e as aa,Y as ba,Ht as ca,Ot as da,$e as ea,$ as fa,Kt as ga,qe as ha,We as ia,Fe as ja,q as ka,Dt as la,ze as ma,Ve as na,Ue as oa,S as pa,Ge as qa,je as ra,Ye as sa,Je as ta,Qe as ua,Pt as va,Xe as wa,Ze as xa,rr as ya,ar as za,nr as Aa,or as Ba,sr as Ca,ir as Da,lr as Ea,dr as Fa,mr as Ga,pr as Ha,ur as Ia,cr as Ja,et as Ka,tt as La,rt as Ma,at as Na,nt as Oa,Et as Pa,_t as Qa,ot as Ra,$t as Sa,qt as Ta,Wt as Ua,fr as Va,Fr as Wa};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as g,L as U,e as V,f as y,k,l as x,n as f,o as v,u as L,x as m,y as M}from"./chunk-SGGMD6DA.js";var J=()=>{let t=!0;return(o,e)=>{if(t){t=!1;try{o()}finally{t=!0}}else e!==void 0&&e()}};var S=3e4,A=class extends V{constructor(o){super(),this.doc=o,this.clientID=o.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=g();this.getLocalState()!==null&&S/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let i=[];this.meta.forEach((s,n)=>{n!==this.clientID&&S<=e-s.lastUpdated&&this.states.has(n)&&i.push(n)}),i.length>0&&T(this,i,"timeout")},y(S/10)),o.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(o){let e=this.clientID,i=this.meta.get(e),s=i===void 0?0:i.clock+1,n=this.states.get(e);o===null?this.states.delete(e):this.states.set(e,o),this.meta.set(e,{clock:s,lastUpdated:g()});let c=[],a=[],d=[],h=[];o===null?h.push(e):n==null?o!=null&&c.push(e):(a.push(e),U(n,o)||d.push(e)),(c.length>0||d.length>0||h.length>0)&&this.emit("change",[{added:c,updated:d,removed:h},"local"]),this.emit("update",[{added:c,updated:a,removed:h},"local"])}setLocalStateField(o,e){let i=this.getLocalState();i!==null&&this.setLocalState({...i,[o]:e})}getStates(){return this.states}},T=(t,o,e)=>{let i=[];for(let s=0;s<o.length;s++){let n=o[s];if(t.states.has(n)){if(t.states.delete(n),n===t.clientID){let c=t.meta.get(n);t.meta.set(n,{clock:c.clock+1,lastUpdated:g()})}i.push(n)}}i.length>0&&(t.emit("change",[{added:[],updated:[],removed:i},e]),t.emit("update",[{added:[],updated:[],removed:i},e]))},Y=(t,o,e=t.states)=>{let i=o.length,s=k();f(s,i);for(let n=0;n<i;n++){let c=o[n],a=e.get(c)||null,d=t.meta.get(c).clock;f(s,c),f(s,d),v(s,JSON.stringify(a))}return x(s)};var j=(t,o,e)=>{let i=L(o),s=g(),n=[],c=[],a=[],d=[],h=m(i);for(let D=0;D<h;D++){let l=m(i),u=m(i),r=JSON.parse(M(i)),p=t.meta.get(l),O=t.states.get(l),I=p===void 0?0:p.clock;(I<u||I===u&&r===null&&t.states.has(l))&&(r===null?l===t.clientID&&t.getLocalState()!=null?u++:t.states.delete(l):t.states.set(l,r),t.meta.set(l,{clock:u,lastUpdated:s}),p===void 0&&r!==null?n.push(l):p!==void 0&&r===null?d.push(l):r!==null&&(U(r,O)||a.push(l),c.push(l)))}(n.length>0||a.length>0||d.length>0)&&t.emit("change",[{added:n,updated:a,removed:d},e]),(n.length>0||c.length>0||d.length>0)&&t.emit("update",[{added:n,updated:c,removed:d},e])};export{J as a,A as b,T as c,Y as d,j as e};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{e as N}from"./chunk-GF2LJCG5.js";import{Aa as O,I as y,L as P,Oa as M,fa as T,va as D}from"./chunk-P3WV3MLS.js";import{g,h,t as S,x as b,y as x}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";function u(e){if(!e)return!1;if(Array.isArray(e))return e.length>1?!1:u(e[0]);let r=e.content;return r?u(r):e.type==="text"}function A(e,r){return Object.assign(e,{meta:{package:"@milkdown/plugin-clipboard",...r}}),e}function z(e,r){let i=y(r);if(i)return e.dispatch(e.state.tr.replaceSelectionWith(i,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(r)),!0}catch{return!1}}var $=N(e=>{let r=e.get(T);e.update(M,t=>({...t,editable:t.editable??(()=>!0),transformPastedHTML:(n,o)=>{let s=t.transformPastedHTML;return s&&(n=s(n,o)),n.includes("docs-internal-guid")&&(n=n.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1"),n=n.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),n}}));let i=new x("MILKDOWN_CLIPBOARD");return new b({key:i,props:{handlePaste:(t,n,o)=>{let s=e.get(D),k=t.props.editable?.(t.state),{clipboardData:c}=n;if(!k||!c||t.state.selection.$from.node().type.spec.code)return!1;let l=c.getData("text/plain"),m=c.getData("vscode-editor-data");if(m){let a=JSON.parse(m)?.mode;if(l&&a){let{tr:p}=t.state,L=P("code_block",r);return p.replaceSelectionWith(L.create({language:a})).setSelection(S.near(p.doc.resolve(Math.max(0,p.selection.from-2)))).insertText(l.replace(/\r\n?/g,`
|
|
2
|
-
`)),t.dispatch(p),!0}}let d=c.getData("text/html");if(d.length===0&&l.length===0)return!1;if(d.length>0&&o)return z(t,o);let C=g.fromSchema(r),f;if(d.length===0){let a=s(l);if(!a||typeof a=="string")return!1;f=h.fromSchema(r).serializeFragment(a.content)}else{let a=document.createElement("template");a.innerHTML=d,f=a.content.cloneNode(!0),a.remove()}return z(t,C.parseSlice(f))},clipboardTextSerializer:t=>{let n=e.get(O);if(u(t.content.toJSON()))return t.content.textBetween(0,t.content.size,`
|
|
3
|
-
|
|
4
|
-
`);let o=r.topNodeType.createAndFill(void 0,t.content);return o?n(o):""}}})});A($,{displayName:"Prose<clipboard>"});export{$ as clipboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$,A,Aa as Bo,B,Ba as Co,C,Ca as Do,D,Da as Eo,E,Ea as Fo,F,Fa as Go,G,Ga as Ho,H,Ha as Io,I,Ia as Jo,J,Ja as Ko,K,Ka as Lo,L,La as Mo,M,Ma as No,N,Na as Oo,O,Oa as Po,P,Pa as Qo,Q,Qa as Ro,R,Ra as So,S,Sa as To,T,Ta as Uo,U,Ua as Vo,V,Va as Wo,W,Wa as Xo,X,Y,Z,_,a as o,aa as oo,b as r,ba as ro,c as e,ca as eo,d as f,da as fo,e as m,ea as mo,f as p,fa as po,g as t,ga as to,h as x,ha as xo,i as a,ia as ao,j as b,ja as bo,k as c,ka as co,l as d,la as go,m as g,ma as ho,n as h,na as io,o as i,oa as jo,p as j,pa as ko,q as k,qa as lo,r as l,ra as no,s as n,sa as qo,t as q,ta as so,u as s,ua as uo,v as u,va as vo,w as v,wa as wo,x as w,xa as yo,y,ya as zo,z,za as Ao}from"./chunk-URTGZHMG.js";import"./chunk-7R5G6FRT.js";import"./chunk-GF2LJCG5.js";import"./chunk-P3WV3MLS.js";import"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";export{Ho as addBlockTypeCommand,I as blockquoteAttr,M as blockquoteKeymap,J as blockquoteSchema,mo as bulletListAttr,ao as bulletListKeymap,po as bulletListSchema,Eo as clearTextInCurrentBlockCommand,N as codeBlockAttr,S as codeBlockKeymap,O as codeBlockSchema,Jo as commands,Xo as commonmark,Q as createCodeBlockCommand,P as createCodeBlockInputRule,u as docSchema,G as downgradeHeadingCommand,o as emphasisAttr,p as emphasisKeymap,r as emphasisSchema,f as emphasisStarInputRule,m as emphasisUnderscoreInputRule,Y as hardbreakAttr,Ro as hardbreakClearMarkPlugin,So as hardbreakFilterNodes,To as hardbreakFilterPlugin,$ as hardbreakKeymap,Z as hardbreakSchema,C as headingAttr,B as headingIdGenerator,H as headingKeymap,D as headingSchema,oo as hrAttr,ro as hrSchema,wo as htmlAttr,yo as htmlSchema,T as imageAttr,U as imageSchema,d as inlineCodeAttr,i as inlineCodeInputRule,j as inlineCodeKeymap,g as inlineCodeSchema,Qo as inlineNodesCursorPlugin,Ao as inputRules,_ as insertHardbreakCommand,fo as insertHrCommand,eo as insertHrInputRule,V as insertImageCommand,X as insertImageInputRule,Co as isMarkSelectedCommand,Do as isNodeSelectedCommand,Ko as keymap,so as liftFirstListItemCommand,no as liftListItemCommand,l as linkAttr,n as linkSchema,jo as listItemAttr,uo as listItemKeymap,ko as listItemSchema,Bo as markInputRules,bo as orderedListAttr,io as orderedListKeymap,co as orderedListSchema,w as paragraphAttr,A as paragraphKeymap,y as paragraphSchema,Wo as plugins,Lo as remarkAddOrderInListPlugin,Oo as remarkHtmlTransformer,No as remarkInlineLinkPlugin,Mo as remarkLineBreak,Po as remarkMarker,v as remarkPreserveEmptyLinePlugin,k as sanitizeLinkHref,zo as schema,Io as selectTextNearPosCommand,Fo as setBlockTypeCommand,lo as sinkListItemCommand,qo as splitListItemCommand,t as strongAttr,b as strongInputRule,c as strongKeymap,x as strongSchema,Uo as syncHeadingIdPlugin,Vo as syncListOrderPlugin,vo as textSchema,e as toggleEmphasisCommand,h as toggleInlineCodeCommand,q as toggleLinkCommand,a as toggleStrongCommand,z as turnIntoTextCommand,R as updateCodeBlockLanguageCommand,W as updateImageCommand,s as updateLinkCommand,Go as wrapInBlockTypeCommand,L as wrapInBlockquoteCommand,K as wrapInBlockquoteInputRule,xo as wrapInBulletListCommand,to as wrapInBulletListInputRule,F as wrapInHeadingCommand,E as wrapInHeadingInputRule,ho as wrapInOrderedListCommand,go as wrapInOrderedListInputRule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as d,Aa as M,Ba as N,Ca as O,Da as P,Ea as Q,Fa as R,Ga as S,Ha as T,Ia as U,Ja as V,Ka as W,La as X,Ma as Y,Na as Z,Oa as _,Pa as $,Q as o,Qa as oo,R as r,Ra as ro,S as e,Sa as eo,T as f,Ta as fo,U as m,Ua as mo,V as p,W as t,X as x,Y as a,Z as b,_ as c,aa as g,ba as h,ca as i,da as j,ea as k,fa as l,ga as n,ha as q,ia as s,ja as u,ka as v,la as w,ma as y,na as z,oa as A,pa as B,qa as C,ra as D,sa as E,ta as F,ua as G,va as H,wa as I,xa as J,ya as K,za as L}from"./chunk-P3WV3MLS.js";import"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";export{u as CommandManager,z as CommandsReady,d as ConfigReady,mo as Editor,R as EditorStateReady,fo as EditorStatus,Y as EditorViewReady,h as InitReady,B as KeymapManager,E as KeymapReady,G as ParserReady,W as PasteRulesReady,j as SchemaReady,K as SerializerReady,A as commands,w as commandsCtx,y as commandsTimerCtx,g as config,v as createCmdKey,O as defaultValueCtx,f as editorCtx,T as editorState,r as editorStateCtx,P as editorStateOptionsCtx,Q as editorStateTimerCtx,eo as editorView,o as editorViewCtx,_ as editorViewOptionsCtx,Z as editorViewTimerCtx,S as getDoc,i as init,e as initTimerCtx,m as inputRulesCtx,F as keymap,C as keymapCtx,D as keymapTimerCtx,a as markViewCtx,q as marksCtx,x as nodeViewCtx,n as nodesCtx,J as parser,H as parserCtx,I as parserTimerCtx,X as pasteRule,U as pasteRulesCtx,V as pasteRulesTimerCtx,p as prosePluginsCtx,b as remarkCtx,t as remarkPluginsCtx,c as remarkStringifyOptionsCtx,ro as rootAttrsCtx,$ as rootCtx,oo as rootDOMCtx,s as schema,l as schemaCtx,k as schemaTimerCtx,N as serializer,M as serializerCtx,L as serializerTimerCtx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as b,g as B}from"./chunk-GF2LJCG5.js";import"./chunk-P3WV3MLS.js";import{L as j,M as R,N as F,a as P,c as A,r as C,t as v,u as g,x as w,y as T}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";function Y(t){return t.nodeType===1}function G(t){return Y(t)&&t.namespaceURI==="http://www.w3.org/1999/xhtml"}var ce=2**53-1;function J(t){let e=[[-1,t.state.doc]],n=[];for(;e.length>0;){let[o,r]=e.pop();if(o>=0){let l=t.nodeDOM(o);if(l&&G(l)){let{top:i,bottom:u,left:s,right:f}=l.getBoundingClientRect();n.push([o,[s,i,f,i]],[o+r.nodeSize,[s,u,f,u]])}}if(r.isBlock&&!r.isTextblock){let l=o+1;for(let i of r.children)e.push([l,i]),l+=i.nodeSize}}return n}function Q(t,e){let n=[],o,r,l=()=>{let c=t.dom.getBoundingClientRect(),p=t.state.doc;return n&&o&&r&&c.width===r.width&&c.height===r.height&&c.x===r.x&&c.y===r.y&&o.eq(p)||(r=c,o=p,n=J(t)),n},i=(c,p)=>{if(!t.editable||t.isDestroyed)return;let m=(y,S)=>{let[x,E]=y,[N,O]=S;return W(c,E)-W(c,O)||x-N},a=l();a.sort(m),a=a.slice(0,8);let h=a.find(y=>e?.({view:t,pos:y[0],event:p})!==!1);if(!(h&&_(t,h[0])))return h},u,s;return(c,p)=>(u&&Z(u,c)||(u=c,s=i(c,p)),s)}function Z(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){return Math.abs(t[0]-e[0])+Math.abs(t[1]-e[1])}function W(t,e){return Math.min(z(t,[e[0],e[1]]),z(t,[e[2],e[3]]))}function _(t,e){let n=t.dragging;if(!n)return;let{move:o}=n;if(!o)return;let r=t.state.selection;if(!(r instanceof g))return;let{from:l,to:i}=r;return l<=e&&e<=i}function H(t){let e;return new w({key:new T("prosemirror-drop-indicator"),view:n=>(e=Q(n,t.onDrag),ee(n,e,t)),props:{handleDrop(n,o,r,l){if(!e)return!1;let i=e([o.clientX,o.clientY],o);if(!i)return!1;o.preventDefault();let u=i[0],s=n.state.tr;if(l){let{node:a}=n.dragging||{};a?a.replace(s):s.deleteSelection()}let f=s.mapping.map(u),c=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,p=s.doc;if(c?s.replaceRangeWith(f,f,r.content.firstChild):s.replaceRange(f,f,r),s.doc.eq(p))return!0;let m=s.doc.resolve(f);if(c&&g.isSelectable(r.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new g(m));else{let a=s.mapping.map(u);s.mapping.maps[s.mapping.maps.length-1].forEach((h,y,S,x)=>a=x),s.setSelection($(n,m,s.doc.resolve(a)))}return n.focus(),n.dispatch(s.setMeta("uiEvent","drop")),!0}}})}function $(t,e,n,o){return t.someProp("createSelectionBetween",r=>r(t,e,n))||v.between(e,n,o)}function ee(t,e,n){let o=t.dom,r,l,i,u=!1,s=()=>{r&&clearTimeout(r),u=!1,r=setTimeout(()=>{u||n.onHide?.()},30)},f=p=>{u=!0;let{clientX:m,clientY:a}=p;if(l===m&&i===a)return;l=m,i=a;let h=e([m,a],p);if(h){let[y,[S,x,E,N]]=h,O={p1:{x:S,y:x},p2:{x:E,y:N}};n.onShow?.({view:t,pos:y,line:O})}else{s();return}};return o.addEventListener("dragover",f),o.addEventListener("dragend",s),o.addEventListener("drop",s),o.addEventListener("dragleave",s),{destroy:()=>{o.removeEventListener("dragover",f),o.removeEventListener("dragend",s),o.removeEventListener("drop",s),o.removeEventListener("dragleave",s)}}}var d=class t extends C{constructor(e){super(e,e)}map(e,n){let o=e.resolve(n.map(this.head));return t.valid(o)?new t(o):C.near(o)}content(){return A.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new L(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!te(e)||!ne(e))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,o=!1){e:for(;;){if(!o&&t.valid(e))return e;let r=e.pos,l=null;for(let i=e.depth;;i--){let u=e.node(i);if(n>0?e.indexAfter(i)<u.childCount:e.index(i)>0){l=u.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=n;let s=e.doc.resolve(r);if(t.valid(s))return s}for(;;){let i=n>0?l.firstChild:l.lastChild;if(!i){if(l.isAtom&&!l.isText&&!g.isSelectable(l)){e=e.doc.resolve(r+l.nodeSize*n),o=!1;continue e}break}l=i,r+=n;let u=e.doc.resolve(r);if(t.valid(u))return u}return null}}};d.prototype.visible=!1;d.findFrom=d.findGapCursorFrom;C.jsonID("gapcursor",d);var L=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return d.valid(n)?new d(n):C.near(n)}};function K(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function te(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),o=t.node(e);if(n==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||K(r.type))return!0;if(r.inlineContent)return!1}}return!0}function ne(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),o=t.node(e);if(n==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||K(r.type))return!0;if(r.inlineContent)return!1}}return!0}function V(){return new w({props:{decorations:se,createSelectionBetween(t,e,n){return e.pos==n.pos&&d.valid(n)?new d(n):null},handleClick:oe,handleKeyDown:re,handleDOMEvents:{beforeinput:ie}}})}var re=j({ArrowLeft:I("horiz",-1),ArrowRight:I("horiz",1),ArrowUp:I("vert",-1),ArrowDown:I("vert",1)});function I(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,r,l){let i=o.selection,u=e>0?i.$to:i.$from,s=i.empty;if(i instanceof v){if(!l.endOfTextblock(n)||u.depth==0)return!1;s=!1,u=o.doc.resolve(e>0?u.after():u.before())}let f=d.findGapCursorFrom(u,e,s);return f?(r&&r(o.tr.setSelection(new d(f))),!0):!1}}function oe(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!d.valid(o))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&g.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new d(o))),!0)}function ie(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof d))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let r=P.empty;for(let i=o.length-1;i>=0;i--)r=P.from(o[i].createAndFill(null,r));let l=t.state.tr.replace(n.pos,n.pos,new A(r,0,0));return l.setSelection(v.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function se(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",F.create(t.doc,[R.widget(t.selection.head,e,{key:"gapcursor"})])}function D(t,e){return Object.assign(t,{meta:{package:"@milkdown/plugin-cursor",...e}}),t}var M=B(null,"dropIndicatorState");D(M,{displayName:"Ctx<dropIndicatorState>"});var k=B({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");D(k,{displayName:"Ctx<dropIndicatorConfig>"});var le=new T("MILKDOWN_DROP_INDICATOR_DOM"),q=b(t=>new w({key:le,view:e=>{let n=t.get(k.key),o=document.createElement("div");Object.assign(o.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),o.classList.add(n.class),o.classList.add("milkdown-drop-indicator"),e.dom.parentNode?.appendChild(o);let r=t.use(M.key),l=i=>{ue(o,i,n)};return r.on(l),{destroy:()=>{r.off(l),o.remove()}}}}));D(q,{displayName:"Prose<dropIndicatorDOM>"});function ue(t,e,n){if(!e){Object.assign(t.style,{display:"none"});return}let{line:o}=e,{width:r}=n,{p1:{x:l,y:i},p2:{x:u,y:s}}=o,f=i===s,c,p,m=i,a=l;f?(c=u-l,p=r,m-=r/2):(c=r,p=s-i,a-=r/2),m=Math.round(m),a=Math.round(a),Object.assign(t.style,{display:"block",width:`${c}px`,height:`${p}px`,transform:`translate(${a}px, ${m}px)`})}var U=b(t=>H({onShow:o=>{t.set(M.key,o)},onHide:()=>{t.set(M.key,null)},onDrag:()=>!0}));D(U,{displayName:"Prose<dropIndicator>"});var X=b(()=>V());D(X,{displayName:"Prose<gapCursor>"});var De=k,Se=[X,k,M,q,U].flat();export{Se as cursor,De as dropCursorConfig,k as dropIndicatorConfig,q as dropIndicatorDOMPlugin,U as dropIndicatorPlugin,M as dropIndicatorState,X as gapCursorPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i}from"./chunk-7R75J74M.js";import"./chunk-GF2LJCG5.js";import"./chunk-P3WV3MLS.js";import"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";export{g as acceptAllDiffsCmd,a as acceptDiffChunkCmd,c as acceptDiffRangeCmd,h as clearDiffReviewCmd,o as computeDocDiff,i as diff,r as diffConfig,p as diffPlugin,e as diffPluginKey,m as getPendingChanges,f as isChangeRejected,b as rejectDiffChunkCmd,d as rejectDiffRangeCmd,t as startDiffReviewCmd,x as startDiffReviewFromDocCmd};
|