@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,5 +0,0 @@
|
|
|
1
|
-
import{pa as tn,y as Se}from"./chunk-URTGZHMG.js";import"./chunk-7R5G6FRT.js";import{a as N,b as xe,c as Yt,e as de,h as q,i as Zt,j as Pe,l as Qt,m as en}from"./chunk-GF2LJCG5.js";import{A as ye,B as Ie,F as qt,H as _e,K as Ut,M as Xt,a as be,h as ke,i as Pt,j as J,k as te,l as Ce,la as pe,m as Ot,n as Y,o as v,p as K,q as fe,r as V,s as I,t as Ee,u as $t,v as Ht,w as Bt,y as jt}from"./chunk-P3WV3MLS.js";import{H as Gt,L as Jt,M as ne,N as oe,a as M,c as D,q as Wt,r as F,s as Kt,t as P,u as Vt,x as Z,y as G}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";var $e,He;if(typeof WeakMap<"u"){let e=new WeakMap;$e=t=>e.get(t),He=(t,n)=>(e.set(t,n),n)}else{let e=[],n=0;$e=o=>{for(let r=0;r<e.length;r+=2)if(e[r]==o)return e[r+1]},He=(o,r)=>(n==10&&(n=0),e[n++]=o,e[n++]=r)}var x=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let o=t%this.width,r=t/this.width|0,i=o+1,l=r+1;for(let s=1;i<this.width&&this.map[t+s]==n;s++)i++;for(let s=1;l<this.height&&this.map[t+this.width*s]==n;s++)l++;return{left:o,top:r,right:i,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:o,right:r,top:i,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:r==this.width)?null:this.map[i*this.width+(n<0?o-1:r)]:(n<0?i==0:l==this.height)?null:this.map[o+this.width*(n<0?i-1:l)]}rectBetween(e,t){let{left:n,right:o,top:r,bottom:i}=this.findCell(e),{left:l,right:s,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(r,a),right:Math.max(o,s),bottom:Math.max(i,c)}}cellsInRect(e){let t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let r=e.left;r<e.right;r++){let i=o*this.width+r,l=this.map[i];n[l]||(n[l]=!0,!(r==e.left&&r&&this.map[i-1]==l||o==e.top&&o&&this.map[i-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,r=0;;o++){let i=r+n.child(o).nodeSize;if(o==e){let l=t+e*this.width,s=(e+1)*this.width;for(;l<s&&this.map[l]<r;)l++;return l==s?i-1:this.map[l]}r=i}}static get(e){return $e(e)||He(e,Mo(e))}};function Mo(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);let t=No(e),n=e.childCount,o=[],r=0,i=null,l=[];for(let c=0,f=t*n;c<f;c++)o[c]=0;for(let c=0,f=0;c<n;c++){let u=e.child(c);f++;for(let d=0;;d++){for(;r<o.length&&o[r]!=0;)r++;if(d==u.childCount)break;let w=u.child(d),{colspan:b,rowspan:g,colwidth:C}=w.attrs;for(let y=0;y<g;y++){if(y+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-y});break}let R=r+y*t;for(let S=0;S<b;S++){o[R+S]==0?o[R+S]=f:(i||(i=[])).push({type:"collision",row:c,pos:f,n:b-S});let T=C&&C[S];if(T){let _=(R+S)%t*2,W=l[_];W==null||W!=T&&l[_+1]==1?(l[_]=T,l[_+1]=1):W==T&&l[_+1]++}}}r+=b,f+=w.nodeSize}let p=(c+1)*t,h=0;for(;r<p;)o[r++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:c,n:h}),f++}(t===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});let s=new x(t,n,o,i),a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Do(s,l,e),s}function No(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){let r=e.child(o),i=0;if(n)for(let l=0;l<o;l++){let s=e.child(l);for(let a=0;a<s.childCount;a++){let c=s.child(a);l+c.attrs.rowspan>o&&(i+=c.attrs.colspan)}}for(let l=0;l<r.childCount;l++){let s=r.child(l);i+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}t==-1?t=i:t!=i&&(t=Math.max(t,i))}return t}function Do(e,t,n){e.problems||(e.problems=[]);let o={};for(let r=0;r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let l=n.nodeAt(i);if(!l)throw new RangeError(`No cell with offset ${i} found`);let s=null,a=l.attrs;for(let c=0;c<a.colspan;c++){let f=t[(r+c)%e.width*2];f!=null&&(!a.colwidth||a.colwidth[c]!=f)&&((s||(s=Fo(a)))[c]=f)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}function Fo(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function nn(e,t){if(typeof e=="string")return{};let n=e.getAttribute("data-colwidth"),o=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(l=>Number(l)):null,r=Number(e.getAttribute("colspan")||1),i={colspan:r,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:o&&o.length==r?o:null};for(let l in t){let s=t[l].getFromDOM,a=s&&s(e);a!=null&&(i[l]=a)}return i}function on(e,t){let n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(let o in t){let r=t[o].setDOMAttr;r&&r(e.attrs[o],n)}return n}function zo(e){if(e!==null){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(let t of e)if(typeof t!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function gn(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:zo}};for(let o in t)n[o]={default:t[o].default,validate:t[o].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:o=>nn(o,t)}],toDOM(o){return["td",on(o,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:o=>nn(o,t)}],toDOM(o){return["th",on(o,t),0]}}}}function E(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let o=e.nodes[n],r=o.spec.tableRole;r&&(t[r]=o)}}return t}var U=new G("selectingCells");function ie(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function L(e){let t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Ne(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;let n=ie(t.$head)||Lo(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Lo(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Be(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function Eo(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ke(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function wn(e,t,n){let o=e.node(-1),r=x.get(o),i=e.start(-1),l=r.nextCell(e.pos-i,t,n);return l==null?null:e.node(0).resolve(i+l)}function Q(e,t,n=1){let o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(r=>r>0)||(o.colwidth=null)),o}function Io(e,t,n=1){let o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let r=0;r<n;r++)o.colwidth.splice(t,0,0)}return o}function _o(e,t,n){let o=E(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=o)return!1;return!0}var A=class $ extends F{constructor(t,n=t){let o=t.node(-1),r=x.get(o),i=t.start(-1),l=r.rectBetween(t.pos-i,n.pos-i),s=t.node(0),a=r.cellsInRect(l).filter(f=>f!=n.pos-i);a.unshift(n.pos-i);let c=a.map(f=>{let u=o.nodeAt(f);if(!u)throw new RangeError(`No cell with offset ${f} found`);let p=i+f+1;return new Kt(s.resolve(p),s.resolve(p+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){let o=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(Be(o)&&Be(r)&&Ke(o,r)){let i=this.$anchorCell.node(-1)!=o.node(-1);return i&&this.isRowSelection()?$.rowSelection(o,r):i&&this.isColSelection()?$.colSelection(o,r):new $(o,r)}return P.between(o,r)}content(){let t=this.$anchorCell.node(-1),n=x.get(t),o=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),i={},l=[];for(let a=r.top;a<r.bottom;a++){let c=[];for(let f=a*n.width+r.left,u=r.left;u<r.right;u++,f++){let p=n.map[f];if(i[p])continue;i[p]=!0;let h=n.findCell(p),d=t.nodeAt(p);if(!d)throw new RangeError(`No cell with offset ${p} found`);let w=r.left-h.left,b=h.right-r.right;if(w>0||b>0){let g=d.attrs;if(w>0&&(g=Q(g,0,w)),b>0&&(g=Q(g,g.colspan-b,b)),h.left<r.left){if(d=d.type.createAndFill(g),!d)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else d=d.type.create(g,d.content)}if(h.top<r.top||h.bottom>r.bottom){let g={...d.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?d=d.type.createAndFill(g):d=d.type.create(g,d.content)}c.push(d)}l.push(t.child(a).copy(M.from(c)))}let s=this.isColSelection()&&this.isRowSelection()?t:l;return new D(M.from(s),1,1)}replace(t,n=D.empty){let o=t.steps.length,r=this.ranges;for(let l=0;l<r.length;l++){let{$from:s,$to:a}=r[l],c=t.mapping.slice(o);t.replace(c.map(s.pos),c.map(a.pos),l?D.empty:n)}let i=F.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);i&&t.setSelection(i)}replaceWith(t,n){this.replace(t,new D(M.from(n),0,0))}forEachCell(t){let n=this.$anchorCell.node(-1),o=x.get(n),r=this.$anchorCell.start(-1),i=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let l=0;l<i.length;l++)t(n.nodeAt(i[l]),r+i[l])}isColSelection(){let t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;let o=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let o=t.node(-1),r=x.get(o),i=t.start(-1),l=r.findCell(t.pos-i),s=r.findCell(n.pos-i),a=t.node(0);return l.top<=s.top?(l.top>0&&(t=a.resolve(i+r.map[l.left])),s.bottom<r.height&&(n=a.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(i+r.map[s.left])),l.bottom<r.height&&(t=a.resolve(i+r.map[r.width*(r.height-1)+l.right-1]))),new $(t,n)}isRowSelection(){let t=this.$anchorCell.node(-1),n=x.get(t),o=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-o),i=n.colCount(this.$headCell.pos-o);if(Math.min(r,i)>0)return!1;let l=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,s)==n.width}eq(t){return t instanceof $&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let o=t.node(-1),r=x.get(o),i=t.start(-1),l=r.findCell(t.pos-i),s=r.findCell(n.pos-i),a=t.node(0);return l.left<=s.left?(l.left>0&&(t=a.resolve(i+r.map[l.top*r.width])),s.right<r.width&&(n=a.resolve(i+r.map[r.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(i+r.map[s.top*r.width])),l.right<r.width&&(t=a.resolve(i+r.map[r.width*(l.top+1)-1]))),new $(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new $(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new $(t.resolve(n),t.resolve(o))}getBookmark(){return new Po(this.$anchorCell.pos,this.$headCell.pos)}};A.prototype.visible=!1;F.jsonID("cell",A);var Po=class bn{constructor(t,n){this.anchor=t,this.head=n}map(t){return new bn(t.map(this.anchor),t.map(this.head))}resolve(t){let n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&Ke(n,o)?new A(n,o):F.near(o,1)}};function Oo(e){if(!(e.selection instanceof A))return null;let t=[];return e.selection.forEachCell((n,o)=>{t.push(ne.node(o,o+n.nodeSize,{class:"selectedCell"}))}),oe.create(e.doc,t)}function $o({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,o--);return n==o&&/row|table/.test(e.node(r).type.spec.tableRole)}function Ho({$from:e,$to:t}){let n,o;for(let r=e.depth;r>0;r--){let i=e.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let r=t.depth;r>0;r--){let i=t.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){o=i;break}}return n!==o&&t.parentOffset===0}function Bo(e,t,n){let o=(t||e).selection,r=(t||e).doc,i,l;if(o instanceof Vt&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")i=A.create(r,o.from);else if(l=="row"){let s=r.resolve(o.from+1);i=A.rowSelection(s,s)}else if(!n){let s=x.get(o.node),a=o.from+1,c=a+s.map[s.width*s.height-1];i=A.create(r,a+1,c)}}else o instanceof P&&$o(o)?i=P.create(r,o.from):o instanceof P&&Ho(o)&&(i=P.create(r,o.$from.start(),o.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}var jo=new G("fix-tables");function kn(e,t,n,o){let r=e.childCount,i=t.childCount;e:for(let l=0,s=0;l<i;l++){let a=t.child(l);for(let c=s,f=Math.min(r,l+3);c<f;c++)if(e.child(c)==a){s=c+1,n+=a.nodeSize;continue e}o(a,n),s<r&&e.child(s).sameMarkup(a)?kn(e.child(s),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function Wo(e,t){let n,o=(r,i)=>{r.type.spec.tableRole=="table"&&(n=Ko(e,r,i,n))};return t?t.doc!=e.doc&&kn(t.doc,e.doc,0,o):e.doc.descendants(o),n}function Ko(e,t,n,o){let r=x.get(t);if(!r.problems)return o;o||(o=e.tr);let i=[];for(let a=0;a<r.height;a++)i.push(0);for(let a=0;a<r.problems.length;a++){let c=r.problems[a];if(c.type=="collision"){let f=t.nodeAt(c.pos);if(!f)continue;let u=f.attrs;for(let p=0;p<u.rowspan;p++)i[c.row+p]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,Q(u,u.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){let f=t.nodeAt(c.pos);if(!f)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){let f=t.nodeAt(c.pos);if(!f)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){let f=o.mapping.map(n);o.delete(f,f+t.nodeSize)}}let l,s;for(let a=0;a<i.length;a++)i[a]&&(l==null&&(l=a),s=a);for(let a=0,c=n+1;a<r.height;a++){let f=t.child(a),u=c+f.nodeSize,p=i[a];if(p>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);let d=[];for(let b=0;b<p;b++){let g=E(e.schema)[h].createAndFill();g&&d.push(g)}let w=(a==0||l==a-1)&&s==a?c+1:u-1;o.insert(o.mapping.map(w),d)}c=u}return o.setMeta(jo,{fixTables:!0})}function Cn(e){let t=x.get(e),n=[],o=t.height,r=t.width;for(let i=0;i<o;i++){let l=[];for(let s=0;s<r;s++){let a=i*r+s,c=t.map[a];if(i>0){let f=a-r;if(c===t.map[f]){l.push(null);continue}}if(s>0){let f=a-1;if(c===t.map[f]){l.push(null);continue}}l.push(e.nodeAt(c))}n.push(l)}return n}function yn(e,t){let n=[],o=x.get(e),r=o.height,i=o.width;for(let l=0;l<r;l++){let s=e.child(l),a=[];for(let f=0;f<i;f++){let u=t[l][f];if(!u)continue;let p=o.map[l*o.width+f],h=e.nodeAt(p);if(!h)continue;let d=h.type.createChecked(u.attrs,u.content,u.marks);a.push(d)}let c=s.type.createChecked(s.attrs,a,s.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function xn(e,t,n,o){let r=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),l=i.length%2===0?1:0,s;return o===-1&&r===1?s=n[0]-1:o===1&&r===-1?s=n[n.length-1]-l+1:s=r===-1?n[0]:n[n.length-1]-l,e.splice(s,0,...i),e}function X(e){return Vo(t=>t.type.spec.tableRole==="table",e)}function Vo(e,t){for(let n=t.depth;n>=0;n-=1){let o=t.node(n);if(e(o))return{node:o,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function re(e,t){let n=X(t.$from);if(!n)return;let o=x.get(n.node);if(!(e<0||e>o.width-1))return o.cellsInRect({left:e,right:e+1,top:0,bottom:o.height}).map(r=>{let i=n.node.nodeAt(r),l=r+n.start;return{pos:l,start:l+1,node:i,depth:n.depth+2}})}function le(e,t){let n=X(t.$from);if(!n)return;let o=x.get(n.node);if(!(e<0||e>o.height-1))return o.cellsInRect({left:0,right:o.width,top:e,bottom:e+1}).map(r=>{let i=n.node.nodeAt(r),l=r+n.start;return{pos:l,start:l+1,node:i,depth:n.depth+2}})}function rn(e,t,n=t){let o=t,r=n;for(let f=t;f>=0;f--){let u=re(f,e.selection);u&&u.forEach(p=>{let h=p.node.attrs.colspan+f-1;h>=o&&(o=f),h>r&&(r=h)})}for(let f=t;f<=r;f++){let u=re(f,e.selection);u&&u.forEach(p=>{let h=p.node.attrs.colspan+f-1;p.node.attrs.colspan>1&&h>r&&(r=h)})}let i=[];for(let f=o;f<=r;f++){let u=re(f,e.selection);u&&u.length>0&&i.push(f)}o=i[0],r=i[i.length-1];let l=re(o,e.selection),s=le(0,e.selection);if(!l||!s)return;let a=e.doc.resolve(l[l.length-1].pos),c;for(let f=r;f>=o;f--){let u=re(f,e.selection);if(u&&u.length>0){for(let p=s.length-1;p>=0;p--)if(s[p].pos===u[0].pos){c=u[0];break}if(c)break}}if(c)return{$anchor:a,$head:e.doc.resolve(c.pos),indexes:i}}function ln(e,t,n=t){let o=t,r=n;for(let f=t;f>=0;f--){let u=le(f,e.selection);u&&u.forEach(p=>{let h=p.node.attrs.rowspan+f-1;h>=o&&(o=f),h>r&&(r=h)})}for(let f=t;f<=r;f++){let u=le(f,e.selection);u&&u.forEach(p=>{let h=p.node.attrs.rowspan+f-1;p.node.attrs.rowspan>1&&h>r&&(r=h)})}let i=[];for(let f=o;f<=r;f++){let u=le(f,e.selection);u&&u.length>0&&i.push(f)}o=i[0],r=i[i.length-1];let l=le(o,e.selection),s=re(0,e.selection);if(!l||!s)return;let a=e.doc.resolve(l[l.length-1].pos),c;for(let f=r;f>=o;f--){let u=le(f,e.selection);if(u&&u.length>0){for(let p=s.length-1;p>=0;p--)if(s[p].pos===u[0].pos){c=u[0];break}if(c)break}}if(c)return{$anchor:a,$head:e.doc.resolve(c.pos),indexes:i}}function an(e){return e[0].map((t,n)=>e.map(o=>o[n]))}function Go(e){var t,n;let{tr:o,originIndex:r,targetIndex:i,select:l,pos:s}=e,a=X(o.doc.resolve(s));if(!a)return!1;let c=(t=rn(o,r))===null||t===void 0?void 0:t.indexes,f=(n=rn(o,i))===null||n===void 0?void 0:n.indexes;if(!c||!f||c.includes(i))return!1;let u=qo(a.node,c,f,0);if(o.replaceWith(a.pos,a.pos+a.node.nodeSize,u),!l)return!0;let p=x.get(u),h=a.start,d=i,w=p.positionAt(p.height-1,d,u),b=o.doc.resolve(h+w),g=p.positionAt(0,d,u),C=o.doc.resolve(h+g);return o.setSelection(A.colSelection(b,C)),!0}function qo(e,t,n,o){let r=an(Cn(e));return r=xn(r,t,n,o),r=an(r),yn(e,r)}function Uo(e){var t,n;let{tr:o,originIndex:r,targetIndex:i,select:l,pos:s}=e,a=X(o.doc.resolve(s));if(!a)return!1;let c=(t=ln(o,r))===null||t===void 0?void 0:t.indexes,f=(n=ln(o,i))===null||n===void 0?void 0:n.indexes;if(!c||!f||c.includes(i))return!1;let u=Xo(a.node,c,f,0);if(o.replaceWith(a.pos,a.pos+a.node.nodeSize,u),!l)return!0;let p=x.get(u),h=a.start,d=i,w=p.positionAt(d,p.width-1,u),b=o.doc.resolve(h+w),g=p.positionAt(d,0,u),C=o.doc.resolve(h+g);return o.setSelection(A.rowSelection(b,C)),!0}function Xo(e,t,n,o){let r=Cn(e);return r=xn(r,t,n,o),yn(e,r)}function H(e){let t=e.selection,n=Ne(e),o=n.node(-1),r=n.start(-1),i=x.get(o);return{...t instanceof A?i.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):i.findCell(n.pos-r),tableStart:r,map:i,table:o}}function Sn(e,{map:t,tableStart:n,table:o},r){let i=r>0?-1:0;_o(t,o,r+i)&&(i=r==0||r==t.width?null:0);for(let l=0;l<t.height;l++){let s=l*t.width+r;if(r>0&&r<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Io(c.attrs,r-t.colCount(a))),l+=c.attrs.rowspan-1}else{let a=i==null?E(o.type.schema).cell:o.nodeAt(t.map[s+i]).type,c=t.positionAt(l,r,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function An(e,t){if(!L(e))return!1;if(t){let n=H(e);t(Sn(e.tr,n,n.left))}return!0}function Rn(e,t){if(!L(e))return!1;if(t){let n=H(e);t(Sn(e.tr,n,n.right))}return!0}function Jo(e,{map:t,table:n,tableStart:o},r){let i=e.mapping.maps.length;for(let l=0;l<t.height;){let s=l*t.width+r,a=t.map[s],c=n.nodeAt(a),f=c.attrs;if(r>0&&t.map[s-1]==a||r<t.width-1&&t.map[s+1]==a)e.setNodeMarkup(e.mapping.slice(i).map(o+a),null,Q(f,r-t.colCount(a)));else{let u=e.mapping.slice(i).map(o+a);e.delete(u,u+c.nodeSize)}l+=f.rowspan}}function Tn(e,t){if(!L(e))return!1;if(t){let n=H(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;Jo(o,n,r),r!=n.left;r--){let i=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=x.get(i)}t(o)}return!0}function Yo(e,{map:t,table:n,tableStart:o},r){let i=0;for(let c=0;c<r;c++)i+=n.child(c).nodeSize;let l=i+n.child(r).nodeSize,s=e.mapping.maps.length;e.delete(i+o,l+o);let a=new Set;for(let c=0,f=r*t.width;c<t.width;c++,f++){let u=t.map[f];if(!a.has(u)){if(a.add(u),r>0&&u==t.map[f-t.width]){let p=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(s).map(u+o),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(r<t.height&&u==t.map[f+t.width]){let p=n.nodeAt(u),h=p.attrs,d=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),w=t.positionAt(r+1,c,n);e.insert(e.mapping.slice(s).map(o+w),d),c+=h.colspan-1}}}}function vn(e,t){if(!L(e))return!1;if(t){let n=H(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;Yo(o,n,r),r!=n.top;r--){let i=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=x.get(n.table)}t(o)}return!0}function Mn(e,t){return function(n,o){if(!L(n))return!1;let r=Ne(n);if(r.nodeAfter.attrs[e]===t)return!1;if(o){let i=n.tr;n.selection instanceof A?n.selection.forEachCell((l,s)=>{l.attrs[e]!==t&&i.setNodeMarkup(s,null,{...l.attrs,[e]:t})}):i.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),o(i)}return!0}}function Zo(e){return function(t,n){if(!L(t))return!1;if(n){let o=E(t.schema),r=H(t),i=t.tr,l=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),s=l.map(a=>r.table.nodeAt(a));for(let a=0;a<l.length;a++)s[a].type==o.header_cell&&i.setNodeMarkup(r.tableStart+l[a],o.cell,s[a].attrs);if(i.steps.length===0)for(let a=0;a<l.length;a++)i.setNodeMarkup(r.tableStart+l[a],o.header_cell,s[a].attrs);n(i)}return!0}}function sn(e,t,n){let o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<o.length;r++){let i=t.table.nodeAt(o[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function Ve(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?Zo(e):function(n,o){if(!L(n))return!1;if(o){let r=E(n.schema),i=H(n),l=n.tr,s=sn("row",i,r),a=sn("column",i,r),c=(e==="column"?s:e==="row"&&a)?1:0,f=e=="column"?{left:0,top:c,right:1,bottom:i.map.height}:e=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e=="column"?a?r.cell:r.header_cell:e=="row"?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(f).forEach(p=>{let h=p+i.tableStart,d=l.doc.nodeAt(h);d&&l.setNodeMarkup(h,u,d.attrs)}),o(l)}return!0}}var Ql=Ve("row",{useDeprecatedLogic:!0}),ei=Ve("column",{useDeprecatedLogic:!0}),ti=Ve("cell",{useDeprecatedLogic:!0});function Qo(e,t){if(t<0){let n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,r=e.before();o>=0;o--){let i=e.node(-1).child(o),l=i.lastChild;if(l)return r-1-l.nodeSize;r-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let n=e.node(-1);for(let o=e.indexAfter(-1),r=e.after();o<n.childCount;o++){let i=n.child(o);if(i.childCount)return r+1;r+=i.nodeSize}}return null}function Ge(e){return function(t,n){if(!L(t))return!1;let o=Qo(Ne(t),e);if(o==null)return!1;if(n){let r=t.doc.resolve(o);n(t.tr.setSelection(P.between(r,Eo(r))).scrollIntoView())}return!0}}function Nn(e,t){let n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function Ae(e,t){let n=e.selection;if(!(n instanceof A))return!1;if(t){let o=e.tr,r=E(e.schema).cell.createAndFill().content;n.forEachCell((i,l)=>{i.content.eq(r)||o.replace(o.mapping.map(l+1),o.mapping.map(l+i.nodeSize-1),new D(r,0,0))}),o.docChanged&&t(o)}return!0}function Dn(e){return(t,n)=>{let{from:o,to:r,select:i=!0,pos:l=t.selection.from}=e,s=t.tr;return Uo({tr:s,originIndex:o,targetIndex:r,select:i,pos:l})?(n?.(s),!0):!1}}function Fn(e){return(t,n)=>{let{from:o,to:r,select:i=!0,pos:l=t.selection.from}=e,s=t.tr;return Go({tr:s,originIndex:o,targetIndex:r,select:i,pos:l})?(n?.(s),!0):!1}}function er(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;let r=t.child(0),i=r.type.spec.tableRole,l=r.type.schema,s=[];if(i=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content,f=a?0:Math.max(0,n-1),u=a<t.childCount-1?0:Math.max(0,o-1);(f||u)&&(c=je(E(l).row,new D(c,f,u)).content),s.push(c)}else if(i=="cell"||i=="header_cell")s.push(n||o?je(E(l).row,new D(t,n,o)).content:t);else return null;return tr(l,s)}function tr(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r];for(let l=i.childCount-1;l>=0;l--){let{rowspan:s,colspan:a}=i.child(l).attrs;for(let c=r;c<r+s;c++)n[c]=(n[c]||0)+a}}let o=0;for(let r=0;r<n.length;r++)o=Math.max(o,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(M.empty),n[r]<o){let i=E(e).cell.createAndFill(),l=[];for(let s=n[r];s<o;s++)l.push(i);t[r]=t[r].append(M.from(l))}return{height:t.length,width:o,rows:t}}function je(e,t){let n=e.createAndFill();return new Wt(n).replace(0,n.content.size,t).doc}function nr({width:e,height:t,rows:n},o,r){if(e!=o){let i=[],l=[];for(let s=0;s<n.length;s++){let a=n[s],c=[];for(let f=i[s]||0,u=0;f<o;u++){let p=a.child(u%a.childCount);f+p.attrs.colspan>o&&(p=p.type.createChecked(Q(p.attrs,p.attrs.colspan,f+p.attrs.colspan-o),p.content)),c.push(p),f+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)i[s+h]=(i[s+h]||0)+p.attrs.colspan}l.push(M.from(c))}n=l,e=o}if(t!=r){let i=[];for(let l=0,s=0;l<r;l++,s++){let a=[],c=n[s%t];for(let f=0;f<c.childCount;f++){let u=c.child(f);l+u.attrs.rowspan>r&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,r-u.attrs.rowspan)},u.content)),a.push(u)}i.push(M.from(a))}n=i,t=r}return{width:e,height:t,rows:n}}function or(e,t,n,o,r,i,l){let s=e.doc.type.schema,a=E(s),c,f;if(r>t.width)for(let u=0,p=0;u<t.height;u++){let h=n.child(u);p+=h.nodeSize;let d=[],w;h.lastChild==null||h.lastChild.type==a.cell?w=c||(c=a.cell.createAndFill()):w=f||(f=a.header_cell.createAndFill());for(let b=t.width;b<r;b++)d.push(w);e.insert(e.mapping.slice(l).map(p-1+o),d)}if(i>t.height){let u=[];for(let d=0,w=(t.height-1)*t.width;d<Math.max(t.width,r);d++){let b=d>=t.width?!1:n.nodeAt(t.map[w+d]).type==a.header_cell;u.push(b?f||(f=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}let p=a.row.create(null,M.from(u)),h=[];for(let d=t.height;d<i;d++)h.push(p);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),h)}return!!(c||f)}function cn(e,t,n,o,r,i,l,s){if(l==0||l==t.height)return!1;let a=!1;for(let c=r;c<i;c++){let f=l*t.width+c,u=t.map[f];if(t.map[f-t.width]==u){a=!0;let p=n.nodeAt(u),{top:h,left:d}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(s).map(u+o),null,{...p.attrs,rowspan:l-h}),e.insert(e.mapping.slice(s).map(t.positionAt(l,d,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-l})),c+=p.attrs.colspan-1}}return a}function un(e,t,n,o,r,i,l,s){if(l==0||l==t.width)return!1;let a=!1;for(let c=r;c<i;c++){let f=c*t.width+l,u=t.map[f];if(t.map[f-1]==u){a=!0;let p=n.nodeAt(u),h=t.colCount(u),d=e.mapping.slice(s).map(u+o);e.setNodeMarkup(d,null,Q(p.attrs,l-h,p.attrs.colspan-(l-h))),e.insert(d+p.nodeSize,p.type.createAndFill(Q(p.attrs,0,l-h))),c+=p.attrs.rowspan-1}}return a}function fn(e,t,n,o,r){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let l=x.get(i),{top:s,left:a}=o,c=a+r.width,f=s+r.height,u=e.tr,p=0;function h(){if(i=n?u.doc.nodeAt(n-1):u.doc,!i)throw new Error("No table found");l=x.get(i),p=u.mapping.maps.length}or(u,l,i,n,c,f,p)&&h(),cn(u,l,i,n,a,c,s,p)&&h(),cn(u,l,i,n,a,c,f,p)&&h(),un(u,l,i,n,s,f,a,p)&&h(),un(u,l,i,n,s,f,c,p)&&h();for(let d=s;d<f;d++){let w=l.positionAt(d,a,i),b=l.positionAt(d,c,i);u.replace(u.mapping.slice(p).map(w+n),u.mapping.slice(p).map(b+n),new D(r.rows[d-s],0,0))}h(),u.setSelection(new A(u.doc.resolve(n+l.positionAt(s,a,i)),u.doc.resolve(n+l.positionAt(f-1,c-1,i)))),t(u)}var rr=Jt({ArrowLeft:Re("horiz",-1),ArrowRight:Re("horiz",1),ArrowUp:Re("vert",-1),ArrowDown:Re("vert",1),"Shift-ArrowLeft":Te("horiz",-1),"Shift-ArrowRight":Te("horiz",1),"Shift-ArrowUp":Te("vert",-1),"Shift-ArrowDown":Te("vert",1),Backspace:Ae,"Mod-Backspace":Ae,Delete:Ae,"Mod-Delete":Ae});function ve(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Re(e,t){return(n,o,r)=>{if(!r)return!1;let i=n.selection;if(i instanceof A)return ve(n,o,F.near(i.$headCell,t));if(e!="horiz"&&!i.empty)return!1;let l=zn(r,e,t);if(l==null)return!1;if(e=="horiz")return ve(n,o,F.near(n.doc.resolve(i.head+t),t));{let s=n.doc.resolve(l),a=wn(s,e,t),c;return a?c=F.near(a,1):t<0?c=F.near(n.doc.resolve(s.before(-1)),-1):c=F.near(n.doc.resolve(s.after(-1)),1),ve(n,o,c)}}}function Te(e,t){return(n,o,r)=>{if(!r)return!1;let i=n.selection,l;if(i instanceof A)l=i;else{let a=zn(r,e,t);if(a==null)return!1;l=new A(n.doc.resolve(a))}let s=wn(l.$headCell,e,t);return s?ve(n,o,new A(l.$anchorCell,s)):!1}}function lr(e,t){let n=e.state.doc,o=ie(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new A(o))),!0):!1}function ir(e,t,n){if(!L(e.state))return!1;let o=er(n),r=e.state.selection;if(r instanceof A){o||(o={width:1,height:1,rows:[M.from(je(E(e.state.schema).cell,n))]});let i=r.$anchorCell.node(-1),l=r.$anchorCell.start(-1),s=x.get(i).rectBetween(r.$anchorCell.pos-l,r.$headCell.pos-l);return o=nr(o,s.right-s.left,s.bottom-s.top),fn(e.state,e.dispatch,l,s,o),!0}else if(o){let i=Ne(e.state),l=i.start(-1);return fn(e.state,e.dispatch,l,x.get(i.node(-1)).findCell(i.pos-l),o),!0}else return!1}function ar(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;let o=pn(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof A)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(r=ie(e.state.selection.$anchor))!=null&&((n=Oe(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)i(r,t),t.preventDefault();else if(!o)return;function i(a,c){let f=Oe(e,c),u=U.getState(e.state)==null;if(!f||!Ke(a,f))if(u)f=a;else return;let p=new A(a,f);if(u||!e.state.selection.eq(p)){let h=e.state.tr.setSelection(p);u&&h.setMeta(U,a.pos),e.dispatch(h)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",s),U.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(U,-1))}function s(a){let c=a,f=U.getState(e.state),u;if(f!=null)u=e.state.doc.resolve(f);else if(pn(e,c.target)!=o&&(u=Oe(e,t),!u))return l();u&&i(u,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",s)}function zn(e,t,n){if(!(e.state.selection instanceof P))return null;let{$head:o}=e.state.selection;for(let r=o.depth-1;r>=0;r--){let i=o.node(r);if((n<0?o.index(r):o.indexAfter(r))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){let l=o.before(r),s=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?l:null}}return null}function pn(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Oe(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:r}=n;return o>=0&&ie(e.state.doc.resolve(o))||ie(e.state.doc.resolve(r))}var sr=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),We(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,We(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function We(e,t,n,o,r,i){let l=0,s=!0,a=t.firstChild,c=e.firstChild;if(c){for(let u=0,p=0;u<c.childCount;u++){let{colspan:h,colwidth:d}=c.child(u).attrs;for(let w=0;w<h;w++,p++){let b=r==p?i:d&&d[w],g=b?b+"px":"";if(l+=b||o,b||(s=!1),a)a.style.width!=g&&(a.style.width=g),a=a.nextSibling;else{let C=document.createElement("col");C.style.width=g,t.appendChild(C)}}}for(;a;){var f;let u=a.nextSibling;(f=a.parentNode)===null||f===void 0||f.removeChild(a),a=u}s?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var z=new G("tableColumnResizing");function Ln({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=sr,lastColumnResizable:r=!0}={}){let i=new Z({key:z,state:{init(l,s){var a;let c=(a=i.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,f=E(s.schema).table.name;return o&&c&&(c[f]=(u,p)=>new o(u,n,p)),new cr(-1,!1)},apply(l,s){return s.apply(l)}},props:{attributes:l=>{let s=z.getState(l);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,s)=>{ur(l,s,e,r)},mouseleave:l=>{fr(l)},mousedown:(l,s)=>{pr(l,s,t,n)}},decorations:l=>{let s=z.getState(l);if(s&&s.activeHandle>-1)return wr(l,s.activeHandle)},nodeViews:{}}});return i}var cr=class Me{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){let n=this,o=t.getMeta(z);if(o&&o.setHandle!=null)return new Me(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new Me(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Be(t.doc.resolve(r))||(r=-1),new Me(r,n.dragging)}return n}};function ur(e,t,n,o){if(!e.editable)return;let r=z.getState(e.state);if(r&&!r.dragging){let i=hr(t.target),l=-1;if(i){let{left:s,right:a}=i.getBoundingClientRect();t.clientX-s<=n?l=dn(e,t,"left",n):a-t.clientX<=n&&(l=dn(e,t,"right",n))}if(l!=r.activeHandle){if(!o&&l!==-1){let s=e.state.doc.resolve(l),a=s.node(-1),c=x.get(a),f=s.start(-1);if(c.colCount(s.pos-f)+s.nodeAfter.attrs.colspan-1==c.width-1)return}En(e,l)}}}function fr(e){if(!e.editable)return;let t=z.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&En(e,-1)}function pr(e,t,n,o){var r;if(!e.editable)return!1;let i=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,l=z.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;let s=e.state.doc.nodeAt(l.activeHandle),a=dr(e,l.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(z,{setDragging:{startX:t.clientX,startWidth:a}}));function c(u){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",f);let p=z.getState(e.state);p?.dragging&&(mr(e,p.activeHandle,hn(p.dragging,u,n)),e.dispatch(e.state.tr.setMeta(z,{setDragging:null})))}function f(u){if(!u.which)return c(u);let p=z.getState(e.state);if(p&&p.dragging){let h=hn(p.dragging,u,n);mn(e,p.activeHandle,h,o)}}return mn(e,l.activeHandle,a,o),i.addEventListener("mouseup",c),i.addEventListener("mousemove",f),t.preventDefault(),!0}function dr(e,t,{colspan:n,colwidth:o}){let r=o&&o[o.length-1];if(r)return r;let i=e.domAtPos(t),l=i.node.childNodes[i.offset].offsetWidth,s=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],s--);return l/s}function hr(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function dn(e,t,n,o){let r=n=="right"?-o:o,i=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!i)return-1;let{pos:l}=i,s=ie(e.state.doc.resolve(l));if(!s)return-1;if(n=="right")return s.pos;let a=x.get(s.node(-1)),c=s.start(-1),f=a.map.indexOf(s.pos-c);return f%a.width==0?-1:c+a.map[f-1]}function hn(e,t,n){let o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function En(e,t){e.dispatch(e.state.tr.setMeta(z,{setHandle:t}))}function mr(e,t,n){let o=e.state.doc.resolve(t),r=o.node(-1),i=x.get(r),l=o.start(-1),s=i.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<i.height;c++){let f=c*i.width+s;if(c&&i.map[f]==i.map[f-i.width])continue;let u=i.map[f],p=r.nodeAt(u).attrs,h=p.colspan==1?0:s-i.colCount(u);if(p.colwidth&&p.colwidth[h]==n)continue;let d=p.colwidth?p.colwidth.slice():gr(p.colspan);d[h]=n,a.setNodeMarkup(l+u,null,{...p,colwidth:d})}a.docChanged&&e.dispatch(a)}function mn(e,t,n,o){let r=e.state.doc.resolve(t),i=r.node(-1),l=r.start(-1),s=x.get(i).colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1,a=e.domAtPos(r.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&We(i,a.firstChild,a,o,s,n)}function gr(e){return Array(e).fill(0)}function wr(e,t){let n=[],o=e.doc.resolve(t),r=o.node(-1);if(!r)return oe.empty;let i=x.get(r),l=o.start(-1),s=i.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){let f=s+c*i.width;if((s==i.width-1||i.map[f]!=i.map[f+1])&&(c==0||i.map[f]!=i.map[f-i.width])){var a;let u=i.map[f],p=l+u+r.nodeAt(u).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((a=z.getState(e))===null||a===void 0)&&a.dragging&&n.push(ne.node(l+u,l+u+r.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(ne.widget(p,h))}}return oe.create(e.doc,n)}function In({allowTableNodeSelection:e=!1}={}){return new Z({key:U,state:{init(){return null},apply(t,n){let o=t.getMeta(U);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;let{deleted:r,pos:i}=t.mapping.mapResult(n);return r?null:i}},props:{decorations:Oo,handleDOMEvents:{mousedown:ar},createSelectionBetween(t){return U.getState(t.state)!=null?t.state.selection:null},handleTripleClick:lr,handleKeyDown:rr,handlePaste:ir},appendTransaction(t,n,o){return Bo(o,Wo(o,n),e)}})}var De=typeof navigator<"u"?navigator:null,Ue=De&&De.userAgent||"",br=/Edge\/(\d+)/.exec(Ue),kr=/MSIE \d/.exec(Ue),Cr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ue),yr=!!(kr||Cr||br),xr=!yr&&!!De&&/Apple Computer/.test(De.vendor),_n=new G("safari-ime-span"),qe=!1,Sr={key:_n,props:{decorations:Ar,handleDOMEvents:{compositionstart:()=>{qe=!0},compositionend:()=>{qe=!1}}}};function Ar(e){let{$from:t,$to:n,to:o}=e.selection;if(qe&&t.sameParent(n)){let r=ne.widget(o,Rr,{ignoreSelection:!0,key:"safari-ime-span"});return oe.create(e.doc,[r])}}function Rr(e){let t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var Pn=new Z(xr?Sr:{key:_n});function Xe(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let o=0,r=n.indexOf(t);for(;r!==-1;)o++,r=n.indexOf(t,r+t.length);return o}function Je(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ye(e,t,n){let r=Bt((n||{}).ignore||[]),i=Tr(t),l=-1;for(;++l<i.length;)jt(e,"text",s);function s(c,f){let u=-1,p;for(;++u<f.length;){let h=f[u],d=p?p.children:void 0;if(r(h,d?d.indexOf(h):void 0,p))return;p=h}if(p)return a(c,f)}function a(c,f){let u=f[f.length-1],p=i[l][0],h=i[l][1],d=0,b=u.children.indexOf(c),g=!1,C=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let R=y.index,S={index:y.index,input:y.input,stack:[...f,c]},T=h(...y,S);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?p.lastIndex=R+1:(d!==R&&C.push({type:"text",value:c.value.slice(d,R)}),Array.isArray(T)?C.push(...T):T&&C.push(T),d=R+y[0].length,g=!0),!p.global)break;y=p.exec(c.value)}return g?(d<c.value.length&&C.push({type:"text",value:c.value.slice(d)}),u.children.splice(b,1,...C)):C=[c],b+C.length}}function Tr(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],o=-1;for(;++o<n.length;){let r=n[o];t.push([vr(r[0]),Mr(r[1])])}return t}function vr(e){return typeof e=="string"?new RegExp(Je(e),"g"):e}function Mr(e){return typeof e=="function"?e:function(){return e}}var Ze="phrasing",Qe=["autolink","link","image","label"];function tt(){return{transforms:[Er],enter:{literalAutolink:Nr,literalAutolinkEmail:et,literalAutolinkHttp:et,literalAutolinkWww:et},exit:{literalAutolink:Lr,literalAutolinkEmail:zr,literalAutolinkHttp:Dr,literalAutolinkWww:Fr}}}function nt(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ze,notInConstruct:Qe},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ze,notInConstruct:Qe},{character:":",before:"[ps]",after:"\\/",inConstruct:Ze,notInConstruct:Qe}]}}function Nr(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function et(e){this.config.enter.autolinkProtocol.call(this,e)}function Dr(e){this.config.exit.autolinkProtocol.call(this,e)}function Fr(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zr(e){this.config.exit.autolinkEmail.call(this,e)}function Lr(e){this.exit(e)}function Er(e){Ye(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ir],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,_r]],{ignore:["link","linkReference"]})}function Ir(e,t,n,o,r){let i="";if(!On(r)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!Pr(n)))return!1;let l=Or(n+o);if(!l[0])return!1;let s={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function _r(e,t,n,o){return!On(o,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Pr(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Or(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],o=n.indexOf(")"),r=Xe(e,"("),i=Xe(e,")");for(;o!==-1&&r>i;)e+=n.slice(0,o+1),n=n.slice(o+1),o=n.indexOf(")"),i++;return[e,n]}function On(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||V(n)||fe(n))&&(!t||n!==47)}$n.peek=qr;function $r(){this.buffer()}function Hr(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Br(){this.buffer()}function jr(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Wr(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=J(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kr(e){this.exit(e)}function Vr(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=J(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Gr(e){this.exit(e)}function qr(){return"["}function $n(e,t,n,o){let r=n.createTracker(o),i=r.move("[^"),l=n.enter("footnoteReference"),s=n.enter("reference");return i+=r.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),l(),i+=r.move("]"),i}function ot(){return{enter:{gfmFootnoteCallString:$r,gfmFootnoteCall:Hr,gfmFootnoteDefinitionLabelString:Br,gfmFootnoteDefinition:jr},exit:{gfmFootnoteCallString:Wr,gfmFootnoteCall:Kr,gfmFootnoteDefinitionLabelString:Vr,gfmFootnoteDefinition:Gr}}}function rt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$n},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(o,r,i,l){let s=i.createTracker(l),a=s.move("[^"),c=i.enter("footnoteDefinition"),f=i.enter("label");return a+=s.move(i.safe(i.associationId(o),{before:a,after:"]"})),f(),a+=s.move("]:"),o.children&&o.children.length>0&&(s.shift(4),a+=s.move((t?`
|
|
2
|
-
`:" ")+i.indentLines(i.containerFlow(o,s.current()),t?Hn:Ur))),c(),a}}function Ur(e,t,n){return t===0?e:Hn(e,t,n)}function Hn(e,t,n){return(n?"":" ")+e}var Xr=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Bn.peek=Zr;function lt(){return{canContainEols:["delete"],enter:{strikethrough:Jr},exit:{strikethrough:Yr}}}function it(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Xr}],handlers:{delete:Bn}}}function Jr(e){this.enter({type:"delete",children:[]},e)}function Yr(e){this.exit(e)}function Bn(e,t,n,o){let r=n.createTracker(o),i=n.enter("strikethrough"),l=r.move("~~");return l+=n.containerPhrasing(e,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),i(),l}function Zr(){return"~"}function Qr(e){return e.length}function Wn(e,t){let n=t||{},o=(n.align||[]).concat(),r=n.stringLength||Qr,i=[],l=[],s=[],a=[],c=0,f=-1;for(;++f<e.length;){let w=[],b=[],g=-1;for(e[f].length>c&&(c=e[f].length);++g<e[f].length;){let C=el(e[f][g]);if(n.alignDelimiters!==!1){let y=r(C);b[g]=y,(a[g]===void 0||y>a[g])&&(a[g]=y)}w.push(C)}l[f]=w,s[f]=b}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<c;)i[u]=jn(o[u]);else{let w=jn(o);for(;++u<c;)i[u]=w}u=-1;let p=[],h=[];for(;++u<c;){let w=i[u],b="",g="";w===99?(b=":",g=":"):w===108?b=":":w===114&&(g=":");let C=n.alignDelimiters===!1?1:Math.max(1,a[u]-b.length-g.length),y=b+"-".repeat(C)+g;n.alignDelimiters!==!1&&(C=b.length+C+g.length,C>a[u]&&(a[u]=C),h[u]=C),p[u]=y}l.splice(1,0,p),s.splice(1,0,h),f=-1;let d=[];for(;++f<l.length;){let w=l[f],b=s[f];u=-1;let g=[];for(;++u<c;){let C=w[u]||"",y="",R="";if(n.alignDelimiters!==!1){let S=a[u]-(b[u]||0),T=i[u];T===114?y=" ".repeat(S):T===99?S%2?(y=" ".repeat(S/2+.5),R=" ".repeat(S/2-.5)):(y=" ".repeat(S/2),R=y):R=" ".repeat(S)}n.delimiterStart!==!1&&!u&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||u)&&g.push(" "),n.alignDelimiters!==!1&&g.push(y),g.push(C),n.alignDelimiters!==!1&&g.push(R),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&g.push("|")}d.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return d.join(`
|
|
3
|
-
`)}function el(e){return e==null?"":String(e)}function jn(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function st(){return{enter:{table:tl,tableData:Kn,tableHeader:Kn,tableRow:ol},exit:{codeText:rl,table:nl,tableData:at,tableHeader:at,tableRow:at}}}function tl(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function nl(e){this.exit(e),this.data.inTable=void 0}function ol(e){this.enter({type:"tableRow",children:[]},e)}function at(e){this.exit(e)}function Kn(e){this.enter({type:"tableCell",children:[]},e)}function rl(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ll));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ll(e,t){return t==="|"?t:e}function ct(e){let t=e||{},n=t.tableCellPadding,o=t.tablePipeAlign,r=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
4
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:a,tableRow:s}};function l(h,d,w,b){return c(f(h,w,b),h.align)}function s(h,d,w,b){let g=u(h,w,b),C=c([g]);return C.slice(0,C.indexOf(`
|
|
5
|
-
`))}function a(h,d,w,b){let g=w.enter("tableCell"),C=w.enter("phrasing"),y=w.containerPhrasing(h,{...b,before:i,after:i});return C(),g(),y}function c(h,d){return Wn(h,{align:d,alignDelimiters:o,padding:n,stringLength:r})}function f(h,d,w){let b=h.children,g=-1,C=[],y=d.enter("table");for(;++g<b.length;)C[g]=u(b[g],d,w);return y(),C}function u(h,d,w){let b=h.children,g=-1,C=[],y=d.enter("tableRow");for(;++g<b.length;)C[g]=a(b[g],h,d,w);return y(),C}function p(h,d,w){let b=ye.inlineCode(h,d,w);return w.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function ut(){return{exit:{taskListCheckValueChecked:Vn,taskListCheckValueUnchecked:Vn,paragraph:il}}}function ft(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:al}}}function Vn(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function il(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let o=n.children[0];if(o&&o.type==="text"){let r=t.children,i=-1,l;for(;++i<r.length;){let s=r[i];if(s.type==="paragraph"){l=s;break}}l===n&&(o.value=o.value.slice(1),o.value.length===0?n.children.shift():n.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,n.position.start=Object.assign({},o.position.start)))}}this.exit(e)}function al(e,t,n,o){let r=e.children[0],i=typeof e.checked=="boolean"&&r&&r.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(o);i&&s.move(l);let a=ye.listItem(e,t,n,{...o,...s.current()});return i&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(f){return f+l}}function pt(){return[tt(),ot(),lt(),st(),ut()]}function dt(e){return{extensions:[nt(),rt(e),it(),ct(e),ft()]}}var sl={tokenize:dl,partial:!0},Gn={tokenize:hl,partial:!0},qn={tokenize:ml,partial:!0},Un={tokenize:gl,partial:!0},cl={tokenize:wl,partial:!0},Xn={name:"wwwAutolink",tokenize:fl,previous:Yn},Jn={name:"protocolAutolink",tokenize:pl,previous:Zn},B={name:"emailAutolink",tokenize:ul,previous:Qn},O={};function mt(){return{text:O}}var ee=48;for(;ee<123;)O[ee]=B,ee++,ee===58?ee=65:ee===91&&(ee=97);O[43]=B;O[45]=B;O[46]=B;O[95]=B;O[72]=[B,Jn];O[104]=[B,Jn];O[87]=[B,Xn];O[119]=[B,Xn];function ul(e,t,n){let o=this,r,i;return l;function l(u){return!ht(u)||!Qn.call(o,o.previous)||gt(o.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return ht(u)?(e.consume(u),s):u===64?(e.consume(u),a):n(u)}function a(u){return u===46?e.check(cl,f,c)(u):u===45||u===95||Ce(u)?(i=!0,e.consume(u),a):f(u)}function c(u){return e.consume(u),r=!0,a}function f(u){return i&&r&&te(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function fl(e,t,n){let o=this;return r;function r(l){return l!==87&&l!==119||!Yn.call(o,o.previous)||gt(o.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sl,e.attempt(Gn,e.attempt(qn,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function pl(e,t,n){let o=this,r="",i=!1;return l;function l(u){return(u===72||u===104)&&Zn.call(o,o.previous)&&!gt(o.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(te(u)&&r.length<5)return r+=String.fromCodePoint(u),e.consume(u),s;if(u===58){let p=r.toLowerCase();if(p==="http"||p==="https")return e.consume(u),a}return n(u)}function a(u){return u===47?(e.consume(u),i?c:(i=!0,a)):n(u)}function c(u){return u===null||Ot(u)||v(u)||V(u)||fe(u)?n(u):e.attempt(Gn,e.attempt(qn,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function dl(e,t,n){let o=0;return r;function r(l){return(l===87||l===119)&&o<3?(o++,e.consume(l),r):l===46&&o===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function hl(e,t,n){let o,r,i;return l;function l(c){return c===46||c===95?e.check(Un,a,s)(c):c===null||v(c)||V(c)||c!==45&&fe(c)?a(c):(i=!0,e.consume(c),l)}function s(c){return c===95?o=!0:(r=o,o=void 0),e.consume(c),l}function a(c){return r||o||!i?n(c):t(c)}}function ml(e,t){let n=0,o=0;return r;function r(l){return l===40?(n++,e.consume(l),r):l===41&&o<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Un,t,i)(l):l===null||v(l)||V(l)?t(l):(e.consume(l),r)}function i(l){return l===41&&o++,e.consume(l),r}}function gl(e,t,n){return o;function o(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),o):s===38?(e.consume(s),i):s===93?(e.consume(s),r):s===60||s===null||v(s)||V(s)?t(s):n(s)}function r(s){return s===null||s===40||s===91||v(s)||V(s)?t(s):o(s)}function i(s){return te(s)?l(s):n(s)}function l(s){return s===59?(e.consume(s),o):te(s)?(e.consume(s),l):n(s)}}function wl(e,t,n){return o;function o(i){return e.consume(i),r}function r(i){return Ce(i)?n(i):t(i)}}function Yn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||v(e)}function Zn(e){return!te(e)}function Qn(e){return!(e===47||ht(e))}function ht(e){return e===43||e===45||e===46||e===95||Ce(e)}function gt(e){let t=e.length,n=!1;for(;t--;){let o=e[t][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){n=!0;break}if(o._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var bl={tokenize:Rl,partial:!0};function wt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xl,continuation:{tokenize:Sl},exit:Al}},text:{91:{name:"gfmFootnoteCall",tokenize:yl},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kl,resolveTo:Cl}}}}function kl(e,t,n){let o=this,r=o.events.length,i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),l;for(;r--;){let a=o.events[r][1];if(a.type==="labelImage"){l=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return s;function s(a){if(!l||!l._balanced)return n(a);let c=J(o.sliceSerialize({start:l.end,end:o.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function Cl(e,t){let n=e.length,o;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){o=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function yl(e,t,n){let o=this,r=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i=0,l;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),a}function a(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(i>999||u===93&&!l||u===null||u===91||v(u))return n(u);if(u===93){e.exit("chunkString");let p=e.exit("gfmFootnoteCallString");return r.includes(J(o.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return v(u)||(l=!0),i++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),i++,c):c(u)}}function xl(e,t,n){let o=this,r=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i,l=0,s;return a;function a(d){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(d){return d===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(d)}function f(d){if(l>999||d===93&&!s||d===null||d===91||v(d))return n(d);if(d===93){e.exit("chunkString");let w=e.exit("gfmFootnoteDefinitionLabelString");return i=J(o.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return v(d)||(s=!0),l++,e.consume(d),d===92?u:f}function u(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}function p(d){return d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),r.includes(i)||r.push(i),I(e,h,"gfmFootnoteDefinitionWhitespace")):n(d)}function h(d){return t(d)}}function Sl(e,t,n){return e.check(Ht,t,e.attempt(bl,t,n))}function Al(e){e.exit("gfmFootnoteDefinition")}function Rl(e,t,n){let o=this;return I(e,r,"gfmFootnoteDefinitionIndent",5);function r(i){let l=o.events[o.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function bt(e){let n=(e||{}).singleTilde,o={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function r(l,s){let a=-1;for(;++a<l.length;)if(l[a][0]==="enter"&&l[a][1].type==="strikethroughSequenceTemporary"&&l[a][1]._close){let c=a;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[a][1].end.offset-l[a][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[a][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";let f={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[a][1].end)},u={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[a][1].start)},p=[["enter",f,s],["enter",l[c][1],s],["exit",l[c][1],s],["enter",u,s]],h=s.parser.constructs.insideSpan.null;h&&ke(p,p.length,0,$t(h,l.slice(c+1,a),s)),ke(p,p.length,0,[["exit",u,s],["enter",l[a][1],s],["exit",l[a][1],s],["exit",f,s]]),ke(l,c-1,a-c+3,p),a=c+p.length-2;break}}for(a=-1;++a<l.length;)l[a][1].type==="strikethroughSequenceTemporary"&&(l[a][1].type="data");return l}function i(l,s,a){let c=this.previous,f=this.events,u=0;return p;function p(d){return c===126&&f[f.length-1][1].type!=="characterEscape"?a(d):(l.enter("strikethroughSequenceTemporary"),h(d))}function h(d){let w=Ee(c);if(d===126)return u>1?a(d):(l.consume(d),u++,h);if(u<2&&!n)return a(d);let b=l.exit("strikethroughSequenceTemporary"),g=Ee(d);return b._open=!g||g===2&&!!w,b._close=!w||w===2&&!!g,s(d)}}}var Fe=class{constructor(){this.map=[]}add(t,n,o){Tl(this,t,n,o)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length,o=[];for(;n>0;)n-=1,o.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];o.push(t.slice()),t.length=0;let r=o.pop();for(;r;){for(let i of r)t.push(i);r=o.pop()}this.map.length=0}};function Tl(e,t,n,o){let r=0;if(!(n===0&&o.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...o);return}r+=1}e.map.push([t,n,o])}}function eo(e,t){let n=!1,o=[];for(;t<e.length;){let r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&o.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=o.length-1;o[i]=o[i]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return o}function kt(){return{flow:{null:{name:"table",tokenize:vl,resolveAll:Ml}}}}function vl(e,t,n){let o=this,r=0,i=0,l;return s;function s(m){let ue=o.events.length-1;for(;ue>-1;){let _t=o.events[ue][1].type;if(_t==="lineEnding"||_t==="linePrefix")ue--;else break}let Et=ue>-1?o.events[ue][1].type:null,It=Et==="tableHead"||Et==="tableRow"?T:a;return It===T&&o.parser.lazy[o.now().line]?n(m):It(m)}function a(m){return e.enter("tableHead"),e.enter("tableRow"),c(m)}function c(m){return m===124||(l=!0,i+=1),f(m)}function f(m){return m===null?n(m):Y(m)?i>1?(i=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):n(m):K(m)?I(e,f,"whitespace")(m):(i+=1,l&&(l=!1,r+=1),m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),u(m)))}function u(m){return m===null||m===124||v(m)?(e.exit("data"),f(m)):(e.consume(m),m===92?p:u)}function p(m){return m===92||m===124?(e.consume(m),u):u(m)}function h(m){return o.interrupt=!1,o.parser.lazy[o.now().line]?n(m):(e.enter("tableDelimiterRow"),l=!1,K(m)?I(e,d,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):d(m))}function d(m){return m===45||m===58?b(m):m===124?(l=!0,e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),w):S(m)}function w(m){return K(m)?I(e,b,"whitespace")(m):b(m)}function b(m){return m===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),g):m===45?(i+=1,g(m)):m===null||Y(m)?R(m):S(m)}function g(m){return m===45?(e.enter("tableDelimiterFiller"),C(m)):S(m)}function C(m){return m===45?(e.consume(m),C):m===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(m))}function y(m){return K(m)?I(e,R,"whitespace")(m):R(m)}function R(m){return m===124?d(m):m===null||Y(m)?!l||r!==i?S(m):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(m)):S(m)}function S(m){return n(m)}function T(m){return e.enter("tableRow"),_(m)}function _(m){return m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),_):m===null||Y(m)?(e.exit("tableRow"),t(m)):K(m)?I(e,_,"whitespace")(m):(e.enter("data"),W(m))}function W(m){return m===null||m===124||v(m)?(e.exit("data"),_(m)):(e.consume(m),m===92?vo:W)}function vo(m){return m===92||m===124?(e.consume(m),W):W(m)}}function Ml(e,t){let n=-1,o=!0,r=0,i=[0,0,0,0],l=[0,0,0,0],s=!1,a=0,c,f,u,p=new Fe;for(;++n<e.length;){let h=e[n],d=h[1];h[0]==="enter"?d.type==="tableHead"?(s=!1,a!==0&&(to(p,t,a,c,f),f=void 0,a=0),c={type:"table",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",c,t]])):d.type==="tableRow"||d.type==="tableDelimiterRow"?(o=!0,u=void 0,i=[0,0,0,0],l=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",f,t]])),r=d.type==="tableDelimiterRow"?2:f?3:1):r&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")?(o=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],u=ze(p,t,i,r,void 0,u),i=[0,0,0,0]),l[2]=n)):d.type==="tableCellDivider"&&(o?o=!1:(i[1]!==0&&(l[0]=l[1],u=ze(p,t,i,r,void 0,u)),i=l,l=[i[1],n,0,0])):d.type==="tableHead"?(s=!0,a=n):d.type==="tableRow"||d.type==="tableDelimiterRow"?(a=n,i[1]!==0?(l[0]=l[1],u=ze(p,t,i,r,n,u)):l[1]!==0&&(u=ze(p,t,l,r,n,u)),r=0):r&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")&&(l[3]=n)}for(a!==0&&to(p,t,a,c,f),p.consume(t.events),n=-1;++n<t.events.length;){let h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=eo(t.events,n))}return e}function ze(e,t,n,o,r,i){let l=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(i.end=Object.assign({},ae(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));let a=ae(t.events,n[1]);if(i={type:l,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){let c=ae(t.events,n[2]),f=ae(t.events,n[3]),u={type:s,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",u,t]]),o!==2){let p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){let d=n[2]+1,w=n[3]-n[2]-1;e.add(d,w,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return r!==void 0&&(i.end=Object.assign({},ae(t.events,r)),e.add(r,0,[["exit",i,t]]),i=void 0),i}function to(e,t,n,o,r){let i=[],l=ae(t.events,n);r&&(r.end=Object.assign({},l),i.push(["exit",r,t])),o.end=Object.assign({},l),i.push(["exit",o,t]),e.add(n+1,0,i)}function ae(e,t){let n=e[t],o=n[0]==="enter"?"start":"end";return n[1][o]}var Nl={name:"tasklistCheck",tokenize:Dl};function Ct(){return{text:{91:Nl}}}function Dl(e,t,n){let o=this;return r;function r(a){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),i)}function i(a){return v(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),l):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),l):n(a)}function l(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(a)}function s(a){return Y(a)?t(a):K(a)?e.check({tokenize:Fl},t,n)(a):n(a)}}function Fl(e,t,n){return I(e,o,"whitespace");function o(r){return r===null?n(r):t(r)}}function no(e){return Pt([mt(),wt(),bt(e),kt(),Ct()])}var zl={};function Le(e){let t=this,n=e||zl,o=t.data(),r=o.micromarkExtensions||(o.micromarkExtensions=[]),i=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),l=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);r.push(no(n)),i.push(pt()),l.push(dt(n))}function k(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var St=Qt("strike_through");k(St,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var he=Zt("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:t=>t==="line-through"}],toDOM:t=>["del",e.get(St.key)(t)],parseMarkdown:{match:t=>t.type==="delete",runner:(t,n,o)=>{t.openMark(o),t.next(n.children),t.closeMark(o)}},toMarkdown:{match:t=>t.type.name==="strike_through",runner:(t,n)=>{t.withMark(n,"delete")}}}));k(he.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});k(he.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var At=N("ToggleStrikeThrough",e=>()=>Gt(he.type(e)));k(At,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var ro=xe(e=>qt(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)$/,he.type(e)));k(ro,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var Rt=Pe("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{let t=e.get(pe);return()=>t.call(At.key)}}});k(Rt.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});k(Rt.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var me=gn({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),j=q("table",()=>({...me.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="table",runner:(e,t,n)=>{let o=t.align,r=t.children.map((i,l)=>({...i,align:o,isHeader:l===0}));e.openNode(n),e.next(r),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table",runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let o=[];n.forEach(r=>{o.push(r.attrs.alignment)}),e.openNode("table",void 0,{align:o}),e.next(t.content),e.closeNode()}}}));k(j.node,{displayName:"NodeSchema<table>",group:"Table"});k(j.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var ge=q("table_header_row",()=>({...me.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&e.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type==="tableRow"&&e.isHeader),runner:(e,t,n)=>{let o=t.align,r=t.children.map((i,l)=>({...i,align:o[l],isHeader:t.isHeader}));e.openNode(n),e.next(r),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));k(ge.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});k(ge.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var ce=q("table_row",()=>({...me.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>e.type==="tableRow",runner:(e,t,n)=>{let o=t.align,r=t.children.map((i,l)=>({...i,align:o[l]}));e.openNode(n),e.next(r),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));k(ce.node,{displayName:"NodeSchema<tableRow>",group:"Table"});k(ce.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var we=q("table_cell",()=>({...me.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!e.isHeader,runner:(e,t,n)=>{let o=t.align;e.openNode(n,{alignment:o}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name==="table_cell",runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}}));k(we.node,{displayName:"NodeSchema<tableCell>",group:"Table"});k(we.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var se=q("table_header",()=>({...me.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!!e.isHeader,runner:(e,t,n)=>{let o=t.align;e.openNode(n,{alignment:o}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header",runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}}));k(se.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});k(se.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function lo(e,t=3,n=3){let o=Array(n).fill(0).map(()=>we.type(e).createAndFill()),r=Array(n).fill(0).map(()=>se.type(e).createAndFill()),i=Array(t).fill(0).map((l,s)=>s===0?ge.type(e).create(null,r):ce.type(e).create(null,o));return j.type(e).create(null,i)}function es(e,t){let n=X(t.$from);if(!n)return;let o=x.get(n.node);return(Array.isArray(e)?e:[e]).filter(r=>r>=0&&r<=o.width-1).flatMap(r=>o.cellsInRect({left:r,right:r+1,top:0,bottom:o.height}).map(i=>{let l=n.node.nodeAt(i),s=i+n.start;return{pos:s,start:s+1,node:l,depth:n.depth+2}}))}function ts(e,t){let n=X(t.$from);if(!n)return;let o=x.get(n.node);return(Array.isArray(e)?e:[e]).filter(r=>r>=0&&r<=o.height-1).flatMap(r=>o.cellsInRect({left:0,right:o.width,top:r,bottom:r+1}).map(i=>{let l=n.node.nodeAt(i),s=i+n.start;return{pos:s,start:s+1,node:l,depth:n.depth+2}}))}function io(e){return(t,n)=>o=>{n=n??o.selection.from;let r=o.doc.resolve(n),i=Xt(a=>a.type.name==="table")(r),l=i?{node:i.node,from:i.start}:void 0,s=e==="row";if(l){let a=x.get(l.node);if(t>=0&&t<(s?a.height:a.width)){let c=a.positionAt(s?t:a.height-1,s?a.width-1:t,l.node),f=o.doc.resolve(l.from+c),u=s?A.rowSelection:A.colSelection,p=a.positionAt(s?t:0,s?0:t,l.node),h=o.doc.resolve(l.from+p);return _e(o.setSelection(u(f,h)))}}return o}}var Ll=io("row"),El=io("col");function ao(e,t,{map:n,tableStart:o,table:r},i){let l=Array(i).fill(0).reduce((a,c,f)=>a+r.child(f).nodeSize,o),s=Array(n.width).fill(0).map((a,c)=>{let f=r.nodeAt(n.map[c]);return we.type(e).createAndFill({alignment:f?.attrs.alignment})});return t.insert(l,ce.type(e).create(null,s)),t}function Il(e){let t=X(e.$from);if(!t)return;let n=x.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(o=>{let r=t.node.nodeAt(o),i=o+t.start;return{pos:i,start:i+1,node:r}})}function _l(e){let t=Il(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),o=t[t.length-1];if(o){let r=e.doc.resolve(o.pos);return _e(e.setSelection(new A(r,n)))}}return e}var Tt=N("GoToPrevTableCell",()=>()=>Ge(-1));k(Tt,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var vt=N("GoToNextTableCell",()=>()=>Ge(1));k(vt,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var Mt=N("ExitTable",e=>()=>(t,n)=>{if(!L(t))return!1;let{$head:o}=t.selection,r=Ut(o,j.type(e));if(!r)return!1;let{to:i}=r,l=t.tr.replaceWith(i,i,Se.type(e).createAndFill());return l.setSelection(F.near(l.doc.resolve(i),1)).scrollIntoView(),n?.(l),!0});k(Mt,{displayName:"Command<breakTableCommand>",group:"Table"});var so=N("InsertTable",e=>({row:t,col:n}={})=>(o,r)=>{let{selection:i,tr:l}=o,{from:s}=i,a=lo(e,t,n),c=l.replaceSelectionWith(a),f=F.findFrom(c.doc.resolve(s),1,!0);return f&&c.setSelection(f),r?.(c),!0});k(so,{displayName:"Command<insertTableCommand>",group:"Table"});var co=N("MoveRow",()=>({from:e,to:t,pos:n}={})=>Dn({from:e??0,to:t??0,pos:n}));k(co,{displayName:"Command<moveRowCommand>",group:"Table"});var uo=N("MoveCol",()=>({from:e,to:t,pos:n}={})=>Fn({from:e??0,to:t??0,pos:n}));k(uo,{displayName:"Command<moveColCommand>",group:"Table"});var fo=N("SelectRow",()=>(e={index:0})=>(t,n)=>{let{tr:o}=t;return!!n?.(Ll(e.index,e.pos)(o))});k(fo,{displayName:"Command<selectRowCommand>",group:"Table"});var po=N("SelectCol",()=>(e={index:0})=>(t,n)=>{let{tr:o}=t;return!!n?.(El(e.index,e.pos)(o))});k(po,{displayName:"Command<selectColCommand>",group:"Table"});var ho=N("SelectTable",()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(_l(n))});k(ho,{displayName:"Command<selectTableCommand>",group:"Table"});var mo=N("DeleteSelectedCells",()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof A))return!1;let o=n.isRowSelection(),r=n.isColSelection();return o&&r?Nn(e,t):r?Tn(e,t):vn(e,t)});k(mo,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var go=N("AddColBefore",()=>()=>An);k(go,{displayName:"Command<addColBeforeCommand>",group:"Table"});var wo=N("AddColAfter",()=>()=>Rn);k(wo,{displayName:"Command<addColAfterCommand>",group:"Table"});var bo=N("AddRowBefore",e=>()=>(t,n)=>{if(!L(t))return!1;if(n){let o=H(t);n(ao(e,t.tr,o,o.top))}return!0});k(bo,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var ko=N("AddRowAfter",e=>()=>(t,n)=>{if(!L(t))return!1;if(n){let o=H(t);n(ao(e,t.tr,o,o.bottom))}return!0});k(ko,{displayName:"Command<addRowAfterCommand>",group:"Table"});var Co=N("SetAlign",()=>(e="left")=>Mn("alignment",e));k(Co,{displayName:"Command<setAlignCommand>",group:"Table"});var yo=xe(e=>new Ie(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,o,r)=>{let i=t.doc.resolve(o);if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),j.type(e)))return null;let l=lo(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(o,r,l);return s.setSelection(P.create(s.doc,o+3)).scrollIntoView()}));k(yo,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var xo=Yt(e=>({run:(t,n,o)=>{if(o)return t;function r(c){let f=c.childCount,u=c.lastChild?.childCount??0;if(f===0||u===0)return Se.type(e).create();let p=c.firstChild;if(!(u>0&&p&&p.childCount===0))return c;if(f>=3){let b=c.child(1),g=[];for(let R=0;R<b.childCount;R++){let S=b.child(R);g.push(se.type(e).create(S.attrs,S.content,S.marks))}let C=p.type.create(p.attrs,g),y=[];for(let R=2;R<f;R++)y.push(c.child(R));return c.type.create(c.attrs,[C,...y])}let h=Array(u).fill(0).map(()=>se.type(e).createAndFill()),d=new D(M.from(h),0,0),w=p.replace(0,0,d);return c.replace(0,p.nodeSize,new D(M.from(w),0,0))}function i(c){let f=ce.type(e),u=[],p=[],h=!1;function d(){if(p.length===0)return;let w=ge.type(e).createAndFill(),b=j.type(e).create(null,[w,...p]);u.push(r(b)),p=[]}return c.forEach(w=>{w.type===f?(h=!0,p.push(w)):(d(),u.push(w))}),d(),h?M.from(u):c}function l(c){let f=i(c),u=f!==c,p=[];return f.forEach(h=>{if(h.type===j.type(e)){let d=r(h);d!==h&&(u=!0),p.push(d)}else if(h.childCount>0){let d=l(h.content);d!==h.content?(u=!0,p.push(h.copy(d))):p.push(h)}else p.push(h)}),u?M.from(p):c}function s(c){let f=[],u=[];c.forEach(p=>u.push(p));for(let p=0;p<u.length;p++){let h=u[p],d=u[p+1];h.type===Se.type(e)&&h.content.size===0&&d&&d.type===j.type(e)||f.push(h)}return f.length<u.length?M.from(f):c}let a=l(t.content);return a=s(a),new D(M.from(a),t.openStart,t.openEnd)}}));k(xo,{displayName:"PasteRule<table>",group:"Table"});var Nt=Pe("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{let t=e.get(pe);return()=>t.call(vt.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{let t=e.get(pe);return()=>t.call(Tt.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{let t=e.get(pe);return()=>t.call(Mt.key)}}});k(Nt.ctx,{displayName:"KeymapCtx<table>",group:"Table"});k(Nt.shortcuts,{displayName:"Keymap<table>",group:"Table"});var yt="footnote_definition",oo="footnoteDefinition",Dt=q("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${yt}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw be(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{let t=e.attrs.label;return["dl",{"data-label":t,"data-type":yt},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===oo,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===yt,runner:(e,t)=>{e.openNode(oo,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));k(Dt.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});k(Dt.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var xt="footnote_reference",Ft=q("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${xt}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw be(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return["sup",{"data-label":t,"data-type":xt},t]},parseMarkdown:{match:({type:e})=>e==="footnoteReference",runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===xt,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));k(Ft.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});k(Ft.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var zt=tn.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:o=>{if(!(o instanceof HTMLElement))throw be(o);return{label:o.dataset.label,listType:o.dataset.listType,spread:o.dataset.spread==="true",checked:o.dataset.checked?o.dataset.checked==="true":null}}},...n?.parseDOM||[]],toDOM:o=>n.toDOM&&o.attrs.checked==null?n.toDOM(o):["li",{"data-item-type":"task","data-label":o.attrs.label,"data-list-type":o.attrs.listType,"data-spread":o.attrs.spread,"data-checked":o.attrs.checked},0],parseMarkdown:{match:({type:o})=>o==="listItem",runner:(o,r,i)=>{if(r.checked==null){n.parseMarkdown.runner(o,r,i);return}let l=r.label!=null?`${r.label}.`:"\u2022",s=r.checked!=null?!!r.checked:null,a=r.label!=null?"ordered":"bullet",c=r.spread??!0;o.openNode(i,{label:l,listType:a,spread:c,checked:s}),o.next(r.children),o.closeNode()}},toMarkdown:{match:o=>o.type.name==="list_item",runner:(o,r)=>{if(r.attrs.checked==null){n.toMarkdown.runner(o,r);return}let i=r.attrs.label,l=r.attrs.listType,s=r.attrs.spread,a=r.attrs.checked;o.openNode("listItem",void 0,{label:i,listType:l,spread:s,checked:a}),o.next(r.content),o.closeNode()}}}});k(zt.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});k(zt.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var So=xe(()=>new Ie(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,o)=>{let r=e.doc.resolve(n),i=0,l=r.node(i);for(;l&&l.type.name!=="list_item";)i--,l=r.node(i);if(!l||l.attrs.checked!=null)return null;let s=t.groups?.checked==="x",a=r.before(i),c=e.tr;return c.deleteRange(n,o).setNodeMarkup(a,void 0,{...l.attrs,checked:s}),c}));k(So,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var Pl=[Rt,Nt].flat(),Ol=[yo,So],$l=[ro],Hl=[xo],Ao=de(()=>Pn);k(Ao,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var Bl=de(()=>Ln({}));k(Bl,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Ro=de(()=>In({allowTableNodeSelection:!0}));k(Ro,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Lt=en("remarkGFM",()=>Le);k(Lt.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});k(Lt.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var jl=new G("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function Wl(e,t){let n=0;return t.forEach((o,r,i)=>{o===e&&(n=i)}),n}function Kl(e,t){let n=e.content.findDiffStart(t.content);if(n==null)return null;let o=e.content.findDiffEnd(t.content);return o?{from:n,to:Math.max(o.b,n)}:null}var To=de(()=>new Z({key:jl,appendTransaction:(e,t,n)=>{if(t.doc===n.doc)return;let o=Kl(t.doc,n.doc);if(!o)return;let r,i=(l,s)=>{if(l.type.name!=="table_cell")return;let a=n.doc.resolve(s),c=a.node(a.depth),f=a.node(a.depth-1).firstChild;if(!f)return;let u=Wl(l,c),p=f.maybeChild(u);if(!p)return;let h=p.attrs.alignment;h!==l.attrs.alignment&&(r||(r=n.tr),r.setNodeMarkup(s,void 0,{...l.attrs,alignment:h}))};return n.doc.nodesBetween(o.from,o.to,(l,s)=>l.type.name!=="table"?!0:(n.doc.nodesBetween(s,s+l.nodeSize,i),!1)),r}}));k(To,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Vl=[To,Ao,Lt,Ro].flat(),Gl=[zt,j,ge,ce,se,we,Dt,Ft,St,he].flat(),ql=[vt,Tt,Mt,so,co,uo,fo,po,ho,mo,bo,ko,go,wo,Co,At],ns=[Gl,Ol,Hl,$l,Pl,ql,Vl].flat();export{wo as addColAfterCommand,go as addColBeforeCommand,ko as addRowAfterCommand,bo as addRowBeforeCommand,ao as addRowWithAlignment,Ao as autoInsertSpanPlugin,Bl as columnResizingPlugin,ql as commands,lo as createTable,mo as deleteSelectedCellsCommand,Mt as exitTable,zt as extendListItemSchemaForTask,Dt as footnoteDefinitionSchema,Ft as footnoteReferenceSchema,Il as getAllCellsInTable,es as getCellsInCol,ts as getCellsInRow,ns as gfm,vt as goToNextTableCellCommand,Tt as goToPrevTableCellCommand,Ol as inputRules,so as insertTableCommand,yo as insertTableInputRule,To as keepTableAlignPlugin,Pl as keymap,$l as markInputRules,uo as moveColCommand,co as moveRowCommand,Hl as pasteRules,Vl as plugins,Lt as remarkGFMPlugin,Gl as schema,El as selectCol,po as selectColCommand,io as selectLine,Ll as selectRow,fo as selectRowCommand,_l as selectTable,ho as selectTableCommand,Co as setAlignCommand,St as strikethroughAttr,ro as strikethroughInputRule,Rt as strikethroughKeymap,he as strikethroughSchema,we as tableCellSchema,Ro as tableEditingPlugin,ge as tableHeaderRowSchema,se as tableHeaderSchema,Nt as tableKeymap,xo as tablePasteRule,ce as tableRowSchema,j as tableSchema,At as toggleStrikethroughCommand,So as wrapInTaskListInputRule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h,b as p,c as l}from"./chunk-HKUJH2VC.js";import{a as m,e as n,g as y,j as c}from"./chunk-GF2LJCG5.js";import{la as a}from"./chunk-P3WV3MLS.js";import"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";function r(o,t){return Object.assign(o,{meta:{package:"@milkdown/plugin-history",...t}}),o}var e=m("Undo",()=>()=>p);r(e,{displayName:"Command<undo>"});var i=m("Redo",()=>()=>l);r(i,{displayName:"Command<redo>"});var d=y({},"historyProviderConfig");r(d,{displayName:"Ctx<historyProviderConfig>"});var u=n(o=>h(o.get(d.key)));r(u,{displayName:"Ctx<historyProviderPlugin>"});var s=c("historyKeymap",{Undo:{shortcuts:"Mod-z",command:o=>{let t=o.get(a);return()=>t.call(e.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:o=>{let t=o.get(a);return()=>t.call(i.key)}}});r(s.ctx,{displayName:"KeymapCtx<history>"});r(s.shortcuts,{displayName:"Keymap<history>"});var g=[d,u,s,e,i].flat();export{g as history,s as historyKeymap,d as historyProviderConfig,u as historyProviderPlugin,i as redoCommand,e as undoCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as s,g as f}from"./chunk-GF2LJCG5.js";import"./chunk-P3WV3MLS.js";import{t as c,v as d}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";function p(n,e){let{doc:o,selection:t}=n;if(!o||!t||!(t instanceof c||t instanceof d))return n;let{to:r}=t,i=e.type==="space"?Array(e.size).fill(" ").join(""):" ";return n.insertText(i,r)}var a=f({type:"space",size:2},"indentConfig");a.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var l=s(n=>({Tab:(e,o)=>{let t=n.get(a.key),{tr:r}=e,i=p(r,t);return i.docChanged?(o?.(i),!0):!1}}));l.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var m=[a,l];export{m as indent,a as indentConfig,l as indentPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as R,b as j,c as E,d as L,e as X,f as Y,h as z,i as B,j as b,m as V}from"./chunk-KX3KYRT7.js";import"./chunk-XLIC2WFB.js";import{la as U,na as A}from"./chunk-SGGMD6DA.js";import{Ga as N,Ma as T,Q as F,V as y,d,e as w,f as K,fa as C,g as x,va as M}from"./chunk-P3WV3MLS.js";import{L as k,x as D,y as O}from"./chunk-EAFZBBCI.js";import{f as e,g as a,h as l,i as g}from"./chunk-23NN352E.js";var I=new O("MILKDOWN_COLLAB_KEYMAP"),Z=[I,R,E,j],c,o,m,s,h,n,q,G,v,H,W=(H=class{constructor(){a(this,n);a(this,c,{});a(this,o,null);a(this,m,null);a(this,s,null);a(this,h,!1)}bindCtx(t){return l(this,s,t),this}bindDoc(t){return l(this,o,t.getXmlFragment("prosemirror")),this}bindXmlFragment(t){return l(this,o,t),this}setOptions(t){return l(this,c,t),this}mergeOptions(t){return Object.assign(e(this,c),t),this}setAwareness(t){return l(this,m,t),this}applyTemplate(t,i){if(!e(this,s))throw d();if(!e(this,o))throw w();let r=i||(u=>u.textContent.length===0),p=g(this,n,q).call(this,t),f=e(this,s).get(C),J=X(e(this,o),f);if(p&&r(J,p)){let u=e(this,o);u.delete(0,u.length);let S=Y(p),Q=A(S);u.doc&&U(u.doc,Q),S.destroy()}return this}connect(){if(!e(this,s))throw d();if(e(this,h))return;let t=e(this,s).get(y),i=g(this,n,G).call(this),r=t.concat(i);return g(this,n,v).call(this,r),l(this,h,!0),this}disconnect(){if(!e(this,s))throw d();if(!e(this,h))return this;let t=e(this,s).get(y).filter(i=>!i.spec.key||!Z.includes(i.spec.key));return g(this,n,v).call(this,t),l(this,h,!1),this}},c=new WeakMap,o=new WeakMap,m=new WeakMap,s=new WeakMap,h=new WeakMap,n=new WeakSet,q=function(t){if(!e(this,s))throw d();let i=e(this,s).get(C),r=e(this,s).get(M);return N(t,r,i)},G=function(){if(!e(this,o))throw w();let{ySyncOpts:t,yUndoOpts:i}=e(this,c),r=[L(e(this,o),t),V(i),new D({key:I,props:{handleKeyDown:k({"Mod-z":B,"Mod-y":b,"Mod-Shift-z":b})}})];if(e(this,m)){let{yCursorOpts:p,yCursorStateField:f}=e(this,c);r.push(z(e(this,m),p,f))}return r},v=function(t){if(!e(this,s))throw d();e(this,s).set(y,t);let i=e(this,s).get(F),r=i.state.reconfigure({plugins:t});i.updateState(r)},H),_=K(new W,"collabServiceCtx"),P=x("CollabReady"),$=t=>{let i=new W;return t.inject(_,i).record(P),async()=>(await t.wait(T),i.bindCtx(t),t.done(P),()=>{t.remove(_).clearTimer(P)})};$.meta={package:"@milkdown/plugin-collab",displayName:"Collab"};export{I as CollabKeymapPluginKey,P as CollabReady,W as CollabService,$ as collab,_ as collabServiceCtx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-OESZ7FEN.js";import{Aa as w,Ma as y,V as f,ba as L,f as h,ya as m}from"./chunk-P3WV3MLS.js";import{x as p,y as c}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";var k=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},g=h(new k,"listener"),E=new c("MILKDOWN_LISTENER"),M=e=>(e.inject(g,new k),async()=>{await e.wait(L);let{listeners:r}=e.get(g);r.beforeMount.forEach(t=>t(e)),await e.wait(m);let u=e.get(w),n=null,d=null,i=null,o=null,l=b(()=>{if(!o)return;let{doc:t}=o;if(r.updated.length>0&&n&&!n.eq(t)&&r.updated.forEach(s=>{s(e,t,n)}),r.markdownUpdated.length>0&&n&&!n.eq(t)){let s=u(t);r.markdownUpdated.forEach(a=>{a(e,s,d)}),d=s}n=t,o=null},200),U=new p({key:E,view:()=>({destroy:()=>{l.cancel(),r.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(r.focus.forEach(t=>t(e)),!1),blur:()=>(r.blur.forEach(t=>t(e)),!1)}},state:{init:(t,s)=>{n=s.doc,d=u(s.doc)},apply:t=>{let s=t.selection;(!i&&s||i&&!s.eq(i))&&(r.selectionUpdated.forEach(a=>{a(e,s,i)}),i=s),!(!(t.docChanged||t.storedMarksSet)||t.getMeta("addToHistory")===!1)&&(o=t,l())}}});e.update(f,t=>t.concat(U)),await e.wait(y),r.mounted.forEach(t=>t(e))});M.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};export{k as ListenerManager,E as key,M as listener,g as listenerCtx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as Z}from"./chunk-6X7NT7KH.js";import{d as ee,g as te,h as oe,k as H,l as E,m as ne}from"./chunk-KX3KYRT7.js";import"./chunk-XLIC2WFB.js";import{da as J}from"./chunk-SGGMD6DA.js";import{a as X,b as j,c as K,d as _,e as V,f as L,g as S}from"./chunk-7R5G6FRT.js";import{a as Y,b as v,c as D}from"./chunk-HKUJH2VC.js";import{D as w,E as W,F as R,G as y,H as d,I as G,J as T,K as A,O as Q,f as z,g as B,h as N,w as $,x as F}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";var n=new z({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},heading:{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,parseDOM:[1,2].map(e=>({tag:`h${e}`,attrs:{level:e}})),toDOM:e=>[`h${e.attrs.level}`,0]},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},bullet_list:j,ordered_list:X,list_item:K},marks:{strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null}],toDOM:()=>["strong",0]},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},code:{parseDOM:[{tag:"code"}],toDOM:()=>["code",0]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title")})}],toDOM:e=>["a",{href:e.attrs.href,title:e.attrs.title,rel:"noreferrer noopener"},0]}}}),ae=[[{name:"bold",label:"B",title:"Bold",command:d(n.marks.strong),active:e=>h(e,n.marks.strong)},{name:"italic",label:"I",title:"Italic",command:d(n.marks.em),active:e=>h(e,n.marks.em)},{name:"code",label:"</>",title:"Code",command:d(n.marks.code),active:e=>h(e,n.marks.code)}],[{name:"paragraph",label:"P",title:"Paragraph",command:y(n.nodes.paragraph),active:e=>f(e,n.nodes.paragraph)},{name:"h1",label:"H1",title:"Heading 1",command:y(n.nodes.heading,{level:1}),active:e=>f(e,n.nodes.heading,{level:1})},{name:"h2",label:"H2",title:"Heading 2",command:y(n.nodes.heading,{level:2}),active:e=>f(e,n.nodes.heading,{level:2})},{name:"quote",label:"Q",title:"Quote",command:R(n.nodes.blockquote),active:e=>f(e,n.nodes.blockquote)}],[{name:"bullet-list",label:"*",title:"Bullet list",command:_(n.nodes.bullet_list),active:e=>f(e,n.nodes.bullet_list)},{name:"ordered-list",label:"1.",title:"Numbered list",command:_(n.nodes.ordered_list),active:e=>f(e,n.nodes.ordered_list)},{name:"link",label:"A",title:"Link",command:me,active:e=>h(e,n.marks.link)}]];function Oe({root:e,value:t="",onChange:o,collaborative:r=!1,room:s="baseui-text-editor",password:i,signaling:g,user:ie,placeholder:b}={}){if(!e)throw new Error("BaseUI text editor: missing root element.");e.replaceChildren();let m=document.createElement("div");m.className="baseui-text-editor-toolbar",m.setAttribute("role","toolbar"),m.setAttribute("aria-label","Text formatting");let k=document.createElement("div");k.className="baseui-text-editor-surface",b&&k.setAttribute("data-placeholder",b),e.append(m,k);let P=[],q=re(t),u=null,p=null,M="",x=[A({"Mod-b":d(n.marks.strong),"Mod-i":d(n.marks.em),"Mod-z":r?H:v,"Mod-y":r?E:D,"Shift-Mod-z":r?E:D,Enter:G(V(n.nodes.list_item),T.Enter),Tab:S(n.nodes.list_item),"Shift-Tab":L(n.nodes.list_item),"Mod-]":S(n.nodes.list_item),"Mod-[":L(n.nodes.list_item),"Shift-Enter":W,"Alt-ArrowUp":w}),A(T),pe(b)];if(r){p=new J;let l=p.getXmlFragment("prosemirror");l.length===0&&te(q,l);let c={};i&&(c.password=i),Array.isArray(g)&&g.length&&(c.signaling=g),u=new Z(s,p,c),u.awareness?.setLocalStateField("user",ce(ie)),x.push(ee(l),oe(u.awareness),ne()),P.push(()=>u.destroy?.(),()=>p.destroy())}else x.push(Y());let a;return a=new Q(k,{state:$.create({doc:r?void 0:q,schema:n,plugins:x}),dispatchTransaction(l){if(!a)return;let c=a.state.apply(l);a.updateState(c),se(m,a);let O=U(a.state.doc),le=O!==M;if(I(e,a,b),le){let de=M;M=O,o?.(O,de,{view:a,provider:u,doc:p})}}}),M=U(a.state.doc),ue(m,a,r?{undo:H,redo:E}:{undo:v,redo:D}),I(e,a,b),{view:a,provider:u,doc:p,focus:()=>a.focus(),getHTML:()=>U(a.state.doc),setHTML:l=>{let c=re(l);a.dispatch(a.state.tr.replaceWith(0,a.state.doc.content.size,c.content))},destroy:()=>{for(let l of P)l();a.destroy(),e.replaceChildren()}}}function re(e){let t=document.createElement("div");return t.innerHTML=String(e||"").trim()||"<p></p>",B.fromSchema(n).parse(t)}function U(e){let t=N.fromSchema(n).serializeFragment(e.content),o=document.createElement("div");return o.append(t),o.innerHTML}function ce(e){let t=e&&typeof e=="object"?e:{};return{name:t.name||"Anonymous",color:t.color||"#2563eb",...t}}function h(e,t){let{from:o,$from:r,to:s,empty:i}=e.selection;return i?!!t.isInSet(e.storedMarks||r.marks()):e.doc.rangeHasMark(o,s,t)}function f(e,t,o={}){let{$from:r,to:s,node:i}=e.selection;return i?i.hasMarkup(t,o):s<=r.end()&&r.parent.hasMarkup(t,o)}function me(e,t){if(h(e,n.marks.link))return d(n.marks.link)(e,t);if(!t)return!0;let o=e.selection.$from.marks().find(s=>s.type===n.marks.link),r=window.prompt("Enter link URL",o?.attrs.href||"");return r?d(n.marks.link,{href:r})(e,t):!1}function ue(e,t,o){e.replaceChildren(),e._baseuiTextEditorUndo=o.undo,e._baseuiTextEditorRedo=o.redo;for(let s of ae){let i=document.createElement("div");i.className="baseui-text-editor-toolbar-group";for(let g of s)i.append(C(g,t));e.append(i)}let r=document.createElement("div");r.className="baseui-text-editor-toolbar-group",r.append(C({name:"undo",label:"Undo",title:"Undo",command:o.undo},t),C({name:"redo",label:"Redo",title:"Redo",command:o.redo},t)),e.append(r),se(e,t)}function C(e,t){let o=document.createElement("button");return o.type="button",o.className="baseui-text-editor-button",o.dataset.command=e.name,o.title=e.title,o.setAttribute("aria-label",e.title),o.textContent=e.label,o.addEventListener("mousedown",r=>{r.preventDefault(),e.command(t.state,t.dispatch,t),t.focus()}),o}function se(e,t){for(let o of ae)for(let r of o){let s=e.querySelector(`[data-command="${r.name}"]`);s&&(s.setAttribute("aria-pressed",r.active?.(t.state)?"true":"false"),s.disabled=!r.command(t.state,null,t))}for(let o of["undo","redo"]){let r=e.querySelector(`[data-command="${o}"]`),s=o==="undo"?e._baseuiTextEditorUndo:e._baseuiTextEditorRedo;r&&(r.disabled=!s(t.state,null,t))}}function pe(e){return new F({view(t){return{update:()=>I(t.dom.closest(".baseui-text-editor-shell"),t,e)}}})}function I(e,t,o){if(!e)return;let r=t.state.doc.childCount===1&&t.state.doc.firstChild?.type===n.nodes.paragraph&&t.state.doc.firstChild.content.size===0;e.classList.toggle("baseui-text-editor-empty",!!(o&&r)),o&&t.dom.setAttribute("data-placeholder",o)}export{Oe as createProseMirrorTextEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as E,d as F,e as I}from"./chunk-MAWHENWJ.js";import{a as _}from"./chunk-OESZ7FEN.js";import{e as N,g as T}from"./chunk-GF2LJCG5.js";import{G as B,N as M}from"./chunk-P3WV3MLS.js";import{t as O,x as H,y as A}from"./chunk-EAFZBBCI.js";import{f as s,g as a,h as i}from"./chunk-23NN352E.js";function D(o){let t=T({},`${o}_SLASH_SPEC`),e=N(m=>{let h=m.get(t.key);return new H({key:new A(`${o}_SLASH`),...h})}),n=[t,e];return n.key=t.key,n.pluginKey=e.key,t.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${o}`},e.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${o}`},n}var c,f,u,p,g,r,y,l,S,x,k,R,G=(R=class{constructor(o){a(this,c);a(this,f);a(this,u);a(this,p);a(this,g);a(this,r);a(this,y);a(this,l);a(this,S);a(this,x);a(this,k);i(this,c,!1),this.onShow=()=>{},this.onHide=()=>{},i(this,x,(t,e)=>{let{state:n,composing:m}=t,{selection:h,doc:w}=n,{ranges:$}=h,P=Math.min(...$.map(d=>d.$from.pos)),C=Math.max(...$.map(d=>d.$to.pos)),b=e&&e.doc.eq(w)&&e.selection.eq(h);if(s(this,c)||((s(this,p)??t.dom.parentElement??document.body).appendChild(this.element),i(this,c,!0)),!(m||b)){if(!s(this,y).call(this,t,e)){this.hide();return}I({getBoundingClientRect:()=>B(t,P,C)},this.element,{placement:"bottom-start",middleware:[F(),E(s(this,S)),...s(this,f)],...s(this,u)}).then(({x:d,y:U})=>{Object.assign(this.element.style,{left:`${d}px`,top:`${U}px`})}).catch(console.error),this.show()}}),i(this,k,t=>{let e=this.getContent(t);if(!e)return!1;let n=e.at(-1);return n?Array.isArray(s(this,r))?s(this,r).includes(n):s(this,r)===n:!1}),this.update=(t,e)=>{s(this,l).call(this,t,e)},this.getContent=(t,e=n=>n.type.name==="paragraph")=>{let{selection:n}=t.state,{empty:m,$from:h}=n,w=t.state.selection instanceof O;if(typeof document>"u")return;let $=this.element.contains(document.activeElement),P=!t.hasFocus()&&!$,C=!t.editable,b=!M(e)(t.state.selection);if(!(P||C||!m||!w||b))return h.parent.textBetween(Math.max(0,h.parentOffset-500),h.parentOffset,void 0,"\uFFFC")},this.destroy=()=>{s(this,l).cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=o.content,i(this,g,o.debounce??200),i(this,y,o.shouldShow??s(this,k)),i(this,r,o.trigger??"/"),i(this,S,o.offset),i(this,f,o.middleware??[]),i(this,u,o.floatingUIOptions??{}),i(this,p,o.root),i(this,l,_(s(this,x),s(this,g)))}},c=new WeakMap,f=new WeakMap,u=new WeakMap,p=new WeakMap,g=new WeakMap,r=new WeakMap,y=new WeakMap,l=new WeakMap,S=new WeakMap,x=new WeakMap,k=new WeakMap,R);export{G as SlashProvider,D as slashFactory};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,b as K,c as L,d as N,e as j}from"./chunk-MAWHENWJ.js";import{b as A}from"./chunk-OESZ7FEN.js";import{e as R,g as q}from"./chunk-GF2LJCG5.js";import{G as M}from"./chunk-P3WV3MLS.js";import{t as B,x as F,y as H}from"./chunk-EAFZBBCI.js";import{f as e,g as i,h as s}from"./chunk-23NN352E.js";var g,y,x,m,d,p,l,k,P,u,a,f,$,w,z,X=(z=class{constructor(n){i(this,g);i(this,y);i(this,x);i(this,m);i(this,d);i(this,p);i(this,l);i(this,k);i(this,P);i(this,u);i(this,a);i(this,f);i(this,$);i(this,w);s(this,p,!1),this.onShow=()=>{},this.onHide=()=>{},s(this,a,t=>{j(t,this.element,{placement:e(this,m).placement??"top",middleware:[N(),K(e(this,k)),L(e(this,P)),...e(this,x)],...e(this,m)}).then(({x:o,y:h})=>{Object.assign(this.element.style,{left:`${o}px`,top:`${h}px`})}).catch(console.error)}),s(this,f,t=>e(this,d)!==t.dom.parentElement),s(this,$,(t,o)=>{var _;let{state:h,composing:c}=t,{selection:r,doc:O}=h,{ranges:T}=r,E=Math.min(...T.map(C=>C.$from.pos)),S=Math.max(...T.map(C=>C.$to.pos)),U=o&&o.doc.eq(O)&&o.selection.eq(r);if(e(this,p)||((e(this,d)??t.dom.parentElement??document.body).appendChild(this.element),s(this,p,!0)),c||U)return;if((_=e(this,l))==null||_.call(this),s(this,l,void 0),!e(this,y).call(this,t,o)){this.hide();return}let b={getBoundingClientRect:()=>M(t,E,S),contextElement:t.dom};e(this,f).call(this,t)?s(this,l,I(b,this.element,()=>e(this,a).call(this,b))):e(this,a).call(this,b),this.show()}),this.update=(t,o)=>{e(this,u).call(this,t,o)},s(this,w,t=>{let{doc:o,selection:h}=t.state,{empty:c,from:r,to:O}=h,T=!o.textBetween(r,O).length&&t.state.selection instanceof B,E=this.element.contains(document.activeElement),S=!t.hasFocus()&&!E,U=!t.editable;return!(S||c||T||U)}),this.destroy=()=>{var t;(t=e(this,l))==null||t.call(this),e(this,u).cancel()},this.show=(t,o)=>{var h;if(this.element.dataset.show="true",t){(h=e(this,l))==null||h.call(this),s(this,l,void 0);let c={...t,contextElement:o?.dom};o&&e(this,f).call(this,o)?s(this,l,I(c,this.element,()=>e(this,a).call(this,c))):e(this,a).call(this,c)}this.onShow()},this.hide=()=>{this.element.dataset.show!=="false"&&(this.element.dataset.show="false",this.onHide())},this.element=n.content,s(this,g,n.debounce??200),s(this,y,n.shouldShow??e(this,w)),s(this,k,n.offset),s(this,P,n.shift),s(this,x,n.middleware??[]),s(this,m,n.floatingUIOptions??{}),s(this,d,n.root),this.element.dataset.show="false",s(this,u,A(e(this,$),e(this,g)))}},g=new WeakMap,y=new WeakMap,x=new WeakMap,m=new WeakMap,d=new WeakMap,p=new WeakMap,l=new WeakMap,k=new WeakMap,P=new WeakMap,u=new WeakMap,a=new WeakMap,f=new WeakMap,$=new WeakMap,w=new WeakMap,z);function Y(n){let t=q({},`${n}_TOOLTIP_SPEC`),o=R(c=>{let r=c.get(t.key);return new F({key:new H(`${n}_TOOLTIP`),...r})}),h=[t,o];return h.key=t.key,h.pluginKey=o.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${n}`},o.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${n}`},h}export{X as TooltipProvider,Y as tooltipFactory};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as U,g as F}from"./chunk-GF2LJCG5.js";import{b as y,fa as b}from"./chunk-P3WV3MLS.js";import{M as k,N as C,x as D,y as P}from"./chunk-EAFZBBCI.js";import"./chunk-23NN352E.js";function A(o){return new Promise(i=>{let n=new FileReader;n.addEventListener("load",()=>{i({alt:o.name,src:n.result})},!1),n.readAsDataURL(o)})}var E=async(o,i)=>{let n=[];for(let e=0;e<o.length;e++){let t=o.item(e);t&&t.type.includes("image")&&n.push(t)}let{image:d}=i.nodes;if(!d)throw y("image");return(await Promise.all(n.map(e=>A(e)))).map(({alt:e,src:t})=>d.createAndFill({src:t,alt:e}))},p=F({uploader:E,enableHtmlFileUploader:!1,uploadWidgetFactory:(o,i)=>{let n=document.createElement("span");return n.textContent="Upload in progress...",k.widget(o,n,i)}},"uploadConfig");p.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var w=U(o=>{let i=new P("MILKDOWN_UPLOAD"),n=(e,t)=>{let a=i.getState(e);if(!a)return-1;let r=a.find(void 0,void 0,s=>s.id===t);return r.length?r[0]?.from??-1:-1},d=(e,t,a)=>{if(!a||a.length<=0)return!1;let r=Symbol("upload symbol"),s=o.get(b),{uploader:l,getInsertPos:f}=o.get(p.key),{tr:c}=e.state,g=t instanceof DragEvent?e.posAtCoords({left:t.clientX,top:t.clientY})?.pos??c.selection.from:c.selection.from,h=typeof f=="function"?f(t,o,g):g;return e.dispatch(c.setMeta(i,{add:{id:r,pos:h}})),l(a,s,o,h).then(u=>{let m=n(e.state,r);m<0||e.dispatch(e.state.tr.replaceWith(m,m,u).setMeta(i,{remove:{id:r}}))}).catch(u=>{console.error(u)}),!0};return new D({key:i,state:{init(){return C.empty},apply(e,t){let a=t.map(e.mapping,e.doc),r=e.getMeta(this);if(!r)return a;if(r.add){let{uploadWidgetFactory:s}=o.get(p.key),l=s(r.add.pos,{id:r.add.id});return a.add(e.doc,[l])}if(r.remove){let s=a.find(void 0,void 0,l=>l.id===r.remove.id);return a.remove(s)}return a}},props:{decorations(e){return this.getState(e)},handlePaste:(e,t)=>{let{enableHtmlFileUploader:a}=o.get(p.key);return!(t instanceof ClipboardEvent)||!a&&t.clipboardData?.getData("text/html")?!1:d(e,t,t.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent?d(e,t,t.dataTransfer?.files):!1}})});w.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var W=[p,w];export{E as defaultUploader,A as readImageAsBase64,W as upload,p as uploadConfig,w as uploadPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-6X7NT7KH.js";import"./chunk-XLIC2WFB.js";import"./chunk-SGGMD6DA.js";import"./chunk-23NN352E.js";export{b as Room,c as SignalingConn,a as WebrtcConn,d as WebrtcProvider};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as d,$a as da,Aa as E,Ab as Ea,Ba as F,Bb as Fa,Ca as G,Cb as Ga,Da as H,Db as Ha,Ea as I,Eb as Ia,Fa as J,Fb as Ja,Ga as K,Gb as Ka,Ha as L,Hb as La,Ia as M,Ib as Ma,Ja as N,Jb as Na,Ka as O,Kb as Oa,La as P,Lb as Pa,Ma as Q,Mb as Qa,Na as R,Nb as Ra,Oa as S,Ob as Sa,Pa as T,Pb as Ta,Qa as U,Qb as Ua,Ra as V,Rb as Va,Sa as W,Sb as Wa,Ta as X,Ua as Y,Va as Z,Wa as _,Xa as $,Y as a,Ya as aa,Z as b,Za as ba,_ as c,_a as ca,aa as e,ab as ea,ba as f,bb as fa,ca as g,cb as ga,da as h,db as ha,ea as i,eb as ia,fa as j,fb as ja,ga as k,gb as ka,ha as l,hb as la,ia as m,ib as ma,ja as n,jb as na,ka as o,kb as oa,la as p,lb as pa,ma as q,mb as qa,na as r,nb as ra,oa as s,ob as sa,pa as t,pb as ta,qa as u,qb as ua,ra as v,rb as va,sa as w,sb as wa,ta as x,tb as xa,ua as y,ub as ya,va as z,vb as za,wa as A,wb as Aa,xa as B,xb as Ba,ya as C,yb as Ca,za as D,zb as Da}from"./chunk-SGGMD6DA.js";import"./chunk-23NN352E.js";export{E as AbsolutePosition,a as AbstractConnector,Ka as AbstractStruct,ua as AbstractType,za as Array,Sa as ContentAny,Ma as ContentBinary,Na as ContentDeleted,Oa as ContentDoc,Pa as ContentEmbed,Qa as ContentFormat,Ra as ContentJSON,Ta as ContentString,Ua as ContentType,h as Doc,La as GC,u as ID,Va as Item,Ba as Map,A as PermanentUserData,B as RelativePosition,Wa as Skip,K as Snapshot,Ea as Text,_ as Transaction,ba as UndoManager,i as UpdateDecoderV1,j as UpdateDecoderV2,k as UpdateEncoderV1,l as UpdateEncoderV2,Ga as XmlElement,Fa as XmlFragment,Ia as XmlHook,Ja as XmlText,ya as YArrayEvent,sa as YEvent,Aa as YMapEvent,Da as YTextEvent,Ha as YXmlEvent,p as applyUpdate,o as applyUpdateV2,Ca as cleanupYTextFormatting,v as compareIDs,J as compareRelativePositions,qa as convertUpdateFormatV1ToV2,ra as convertUpdateFormatV2ToV1,I as createAbsolutePositionFromRelativePosition,e as createDeleteSet,f as createDeleteSetFromStructStore,T as createDocFromSnapshot,w as createID,D as createRelativePositionFromJSON,F as createRelativePositionFromTypeIndex,Q as createSnapshot,H as decodeRelativePosition,P as decodeSnapshot,O as decodeSnapshotV2,s as decodeStateVector,ea as decodeUpdate,fa as decodeUpdateV2,na as diffUpdate,ma as diffUpdateV2,R as emptySnapshot,G as encodeRelativePosition,N as encodeSnapshot,M as encodeSnapshotV2,r as encodeStateAsUpdate,q as encodeStateAsUpdateV2,t as encodeStateVector,ia as encodeStateVectorFromUpdate,ha as encodeStateVectorFromUpdateV2,g as equalDeleteSets,L as equalSnapshots,W as findIndexSS,x as findRootTypeKey,X as getItem,Z as getItemCleanEnd,Y as getItemCleanStart,V as getState,ta as getTypeChildren,c as isDeleted,y as isParentOf,b as iterateDeletedStructs,z as logType,ca as logUpdate,da as logUpdateV2,d as mergeDeleteSets,ga as mergeUpdates,la as mergeUpdatesV2,oa as obfuscateUpdate,pa as obfuscateUpdateV2,ka as parseUpdateMeta,ja as parseUpdateMetaV2,n as readUpdate,m as readUpdateV2,C as relativePositionToJSON,S as snapshot,U as snapshotContainsUpdate,aa as transact,$ as tryGc,va as typeListToArraySnapshot,xa as typeMapGetAllSnapshot,wa as typeMapGetSnapshot};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|