1?"-"+o:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:A.footnoteBackLabel},children:[{type:"text",value:"↩"}]};o>1&&E.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(o)}]}),a.length>0&&a.push({type:"text",value:" "}),a.push(E)}const s=r[r.length-1];if(s&&s.type==="element"&&s.tagName==="p"){const E=s.children[s.children.length-1];E&&E.type==="text"?E.value+=" ":s.children.push({type:"text",value:" "}),s.children.push(...a)}else r.push(...a);const B={type:"element",tagName:"li",properties:{id:A.clobberPrefix+"fn-"+i},children:A.wrap(r,!0)};A.patch(n,B),e.push(B)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(A.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:A.footnoteLabel}]},{type:"text",value:`
+`},{type:"element",tagName:"ol",properties:{},children:A.wrap(e,!0)},{type:"text",value:`
+`}]}}function Um(A,e){const t=Lm(A,e),n=t.one(A,null),r=Gm(t);return r&&n.children.push({type:"text",value:`
+`},r),Array.isArray(n)?{type:"root",children:n}:n}function xm(A={}){const e={...A};let t;typeof e.sanitize=="boolean"&&(t=e.sanitize,e.sanitize=void 0),typeof t!="boolean"&&(t=!0),Object.assign(this,{Compiler:n});function n(r,g){const i=Um(r,{allowDangerousHtml:!t,handlers:e.handlers}),o=t?_0(i,e.sanitize):i,a=K0(o,Object.assign({},e,{allowDangerousHtml:!t}));return g.extname&&(g.extname=".html"),r&&r.type&&r.type==="root"&&a&&/[^\r\n]/.test(a.charAt(a.length-1))?a+`
+`:a}}const Jm=qw().use(xm);function Bs(A,e){const t=Jm.processSync(A).toString().replace(/\n\n/g,`
+`);return e?t.trim().replace(/^/,"").replace(/<\/p>$/,""):t}const Hm={ref:"output",class:"md-output"},vm=Me("div",null,[Me("b",null,"Story Output:")],-1),Km={class:"output-container"},Ym={class:"lines"},qm=["innerHTML"],Tm=["onClick","innerHTML"],_m=Me("div",null,"~~ ended ~~",-1),Pm=hB({__name:"MdExample",props:{height:{},autoScroll:{type:Boolean},markdown:{}},setup(A){const e=A,{isDark:t}=fB(),n=$e("");dB(()=>e.markdown,d=>{d!==void 0&&o(d)});const r=new nC,g=$e([]);function i(d){g.value=d.messages.map(F=>{var L,N;return{from:((L=F.position)==null?void 0:L.start.offset)??0,to:((N=F.position)==null?void 0:N.end.offset)??0,severity:"error",message:F.message}})}async function o(d){if(d.trim()!==""){n.value=d,m();try{const F=await Qp().compileAll("main",async()=>d);i(F),await r.loadStory(F.toString().trim()),U(10)}catch(F){console.log(d),console.log(F)}}}const a=sp(o,1e3),s=$e(),B=$e();let E=null,u=null;const l=$e(!1);function k(d){var F;if(s.value&&(l.value||d)){const L=(F=s.value)==null?void 0:F.querySelector("pre");o(e.markdown??(L?L.innerText:"")),l.value=!0}}pB(()=>{s.value&&(E=new MutationObserver(()=>k()),E.observe(s.value,{subtree:!0,childList:!0,characterData:!0})),B.value&&(u=new IntersectionObserver(d=>{var F;(F=d[0])!=null&&F.isIntersecting&&(u==null||u.disconnect(),u=null,k(!0))},{threshold:0}),u.observe(B.value))}),DB(()=>{E==null||E.disconnect(),E=null,u==null||u.disconnect(),u=null});const p=$e(!0),w=$e(!1),y=$e([]),H=$e([]);function m(){p.value=!0,w.value=!1,y.value=[],H.value=[]}function U(d,F){if(!p.value)return;function L(N,V){const M=Y(V);NL(N+1),1):p.value=!0}p.value=!1,L(0,F)}function Y(d){if(!r.isLoaded())return!1;d&&(H.value=[]);const F=r.next(d);if(!F)return w.value=!0,!1;if(F.text){const L=F;return L.tags=typeof L.tags=="boolean"?{}:L.tags,y.value.push(L),!0}else if(F.select)return H.value=F.select,!1;return!1}return(d,F)=>{const L=yB("brocatel-editor");return ht(),ft(sg,null,[Me("pre",{ref_key:"defaultText",ref:s,style:{display:"none"}},[wB(d.$slots,"default")],512),l.value?(ht(),ft("div",{key:0,class:"md-example",style:Ig({height:e.height})},[Tn(L,{modelValue:n.value,plainText:!1,diagnostics:g.value,"dark-mode":Cn(t),"onUpdate:modelValue":F[0]||(F[0]=N=>Cn(a)(N))},null,8,["modelValue","diagnostics","dark-mode"]),Me("div",Hm,[vm,Me("div",Km,[Me("div",Ym,[Tn(mB,null,{default:ag(()=>[(ht(!0),ft(sg,null,eI(y.value,(N,V)=>(ht(),ft("p",{key:V,innerHTML:Cn(Bs)(N.text),style:Ig(N.tags===!0?{}:N.tags)},null,12,qm))),128))]),_:1})]),Tn(tI,null,{default:ag(()=>[Cg(Me("div",null,[(ht(!0),ft(sg,null,eI(H.value,N=>(ht(),ft("button",{key:N.option.text,onClick:V=>U(10,N.key),innerHTML:Cn(Bs)(N.option.text,!0),style:Ig(N.option.tags===!0?{}:N.option.tags)},null,12,Tm))),128))],512),[[Qg,H.value.length>0]])]),_:1}),Cg(Me("button",{onClick:F[1]||(F[1]=N=>U(10))}," Next Few Lines ",512),[[Qg,H.value.length===0&&Cn(r)&&p.value&&!w.value]]),Tn(tI,null,{default:ag(()=>[Cg(Me("div",null,[_m,Me("button",{onClick:F[2]||(F[2]=N=>o(n.value))},"Restart")],512),[[Qg,w.value]])]),_:1})])],512)],4)):(ht(),ft("button",{key:1,ref_key:"hindsight",ref:B,onClick:F[3]||(F[3]=N=>k(!0))},"Load Example",512))],64)}}});export{Pm as default};
diff --git a/assets/chunks/brocatel-mde.es.Bo8dZpIJ.js b/assets/chunks/brocatel-mde.es.Bo8dZpIJ.js
new file mode 100644
index 0000000..a2a87a4
--- /dev/null
+++ b/assets/chunks/brocatel-mde.es.Bo8dZpIJ.js
@@ -0,0 +1,115 @@
+import{d as Vt,H as gi,O as go,k as Ns,aj as WA,l as Dw,y as dr,ak as jA,ai as Tw,o as yr,b as Pw,w as lf,J as wt,p as Se,h as Jt,Y as Ki,F as cm,U as UA,c as yi,n as sl,m as Ce,a as vl,t as Wc,e as jc,al as $h,am as Ah,an as Mu,ao as _A,A as Ew,ap as GA,K as HA,aq as um,ar as KA,Q as JA}from"./framework.tOI-YKg8.js";var BO={},Pt=(r=>(r.docTypeError="docTypeError",r.contextNotFound="contextNotFound",r.timerNotFound="timerNotFound",r.ctxCallOutOfScope="ctxCallOutOfScope",r.createNodeInParserFail="createNodeInParserFail",r.stackOverFlow="stackOverFlow",r.parserMatchError="parserMatchError",r.serializerMatchError="serializerMatchError",r.getAtomFromSchemaFail="getAtomFromSchemaFail",r.expectDomTypeError="expectDomTypeError",r.callCommandBeforeEditorView="callCommandBeforeEditorView",r.missingRootElement="missingRootElement",r.missingNodeInSchema="missingNodeInSchema",r.missingMarkInSchema="missingMarkInSchema",r.ctxNotBind="ctxNotBind",r.missingYjsDoc="missingYjsDoc",r))(Pt||{});let zt=class extends Error{constructor(r,e){super(e),this.name="MilkdownError",this.code=r}};const eD=(r,e)=>typeof e=="function"?"[Function]":e,Ks=r=>JSON.stringify(r,eD),tD=r=>new zt(Pt.docTypeError,`Doc type error, unsupported type: ${Ks(r)}`),rD=r=>new zt(Pt.contextNotFound,`Context "${r}" not found, do you forget to inject it?`),iD=r=>new zt(Pt.timerNotFound,`Timer "${r}" not found, do you forget to record it?`),hm=()=>new zt(Pt.ctxCallOutOfScope,"Should not call a context out of the plugin."),nD=(...r)=>{const e=r.reduce((t,i)=>{if(!i)return t;const n=s=>Array.isArray(s)?s.map(o=>n(o)).join(", "):s.toJSON?Ks(s.toJSON()):s.spec?Ks(s.spec):s.toString();return`${t}, ${n(i)}`},"Create prosemirror node from remark failed in parser");return new zt(Pt.createNodeInParserFail,e)},Mw=()=>new zt(Pt.stackOverFlow,"Stack over flow, cannot pop on an empty stack."),sD=r=>new zt(Pt.parserMatchError,`Cannot match target parser for node: ${Ks(r)}.`),oD=r=>new zt(Pt.serializerMatchError,`Cannot match target serializer for node: ${Ks(r)}.`),aD=(r,e)=>new zt(Pt.getAtomFromSchemaFail,`Cannot get ${r}: ${e} from schema.`),ds=r=>new zt(Pt.expectDomTypeError,`Expect to be a dom, but get: ${Ks(r)}.`),lD=()=>new zt(Pt.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized"),cD=r=>new zt(Pt.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${r}" in schema.`),uD=r=>new zt(Pt.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${r}" in schema.`);var Rw=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(Rw(r,e,"read from private field"),t?t.call(r):e.get(r)),Re=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},ce=(r,e,t,i)=>(Rw(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);let Zw=class{constructor(){this.sliceMap=new Map,this.get=r=>{const e=typeof r=="string"?[...this.sliceMap.values()].find(t=>t.type.name===r):this.sliceMap.get(r.id);if(!e){const t=typeof r=="string"?r:r.name;throw rD(t)}return e},this.remove=r=>{const e=typeof r=="string"?[...this.sliceMap.values()].find(t=>t.type.name===r):this.sliceMap.get(r.id);e&&this.sliceMap.delete(e.type.id)},this.has=r=>typeof r=="string"?[...this.sliceMap.values()].some(e=>e.type.name===r):this.sliceMap.has(r.id)}};var Rr,Pi,Yo;let hD=class{constructor(r,e,t){Re(this,Rr,void 0),Re(this,Pi,void 0),Re(this,Yo,void 0),ce(this,Rr,[]),ce(this,Yo,()=>{j(this,Rr).forEach(i=>i(j(this,Pi)))}),this.set=i=>{ce(this,Pi,i),j(this,Yo).call(this)},this.get=()=>j(this,Pi),this.update=i=>{ce(this,Pi,i(j(this,Pi))),j(this,Yo).call(this)},this.type=t,ce(this,Pi,e),r.set(t.id,this)}on(r){return j(this,Rr).push(r),()=>{ce(this,Rr,j(this,Rr).filter(e=>e!==r))}}once(r){const e=this.on(t=>{r(t),e()});return e}off(r){ce(this,Rr,j(this,Rr).filter(e=>e!==r))}offAll(){ce(this,Rr,[])}};Rr=new WeakMap,Pi=new WeakMap,Yo=new WeakMap;let dD=class{constructor(r,e){this.id=Symbol(`Context-${e}`),this.name=e,this._defaultValue=r,this._typeInfo=()=>{throw hm()}}create(r,e=this._defaultValue){return new hD(r,e,this)}};const he=(r,e)=>new dD(r,e);var ec,tc,rc,xs,Vo,An,zo,Wo,jo;let fD=class{constructor(r,e,t){Re(this,ec,void 0),Re(this,tc,void 0),Re(this,rc,void 0),Re(this,xs,void 0),Re(this,Vo,void 0),Re(this,An,void 0),Re(this,zo,void 0),Re(this,Wo,void 0),Re(this,jo,void 0),ce(this,xs,new Set),ce(this,Vo,new Set),ce(this,An,new Map),ce(this,zo,new Map),this.read=()=>({metadata:j(this,ec),injectedSlices:[...j(this,xs)].map(i=>({name:typeof i=="string"?i:i.name,value:j(this,Wo).call(this,i)})),consumedSlices:[...j(this,Vo)].map(i=>({name:typeof i=="string"?i:i.name,value:j(this,Wo).call(this,i)})),recordedTimers:[...j(this,An)].map(([i,{duration:n}])=>({name:i.name,duration:n,status:j(this,jo).call(this,i)})),waitTimers:[...j(this,zo)].map(([i,{duration:n}])=>({name:i.name,duration:n,status:j(this,jo).call(this,i)}))}),this.onRecord=i=>{j(this,An).set(i,{start:Date.now(),duration:0})},this.onClear=i=>{j(this,An).delete(i)},this.onDone=i=>{const n=j(this,An).get(i);n&&(n.duration=Date.now()-n.start)},this.onWait=(i,n)=>{const s=Date.now();n.finally(()=>{j(this,zo).set(i,{duration:Date.now()-s})})},this.onInject=i=>{j(this,xs).add(i)},this.onRemove=i=>{j(this,xs).delete(i)},this.onUse=i=>{j(this,Vo).add(i)},ce(this,Wo,i=>j(this,tc).get(i).get()),ce(this,jo,i=>j(this,rc).get(i).status),ce(this,tc,r),ce(this,rc,e),ce(this,ec,t)}};ec=new WeakMap,tc=new WeakMap,rc=new WeakMap,xs=new WeakMap,Vo=new WeakMap,An=new WeakMap,zo=new WeakMap,Wo=new WeakMap,jo=new WeakMap;var Ei,Mi,ic,hr;const Nw=class{constructor(r,e,t){Re(this,Ei,void 0),Re(this,Mi,void 0),Re(this,ic,void 0),Re(this,hr,void 0),this.produce=i=>i&&Object.keys(i).length?new Nw(j(this,Ei),j(this,Mi),{...i}):this,this.inject=(i,n)=>{var s;const o=i.create(j(this,Ei).sliceMap);return n!=null&&o.set(n),(s=j(this,hr))==null||s.onInject(i),this},this.remove=i=>{var n;return j(this,Ei).remove(i),(n=j(this,hr))==null||n.onRemove(i),this},this.record=i=>{var n;return i.create(j(this,Mi).store),(n=j(this,hr))==null||n.onRecord(i),this},this.clearTimer=i=>{var n;return j(this,Mi).remove(i),(n=j(this,hr))==null||n.onClear(i),this},this.isInjected=i=>j(this,Ei).has(i),this.isRecorded=i=>j(this,Mi).has(i),this.use=i=>{var n;return(n=j(this,hr))==null||n.onUse(i),j(this,Ei).get(i)},this.get=i=>this.use(i).get(),this.set=(i,n)=>this.use(i).set(n),this.update=(i,n)=>this.use(i).update(n),this.timer=i=>j(this,Mi).get(i),this.done=i=>{var n;this.timer(i).done(),(n=j(this,hr))==null||n.onDone(i)},this.wait=i=>{var n;const s=this.timer(i).start();return(n=j(this,hr))==null||n.onWait(i,s),s},this.waitTimers=async i=>{await Promise.all(this.get(i).map(n=>this.wait(n)))},ce(this,Ei,r),ce(this,Mi,e),ce(this,ic,t),t&&ce(this,hr,new fD(r,e,t))}get meta(){return j(this,ic)}get inspector(){return j(this,hr)}};let pD=Nw;Ei=new WeakMap,Mi=new WeakMap,ic=new WeakMap,hr=new WeakMap;let mD=class{constructor(){this.store=new Map,this.get=r=>{const e=this.store.get(r.id);if(!e)throw iD(r.name);return e},this.remove=r=>{this.store.delete(r.id)},this.has=r=>this.store.has(r.id)}};var Ss,Dn,Uo,Ri,_o,nc;let gD=class{constructor(r,e){Re(this,Ss,void 0),Re(this,Dn,void 0),Re(this,Uo,void 0),Re(this,Ri,void 0),Re(this,_o,void 0),Re(this,nc,void 0),ce(this,Ss,null),ce(this,Dn,null),ce(this,Ri,"pending"),this.start=()=>(j(this,Ss)??ce(this,Ss,new Promise((t,i)=>{ce(this,Dn,n=>{n instanceof CustomEvent&&n.detail.id===j(this,Uo)&&(ce(this,Ri,"resolved"),j(this,_o).call(this),n.stopImmediatePropagation(),t())}),j(this,nc).call(this,()=>{j(this,Ri)==="pending"&&ce(this,Ri,"rejected"),j(this,_o).call(this),i(new Error(`Timing ${this.type.name} timeout.`))}),ce(this,Ri,"pending"),addEventListener(this.type.name,j(this,Dn))})),j(this,Ss)),this.done=()=>{const t=new CustomEvent(this.type.name,{detail:{id:j(this,Uo)}});dispatchEvent(t)},ce(this,_o,()=>{j(this,Dn)&&removeEventListener(this.type.name,j(this,Dn))}),ce(this,nc,t=>{setTimeout(()=>{t()},this.type.timeout)}),ce(this,Uo,Symbol(e.name)),this.type=e,r.set(e.id,this)}get status(){return j(this,Ri)}};Ss=new WeakMap,Dn=new WeakMap,Uo=new WeakMap,Ri=new WeakMap,_o=new WeakMap,nc=new WeakMap;let OD=class{constructor(r,e=3e3){this.create=t=>new gD(t,this),this.id=Symbol(`Timer-${r}`),this.name=r,this.timeout=e}};const mn=(r,e=3e3)=>new OD(r,e);function Ke(r){this.content=r}Ke.prototype={constructor:Ke,find:function(r){for(var e=0;e>1}};Ke.from=function(r){if(r instanceof Ke)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ke(e)};function Fw(r,e,t){for(let i=0;;i++){if(i==r.childCount||i==e.childCount)return r.childCount==e.childCount?null:t;let n=r.child(i),s=e.child(i);if(n==s){t+=n.nodeSize;continue}if(!n.sameMarkup(s))return t;if(n.isText&&n.text!=s.text){for(let o=0;n.text[o]==s.text[o];o++)t++;return t}if(n.content.size||s.content.size){let o=Fw(n.content,s.content,t+1);if(o!=null)return o}t+=n.nodeSize}}function Iw(r,e,t,i){for(let n=r.childCount,s=e.childCount;;){if(n==0||s==0)return n==s?null:{a:t,b:i};let o=r.child(--n),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,i-=l;continue}if(!o.sameMarkup(a))return{a:t,b:i};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;ce&&i(l,n+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),i,n+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,n){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{a.isText?(s+=a.text.slice(Math.max(e,l)-l,t-l),o=!i):a.isLeaf?(n?s+=typeof n=="function"?n(a):n:a.type.spec.leafText&&(s+=a.type.spec.leafText(a)),o=!i):!o&&a.isBlock&&(s+=i,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,n=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(i)&&(n[n.length-1]=t.withText(t.text+i.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),i.push(a),n+=a.nodeSize),o=l}return new Z(i,n)}cutByIndex(e,t){return e==t?Z.empty:e==0&&t==this.content.length?this:new Z(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let n=this.content.slice(),s=this.size+t.nodeSize-i.nodeSize;return n[e]=t,new Z(n,s)}addToStart(e){return new Z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let i=0,n=0;;i++){let s=this.child(i),o=n+s.nodeSize;if(o>=e)return o==e||t>0?kl(i+1,o):kl(i,n);n=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Z.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Z(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Z.empty;let t,i=0;for(let n=0;nthis.type.rank&&(t||(t=e.slice(0,n)),t.push(this),i=!0),t&&t.push(s)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;ti.type.rank-n.type.rank),t}}ae.none=[];class _c extends Error{}class L{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=qw(this.content,e+this.openStart,t);return i&&new L(i,this.openStart,this.openEnd)}removeBetween(e,t){return new L(Bw(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return L.empty;let i=t.openStart||0,n=t.openEnd||0;if(typeof i!="number"||typeof n!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new L(Z.fromJSON(e,t.content),i,n)}static maxOpen(e,t=!0){let i=0,n=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)n++;return new L(e,i,n)}}L.empty=new L(Z.empty,0,0);function Bw(r,e,t){let{index:i,offset:n}=r.findIndex(e),s=r.maybeChild(i),{index:o,offset:a}=r.findIndex(t);if(n==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(i!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(i,s.copy(Bw(s.content,e-n-1,t-n-1)))}function qw(r,e,t,i){let{index:n,offset:s}=r.findIndex(e),o=r.maybeChild(n);if(s==e||o.isText)return i&&!i.canReplace(n,n,t)?null:r.cut(0,e).append(t).append(r.cut(e));let a=qw(o.content,e-s-1,t);return a&&r.replaceChild(n,o.copy(a))}function yD(r,e,t){if(t.openStart>r.depth)throw new _c("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new _c("Inconsistent open depths");return Lw(r,e,t,0)}function Lw(r,e,t,i){let n=r.index(i),s=r.node(i);if(n==e.index(i)&&i=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function da(r,e,t,i){let n=(e||r).node(t),s=0,o=e?e.index(t):n.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(zn(r.nodeAfter,i),s++));for(let a=s;an&&cf(r,e,n+1),o=i.depth>n&&cf(t,i,n+1),a=[];return da(null,r,n,a),s&&o&&e.index(n)==t.index(n)?(Xw(s,o),zn(Wn(s,Yw(r,e,t,i,n+1)),a)):(s&&zn(Wn(s,Gc(r,e,n+1)),a),da(e,t,n,a),o&&zn(Wn(o,Gc(t,i,n+1)),a)),da(i,null,n,a),new Z(a)}function Gc(r,e,t){let i=[];if(da(null,r,t,i),r.depth>t){let n=cf(r,e,t+1);zn(Wn(n,Gc(r,e,t+1)),i)}return da(e,null,t,i),new Z(i)}function bD(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let n=t-1;n>=0;n--)i=e.node(n).copy(Z.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Ta{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],n=e.child(t);return i?e.child(t).cut(i):n}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],n=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Vw(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],n=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(i.push(o,a,n+l),!c||(o=o.child(a),o.isText))break;s=c-1,n+=l+1}return new Ta(t,i,s)}static resolveCached(e,t){for(let n=0;ne&&this.nodesBetween(e,t,s=>(i.isInSet(s.marks)&&(n=!0),!n)),n}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),zw(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=Z.empty,n=0,s=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,n,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=n;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let n=Z.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,n,i)}}br.prototype.text=void 0;let kD=class uf extends br{constructor(e,t,i,n){if(super(e,t,null,n),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new uf(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new uf(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function zw(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class es{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new xD(e,t);if(i.next==null)return es.empty;let n=Ww(i);i.next&&i.err("Unexpected trailing text");let s=TD(DD(n));return PD(s,i),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let n=0;n{let s=n+(i.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(i.next[o].next);return s}).join(`
+`)}}es.empty=new es(!0);class xD{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ww(r){let e=[];do e.push(SD(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function SD(r){let e=[];do e.push(CD(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function CD(r){let e=AD(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=QD(r,e);else break;return e}function qO(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function QD(r,e){let t=qO(r),i=t;return r.eat(",")&&(r.next!="}"?i=qO(r):i=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function $D(r,e){let t=r.nodeTypes,i=t[e];if(i)return[i];let n=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&n.push(o)}return n.length==0&&r.err("No node type or group '"+e+"' found"),n}function AD(r){if(r.eat("(")){let e=Ww(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=$D(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function DD(r){let e=[[]];return n(s(r,0),t()),e;function t(){return e.push([])-1}function i(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function n(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;n(c,a=t())}else if(o.type=="star"){let l=t();return i(a,l),n(s(o.expr,l),l),[i(l)]}else if(o.type=="plus"){let l=t();return n(s(o.expr,a),l),n(s(o.expr,l),l),[i(l)]}else{if(o.type=="opt")return[i(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c{r[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||n.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[i.join(",")]=new es(i.indexOf(r.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;ti[s]=new Hw(s,t,o));let n=t.spec.topNode||"doc";if(!i[n])throw new RangeError("Schema is missing its top node type ('"+n+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}},ED=class{constructor(r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default}get isRequired(){return!this.hasDefault}};class Ru{constructor(e,t,i,n){this.name=e,this.rank=t,this.schema=i,this.spec=n,this.attrs=Gw(n.attrs),this.excluded=null;let s=Uw(this.attrs);this.instance=s?new ae(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ae(this,_w(this.attrs,e))}static compile(e,t){let i=Object.create(null),n=0;return e.forEach((s,o)=>i[s]=new Ru(s,n++,t,o)),i}removeFromSet(e){for(var t=0;t-1}}let MD=class{constructor(r){this.cached=Object.create(null);let e=this.spec={};for(let i in r)e[i]=r[i];e.nodes=Ke.from(r.nodes),e.marks=Ke.from(r.marks||{}),this.nodes=Hc.compile(this.spec.nodes,this),this.marks=Ru.compile(this.spec.marks,this);let t=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let n=this.nodes[i],s=n.spec.content||"",o=n.spec.marks;n.contentMatch=t[s]||(t[s]=es.parse(s,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet=o=="_"?null:o?XO(this,o.split(" ")):o==""||!n.inlineContent?[]:null}for(let i in this.marks){let n=this.marks[i],s=n.spec.excludes;n.excluded=s==null?[n]:s==""?[]:XO(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(r,e=null,t,i){if(typeof r=="string")r=this.nodeType(r);else if(r instanceof Hc){if(r.schema!=this)throw new RangeError("Node type from different schema used ("+r.name+")")}else throw new RangeError("Invalid node type: "+r);return r.createChecked(e,t,i)}text(r,e){let t=this.nodes.text;return new kD(t,t.defaultAttrs,r,ae.setFrom(e))}mark(r,e){return typeof r=="string"&&(r=this.marks[r]),r.create(e)}nodeFromJSON(r){return br.fromJSON(this,r)}markFromJSON(r){return ae.fromJSON(this,r)}nodeType(r){let e=this.nodes[r];if(!e)throw new RangeError("Unknown node type: "+r);return e}};function XO(r,e){let t=[];for(let i=0;i-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}class ts{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(i=>{i.tag?this.tags.push(i):i.style&&this.styles.push(i)}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let n=e.nodes[i.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let i=new VO(this,t,!1);return i.addAll(e,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new VO(this,t,!0);return i.addAll(e,t.from,t.to),L.maxOpen(i.finish())}matchTag(e,t,i){for(let n=i?this.tags.indexOf(i)+1:0;ne.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function i(n){let s=n.priority==null?50:n.priority,o=0;for(;o{i(o=zO(o)),o.mark||o.ignore||o.clearMark||(o.mark=n)})}for(let n in e.nodes){let s=e.nodes[n].spec.parseDOM;s&&s.forEach(o=>{i(o=zO(o)),o.node||o.ignore||o.mark||(o.node=n)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ts(e,ts.schemaRules(e)))}}const Kw={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},RD={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jw={ol:!0,ul:!0},Kc=1,Jc=2,fa=4;function YO(r,e,t){return e!=null?(e?Kc:0)|(e==="full"?Jc:0):r&&r.whitespace=="pre"?Kc|Jc:t&~fa}class xl{constructor(e,t,i,n,s,o,a){this.type=e,this.attrs=t,this.marks=i,this.pendingMarks=n,this.solid=s,this.options=a,this.content=[],this.activeMarks=ae.none,this.stashMarks=[],this.match=o||(a&fa?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Z.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,n;return(n=i.findWrapping(e.type))?(this.match=i,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Kc)){let i=this.content[this.content.length-1],n;if(i&&i.isText&&(n=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-n[0].length))}}let t=Z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Z.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,i=this.pendingMarks;tthis.addAll(r)),s&&this.sync(o),this.needsBlock=a}else this.withStyleRules(r,()=>{this.addElementByRule(r,n,n.consuming===!1?i:void 0)})}leafFallback(r){r.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(r.ownerDocument.createTextNode(`
+`))}ignoreFallback(r){r.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(r){let e=ae.none,t=ae.none;for(let i=0;i{s.clearMark(o)&&(t=o.addToSet(t))}):e=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(e),s.consuming===!1)n=s;else break}return[e,t]}addElementByRule(r,e,t){let i,n,s;e.node?(n=this.parser.schema.nodes[e.node],n.isLeaf?this.insertNode(n.create(e.attrs))||this.leafFallback(r):i=this.enter(n,e.attrs||null,e.preserveWhitespace)):(s=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(s));let o=this.top;if(n&&n.isLeaf)this.findInside(r);else if(t)this.addElement(r,t);else if(e.getContent)this.findInside(r),e.getContent(r,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=r;typeof e.contentElement=="string"?a=r.querySelector(e.contentElement):typeof e.contentElement=="function"?a=e.contentElement(r):e.contentElement&&(a=e.contentElement),this.findAround(r,a,!0),this.addAll(a)}i&&this.sync(o)&&this.open--,s&&this.removePendingMark(s,o)}addAll(r,e,t){let i=e||0;for(let n=e?r.childNodes[e]:r.firstChild,s=t==null?null:r.childNodes[t];n!=s;n=n.nextSibling,++i)this.findAtPoint(r,i),this.addDOM(n);this.findAtPoint(r,i)}findPlace(r){let e,t;for(let i=this.open;i>=0;i--){let n=this.nodes[i],s=n.findWrapping(r);if(s&&(!e||e.length>s.length)&&(e=s,t=n,!s.length)||n.solid)break}if(!e)return!1;this.sync(t);for(let i=0;ithis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(r));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(r){for(let e=this.open;e>=0;e--)if(this.nodes[e]==r)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let r=0;for(let e=this.open;e>=0;e--){let t=this.nodes[e].content;for(let i=t.length-1;i>=0;i--)r+=t[i].nodeSize;e&&r++}return r}findAtPoint(r,e){if(this.find)for(let t=0;t-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);let e=r.split("/"),t=this.options.context,i=!this.isOpen&&(!t||t.parent.type==this.nodes[0].type),n=-(t?t.depth+1:0)+(i?0:1),s=(o,a)=>{for(;o>=0;o--){let l=e[o];if(l==""){if(o==e.length-1||o==0)continue;for(;a>=n;a--)if(s(o-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:t&&a>=n?t.node(a-n).type:null;if(!c||c.name!=l&&c.groups.indexOf(l)==-1)return!1;a--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let r=this.options.context;if(r)for(let e=r.depth;e>=0;e--){let t=r.node(e).contentMatchAt(r.indexAfter(e)).defaultType;if(t&&t.isTextblock&&t.defaultAttrs)return t}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(r){let e=BD(r,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=r.addToSet(this.top.pendingMarks)}removePendingMark(r,e){for(let t=this.open;t>=0;t--){let i=this.nodes[t];if(i.pendingMarks.lastIndexOf(r)>-1)i.pendingMarks=r.removeFromSet(i.pendingMarks);else{i.activeMarks=r.removeFromSet(i.activeMarks);let n=i.popFromStashMark(r);n&&i.type&&i.type.allowsMarkType(n.type)&&(i.activeMarks=n.addToSet(i.activeMarks))}if(i==e)break}}};function ZD(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&Jw.hasOwnProperty(i)&&t?(t.appendChild(e),e=t):i=="li"?t=e:i&&(t=null)}}function ND(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function FD(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,i=[];for(;t=e.exec(r);)i.push(t[1],t[2].trim());return i}function zO(r){let e={};for(let t in r)e[t]=r[t];return e}function ID(r,e){let t=e.schema.nodes;for(let i in t){let n=t[i];if(!n.allowsMarkType(r))continue;let s=[],o=a=>{s.push(a);for(let l=0;l{if(s.length||o.marks.length){let a=0,l=0;for(;a=0;n--){let s=this.serializeMark(e.marks[n],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(e,t,i={}){let n=this.marks[e.type.name];return n&&Yr.renderSpec(Eh(i),n(e,t))}static renderSpec(e,t,i=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let n=t[0],s=n.indexOf(" ");s>0&&(i=n.slice(0,s),n=n.slice(s+1));let o,a=i?e.createElementNS(i,n):e.createElement(n),l=t[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let h=u.indexOf(" ");h>0?a.setAttributeNS(u.slice(0,h),u.slice(h+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:d,contentDOM:f}=Yr.renderSpec(e,h,i);if(a.appendChild(d),f){if(o)throw new RangeError("Multiple content holes");o=f}}}return{dom:a,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Yr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=WO(e.nodes);return t.text||(t.text=i=>i.text),t}static marksFromSchema(e){return WO(e.marks)}}function WO(r){let e={};for(let t in r){let i=r[t].spec.toDOM;i&&(e[t]=i)}return e}function Eh(r){return r.document||window.document}const qD={};function dm(r,e){const t=e||qD,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,n=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return ev(r,i,n)}function ev(r,e,t){if(LD(r)){if("value"in r)return r.type==="html"&&!t?"":r.value;if(e&&"alt"in r&&r.alt)return r.alt;if("children"in r)return jO(r.children,e,t)}return Array.isArray(r)?jO(r,e,t):""}function jO(r,e,t){const i=[];let n=-1;for(;++nn?0:n+e:e=e>n?n:e,t=t>0?t:0,i.length<1e4)o=Array.from(i),o.unshift(e,t),r.splice(...o);else for(t&&r.splice(e,t);s0?(Kr(r,r.length,0,e),r):e}const UO={}.hasOwnProperty;function XD(r){const e={};let t=-1;for(;++to))return;const x=e.events.length;let R=x,P,B;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){if(P){B=e.events[R][1].end;break}P=!0}for(O(i),b=x;bv;){const Q=t[C];e.containerState=Q[1],Q[0].exit.call(e,r)}t.length=v}function w(){n.write([null]),s=void 0,n=void 0,e.containerState._closeFlow=void 0}}function tT(r,e,t){return ve(r,r.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function GO(r){if(r===null||Dt(r)||GD(r))return 1;if(_D(r))return 2}function fm(r,e,t){const i=[];let n=-1;for(;++n1&&r[t][1].end.offset-r[t][1].start.offset>1?2:1;const h=Object.assign({},r[i][1].end),d=Object.assign({},r[t][1].start);HO(h,-l),HO(d,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},r[i][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},r[t][1].start),end:d},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},r[i][1].end),end:Object.assign({},r[t][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},r[i][1].end=Object.assign({},o.start),r[t][1].start=Object.assign({},a.end),c=[],r[i][1].end.offset-r[i][1].start.offset&&(c=Gt(c,[["enter",r[i][1],e],["exit",r[i][1],e]])),c=Gt(c,[["enter",n,e],["enter",o,e],["exit",o,e],["enter",s,e]]),c=Gt(c,fm(e.parser.constructs.insideSpan.null,r.slice(i+1,t),e)),c=Gt(c,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",n,e]]),r[t][1].end.offset-r[t][1].start.offset?(u=2,c=Gt(c,[["enter",r[t][1],e],["exit",r[t][1],e]])):u=0,Kr(r,i-1,t-i+3,c),t=i+c.length-u-2;break}}for(t=-1;++t",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"",InvisibleTimes:"",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
+`,Nfr:"𝔑",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"",zwnj:""},hT={}.hasOwnProperty;function pm(r){return hT.call(KO,r)?KO[r]:!1}const iv={name:"characterReference",tokenize:dT};function dT(r,e,t){const i=this;let n=0,s,o;return a;function a(h){return r.enter("characterReference"),r.enter("characterReferenceMarker"),r.consume(h),r.exit("characterReferenceMarker"),l}function l(h){return h===35?(r.enter("characterReferenceMarkerNumeric"),r.consume(h),r.exit("characterReferenceMarkerNumeric"),c):(r.enter("characterReferenceValue"),s=31,o=Or,u(h))}function c(h){return h===88||h===120?(r.enter("characterReferenceMarkerHexadecimal"),r.consume(h),r.exit("characterReferenceMarkerHexadecimal"),r.enter("characterReferenceValue"),s=6,o=jD,u):(r.enter("characterReferenceValue"),s=7,o=df,u(h))}function u(h){if(h===59&&n){const d=r.exit("characterReferenceValue");return o===Or&&!pm(i.sliceSerialize(d))?t(h):(r.enter("characterReferenceMarker"),r.consume(h),r.exit("characterReferenceMarker"),r.exit("characterReference"),e)}return o(h)&&n++0&&fe(b)?ve(r,w,"linePrefix",s+1)(b):w(b)}function w(b){return b===null||H(b)?r.check(JO,m,C)(b):(r.enter("codeFlowValue"),v(b))}function v(b){return b===null||H(b)?(r.exit("codeFlowValue"),w(b)):(r.consume(b),v)}function C(b){return r.exit("codeFenced"),e(b)}function Q(b,x,R){let P=0;return B;function B($){return b.enter("lineEnding"),b.consume($),b.exit("lineEnding"),E}function E($){return b.enter("codeFencedFence"),fe($)?ve(b,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):A($)}function A($){return $===a?(b.enter("codeFencedFenceSequence"),z($)):R($)}function z($){return $===a?(P++,b.consume($),z):P>=o?(b.exit("codeFencedFenceSequence"),fe($)?ve(b,X,"whitespace")($):X($)):R($)}function X($){return $===null||H($)?(b.exit("codeFencedFence"),x($)):R($)}}}function pT(r,e,t){const i=this;return n;function n(o){return o===null?t(o):(r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?t(o):e(o)}}const Mh={name:"codeIndented",tokenize:gT},mT={tokenize:OT,partial:!0};function gT(r,e,t){const i=this;return n;function n(c){return r.enter("codeIndented"),ve(r,s,"linePrefix",5)(c)}function s(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?l(c):H(c)?r.attempt(mT,o,l)(c):(r.enter("codeFlowValue"),a(c))}function a(c){return c===null||H(c)?(r.exit("codeFlowValue"),o(c)):(r.consume(c),a)}function l(c){return r.exit("codeIndented"),e(c)}}function OT(r,e,t){const i=this;return n;function n(o){return i.parser.lazy[i.now().line]?t(o):H(o)?(r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),n):ve(r,s,"linePrefix",5)(o)}function s(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):H(o)?n(o):t(o)}}const yT={name:"codeText",tokenize:vT,resolve:bT,previous:wT};function bT(r){let e=r.length-4,t=3,i,n;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(i=t;++i=4?e(o):r.interrupt(i.parser.constructs.flow,t,e)(o)}}function sv(r,e,t,i,n,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(O){return O===60?(r.enter(i),r.enter(n),r.enter(s),r.consume(O),r.exit(s),d):O===null||O===32||O===41||hf(O)?t(O):(r.enter(i),r.enter(o),r.enter(a),r.enter("chunkString",{contentType:"string"}),m(O))}function d(O){return O===62?(r.enter(s),r.consume(O),r.exit(s),r.exit(n),r.exit(i),e):(r.enter(a),r.enter("chunkString",{contentType:"string"}),f(O))}function f(O){return O===62?(r.exit("chunkString"),r.exit(a),d(O)):O===null||O===60||H(O)?t(O):(r.consume(O),O===92?p:f)}function p(O){return O===60||O===62||O===92?(r.consume(O),f):f(O)}function m(O){return!u&&(O===null||O===41||Dt(O))?(r.exit("chunkString"),r.exit(a),r.exit(o),r.exit(i),e(O)):u999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(r.exit(s),r.enter(n),r.consume(f),r.exit(n),r.exit(i),e):H(f)?(r.enter("lineEnding"),r.consume(f),r.exit("lineEnding"),u):(r.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||H(f)||a++>999?(r.exit("chunkString"),u(f)):(r.consume(f),l||(l=!fe(f)),f===92?d:h)}function d(f){return f===91||f===92||f===93?(r.consume(f),a++,h):h(f)}}function av(r,e,t,i,n,s){let o;return a;function a(d){return d===34||d===39||d===40?(r.enter(i),r.enter(n),r.consume(d),r.exit(n),o=d===40?41:d,l):t(d)}function l(d){return d===o?(r.enter(n),r.consume(d),r.exit(n),r.exit(i),e):(r.enter(s),c(d))}function c(d){return d===o?(r.exit(s),l(o)):d===null?t(d):H(d)?(r.enter("lineEnding"),r.consume(d),r.exit("lineEnding"),ve(r,c,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===o||d===null||H(d)?(r.exit("chunkString"),c(d)):(r.consume(d),d===92?h:u)}function h(d){return d===o||d===92?(r.consume(d),u):u(d)}}function pa(r,e){let t;return i;function i(n){return H(n)?(r.enter("lineEnding"),r.consume(n),r.exit("lineEnding"),t=!0,i):fe(n)?ve(r,i,t?"linePrefix":"lineSuffix")(n):e(n)}}function Fs(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const AT={name:"definition",tokenize:TT},DT={tokenize:PT,partial:!0};function TT(r,e,t){const i=this;let n;return s;function s(f){return r.enter("definition"),o(f)}function o(f){return ov.call(i,r,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return n=Fs(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(r.enter("definitionMarker"),r.consume(f),r.exit("definitionMarker"),l):t(f)}function l(f){return Dt(f)?pa(r,c)(f):c(f)}function c(f){return sv(r,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return r.attempt(DT,h,h)(f)}function h(f){return fe(f)?ve(r,d,"whitespace")(f):d(f)}function d(f){return f===null||H(f)?(r.exit("definition"),i.parser.defined.push(n),e(f)):t(f)}}function PT(r,e,t){return i;function i(a){return Dt(a)?pa(r,n)(a):t(a)}function n(a){return av(r,s,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return fe(a)?ve(r,o,"whitespace")(a):o(a)}function o(a){return a===null||H(a)?e(a):t(a)}}const ET={name:"hardBreakEscape",tokenize:MT};function MT(r,e,t){return i;function i(s){return r.enter("hardBreakEscape"),r.consume(s),n}function n(s){return H(s)?(r.exit("hardBreakEscape"),e(s)):t(s)}}const RT={name:"headingAtx",tokenize:NT,resolve:ZT};function ZT(r,e){let t=r.length-2,i=3,n,s;return r[i][1].type==="whitespace"&&(i+=2),t-2>i&&r[t][1].type==="whitespace"&&(t-=2),r[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&r[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(n={type:"atxHeadingText",start:r[i][1].start,end:r[t][1].end},s={type:"chunkText",start:r[i][1].start,end:r[t][1].end,contentType:"text"},Kr(r,i,t-i+1,[["enter",n,e],["enter",s,e],["exit",s,e],["exit",n,e]])),r}function NT(r,e,t){let i=0;return n;function n(u){return r.enter("atxHeading"),s(u)}function s(u){return r.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&i++<6?(r.consume(u),o):u===null||Dt(u)?(r.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(r.enter("atxHeadingSequence"),l(u)):u===null||H(u)?(r.exit("atxHeading"),e(u)):fe(u)?ve(r,a,"whitespace")(u):(r.enter("atxHeadingText"),c(u))}function l(u){return u===35?(r.consume(u),l):(r.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Dt(u)?(r.exit("atxHeadingText"),a(u)):(r.consume(u),c)}}const FT=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ty=["pre","script","style","textarea"],IT={name:"htmlFlow",tokenize:XT,resolveTo:LT,concrete:!0},BT={tokenize:VT,partial:!0},qT={tokenize:YT,partial:!0};function LT(r){let e=r.length;for(;e--&&!(r[e][0]==="enter"&&r[e][1].type==="htmlFlow"););return e>1&&r[e-2][1].type==="linePrefix"&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r}function XT(r,e,t){const i=this;let n,s,o,a,l;return c;function c(S){return u(S)}function u(S){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(S),h}function h(S){return S===33?(r.consume(S),d):S===47?(r.consume(S),s=!0,m):S===63?(r.consume(S),n=3,i.interrupt?e:k):Ir(S)?(r.consume(S),o=String.fromCharCode(S),g):t(S)}function d(S){return S===45?(r.consume(S),n=2,f):S===91?(r.consume(S),n=5,a=0,p):Ir(S)?(r.consume(S),n=4,i.interrupt?e:k):t(S)}function f(S){return S===45?(r.consume(S),i.interrupt?e:k):t(S)}function p(S){const Ue="CDATA[";return S===Ue.charCodeAt(a++)?(r.consume(S),a===Ue.length?i.interrupt?e:A:p):t(S)}function m(S){return Ir(S)?(r.consume(S),o=String.fromCharCode(S),g):t(S)}function g(S){if(S===null||S===47||S===62||Dt(S)){const Ue=S===47,ur=o.toLowerCase();return!Ue&&!s&&ty.includes(ur)?(n=1,i.interrupt?e(S):A(S)):FT.includes(o.toLowerCase())?(n=6,Ue?(r.consume(S),O):i.interrupt?e(S):A(S)):(n=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(S):s?w(S):v(S))}return S===45||Or(S)?(r.consume(S),o+=String.fromCharCode(S),g):t(S)}function O(S){return S===62?(r.consume(S),i.interrupt?e:A):t(S)}function w(S){return fe(S)?(r.consume(S),w):B(S)}function v(S){return S===47?(r.consume(S),B):S===58||S===95||Ir(S)?(r.consume(S),C):fe(S)?(r.consume(S),v):B(S)}function C(S){return S===45||S===46||S===58||S===95||Or(S)?(r.consume(S),C):Q(S)}function Q(S){return S===61?(r.consume(S),b):fe(S)?(r.consume(S),Q):v(S)}function b(S){return S===null||S===60||S===61||S===62||S===96?t(S):S===34||S===39?(r.consume(S),l=S,x):fe(S)?(r.consume(S),b):R(S)}function x(S){return S===l?(r.consume(S),l=null,P):S===null||H(S)?t(S):(r.consume(S),x)}function R(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Dt(S)?Q(S):(r.consume(S),R)}function P(S){return S===47||S===62||fe(S)?v(S):t(S)}function B(S){return S===62?(r.consume(S),E):t(S)}function E(S){return S===null||H(S)?A(S):fe(S)?(r.consume(S),E):t(S)}function A(S){return S===45&&n===2?(r.consume(S),te):S===60&&n===1?(r.consume(S),le):S===62&&n===4?(r.consume(S),De):S===63&&n===3?(r.consume(S),k):S===93&&n===5?(r.consume(S),Ee):H(S)&&(n===6||n===7)?(r.exit("htmlFlowData"),r.check(BT,qe,z)(S)):S===null||H(S)?(r.exit("htmlFlowData"),z(S)):(r.consume(S),A)}function z(S){return r.check(qT,X,qe)(S)}function X(S){return r.enter("lineEnding"),r.consume(S),r.exit("lineEnding"),$}function $(S){return S===null||H(S)?z(S):(r.enter("htmlFlowData"),A(S))}function te(S){return S===45?(r.consume(S),k):A(S)}function le(S){return S===47?(r.consume(S),o="",xe):A(S)}function xe(S){if(S===62){const Ue=o.toLowerCase();return ty.includes(Ue)?(r.consume(S),De):A(S)}return Ir(S)&&o.length<8?(r.consume(S),o+=String.fromCharCode(S),xe):A(S)}function Ee(S){return S===93?(r.consume(S),k):A(S)}function k(S){return S===62?(r.consume(S),De):S===45&&n===2?(r.consume(S),k):A(S)}function De(S){return S===null||H(S)?(r.exit("htmlFlowData"),qe(S)):(r.consume(S),De)}function qe(S){return r.exit("htmlFlow"),e(S)}}function YT(r,e,t){const i=this;return n;function n(o){return H(o)?(r.enter("lineEnding"),r.consume(o),r.exit("lineEnding"),s):t(o)}function s(o){return i.parser.lazy[i.now().line]?t(o):e(o)}}function VT(r,e,t){return i;function i(n){return r.enter("lineEnding"),r.consume(n),r.exit("lineEnding"),r.attempt(Zu,e,t)}}const zT={name:"htmlText",tokenize:WT};function WT(r,e,t){const i=this;let n,s,o;return a;function a(k){return r.enter("htmlText"),r.enter("htmlTextData"),r.consume(k),l}function l(k){return k===33?(r.consume(k),c):k===47?(r.consume(k),Q):k===63?(r.consume(k),v):Ir(k)?(r.consume(k),R):t(k)}function c(k){return k===45?(r.consume(k),u):k===91?(r.consume(k),s=0,p):Ir(k)?(r.consume(k),w):t(k)}function u(k){return k===45?(r.consume(k),f):t(k)}function h(k){return k===null?t(k):k===45?(r.consume(k),d):H(k)?(o=h,le(k)):(r.consume(k),h)}function d(k){return k===45?(r.consume(k),f):h(k)}function f(k){return k===62?te(k):k===45?d(k):h(k)}function p(k){const De="CDATA[";return k===De.charCodeAt(s++)?(r.consume(k),s===De.length?m:p):t(k)}function m(k){return k===null?t(k):k===93?(r.consume(k),g):H(k)?(o=m,le(k)):(r.consume(k),m)}function g(k){return k===93?(r.consume(k),O):m(k)}function O(k){return k===62?te(k):k===93?(r.consume(k),O):m(k)}function w(k){return k===null||k===62?te(k):H(k)?(o=w,le(k)):(r.consume(k),w)}function v(k){return k===null?t(k):k===63?(r.consume(k),C):H(k)?(o=v,le(k)):(r.consume(k),v)}function C(k){return k===62?te(k):v(k)}function Q(k){return Ir(k)?(r.consume(k),b):t(k)}function b(k){return k===45||Or(k)?(r.consume(k),b):x(k)}function x(k){return H(k)?(o=x,le(k)):fe(k)?(r.consume(k),x):te(k)}function R(k){return k===45||Or(k)?(r.consume(k),R):k===47||k===62||Dt(k)?P(k):t(k)}function P(k){return k===47?(r.consume(k),te):k===58||k===95||Ir(k)?(r.consume(k),B):H(k)?(o=P,le(k)):fe(k)?(r.consume(k),P):te(k)}function B(k){return k===45||k===46||k===58||k===95||Or(k)?(r.consume(k),B):E(k)}function E(k){return k===61?(r.consume(k),A):H(k)?(o=E,le(k)):fe(k)?(r.consume(k),E):P(k)}function A(k){return k===null||k===60||k===61||k===62||k===96?t(k):k===34||k===39?(r.consume(k),n=k,z):H(k)?(o=A,le(k)):fe(k)?(r.consume(k),A):(r.consume(k),X)}function z(k){return k===n?(r.consume(k),n=void 0,$):k===null?t(k):H(k)?(o=z,le(k)):(r.consume(k),z)}function X(k){return k===null||k===34||k===39||k===60||k===61||k===96?t(k):k===47||k===62||Dt(k)?P(k):(r.consume(k),X)}function $(k){return k===47||k===62||Dt(k)?P(k):t(k)}function te(k){return k===62?(r.consume(k),r.exit("htmlTextData"),r.exit("htmlText"),e):t(k)}function le(k){return r.exit("htmlTextData"),r.enter("lineEnding"),r.consume(k),r.exit("lineEnding"),xe}function xe(k){return fe(k)?ve(r,Ee,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):Ee(k)}function Ee(k){return r.enter("htmlTextData"),o(k)}}const mm={name:"labelEnd",tokenize:KT,resolveTo:HT,resolveAll:GT},jT={tokenize:JT},UT={tokenize:eP},_T={tokenize:tP};function GT(r){let e=-1;for(;++e=3&&(c===null||H(c))?(r.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===n?(r.consume(c),i++,l):(r.exit("thematicBreakSequence"),fe(c)?ve(r,a,"whitespace")(c):a(c))}}const Ct={name:"list",tokenize:uP,continuation:{tokenize:hP},exit:fP},lP={tokenize:pP,partial:!0},cP={tokenize:dP,partial:!0};function uP(r,e,t){const i=this,n=i.events[i.events.length-1];let s=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,o=0;return a;function a(f){const p=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:df(f)){if(i.containerState.type||(i.containerState.type=p,r.enter(p,{_container:!0})),p==="listUnordered")return r.enter("listItemPrefix"),f===42||f===45?r.check(sc,t,c)(f):c(f);if(!i.interrupt||f===49)return r.enter("listItemPrefix"),r.enter("listItemValue"),l(f)}return t(f)}function l(f){return df(f)&&++o<10?(r.consume(f),l):(!i.interrupt||o<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(r.exit("listItemValue"),c(f)):t(f)}function c(f){return r.enter("listItemMarker"),r.consume(f),r.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,r.check(Zu,i.interrupt?t:u,r.attempt(lP,d,h))}function u(f){return i.containerState.initialBlankLine=!0,s++,d(f)}function h(f){return fe(f)?(r.enter("listItemPrefixWhitespace"),r.consume(f),r.exit("listItemPrefixWhitespace"),d):t(f)}function d(f){return i.containerState.size=s+i.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(f)}}function hP(r,e,t){const i=this;return i.containerState._closeFlow=void 0,r.check(Zu,n,s);function n(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ve(r,e,"listItemIndent",i.containerState.size+1)(a)}function s(a){return i.containerState.furtherBlankLines||!fe(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r.attempt(cP,e,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,ve(r,r.attempt(Ct,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function dP(r,e,t){const i=this;return ve(r,n,"listItemIndent",i.containerState.size+1);function n(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?e(s):t(s)}}function fP(r){r.exit(this.containerState.type)}function pP(r,e,t){const i=this;return ve(r,n,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(s){const o=i.events[i.events.length-1];return!fe(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):t(s)}}const ry={name:"setextUnderline",tokenize:gP,resolveTo:mP};function mP(r,e){let t=r.length,i,n,s;for(;t--;)if(r[t][0]==="enter"){if(r[t][1].type==="content"){i=t;break}r[t][1].type==="paragraph"&&(n=t)}else r[t][1].type==="content"&&r.splice(t,1),!s&&r[t][1].type==="definition"&&(s=t);const o={type:"setextHeading",start:Object.assign({},r[n][1].start),end:Object.assign({},r[r.length-1][1].end)};return r[n][1].type="setextHeadingText",s?(r.splice(n,0,["enter",o,e]),r.splice(s+1,0,["exit",r[i][1],e]),r[i][1].end=Object.assign({},r[s][1].end)):r[i][1]=o,r.push(["exit",o,e]),r}function gP(r,e,t){const i=this;let n;return s;function s(c){let u=i.events.length,h;for(;u--;)if(i.events[u][1].type!=="lineEnding"&&i.events[u][1].type!=="linePrefix"&&i.events[u][1].type!=="content"){h=i.events[u][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||h)?(r.enter("setextHeadingLine"),n=c,o(c)):t(c)}function o(c){return r.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===n?(r.consume(c),a):(r.exit("setextHeadingLineSequence"),fe(c)?ve(r,l,"lineSuffix")(c):l(c))}function l(c){return c===null||H(c)?(r.exit("setextHeadingLine"),e(c)):t(c)}}const OP={tokenize:yP};function yP(r){const e=this,t=r.attempt(Zu,i,r.attempt(this.parser.constructs.flowInitial,n,ve(r,r.attempt(this.parser.constructs.flow,n,r.attempt(xT,n)),"linePrefix")));return t;function i(s){if(s===null){r.consume(s);return}return r.enter("lineEndingBlank"),r.consume(s),r.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function n(s){if(s===null){r.consume(s);return}return r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),e.currentConstruct=void 0,t}}const bP={resolveAll:cv()},wP=lv("string"),vP=lv("text");function lv(r){return{tokenize:e,resolveAll:cv(r==="text"?kP:void 0)};function e(t){const i=this,n=this.parser.constructs[r],s=t.attempt(n,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),l}function l(u){return c(u)?(t.exit("data"),s(u)):(t.consume(u),l)}function c(u){if(u===null)return!0;const h=n[u];let d=-1;if(h)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}s>0&&o.push(r[n].slice(0,s))}return o}function CP(r,e){let t=-1;const i=[];let n;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCharCode(t)}const BP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hv(r){return r.replace(BP,qP)}function qP(r,e,t){if(e)return e;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),n=i===120||i===88;return uv(t.slice(n?2:1),n?16:10)}return pm(t)||r}function ma(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?ny(r.position):"start"in r||"end"in r?ny(r):"line"in r||"column"in r?pf(r):""}function pf(r){return sy(r&&r.line)+":"+sy(r&&r.column)}function ny(r){return pf(r&&r.start)+"-"+pf(r&&r.end)}function sy(r){return r&&typeof r=="number"?r:1}const dv={}.hasOwnProperty,LP=function(r,e,t){return typeof e!="string"&&(t=e,e=void 0),XP(t)(IP(NP(t).document().write(FP()(r,e,!0))))};function XP(r){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(FO),autolinkProtocol:E,autolinkEmail:E,atxHeading:a(RO),blockQuote:a(Ch),characterEscape:E,characterReference:E,codeFenced:a(MO),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(MO,l),codeText:a(FA,l),codeTextData:E,data:E,codeFlowValue:E,definition:a(IA),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(BA),hardBreakEscape:a(ZO),hardBreakTrailing:a(ZO),htmlFlow:a(NO,l),htmlFlowData:E,htmlText:a(NO,l),htmlTextData:E,image:a(qA),label:l,link:a(FO),listItem:a(LA),listItemValue:p,listOrdered:a(IO,f),listUnordered:a(IO),paragraph:a(XA),reference:ur,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(RO),strong:a(YA),thematicBreak:a(zA)},exit:{atxHeading:u(),atxHeadingSequence:x,autolink:u(),autolinkEmail:Os,autolinkProtocol:gs,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ms,characterReferenceMarkerNumeric:ms,characterReferenceValue:Ai,codeFenced:u(w),codeFencedFence:O,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:u(v),codeText:u(le),codeTextData:A,data:A,definition:u(),definitionDestinationString:b,definitionLabelString:C,definitionTitleString:Q,emphasis:u(),hardBreakEscape:u(X),hardBreakTrailing:u(X),htmlFlow:u($),htmlFlowData:A,htmlText:u(te),htmlTextData:A,image:u(Ee),label:De,labelText:k,lineEnding:z,link:u(xe),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Le,resourceDestinationString:qe,resourceTitleString:S,resource:Ue,setextHeading:u(B),setextHeadingLineSequence:P,setextHeadingText:R,strong:u(),thematicBreak:u()}};fv(e,(r||{}).mdastExtensions||[]);const t={};return i;function i(T){let F={type:"root",children:[]};const G={stack:[F],tokenStack:[],config:e,enter:c,exit:h,buffer:l,resume:d,setData:s,getData:o},me=[];let ye=-1;for(;++ye0){const Tr=G.tokenStack[G.tokenStack.length-1];(Tr[1]||oy).call(G,void 0,Tr[0])}for(F.position={start:Di(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:Di(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye{const t=this.data("settings");return LP(e,Object.assign({},t,r,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}const ay={}.hasOwnProperty;function VP(r,e){const t=e||{};function i(n,...s){let o=i.invalid;const a=i.handlers;if(n&&ay.call(n,r)){const l=String(n[r]);o=ay.call(a,l)?a[l]:i.unknown}if(o)return o.call(this,n,...s)}return i.handlers=t.handlers||{},i.invalid=t.invalid,i.unknown=t.unknown,i}function oc(r,e){let t=-1,i;if(e.extensions)for(;++t "),s.shift(2);const o=t.indentLines(t.containerFlow(r,s.current()),WP);return n(),o}function WP(r,e,t){return">"+(t?"":" ")+r}function pv(r,e){return ly(r,e.inConstruct,!0)&&!ly(r,e.notInConstruct,!1)}function ly(r,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let i=-1;for(;++io&&(o=s):s=1,n=i+e.length,i=t.indexOf(e,n);return o}function gf(r,e){return!!(!e.options.fences&&r.value&&!r.lang&&/[^ \r\n]/.test(r.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(r.value))}function UP(r){const e=r.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function _P(r,e,t,i){const n=UP(t),s=r.value||"",o=n==="`"?"GraveAccent":"Tilde";if(gf(r,t)){const h=t.enter("codeIndented"),d=t.indentLines(s,GP);return h(),d}const a=t.createTracker(i),l=n.repeat(Math.max(jP(s,n)+1,3)),c=t.enter("codeFenced");let u=a.move(l);if(r.lang){const h=t.enter(`codeFencedLang${o}`);u+=a.move(t.safe(r.lang,{before:u,after:" ",encode:["`"],...a.current()})),h()}if(r.lang&&r.meta){const h=t.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(t.safe(r.meta,{before:u,after:`
+`,encode:["`"],...a.current()})),h()}return u+=a.move(`
+`),s&&(u+=a.move(s+`
+`)),u+=a.move(l),c(),u}function GP(r,e,t){return(t?"":" ")+r}function gm(r){const e=r.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function HP(r,e,t,i){const n=gm(t),s=n==='"'?"Quote":"Apostrophe",o=t.enter("definition");let a=t.enter("label");const l=t.createTracker(i);let c=l.move("[");return c+=l.move(t.safe(t.associationId(r),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!r.url||/[\0- \u007F]/.test(r.url)?(a=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":`
+`,...l.current()}))),a(),r.title&&(a=t.enter(`title${s}`),c+=l.move(" "+n),c+=l.move(t.safe(r.title,{before:c,after:n,...l.current()})),c+=l.move(n),a()),o(),c}function KP(r){const e=r.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}mv.peek=JP;function mv(r,e,t,i){const n=KP(t),s=t.enter("emphasis"),o=t.createTracker(i);let a=o.move(n);return a+=o.move(t.containerPhrasing(r,{before:a,after:n,...o.current()})),a+=o.move(n),s(),a}function JP(r,e,t){return t.options.emphasis||"*"}const Om=function(r){if(r==null)return iE;if(typeof r=="string")return rE(r);if(typeof r=="object")return Array.isArray(r)?eE(r):tE(r);if(typeof r=="function")return Nu(r);throw new Error("Expected function, string, or object as test")};function eE(r){const e=[];let t=-1;for(;++t":""))+")"})}return h;function h(){let d=[],f,p,m;if((!e||n(a,l,c[c.length-1]||null))&&(d=oE(t(a,c)),d[0]===Of))return d;if(a.children&&d[0]!==yf)for(p=(i?a.children.length:-1)+s,m=c.concat(a);p>-1&&p{if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return t=!0,Of}),!!((!r.depth||r.depth<3)&&dm(r)&&(e.options.setext||t))}function aE(r,e,t,i){const n=Math.max(Math.min(6,r.depth||1),1),s=t.createTracker(i);if(gv(r,t)){const u=t.enter("headingSetext"),h=t.enter("phrasing"),d=t.containerPhrasing(r,{...s.current(),before:`
+`,after:`
+`});return h(),u(),d+`
+`+(n===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
+`))+1))}const o="#".repeat(n),a=t.enter("headingAtx"),l=t.enter("phrasing");s.move(o+" ");let c=t.containerPhrasing(r,{before:"# ",after:`
+`,...s.current()});return/^[\t ]/.test(c)&&(c=""+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,t.options.closeAtx&&(c+=" "+o),l(),a(),c}Ov.peek=lE;function Ov(r){return r.value||""}function lE(){return"<"}yv.peek=cE;function yv(r,e,t,i){const n=gm(t),s=n==='"'?"Quote":"Apostrophe",o=t.enter("image");let a=t.enter("label");const l=t.createTracker(i);let c=l.move("![");return c+=l.move(t.safe(r.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(a=t.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(t.safe(r.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=t.enter("destinationRaw"),c+=l.move(t.safe(r.url,{before:c,after:r.title?" ":")",...l.current()}))),a(),r.title&&(a=t.enter(`title${s}`),c+=l.move(" "+n),c+=l.move(t.safe(r.title,{before:c,after:n,...l.current()})),c+=l.move(n),a()),c+=l.move(")"),o(),c}function cE(){return"!"}bv.peek=uE;function bv(r,e,t,i){const n=r.referenceType,s=t.enter("imageReference");let o=t.enter("label");const a=t.createTracker(i);let l=a.move("![");const c=t.safe(r.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(r),{before:l,after:"]",...a.current()});return o(),t.stack=u,s(),n==="full"||!c||c!==h?l+=a.move(h+"]"):n==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function uE(){return"!"}function wv(r){if(!r._compiled){const e=(r.atBreak?"[\\r\\n][\\t ]*":"")+(r.before?"(?:"+r.before+")":"");r._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(r.character)?"\\":"")+r.character+(r.after?"(?:"+r.after+")":""),"g")}return r._compiled}vv.peek=hE;function vv(r,e,t){let i=r.value||"",n="`",s=-1;for(;new RegExp("(^|[^`])"+n+"([^`]|$)").test(i);)n+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(r.url))}xv.peek=dE;function xv(r,e,t,i){const n=gm(t),s=n==='"'?"Quote":"Apostrophe",o=t.createTracker(i);let a,l;if(kv(r,t)){const u=t.stack;t.stack=[],a=t.enter("autolink");let h=o.move("<");return h+=o.move(t.containerPhrasing(r,{before:h,after:">",...o.current()})),h+=o.move(">"),a(),t.stack=u,h}a=t.enter("link"),l=t.enter("label");let c=o.move("[");return c+=o.move(t.containerPhrasing(r,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!r.url&&r.title||/[\0- \u007F]/.test(r.url)?(l=t.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(t.safe(r.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=t.enter("destinationRaw"),c+=o.move(t.safe(r.url,{before:c,after:r.title?" ":")",...o.current()}))),l(),r.title&&(l=t.enter(`title${s}`),c+=o.move(" "+n),c+=o.move(t.safe(r.title,{before:c,after:n,...o.current()})),c+=o.move(n),l()),c+=o.move(")"),a(),c}function dE(r,e,t){return kv(r,t)?"<":"["}Sv.peek=fE;function Sv(r,e,t,i){const n=r.referenceType,s=t.enter("linkReference");let o=t.enter("label");const a=t.createTracker(i);let l=a.move("[");const c=t.containerPhrasing(r,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=t.stack;t.stack=[],o=t.enter("reference");const h=t.safe(t.associationId(r),{before:l,after:"]",...a.current()});return o(),t.stack=u,s(),n==="full"||!c||c!==h?l+=a.move(h+"]"):n==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function fE(){return"["}function ym(r){const e=r.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function pE(r){const e=ym(r),t=r.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Cv(r){const e=r.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function mE(r){const e=Cv(r),t=r.options.bulletOrderedOther;if(!t)return e==="."?")":".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bulletOrdered` (`"+e+"`) and `bulletOrderedOther` (`"+t+"`) to be different");return t}function Qv(r){const e=r.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function gE(r,e,t,i){const n=t.enter("list"),s=t.bulletCurrent;let o=r.ordered?Cv(t):ym(t);const a=r.ordered?mE(t):pE(t),l=t.bulletLastUsed;let c=!1;if(e&&(r.ordered?t.options.bulletOrderedOther:t.options.bulletOther)&&l&&o===l&&(c=!0),!r.ordered){const h=r.children?r.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),Qv(t)===o&&h){let d=-1;for(;++d-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(r))+s);let o=s.length+1;(n==="tab"||n==="mixed"&&(e&&e.type==="list"&&e.spread||r.spread))&&(o=Math.ceil(o/4)*4);const a=t.createTracker(i);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=t.enter("listItem"),c=t.indentLines(t.containerFlow(r,a.current()),u);return l(),c;function u(h,d,f){return d?(f?"":" ".repeat(o))+h:(f?s:s+" ".repeat(o-s.length))+h}}function bE(r,e,t,i){const n=t.enter("paragraph"),s=t.enter("phrasing"),o=t.containerPhrasing(r,i);return s(),n(),o}const wE=Om(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text"]);function vE(r,e,t,i){return(r.children.some(n=>wE(n))?t.containerPhrasing:t.containerFlow).call(t,r,i)}function kE(r){const e=r.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}$v.peek=xE;function $v(r,e,t,i){const n=kE(t),s=t.enter("strong"),o=t.createTracker(i);let a=o.move(n+n);return a+=o.move(t.containerPhrasing(r,{before:a,after:n,...o.current()})),a+=o.move(n+n),s(),a}function xE(r,e,t){return t.options.strong||"*"}function SE(r,e,t,i){return t.safe(r.value,i)}function CE(r){const e=r.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function QE(r,e,t){const i=(Qv(t)+(t.options.ruleSpaces?" ":"")).repeat(CE(t));return t.options.ruleSpaces?i.slice(0,-1):i}const $E={blockquote:zP,break:cy,code:_P,definition:HP,emphasis:mv,hardBreak:cy,heading:aE,html:Ov,image:yv,imageReference:bv,inlineCode:vv,link:xv,linkReference:Sv,list:gE,listItem:yE,paragraph:bE,root:vE,strong:$v,text:SE,thematicBreak:QE},AE=[DE];function DE(r,e,t,i){if(e.type==="code"&&gf(e,i)&&(r.type==="list"||r.type===e.type&&gf(r,i))||r.type==="list"&&r.type===e.type&&!!r.ordered==!!e.ordered&&!(r.ordered?i.options.bulletOrderedOther:i.options.bulletOther))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&gv(e,i))?void 0:t.spread?1:0}const xn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],TE=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
+`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:xn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
+]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:xn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
+*])`},{character:"*",inConstruct:"phrasing",notInConstruct:xn},{atBreak:!0,character:"+",after:`(?:[ \r
+])`},{atBreak:!0,character:"-",after:`(?:[ \r
+-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
+]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:xn},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:xn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:xn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:xn},{atBreak:!0,character:"~"}];function PE(r){return r.label||!r.identifier?r.label||"":hv(r.identifier)}function EE(r,e,t){const i=e.indexStack,n=r.children||[],s=[];let o=-1,a=t.before;i.push(-1);let l=e.createTracker(t);for(;++o0&&(a==="\r"||a===`
+`)&&c.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(t),l.move(s.join(""))),s.push(l.move(e.handle(c,r,e,{...l.current(),before:a,after:u}))),a=s[s.length-1].slice(-1)}return i.pop(),s.join("")}function ME(r,e,t){const i=e.indexStack,n=r.children||[],s=e.createTracker(t),o=[];let a=-1;for(i.push(-1);++a
+
+`}return`
+
+`}const ZE=/\r?\n|\r/g;function NE(r,e){const t=[];let i=0,n=0,s;for(;s=ZE.exec(r);)o(r.slice(i,s.index)),t.push(s[0]),i=s.index+s[0].length,n++;return o(r.slice(i)),t.join("");function o(a){t.push(e(a,n,!a))}}function FE(r,e,t){const i=(t.before||"")+(e||"")+(t.after||""),n=[],s=[],o={};let a=-1;for(;++a=c||u+1{const t=this.data("settings");return qE(e,Object.assign({},t,r,{extensions:this.data("toMarkdownExtensions")||[]}))}})}function hy(r){if(r)throw r}var Sl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */var jE=function(r){return r!=null&&r.constructor!=null&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)};const Av=bm(jE);var ac=Object.prototype.hasOwnProperty,Dv=Object.prototype.toString,dy=Object.defineProperty,fy=Object.getOwnPropertyDescriptor,py=function(r){return typeof Array.isArray=="function"?Array.isArray(r):Dv.call(r)==="[object Array]"},my=function(r){if(!r||Dv.call(r)!=="[object Object]")return!1;var e=ac.call(r,"constructor"),t=r.constructor&&r.constructor.prototype&&ac.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!e&&!t)return!1;var i;for(i in r);return typeof i>"u"||ac.call(r,i)},gy=function(r,e){dy&&e.name==="__proto__"?dy(r,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):r[e.name]=e.newValue},Oy=function(r,e){if(e==="__proto__")if(ac.call(r,e)){if(fy)return fy(r,e).value}else return;return r[e]},UE=function r(){var e,t,i,n,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});lo.length;let l;a&&o.push(n);try{l=r.apply(this,o)}catch(c){const u=c;if(a&&t)throw u;return n(u)}a||(l instanceof Promise?l.then(s,n):l instanceof Error?n(l):s(l))}function n(o,...a){t||(t=!0,e(o,...a))}function s(o){n(null,o)}}class or extends Error{constructor(e,t,i){const n=[null,null];let s={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof t=="string"&&(i=t,t=void 0),typeof i=="string"){const o=i.indexOf(":");o===-1?n[1]=i:(n[0]=i.slice(0,o),n[1]=i.slice(o+1))}t&&("type"in t||"position"in t?t.position&&(s=t.position):"start"in t||"end"in t?s=t:("line"in t||"column"in t)&&(s.start=t)),this.name=ma(t)||"1:1",this.message=typeof e=="object"?e.message:e,this.stack="",typeof e=="object"&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=s.start.line,this.column=s.start.column,this.position=s,this.source=n[0],this.ruleId=n[1],this.file,this.actual,this.expected,this.url,this.note}}or.prototype.file="";or.prototype.name="";or.prototype.reason="";or.prototype.message="";or.prototype.stack="";or.prototype.fatal=null;or.prototype.column=null;or.prototype.line=null;or.prototype.source=null;or.prototype.ruleId=null;or.prototype.position=null;const Nr={basename:HE,dirname:KE,extname:JE,join:eM,sep:"/"};function HE(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ol(r);let t=0,i=-1,n=r.length,s;if(e===void 0||e.length===0||e.length>r.length){for(;n--;)if(r.charCodeAt(n)===47){if(s){t=n+1;break}}else i<0&&(s=!0,i=n+1);return i<0?"":r.slice(t,i)}if(e===r)return"";let o=-1,a=e.length-1;for(;n--;)if(r.charCodeAt(n)===47){if(s){t=n+1;break}}else o<0&&(s=!0,o=n+1),a>-1&&(r.charCodeAt(n)===e.charCodeAt(a--)?a<0&&(i=n):(a=-1,i=o));return t===i?i=o:i<0&&(i=r.length),r.slice(t,i)}function KE(r){if(ol(r),r.length===0)return".";let e=-1,t=r.length,i;for(;--t;)if(r.charCodeAt(t)===47){if(i){e=t;break}}else i||(i=!0);return e<0?r.charCodeAt(0)===47?"/":".":e===1&&r.charCodeAt(0)===47?"//":r.slice(0,e)}function JE(r){ol(r);let e=r.length,t=-1,i=0,n=-1,s=0,o;for(;e--;){const a=r.charCodeAt(e);if(a===47){if(o){i=e+1;break}continue}t<0&&(o=!0,t=e+1),a===46?n<0?n=e:s!==1&&(s=1):n>-1&&(s=-1)}return n<0||t<0||s===0||s===1&&n===t-1&&n===i+1?"":r.slice(n,t)}function eM(...r){let e=-1,t;for(;++e0&&r.charCodeAt(r.length-1)===47&&(t+="/"),e?"/"+t:t}function rM(r,e){let t="",i=0,n=-1,s=0,o=-1,a,l;for(;++o<=r.length;){if(o2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",i=0):(t=t.slice(0,l),i=t.length-1-t.lastIndexOf("/")),n=o,s=0;continue}}else if(t.length>0){t="",i=0,n=o,s=0;continue}}e&&(t=t.length>0?t+"/..":"..",i=2)}else t.length>0?t+="/"+r.slice(n+1,o):t=r.slice(n+1,o),i=o-n-1;n=o,s=0}else a===46&&s>-1?s++:s=-1}return t}function ol(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const iM={cwd:nM};function nM(){return"/"}function vf(r){return r!==null&&typeof r=="object"&&r.href&&r.origin}function sM(r){if(typeof r=="string")r=new URL(r);else if(!vf(r)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+r+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(r.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return oM(r)}function oM(r){if(r.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=r.pathname;let t=-1;for(;++t{if(b||!x||!R)Q(b);else{const P=s.stringify(x,R);P==null||(hM(P)?R.value=P:R.result=P),Q(b,R)}});function Q(b,x){b||!x?v(b):w?w(x):g(null,x)}}}function p(m){let g;s.freeze(),Ih("processSync",s.Parser),Bh("processSync",s.Compiler);const O=Po(m);return s.process(O,w),ky("processSync","process",g),O;function w(v){g=!0,hy(v)}}}function wy(r,e){return typeof r=="function"&&r.prototype&&(cM(r.prototype)||e in r.prototype)}function cM(r){let e;for(e in r)if(Tv.call(r,e))return!0;return!1}function Ih(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `Parser`")}function Bh(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `Compiler`")}function qh(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vy(r){if(!wf(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function ky(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function Po(r){return uM(r)?r:new aM(r)}function uM(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function hM(r){return typeof r=="string"||Av(r)}let Ev=class{},Mv=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=r=>{var e;(e=this.top())==null||e.push(r)},this.open=r=>{this.elements.push(r)},this.close=()=>{const r=this.elements.pop();if(!r)throw Mw();return r}}},dM=class Rv extends Ev{constructor(e,t,i){super(),this.type=e,this.content=t,this.attrs=i}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(e,t,i){return new Rv(e,t,i)}};var Zv=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},Mt=(r,e,t)=>(Zv(r,e,"read from private field"),t?t.call(r):e.get(r)),Sn=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Lh=(r,e,t,i)=>(Zv(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),hi,lc,xf,Sf,Cf,cc,uc;const Nv=class extends Mv{constructor(r){super(),Sn(this,hi,ae.none),Sn(this,lc,e=>e.isText),Sn(this,xf,(e,t)=>{if(Mt(this,lc).call(this,e)&&Mt(this,lc).call(this,t)&&ae.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)}),Sn(this,Sf,e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find(i=>i.spec.parseMarkdown.match(e));if(!t)throw sD(e);return t}),Sn(this,Cf,e=>{const t=Mt(this,Sf).call(this,e);t.spec.parseMarkdown.runner(this,e,t)}),this.injectRoot=(e,t,i)=>(this.openNode(t,i),this.next(e.children),this),this.openNode=(e,t)=>(this.open(dM.create(e,[],t)),this),Sn(this,cc,()=>{Lh(this,hi,ae.none);const e=this.close();return Mt(this,uc).call(this,e.type,e.attrs,e.content)}),this.closeNode=()=>(Mt(this,cc).call(this),this),Sn(this,uc,(e,t,i)=>{const n=e.createAndFill(t,i,Mt(this,hi));if(!n)throw nD(e,t,i);return this.push(n),n}),this.addNode=(e,t,i)=>(Mt(this,uc).call(this,e,t,i),this),this.openMark=(e,t)=>{const i=e.create(t);return Lh(this,hi,i.addToSet(Mt(this,hi))),this},this.closeMark=e=>(Lh(this,hi,e.removeFromSet(Mt(this,hi))),this),this.addText=e=>{const t=this.top();if(!t)throw Mw();const i=t.pop(),n=this.schema.text(e,Mt(this,hi));if(!i)return t.push(n),this;const s=Mt(this,xf).call(this,i,n);return s?(t.push(s),this):(t.push(i,n),this)},this.build=()=>{let e;do e=Mt(this,cc).call(this);while(this.size());return e},this.next=(e=[])=>([e].flat().forEach(t=>Mt(this,Cf).call(this,t)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{const i=e.runSync(e.parse(t),t);return this.next(i),this},this.schema=r}};let Fv=Nv;hi=new WeakMap;lc=new WeakMap;xf=new WeakMap;Sf=new WeakMap;Cf=new WeakMap;cc=new WeakMap;uc=new WeakMap;Fv.create=(r,e)=>{const t=new Nv(r);return i=>(t.run(e,i),t.toDoc())};const Iv=class extends Ev{constructor(r,e,t,i={}){super(),this.type=r,this.children=e,this.value=t,this.props=i,this.push=(n,...s)=>{this.children||(this.children=[]),this.children.push(n,...s)},this.pop=()=>{var n;return(n=this.children)==null?void 0:n.pop()}}};let Qf=Iv;Qf.create=(r,e,t,i={})=>new Iv(r,e,t,i);var Bv=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},Me=(r,e,t)=>(Bv(r,e,"read from private field"),t?t.call(r):e.get(r)),jt=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},xy=(r,e,t,i)=>(Bv(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),Zi,hc,$f,Af,dc,Df,fc,Tf,Go,pc,Pf,mc;const fM=r=>Object.prototype.hasOwnProperty.call(r,"size"),qv=class extends Mv{constructor(r){super(),jt(this,Zi,ae.none),jt(this,hc,e=>{const t=Object.values({...this.schema.nodes,...this.schema.marks}).find(i=>i.spec.toMarkdown.match(e));if(!t)throw oD(e.type);return t}),jt(this,$f,e=>Me(this,hc).call(this,e).spec.toMarkdown.runner(this,e)),jt(this,Af,(e,t)=>Me(this,hc).call(this,e).spec.toMarkdown.runner(this,e,t)),jt(this,dc,e=>{const{marks:t}=e,i=n=>n.type.spec.priority??50;[...t].sort((n,s)=>i(n)-i(s)).every(n=>!Me(this,Af).call(this,n,e))&&Me(this,$f).call(this,e),t.forEach(n=>Me(this,mc).call(this,n))}),jt(this,Df,(e,t)=>{var i;if(e.type===t||((i=e.children)==null?void 0:i.length)!==1)return e;const n=l=>{var c;if(l.type===t)return l;if(((c=l.children)==null?void 0:c.length)!==1)return null;const[u]=l.children;return u?n(u):null},s=n(e);if(!s)return e;const o=s.children?[...s.children]:void 0,a={...e,children:o};return a.children=o,s.children=[a],s}),jt(this,fc,e=>{const{children:t}=e;return t&&(e.children=t.reduce((i,n,s)=>{if(s===0)return[n];const o=i.at(-1);if(o&&o.isMark&&n.isMark){n=Me(this,Df).call(this,n,o.type);const{children:a,...l}=n,{children:c,...u}=o;if(n.type===o.type&&a&&c&&JSON.stringify(l)===JSON.stringify(u)){const h={...u,children:[...c,...a]};return i.slice(0,-1).concat(Me(this,fc).call(this,h))}}return i.concat(n)},[])),e}),jt(this,Tf,e=>{const t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t}),this.openNode=(e,t,i)=>(this.open(Qf.create(e,void 0,t,i)),this),jt(this,Go,()=>{const e=this.close();return Me(this,pc).call(this,e.type,e.children,e.value,e.props)}),this.closeNode=()=>(Me(this,Go).call(this),this),jt(this,pc,(e,t,i,n)=>{const s=Qf.create(e,t,i,n),o=Me(this,fc).call(this,Me(this,Tf).call(this,s));return this.push(o),o}),this.addNode=(e,t,i,n)=>(Me(this,pc).call(this,e,t,i,n),this),jt(this,Pf,(e,t,i,n)=>e.isInSet(Me(this,Zi))?this:(xy(this,Zi,e.addToSet(Me(this,Zi))),this.openNode(t,i,{...n,isMark:!0}))),jt(this,mc,e=>{e.isInSet(Me(this,Zi))&&(xy(this,Zi,e.type.removeFromSet(Me(this,Zi))),Me(this,Go).call(this))}),this.withMark=(e,t,i,n)=>(Me(this,Pf).call(this,e,t,i,n),this),this.closeMark=e=>(Me(this,mc).call(this,e),this),this.build=()=>{let e=null;do e=Me(this,Go).call(this);while(this.size());return e},this.next=e=>fM(e)?(e.forEach(t=>{Me(this,dc).call(this,t)}),this):(Me(this,dc).call(this,e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.next(e),this),this.schema=r}};let Lv=qv;Zi=new WeakMap;hc=new WeakMap;$f=new WeakMap;Af=new WeakMap;dc=new WeakMap;Df=new WeakMap;fc=new WeakMap;Tf=new WeakMap;Go=new WeakMap;pc=new WeakMap;Pf=new WeakMap;mc=new WeakMap;Lv.create=(r,e)=>{const t=new qv(r);return i=>(t.run(i),t.toString(e))};const Xv=65535,Yv=Math.pow(2,16);function pM(r,e){return r+e*Yv}function Sy(r){return r&Xv}function mM(r){return(r-(r&Xv))/Yv}const Vv=1,zv=2,gc=4,Wv=8;class Ef{constructor(e,t,i){this.pos=e,this.delInfo=t,this.recover=i}get deleted(){return(this.delInfo&Wv)>0}get deletedBefore(){return(this.delInfo&(Vv|gc))>0}get deletedAfter(){return(this.delInfo&(zv|gc))>0}get deletedAcross(){return(this.delInfo&gc)>0}}class Ht{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ht.empty)return Ht.empty}recover(e){let t=0,i=Sy(e);if(!this.inverted)for(let n=0;ne)break;let c=this.ranges[a+s],u=this.ranges[a+o],h=l+c;if(e<=h){let d=c?e==l?-1:e==h?1:t:t,f=l+n+(d<0?0:u);if(i)return f;let p=e==(t<0?l:h)?null:pM(a/3,e-l),m=e==l?zv:e==h?Vv:gc;return(t<0?e!=l:e!=h)&&(m|=Wv),new Ef(f,m,p)}n+=u-c}return i?e+n:new Ef(e+n,0,null)}touches(e,t){let i=0,n=Sy(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==n*3)return!0;i+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,i=this.inverted?1:2;for(let n=0,s=0;n=0;t--){let n=e.getMirror(t);this.appendMap(e.maps[t].invert(),n!=null&&n>t?i-n-1:void 0)}}invert(){let e=new Is;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;is&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),n),t.openStart,t.openEnd);return We.fromReplace(e,this.from,this.to,s)}invert(){return new Vr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new Oi(t.pos,i.pos,this.mark)}merge(e){return e instanceof Oi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Oi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Oi(t.from,t.to,e.markFromJSON(t.mark))}}Et.jsonID("addMark",Oi);class Vr extends Et{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=new L(wm(t.content,n=>n.mark(this.mark.removeFromSet(n.marks)),e),t.openStart,t.openEnd);return We.fromReplace(e,this.from,this.to,i)}invert(){return new Oi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new Vr(t.pos,i.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}}Et.jsonID("removeMark",Vr);class zi extends Et{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return We.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return We.fromReplace(e,this.pos,this.pos+1,new L(Z.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let i=this.mark.addToSet(t.marks);if(i.length==t.marks.length){for(let n=0;ni.pos?null:new ut(t.pos,i.pos,n,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ut(t.from,t.to,t.gapFrom,t.gapTo,L.fromJSON(e,t.slice),t.insert,!!t.structure)}}Et.jsonID("replaceAround",ut);function Mf(r,e,t){let i=r.resolve(e),n=t-e,s=i.depth;for(;n>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,n--;if(n>0){let o=i.node(s).maybeChild(i.indexAfter(s));for(;n>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,n--}}return!1}function gM(r,e,t,i){let n=[],s=[],o,a;r.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let h=l.marks;if(!i.isInSet(h)&&u.type.allowsMarkType(i.type)){let d=Math.max(c,e),f=Math.min(c+l.nodeSize,t),p=i.addToSet(h);for(let m=0;mr.step(l)),s.forEach(l=>r.step(l))}function OM(r,e,t,i){let n=[],s=0;r.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(i instanceof Ru){let c=o.marks,u;for(;u=i.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else i?i.isInSet(o.marks)&&(l=[i]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;ur.step(new Vr(o.from,o.to,o.style)))}function yM(r,e,t,i=t.contentMatch){let n=r.doc.nodeAt(e),s=[],o=e+1;for(let a=0;a=0;a--)r.step(s[a])}function bM(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Iu(r){let e=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let t=r.depth;;--t){let i=r.$from.node(t),n=r.$from.index(t),s=r.$to.indexAfter(t);if(tt;p--)m||i.index(p)>0?(m=!0,u=Z.from(i.node(p).copy(u)),h++):l--;let d=Z.empty,f=0;for(let p=s,m=!1;p>t;p--)m||n.after(p+1)=0;o--){if(i.size){let a=t[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Z.from(t[o].type.create(t[o].attrs,i))}let n=e.start,s=e.end;r.step(new ut(n,s,n,s,new L(i,0,0),t.length,!0))}function SM(r,e,t,i,n){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,a)=>{if(o.isTextblock&&!o.hasMarkup(i,n)&&CM(r.doc,r.mapping.slice(s).map(a),i)){r.clearIncompatible(r.mapping.slice(s).map(a,1),i);let l=r.mapping.slice(s),c=l.map(a,1),u=l.map(a+o.nodeSize,1);return r.step(new ut(c,u,c+1,u-1,new L(Z.from(i.create(n,null,o.marks)),0,0),1,!0)),!1}})}function CM(r,e,t){let i=r.resolve(e),n=i.index();return i.parent.canReplaceWith(n,n+1,t)}function QM(r,e,t,i,n){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(i,null,n||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new ut(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new L(Z.from(o),0,0),1,!0))}function ga(r,e,t=1,i){let n=r.resolve(e),s=n.depth-t,o=i&&i[i.length-1]||n.parent;if(s<0||n.parent.type.spec.isolating||!n.parent.canReplace(n.index(),n.parent.childCount)||!o.type.validContent(n.parent.content.cutByIndex(n.index(),n.parent.childCount)))return!1;for(let c=n.depth-1,u=t-2;c>s;c--,u--){let h=n.node(c),d=n.index(c);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(d,h.childCount),p=i&&i[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=i&&i[u]||h;if(!h.canReplace(d+1,h.childCount)||!m.type.validContent(f))return!1}let a=n.indexAfter(s),l=i&&i[0];return n.node(s).canReplaceWith(a,a,l?l.type:n.node(s+1).type)}function $M(r,e,t=1,i){let n=r.doc.resolve(e),s=Z.empty,o=Z.empty;for(let a=n.depth,l=n.depth-t,c=t-1;a>l;a--,c--){s=Z.from(n.node(a).copy(s));let u=i&&i[c];o=Z.from(u?u.type.create(u.attrs,o):n.node(a).copy(o))}r.step(new et(e,e,new L(s.append(o),t,t),!0))}function Bu(r,e){let t=r.resolve(e),i=t.index();return AM(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(i,i+1)}function AM(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function DM(r,e,t){let i=new et(e-t,e+t,L.empty,!0);r.step(i)}function TM(r,e,t){let i=r.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),t))return e;if(i.parentOffset==0)for(let n=i.depth-1;n>=0;n--){let s=i.index(n);if(i.node(n).canReplaceWith(s,s,t))return i.before(n+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let n=i.depth-1;n>=0;n--){let s=i.indexAfter(n);if(i.node(n).canReplaceWith(s,s,t))return i.after(n+1);if(s=0;o--){let a=o==i.depth?0:i.pos<=(i.start(o+1)+i.end(o+1))/2?-1:1,l=i.index(o)+(a>0?1:0),c=i.node(o),u=!1;if(s==1)u=c.canReplace(l,l,n);else{let h=c.contentMatchAt(l).findWrapping(n.firstChild.type);u=h&&c.canReplaceWith(l,l,h[0])}if(u)return a==0?i.pos:a<0?i.before(o+1):i.after(o+1)}return null}function vm(r,e,t=e,i=L.empty){if(e==t&&!i.size)return null;let n=r.resolve(e),s=r.resolve(t);return _v(n,s,i)?new et(e,t,i):new PM(n,s,i).fit()}function _v(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class PM{constructor(e,t,i){this.$from=e,this.$to=t,this.unplaced=i,this.frontier=[],this.placed=Z.empty;for(let n=0;n<=e.depth;n++){let s=e.node(n);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(n))})}for(let n=e.depth;n>0;n--)this.placed=Z.from(e.node(n).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,i=this.$from,n=this.close(e<0?this.$to:i.doc.resolve(e));if(!n)return null;let s=this.placed,o=i.depth,a=n.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new L(s,o,a);return e>-1?new ut(i.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||i.pos!=this.$to.pos?new et(i.pos,n.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,i=0,n=this.unplaced.openEnd;i1&&(n=0),s.type.spec.isolating&&n<=i){e=i;break}t=s.content}for(let t=1;t<=2;t++)for(let i=t==1?e:this.unplaced.openStart;i>=0;i--){let n,s=null;i?(s=Yh(this.unplaced.content,i-1).firstChild,n=s.content):n=this.unplaced.content;let o=n.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,h=null;if(t==1&&(o?c.matchType(o.type)||(h=c.fillBefore(Z.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:a,parent:s,inject:h};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:i,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:i}=this.unplaced,n=Yh(e,t);return!n.childCount||n.firstChild.isLeaf?!1:(this.unplaced=new L(e,t+1,Math.max(i,n.size+t>=e.size-i?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:i}=this.unplaced,n=Yh(e,t);if(n.childCount<=1&&t>0){let s=e.size-t<=t+n.size;this.unplaced=new L(Ho(e,t-1,1),t-1,s?t-1:i)}else this.unplaced=new L(Ho(e,t,1),t,i)}placeNodes({sliceDepth:e,frontierDepth:t,parent:i,inject:n,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let m=0;m1||l==0||m.content.size)&&(h=g,u.push(Gv(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?f:-1)))}let p=c==a.childCount;p||(f=-1),this.placed=Ko(this.placed,t,Z.from(u)),this.frontier[t].match=h,p&&f<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m1&&n==this.$to.end(--i);)++n;return n}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:i,type:n}=this.frontier[t],s=t=0;a--){let{match:l,type:c}=this.frontier[a],u=Vh(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ko(this.placed,t.depth,t.fit)),e=t.move;for(let i=t.depth+1;i<=e.depth;i++){let n=e.node(i),s=n.type.contentMatch.fillBefore(n.content,!0,e.index(i));this.openFrontierNode(n.type,n.attrs,s)}return e}openFrontierNode(e,t=null,i){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=Ko(this.placed,this.depth,Z.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Z.empty,!0);e.childCount&&(this.placed=Ko(this.placed,this.frontier.length,e))}}function Ho(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(Ho(r.firstChild.content,e-1,t)))}function Ko(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(Ko(r.lastChild.content,e-1,t)))}function Yh(r,e){for(let t=0;t1&&(i=i.replaceChild(0,Gv(i.firstChild,e-1,i.childCount==1?t-1:0))),e>0&&(i=r.type.contentMatch.fillBefore(i).append(i),t<=0&&(i=i.append(r.type.contentMatch.matchFragment(i).fillBefore(Z.empty,!0)))),r.copy(i)}function Vh(r,e,t,i,n){let s=r.node(e),o=n?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=i.fillBefore(s.content,!0,o);return a&&!EM(t,s.content,o)?a:null}function EM(r,e,t){for(let i=t;i0;d--,f--){let p=n.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(d)>-1?a=d:n.before(d)==f&&o.splice(1,0,-d)}let l=o.indexOf(a),c=[],u=i.openStart;for(let d=i.content,f=0;;f++){let p=d.firstChild;if(c.push(p),f==i.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let f=c[d],p=MM(f.type);if(p&&!f.sameMarkup(n.node(Math.abs(a)-1)))u=d;else if(p||!f.type.isTextblock)break}for(let d=i.openStart;d>=0;d--){let f=(d+u+1)%(i.openStart+1),p=c[f];if(p)for(let m=0;m=0&&(r.replace(e,t,i),!(r.steps.length>h));d--){let f=o[d];f<0||(e=n.before(f),t=s.after(f))}}function Hv(r,e,t,i,n){if(ei){let s=n.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(Z.empty,!0))}return r}function ZM(r,e,t,i){if(!i.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let n=TM(r.doc,e,i.type);n!=null&&(e=t=n)}r.replaceRange(e,t,new L(Z.from(i),0,0))}function NM(r,e,t){let i=r.doc.resolve(e),n=r.doc.resolve(t),s=Kv(i,n);for(let o=0;o0&&(l||i.node(a-1).canReplace(i.index(a-1),n.indexAfter(a-1))))return r.delete(i.before(a),n.after(a))}for(let o=1;o<=i.depth&&o<=n.depth;o++)if(e-i.start(o)==i.depth-o&&t>i.end(o)&&n.end(o)-t!=n.depth-o)return r.delete(i.before(o),t);r.delete(e,t)}function Kv(r,e){let t=[],i=Math.min(r.depth,e.depth);for(let n=i;n>=0;n--){let s=r.start(n);if(se.pos+(e.depth-n)||r.node(n).type.spec.isolating||e.node(n).type.spec.isolating)break;(s==e.start(n)||n==r.depth&&n==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&n&&e.start(n-1)==s-1)&&t.push(n)}return t}class Bs extends Et{constructor(e,t,i){super(),this.pos=e,this.attr=t,this.value=i}apply(e){let t=e.nodeAt(this.pos);if(!t)return We.fail("No node at attribute step's position");let i=Object.create(null);for(let s in t.attrs)i[s]=t.attrs[s];i[this.attr]=this.value;let n=t.type.create(i,null,t.marks);return We.fromReplace(e,this.pos,this.pos+1,new L(Z.from(n),0,t.isLeaf?0:1))}getMap(){return Ht.empty}invert(e){return new Bs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Bs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bs(t.pos,t.attr,t.value)}}Et.jsonID("attr",Bs);let eo=class extends Error{};eo=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.name="TransformError";class FM{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Is}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eo(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,i=L.empty){let n=vm(this.doc,e,t,i);return n&&this.step(n),this}replaceWith(e,t,i){return this.replace(e,t,new L(Z.from(i),0,0))}delete(e,t){return this.replace(e,t,L.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,i){return RM(this,e,t,i),this}replaceRangeWith(e,t,i){return ZM(this,e,t,i),this}deleteRange(e,t){return NM(this,e,t),this}lift(e,t){return wM(this,e,t),this}join(e,t=1){return DM(this,e,t),this}wrap(e,t){return xM(this,e,t),this}setBlockType(e,t=e,i,n=null){return SM(this,e,t,i,n),this}setNodeMarkup(e,t,i=null,n){return QM(this,e,t,i,n),this}setNodeAttribute(e,t,i){return this.step(new Bs(e,t,i)),this}addNodeMark(e,t){return this.step(new zi(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ae)){let i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at position "+e);if(t=t.isInSet(i.marks),!t)return this}return this.step(new Js(e,t)),this}split(e,t=1,i){return $M(this,e,t,i),this}addMark(e,t,i){return gM(this,e,t,i),this}removeMark(e,t,i){return OM(this,e,t,i),this}clearIncompatible(e,t,i){return yM(this,e,t,i),this}}const zh=Object.create(null);class ie{constructor(e,t,i){this.$anchor=e,this.$head=t,this.ranges=i||[new IM(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;s--){let o=t<0?Cs(e.node(0),e.node(s),e.before(s+1),e.index(s),t,i):Cs(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,i);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Yt(e.node(0))}static atStart(e){return Cs(e,e,0,0,1)||new Yt(e)}static atEnd(e){return Cs(e,e,e.content.size,e.childCount,-1)||new Yt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=zh[t.type];if(!i)throw new RangeError(`No selection type ${t.type} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in zh)throw new RangeError("Duplicate use of selection JSON ID "+e);return zh[e]=t,t.prototype.jsonID=e,t}getBookmark(){return oe.between(this.$anchor,this.$head).getBookmark()}}ie.prototype.visible=!0;let IM=class{constructor(r,e){this.$from=r,this.$to=e}},Qy=!1;function $y(r){!Qy&&!r.parent.inlineContent&&(Qy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class oe extends ie{constructor(e,t=e){$y(e),$y(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let i=e.resolve(t.map(this.head));if(!i.parent.inlineContent)return ie.near(i);let n=e.resolve(t.map(this.anchor));return new oe(n.parent.inlineContent?n:i,i)}replace(e,t=L.empty){if(super.replace(e,t),t==L.empty){let i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}eq(e){return e instanceof oe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new qu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new oe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,i=t){let n=e.resolve(t);return new this(n,i==t?n:e.resolve(i))}static between(e,t,i){let n=e.pos-t.pos;if((!i||n)&&(i=n>=0?1:-1),!t.parent.inlineContent){let s=ie.findFrom(t,i,!0)||ie.findFrom(t,-i,!0);if(s)t=s.$head;else return ie.near(t,i)}return e.parent.inlineContent||(n==0?e=t:(e=(ie.findFrom(e,-i,!0)||ie.findFrom(e,i,!0)).$anchor,e.pos0?0:1);n>0?o=0;o+=n){let a=e.child(o);if(a.isAtom){if(!s&&J.isSelectable(a))return J.create(r,t-(n<0?a.nodeSize:0))}else{let l=Cs(r,a,t+n,n<0?a.childCount:0,n,s);if(l)return l}t+=a.nodeSize*n}return null}function Ay(r,e,t){let i=r.steps.length-1;if(i{o==null&&(o=u)}),r.setSelection(ie.near(r.doc.resolve(o),t))}const Dy=1,Cl=2,Ty=4;let qM=class extends FM{constructor(r){super(r.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=r.selection,this.storedMarks=r.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(r){return this.storedMarks=r,this.updated|=Cl,this}ensureMarks(r){return ae.sameSet(this.storedMarks||this.selection.$from.marks(),r)||this.setStoredMarks(r),this}addStoredMark(r){return this.ensureMarks(r.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(r){return this.ensureMarks(r.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Cl)>0}addStep(r,e){super.addStep(r,e),this.updated=this.updated&~Cl,this.storedMarks=null}setTime(r){return this.time=r,this}replaceSelection(r){return this.selection.replace(this,r),this}replaceSelectionWith(r,e=!0){let t=this.selection;return e&&(r=r.mark(this.storedMarks||(t.empty?t.$from.marks():t.$from.marksAcross(t.$to)||ae.none))),t.replaceWith(this,r),this}deleteSelection(){return this.selection.replace(this),this}insertText(r,e,t){let i=this.doc.type.schema;if(e==null)return r?this.replaceSelectionWith(i.text(r),!0):this.deleteSelection();{if(t==null&&(t=e),t=t??e,!r)return this.deleteRange(e,t);let n=this.storedMarks;if(!n){let s=this.doc.resolve(e);n=t==e?s.marks():s.marksAcross(this.doc.resolve(t))}return this.replaceRangeWith(e,t,i.text(r,n)),this.selection.empty||this.setSelection(ie.near(this.selection.$to)),this}}setMeta(r,e){return this.meta[typeof r=="string"?r:r.key]=e,this}getMeta(r){return this.meta[typeof r=="string"?r:r.key]}get isGeneric(){for(let r in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ty,this}get scrolledIntoView(){return(this.updated&Ty)>0}};function Py(r,e){return!e||!r?r:r.bind(e)}class Jo{constructor(e,t,i){this.name=e,this.init=Py(t.init,i),this.apply=Py(t.apply,i)}}const LM=[new Jo("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Jo("selection",{init(r,e){return r.selection||ie.atStart(e.doc)},apply(r){return r.selection}}),new Jo("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,i){return i.selection.$cursor?r.storedMarks:null}}),new Jo("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];let Wh=class{constructor(r,e){this.schema=r,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=LM.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Jo(t.key,t.spec.state,t))})}},Jv=class ea{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let i=0;ii.toJSON())),e&&typeof e=="object")for(let i in e){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let n=e[i],s=n.spec.state;s&&s.toJSON&&(t[i]=s.toJSON.call(n,this[n.key]))}return t}static fromJSON(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let n=new Wh(e.schema,e.plugins),s=new ea(n);return n.fields.forEach(o=>{if(o.name=="doc")s.doc=br.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=ie.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(let a in i){let l=i[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=c.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}};function ek(r,e,t){for(let i in r){let n=r[i];n instanceof Function?n=n.bind(e):i=="handleDOMEvents"&&(n=ek(n,e,{})),t[i]=n}return t}class St{constructor(e){this.spec=e,this.props={},e.props&&ek(e.props,this,this.props),this.key=e.key?e.key.key:tk("plugin")}getState(e){return e[this.key]}}const jh=Object.create(null);function tk(r){return r in jh?r+"$"+ ++jh[r]:(jh[r]=0,r+"$")}class Wt{constructor(e="key"){this.key=tk(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const mt=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Pa=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let Ey=null;const di=function(r,e,t){let i=Ey||(Ey=document.createRange());return i.setEnd(r,t??r.nodeValue.length),i.setStart(r,e||0),i},rs=function(r,e,t,i){return t&&(My(r,e,t,i,-1)||My(r,e,t,i,1))},XM=/^(img|br|input|textarea|hr)$/i;function My(r,e,t,i,n){for(;;){if(r==t&&e==i)return!0;if(e==(n<0?0:Br(r))){let s=r.parentNode;if(!s||s.nodeType!=1||xm(r)||XM.test(r.nodeName)||r.contentEditable=="false")return!1;e=mt(r)+(n<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(n<0?-1:0)],r.contentEditable=="false")return!1;e=n<0?Br(r):0}else return!1}}function Br(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function YM(r,e,t){for(let i=e==0,n=e==Br(r);i||n;){if(r==t)return!0;let s=mt(r);if(r=r.parentNode,!r)return!1;i=i&&s==0,n=n&&s==Br(r)}}function xm(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const Lu=function(r){return r.focusNode&&rs(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function En(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function VM(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function zM(r,e,t){if(r.caretPositionFromPoint)try{let i=r.caretPositionFromPoint(e,t);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(r.caretRangeFromPoint){let i=r.caretRangeFromPoint(e,t);if(i)return{node:i.startContainer,offset:i.startOffset}}}const Jr=typeof navigator<"u"?navigator:null,Ry=typeof document<"u"?document:null,On=Jr&&Jr.userAgent||"",Rf=/Edge\/(\d+)/.exec(On),rk=/MSIE \d/.exec(On),Zf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(On),Tt=!!(rk||Zf||Rf),Ji=rk?document.documentMode:Zf?+Zf[1]:Rf?+Rf[1]:0,vr=!Tt&&/gecko\/(\d+)/i.test(On);vr&&+(/Firefox\/(\d+)/.exec(On)||[0,0])[1];const Nf=!Tt&&/Chrome\/(\d+)/.exec(On),ot=!!Nf,WM=Nf?+Nf[1]:0,vt=!Tt&&!!Jr&&/Apple Computer/.test(Jr.vendor),to=vt&&(/Mobile\/\w+/.test(On)||!!Jr&&Jr.maxTouchPoints>2),_t=to||(Jr?/Mac/.test(Jr.platform):!1),jM=Jr?/Win/.test(Jr.platform):!1,fr=/Android \d/.test(On),Xu=!!Ry&&"webkitFontSmoothing"in Ry.documentElement.style,UM=Xu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _M(r){return{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function ui(r,e){return typeof r=="number"?r:r[e]}function GM(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,i=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*i}}function Zy(r,e,t){let i=r.someProp("scrollThreshold")||0,n=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;o=Pa(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,c=l?_M(s):GM(a),u=0,h=0;if(e.topc.bottom-ui(i,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+ui(n,"top")-c.top:e.bottom-c.bottom+ui(n,"bottom")),e.leftc.right-ui(i,"right")&&(u=e.right-c.right+ui(n,"right")),u||h)if(l)s.defaultView.scrollBy(u,h);else{let d=a.scrollLeft,f=a.scrollTop;h&&(a.scrollTop+=h),u&&(a.scrollLeft+=u);let p=a.scrollLeft-d,m=a.scrollTop-f;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function HM(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),i,n;for(let s=(e.left+e.right)/2,o=t+1;o=t-20){i=a,n=l.top;break}}return{refDOM:i,refTop:n,stack:ik(r.dom)}}function ik(r){let e=[],t=r.ownerDocument;for(let i=r;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),r!=t);i=Pa(i));return e}function KM({refDOM:r,refTop:e,stack:t}){let i=r?r.getBoundingClientRect().top:0;nk(t,i==0?0:i-e)}function nk(r,e){for(let t=0;t=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=h+1)}}return!t&&l&&(t=l,n=c,i=0),t&&t.nodeType==3?e2(t,n):!t||i&&t.nodeType==1?{node:r,offset:s}:sk(t,n)}function e2(r,e){let t=r.nodeValue.length,i=document.createRange();for(let n=0;n=(s.left+s.right)/2?1:0)}}return{node:r,offset:0}}function Sm(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function t2(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left