(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{1051:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return Ce}),V.d(pe,"b",function(){return W}),V.d(pe,"c",function(){return xe}),V.d(pe,"d",function(){return de}),V.d(pe,"e",function(){return ee}),V.d(pe,"f",function(){return be}),V.d(pe,"g",function(){return it}),V.d(pe,"h",function(){return Re}),V.d(pe,"i",function(){return ne}),V.d(pe,"j",function(){return Be});function j(k){this.content=k}j.prototype={constructor:j,find:function(k){for(var r=0;r<this.content.length;r+=2)if(this.content[r]===k)return r;return-1},get:function(k){var r=this.find(k);return r==-1?void 0:this.content[r+1]},update:function(k,r,s){var d=s&&s!=k?this.remove(s):this,v=d.find(k),b=d.content.slice();return v==-1?b.push(s||k,r):(b[v+1]=r,s&&(b[v]=s)),new j(b)},remove:function(k){var r=this.find(k);if(r==-1)return this;var s=this.content.slice();return s.splice(r,2),new j(s)},addToStart:function(k,r){return new j([k,r].concat(this.remove(k).content))},addToEnd:function(k,r){var s=this.remove(k).content.slice();return s.push(k,r),new j(s)},addBefore:function(k,r,s){var d=this.remove(r),v=d.content.slice(),b=d.find(k);return v.splice(b==-1?v.length:b,0,r,s),new j(v)},forEach:function(k){for(var r=0;r<this.content.length;r+=2)k(this.content[r],this.content[r+1])},prepend:function(k){return k=j.from(k),k.size?new j(k.content.concat(this.subtract(k).content)):this},append:function(k){return k=j.from(k),k.size?new j(this.subtract(k).content.concat(k.content)):this},subtract:function(k){var r=this;k=j.from(k);for(var s=0;s<k.content.length;s+=2)r=r.remove(k.content[s]);return r},toObject:function(){var k={};return this.forEach(function(r,s){k[r]=s}),k},get size(){return this.content.length>>1}},j.from=function(k){if(k instanceof j)return k;var r=[];if(k)for(var s in k)r.push(s,k[s]);return new j(r)};var Ee=j;function me(k,r,s){for(let d=0;;d++){if(d==k.childCount||d==r.childCount)return k.childCount==r.childCount?null:s;let v=k.child(d),b=r.child(d);if(v==b){s+=v.nodeSize;continue}if(!v.sameMarkup(b))return s;if(v.isText&&v.text!=b.text){for(let O=0;v.text[O]==b.text[O];O++)s++;return s}if(v.content.size||b.content.size){let O=me(v.content,b.content,s+1);if(O!=null)return O}s+=v.nodeSize}}function _(k,r,s,d){for(let v=k.childCount,b=r.childCount;;){if(v==0||b==0)return v==b?null:{a:s,b:d};let O=k.child(--v),L=r.child(--b),U=O.nodeSize;if(O==L){s-=U,d-=U;continue}if(!O.sameMarkup(L))return{a:s,b:d};if(O.isText&&O.text!=L.text){let Ae=0,Ne=Math.min(O.text.length,L.text.length);for(;Ae<Ne&&O.text[O.text.length-Ae-1]==L.text[L.text.length-Ae-1];)Ae++,s--,d--;return{a:s,b:d}}if(O.content.size||L.content.size){let Ae=_(O.content,L.content,s-1,d-1);if(Ae)return Ae}s-=U,d-=U}}class xe{constructor(r,s){if(this.content=r,this.size=s||0,s==null)for(let d=0;d<r.length;d++)this.size+=r[d].nodeSize}nodesBetween(r,s,d,v=0,b){for(let O=0,L=0;L<s;O++){let U=this.content[O],Ae=L+U.nodeSize;if(Ae>r&&d(U,v+L,b||null,O)!==!1&&U.content.size){let Ne=L+1;U.nodesBetween(Math.max(0,r-Ne),Math.min(U.content.size,s-Ne),d,v+Ne)}L=Ae}}descendants(r){this.nodesBetween(0,this.size,r)}textBetween(r,s,d,v){let b="",O=!0;return this.nodesBetween(r,s,(L,U)=>{L.isText?(b+=L.text.slice(Math.max(r,U)-U,s-U),O=!d):L.isLeaf?(v?b+=typeof v=="function"?v(L):v:L.type.spec.leafText&&(b+=L.type.spec.leafText(L)),O=!d):!O&&L.isBlock&&(b+=d,O=!0)},0),b}append(r){if(!r.size)return this;if(!this.size)return r;let s=this.lastChild,d=r.firstChild,v=this.content.slice(),b=0;for(s.isText&&s.sameMarkup(d)&&(v[v.length-1]=s.withText(s.text+d.text),b=1);b<r.content.length;b++)v.push(r.content[b]);return new xe(v,this.size+r.size)}cut(r,s=this.size){if(r==0&&s==this.size)return this;let d=[],v=0;if(s>r)for(let b=0,O=0;O<s;b++){let L=this.content[b],U=O+L.nodeSize;U>r&&((O<r||U>s)&&(L.isText?L=L.cut(Math.max(0,r-O),Math.min(L.text.length,s-O)):L=L.cut(Math.max(0,r-O-1),Math.min(L.content.size,s-O-1))),d.push(L),v+=L.nodeSize),O=U}return new xe(d,v)}cutByIndex(r,s){return r==s?xe.empty:r==0&&s==this.content.length?this:new xe(this.content.slice(r,s))}replaceChild(r,s){let d=this.content[r];if(d==s)return this;let v=this.content.slice(),b=this.size+s.nodeSize-d.nodeSize;return v[r]=s,new xe(v,b)}addToStart(r){return new xe([r].concat(this.content),this.size+r.nodeSize)}addToEnd(r){return new xe(this.content.concat(r),this.size+r.nodeSize)}eq(r){if(this.content.length!=r.content.length)return!1;for(let s=0;s<this.content.length;s++)if(!this.content[s].eq(r.content[s]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(r){let s=this.content[r];if(!s)throw new RangeError("Index "+r+" out of range for "+this);return s}maybeChild(r){return this.content[r]||null}forEach(r){for(let s=0,d=0;s<this.content.length;s++){let v=this.content[s];r(v,d,s),d+=v.nodeSize}}findDiffStart(r,s=0){return me(this,r,s)}findDiffEnd(r,s=this.size,d=r.size){return _(this,r,s,d)}findIndex(r,s=-1){if(r==0)return Fe(0,r);if(r==this.size)return Fe(this.content.length,r);if(r>this.size||r<0)throw new RangeError(`Position ${r} outside of fragment (${this})`);for(let d=0,v=0;;d++){let b=this.child(d),O=v+b.nodeSize;if(O>=r)return O==r||s>0?Fe(d+1,O):Fe(d,v);v=O}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(r=>r.toJSON()):null}static fromJSON(r,s){if(!s)return xe.empty;if(!Array.isArray(s))throw new RangeError("Invalid input for Fragment.fromJSON");return new xe(s.map(r.nodeFromJSON))}static fromArray(r){if(!r.length)return xe.empty;let s,d=0;for(let v=0;v<r.length;v++){let b=r[v];d+=b.nodeSize,v&&b.isText&&r[v-1].sameMarkup(b)?(s||(s=r.slice(0,v)),s[s.length-1]=b.withText(s[s.length-1].text+b.text)):s&&s.push(b)}return new xe(s||r,d)}static from(r){if(!r)return xe.empty;if(r instanceof xe)return r;if(Array.isArray(r))return this.fromArray(r);if(r.attrs)return new xe([r],r.nodeSize);throw new RangeError("Can not convert "+r+" to a Fragment"+(r.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}xe.empty=new xe([],0);const Dt={index:0,offset:0};function Fe(k,r){return Dt.index=k,Dt.offset=r,Dt}function ot(k,r){if(k===r)return!0;if(!(k&&typeof k=="object")||!(r&&typeof r=="object"))return!1;let s=Array.isArray(k);if(Array.isArray(r)!=s)return!1;if(s){if(k.length!=r.length)return!1;for(let d=0;d<k.length;d++)if(!ot(k[d],r[d]))return!1}else{for(let d in k)if(!(d in r)||!ot(k[d],r[d]))return!1;for(let d in r)if(!(d in k))return!1}return!0}class de{constructor(r,s){this.type=r,this.attrs=s}addToSet(r){let s,d=!1;for(let v=0;v<r.length;v++){let b=r[v];if(this.eq(b))return r;if(this.type.excludes(b.type))s||(s=r.slice(0,v));else{if(b.type.excludes(this.type))return r;!d&&b.type.rank>this.type.rank&&(s||(s=r.slice(0,v)),s.push(this),d=!0),s&&s.push(b)}}return s||(s=r.slice()),d||s.push(this),s}removeFromSet(r){for(let s=0;s<r.length;s++)if(this.eq(r[s]))return r.slice(0,s).concat(r.slice(s+1));return r}isInSet(r){for(let s=0;s<r.length;s++)if(this.eq(r[s]))return!0;return!1}eq(r){return this==r||this.type==r.type&&ot(this.attrs,r.attrs)}toJSON(){let r={type:this.type.name};for(let s in this.attrs){r.attrs=this.attrs;break}return r}static fromJSON(r,s){if(!s)throw new RangeError("Invalid input for Mark.fromJSON");let d=r.marks[s.type];if(!d)throw new RangeError(`There is no mark type ${s.type} in this schema`);return d.create(s.attrs)}static sameSet(r,s){if(r==s)return!0;if(r.length!=s.length)return!1;for(let d=0;d<r.length;d++)if(!r[d].eq(s[d]))return!1;return!0}static setFrom(r){if(!r||Array.isArray(r)&&r.length==0)return de.none;if(r instanceof de)return[r];let s=r.slice();return s.sort((d,v)=>d.type.rank-v.type.rank),s}}de.none=[];class Re extends Error{}class Be{constructor(r,s,d){this.content=r,this.openStart=s,this.openEnd=d}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(r,s){let d=_e(this.content,r+this.openStart,s);return d&&new Be(d,this.openStart,this.openEnd)}removeBetween(r,s){return new Be(Pe(this.content,r+this.openStart,s+this.openStart),this.openStart,this.openEnd)}eq(r){return this.content.eq(r.content)&&this.openStart==r.openStart&&this.openEnd==r.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let r={content:this.content.toJSON()};return this.openStart>0&&(r.openStart=this.openStart),this.openEnd>0&&(r.openEnd=this.openEnd),r}static fromJSON(r,s){if(!s)return Be.empty;let d=s.openStart||0,v=s.openEnd||0;if(typeof d!="number"||typeof v!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Be(xe.fromJSON(r,s.content),d,v)}static maxOpen(r,s=!0){let d=0,v=0;for(let b=r.firstChild;b&&!b.isLeaf&&(s||!b.type.spec.isolating);b=b.firstChild)d++;for(let b=r.lastChild;b&&!b.isLeaf&&(s||!b.type.spec.isolating);b=b.lastChild)v++;return new Be(r,d,v)}}Be.empty=new Be(xe.empty,0,0);function Pe(k,r,s){let{index:d,offset:v}=k.findIndex(r),b=k.maybeChild(d),{index:O,offset:L}=k.findIndex(s);if(v==r||b.isText){if(L!=s&&!k.child(O).isText)throw new RangeError("Removing non-flat range");return k.cut(0,r).append(k.cut(s))}if(d!=O)throw new RangeError("Removing non-flat range");return k.replaceChild(d,b.copy(Pe(b.content,r-v-1,s-v-1)))}function _e(k,r,s,d){let{index:v,offset:b}=k.findIndex(r),O=k.maybeChild(v);if(b==r||O.isText)return d&&!d.canReplace(v,v,s)?null:k.cut(0,r).append(s).append(k.cut(r));let L=_e(O.content,r-b-1,s);return L&&k.replaceChild(v,O.copy(L))}function dt(k,r,s){if(s.openStart>k.depth)throw new Re("Inserted content deeper than insertion position");if(k.depth-s.openStart!=r.depth-s.openEnd)throw new Re("Inconsistent open depths");return et(k,r,s,0)}function et(k,r,s,d){let v=k.index(d),b=k.node(d);if(v==r.index(d)&&d<k.depth-s.openStart){let O=et(k,r,s,d+1);return b.copy(b.content.replaceChild(v,O))}else if(s.content.size)if(!s.openStart&&!s.openEnd&&k.depth==d&&r.depth==d){let O=k.parent,L=O.content;return we(O,L.cut(0,k.parentOffset).append(s.content).append(L.cut(r.parentOffset)))}else{let{start:O,end:L}=We(s,k);return we(b,Me(k,O,L,r,d))}else return we(b,Ke(k,r,d))}function Je(k,r){if(!r.type.compatibleContent(k.type))throw new Re("Cannot join "+r.type.name+" onto "+k.type.name)}function ft(k,r,s){let d=k.node(s);return Je(d,r.node(s)),d}function Ie(k,r){let s=r.length-1;s>=0&&k.isText&&k.sameMarkup(r[s])?r[s]=k.withText(r[s].text+k.text):r.push(k)}function Se(k,r,s,d){let v=(r||k).node(s),b=0,O=r?r.index(s):v.childCount;k&&(b=k.index(s),k.depth>s?b++:k.textOffset&&(Ie(k.nodeAfter,d),b++));for(let L=b;L<O;L++)Ie(v.child(L),d);r&&r.depth==s&&r.textOffset&&Ie(r.nodeBefore,d)}function we(k,r){return k.type.checkContent(r),k.copy(r)}function Me(k,r,s,d,v){let b=k.depth>v&&ft(k,r,v+1),O=d.depth>v&&ft(s,d,v+1),L=[];return Se(null,k,v,L),b&&O&&r.index(v)==s.index(v)?(Je(b,O),Ie(we(b,Me(k,r,s,d,v+1)),L)):(b&&Ie(we(b,Ke(k,r,v+1)),L),Se(r,s,v,L),O&&Ie(we(O,Ke(s,d,v+1)),L)),Se(d,null,v,L),new xe(L)}function Ke(k,r,s){let d=[];if(Se(null,k,s,d),k.depth>s){let v=ft(k,r,s+1);Ie(we(v,Ke(k,r,s+1)),d)}return Se(r,null,s,d),new xe(d)}function We(k,r){let s=r.depth-k.openStart,v=r.node(s).copy(k.content);for(let b=s-1;b>=0;b--)v=r.node(b).copy(xe.from(v));return{start:v.resolveNoCache(k.openStart+s),end:v.resolveNoCache(v.content.size-k.openEnd-s)}}class Ve{constructor(r,s,d){this.pos=r,this.path=s,this.parentOffset=d,this.depth=s.length/3-1}resolveDepth(r){return r==null?this.depth:r<0?this.depth+r:r}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(r){return this.path[this.resolveDepth(r)*3]}index(r){return this.path[this.resolveDepth(r)*3+1]}indexAfter(r){return r=this.resolveDepth(r),this.index(r)+(r==this.depth&&!this.textOffset?0:1)}start(r){return r=this.resolveDepth(r),r==0?0:this.path[r*3-1]+1}end(r){return r=this.resolveDepth(r),this.start(r)+this.node(r).content.size}before(r){if(r=this.resolveDepth(r),!r)throw new RangeError("There is no position before the top-level node");return r==this.depth+1?this.pos:this.path[r*3-1]}after(r){if(r=this.resolveDepth(r),!r)throw new RangeError("There is no position after the top-level node");return r==this.depth+1?this.pos:this.path[r*3-1]+this.path[r*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let r=this.parent,s=this.index(this.depth);if(s==r.childCount)return null;let d=this.pos-this.path[this.path.length-1],v=r.child(s);return d?r.child(s).cut(d):v}get nodeBefore(){let r=this.index(this.depth),s=this.pos-this.path[this.path.length-1];return s?this.parent.child(r).cut(0,s):r==0?null:this.parent.child(r-1)}posAtIndex(r,s){s=this.resolveDepth(s);let d=this.path[s*3],v=s==0?0:this.path[s*3-1]+1;for(let b=0;b<r;b++)v+=d.child(b).nodeSize;return v}marks(){let r=this.parent,s=this.index();if(r.content.size==0)return de.none;if(this.textOffset)return r.child(s).marks;let d=r.maybeChild(s-1),v=r.maybeChild(s);if(!d){let L=d;d=v,v=L}let b=d.marks;for(var O=0;O<b.length;O++)b[O].type.spec.inclusive===!1&&(!v||!b[O].isInSet(v.marks))&&(b=b[O--].removeFromSet(b));return b}marksAcross(r){let s=this.parent.maybeChild(this.index());if(!s||!s.isInline)return null;let d=s.marks,v=r.parent.maybeChild(r.index());for(var b=0;b<d.length;b++)d[b].type.spec.inclusive===!1&&(!v||!d[b].isInSet(v.marks))&&(d=d[b--].removeFromSet(d));return d}sharedDepth(r){for(let s=this.depth;s>0;s--)if(this.start(s)<=r&&this.end(s)>=r)return s;return 0}blockRange(r=this,s){if(r.pos<this.pos)return r.blockRange(this);for(let d=this.depth-(this.parent.inlineContent||this.pos==r.pos?1:0);d>=0;d--)if(r.pos<=this.end(d)&&(!s||s(this.node(d))))return new it(this,r,d);return null}sameParent(r){return this.pos-this.parentOffset==r.pos-r.parentOffset}max(r){return r.pos>this.pos?r:this}min(r){return r.pos<this.pos?r:this}toString(){let r="";for(let s=1;s<=this.depth;s++)r+=(r?"/":"")+this.node(s).type.name+"_"+this.index(s-1);return r+":"+this.parentOffset}static resolve(r,s){if(!(s>=0&&s<=r.content.size))throw new RangeError("Position "+s+" out of range");let d=[],v=0,b=s;for(let O=r;;){let{index:L,offset:U}=O.content.findIndex(b),Ae=b-U;if(d.push(O,L,v+U),!Ae||(O=O.child(L),O.isText))break;b=Ae-1,v+=U+1}return new Ve(s,d,b)}static resolveCached(r,s){for(let v=0;v<rt.length;v++){let b=rt[v];if(b.pos==s&&b.doc==r)return b}let d=rt[Qe]=Ve.resolve(r,s);return Qe=(Qe+1)%mt,d}}let rt=[],Qe=0,mt=12;class it{constructor(r,s,d){this.$from=r,this.$to=s,this.depth=d}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Pt=Object.create(null);class be{constructor(r,s,d,v=de.none){this.type=r,this.attrs=s,this.marks=v,this.content=d||xe.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(r){return this.content.child(r)}maybeChild(r){return this.content.maybeChild(r)}forEach(r){this.content.forEach(r)}nodesBetween(r,s,d,v=0){this.content.nodesBetween(r,s,d,v,this)}descendants(r){this.nodesBetween(0,this.content.size,r)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(r,s,d,v){return this.content.textBetween(r,s,d,v)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(r){return this==r||this.sameMarkup(r)&&this.content.eq(r.content)}sameMarkup(r){return this.hasMarkup(r.type,r.attrs,r.marks)}hasMarkup(r,s,d){return this.type==r&&ot(this.attrs,s||r.defaultAttrs||Pt)&&de.sameSet(this.marks,d||de.none)}copy(r=null){return r==this.content?this:new be(this.type,this.attrs,r,this.marks)}mark(r){return r==this.marks?this:new be(this.type,this.attrs,this.content,r)}cut(r,s=this.content.size){return r==0&&s==this.content.size?this:this.copy(this.content.cut(r,s))}slice(r,s=this.content.size,d=!1){if(r==s)return Be.empty;let v=this.resolve(r),b=this.resolve(s),O=d?0:v.sharedDepth(s),L=v.start(O),Ae=v.node(O).content.cut(v.pos-L,b.pos-L);return new Be(Ae,v.depth-O,b.depth-O)}replace(r,s,d){return dt(this.resolve(r),this.resolve(s),d)}nodeAt(r){for(let s=this;;){let{index:d,offset:v}=s.content.findIndex(r);if(s=s.maybeChild(d),!s)return null;if(v==r||s.isText)return s;r-=v+1}}childAfter(r){let{index:s,offset:d}=this.content.findIndex(r);return{node:this.content.maybeChild(s),index:s,offset:d}}childBefore(r){if(r==0)return{node:null,index:0,offset:0};let{index:s,offset:d}=this.content.findIndex(r);if(d<r)return{node:this.content.child(s),index:s,offset:d};let v=this.content.child(s-1);return{node:v,index:s-1,offset:d-v.nodeSize}}resolve(r){return Ve.resolveCached(this,r)}resolveNoCache(r){return Ve.resolve(this,r)}rangeHasMark(r,s,d){let v=!1;return s>r&&this.nodesBetween(r,s,b=>(d.isInSet(b.marks)&&(v=!0),!v)),v}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 r=this.type.name;return this.content.size&&(r+="("+this.content.toStringInner()+")"),$(this.marks,r)}contentMatchAt(r){let s=this.type.contentMatch.matchFragment(this.content,0,r);if(!s)throw new Error("Called contentMatchAt on a node with invalid content");return s}canReplace(r,s,d=xe.empty,v=0,b=d.childCount){let O=this.contentMatchAt(r).matchFragment(d,v,b),L=O&&O.matchFragment(this.content,s);if(!L||!L.validEnd)return!1;for(let U=v;U<b;U++)if(!this.type.allowsMarks(d.child(U).marks))return!1;return!0}canReplaceWith(r,s,d,v){if(v&&!this.type.allowsMarks(v))return!1;let b=this.contentMatchAt(r).matchType(d),O=b&&b.matchFragment(this.content,s);return O?O.validEnd:!1}canAppend(r){return r.content.size?this.canReplace(this.childCount,this.childCount,r.content):this.type.compatibleContent(r.type)}check(){this.type.checkContent(this.content);let r=de.none;for(let s=0;s<this.marks.length;s++)r=this.marks[s].addToSet(r);if(!de.sameSet(r,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(s=>s.type.name)}`);this.content.forEach(s=>s.check())}toJSON(){let r={type:this.type.name};for(let s in this.attrs){r.attrs=this.attrs;break}return this.content.size&&(r.content=this.content.toJSON()),this.marks.length&&(r.marks=this.marks.map(s=>s.toJSON())),r}static fromJSON(r,s){if(!s)throw new RangeError("Invalid input for Node.fromJSON");let d=null;if(s.marks){if(!Array.isArray(s.marks))throw new RangeError("Invalid mark data for Node.fromJSON");d=s.marks.map(r.markFromJSON)}if(s.type=="text"){if(typeof s.text!="string")throw new RangeError("Invalid text node in JSON");return r.text(s.text,d)}let v=xe.fromJSON(r,s.content);return r.nodeType(s.type).create(s.attrs,v,d)}}be.prototype.text=void 0;class T extends be{constructor(r,s,d,v){if(super(r,s,null,v),!d)throw new RangeError("Empty text nodes are not allowed");this.text=d}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(r,s){return this.text.slice(r,s)}get nodeSize(){return this.text.length}mark(r){return r==this.marks?this:new T(this.type,this.attrs,this.text,r)}withText(r){return r==this.text?this:new T(this.type,this.attrs,r,this.marks)}cut(r=0,s=this.text.length){return r==0&&s==this.text.length?this:this.withText(this.text.slice(r,s))}eq(r){return this.sameMarkup(r)&&this.text==r.text}toJSON(){let r=super.toJSON();return r.text=this.text,r}}function $(k,r){for(let s=k.length-1;s>=0;s--)r=k[s].type.name+"("+r+")";return r}class Y{constructor(r){this.validEnd=r,this.next=[],this.wrapCache=[]}static parse(r,s){let d=new ce(r,s);if(d.next==null)return Y.empty;let v=Oe(d);d.next&&d.err("Unexpected trailing text");let b=Ft(Rt(v));return ln(b,d),b}matchType(r){for(let s=0;s<this.next.length;s++)if(this.next[s].type==r)return this.next[s].next;return null}matchFragment(r,s=0,d=r.childCount){let v=this;for(let b=s;v&&b<d;b++)v=v.matchType(r.child(b).type);return v}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let r=0;r<this.next.length;r++){let{type:s}=this.next[r];if(!(s.isText||s.hasRequiredAttrs()))return s}return null}compatible(r){for(let s=0;s<this.next.length;s++)for(let d=0;d<r.next.length;d++)if(this.next[s].type==r.next[d].type)return!0;return!1}fillBefore(r,s=!1,d=0){let v=[this];function b(O,L){let U=O.matchFragment(r,d);if(U&&(!s||U.validEnd))return xe.from(L.map(Ae=>Ae.createAndFill()));for(let Ae=0;Ae<O.next.length;Ae++){let{type:Ne,next:wt}=O.next[Ae];if(!(Ne.isText||Ne.hasRequiredAttrs())&&v.indexOf(wt)==-1){v.push(wt);let un=b(wt,L.concat(Ne));if(un)return un}}return null}return b(this,[])}findWrapping(r){for(let d=0;d<this.wrapCache.length;d+=2)if(this.wrapCache[d]==r)return this.wrapCache[d+1];let s=this.computeWrapping(r);return this.wrapCache.push(r,s),s}computeWrapping(r){let s=Object.create(null),d=[{match:this,type:null,via:null}];for(;d.length;){let v=d.shift(),b=v.match;if(b.matchType(r)){let O=[];for(let L=v;L.type;L=L.via)O.push(L.type);return O.reverse()}for(let O=0;O<b.next.length;O++){let{type:L,next:U}=b.next[O];!L.isLeaf&&!L.hasRequiredAttrs()&&!(L.name in s)&&(!v.type||U.validEnd)&&(d.push({match:L.contentMatch,type:L,via:v}),s[L.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(r){if(r>=this.next.length)throw new RangeError(`There's no ${r}th edge in this content match`);return this.next[r]}toString(){let r=[];function s(d){r.push(d);for(let v=0;v<d.next.length;v++)r.indexOf(d.next[v].next)==-1&&s(d.next[v].next)}return s(this),r.map((d,v)=>{let b=v+(d.validEnd?"*":" ")+" ";for(let O=0;O<d.next.length;O++)b+=(O?", ":"")+d.next[O].type.name+"->"+r.indexOf(d.next[O].next);return b}).join(`
`)}}Y.empty=new Y(!0);class ce{constructor(r,s){this.string=r,this.nodeTypes=s,this.inline=null,this.pos=0,this.tokens=r.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(r){return this.next==r&&(this.pos++||!0)}err(r){throw new SyntaxError(r+" (in content expression '"+this.string+"')")}}function Oe(k){let r=[];do r.push(je(k));while(k.eat("|"));return r.length==1?r[0]:{type:"choice",exprs:r}}function je(k){let r=[];do r.push(tt(k));while(k.next&&k.next!=")"&&k.next!="|");return r.length==1?r[0]:{type:"seq",exprs:r}}function tt(k){let r=Tt(k);for(;;)if(k.eat("+"))r={type:"plus",expr:r};else if(k.eat("*"))r={type:"star",expr:r};else if(k.eat("?"))r={type:"opt",expr:r};else if(k.eat("{"))r=Ct(k,r);else break;return r}function at(k){/\D/.test(k.next)&&k.err("Expected number, got '"+k.next+"'");let r=Number(k.next);return k.pos++,r}function Ct(k,r){let s=at(k),d=s;return k.eat(",")&&(k.next!="}"?d=at(k):d=-1),k.eat("}")||k.err("Unclosed braced range"),{type:"range",min:s,max:d,expr:r}}function vt(k,r){let s=k.nodeTypes,d=s[r];if(d)return[d];let v=[];for(let b in s){let O=s[b];O.groups.indexOf(r)>-1&&v.push(O)}return v.length==0&&k.err("No node type or group '"+r+"' found"),v}function Tt(k){if(k.eat("(")){let r=Oe(k);return k.eat(")")||k.err("Missing closing paren"),r}else if(/\W/.test(k.next))k.err("Unexpected token '"+k.next+"'");else{let r=vt(k,k.next).map(s=>(k.inline==null?k.inline=s.isInline:k.inline!=s.isInline&&k.err("Mixing inline and block content"),{type:"name",value:s}));return k.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}}function Rt(k){let r=[[]];return v(b(k,0),s()),r;function s(){return r.push([])-1}function d(O,L,U){let Ae={term:U,to:L};return r[O].push(Ae),Ae}function v(O,L){O.forEach(U=>U.to=L)}function b(O,L){if(O.type=="choice")return O.exprs.reduce((U,Ae)=>U.concat(b(Ae,L)),[]);if(O.type=="seq")for(let U=0;;U++){let Ae=b(O.exprs[U],L);if(U==O.exprs.length-1)return Ae;v(Ae,L=s())}else if(O.type=="star"){let U=s();return d(L,U),v(b(O.expr,U),U),[d(U)]}else if(O.type=="plus"){let U=s();return v(b(O.expr,L),U),v(b(O.expr,U),U),[d(U)]}else{if(O.type=="opt")return[d(L)].concat(b(O.expr,L));if(O.type=="range"){let U=L;for(let Ae=0;Ae<O.min;Ae++){let Ne=s();v(b(O.expr,U),Ne),U=Ne}if(O.max==-1)v(b(O.expr,U),U);else for(let Ae=O.min;Ae<O.max;Ae++){let Ne=s();d(U,Ne),v(b(O.expr,U),Ne),U=Ne}return[d(U)]}else{if(O.type=="name")return[d(L,void 0,O.value)];throw new Error("Unknown expr type")}}}}function Ht(k,r){return r-k}function St(k,r){let s=[];return d(r),s.sort(Ht);function d(v){let b=k[v];if(b.length==1&&!b[0].term)return d(b[0].to);s.push(v);for(let O=0;O<b.length;O++){let{term:L,to:U}=b[O];!L&&s.indexOf(U)==-1&&d(U)}}}function Ft(k){let r=Object.create(null);return s(St(k,0));function s(d){let v=[];d.forEach(O=>{k[O].forEach(({term:L,to:U})=>{if(!L)return;let Ae;for(let Ne=0;Ne<v.length;Ne++)v[Ne][0]==L&&(Ae=v[Ne][1]);St(k,U).forEach(Ne=>{Ae||v.push([L,Ae=[]]),Ae.indexOf(Ne)==-1&&Ae.push(Ne)})})});let b=r[d.join(",")]=new Y(d.indexOf(k.length-1)>-1);for(let O=0;O<v.length;O++){let L=v[O][1].sort(Ht);b.next.push({type:v[O][0],next:r[L.join(",")]||s(L)})}return b}}function ln(k,r){for(let s=0,d=[k];s<d.length;s++){let v=d[s],b=!v.validEnd,O=[];for(let L=0;L<v.next.length;L++){let{type:U,next:Ae}=v.next[L];O.push(U.name),b&&!(U.isText||U.hasRequiredAttrs())&&(b=!1),d.indexOf(Ae)==-1&&d.push(Ae)}b&&r.err("Only non-generatable nodes ("+O.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function xt(k){let r=Object.create(null);for(let s in k){let d=k[s];if(!d.hasDefault)return null;r[s]=d.default}return r}function J(k,r){let s=Object.create(null);for(let d in k){let v=r&&r[d];if(v===void 0){let b=k[d];if(b.hasDefault)v=b.default;else throw new RangeError("No value supplied for attribute "+d)}s[d]=v}return s}function H(k){let r=Object.create(null);if(k)for(let s in k)r[s]=new Q(k[s]);return r}class G{constructor(r,s,d){this.name=r,this.schema=s,this.spec=d,this.markSet=null,this.groups=d.group?d.group.split(" "):[],this.attrs=H(d.attrs),this.defaultAttrs=xt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(d.inline||r=="text"),this.isText=r=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Y.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let r in this.attrs)if(this.attrs[r].isRequired)return!0;return!1}compatibleContent(r){return this==r||this.contentMatch.compatible(r.contentMatch)}computeAttrs(r){return!r&&this.defaultAttrs?this.defaultAttrs:J(this.attrs,r)}create(r=null,s,d){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new be(this,this.computeAttrs(r),xe.from(s),de.setFrom(d))}createChecked(r=null,s,d){return s=xe.from(s),this.checkContent(s),new be(this,this.computeAttrs(r),s,de.setFrom(d))}createAndFill(r=null,s,d){if(r=this.computeAttrs(r),s=xe.from(s),s.size){let O=this.contentMatch.fillBefore(s);if(!O)return null;s=O.append(s)}let v=this.contentMatch.matchFragment(s),b=v&&v.fillBefore(xe.empty,!0);return b?new be(this,r,s.append(b),de.setFrom(d)):null}validContent(r){let s=this.contentMatch.matchFragment(r);if(!s||!s.validEnd)return!1;for(let d=0;d<r.childCount;d++)if(!this.allowsMarks(r.child(d).marks))return!1;return!0}checkContent(r){if(!this.validContent(r))throw new RangeError(`Invalid content for node ${this.name}: ${r.toString().slice(0,50)}`)}allowsMarkType(r){return this.markSet==null||this.markSet.indexOf(r)>-1}allowsMarks(r){if(this.markSet==null)return!0;for(let s=0;s<r.length;s++)if(!this.allowsMarkType(r[s].type))return!1;return!0}allowedMarks(r){if(this.markSet==null)return r;let s;for(let d=0;d<r.length;d++)this.allowsMarkType(r[d].type)?s&&s.push(r[d]):s||(s=r.slice(0,d));return s?s.length?s:de.none:r}static compile(r,s){let d=Object.create(null);r.forEach((b,O)=>d[b]=new G(b,s,O));let v=s.spec.topNode||"doc";if(!d[v])throw new RangeError("Schema is missing its top node type ('"+v+"')");if(!d.text)throw new RangeError("Every schema needs a 'text' type");for(let b in d.text.attrs)throw new RangeError("The text node type should not have attributes");return d}}class Q{constructor(r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default}get isRequired(){return!this.hasDefault}}class ee{constructor(r,s,d,v){this.name=r,this.rank=s,this.schema=d,this.spec=v,this.attrs=H(v.attrs),this.excluded=null;let b=xt(this.attrs);this.instance=b?new de(this,b):null}create(r=null){return!r&&this.instance?this.instance:new de(this,J(this.attrs,r))}static compile(r,s){let d=Object.create(null),v=0;return r.forEach((b,O)=>d[b]=new ee(b,v++,s,O)),d}removeFromSet(r){for(var s=0;s<r.length;s++)r[s].type==this&&(r=r.slice(0,s).concat(r.slice(s+1)),s--);return r}isInSet(r){for(let s=0;s<r.length;s++)if(r[s].type==this)return r[s]}excludes(r){return this.excluded.indexOf(r)>-1}}class ne{constructor(r){this.cached=Object.create(null);let s=this.spec={};for(let v in r)s[v]=r[v];s.nodes=Ee.from(r.nodes),s.marks=Ee.from(r.marks||{}),this.nodes=G.compile(this.spec.nodes,this),this.marks=ee.compile(this.spec.marks,this);let d=Object.create(null);for(let v in this.nodes){if(v in this.marks)throw new RangeError(v+" can not be both a node and a mark");let b=this.nodes[v],O=b.spec.content||"",L=b.spec.marks;b.contentMatch=d[O]||(d[O]=Y.parse(O,this.nodes)),b.inlineContent=b.contentMatch.inlineContent,b.markSet=L=="_"?null:L?De(this,L.split(" ")):L==""||!b.inlineContent?[]:null}for(let v in this.marks){let b=this.marks[v],O=b.spec.excludes;b.excluded=O==null?[b]:O==""?[]:De(this,O.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,s=null,d,v){if(typeof r=="string")r=this.nodeType(r);else if(r instanceof G){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(s,d,v)}text(r,s){let d=this.nodes.text;return new T(d,d.defaultAttrs,r,de.setFrom(s))}mark(r,s){return typeof r=="string"&&(r=this.marks[r]),r.create(s)}nodeFromJSON(r){return be.fromJSON(this,r)}markFromJSON(r){return de.fromJSON(this,r)}nodeType(r){let s=this.nodes[r];if(!s)throw new RangeError("Unknown node type: "+r);return s}}function De(k,r){let s=[];for(let d=0;d<r.length;d++){let v=r[d],b=k.marks[v],O=b;if(b)s.push(b);else for(let L in k.marks){let U=k.marks[L];(v=="_"||U.spec.group&&U.spec.group.split(" ").indexOf(v)>-1)&&s.push(O=U)}if(!O)throw new SyntaxError("Unknown mark type: '"+r[d]+"'")}return s}class Ce{constructor(r,s){this.schema=r,this.rules=s,this.tags=[],this.styles=[],s.forEach(d=>{d.tag?this.tags.push(d):d.style&&this.styles.push(d)}),this.normalizeLists=!this.tags.some(d=>{if(!/^(ul|ol)\b/.test(d.tag)||!d.node)return!1;let v=r.nodes[d.node];return v.contentMatch.matchType(v)})}parse(r,s={}){let d=new He(this,s,!1);return d.addAll(r,s.from,s.to),d.finish()}parseSlice(r,s={}){let d=new He(this,s,!0);return d.addAll(r,s.from,s.to),Be.maxOpen(d.finish())}matchTag(r,s,d){for(let v=d?this.tags.indexOf(d)+1:0;v<this.tags.length;v++){let b=this.tags[v];if(m(r,b.tag)&&(b.namespace===void 0||r.namespaceURI==b.namespace)&&(!b.context||s.matchesContext(b.context))){if(b.getAttrs){let O=b.getAttrs(r);if(O===!1)continue;b.attrs=O||void 0}return b}}}matchStyle(r,s,d,v){for(let b=v?this.styles.indexOf(v)+1:0;b<this.styles.length;b++){let O=this.styles[b],L=O.style;if(!(L.indexOf(r)!=0||O.context&&!d.matchesContext(O.context)||L.length>r.length&&(L.charCodeAt(r.length)!=61||L.slice(r.length+1)!=s))){if(O.getAttrs){let U=O.getAttrs(s);if(U===!1)continue;O.attrs=U||void 0}return O}}}static schemaRules(r){let s=[];function d(v){let b=v.priority==null?50:v.priority,O=0;for(;O<s.length;O++){let L=s[O];if((L.priority==null?50:L.priority)<b)break}s.splice(O,0,v)}for(let v in r.marks){let b=r.marks[v].spec.parseDOM;b&&b.forEach(O=>{d(O=C(O)),O.mark||O.ignore||O.clearMark||(O.mark=v)})}for(let v in r.nodes){let b=r.nodes[v].spec.parseDOM;b&&b.forEach(O=>{d(O=C(O)),O.node||O.ignore||O.mark||(O.node=v)})}return s}static fromSchema(r){return r.cached.domParser||(r.cached.domParser=new Ce(r,Ce.schemaRules(r)))}}const $e={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},nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xe={ol:!0,ul:!0},Ze=1,st=2,ct=4;function Ye(k,r,s){return r!=null?(r?Ze:0)|(r==="full"?st:0):k&&k.whitespace=="pre"?Ze|st:s&~ct}class ht{constructor(r,s,d,v,b,O,L){this.type=r,this.attrs=s,this.marks=d,this.pendingMarks=v,this.solid=b,this.options=L,this.content=[],this.activeMarks=de.none,this.stashMarks=[],this.match=O||(L&ct?null:r.contentMatch)}findWrapping(r){if(!this.match){if(!this.type)return[];let s=this.type.contentMatch.fillBefore(xe.from(r));if(s)this.match=this.type.contentMatch.matchFragment(s);else{let d=this.type.contentMatch,v;return(v=d.findWrapping(r.type))?(this.match=d,v):null}}return this.match.findWrapping(r.type)}finish(r){if(!(this.options&Ze)){let d=this.content[this.content.length-1],v;if(d&&d.isText&&(v=/[ \t\r\n\u000c]+$/.exec(d.text))){let b=d;d.text.length==v[0].length?this.content.pop():this.content[this.content.length-1]=b.withText(b.text.slice(0,b.text.length-v[0].length))}}let s=xe.from(this.content);return!r&&this.match&&(s=s.append(this.match.fillBefore(xe.empty,!0))),this.type?this.type.create(this.attrs,s,this.marks):s}popFromStashMark(r){for(let s=this.stashMarks.length-1;s>=0;s--)if(r.eq(this.stashMarks[s]))return this.stashMarks.splice(s,1)[0]}applyPending(r){for(let s=0,d=this.pendingMarks;s<d.length;s++){let v=d[s];(this.type?this.type.allowsMarkType(v.type):A(v.type,r))&&!v.isInSet(this.activeMarks)&&(this.activeMarks=v.addToSet(this.activeMarks),this.pendingMarks=v.removeFromSet(this.pendingMarks))}}inlineContext(r){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:r.parentNode&&!$e.hasOwnProperty(r.parentNode.nodeName.toLowerCase())}}class He{constructor(r,s,d){this.parser=r,this.options=s,this.isOpen=d,this.open=0;let v=s.topNode,b,O=Ye(null,s.preserveWhitespace,0)|(d?ct:0);v?b=new ht(v.type,v.attrs,de.none,de.none,!0,s.topMatch||v.type.contentMatch,O):d?b=new ht(null,null,de.none,de.none,!0,null,O):b=new ht(r.schema.topNodeType,null,de.none,de.none,!0,null,O),this.nodes=[b],this.find=s.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(r){r.nodeType==3?this.addTextNode(r):r.nodeType==1&&this.addElement(r)}withStyleRules(r,s){let d=r.getAttribute("style");if(!d)return s();let v=this.readStyles(p(d));if(!v)return;let[b,O]=v,L=this.top;for(let U=0;U<O.length;U++)this.removePendingMark(O[U],L);for(let U=0;U<b.length;U++)this.addPendingMark(b[U]);s();for(let U=0;U<b.length;U++)this.removePendingMark(b[U],L);for(let U=0;U<O.length;U++)this.addPendingMark(O[U])}addTextNode(r){let s=r.nodeValue,d=this.top;if(d.options&st||d.inlineContext(r)||/[^ \t\r\n\u000c]/.test(s)){if(d.options&Ze)d.options&st?s=s.replace(/\r\n?/g,`
`):s=s.replace(/\r?\n|\r/g," ");else if(s=s.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(s)&&this.open==this.nodes.length-1){let v=d.content[d.content.length-1],b=r.previousSibling;(!v||b&&b.nodeName=="BR"||v.isText&&/[ \t\r\n\u000c]$/.test(v.text))&&(s=s.slice(1))}s&&this.insertNode(this.parser.schema.text(s)),this.findInText(r)}else this.findInside(r)}addElement(r,s){let d=r.nodeName.toLowerCase(),v;Xe.hasOwnProperty(d)&&this.parser.normalizeLists&&K(r);let b=this.options.ruleFromNode&&this.options.ruleFromNode(r)||(v=this.parser.matchTag(r,this,s));if(b?b.ignore:nt.hasOwnProperty(d))this.findInside(r),this.ignoreFallback(r);else if(!b||b.skip||b.closeParent){b&&b.closeParent?this.open=Math.max(0,this.open-1):b&&b.skip.nodeType&&(r=b.skip);let O,L=this.top,U=this.needsBlock;if($e.hasOwnProperty(d))L.content.length&&L.content[0].isInline&&this.open&&(this.open--,L=this.top),O=!0,L.type||(this.needsBlock=!0);else if(!r.firstChild){this.leafFallback(r);return}b&&b.skip?this.addAll(r):this.withStyleRules(r,()=>this.addAll(r)),O&&this.sync(L),this.needsBlock=U}else this.withStyleRules(r,()=>{this.addElementByRule(r,b,b.consuming===!1?v: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 s=de.none,d=de.none;for(let v=0;v<r.length;v+=2)for(let b=void 0;;){let O=this.parser.matchStyle(r[v],r[v+1],this,b);if(!O)break;if(O.ignore)return null;if(O.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(L=>{O.clearMark(L)&&(d=L.addToSet(d))}):s=this.parser.schema.marks[O.mark].create(O.attrs).addToSet(s),O.consuming===!1)b=O;else break}return[s,d]}addElementByRule(r,s,d){let v,b,O;s.node?(b=this.parser.schema.nodes[s.node],b.isLeaf?this.insertNode(b.create(s.attrs))||this.leafFallback(r):v=this.enter(b,s.attrs||null,s.preserveWhitespace)):(O=this.parser.schema.marks[s.mark].create(s.attrs),this.addPendingMark(O));let L=this.top;if(b&&b.isLeaf)this.findInside(r);else if(d)this.addElement(r,d);else if(s.getContent)this.findInside(r),s.getContent(r,this.parser.schema).forEach(U=>this.insertNode(U));else{let U=r;typeof s.contentElement=="string"?U=r.querySelector(s.contentElement):typeof s.contentElement=="function"?U=s.contentElement(r):s.contentElement&&(U=s.contentElement),this.findAround(r,U,!0),this.addAll(U)}v&&this.sync(L)&&this.open--,O&&this.removePendingMark(O,L)}addAll(r,s,d){let v=s||0;for(let b=s?r.childNodes[s]:r.firstChild,O=d==null?null:r.childNodes[d];b!=O;b=b.nextSibling,++v)this.findAtPoint(r,v),this.addDOM(b);this.findAtPoint(r,v)}findPlace(r){let s,d;for(let v=this.open;v>=0;v--){let b=this.nodes[v],O=b.findWrapping(r);if(O&&(!s||s.length>O.length)&&(s=O,d=b,!O.length)||b.solid)break}if(!s)return!1;this.sync(d);for(let v=0;v<s.length;v++)this.enterInner(s[v],null,!1);return!0}insertNode(r){if(r.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&this.enterInner(s)}if(this.findPlace(r)){this.closeExtra();let s=this.top;s.applyPending(r.type),s.match&&(s.match=s.match.matchType(r.type));let d=s.activeMarks;for(let v=0;v<r.marks.length;v++)(!s.type||s.type.allowsMarkType(r.marks[v].type))&&(d=r.marks[v].addToSet(d));return s.content.push(r.mark(d)),!0}return!1}enter(r,s,d){let v=this.findPlace(r.create(s));return v&&this.enterInner(r,s,!0,d),v}enterInner(r,s=null,d=!1,v){this.closeExtra();let b=this.top;b.applyPending(r),b.match=b.match&&b.match.matchType(r);let O=Ye(r,v,b.options);b.options&ct&&b.content.length==0&&(O|=ct),this.nodes.push(new ht(r,s,b.activeMarks,b.pendingMarks,d,null,O)),this.open++}closeExtra(r=!1){let s=this.nodes.length-1;if(s>this.open){for(;s>this.open;s--)this.nodes[s-1].content.push(this.nodes[s].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 s=this.open;s>=0;s--)if(this.nodes[s]==r)return this.open=s,!0;return!1}get currentPos(){this.closeExtra();let r=0;for(let s=this.open;s>=0;s--){let d=this.nodes[s].content;for(let v=d.length-1;v>=0;v--)r+=d[v].nodeSize;s&&r++}return r}findAtPoint(r,s){if(this.find)for(let d=0;d<this.find.length;d++)this.find[d].node==r&&this.find[d].offset==s&&(this.find[d].pos=this.currentPos)}findInside(r){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&r.nodeType==1&&r.contains(this.find[s].node)&&(this.find[s].pos=this.currentPos)}findAround(r,s,d){if(r!=s&&this.find)for(let v=0;v<this.find.length;v++)this.find[v].pos==null&&r.nodeType==1&&r.contains(this.find[v].node)&&s.compareDocumentPosition(this.find[v].node)&(d?2:4)&&(this.find[v].pos=this.currentPos)}findInText(r){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].node==r&&(this.find[s].pos=this.currentPos-(r.nodeValue.length-this.find[s].offset))}matchesContext(r){if(r.indexOf("|")>-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);let s=r.split("/"),d=this.options.context,v=!this.isOpen&&(!d||d.parent.type==this.nodes[0].type),b=-(d?d.depth+1:0)+(v?0:1),O=(L,U)=>{for(;L>=0;L--){let Ae=s[L];if(Ae==""){if(L==s.length-1||L==0)continue;for(;U>=b;U--)if(O(L-1,U))return!0;return!1}else{let Ne=U>0||U==0&&v?this.nodes[U].type:d&&U>=b?d.node(U-b).type:null;if(!Ne||Ne.name!=Ae&&Ne.groups.indexOf(Ae)==-1)return!1;U--}}return!0};return O(s.length-1,this.open)}textblockFromContext(){let r=this.options.context;if(r)for(let s=r.depth;s>=0;s--){let d=r.node(s).contentMatchAt(r.indexAfter(s)).defaultType;if(d&&d.isTextblock&&d.defaultAttrs)return d}for(let s in this.parser.schema.nodes){let d=this.parser.schema.nodes[s];if(d.isTextblock&&d.defaultAttrs)return d}}addPendingMark(r){let s=I(r,this.top.pendingMarks);s&&this.top.stashMarks.push(s),this.top.pendingMarks=r.addToSet(this.top.pendingMarks)}removePendingMark(r,s){for(let d=this.open;d>=0;d--){let v=this.nodes[d];if(v.pendingMarks.lastIndexOf(r)>-1)v.pendingMarks=r.removeFromSet(v.pendingMarks);else{v.activeMarks=r.removeFromSet(v.activeMarks);let O=v.popFromStashMark(r);O&&v.type&&v.type.allowsMarkType(O.type)&&(v.activeMarks=O.addToSet(v.activeMarks))}if(v==s)break}}}function K(k){for(let r=k.firstChild,s=null;r;r=r.nextSibling){let d=r.nodeType==1?r.nodeName.toLowerCase():null;d&&Xe.hasOwnProperty(d)&&s?(s.appendChild(r),r=s):d=="li"?s=r:d&&(s=null)}}function m(k,r){return(k.matches||k.msMatchesSelector||k.webkitMatchesSelector||k.mozMatchesSelector).call(k,r)}function p(k){let r=/\s*([\w-]+)\s*:\s*([^;]+)/g,s,d=[];for(;s=r.exec(k);)d.push(s[1],s[2].trim());return d}function C(k){let r={};for(let s in k)r[s]=k[s];return r}function A(k,r){let s=r.schema.nodes;for(let d in s){let v=s[d];if(!v.allowsMarkType(k))continue;let b=[],O=L=>{b.push(L);for(let U=0;U<L.edgeCount;U++){let{type:Ae,next:Ne}=L.edge(U);if(Ae==r||b.indexOf(Ne)<0&&O(Ne))return!0}};if(O(v.contentMatch))return!0}}function I(k,r){for(let s=0;s<r.length;s++)if(k.eq(r[s]))return r[s]}class W{constructor(r,s){this.nodes=r,this.marks=s}serializeFragment(r,s={},d){d||(d=ue(s).createDocumentFragment());let v=d,b=[];return r.forEach(O=>{if(b.length||O.marks.length){let L=0,U=0;for(;L<b.length&&U<O.marks.length;){let Ae=O.marks[U];if(!this.marks[Ae.type.name]){U++;continue}if(!Ae.eq(b[L][0])||Ae.type.spec.spanning===!1)break;L++,U++}for(;L<b.length;)v=b.pop()[1];for(;U<O.marks.length;){let Ae=O.marks[U++],Ne=this.serializeMark(Ae,O.isInline,s);Ne&&(b.push([Ae,v]),v.appendChild(Ne.dom),v=Ne.contentDOM||Ne.dom)}}v.appendChild(this.serializeNodeInner(O,s))}),d}serializeNodeInner(r,s){let{dom:d,contentDOM:v}=W.renderSpec(ue(s),this.nodes[r.type.name](r));if(v){if(r.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(r.content,s,v)}return d}serializeNode(r,s={}){let d=this.serializeNodeInner(r,s);for(let v=r.marks.length-1;v>=0;v--){let b=this.serializeMark(r.marks[v],r.isInline,s);b&&((b.contentDOM||b.dom).appendChild(d),d=b.dom)}return d}serializeMark(r,s,d={}){let v=this.marks[r.type.name];return v&&W.renderSpec(ue(d),v(r,s))}static renderSpec(r,s,d=null){if(typeof s=="string")return{dom:r.createTextNode(s)};if(s.nodeType!=null)return{dom:s};if(s.dom&&s.dom.nodeType!=null)return s;let v=s[0],b=v.indexOf(" ");b>0&&(d=v.slice(0,b),v=v.slice(b+1));let O,L=d?r.createElementNS(d,v):r.createElement(v),U=s[1],Ae=1;if(U&&typeof U=="object"&&U.nodeType==null&&!Array.isArray(U)){Ae=2;for(let Ne in U)if(U[Ne]!=null){let wt=Ne.indexOf(" ");wt>0?L.setAttributeNS(Ne.slice(0,wt),Ne.slice(wt+1),U[Ne]):L.setAttribute(Ne,U[Ne])}}for(let Ne=Ae;Ne<s.length;Ne++){let wt=s[Ne];if(wt===0){if(Ne<s.length-1||Ne>Ae)throw new RangeError("Content hole must be the only child of its parent node");return{dom:L,contentDOM:L}}else{let{dom:un,contentDOM:oe}=W.renderSpec(r,wt,d);if(L.appendChild(un),oe){if(O)throw new RangeError("Multiple content holes");O=oe}}}return{dom:L,contentDOM:O}}static fromSchema(r){return r.cached.domSerializer||(r.cached.domSerializer=new W(this.nodesFromSchema(r),this.marksFromSchema(r)))}static nodesFromSchema(r){let s=Z(r.nodes);return s.text||(s.text=d=>d.text),s}static marksFromSchema(r){return Z(r.marks)}}function Z(k){let r={};for(let s in k){let d=k[s].spec.toDOM;d&&(r[s]=d)}return r}function ue(k){return k.document||window.document}},1162:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return xt}),V.d(pe,"b",function(){return We}),V.d(pe,"c",function(){return _}),V.d(pe,"d",function(){return Ke}),V.d(pe,"e",function(){return Dt}),V.d(pe,"f",function(){return Ie}),V.d(pe,"g",function(){return dt}),V.d(pe,"h",function(){return ft}),V.d(pe,"i",function(){return Se}),V.d(pe,"j",function(){return Ve}),V.d(pe,"k",function(){return we}),V.d(pe,"l",function(){return Be}),V.d(pe,"m",function(){return et}),V.d(pe,"n",function(){return it}),V.d(pe,"o",function(){return ce}),V.d(pe,"p",function(){return Y}),V.d(pe,"q",function(){return je}),V.d(pe,"r",function(){return Oe});var j=V(781),Ee=V(1051),me=V(566);const _=(J,H)=>J.selection.empty?!1:(H&&H(J.tr.deleteSelection().scrollIntoView()),!0);function xe(J,H){let{$cursor:G}=J.selection;return!G||(H?!H.endOfTextblock("backward",J):G.parentOffset>0)?null:G}const Dt=(J,H,G)=>{let Q=xe(J,G);if(!Q)return!1;let ee=Pe(Q);if(!ee){let De=Q.blockRange(),Ce=De&&Object(j.j)(De);return Ce==null?!1:(H&&H(J.tr.lift(De,Ce).scrollIntoView()),!0)}let ne=ee.nodeBefore;if(!ne.type.spec.isolating&&T(J,ee,H))return!0;if(Q.parent.content.size==0&&(Re(ne,"end")||me.c.isSelectable(ne))){let De=Object(j.k)(J.doc,Q.before(),Q.after(),Ee.j.empty);if(De&&De.slice.size<De.to-De.from){if(H){let Ce=J.tr.step(De);Ce.setSelection(Re(ne,"end")?me.f.findFrom(Ce.doc.resolve(Ce.mapping.map(ee.pos,-1)),-1):me.c.create(Ce.doc,ee.pos-ne.nodeSize)),H(Ce.scrollIntoView())}return!0}}return ne.isAtom&&ee.depth==Q.depth-1?(H&&H(J.tr.delete(ee.pos-ne.nodeSize,ee.pos).scrollIntoView()),!0):!1},Fe=(J,H,G)=>{let Q=xe(J,G);if(!Q)return!1;let ee=Pe(Q);return ee?de(J,ee,H):!1},ot=(J,H,G)=>{let Q=_e(J,G);if(!Q)return!1;let ee=Je(Q);return ee?de(J,ee,H):!1};function de(J,H,G){let Q=H.nodeBefore,ee=Q,ne=H.pos-1;for(;!ee.isTextblock;ne--){if(ee.type.spec.isolating)return!1;let Xe=ee.lastChild;if(!Xe)return!1;ee=Xe}let De=H.nodeAfter,Ce=De,$e=H.pos+1;for(;!Ce.isTextblock;$e++){if(Ce.type.spec.isolating)return!1;let Xe=Ce.firstChild;if(!Xe)return!1;Ce=Xe}let nt=Object(j.k)(J.doc,ne,$e,Ee.j.empty);if(!nt||nt.from!=ne||nt instanceof j.c&&nt.slice.size>=$e-ne)return!1;if(G){let Xe=J.tr.step(nt);Xe.setSelection(me.g.create(Xe.doc,ne)),G(Xe.scrollIntoView())}return!0}function Re(J,H,G=!1){for(let Q=J;Q;Q=H=="start"?Q.firstChild:Q.lastChild){if(Q.isTextblock)return!0;if(G&&Q.childCount!=1)return!1}return!1}const Be=(J,H,G)=>{let{$head:Q,empty:ee}=J.selection,ne=Q;if(!ee)return!1;if(Q.parent.isTextblock){if(G?!G.endOfTextblock("backward",J):Q.parentOffset>0)return!1;ne=Pe(Q)}let De=ne&&ne.nodeBefore;return!De||!me.c.isSelectable(De)?!1:(H&&H(J.tr.setSelection(me.c.create(J.doc,ne.pos-De.nodeSize)).scrollIntoView()),!0)};function Pe(J){if(!J.parent.type.spec.isolating)for(let H=J.depth-1;H>=0;H--){if(J.index(H)>0)return J.doc.resolve(J.before(H+1));if(J.node(H).type.spec.isolating)break}return null}function _e(J,H){let{$cursor:G}=J.selection;return!G||(H?!H.endOfTextblock("forward",J):G.parentOffset<G.parent.content.size)?null:G}const dt=(J,H,G)=>{let Q=_e(J,G);if(!Q)return!1;let ee=Je(Q);if(!ee)return!1;let ne=ee.nodeAfter;if(T(J,ee,H))return!0;if(Q.parent.content.size==0&&(Re(ne,"start")||me.c.isSelectable(ne))){let De=Object(j.k)(J.doc,Q.before(),Q.after(),Ee.j.empty);if(De&&De.slice.size<De.to-De.from){if(H){let Ce=J.tr.step(De);Ce.setSelection(Re(ne,"start")?me.f.findFrom(Ce.doc.resolve(Ce.mapping.map(ee.pos)),1):me.c.create(Ce.doc,Ce.mapping.map(ee.pos))),H(Ce.scrollIntoView())}return!0}}return ne.isAtom&&ee.depth==Q.depth-1?(H&&H(J.tr.delete(ee.pos,ee.pos+ne.nodeSize).scrollIntoView()),!0):!1},et=(J,H,G)=>{let{$head:Q,empty:ee}=J.selection,ne=Q;if(!ee)return!1;if(Q.parent.isTextblock){if(G?!G.endOfTextblock("forward",J):Q.parentOffset<Q.parent.content.size)return!1;ne=Je(Q)}let De=ne&&ne.nodeAfter;return!De||!me.c.isSelectable(De)?!1:(H&&H(J.tr.setSelection(me.c.create(J.doc,ne.pos)).scrollIntoView()),!0)};function Je(J){if(!J.parent.type.spec.isolating)for(let H=J.depth-1;H>=0;H--){let G=J.node(H);if(J.index(H)+1<G.childCount)return J.doc.resolve(J.after(H+1));if(G.type.spec.isolating)break}return null}const ft=(J,H)=>{let G=J.selection,Q=G instanceof me.c,ee;if(Q){if(G.node.isTextblock||!Object(j.e)(J.doc,G.from))return!1;ee=G.from}else if(ee=Object(j.i)(J.doc,G.from,-1),ee==null)return!1;if(H){let ne=J.tr.join(ee);Q&&ne.setSelection(me.c.create(ne.doc,ee-J.doc.resolve(ee).nodeBefore.nodeSize)),H(ne.scrollIntoView())}return!0},Ie=(J,H)=>{let G=J.selection,Q;if(G instanceof me.c){if(G.node.isTextblock||!Object(j.e)(J.doc,G.to))return!1;Q=G.to}else if(Q=Object(j.i)(J.doc,G.to,1),Q==null)return!1;return H&&H(J.tr.join(Q).scrollIntoView()),!0},Se=(J,H)=>{let{$from:G,$to:Q}=J.selection,ee=G.blockRange(Q),ne=ee&&Object(j.j)(ee);return ne==null?!1:(H&&H(J.tr.lift(ee,ne).scrollIntoView()),!0)},we=(J,H)=>{let{$head:G,$anchor:Q}=J.selection;return!G.parent.type.spec.code||!G.sameParent(Q)?!1:(H&&H(J.tr.insertText(`
`).scrollIntoView()),!0)};function Me(J){for(let H=0;H<J.edgeCount;H++){let{type:G}=J.edge(H);if(G.isTextblock&&!G.hasRequiredAttrs())return G}return null}const Ke=(J,H)=>{let{$head:G,$anchor:Q}=J.selection;if(!G.parent.type.spec.code||!G.sameParent(Q))return!1;let ee=G.node(-1),ne=G.indexAfter(-1),De=Me(ee.contentMatchAt(ne));if(!De||!ee.canReplaceWith(ne,ne,De))return!1;if(H){let Ce=G.after(),$e=J.tr.replaceWith(Ce,Ce,De.createAndFill());$e.setSelection(me.f.near($e.doc.resolve(Ce),1)),H($e.scrollIntoView())}return!0},We=(J,H)=>{let G=J.selection,{$from:Q,$to:ee}=G;if(G instanceof me.a||Q.parent.inlineContent||ee.parent.inlineContent)return!1;let ne=Me(ee.parent.contentMatchAt(ee.indexAfter()));if(!ne||!ne.isTextblock)return!1;if(H){let De=(!Q.parentOffset&&ee.index()<ee.parent.childCount?Q:ee).pos,Ce=J.tr.insert(De,ne.createAndFill());Ce.setSelection(me.g.create(Ce.doc,De+1)),H(Ce.scrollIntoView())}return!0},Ve=(J,H)=>{let{$cursor:G}=J.selection;if(!G||G.parent.content.size)return!1;if(G.depth>1&&G.after()!=G.end(-1)){let ne=G.before();if(Object(j.f)(J.doc,ne))return H&&H(J.tr.split(ne).scrollIntoView()),!0}let Q=G.blockRange(),ee=Q&&Object(j.j)(Q);return ee==null?!1:(H&&H(J.tr.lift(Q,ee).scrollIntoView()),!0)};function rt(J){return(H,G)=>{let{$from:Q,$to:ee}=H.selection;if(H.selection instanceof me.c&&H.selection.node.isBlock)return!Q.parentOffset||!Object(j.f)(H.doc,Q.pos)?!1:(G&&G(H.tr.split(Q.pos).scrollIntoView()),!0);if(!Q.parent.isBlock)return!1;if(G){let ne=ee.parentOffset==ee.parent.content.size,De=H.tr;(H.selection instanceof me.g||H.selection instanceof me.a)&&De.deleteSelection();let Ce=Q.depth==0?null:Me(Q.node(-1).contentMatchAt(Q.indexAfter(-1))),$e=J&&J(ee.parent,ne),nt=$e?[$e]:ne&&Ce?[{type:Ce}]:void 0,Xe=Object(j.f)(De.doc,De.mapping.map(Q.pos),1,nt);if(!nt&&!Xe&&Object(j.f)(De.doc,De.mapping.map(Q.pos),1,Ce?[{type:Ce}]:void 0)&&(Ce&&(nt=[{type:Ce}]),Xe=!0),Xe&&(De.split(De.mapping.map(Q.pos),1,nt),!ne&&!Q.parentOffset&&Q.parent.type!=Ce)){let Ze=De.mapping.map(Q.before()),st=De.doc.resolve(Ze);Ce&&Q.node(-1).canReplaceWith(st.index(),st.index()+1,Ce)&&De.setNodeMarkup(De.mapping.map(Q.before()),Ce)}G(De.scrollIntoView())}return!0}}const Qe=rt(),mt=(J,H)=>Qe(J,H&&(G=>{let Q=J.storedMarks||J.selection.$to.parentOffset&&J.selection.$from.marks();Q&&G.ensureMarks(Q),H(G)})),it=(J,H)=>{let{$from:G,to:Q}=J.selection,ee,ne=G.sharedDepth(Q);return ne==0?!1:(ee=G.before(ne),H&&H(J.tr.setSelection(me.c.create(J.doc,ee))),!0)},Pt=(J,H)=>(H&&H(J.tr.setSelection(new me.a(J.doc))),!0);function be(J,H,G){let Q=H.nodeBefore,ee=H.nodeAfter,ne=H.index();return!Q||!ee||!Q.type.compatibleContent(ee.type)?!1:!Q.content.size&&H.parent.canReplace(ne-1,ne)?(G&&G(J.tr.delete(H.pos-Q.nodeSize,H.pos).scrollIntoView()),!0):!H.parent.canReplace(ne,ne+1)||!(ee.isTextblock||Object(j.e)(J.doc,H.pos))?!1:(G&&G(J.tr.clearIncompatible(H.pos,Q.type,Q.contentMatchAt(Q.childCount)).join(H.pos).scrollIntoView()),!0)}function T(J,H,G){let Q=H.nodeBefore,ee=H.nodeAfter,ne,De;if(Q.type.spec.isolating||ee.type.spec.isolating)return!1;if(be(J,H,G))return!0;let Ce=H.parent.canReplace(H.index(),H.index()+1);if(Ce&&(ne=(De=Q.contentMatchAt(Q.childCount)).findWrapping(ee.type))&&De.matchType(ne[0]||ee.type).validEnd){if(G){let Ze=H.pos+ee.nodeSize,st=Ee.c.empty;for(let ht=ne.length-1;ht>=0;ht--)st=Ee.c.from(ne[ht].create(null,st));st=Ee.c.from(Q.copy(st));let ct=J.tr.step(new j.b(H.pos-1,Ze,H.pos,Ze,new Ee.j(st,1,0),ne.length,!0)),Ye=Ze+2*ne.length;Object(j.e)(ct.doc,Ye)&&ct.join(Ye),G(ct.scrollIntoView())}return!0}let $e=me.f.findFrom(H,1),nt=$e&&$e.$from.blockRange($e.$to),Xe=nt&&Object(j.j)(nt);if(Xe!=null&&Xe>=H.depth)return G&&G(J.tr.lift(nt,Xe).scrollIntoView()),!0;if(Ce&&Re(ee,"start",!0)&&Re(Q,"end")){let Ze=Q,st=[];for(;st.push(Ze),!Ze.isTextblock;)Ze=Ze.lastChild;let ct=ee,Ye=1;for(;!ct.isTextblock;ct=ct.firstChild)Ye++;if(Ze.canReplace(Ze.childCount,Ze.childCount,ct.content)){if(G){let ht=Ee.c.empty;for(let K=st.length-1;K>=0;K--)ht=Ee.c.from(st[K].copy(ht));let He=J.tr.step(new j.b(H.pos-st.length,H.pos+ee.nodeSize,H.pos+Ye,H.pos+ee.nodeSize-Ye,new Ee.j(ht,st.length,0),0,!0));G(He.scrollIntoView())}return!0}}return!1}function $(J){return function(H,G){let Q=H.selection,ee=J<0?Q.$from:Q.$to,ne=ee.depth;for(;ee.node(ne).isInline;){if(!ne)return!1;ne--}return ee.node(ne).isTextblock?(G&&G(H.tr.setSelection(me.g.create(H.doc,J<0?ee.start(ne):ee.end(ne)))),!0):!1}}const Y=$(-1),ce=$(1);function Oe(J,H=null){return function(G,Q){let{$from:ee,$to:ne}=G.selection,De=ee.blockRange(ne),Ce=De&&Object(j.h)(De,J,H);return Ce?(Q&&Q(G.tr.wrap(De,Ce).scrollIntoView()),!0):!1}}function je(J,H=null){return function(G,Q){let ee=!1;for(let ne=0;ne<G.selection.ranges.length&&!ee;ne++){let{$from:{pos:De},$to:{pos:Ce}}=G.selection.ranges[ne];G.doc.nodesBetween(De,Ce,($e,nt)=>{if(ee)return!1;if(!(!$e.isTextblock||$e.hasMarkup(J,H)))if($e.type==J)ee=!0;else{let Xe=G.doc.resolve(nt),Ze=Xe.index();ee=Xe.parent.canReplaceWith(Ze,Ze+1,J)}})}if(!ee)return!1;if(Q){let ne=G.tr;for(let De=0;De<G.selection.ranges.length;De++){let{$from:{pos:Ce},$to:{pos:$e}}=G.selection.ranges[De];ne.setBlockType(Ce,$e,J,H)}Q(ne.scrollIntoView())}return!0}}function tt(J,H,G){for(let Q=0;Q<H.length;Q++){let{$from:ee,$to:ne}=H[Q],De=ee.depth==0?J.inlineContent&&J.type.allowsMarkType(G):!1;if(J.nodesBetween(ee.pos,ne.pos,Ce=>{if(De)return!1;De=Ce.inlineContent&&Ce.type.allowsMarkType(G)}),De)return!0}return!1}function at(J,H=null){return function(G,Q){let{empty:ee,$cursor:ne,ranges:De}=G.selection;if(ee&&!ne||!tt(G.doc,De,J))return!1;if(Q)if(ne)J.isInSet(G.storedMarks||ne.marks())?Q(G.tr.removeStoredMark(J)):Q(G.tr.addStoredMark(J.create(H)));else{let Ce=!1,$e=G.tr;for(let nt=0;!Ce&&nt<De.length;nt++){let{$from:Xe,$to:Ze}=De[nt];Ce=G.doc.rangeHasMark(Xe.pos,Ze.pos,J)}for(let nt=0;nt<De.length;nt++){let{$from:Xe,$to:Ze}=De[nt];if(Ce)$e.removeMark(Xe.pos,Ze.pos,J);else{let st=Xe.pos,ct=Ze.pos,Ye=Xe.nodeAfter,ht=Ze.nodeBefore,He=Ye&&Ye.isText?/^\s*/.exec(Ye.text)[0].length:0,K=ht&&ht.isText?/\s*$/.exec(ht.text)[0].length:0;st+He<ct&&(st+=He,ct-=K),$e.addMark(st,ct,J.create(H))}}Q($e.scrollIntoView())}return!0}}function Ct(J,H){return G=>{if(!G.isGeneric)return J(G);let Q=[];for(let ne=0;ne<G.mapping.maps.length;ne++){let De=G.mapping.maps[ne];for(let Ce=0;Ce<Q.length;Ce++)Q[Ce]=De.map(Q[Ce]);De.forEach((Ce,$e,nt,Xe)=>Q.push(nt,Xe))}let ee=[];for(let ne=0;ne<Q.length;ne+=2){let De=Q[ne],Ce=Q[ne+1],$e=G.doc.resolve(De),nt=$e.sharedDepth(Ce),Xe=$e.node(nt);for(let Ze=$e.indexAfter(nt),st=$e.after(nt+1);st<=Ce;++Ze){let ct=Xe.maybeChild(Ze);if(!ct)break;if(Ze&&ee.indexOf(st)==-1){let Ye=Xe.child(Ze-1);Ye.type==ct.type&&H(Ye,ct)&&ee.push(st)}st+=ct.nodeSize}}ee.sort((ne,De)=>ne-De);for(let ne=ee.length-1;ne>=0;ne--)Object(j.e)(G.doc,ee[ne])&&G.join(ee[ne]);J(G)}}function vt(J,H){let G=Array.isArray(H)?Q=>H.indexOf(Q.type.name)>-1:H;return(Q,ee,ne)=>J(Q,ee&&Ct(ee,G),ne)}function Tt(...J){return function(H,G,Q){for(let ee=0;ee<J.length;ee++)if(J[ee](H,G,Q))return!0;return!1}}let Rt=Tt(_,Dt,Be),Ht=Tt(_,dt,et);const St={Enter:Tt(we,We,Ve,Qe),"Mod-Enter":Ke,Backspace:Rt,"Mod-Backspace":Rt,"Shift-Backspace":Rt,Delete:Ht,"Mod-Delete":Ht,"Mod-a":Pt},Ft={"Ctrl-h":St.Backspace,"Alt-Backspace":St["Mod-Backspace"],"Ctrl-d":St.Delete,"Ctrl-Alt-Backspace":St["Mod-Delete"],"Alt-Delete":St["Mod-Delete"],"Alt-d":St["Mod-Delete"],"Ctrl-a":Y,"Ctrl-e":ce};for(let J in St)Ft[J]=St[J];const xt=(typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os!="undefined"&&os.platform?os.platform()=="darwin":!1)?Ft:St},1201:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return ft});for(var j={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Ee={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},me=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),_=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),xe=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),Dt=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Fe=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ot=me&&(Dt||+me[1]<57)||xe&&Dt,de=0;de<10;de++)j[48+de]=j[96+de]=String(de);for(var de=1;de<=24;de++)j[de+111]="F"+de;for(var de=65;de<=90;de++)j[de]=String.fromCharCode(de+32),Ee[de]=String.fromCharCode(de);for(var Re in j)Ee.hasOwnProperty(Re)||(Ee[Re]=j[Re]);function Be(Se){var we=ot&&(Se.ctrlKey||Se.altKey||Se.metaKey)||(_||Fe)&&Se.shiftKey&&Se.key&&Se.key.length==1,Me=!we&&Se.key||(Se.shiftKey?Ee:j)[Se.keyCode]||Se.key||"Unidentified";return Me=="Esc"&&(Me="Escape"),Me=="Del"&&(Me="Delete"),Me=="Left"&&(Me="ArrowLeft"),Me=="Up"&&(Me="ArrowUp"),Me=="Right"&&(Me="ArrowRight"),Me=="Down"&&(Me="ArrowDown"),Me}var Pe=V(566);const _e=typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function dt(Se){let we=Se.split(/-(?!$)/),Me=we[we.length-1];Me=="Space"&&(Me=" ");let Ke,We,Ve,rt;for(let Qe=0;Qe<we.length-1;Qe++){let mt=we[Qe];if(/^(cmd|meta|m)$/i.test(mt))rt=!0;else if(/^a(lt)?$/i.test(mt))Ke=!0;else if(/^(c|ctrl|control)$/i.test(mt))We=!0;else if(/^s(hift)?$/i.test(mt))Ve=!0;else if(/^mod$/i.test(mt))_e?rt=!0:We=!0;else throw new Error("Unrecognized modifier name: "+mt)}return Ke&&(Me="Alt-"+Me),We&&(Me="Ctrl-"+Me),rt&&(Me="Meta-"+Me),Ve&&(Me="Shift-"+Me),Me}function et(Se){let we=Object.create(null);for(let Me in Se)we[dt(Me)]=Se[Me];return we}function Je(Se,we,Me=!0){return we.altKey&&(Se="Alt-"+Se),we.ctrlKey&&(Se="Ctrl-"+Se),we.metaKey&&(Se="Meta-"+Se),Me&&we.shiftKey&&(Se="Shift-"+Se),Se}function ft(Se){return new Pe.d({props:{handleKeyDown:Ie(Se)}})}function Ie(Se){let we=et(Se);return function(Me,Ke){let We=Be(Ke),Ve,rt=we[Je(We,Ke)];if(rt&&rt(Me.state,Me.dispatch,Me))return!0;if(We.length==1&&We!=" "){if(Ke.shiftKey){let Qe=we[Je(We,Ke,!1)];if(Qe&&Qe(Me.state,Me.dispatch,Me))return!0}if((Ke.shiftKey||Ke.altKey||Ke.metaKey||We.charCodeAt(0)>127)&&(Ve=j[Ke.keyCode])&&Ve!=We){let Qe=we[Je(Ve,Ke)];if(Qe&&Qe(Me.state,Me.dispatch,Me))return!0}}return!1}}},1576:function(sn,pe,V){sn.exports=V(1577)},1577:function(sn,pe,V){"use strict";Object.defineProperty(pe,"__esModule",{value:!0});function j(oe){this.j={},this.jr=[],this.jd=null,this.t=oe}j.prototype={accepts:function(){return!!this.t},tt:function(re,z){if(z&&z.j)return this.j[re]=z,z;var ge=z,ve=this.j[re];if(ve)return ge&&(ve.t=ge),ve;ve=Ee();var Te=Dt(this,re);return Te?(Object.assign(ve.j,Te.j),ve.jr.append(Te.jr),ve.jr=Te.jd,ve.t=ge||Te.t):ve.t=ge,this.j[re]=ve,ve}};var Ee=function(){return new j},me=function(re){return new j(re)},_=function(re,z,ge){re.j[z]||(re.j[z]=ge)},xe=function(re,z,ge){re.jr.push([z,ge])},Dt=function(re,z){var ge=re.j[z];if(ge)return ge;for(var ve=0;ve<re.jr.length;ve++){var Te=re.jr[ve][0],se=re.jr[ve][1];if(Te.test(z))return se}return re.jd},Fe=function(re,z,ge){for(var ve=0;ve<z.length;ve++)_(re,z[ve],ge)},ot=function(re,z){for(var ge=0;ge<z.length;ge++){var ve=z[ge][0],Te=z[ge][1];_(re,ve,Te)}},de=function(re,z,ge,ve){for(var Te=0,se=z.length,Ue;Te<se&&(Ue=re.j[z[Te]]);)re=Ue,Te++;if(Te>=se)return[];for(;Te<se-1;)Ue=ve(),_(re,z[Te],Ue),re=Ue,Te++;_(re,z[se-1],ge)},Re="DOMAIN",Be="LOCALHOST",Pe="TLD",_e="NUM",dt="PROTOCOL",et="MAILTO",Je="WS",ft="NL",Ie="OPENBRACE",Se="OPENBRACKET",we="OPENANGLEBRACKET",Me="OPENPAREN",Ke="CLOSEBRACE",We="CLOSEBRACKET",Ve="CLOSEANGLEBRACKET",rt="CLOSEPAREN",Qe="AMPERSAND",mt="APOSTROPHE",it="ASTERISK",Pt="AT",be="BACKSLASH",T="BACKTICK",$="CARET",Y="COLON",ce="COMMA",Oe="DOLLAR",je="DOT",tt="EQUALS",at="EXCLAMATION",Ct="HYPHEN",vt="PERCENT",Tt="PIPE",Rt="PLUS",Ht="POUND",St="QUERY",Ft="QUOTE",ln="SEMI",xt="SLASH",J="TILDE",H="UNDERSCORE",G="SYM",Q=Object.freeze({__proto__:null,DOMAIN:Re,LOCALHOST:Be,TLD:Pe,NUM:_e,PROTOCOL:dt,MAILTO:et,WS:Je,NL:ft,OPENBRACE:Ie,OPENBRACKET:Se,OPENANGLEBRACKET:we,OPENPAREN:Me,CLOSEBRACE:Ke,CLOSEBRACKET:We,CLOSEANGLEBRACKET:Ve,CLOSEPAREN:rt,AMPERSAND:Qe,APOSTROPHE:mt,ASTERISK:it,AT:Pt,BACKSLASH:be,BACKTICK:T,CARET:$,COLON:Y,COMMA:ce,DOLLAR:Oe,DOT:je,EQUALS:tt,EXCLAMATION:at,HYPHEN:Ct,PERCENT:vt,PIPE:Tt,PLUS:Rt,POUND:Ht,QUERY:St,QUOTE:Ft,SEMI:ln,SLASH:xt,TILDE:J,UNDERSCORE:H,SYM:G}),ee="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw verm\xF6gensberater-ctb verm\xF6gensberatung-pwb \u03B5\u03BB \u03B5\u03C5 \u0431\u0433 \u0431\u0435\u043B \u0434\u0435\u0442\u0438 \u0435\u044E \u043A\u0430\u0442\u043E\u043B\u0438\u043A \u043A\u043E\u043C \u049B\u0430\u0437 \u043C\u043A\u0434 \u043C\u043E\u043D \u043C\u043E\u0441\u043A\u0432\u0430 \u043E\u043D\u043B\u0430\u0439\u043D \u043E\u0440\u0433 \u0440\u0443\u0441 \u0440\u0444 \u0441\u0430\u0439\u0442 \u0441\u0440\u0431 \u0443\u043A\u0440 \u10D2\u10D4 \u0570\u0561\u0575 \u05D9\u05E9\u05E8\u05D0\u05DC \u05E7\u05D5\u05DD \u0627\u0628\u0648\u0638\u0628\u064A \u0627\u062A\u0635\u0627\u0644\u0627\u062A \u0627\u0631\u0627\u0645\u0643\u0648 \u0627\u0644\u0627\u0631\u062F\u0646 \u0627\u0644\u0628\u062D\u0631\u064A\u0646 \u0627\u0644\u062C\u0632\u0627\u0626\u0631 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629 \u0627\u0644\u0639\u0644\u064A\u0627\u0646 \u0627\u0644\u0645\u063A\u0631\u0628 \u0627\u0645\u0627\u0631\u0627\u062A \u0627\u06CC\u0631\u0627\u0646 \u0628\u0627\u0631\u062A \u0628\u0627\u0632\u0627\u0631 \u0628\u06BE\u0627\u0631\u062A \u0628\u064A\u062A\u0643 \u067E\u0627\u06A9\u0633\u062A\u0627\u0646 \u0680\u0627\u0631\u062A \u062A\u0648\u0646\u0633 \u0633\u0648\u062F\u0627\u0646 \u0633\u0648\u0631\u064A\u0629 \u0634\u0628\u0643\u0629 \u0639\u0631\u0627\u0642 \u0639\u0631\u0628 \u0639\u0645\u0627\u0646 \u0641\u0644\u0633\u0637\u064A\u0646 \u0642\u0637\u0631 \u0643\u0627\u062B\u0648\u0644\u064A\u0643 \u0643\u0648\u0645 \u0645\u0635\u0631 \u0645\u0644\u064A\u0633\u064A\u0627 \u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627 \u0645\u0648\u0642\u0639 \u0647\u0645\u0631\u0627\u0647 \u0915\u0949\u092E \u0928\u0947\u091F \u092D\u093E\u0930\u0924 \u092D\u093E\u0930\u0924\u092E\u094D \u092D\u093E\u0930\u094B\u0924 \u0938\u0902\u0917\u0920\u0928 \u09AC\u09BE\u0982\u09B2\u09BE \u09AD\u09BE\u09B0\u09A4 \u09AD\u09BE\u09F0\u09A4 \u0A2D\u0A3E\u0A30\u0A24 \u0AAD\u0ABE\u0AB0\u0AA4 \u0B2D\u0B3E\u0B30\u0B24 \u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE \u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8 \u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD \u0C2D\u0C3E\u0C30\u0C24\u0C4D \u0CAD\u0CBE\u0CB0\u0CA4 \u0D2D\u0D3E\u0D30\u0D24\u0D02 \u0DBD\u0D82\u0D9A\u0DCF \u0E04\u0E2D\u0E21 \u0E44\u0E17\u0E22 \u0EA5\u0EB2\u0EA7 \uB2F7\uB137 \uB2F7\uCEF4 \uC0BC\uC131 \uD55C\uAD6D \u30A2\u30DE\u30BE\u30F3 \u30B0\u30FC\u30B0\u30EB \u30AF\u30E9\u30A6\u30C9 \u30B3\u30E0 \u30B9\u30C8\u30A2 \u30BB\u30FC\u30EB \u30D5\u30A1\u30C3\u30B7\u30E7\u30F3 \u30DD\u30A4\u30F3\u30C8 \u307F\u3093\u306A \u4E16\u754C \u4E2D\u4FE1 \u4E2D\u56FD \u4E2D\u570B \u4E2D\u6587\u7F51 \u4E9A\u9A6C\u900A \u4F01\u4E1A \u4F5B\u5C71 \u4FE1\u606F \u5065\u5EB7 \u516B\u5366 \u516C\u53F8 \u516C\u76CA \u53F0\u6E7E \u53F0\u7063 \u5546\u57CE \u5546\u5E97 \u5546\u6807 \u5609\u91CC \u5609\u91CC\u5927\u9152\u5E97 \u5728\u7EBF \u5927\u4F17\u6C7D\u8F66 \u5927\u62FF \u5929\u4E3B\u6559 \u5A31\u4E50 \u5BB6\u96FB \u5E7F\u4E1C \u5FAE\u535A \u6148\u5584 \u6211\u7231\u4F60 \u624B\u673A \u62DB\u8058 \u653F\u52A1 \u653F\u5E9C \u65B0\u52A0\u5761 \u65B0\u95FB \u65F6\u5C1A \u66F8\u7C4D \u673A\u6784 \u6DE1\u9A6C\u9521 \u6E38\u620F \u6FB3\u9580 \u70B9\u770B \u79FB\u52A8 \u7EC4\u7EC7\u673A\u6784 \u7F51\u5740 \u7F51\u5E97 \u7F51\u7AD9 \u7F51\u7EDC \u8054\u901A \u8BFA\u57FA\u4E9A \u8C37\u6B4C \u8D2D\u7269 \u901A\u8CA9 \u96C6\u56E2 \u96FB\u8A0A\u76C8\u79D1 \u98DE\u5229\u6D66 \u98DF\u54C1 \u9910\u5385 \u9999\u683C\u91CC\u62C9 \u9999\u6E2F".split(" "),ne=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,De=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/,Ce=/\uFE0F/,$e=/\d/,nt=/\s/;function Xe(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],re=Ee(),z=me(_e),ge=me(Re),ve=Ee(),Te=me(Je),se=[[$e,ge],[ne,ge],[De,ge],[Ce,ge]],Ue=function(){var Vt=me(Re);return Vt.j={"-":ve},Vt.jr=[].concat(se),Vt},It=function(Vt){var qt=Ue();return qt.t=Vt,qt};ot(re,[["'",me(mt)],["{",me(Ie)],["[",me(Se)],["<",me(we)],["(",me(Me)],["}",me(Ke)],["]",me(We)],[">",me(Ve)],[")",me(rt)],["&",me(Qe)],["*",me(it)],["@",me(Pt)],["`",me(T)],["^",me($)],[":",me(Y)],[",",me(ce)],["$",me(Oe)],[".",me(je)],["=",me(tt)],["!",me(at)],["-",me(Ct)],["%",me(vt)],["|",me(Tt)],["+",me(Rt)],["#",me(Ht)],["?",me(St)],['"',me(Ft)],["/",me(xt)],[";",me(ln)],["~",me(J)],["_",me(H)],["\\",me(be)]]),_(re,`
`,me(ft)),xe(re,nt,Te),_(Te,`
`,Ee()),xe(Te,nt,Te);for(var lt=0;lt<ee.length;lt++)de(re,ee[lt],It(Pe),Ue);var qe=Ue(),pt=Ue(),yt=Ue(),Le=Ue();de(re,"file",qe,Ue),de(re,"ftp",pt,Ue),de(re,"http",yt,Ue),de(re,"mailto",Le,Ue);var Ot=Ue(),Bt=me(dt),Jt=me(et);_(pt,"s",Ot),_(pt,":",Bt),_(yt,"s",Ot),_(yt,":",Bt),_(qe,":",Bt),_(Ot,":",Bt),_(Le,":",Jt);for(var jt=Ue(),Lt=0;Lt<oe.length;Lt++)de(re,oe[Lt],jt,Ue);return _(jt,":",Bt),de(re,"localhost",It(Be),Ue),xe(re,$e,z),xe(re,ne,ge),xe(re,De,ge),xe(re,Ce,ge),xe(z,$e,z),xe(z,ne,ge),xe(z,De,ge),xe(z,Ce,ge),_(z,"-",ve),_(ge,"-",ve),_(ve,"-",ve),xe(ge,$e,ge),xe(ge,ne,ge),xe(ge,De,ge),xe(ge,Ce,ge),xe(ve,$e,ge),xe(ve,ne,ge),xe(ve,De,ge),xe(ve,Ce,ge),re.jd=me(G),re}function Ze(oe,re){for(var z=st(re.replace(/[A-Z]/g,function(Le){return Le.toLowerCase()})),ge=z.length,ve=[],Te=0,se=0;se<ge;){for(var Ue=oe,It=null,lt=0,qe=null,pt=-1,yt=-1;se<ge&&(It=Dt(Ue,z[se]));)Ue=It,Ue.accepts()?(pt=0,yt=0,qe=Ue):pt>=0&&(pt+=z[se].length,yt++),lt+=z[se].length,Te+=z[se].length,se++;Te-=pt,se-=yt,lt-=pt,ve.push({t:qe.t,v:re.substr(Te-lt,lt),s:Te-lt,e:Te})}return ve}function st(oe){for(var re=[],z=oe.length,ge=0;ge<z;){var ve=oe.charCodeAt(ge),Te=void 0,se=ve<55296||ve>56319||ge+1===z||(Te=oe.charCodeAt(ge+1))<56320||Te>57343?oe[ge]:oe.slice(ge,ge+2);re.push(se),ge+=se.length}return re}function ct(oe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ct=function(re){return typeof re}:ct=function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},ct(oe)}var Ye={defaultProtocol:"http",events:null,format:He,formatHref:He,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function ht(oe){oe=oe||{},this.defaultProtocol="defaultProtocol"in oe?oe.defaultProtocol:Ye.defaultProtocol,this.events="events"in oe?oe.events:Ye.events,this.format="format"in oe?oe.format:Ye.format,this.formatHref="formatHref"in oe?oe.formatHref:Ye.formatHref,this.nl2br="nl2br"in oe?oe.nl2br:Ye.nl2br,this.tagName="tagName"in oe?oe.tagName:Ye.tagName,this.target="target"in oe?oe.target:Ye.target,this.rel="rel"in oe?oe.rel:Ye.rel,this.validate="validate"in oe?oe.validate:Ye.validate,this.truncate="truncate"in oe?oe.truncate:Ye.truncate,this.className="className"in oe?oe.className:Ye.className,this.attributes=oe.attributes||Ye.attributes,this.ignoreTags=[];for(var re=("ignoreTags"in oe)?oe.ignoreTags:Ye.ignoreTags,z=0;z<re.length;z++)this.ignoreTags.push(re[z].toUpperCase())}ht.prototype={resolve:function(re){var z=re.toHref(this.defaultProtocol);return{formatted:this.get("format",re.toString(),re),formattedHref:this.get("formatHref",z,re),tagName:this.get("tagName",z,re),className:this.get("className",z,re),target:this.get("target",z,re),rel:this.get("rel",z,re),events:this.getObject("events",z,re),attributes:this.getObject("attributes",z,re),truncate:this.get("truncate",z,re)}},check:function(re){return this.get("validate",re.toString(),re)},get:function(re,z,ge){var ve=this[re];if(!ve)return ve;var Te;switch(ct(ve)){case"function":return ve(z,ge.t);case"object":return Te=ge.t in ve?ve[ge.t]:Ye[re],typeof Te=="function"?Te(z,ge.t):Te}return ve},getObject:function(re,z,ge){var ve=this[re];return typeof ve=="function"?ve(z,ge.t):ve}};function He(oe){return oe}var K=Object.freeze({__proto__:null,defaults:Ye,Options:ht});function m(oe,re){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ge=Object.create(oe.prototype);for(var ve in z)ge[ve]=z[ve];return ge.constructor=re,re.prototype=ge,re}function p(){}p.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(re),start:this.startIndex(),end:this.endIndex()}}};function C(oe,re){function z(ge,ve){this.t=oe,this.v=ge,this.tk=ve}return m(p,z,re),z}var A=C("email",{isLink:!0}),I=C("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),W=C("text"),Z=C("nl"),ue=C("url",{isLink:!0,toHref:function(){for(var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye.defaultProtocol,z=this.tk,ge=!1,ve=!1,Te=[],se=0;z[se].t===dt;)ge=!0,Te.push(z[se].v),se++;for(;z[se].t===xt;)ve=!0,Te.push(z[se].v),se++;for(;se<z.length;se++)Te.push(z[se].v);return Te=Te.join(""),ge||ve||(Te="".concat(re,"://").concat(Te)),Te},hasProtocol:function(){return this.tk[0].t===dt}}),k=Object.freeze({__proto__:null,MultiToken:p,Base:p,createTokenClass:C,MailtoEmail:A,Email:I,Text:W,Nl:Z,Url:ue});function r(){var oe=Ee(),re=Ee(),z=Ee(),ge=Ee(),ve=Ee(),Te=Ee(),se=Ee(),Ue=me(ue),It=Ee(),lt=me(ue),qe=me(ue),pt=Ee(),yt=Ee(),Le=Ee(),Ot=Ee(),Bt=Ee(),Jt=me(ue),jt=me(ue),Lt=me(ue),Ut=me(ue),Vt=Ee(),qt=Ee(),on=Ee(),Gt=Ee(),an=Ee(),_t=Ee(),yn=me(I),Dn=Ee(),en=me(I),tn=me(A),cn=Ee(),Kt=Ee(),Yt=Ee(),xn=Ee(),Rn=me(Z);_(oe,ft,Rn),_(oe,dt,re),_(oe,et,z),_(re,xt,ge),_(ge,xt,ve),_(oe,Pe,Te),_(oe,Re,Te),_(oe,Be,Ue),_(oe,_e,Te),_(ve,Pe,qe),_(ve,Re,qe),_(ve,_e,qe),_(ve,Be,qe),_(Te,je,se),_(an,je,_t),_(se,Pe,Ue),_(se,Re,Te),_(se,_e,Te),_(se,Be,Te),_(_t,Pe,yn),_(_t,Re,an),_(_t,_e,an),_(_t,Be,an),_(Ue,je,se),_(yn,je,_t),_(Ue,Y,It),_(Ue,xt,qe),_(It,_e,lt),_(lt,xt,qe),_(yn,Y,Dn),_(Dn,_e,en);var At=[Qe,it,Pt,be,T,$,Oe,Re,tt,Ct,Be,_e,vt,Tt,Rt,Ht,dt,xt,G,J,Pe,H],Et=[mt,Ve,Ke,We,rt,Y,ce,je,at,we,Ie,Se,Me,St,Ft,ln];_(qe,Ie,yt),_(qe,Se,Le),_(qe,we,Ot),_(qe,Me,Bt),_(pt,Ie,yt),_(pt,Se,Le),_(pt,we,Ot),_(pt,Me,Bt),_(yt,Ke,qe),_(Le,We,qe),_(Ot,Ve,qe),_(Bt,rt,qe),_(Jt,Ke,qe),_(jt,We,qe),_(Lt,Ve,qe),_(Ut,rt,qe),_(Vt,Ke,qe),_(qt,We,qe),_(on,Ve,qe),_(Gt,rt,qe),Fe(yt,At,Jt),Fe(Le,At,jt),Fe(Ot,At,Lt),Fe(Bt,At,Ut),Fe(yt,Et,Vt),Fe(Le,Et,qt),Fe(Ot,Et,on),Fe(Bt,Et,Gt),Fe(Jt,At,Jt),Fe(jt,At,jt),Fe(Lt,At,Lt),Fe(Ut,At,Ut),Fe(Jt,Et,Jt),Fe(jt,Et,jt),Fe(Lt,Et,Lt),Fe(Ut,Et,Ut),Fe(Vt,At,Jt),Fe(qt,At,jt),Fe(on,At,Lt),Fe(Gt,At,Ut),Fe(Vt,Et,Vt),Fe(qt,Et,qt),Fe(on,Et,on),Fe(Gt,Et,Gt),Fe(qe,At,qe),Fe(pt,At,qe),Fe(qe,Et,pt),Fe(pt,Et,pt),_(z,Pe,tn),_(z,Re,tn),_(z,_e,tn),_(z,Be,tn),Fe(tn,At,tn),Fe(tn,Et,cn),Fe(cn,At,tn),Fe(cn,Et,cn);var $t=[Qe,mt,it,be,T,$,Ke,Oe,Re,tt,Ct,_e,Ie,vt,Tt,Rt,Ht,St,xt,G,J,Pe,H];return Fe(Te,$t,Kt),_(Te,Pt,Yt),Fe(Ue,$t,Kt),_(Ue,Pt,Yt),Fe(se,$t,Kt),Fe(Kt,$t,Kt),_(Kt,Pt,Yt),_(Kt,je,xn),Fe(xn,$t,Kt),_(Yt,Pe,an),_(Yt,Re,an),_(Yt,_e,an),_(Yt,Be,yn),oe}function s(oe,re,z){for(var ge=z.length,ve=0,Te=[],se=[];ve<ge;){for(var Ue=oe,It=null,lt=null,qe=0,pt=null,yt=-1;ve<ge&&!(It=Dt(Ue,z[ve].t));)se.push(z[ve++]);for(;ve<ge&&(lt=It||Dt(Ue,z[ve].t));)It=null,Ue=lt,Ue.accepts()?(yt=0,pt=Ue):yt>=0&&yt++,ve++,qe++;if(yt<0)for(var Le=ve-qe;Le<ve;Le++)se.push(z[Le]);else{se.length>0&&(Te.push(d(W,re,se)),se=[]),ve-=yt,qe-=yt;var Ot=pt.t,Bt=z.slice(ve-qe,ve);Te.push(d(Ot,re,Bt))}}return se.length>0&&Te.push(d(W,re,se)),Te}function d(oe,re,z){var ge=z[0].s,ve=z[z.length-1].e,Te=re.substr(ge,ve-ge);return new oe(Te,z)}var v=typeof console!="undefined"&&console&&console.warn||function(){},b={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function O(){b.scanner=null,b.parser=null,b.pluginQueue=[],b.customProtocols=[],b.initialized=!1}function L(oe,re){for(var z=0;z<b.pluginQueue.length;z++)if(oe===b.pluginQueue[z][0]){v('linkifyjs: plugin "'.concat(oe,'" already registered - will be overwritten')),b.pluginQueue[z]=[oe,re];return}b.pluginQueue.push([oe,re]),b.initialized&&v('linkifyjs: already initialized - will not register plugin "'.concat(oe,'" until you manually call linkify.init(). To avoid this warning, please register all plugins before invoking linkify the first time.'))}function U(oe){if(b.initialized&&v('linkifyjs: already initialized - will not register custom protocol "'.concat(oe,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(oe))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");b.customProtocols.push(oe)}function Ae(){b.scanner={start:Xe(b.customProtocols),tokens:Q},b.parser={start:r(),tokens:k};for(var oe={createTokenClass:C},re=0;re<b.pluginQueue.length;re++)b.pluginQueue[re][1]({scanner:b.scanner,parser:b.parser,utils:oe});b.initialized=!0}function Ne(oe){return b.initialized||Ae(),s(b.parser.start,oe,Ze(b.scanner.start,oe))}function wt(oe){for(var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,z=Ne(oe),ge=[],ve=0;ve<z.length;ve++){var Te=z[ve];Te.isLink&&(!re||Te.t===re)&&ge.push(Te.toObject())}return ge}function un(oe){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,z=Ne(oe);return z.length===1&&z[0].isLink&&(!re||z[0].t===re)}pe.Options=ht,pe.find=wt,pe.init=Ae,pe.options=K,pe.registerCustomProtocol=U,pe.registerPlugin=L,pe.reset=O,pe.test=un,pe.tokenize=Ne},519:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return F}),V.d(pe,"b",function(){return $t}),V.d(pe,"c",function(){return ze}),V.d(pe,"d",function(){return ut}),V.d(pe,"e",function(){return bt}),V.d(pe,"f",function(){return rn}),V.d(pe,"g",function(){return yr}),V.d(pe,"h",function(){return Nt}),V.d(pe,"i",function(){return w}),V.d(pe,"j",function(){return nn}),V.d(pe,"k",function(){return qe}),V.d(pe,"l",function(){return Dr}),V.d(pe,"m",function(){return ae}),V.d(pe,"n",function(){return le});var j=V(13),Ee=V(15),me=V(16),_=V(79),xe=V(50),Dt=V(33),Fe=V(49),ot=V(20),de=V(43),Re=V(28),Be=V(29),Pe=V(30),_e=V(2),dt=V(22),et=V(11),Je=V(80),ft=V(785),Ie=V(81),Se=V(35),we=V(66),Me=V(55),Ke=V(72),We=V(326),Ve=V(786),rt=V(17),Qe=V(200),mt=V(201),it=V(346),Pt=V(543),be=V(347),T=V(12),$=V(6),Y=V(603),ce=V(21),Oe=V(48),je=V(958),tt=V(56),at=V(37),Ct=V(102),vt=V(36),Tt=V(126),Rt=V(210),Ht=V(161),St=V(959),Ft=V(960),ln=V(961),xt=V(962),J=V(963),H=V(964),G=V(965),Q=V(966),ee=V(967),ne=V(968),De=V(969),Ce=V(970),$e=V(971),nt=V(972),Xe=V(973),Ze=V(974),st=V(789),ct=V(8),Ye=V(38),ht=V(46),He=V(608),K=V(797),m=V(1201),p=V(1051),C=V(781),A=V(1162),I=V(566);const W=["ol",0],Z=["ul",0],ue=["li",0],k={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs(f){return{order:f.hasAttribute("start")?+f.getAttribute("start"):1}}}],toDOM(f){return f.attrs.order==1?W:["ol",{start:f.attrs.order},0]}},r={parseDOM:[{tag:"ul"}],toDOM(){return Z}},s={parseDOM:[{tag:"li"}],toDOM(){return ue},defining:!0};function d(f,c){let o={};for(let l in f)o[l]=f[l];for(let l in c)o[l]=c[l];return o}function v(f,c,o){return f.append({ordered_list:d(k,{content:"list_item+",group:o}),bullet_list:d(r,{content:"list_item+",group:o}),list_item:d(s,{content:c})})}function b(f,c=null){return function(o,l){let{$from:h,$to:D}=o.selection,S=h.blockRange(D),x=!1,N=S;if(!S)return!1;if(S.depth>=2&&h.node(S.depth-1).type.compatibleContent(f)&&S.startIndex==0){if(h.index(S.depth-1)==0)return!1;let M=o.doc.resolve(S.start-2);N=new p.g(M,M,S.depth),S.endIndex<S.parent.childCount&&(S=new p.g(h,o.doc.resolve(D.end(S.depth)),S.depth)),x=!0}let B=Object(C.h)(N,f,c,S);return B?(l&&l(O(o.tr,S,B,x,f).scrollIntoView()),!0):!1}}function O(f,c,o,l,h){let D=p.c.empty;for(let M=o.length-1;M>=0;M--)D=p.c.from(o[M].type.create(o[M].attrs,D));f.step(new C.b(c.start-(l?2:0),c.end,c.start,c.end,new p.j(D,0,0),o.length,!0));let S=0;for(let M=0;M<o.length;M++)o[M].type==h&&(S=M+1);let x=o.length-S,N=c.start+o.length-(l?2:0),B=c.parent;for(let M=c.startIndex,P=c.endIndex,R=!0;M<P;M++,R=!1)!R&&Object(C.f)(f.doc,N,x)&&(f.split(N,x),N+=2*x),N+=B.child(M).nodeSize;return f}function L(f,c){return function(o,l){let{$from:h,$to:D,node:S}=o.selection;if(S&&S.isBlock||h.depth<2||!h.sameParent(D))return!1;let x=h.node(-1);if(x.type!=f)return!1;if(h.parent.content.size==0&&h.node(-1).childCount==h.indexAfter(-1)){if(h.depth==3||h.node(-3).type!=f||h.index(-2)!=h.node(-2).childCount-1)return!1;if(l){let P=p.c.empty,R=h.index(-1)?1:h.index(-2)?2:3;for(let ye=h.depth-R;ye>=h.depth-3;ye--)P=p.c.from(h.node(ye).copy(P));let X=h.indexAfter(-1)<h.node(-2).childCount?1:h.indexAfter(-2)<h.node(-3).childCount?2:3;P=P.append(p.c.from(f.createAndFill()));let he=h.before(h.depth-(R-1)),ie=o.tr.replace(he,h.after(-X),new p.j(P,4-R,0)),fe=-1;ie.doc.nodesBetween(he,ie.doc.content.size,(ye,ke)=>{if(fe>-1)return!1;ye.isTextblock&&ye.content.size==0&&(fe=ke+1)}),fe>-1&&ie.setSelection(I.f.near(ie.doc.resolve(fe))),l(ie.scrollIntoView())}return!0}let N=D.pos==h.end()?x.contentMatchAt(0).defaultType:null,B=o.tr.delete(h.pos,D.pos),M=N?[c?{type:f,attrs:c}:null,{type:N}]:void 0;return Object(C.f)(B.doc,h.pos,2,M)?(l&&l(B.split(h.pos,2,M).scrollIntoView()),!0):!1}}function U(f){return function(c,o){let{$from:l,$to:h}=c.selection,D=l.blockRange(h,S=>S.childCount>0&&S.firstChild.type==f);return D?o?l.node(D.depth-1).type==f?Ae(c,o,f,D):Ne(c,o,D):!0:!1}}function Ae(f,c,o,l){let h=f.tr,D=l.end,S=l.$to.end(l.depth);D<S&&(h.step(new C.b(D-1,S,D,S,new p.j(p.c.from(o.create(null,l.parent.copy())),1,0),1,!0)),l=new p.g(h.doc.resolve(l.$from.pos),h.doc.resolve(S),l.depth));const x=Object(C.j)(l);if(x==null)return!1;h.lift(l,x);let N=h.mapping.map(D,-1)-1;return Object(C.e)(h.doc,N)&&h.join(N),c(h.scrollIntoView()),!0}function Ne(f,c,o){let l=f.tr,h=o.parent;for(let X=o.end,he=o.endIndex-1,ie=o.startIndex;he>ie;he--)X-=h.child(he).nodeSize,l.delete(X-1,X+1);let D=l.doc.resolve(o.start),S=D.nodeAfter;if(l.mapping.map(o.end)!=o.start+D.nodeAfter.nodeSize)return!1;let x=o.startIndex==0,N=o.endIndex==h.childCount,B=D.node(-1),M=D.index(-1);if(!B.canReplace(M+(x?0:1),M+1,S.content.append(N?p.c.empty:p.c.from(h))))return!1;let P=D.pos,R=P+S.nodeSize;return l.step(new C.b(P-(x?1:0),R+(N?1:0),P+1,R-1,new p.j((x?p.c.empty:p.c.from(h.copy(p.c.empty))).append(N?p.c.empty:p.c.from(h.copy(p.c.empty))),x?0:1,N?0:1),x?0:1)),c(l.scrollIntoView()),!0}function wt(f){return function(c,o){let{$from:l,$to:h}=c.selection,D=l.blockRange(h,B=>B.childCount>0&&B.firstChild.type==f);if(!D)return!1;let S=D.startIndex;if(S==0)return!1;let x=D.parent,N=x.child(S-1);if(N.type!=f)return!1;if(o){let B=N.lastChild&&N.lastChild.type==x.type,M=p.c.from(B?f.create():null),P=new p.j(p.c.from(f.create(null,p.c.from(x.type.create(null,M)))),B?3:1,0),R=D.start,X=D.end;o(c.tr.step(new C.b(R-(B?3:1),X,R,X,P,1,!0)).scrollIntoView())}return!0}}function un(f,c,o){return c=Object(Dt.a)(c),Object(xe.a)(f,oe()?Reflect.construct(c,o||[],Object(Dt.a)(f).constructor):c.apply(f,o))}function oe(){try{var f=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(c){}return(oe=function(){return!!f})()}function re(f,c){var o=Object.keys(f);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(f);c&&(l=l.filter(function(h){return Object.getOwnPropertyDescriptor(f,h).enumerable})),o.push.apply(o,l)}return o}function z(f){for(var c=1;c<arguments.length;c++){var o=arguments[c]!=null?arguments[c]:{};c%2?re(Object(o),!0).forEach(function(l){Object(_e.a)(f,l,o[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(o)):re(Object(o)).forEach(function(l){Object.defineProperty(f,l,Object.getOwnPropertyDescriptor(o,l))})}return f}function ge(f){var c=f.state,o=f.transaction,l=o.selection,h=o.doc,D=o.storedMarks;return z(z({},c),{},{apply:c.apply.bind(c),applyTransaction:c.applyTransaction.bind(c),filterTransaction:c.filterTransaction,plugins:c.plugins,schema:c.schema,reconfigure:c.reconfigure.bind(c),toJSON:c.toJSON.bind(c),get storedMarks(){return D},get selection(){return l},get doc(){return h},get tr(){return l=o.selection,h=o.doc,D=o.storedMarks,o}})}var ve=function(){function f(c){Object(Be.a)(this,f),this.editor=c.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=c.state}return Object(Pe.a)(f,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var o=this,l=this.rawCommands,h=this.editor,D=this.state,S=h.view,x=D.tr,N=this.buildProps(x);return Object.fromEntries(Object.entries(l).map(function(B){var M=Object(Re.a)(B,2),P=M[0],R=M[1],X=function(){var ie=R.apply(void 0,arguments)(N);return!x.getMeta("preventDispatch")&&!o.hasCustomState&&S.dispatch(x),ie};return[P,X]}))}},{key:"chain",get:function(){var o=this;return function(){return o.createChain()}}},{key:"can",get:function(){var o=this;return function(){return o.createCan()}}},{key:"createChain",value:function(o){var l=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,D=this.rawCommands,S=this.editor,x=this.state,N=S.view,B=[],M=!!o,P=o||x.tr,R=function(){return!M&&h&&!P.getMeta("preventDispatch")&&!l.hasCustomState&&N.dispatch(P),B.every(function(ie){return ie===!0})},X=z(z({},Object.fromEntries(Object.entries(D).map(function(he){var ie=Object(Re.a)(he,2),fe=ie[0],ye=ie[1],ke=function(){var gt=l.buildProps(P,h),Xt=ye.apply(void 0,arguments)(gt);return B.push(Xt),X};return[fe,ke]}))),{},{run:R});return X}},{key:"createCan",value:function(o){var l=this,h=this.rawCommands,D=this.state,S=!1,x=o||D.tr,N=this.buildProps(x,S),B=Object.fromEntries(Object.entries(h).map(function(M){var P=Object(Re.a)(M,2),R=P[0],X=P[1];return[R,function(){return X.apply(void 0,arguments)(z(z({},N),{},{dispatch:void 0}))}]}));return z(z({},B),{},{chain:function(){return l.createChain(x,S)}})}},{key:"buildProps",value:function(o){var l=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,D=this.rawCommands,S=this.editor,x=this.state,N=S.view;x.storedMarks&&o.setStoredMarks(x.storedMarks);var B={tr:o,editor:S,view:N,state:ge({state:x,transaction:o}),dispatch:h?function(){}:void 0,chain:function(){return l.createChain(o)},can:function(){return l.createCan(o)},get commands(){return Object.fromEntries(Object.entries(D).map(function(M){var P=Object(Re.a)(M,2),R=P[0],X=P[1];return[R,function(){return X.apply(void 0,arguments)(B)}]}))}};return B}}])}(),Te=function(){function f(){Object(Be.a)(this,f),this.callbacks={}}return Object(Pe.a)(f,[{key:"on",value:function(o,l){return this.callbacks[o]||(this.callbacks[o]=[]),this.callbacks[o].push(l),this}},{key:"emit",value:function(o){for(var l=this,h=arguments.length,D=new Array(h>1?h-1:0),S=1;S<h;S++)D[S-1]=arguments[S];var x=this.callbacks[o];return x&&x.forEach(function(N){return N.apply(l,D)}),this}},{key:"off",value:function(o,l){var h=this.callbacks[o];return h&&(l?this.callbacks[o]=h.filter(function(D){return D!==l}):delete this.callbacks[o]),this}},{key:"removeAllListeners",value:function(){this.callbacks={}}}])}();function se(f,c,o){if(f.config[c]===void 0&&f.parent)return se(f.parent,c,o);if(typeof f.config[c]=="function"){var l=f.config[c].bind(z(z({},o),{},{parent:f.parent?se(f.parent,c,o):null}));return l}return f.config[c]}function Ue(f){var c=f.filter(function(h){return h.type==="extension"}),o=f.filter(function(h){return h.type==="node"}),l=f.filter(function(h){return h.type==="mark"});return{baseExtensions:c,nodeExtensions:o,markExtensions:l}}function It(f){var c=[],o=Ue(f),l=o.nodeExtensions,h=o.markExtensions,D=[].concat(Object(de.a)(l),Object(de.a)(h)),S={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return f.forEach(function(x){var N={name:x.name,options:x.options,storage:x.storage},B=se(x,"addGlobalAttributes",N);if(B){var M=B();M.forEach(function(P){P.types.forEach(function(R){Object.entries(P.attributes).forEach(function(X){var he=Object(Re.a)(X,2),ie=he[0],fe=he[1];c.push({type:R,name:ie,attribute:z(z({},S),fe)})})})})}}),D.forEach(function(x){var N={name:x.name,options:x.options,storage:x.storage},B=se(x,"addAttributes",N);if(B){var M=B();Object.entries(M).forEach(function(P){var R=Object(Re.a)(P,2),X=R[0],he=R[1],ie=z(z({},S),he);typeof(ie==null?void 0:ie.default)=="function"&&(ie.default=ie.default()),ie!=null&&ie.isRequired&&(ie==null?void 0:ie.default)===void 0&&delete ie.default,c.push({type:x.name,name:X,attribute:ie})})}}),c}function lt(f,c){if(typeof f=="string"){if(!c.nodes[f])throw Error("There is no node type named '".concat(f,"'. Maybe you forgot to add the extension?"));return c.nodes[f]}return f}function qe(){for(var f=arguments.length,c=new Array(f),o=0;o<f;o++)c[o]=arguments[o];return c.filter(function(l){return!!l}).reduce(function(l,h){var D=z({},l);return Object.entries(h).forEach(function(S){var x=Object(Re.a)(S,2),N=x[0],B=x[1],M=D[N];if(!M){D[N]=B;return}N==="class"?D[N]=[D[N],B].join(" "):N==="style"?D[N]=[D[N],B].join("; "):D[N]=B}),D},{})}function pt(f,c){return c.filter(function(o){return o.attribute.rendered}).map(function(o){return o.attribute.renderHTML?o.attribute.renderHTML(f.attrs)||{}:Object(_e.a)({},o.name,f.attrs[o.name])}).reduce(function(o,l){return qe(o,l)},{})}function yt(f){return typeof f=="function"}function Le(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(yt(f)){for(var o=arguments.length,l=new Array(o>2?o-2:0),h=2;h<o;h++)l[h-2]=arguments[h];return c?f.bind(c).apply(void 0,l):f.apply(void 0,l)}return f}function Ot(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(f).length===0&&f.constructor===Object}function Bt(f){return typeof f!="string"?f:f.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(f):f==="true"?!0:f==="false"?!1:f}function Jt(f,c){return f.style?f:z(z({},f),{},{getAttrs:function(l){var h=f.getAttrs?f.getAttrs(l):f.attrs;if(h===!1)return!1;var D=c.reduce(function(S,x){var N=x.attribute.parseHTML?x.attribute.parseHTML(l):Bt(l.getAttribute(x.name));return N==null?S:z(z({},S),{},Object(_e.a)({},x.name,N))},{});return z(z({},h),D)}})}function jt(f){return Object.fromEntries(Object.entries(f).filter(function(c){var o=Object(Re.a)(c,2),l=o[0],h=o[1];return l==="attrs"&&Ot(h)?!1:h!=null}))}function Lt(f,c){var o,l=It(f),h=Ue(f),D=h.nodeExtensions,S=h.markExtensions,x=(o=D.find(function(M){return se(M,"topNode")}))===null||o===void 0?void 0:o.name,N=Object.fromEntries(D.map(function(M){var P=l.filter(function(ke){return ke.type===M.name}),R={name:M.name,options:M.options,storage:M.storage,editor:c},X=f.reduce(function(ke,Ge){var gt=se(Ge,"extendNodeSchema",R);return z(z({},ke),gt?gt(M):{})},{}),he=jt(z(z({},X),{},{content:Le(se(M,"content",R)),marks:Le(se(M,"marks",R)),group:Le(se(M,"group",R)),inline:Le(se(M,"inline",R)),atom:Le(se(M,"atom",R)),selectable:Le(se(M,"selectable",R)),draggable:Le(se(M,"draggable",R)),code:Le(se(M,"code",R)),defining:Le(se(M,"defining",R)),isolating:Le(se(M,"isolating",R)),attrs:Object.fromEntries(P.map(function(ke){var Ge;return[ke.name,{default:(Ge=ke==null?void 0:ke.attribute)===null||Ge===void 0?void 0:Ge.default}]}))})),ie=Le(se(M,"parseHTML",R));ie&&(he.parseDOM=ie.map(function(ke){return Jt(ke,P)}));var fe=se(M,"renderHTML",R);fe&&(he.toDOM=function(ke){return fe({node:ke,HTMLAttributes:pt(ke,P)})});var ye=se(M,"renderText",R);return ye&&(he.toText=ye),[M.name,he]})),B=Object.fromEntries(S.map(function(M){var P=l.filter(function(ye){return ye.type===M.name}),R={name:M.name,options:M.options,storage:M.storage,editor:c},X=f.reduce(function(ye,ke){var Ge=se(ke,"extendMarkSchema",R);return z(z({},ye),Ge?Ge(M):{})},{}),he=jt(z(z({},X),{},{inclusive:Le(se(M,"inclusive",R)),excludes:Le(se(M,"excludes",R)),group:Le(se(M,"group",R)),spanning:Le(se(M,"spanning",R)),code:Le(se(M,"code",R)),attrs:Object.fromEntries(P.map(function(ye){var ke;return[ye.name,{default:(ke=ye==null?void 0:ye.attribute)===null||ke===void 0?void 0:ke.default}]}))})),ie=Le(se(M,"parseHTML",R));ie&&(he.parseDOM=ie.map(function(ye){return Jt(ye,P)}));var fe=se(M,"renderHTML",R);return fe&&(he.toDOM=function(ye){return fe({mark:ye,HTMLAttributes:pt(ye,P)})}),[M.name,he]}));return new p.i({topNode:x,nodes:N,marks:B})}function Ut(f,c){return c.nodes[f]||c.marks[f]||null}function Vt(f,c){return Array.isArray(c)?c.some(function(o){var l=typeof o=="string"?o:o.name;return l===f.name}):c}var qt=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500,l="",h=c.parentOffset;return c.parent.nodesBetween(Math.max(0,h-o),h,function(D,S,x,N){var B,M,P=((M=(B=D.type.spec).toText)===null||M===void 0?void 0:M.call(B,{node:D,pos:S,parent:x,index:N}))||D.textContent||"%leaf%";l+=P.slice(0,Math.max(0,h-S))}),l};function on(f){return Object.prototype.toString.call(f)==="[object RegExp]"}var Gt=Object(Pe.a)(function f(c){Object(Be.a)(this,f),this.find=c.find,this.handler=c.handler}),an=function(c,o){if(on(o))return o.exec(c);var l=o(c);if(!l)return null;var h=[l.text];return h.index=l.index,h.input=c,h.data=l.data,l.replaceWith&&(l.text.includes(l.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),h.push(l.replaceWith)),h};function _t(f){var c,o=f.editor,l=f.from,h=f.to,D=f.text,S=f.rules,x=f.plugin,N=o.view;if(N.composing)return!1;var B=N.state.doc.resolve(l);if(B.parent.type.spec.code||!((c=B.nodeBefore||B.nodeAfter)===null||c===void 0)&&c.marks.find(function(R){return R.type.spec.code}))return!1;var M=!1,P=qt(B)+D;return S.forEach(function(R){if(!M){var X=an(P,R.find);if(X){var he=N.state.tr,ie=ge({state:N.state,transaction:he}),fe={from:l-(X[0].length-D.length),to:h},ye=new ve({editor:o,state:ie}),ke=ye.commands,Ge=ye.chain,gt=ye.can,Xt=R.handler({state:ie,range:fe,match:X,commands:ke,chain:Ge,can:gt});Xt===null||!he.steps.length||(he.setMeta(x,{transform:he,from:l,to:h,text:D}),N.dispatch(he),M=!0)}}}),M}function yn(f){var c=f.editor,o=f.rules,l=new He.c({state:{init:function(){return null},apply:function(D,S){var x=D.getMeta(l);return x||(D.selectionSet||D.docChanged?null:S)}},props:{handleTextInput:function(D,S,x,N){return _t({editor:c,from:S,to:x,text:N,rules:o,plugin:l})},handleDOMEvents:{compositionend:function(D){return setTimeout(function(){var S=D.state.selection.$cursor;S&&_t({editor:c,from:S.pos,to:S.pos,text:"",rules:o,plugin:l})}),!1}},handleKeyDown:function(D,S){if(S.key!=="Enter")return!1;var x=D.state.selection.$cursor;return x?_t({editor:c,from:x.pos,to:x.pos,text:`
`,rules:o,plugin:l}):!1}},isInputRules:!0});return l}function Dn(f){return typeof f=="number"}var en=Object(Pe.a)(function f(c){Object(Be.a)(this,f),this.find=c.find,this.handler=c.handler}),tn=function(c,o){if(on(o))return Object(de.a)(c.matchAll(o));var l=o(c);return l?l.map(function(h){var D=[h.text];return D.index=h.index,D.input=c,D.data=h.data,h.replaceWith&&(h.text.includes(h.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),D.push(h.replaceWith)),D}):[]};function cn(f){var c=f.editor,o=f.state,l=f.from,h=f.to,D=f.rule,S=new ve({editor:c,state:o}),x=S.commands,N=S.chain,B=S.can,M=[];o.doc.nodesBetween(l,h,function(R,X){if(!(!R.isTextblock||R.type.spec.code)){var he=Math.max(l,X),ie=Math.min(h,X+R.content.size),fe=R.textBetween(he-X,ie-X,void 0,"\uFFFC"),ye=tn(fe,D.find);ye.forEach(function(ke){if(ke.index!==void 0){var Ge=he+ke.index+1,gt=Ge+ke[0].length,Xt={from:o.tr.mapping.map(Ge),to:o.tr.mapping.map(gt)},Zt=D.handler({state:o,range:Xt,match:ke,commands:x,chain:N,can:B});M.push(Zt)}})}});var P=M.every(function(R){return R!==null});return P}function Kt(f){var c=f.editor,o=f.rules,l=null,h=!1,D=!1,S=o.map(function(x){return new He.c({view:function(B){var M=function(R){var X;l=!((X=B.dom.parentElement)===null||X===void 0)&&X.contains(R.target)?B.dom.parentElement:null};return window.addEventListener("dragstart",M),{destroy:function(){window.removeEventListener("dragstart",M)}}},props:{handleDOMEvents:{drop:function(B){return D=l===B.dom.parentElement,!1},paste:function(B,M){var P,R=(P=M.clipboardData)===null||P===void 0?void 0:P.getData("text/html");return h=!!(R!=null&&R.includes("data-pm-slice")),!1}}},appendTransaction:function(B,M,P){var R=B[0],X=R.getMeta("uiEvent")==="paste"&&!h,he=R.getMeta("uiEvent")==="drop"&&!D;if(!(!X&&!he)){var ie=M.doc.content.findDiffStart(P.doc.content),fe=M.doc.content.findDiffEnd(P.doc.content);if(!(!Dn(ie)||!fe||ie===fe.b)){var ye=P.tr,ke=ge({state:P,transaction:ye}),Ge=cn({editor:c,state:ke,from:Math.max(ie-1,0),to:fe.b-1,rule:x});if(!(!Ge||!ye.steps.length))return ye}}}})});return S}function Yt(f){var c=f.filter(function(o,l){return f.indexOf(o)!==l});return Object(de.a)(new Set(c))}var xn=function(){function f(c,o){var l=this;Object(Be.a)(this,f),this.splittableMarks=[],this.editor=o,this.extensions=f.resolve(c),this.schema=Lt(this.extensions,o),this.extensions.forEach(function(h){var D;l.editor.extensionStorage[h.name]=h.storage;var S={name:h.name,options:h.options,storage:h.storage,editor:l.editor,type:Ut(h.name,l.schema)};if(h.type==="mark"){var x=(D=Le(se(h,"keepOnSplit",S)))!==null&&D!==void 0?D:!0;x&&l.splittableMarks.push(h.name)}var N=se(h,"onBeforeCreate",S);N&&l.editor.on("beforeCreate",N);var B=se(h,"onCreate",S);B&&l.editor.on("create",B);var M=se(h,"onUpdate",S);M&&l.editor.on("update",M);var P=se(h,"onSelectionUpdate",S);P&&l.editor.on("selectionUpdate",P);var R=se(h,"onTransaction",S);R&&l.editor.on("transaction",R);var X=se(h,"onFocus",S);X&&l.editor.on("focus",X);var he=se(h,"onBlur",S);he&&l.editor.on("blur",he);var ie=se(h,"onDestroy",S);ie&&l.editor.on("destroy",ie)})}return Object(Pe.a)(f,[{key:"commands",get:function(){var o=this;return this.extensions.reduce(function(l,h){var D={name:h.name,options:h.options,storage:h.storage,editor:o.editor,type:Ut(h.name,o.schema)},S=se(h,"addCommands",D);return S?z(z({},l),S()):l},{})}},{key:"plugins",get:function(){var o=this,l=this.editor,h=f.sort(Object(de.a)(this.extensions).reverse()),D=[],S=[],x=h.map(function(N){var B={name:N.name,options:N.options,storage:N.storage,editor:l,type:Ut(N.name,o.schema)},M=[],P=se(N,"addKeyboardShortcuts",B),R={};if(N.type==="mark"&&N.config.exitable&&(R.ArrowRight=function(){return ze.handleExit({editor:l,mark:N})}),P){var X=Object.fromEntries(Object.entries(P()).map(function(Ge){var gt=Object(Re.a)(Ge,2),Xt=gt[0],Zt=gt[1];return[Xt,function(){return Zt({editor:l})}]}));R=z(z({},R),X)}var he=Object(m.a)(R);M.push(he);var ie=se(N,"addInputRules",B);Vt(N,l.options.enableInputRules)&&ie&&D.push.apply(D,Object(de.a)(ie()));var fe=se(N,"addPasteRules",B);Vt(N,l.options.enablePasteRules)&&fe&&S.push.apply(S,Object(de.a)(fe()));var ye=se(N,"addProseMirrorPlugins",B);if(ye){var ke=ye();M.push.apply(M,Object(de.a)(ke))}return M}).flat();return[yn({editor:l,rules:D})].concat(Object(de.a)(Kt({editor:l,rules:S})),Object(de.a)(x))}},{key:"attributes",get:function(){return It(this.extensions)}},{key:"nodeViews",get:function(){var o=this,l=this.editor,h=Ue(this.extensions),D=h.nodeExtensions;return Object.fromEntries(D.filter(function(S){return!!se(S,"addNodeView")}).map(function(S){var x=o.attributes.filter(function(P){return P.type===S.name}),N={name:S.name,options:S.options,storage:S.storage,editor:l,type:lt(S.name,o.schema)},B=se(S,"addNodeView",N);if(!B)return[];var M=function(R,X,he,ie){var fe=pt(R,x);return B()({editor:l,node:R,getPos:he,decorations:ie,HTMLAttributes:fe,extension:S})};return[S.name,M]}))}}],[{key:"resolve",value:function(o){var l=f.sort(f.flatten(o)),h=Yt(l.map(function(D){return D.name}));return h.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(h.map(function(D){return"'".concat(D,"'")}).join(", "),"]. This can lead to issues.")),l}},{key:"flatten",value:function(o){var l=this;return o.map(function(h){var D={name:h.name,options:h.options,storage:h.storage},S=se(h,"addExtensions",D);return S?[h].concat(Object(de.a)(l.flatten(S()))):h}).flat(10)}},{key:"sort",value:function(o){var l=100;return o.sort(function(h,D){var S=se(h,"priority")||l,x=se(D,"priority")||l;return S>x?-1:S<x?1:0})}}])}();function Rn(f){return Object.prototype.toString.call(f).slice(8,-1)}function At(f){return Rn(f)!=="Object"?!1:f.constructor===Object&&Object.getPrototypeOf(f)===Object.prototype}function Et(f,c){var o=z({},f);return At(f)&&At(c)&&Object.keys(c).forEach(function(l){At(c[l])?l in f?o[l]=Et(f[l],c[l]):Object.assign(o,Object(_e.a)({},l,c[l])):Object.assign(o,Object(_e.a)({},l,c[l]))}),o}var $t=function(){function f(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object(Be.a)(this,f),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=z(z({},this.config),c),this.name=this.config.name,c.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(se(this,"addOptions",{name:this.name}))),this.storage=Le(se(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(Pe.a)(f,[{key:"configure",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=this.extend();return l.options=Et(this.options,o),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}},{key:"extend",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=new f(o);return l.parent=this,this.child=l,l.name=o.name?o.name:l.parent.name,o.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(l.name,'".')),l.options=Le(se(l,"addOptions",{name:l.name})),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}}],[{key:"create",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new f(o)}}])}();function $n(f,c,o){var l=c.from,h=c.to,D=o||{},S=D.blockSeparator,x=S===void 0?`

`:S,N=D.textSerializers,B=N===void 0?{}:N,M="",P=!0;return f.nodesBetween(l,h,function(R,X,he,ie){var fe,ye=B==null?void 0:B[R.type.name];ye?(R.isBlock&&!P&&(M+=x,P=!0),he&&(M+=ye({node:R,pos:X,parent:he,index:ie,range:c}))):R.isText?(M+=(fe=R==null?void 0:R.text)===null||fe===void 0?void 0:fe.slice(Math.max(l,X)-X,h-X),P=!1):R.isBlock&&!P&&(M+=x,P=!0)}),M}function In(f){return Object.fromEntries(Object.entries(f.nodes).filter(function(c){var o=Object(Re.a)(c,2),l=o[1];return l.spec.toText}).map(function(c){var o=Object(Re.a)(c,2),l=o[0],h=o[1];return[l,h.spec.toText]}))}var rr=$t.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var c=this;return[new He.c({key:new He.d("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var l=c.editor,h=l.state,D=l.schema,S=h.doc,x=h.selection,N=x.ranges,B=Math.min.apply(Math,Object(de.a)(N.map(function(X){return X.$from.pos}))),M=Math.max.apply(Math,Object(de.a)(N.map(function(X){return X.$to.pos}))),P=In(D),R={from:B,to:M};return $n(S,R,{textSerializers:P})}}})]}}),Fr=function(){return function(c){var o=c.editor,l=c.view;return requestAnimationFrame(function(){var h;o.isDestroyed||(l.dom.blur(),(h=window==null?void 0:window.getSelection())===null||h===void 0||h.removeAllRanges())}),!0}},wr=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return function(o){var l=o.commands;return l.setContent("",c)}},Br=function(){return function(c){var o=c.state,l=c.tr,h=c.dispatch,D=l.selection,S=D.ranges;return h&&S.forEach(function(x){var N=x.$from,B=x.$to;o.doc.nodesBetween(N.pos,B.pos,function(M,P){if(!M.type.isText){var R=l.doc,X=l.mapping,he=R.resolve(X.map(P)),ie=R.resolve(X.map(P+M.nodeSize)),fe=he.blockRange(ie);if(fe){var ye=Object(C.j)(fe);if(M.type.isTextblock){var ke=he.parent.contentMatchAt(he.index()),Ge=ke.defaultType;l.setNodeMarkup(fe.start,Ge)}(ye||ye===0)&&l.lift(fe,ye)}}})}),!0}},Wn=function(c){return function(o){return c(o)}},Hn=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.b)(o,l)}},Pr=function(){return function(c){var o=c.tr,l=c.dispatch,h=o.selection,D=h.$anchor.node();if(D.content.size>0)return!1;for(var S=o.selection.$anchor,x=S.depth;x>0;x-=1){var N=S.node(x);if(N.type===D.type){if(l){var B=S.before(x),M=S.after(x);o.delete(B,M).scrollIntoView()}return!0}}return!1}},Rr=function(c){return function(o){for(var l=o.tr,h=o.state,D=o.dispatch,S=lt(c,h.schema),x=l.selection.$anchor,N=x.depth;N>0;N-=1){var B=x.node(N);if(B.type===S){if(D){var M=x.before(N),P=x.after(N);l.delete(M,P).scrollIntoView()}return!0}}return!1}},ir=function(c){return function(o){var l=o.tr,h=o.dispatch,D=c.from,S=c.to;return h&&l.delete(D,S),!0}},sr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.c)(o,l)}},or=function(){return function(c){var o=c.commands;return o.keyboardShortcut("Enter")}},Jn=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.d)(o,l)}};function Mn(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},l=Object.keys(c);return l.length?l.every(function(h){return o.strict?c[h]===f[h]:on(c[h])?c[h].test(f[h]):c[h]===f[h]}):!0}function jn(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return f.find(function(l){return l.type===c&&Mn(l.attrs,o)})}function ar(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!!jn(f,c,o)}function Ln(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!f||!c)){var l=f.parent.childAfter(f.parentOffset);if(f.parentOffset===l.offset&&l.offset!==0&&(l=f.parent.childBefore(f.parentOffset)),!!l.node){var h=jn(Object(de.a)(l.node.marks),c,o);if(h){var D=l.index,S=f.start()+l.offset,x=D+1,N=S+l.node.nodeSize;for(jn(Object(de.a)(l.node.marks),c,o);D>0&&h.isInSet(f.parent.child(D-1).marks);)D-=1,S-=f.parent.child(D).nodeSize;for(;x<f.parent.childCount&&ar(Object(de.a)(f.parent.child(x).marks),c,o);)N+=f.parent.child(x).nodeSize,x+=1;return{from:S,to:N}}}}}function hn(f,c){if(typeof f=="string"){if(!c.marks[f])throw Error("There is no mark type named '".concat(f,"'. Maybe you forgot to add the extension?"));return c.marks[f]}return f}var Ir=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.tr,D=l.state,S=l.dispatch,x=hn(c,D.schema),N=h.doc,B=h.selection,M=B.$from,P=B.from,R=B.to;if(S){var X=Ln(M,x,o);if(X&&X.from<=P&&X.to>=R){var he=He.f.create(N,X.from,X.to);h.setSelection(he)}}return!0}},jr=function(c){return function(o){for(var l=typeof c=="function"?c(o):c,h=0;h<l.length;h+=1)if(l[h](o))return!0;return!1}};function Nt(f){return f instanceof He.f}function kt(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Math.min(Math.max(f,c),o)}function lr(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!c)return null;var o=He.e.atStart(f),l=He.e.atEnd(f);if(c==="start"||c===!0)return o;if(c==="end")return l;var h=o.from,D=l.to;return c==="all"?He.f.create(f,kt(0,h,D),kt(f.content.size,h,D)):He.f.create(f,kt(c,h,D),kt(c,h,D))}function zn(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Lr=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.editor,D=l.view,S=l.tr,x=l.dispatch;o=z({scrollIntoView:!0},o);var N=function(){zn()&&D.dom.focus(),requestAnimationFrame(function(){h.isDestroyed||(D.focus(),o!=null&&o.scrollIntoView&&h.commands.scrollIntoView())})};if(D.hasFocus()&&c===null||c===!1)return!0;if(x&&c===null&&!Nt(h.state.selection))return N(),!0;var B=lr(S.doc,c)||h.state.selection,M=h.state.selection.eq(B);return x&&(M||S.setSelection(B),M&&S.storedMarks&&S.setStoredMarks(S.storedMarks),N()),!0}},pn=function(c,o){return function(l){return c.every(function(h,D){return o(h,z(z({},l),{},{index:D}))})}},zr=function(c,o){return function(l){var h=l.tr,D=l.commands;return D.insertContentAt({from:h.selection.from,to:h.selection.to},c,o)}};function Tn(f){var c="<body>".concat(f,"</body>");return new window.DOMParser().parseFromString(c,"text/html").body}function bn(f,c,o){if(o=z({slice:!0,parseOptions:{}},o),Object(ot.a)(f)==="object"&&f!==null)try{return Array.isArray(f)&&f.length>0?p.c.fromArray(f.map(function(h){return c.nodeFromJSON(h)})):c.nodeFromJSON(f)}catch(h){return console.warn("[tiptap warn]: Invalid content.","Passed value:",f,"Error:",h),bn("",c,o)}if(typeof f=="string"){var l=p.a.fromSchema(c);return o.slice?l.parseSlice(Tn(f),o.parseOptions).content:l.parse(Tn(f),o.parseOptions)}return bn("",c,o)}function Vr(f,c,o){var l=f.steps.length-1;if(!(l<c)){var h=f.steps[l];if(h instanceof C.c||h instanceof C.b){var D=f.mapping.maps[l],S=0;D.forEach(function(x,N,B,M){S===0&&(S=M)}),f.setSelection(He.e.near(f.doc.resolve(S),o))}}}var Kr=function(c){return c.toString().startsWith("<")},Vn=function(c,o,l){return function(h){var D=h.tr,S=h.dispatch,x=h.editor;if(S){l=z({parseOptions:{},updateSelection:!0},l);var N=bn(o,x.schema,{parseOptions:z({preserveWhitespace:"full"},l.parseOptions)});if(N.toString()==="<>")return!0;var B=typeof c=="number"?{from:c,to:c}:c,M=B.from,P=B.to,R=!0,X=!0,he=Kr(N)?N:[N];if(he.forEach(function(ke){ke.check(),R=R?ke.isText&&ke.marks.length===0:!1,X=X?ke.isBlock:!1}),M===P&&X){var ie=D.doc.resolve(M),fe=ie.parent,ye=fe.isTextblock&&!fe.type.spec.code&&!fe.childCount;ye&&(M-=1,P+=1)}R?Array.isArray(o)?D.insertText(o.map(function(ke){return ke.text||""}).join(""),M,P):Object(ot.a)(o)==="object"&&o&&o.text?D.insertText(o.text,M,P):D.insertText(o,M,P):D.replaceWith(M,P,N),l.updateSelection&&Vr(D,D.steps.length-1,-1)}return!0}},$r=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.h)(o,l)}},Un=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.f)(o,l)}},Cn=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.e)(o,l)}},Wr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.g)(o,l)}};function ur(){return typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1}function Hr(f){var c=f.split(/-(?!$)/),o=c[c.length-1];o==="Space"&&(o=" ");for(var l,h,D,S,x=0;x<c.length-1;x+=1){var N=c[x];if(/^(cmd|meta|m)$/i.test(N))S=!0;else if(/^a(lt)?$/i.test(N))l=!0;else if(/^(c|ctrl|control)$/i.test(N))h=!0;else if(/^s(hift)?$/i.test(N))D=!0;else if(/^mod$/i.test(N))zn()||ur()?S=!0:h=!0;else throw new Error("Unrecognized modifier name: ".concat(N))}return l&&(o="Alt-".concat(o)),h&&(o="Ctrl-".concat(o)),S&&(o="Meta-".concat(o)),D&&(o="Shift-".concat(o)),o}var Jr=function(c){return function(o){var l=o.editor,h=o.view,D=o.tr,S=o.dispatch,x=Hr(c).split(/-(?!$)/),N=x.find(function(P){return!["Alt","Ctrl","Meta","Shift"].includes(P)}),B=new KeyboardEvent("keydown",{key:N==="Space"?" ":N,altKey:x.includes("Alt"),ctrlKey:x.includes("Ctrl"),metaKey:x.includes("Meta"),shiftKey:x.includes("Shift"),bubbles:!0,cancelable:!0}),M=l.captureTransaction(function(){h.someProp("handleKeyDown",function(P){return P(h,B)})});return M==null||M.steps.forEach(function(P){var R=P.map(D.mapping);R&&S&&D.maybeStep(R)}),!0}};function Nn(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=f.selection,h=l.from,D=l.to,S=l.empty,x=c?lt(c,f.schema):null,N=[];f.doc.nodesBetween(h,D,function(R,X){if(!R.isText){var he=Math.max(h,X),ie=Math.min(D,X+R.nodeSize);N.push({node:R,from:he,to:ie})}});var B=D-h,M=N.filter(function(R){return x?x.name===R.node.type.name:!0}).filter(function(R){return Mn(R.node.attrs,o,{strict:!1})});if(S)return!!M.length;var P=M.reduce(function(R,X){return R+X.to-X.from},0);return P>=B}var Ur=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.state,D=l.dispatch,S=lt(c,h.schema),x=Nn(h,S,o);return x?Object(A.i)(h,D):!1}},Gn=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.j)(o,l)}},cr=function(c){return function(o){var l=o.state,h=o.dispatch,D=lt(c,l.schema);return U(D)(l,h)}},Gr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.k)(o,l)}};function Fn(f,c){return c.nodes[f]?"node":c.marks[f]?"mark":null}function fr(f,c){var o=typeof c=="string"?[c]:c;return Object.keys(f).reduce(function(l,h){return o.includes(h)||(l[h]=f[h]),l},{})}var dr=function(c,o){return function(l){var h=l.tr,D=l.state,S=l.dispatch,x=null,N=null,B=Fn(typeof c=="string"?c:c.name,D.schema);return B?(B==="node"&&(x=lt(c,D.schema)),B==="mark"&&(N=hn(c,D.schema)),S&&h.selection.ranges.forEach(function(M){D.doc.nodesBetween(M.$from.pos,M.$to.pos,function(P,R){x&&x===P.type&&h.setNodeMarkup(R,void 0,fr(P.attrs,o)),N&&P.marks.length&&P.marks.forEach(function(X){N===X.type&&h.addMark(R,R+P.nodeSize,N.create(fr(X.attrs,o)))})})}),!0):!1}},hr=function(){return function(c){var o=c.tr,l=c.dispatch;return l&&o.scrollIntoView(),!0}},Yr=function(){return function(c){var o=c.tr,l=c.commands;return l.setTextSelection({from:0,to:o.doc.content.size})}},wn=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.l)(o,l)}},Qr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.m)(o,l)}},En=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.n)(o,l)}},Xr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.o)(o,l)}},Zr=function(){return function(c){var o=c.state,l=c.dispatch;return Object(A.p)(o,l)}};function kn(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bn(f,c,{slice:!1,parseOptions:o})}var qr=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(h){var D=h.tr,S=h.editor,x=h.dispatch,N=D.doc,B=kn(c,S.schema,l);return x&&D.replaceWith(0,N.content.size,B).setMeta("preventUpdate",!o),!0}};function _r(f,c){var o=new C.d(f);return c.forEach(function(l){l.steps.forEach(function(h){o.step(h)})}),o}function Bn(f){for(var c=0;c<f.edgeCount;c+=1){var o=f.edge(c),l=o.type;if(l.isTextblock&&!l.hasRequiredAttrs())return l}return null}function pr(f,c){var o=[];return f.descendants(function(l,h){c(l)&&o.push({node:l,pos:h})}),o}function mn(f,c,o){var l=[];return f.nodesBetween(c.from,c.to,function(h,D){o(h)&&l.push({node:h,pos:D})}),l}function Yn(f,c){for(var o=f.depth;o>0;o-=1){var l=f.node(o);if(c(l))return{pos:o>0?f.before(o):0,start:f.start(o),depth:o,node:l}}}function Wt(f){return function(c){return Yn(c.$from,f)}}function gn(f,c){var o=p.b.fromSchema(c).serializeFragment(f),l=document.implementation.createHTMLDocument(),h=l.createElement("div");return h.appendChild(o),h.innerHTML}function fn(f,c){var o=xn.resolve(f);return Lt(o,c)}function Mt(f,c){var o=fn(c),l=p.f.fromJSON(o,f);return gn(l.content,o)}function zt(f,c){var o=fn(c),l=Tn(f);return p.a.fromSchema(o).parse(l).toJSON()}function dn(f,c){var o={from:0,to:f.content.size};return $n(f,o,c)}function pi(f,c,o){var l=o||{},h=l.blockSeparator,D=h===void 0?`

`:h,S=l.textSerializers,x=S===void 0?{}:S,N=fn(c),B=p.f.fromJSON(N,f);return dn(B,{blockSeparator:D,textSerializers:z(z({},In(N)),x)})}function Qn(f,c){var o=hn(c,f.schema),l=f.selection,h=l.from,D=l.to,S=l.empty,x=[];S?(f.storedMarks&&x.push.apply(x,Object(de.a)(f.storedMarks)),x.push.apply(x,Object(de.a)(f.selection.$head.marks()))):f.doc.nodesBetween(h,D,function(B){x.push.apply(x,Object(de.a)(B.marks))});var N=x.find(function(B){return B.type.name===o.name});return N?z({},N.attrs):{}}function ei(f,c){var o=lt(c,f.schema),l=f.selection,h=l.from,D=l.to,S=[];f.doc.nodesBetween(h,D,function(N){S.push(N)});var x=S.reverse().find(function(N){return N.type.name===o.name});return x?z({},x.attrs):{}}function mr(f,c){var o=Fn(typeof c=="string"?c:c.name,f.schema);return o==="node"?ei(f,c):o==="mark"?Qn(f,c):{}}function gr(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JSON.stringify,o={};return f.filter(function(l){var h=c(l);return Object.prototype.hasOwnProperty.call(o,h)?!1:o[h]=!0})}function Kn(f){var c=gr(f);return c.length===1?c:c.filter(function(o,l){var h=c.filter(function(D,S){return S!==l});return!h.some(function(D){return o.oldRange.from>=D.oldRange.from&&o.oldRange.to<=D.oldRange.to&&o.newRange.from>=D.newRange.from&&o.newRange.to<=D.newRange.to})})}function Sn(f){var c=f.mapping,o=f.steps,l=[];return c.maps.forEach(function(h,D){var S=[];if(h.ranges.length)h.forEach(function(M,P){S.push({from:M,to:P})});else{var x=o[D],N=x.from,B=x.to;if(N===void 0||B===void 0)return;S.push({from:N,to:B})}S.forEach(function(M){var P=M.from,R=M.to,X=c.slice(D).map(P,-1),he=c.slice(D).map(R),ie=c.invert().map(X,-1),fe=c.invert().map(he);l.push({oldRange:{from:ie,to:fe},newRange:{from:X,to:he}})})}),Kn(l)}function Xn(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=f.type===f.type.schema.topNodeType,l=o?0:1,h=c,D=h+f.nodeSize,S=f.marks.map(function(B){var M={type:B.type.name};return Object.keys(B.attrs).length&&(M.attrs=z({},B.attrs)),M}),x=z({},f.attrs),N={type:f.type.name,from:h,to:D};return Object.keys(x).length&&(N.attrs=x),S.length&&(N.marks=S),f.content.childCount&&(N.content=[],f.forEach(function(B,M){var P;(P=N.content)===null||P===void 0||P.push(Xn(B,c+M+l))})),f.text&&(N.text=f.text),N}function Zn(f,c,o){var l=[];return f===c?o.resolve(f).marks().forEach(function(h){var D=o.resolve(f-1),S=Ln(D,h.type);S&&l.push(z({mark:h},S))}):o.nodesBetween(f,c,function(h,D){l.push.apply(l,Object(de.a)(h.marks.map(function(S){return{from:D,to:D+h.nodeSize,mark:S}})))}),l}function On(f,c,o){return Object.fromEntries(Object.entries(o).filter(function(l){var h=Object(Re.a)(l,1),D=h[0],S=f.find(function(x){return x.type===c&&x.name===D});return S?S.attribute.keepOnSplit:!1}))}function qn(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=f.selection,h=l.empty,D=l.ranges,S=c?hn(c,f.schema):null;if(h)return!!(f.storedMarks||f.selection.$from.marks()).filter(function(R){return S?S.name===R.type.name:!0}).find(function(R){return Mn(R.attrs,o,{strict:!1})});var x=0,N=[];if(D.forEach(function(R){var X=R.$from,he=R.$to,ie=X.pos,fe=he.pos;f.doc.nodesBetween(ie,fe,function(ye,ke){if(!(!ye.isText&&!ye.marks.length)){var Ge=Math.max(ie,ke),gt=Math.min(fe,ke+ye.nodeSize),Xt=gt-Ge;x+=Xt,N.push.apply(N,Object(de.a)(ye.marks.map(function(Zt){return{mark:Zt,from:Ge,to:gt}})))}})}),x===0)return!1;var B=N.filter(function(R){return S?S.name===R.mark.type.name:!0}).filter(function(R){return Mn(R.mark.attrs,o,{strict:!1})}).reduce(function(R,X){return R+X.to-X.from},0),M=N.filter(function(R){return S?R.mark.type!==S&&R.mark.type.excludes(S):!0}).reduce(function(R,X){return R+X.to-X.from},0),P=B>0?B+M:B;return P>=x}function ti(f,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!c)return Nn(f,null,o)||qn(f,null,o);var l=Fn(c,f.schema);return l==="node"?Nn(f,c,o):l==="mark"?qn(f,c,o):!1}function vr(f,c){var o=Ue(c),l=o.nodeExtensions,h=l.find(function(x){return x.name===f});if(!h)return!1;var D={name:h.name,options:h.options,storage:h.storage},S=Le(se(h,"group",D));return typeof S!="string"?!1:S.split(" ").includes("list")}function ni(f){var c,o=(c=f.type.createAndFill())===null||c===void 0?void 0:c.toJSON(),l=f.toJSON();return JSON.stringify(o)===JSON.stringify(l)}function yr(f){return f instanceof He.b}function Dr(f,c,o){var l=0,h=f.state.doc.content.size,D=kt(c,l,h),S=kt(o,l,h),x=f.coordsAtPos(D),N=f.coordsAtPos(S,-1),B=Math.min(x.top,N.top),M=Math.max(x.bottom,N.bottom),P=Math.min(x.left,N.left),R=Math.max(x.right,N.right),X=R-P,he=M-B,ie=P,fe=B,ye={top:B,bottom:M,left:P,right:R,width:X,height:he,x:ie,y:fe};return z(z({},ye),{},{toJSON:function(){return ye}})}function ri(f,c,o){var l,h=c.selection,D=null;if(Nt(h)&&(D=h.$cursor),D){var S=(l=f.storedMarks)!==null&&l!==void 0?l:D.marks();return!!o.isInSet(S)||!S.some(function(N){return N.type.excludes(o)})}var x=h.ranges;return x.some(function(N){var B=N.$from,M=N.$to,P=B.depth===0?f.doc.inlineContent&&f.doc.type.allowsMarkType(o):!1;return f.doc.nodesBetween(B.pos,M.pos,function(R,X,he){if(P)return!1;if(R.isInline){var ie=!he||he.type.allowsMarkType(o),fe=!!o.isInSet(R.marks)||!R.marks.some(function(ye){return ye.type.excludes(o)});P=ie&&fe}return!P}),P})}var ii=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.tr,D=l.state,S=l.dispatch,x=h.selection,N=x.empty,B=x.ranges,M=hn(c,D.schema);if(S)if(N){var P=Qn(D,M);h.addStoredMark(M.create(z(z({},P),o)))}else B.forEach(function(R){var X=R.$from.pos,he=R.$to.pos;D.doc.nodesBetween(X,he,function(ie,fe){var ye=Math.max(fe,X),ke=Math.min(fe+ie.nodeSize,he),Ge=ie.marks.find(function(gt){return gt.type===M});Ge?ie.marks.forEach(function(gt){M===gt.type&&h.addMark(ye,ke,M.create(z(z({},gt.attrs),o)))}):h.addMark(ye,ke,M.create(o))})});return ri(D,h,M)}},si=function(c,o){return function(l){var h=l.tr;return h.setMeta(c,o),!0}},oi=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.state,D=l.dispatch,S=l.chain,x=lt(c,h.schema);return x.isTextblock?S().command(function(N){var B=N.commands,M=Object(A.q)(x,o)(h);return M?!0:B.clearNodes()}).command(function(N){var B=N.state;return Object(A.q)(x,o)(B,D)}).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},ai=function(c){return function(o){var l=o.tr,h=o.dispatch;if(h){var D=l.doc,S=kt(c,0,D.content.size),x=He.b.create(D,S);l.setSelection(x)}return!0}},li=function(c){return function(o){var l=o.tr,h=o.dispatch;if(h){var D=l.doc,S=typeof c=="number"?{from:c,to:c}:c,x=S.from,N=S.to,B=He.f.atStart(D).from,M=He.f.atEnd(D).to,P=kt(x,B,M),R=kt(N,B,M),X=He.f.create(D,P,R);l.setSelection(X)}return!0}},br=function(c){return function(o){var l=o.state,h=o.dispatch,D=lt(c,l.schema);return wt(D)(l,h)}};function Cr(f,c){var o=f.storedMarks||f.selection.$to.parentOffset&&f.selection.$from.marks();if(o){var l=o.filter(function(h){return c==null?void 0:c.includes(h.type.name)});f.tr.ensureMarks(l)}}var ui=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=c.keepMarks,l=o===void 0?!0:o;return function(h){var D=h.tr,S=h.state,x=h.dispatch,N=h.editor,B=D.selection,M=D.doc,P=B.$from,R=B.$to,X=N.extensionManager.attributes,he=On(X,P.node().type.name,P.node().attrs);if(B instanceof He.b&&B.node.isBlock)return!P.parentOffset||!Object(C.f)(M,P.pos)?!1:(x&&(l&&Cr(S,N.extensionManager.splittableMarks),D.split(P.pos).scrollIntoView()),!0);if(!P.parent.isBlock)return!1;if(x){var ie=R.parentOffset===R.parent.content.size;B instanceof He.f&&D.deleteSelection();var fe=P.depth===0?void 0:Bn(P.node(-1).contentMatchAt(P.indexAfter(-1))),ye=ie&&fe?[{type:fe,attrs:he}]:void 0,ke=Object(C.f)(D.doc,D.mapping.map(P.pos),1,ye);if(!ye&&!ke&&Object(C.f)(D.doc,D.mapping.map(P.pos),1,fe?[{type:fe}]:void 0)&&(ke=!0,ye=fe?[{type:fe,attrs:he}]:void 0),ke&&(D.split(D.mapping.map(P.pos),1,ye),fe&&!ie&&!P.parentOffset&&P.parent.type!==fe)){var Ge=D.mapping.map(P.before()),gt=D.doc.resolve(Ge);P.node(-1).canReplaceWith(gt.index(),gt.index()+1,fe)&&D.setNodeMarkup(D.mapping.map(P.before()),fe)}l&&Cr(S,N.extensionManager.splittableMarks),D.scrollIntoView()}return!0}},_n=function(c){return function(o){var l=o.tr,h=o.state,D=o.dispatch,S=o.editor,x,N=lt(c,h.schema),B=h.selection,M=B.$from,P=B.$to,R=h.selection.node;if(R&&R.isBlock||M.depth<2||!M.sameParent(P))return!1;var X=M.node(-1);if(X.type!==N)return!1;var he=S.extensionManager.attributes;if(M.parent.content.size===0&&M.node(-1).childCount===M.indexAfter(-1)){if(M.depth===2||M.node(-3).type!==N||M.index(-2)!==M.node(-2).childCount-1)return!1;if(D){for(var ie=p.c.empty,fe=M.index(-1)?1:M.index(-2)?2:3,ye=M.depth-fe;ye>=M.depth-3;ye-=1)ie=p.c.from(M.node(ye).copy(ie));var ke=M.indexAfter(-1)<M.node(-2).childCount?1:M.indexAfter(-2)<M.node(-3).childCount?2:3,Ge=On(he,M.node().type.name,M.node().attrs),gt=((x=N.contentMatch.defaultType)===null||x===void 0?void 0:x.createAndFill(Ge))||void 0;ie=ie.append(p.c.from(N.createAndFill(null,gt)||void 0));var Xt=M.before(M.depth-(fe-1));l.replace(Xt,M.after(-ke),new p.j(ie,4-fe,0));var Zt=-1;l.doc.nodesBetween(Xt,l.doc.content.size,function(Nr,Ci){if(Zt>-1)return!1;Nr.isTextblock&&Nr.content.size===0&&(Zt=Ci+1)}),Zt>-1&&l.setSelection(He.f.near(l.doc.resolve(Zt))),l.scrollIntoView()}return!0}var nr=P.pos===M.end()?X.contentMatchAt(0).defaultType:null,vn=On(he,X.type.name,X.attrs),Pn=On(he,M.node().type.name,M.node().attrs);l.delete(M.pos,P.pos);var hi=nr?[{type:N,attrs:vn},{type:nr,attrs:Pn}]:[{type:N,attrs:vn}];if(!Object(C.f)(l.doc,M.pos,2))return!1;if(D){var Tr=h.selection,yi=h.storedMarks,Di=S.extensionManager.splittableMarks,vi=yi||Tr.$to.parentOffset&&Tr.$from.marks();if(l.split(M.pos,2,hi).scrollIntoView(),!vi||!D)return!0;var bi=vi.filter(function(Nr){return Di.includes(Nr.type.name)});l.ensureMarks(bi)}return!0}},er=function(c,o){var l=Wt(function(x){return x.type===o})(c.selection);if(!l)return!0;var h=c.doc.resolve(Math.max(0,l.pos-1)).before(l.depth);if(h===void 0)return!0;var D=c.doc.nodeAt(h),S=l.node.type===(D==null?void 0:D.type)&&Object(C.e)(c.doc,l.pos);return S&&c.join(l.pos),!0},Er=function(c,o){var l=Wt(function(x){return x.type===o})(c.selection);if(!l)return!0;var h=c.doc.resolve(l.start).after(l.depth);if(h===void 0)return!0;var D=c.doc.nodeAt(h),S=l.node.type===(D==null?void 0:D.type)&&Object(C.e)(c.doc,h);return S&&c.join(h),!0},mi=function(c,o,l){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return function(D){var S=D.editor,x=D.tr,N=D.state,B=D.dispatch,M=D.chain,P=D.commands,R=D.can,X=S.extensionManager,he=X.extensions,ie=X.splittableMarks,fe=lt(c,N.schema),ye=lt(o,N.schema),ke=N.selection,Ge=N.storedMarks,gt=ke.$from,Xt=ke.$to,Zt=gt.blockRange(Xt),nr=Ge||ke.$to.parentOffset&&ke.$from.marks();if(!Zt)return!1;var vn=Wt(function(Pn){return vr(Pn.type.name,he)})(ke);if(Zt.depth>=1&&vn&&Zt.depth-vn.depth<=1){if(vn.node.type===fe)return P.liftListItem(ye);if(vr(vn.node.type.name,he)&&fe.validContent(vn.node.content)&&B)return M().command(function(){return x.setNodeMarkup(vn.pos,fe),!0}).command(function(){return er(x,fe)}).command(function(){return Er(x,fe)}).run()}return!l||!nr||!B?M().command(function(){var Pn=R().wrapInList(fe,h);return Pn?!0:P.clearNodes()}).wrapInList(fe,h).command(function(){return er(x,fe)}).command(function(){return Er(x,fe)}).run():M().command(function(){var Pn=R().wrapInList(fe,h),hi=nr.filter(function(Tr){return ie.includes(Tr.type.name)});return x.ensureMarks(hi),Pn?!0:P.clearNodes()}).wrapInList(fe,h).command(function(){return er(x,fe)}).command(function(){return Er(x,fe)}).run()}},gi=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(h){var D=h.state,S=h.commands,x=l.extendEmptyMarkRange,N=x===void 0?!1:x,B=hn(c,D.schema),M=qn(D,B,o);return M?S.unsetMark(B,{extendEmptyMarkRange:N}):S.setMark(B,o)}},ci=function(c,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(h){var D=h.state,S=h.commands,x=lt(c,D.schema),N=lt(o,D.schema),B=Nn(D,x,l);return B?S.setNode(N):S.setNode(x,l)}},kr=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.state,D=l.commands,S=lt(c,h.schema),x=Nn(h,S,o);return x?D.lift(S):D.wrapIn(S,o)}},Sr=function(){return function(c){for(var o=c.state,l=c.dispatch,h=o.plugins,D=0;D<h.length;D+=1){var S=h[D],x=void 0;if(S.spec.isInputRules&&(x=S.getState(o))){if(l){for(var N=o.tr,B=x.transform,M=B.steps.length-1;M>=0;M-=1)N.step(B.steps[M].invert(B.docs[M]));if(x.text){var P=N.doc.resolve(x.from).marks();N.replaceWith(x.from,x.to,o.schema.text(x.text,P))}else N.delete(x.from,x.to)}return!0}}return!1}},Or=function(){return function(c){var o=c.tr,l=c.dispatch,h=o.selection,D=h.empty,S=h.ranges;return D||l&&S.forEach(function(x){o.removeMark(x.$from.pos,x.$to.pos)}),!0}},fi=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.tr,D=l.state,S=l.dispatch,x,N=o.extendEmptyMarkRange,B=N===void 0?!1:N,M=h.selection,P=hn(c,D.schema),R=M.$from,X=M.empty,he=M.ranges;if(!S)return!0;if(X&&B){var ie=M.from,fe=M.to,ye=(x=R.marks().find(function(Ge){return Ge.type===P}))===null||x===void 0?void 0:x.attrs,ke=Ln(R,P,ye);ke&&(ie=ke.from,fe=ke.to),h.removeMark(ie,fe,P)}else he.forEach(function(Ge){h.removeMark(Ge.$from.pos,Ge.$to.pos,P)});return h.removeStoredMark(P),!0}},Ar=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.tr,D=l.state,S=l.dispatch,x=null,N=null,B=Fn(typeof c=="string"?c:c.name,D.schema);return B?(B==="node"&&(x=lt(c,D.schema)),B==="mark"&&(N=hn(c,D.schema)),S&&h.selection.ranges.forEach(function(M){var P=M.$from.pos,R=M.$to.pos;D.doc.nodesBetween(P,R,function(X,he){x&&x===X.type&&h.setNodeMarkup(he,void 0,z(z({},X.attrs),o)),N&&X.marks.length&&X.marks.forEach(function(ie){if(N===ie.type){var fe=Math.max(he,P),ye=Math.min(he+X.nodeSize,R);h.addMark(fe,ye,N.create(z(z({},ie.attrs),o)))}})})}),!0):!1}},di=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.state,D=l.dispatch,S=lt(c,h.schema);return Object(A.r)(S,o)(h,D)}},xr=function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(l){var h=l.state,D=l.dispatch,S=lt(c,h.schema);return b(S,o)(h,D)}},t=Object.freeze({__proto__:null,blur:Fr,clearContent:wr,clearNodes:Br,command:Wn,createParagraphNear:Hn,deleteCurrentNode:Pr,deleteNode:Rr,deleteRange:ir,deleteSelection:sr,enter:or,exitCode:Jn,extendMarkRange:Ir,first:jr,focus:Lr,forEach:pn,insertContent:zr,insertContentAt:Vn,joinUp:$r,joinDown:Un,joinBackward:Cn,joinForward:Wr,keyboardShortcut:Jr,lift:Ur,liftEmptyBlock:Gn,liftListItem:cr,newlineInCode:Gr,resetAttributes:dr,scrollIntoView:hr,selectAll:Yr,selectNodeBackward:wn,selectNodeForward:Qr,selectParentNode:En,selectTextblockEnd:Xr,selectTextblockStart:Zr,setContent:qr,setMark:ii,setMeta:si,setNode:oi,setNodeSelection:ai,setTextSelection:li,sinkListItem:br,splitBlock:ui,splitListItem:_n,toggleList:mi,toggleMark:gi,toggleNode:ci,toggleWrap:kr,undoInputRule:Sr,unsetAllMarks:Or,unsetMark:fi,updateAttributes:Ar,wrapIn:di,wrapInList:xr}),e=$t.create({name:"commands",addCommands:function(){return z({},t)}}),n=$t.create({name:"editable",addProseMirrorPlugins:function(){var c=this;return[new He.c({key:new He.d("editable"),props:{editable:function(){return c.editor.options.editable}}})]}}),i=$t.create({name:"focusEvents",addProseMirrorPlugins:function(){var c=this.editor;return[new He.c({key:new He.d("focusEvents"),props:{handleDOMEvents:{focus:function(l,h){c.isFocused=!0;var D=c.state.tr.setMeta("focus",{event:h}).setMeta("addToHistory",!1);return l.dispatch(D),!1},blur:function(l,h){c.isFocused=!1;var D=c.state.tr.setMeta("blur",{event:h}).setMeta("addToHistory",!1);return l.dispatch(D),!1}}}})]}}),a=$t.create({name:"keymap",addKeyboardShortcuts:function(){var c=this,o=function(){return c.editor.commands.first(function(B){var M=B.commands;return[function(){return M.undoInputRule()},function(){return M.command(function(P){var R=P.tr,X=R.selection,he=R.doc,ie=X.empty,fe=X.$anchor,ye=fe.pos,ke=fe.parent,Ge=He.e.atStart(he).from===ye;return!ie||!Ge||!ke.type.isTextblock||ke.textContent.length?!1:M.clearNodes()})},function(){return M.deleteSelection()},function(){return M.joinBackward()},function(){return M.selectNodeBackward()}]})},l=function(){return c.editor.commands.first(function(B){var M=B.commands;return[function(){return M.deleteSelection()},function(){return M.deleteCurrentNode()},function(){return M.joinForward()},function(){return M.selectNodeForward()}]})},h=function(){return c.editor.commands.first(function(B){var M=B.commands;return[function(){return M.newlineInCode()},function(){return M.createParagraphNear()},function(){return M.liftEmptyBlock()},function(){return M.splitBlock()}]})},D={Enter:h,"Mod-Enter":function(){return c.editor.commands.exitCode()},Backspace:o,"Mod-Backspace":o,"Shift-Backspace":o,Delete:l,"Mod-Delete":l,"Mod-a":function(){return c.editor.commands.selectAll()}},S=z({},D),x=z(z({},D),{},{"Ctrl-h":o,"Alt-Backspace":o,"Ctrl-d":l,"Ctrl-Alt-Backspace":l,"Alt-Delete":l,"Alt-d":l,"Ctrl-a":function(){return c.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return c.editor.commands.selectTextblockEnd()}});return zn()||ur()?x:S},addProseMirrorPlugins:function(){var c=this;return[new He.c({key:new He.d("clearDocument"),appendTransaction:function(l,h,D){var S=l.some(function(Ge){return Ge.docChanged})&&!h.doc.eq(D.doc);if(S){var x=h.selection,N=x.empty,B=x.from,M=x.to,P=He.e.atStart(h.doc).from,R=He.e.atEnd(h.doc).to,X=B===P&&M===R;if(!(N||!X)){var he=D.doc.textBetween(0,D.doc.content.size," "," ").length===0;if(he){var ie=D.tr,fe=ge({state:D,transaction:ie}),ye=new ve({editor:c.editor,state:fe}),ke=ye.commands;if(ke.clearNodes(),!!ie.steps.length)return ie}}}}})]}}),u=$t.create({name:"tabindex",addProseMirrorPlugins:function(){return[new He.c({key:new He.d("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),g=Object.freeze({__proto__:null,ClipboardTextSerializer:rr,Commands:e,Editable:n,FocusEvents:i,Keymap:a,Tabindex:u}),y=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 1px !important;
  height: 1px !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}

.tippy-box[data-animation=fade][data-state=hidden] {
  opacity: 0
}`;function E(f,c,o){var l=document.querySelector("style[data-tiptap-style".concat(o?"-".concat(o):"","]"));if(l!==null)return l;var h=document.createElement("style");return c&&h.setAttribute("nonce",c),h.setAttribute("data-tiptap-style".concat(o?"-".concat(o):""),""),h.innerHTML=f,document.getElementsByTagName("head")[0].appendChild(h),h}var F=function(f){function c(){var o,l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object(Be.a)(this,c),o=un(this,c),o.isFocused=!1,o.extensionStorage={},o.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},o.isCapturingTransaction=!1,o.capturedTransaction=null,o.setOptions(l),o.createExtensionManager(),o.createCommandManager(),o.createSchema(),o.on("beforeCreate",o.options.onBeforeCreate),o.emit("beforeCreate",{editor:o}),o.createView(),o.injectCSS(),o.on("create",o.options.onCreate),o.on("update",o.options.onUpdate),o.on("selectionUpdate",o.options.onSelectionUpdate),o.on("transaction",o.options.onTransaction),o.on("focus",o.options.onFocus),o.on("blur",o.options.onBlur),o.on("destroy",o.options.onDestroy),window.setTimeout(function(){o.isDestroyed||(o.commands.focus(o.options.autofocus),o.emit("create",{editor:o}))},0),o}return Object(Fe.a)(c,f),Object(Pe.a)(c,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=E(y,this.options.injectNonce))}},{key:"setOptions",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=z(z({},this.options),l),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.setOptions({editable:l}),h&&this.emit("update",{editor:this,transaction:this.state.tr})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(l,h){var D=yt(h)?h(l,Object(de.a)(this.state.plugins)):[].concat(Object(de.a)(this.state.plugins),[l]),S=this.state.reconfigure({plugins:D});this.view.updateState(S)}},{key:"unregisterPlugin",value:function(l){if(!this.isDestroyed){var h=typeof l=="string"?"".concat(l,"$"):l.key,D=this.state.reconfigure({plugins:this.state.plugins.filter(function(S){return!S.key.startsWith(h)})});this.view.updateState(D)}}},{key:"createExtensionManager",value:function(){var l=this.options.enableCoreExtensions?Object.values(g):[],h=[].concat(Object(de.a)(l),Object(de.a)(this.options.extensions)).filter(function(D){return["extension","node","mark"].includes(D==null?void 0:D.type)});this.extensionManager=new xn(h,this)}},{key:"createCommandManager",value:function(){this.commandManager=new ve({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var l=kn(this.options.content,this.schema,this.options.parseOptions),h=lr(l,this.options.autofocus);this.view=new K.c(this.options.element,z(z({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:He.a.create({doc:l,selection:h||void 0})}));var D=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(D),this.createNodeViews();var S=this.view.dom;S.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"captureTransaction",value:function(l){this.isCapturingTransaction=!0,l(),this.isCapturingTransaction=!1;var h=this.capturedTransaction;return this.capturedTransaction=null,h}},{key:"dispatchTransaction",value:function(l){var h=this;if(!this.view.isDestroyed){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=l;return}l.steps.forEach(function(B){var M;return(M=h.capturedTransaction)===null||M===void 0?void 0:M.step(B)});return}var D=this.state.apply(l),S=!this.state.selection.eq(D.selection);this.view.updateState(D),this.emit("transaction",{editor:this,transaction:l}),S&&this.emit("selectionUpdate",{editor:this,transaction:l});var x=l.getMeta("focus"),N=l.getMeta("blur");x&&this.emit("focus",{editor:this,event:x.event,transaction:l}),N&&this.emit("blur",{editor:this,event:N.event,transaction:l}),!(!l.docChanged||l.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:l})}}},{key:"getAttributes",value:function(l){return mr(this.state,l)}},{key:"isActive",value:function(l,h){var D=typeof l=="string"?l:null,S=typeof l=="string"?h:l;return ti(this.state,D,S)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return gn(this.state.doc.content,this.schema)}},{key:"getText",value:function(l){var h=l||{},D=h.blockSeparator,S=D===void 0?`

`:D,x=h.textSerializers,N=x===void 0?{}:x;return dn(this.state.doc,{blockSeparator:S,textSerializers:z(z({},In(this.schema)),N)})}},{key:"isEmpty",get:function(){return ni(this.state.doc)}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var l;return!(!((l=this.view)===null||l===void 0)&&l.docView)}}])}(Te);function w(f){return new Gt({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=Le(f.getAttributes,void 0,D);if(S===!1||S===null)return null;var x=l.tr,N=D[D.length-1],B=D[0],M=h.to;if(N){var P=B.search(/\S/),R=h.from+B.indexOf(N),X=R+N.length,he=Zn(h.from,h.to,l.doc).filter(function(ie){var fe=ie.mark.type.excluded;return fe.find(function(ye){return ye===f.type&&ye!==ie.mark.type})}).filter(function(ie){return ie.to>R});if(he.length)return null;X<h.to&&x.delete(X,h.to),R>h.from&&x.delete(h.from+P,R),M=h.from+P+N.length,x.addMark(h.from+P,M,f.type.create(S||{})),x.removeStoredMark(f.type)}}})}function q(f){return new Gt({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=Le(f.getAttributes,void 0,D)||{},x=l.tr,N=h.from,B=h.to;if(D[1]){var M=D[0].lastIndexOf(D[1]),P=N+M;P>B?P=B:B=P+D[1].length;var R=D[0][D[0].length-1];x.insertText(R,N+D[0].length-1),x.replaceWith(P,B,f.type.create(S))}else D[0]&&x.replaceWith(N,B,f.type.create(S))}})}function ae(f){return new Gt({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=l.doc.resolve(h.from),x=Le(f.getAttributes,void 0,D)||{};if(!S.node(-1).canReplaceWith(S.index(-1),S.indexAfter(-1),f.type))return null;l.tr.delete(h.from,h.to).setBlockType(h.from,h.from,f.type,x)}})}function te(f){return new Gt({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=f.replace,x=h.from,N=h.to;if(D[1]){var B=D[0].lastIndexOf(D[1]);S+=D[0].slice(B+D[1].length),x+=B;var M=x-N;M>0&&(S=D[0].slice(B-M,B)+S,x=N)}l.tr.insertText(S,x,N)}})}function le(f){return new Gt({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=o.chain,x=Le(f.getAttributes,void 0,D)||{},N=l.tr.delete(h.from,h.to),B=N.doc.resolve(h.from),M=B.blockRange(),P=M&&Object(C.h)(M,f.type,x);if(!P)return null;if(N.wrap(M,P),f.keepMarks&&f.editor){var R=l.selection,X=l.storedMarks,he=f.editor.extensionManager.splittableMarks,ie=X||R.$to.parentOffset&&R.$from.marks();if(ie){var fe=ie.filter(function(Ge){return he.includes(Ge.type.name)});N.ensureMarks(fe)}}if(f.keepAttributes){var ye=f.type.name==="bulletList"||f.type.name==="orderedList"?"listItem":"taskList";S().updateAttributes(ye,x).run()}var ke=N.doc.resolve(h.from-1).nodeBefore;ke&&ke.type===f.type&&Object(C.e)(N.doc,h.from-1)&&(!f.joinPredicate||f.joinPredicate(D,ke))&&N.join(h.from-1)}})}var ze=function(){function f(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object(Be.a)(this,f),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=z(z({},this.config),c),this.name=this.config.name,c.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(se(this,"addOptions",{name:this.name}))),this.storage=Le(se(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(Pe.a)(f,[{key:"configure",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=this.extend();return l.options=Et(this.options,o),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}},{key:"extend",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=new f(o);return l.parent=this,this.child=l,l.name=o.name?o.name:l.parent.name,o.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(l.name,'".')),l.options=Le(se(l,"addOptions",{name:l.name})),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}}],[{key:"create",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new f(o)}},{key:"handleExit",value:function(o){var l=o.editor,h=o.mark,D=l.state.tr,S=l.state.selection.$from,x=S.pos===S.end();if(x){var N=S.marks(),B=!!N.find(function(P){return(P==null?void 0:P.type.name)===h.name});if(!B)return!1;var M=N.find(function(P){return(P==null?void 0:P.type.name)===h.name});return M&&D.removeStoredMark(M),D.insertText(" ",S.pos),l.view.dispatch(D),!0}return!1}}])}(),ut=function(){function f(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object(Be.a)(this,f),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=z(z({},this.config),c),this.name=this.config.name,c.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(se(this,"addOptions",{name:this.name}))),this.storage=Le(se(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(Pe.a)(f,[{key:"configure",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=this.extend();return l.options=Et(this.options,o),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}},{key:"extend",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=new f(o);return l.parent=this,this.child=l,l.name=o.name?o.name:l.parent.name,o.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(l.name,'".')),l.options=Le(se(l,"addOptions",{name:l.name})),l.storage=Le(se(l,"addStorage",{name:l.name,options:l.options})),l}}],[{key:"create",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new f(o)}}])}(),bt=function(){function f(c,o,l){Object(Be.a)(this,f),this.isDragging=!1,this.component=c,this.editor=o.editor,this.options=z({stopEvent:null,ignoreMutation:null},l),this.extension=o.extension,this.node=o.node,this.decorations=o.decorations,this.getPos=o.getPos,this.mount()}return Object(Pe.a)(f,[{key:"mount",value:function(){}},{key:"dom",get:function(){return this.editor.view.dom}},{key:"contentDOM",get:function(){return null}},{key:"onDragStart",value:function(o){var l,h,D,S,x,N,B,M=this.editor.view,P=o.target,R=P.nodeType===3?(l=P.parentElement)===null||l===void 0?void 0:l.closest("[data-drag-handle]"):P.closest("[data-drag-handle]");if(!(!this.dom||!((h=this.contentDOM)===null||h===void 0)&&h.contains(P)||!R)){var X=0,he=0;if(this.dom!==R){var ie=this.dom.getBoundingClientRect(),fe=R.getBoundingClientRect(),ye=(D=o.offsetX)!==null&&D!==void 0?D:(S=o.nativeEvent)===null||S===void 0?void 0:S.offsetX,ke=(x=o.offsetY)!==null&&x!==void 0?x:(N=o.nativeEvent)===null||N===void 0?void 0:N.offsetY;X=fe.x-ie.x+ye,he=fe.y-ie.y+ke}(B=o.dataTransfer)===null||B===void 0||B.setDragImage(this.dom,X,he);var Ge=He.b.create(M.state.doc,this.getPos()),gt=M.state.tr.setSelection(Ge);M.dispatch(gt)}}},{key:"stopEvent",value:function(o){var l=this,h;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:o});var D=o.target,S=this.dom.contains(D)&&!(!((h=this.contentDOM)===null||h===void 0)&&h.contains(D));if(!S)return!1;var x=o.type.startsWith("drag"),N=o.type==="drop",B=["INPUT","BUTTON","SELECT","TEXTAREA"].includes(D.tagName)||D.isContentEditable;if(B&&!N&&!x)return!0;var M=this.editor.isEditable,P=this.isDragging,R=!!this.node.type.spec.draggable,X=He.b.isSelectable(this.node),he=o.type==="copy",ie=o.type==="paste",fe=o.type==="cut",ye=o.type==="mousedown";if(!R&&X&&x&&o.preventDefault(),R&&x&&!P)return o.preventDefault(),!1;if(R&&M&&!P&&ye){var ke=D.closest("[data-drag-handle]"),Ge=ke&&(this.dom===ke||this.dom.contains(ke));Ge&&(this.isDragging=!0,document.addEventListener("dragend",function(){l.isDragging=!1},{once:!0}),document.addEventListener("drop",function(){l.isDragging=!1},{once:!0}),document.addEventListener("mouseup",function(){l.isDragging=!1},{once:!0}))}return!(P||N||he||ie||fe||ye&&X)}},{key:"ignoreMutation",value:function(o){if(!this.dom||!this.contentDOM)return!0;if(typeof this.options.ignoreMutation=="function")return this.options.ignoreMutation({mutation:o});if(this.node.isLeaf||this.node.isAtom)return!0;if(o.type==="selection")return!1;if(this.dom.contains(o.target)&&o.type==="childList"&&zn()&&this.editor.isFocused){var l=[].concat(Object(de.a)(Array.from(o.addedNodes)),Object(de.a)(Array.from(o.removedNodes)));if(l.every(function(h){return h.isContentEditable}))return!1}return this.contentDOM===o.target&&o.type==="attributes"?!0:!this.contentDOM.contains(o.target)}},{key:"updateAttributes",value:function(o){var l=this;this.editor.commands.command(function(h){var D=h.tr,S=l.getPos();return D.setNodeMarkup(S,void 0,z(z({},l.node.attrs),o)),!0})}},{key:"deleteNode",value:function(){var o=this.getPos(),l=o+this.node.nodeSize;this.editor.commands.deleteRange({from:o,to:l})}}])}();function nn(f){return new en({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=Le(f.getAttributes,void 0,D);if(S===!1||S===null)return null;var x=l.tr,N=D[D.length-1],B=D[0],M=h.to;if(N){var P=B.search(/\S/),R=h.from+B.indexOf(N),X=R+N.length,he=Zn(h.from,h.to,l.doc).filter(function(ie){var fe=ie.mark.type.excluded;return fe.find(function(ye){return ye===f.type&&ye!==ie.mark.type})}).filter(function(ie){return ie.to>R});if(he.length)return null;X<h.to&&x.delete(X,h.to),R>h.from&&x.delete(h.from+P,R),M=h.from+P+N.length,x.addMark(h.from+P,M,f.type.create(S||{})),x.removeStoredMark(f.type)}}})}function rn(f){return f.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function An(f){return typeof f=="string"}function Qt(f){return new en({find:f.find,handler:function(o){var l=o.match,h=o.chain,D=o.range,S=Le(f.getAttributes,void 0,l);if(S===!1||S===null)return null;l.input&&h().deleteRange(D).insertContentAt(D.from,{type:f.type.name,attrs:S})}})}function Mr(f){return new en({find:f.find,handler:function(o){var l=o.state,h=o.range,D=o.match,S=f.replace,x=h.from,N=h.to;if(D[1]){var B=D[0].lastIndexOf(D[1]);S+=D[0].slice(B+D[1].length),x+=B;var M=x-N;M>0&&(S=D[0].slice(B-M,B)+S,x=N)}l.tr.insertText(S,x,N)}})}var tr=function(){function f(c){Object(Be.a)(this,f),this.transaction=c,this.currentStep=this.transaction.steps.length}return Object(Pe.a)(f,[{key:"map",value:function(o){var l=!1,h=this.transaction.steps.slice(this.currentStep).reduce(function(D,S){var x=S.getMap().mapResult(D);return x.deleted&&(l=!0),x.pos},o);return{position:h,deleted:l}}}])}()},566:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return Pe}),V.d(pe,"b",function(){return Ve}),V.d(pe,"c",function(){return Re}),V.d(pe,"d",function(){return Qe}),V.d(pe,"e",function(){return Pt}),V.d(pe,"f",function(){return _}),V.d(pe,"g",function(){return ot});var j=V(1051),Ee=V(781);const me=Object.create(null);class _{constructor(T,$,Y){this.$anchor=T,this.$head=$,this.ranges=Y||[new xe(T.min($),T.max($))]}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 T=this.ranges;for(let $=0;$<T.length;$++)if(T[$].$from.pos!=T[$].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(T,$=j.j.empty){let Y=$.content.lastChild,ce=null;for(let tt=0;tt<$.openEnd;tt++)ce=Y,Y=Y.lastChild;let Oe=T.steps.length,je=this.ranges;for(let tt=0;tt<je.length;tt++){let{$from:at,$to:Ct}=je[tt],vt=T.mapping.slice(Oe);T.replaceRange(vt.map(at.pos),vt.map(Ct.pos),tt?j.j.empty:$),tt==0&&et(T,Oe,(Y?Y.isInline:ce&&ce.isTextblock)?-1:1)}}replaceWith(T,$){let Y=T.steps.length,ce=this.ranges;for(let Oe=0;Oe<ce.length;Oe++){let{$from:je,$to:tt}=ce[Oe],at=T.mapping.slice(Y),Ct=at.map(je.pos),vt=at.map(tt.pos);Oe?T.deleteRange(Ct,vt):(T.replaceRangeWith(Ct,vt,$),et(T,Y,$.isInline?-1:1))}}static findFrom(T,$,Y=!1){let ce=T.parent.inlineContent?new ot(T):dt(T.node(0),T.parent,T.pos,T.index(),$,Y);if(ce)return ce;for(let Oe=T.depth-1;Oe>=0;Oe--){let je=$<0?dt(T.node(0),T.node(Oe),T.before(Oe+1),T.index(Oe),$,Y):dt(T.node(0),T.node(Oe),T.after(Oe+1),T.index(Oe)+1,$,Y);if(je)return je}return null}static near(T,$=1){return this.findFrom(T,$)||this.findFrom(T,-$)||new Pe(T.node(0))}static atStart(T){return dt(T,T,0,0,1)||new Pe(T)}static atEnd(T){return dt(T,T,T.content.size,T.childCount,-1)||new Pe(T)}static fromJSON(T,$){if(!$||!$.type)throw new RangeError("Invalid input for Selection.fromJSON");let Y=me[$.type];if(!Y)throw new RangeError(`No selection type ${$.type} defined`);return Y.fromJSON(T,$)}static jsonID(T,$){if(T in me)throw new RangeError("Duplicate use of selection JSON ID "+T);return me[T]=$,$.prototype.jsonID=T,$}getBookmark(){return ot.between(this.$anchor,this.$head).getBookmark()}}_.prototype.visible=!0;class xe{constructor(T,$){this.$from=T,this.$to=$}}let Dt=!1;function Fe(be){!Dt&&!be.parent.inlineContent&&(Dt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+be.parent.type.name+")"))}class ot extends _{constructor(T,$=T){Fe(T),Fe($),super(T,$)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(T,$){let Y=T.resolve($.map(this.head));if(!Y.parent.inlineContent)return _.near(Y);let ce=T.resolve($.map(this.anchor));return new ot(ce.parent.inlineContent?ce:Y,Y)}replace(T,$=j.j.empty){if(super.replace(T,$),$==j.j.empty){let Y=this.$from.marksAcross(this.$to);Y&&T.ensureMarks(Y)}}eq(T){return T instanceof ot&&T.anchor==this.anchor&&T.head==this.head}getBookmark(){return new de(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(T,$){if(typeof $.anchor!="number"||typeof $.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ot(T.resolve($.anchor),T.resolve($.head))}static create(T,$,Y=$){let ce=T.resolve($);return new this(ce,Y==$?ce:T.resolve(Y))}static between(T,$,Y){let ce=T.pos-$.pos;if((!Y||ce)&&(Y=ce>=0?1:-1),!$.parent.inlineContent){let Oe=_.findFrom($,Y,!0)||_.findFrom($,-Y,!0);if(Oe)$=Oe.$head;else return _.near($,Y)}return T.parent.inlineContent||(ce==0?T=$:(T=(_.findFrom(T,-Y,!0)||_.findFrom(T,Y,!0)).$anchor,T.pos<$.pos!=ce<0&&(T=$))),new ot(T,$)}}_.jsonID("text",ot);class de{constructor(T,$){this.anchor=T,this.head=$}map(T){return new de(T.map(this.anchor),T.map(this.head))}resolve(T){return ot.between(T.resolve(this.anchor),T.resolve(this.head))}}class Re extends _{constructor(T){let $=T.nodeAfter,Y=T.node(0).resolve(T.pos+$.nodeSize);super(T,Y),this.node=$}map(T,$){let{deleted:Y,pos:ce}=$.mapResult(this.anchor),Oe=T.resolve(ce);return Y?_.near(Oe):new Re(Oe)}content(){return new j.j(j.c.from(this.node),0,0)}eq(T){return T instanceof Re&&T.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Be(this.anchor)}static fromJSON(T,$){if(typeof $.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Re(T.resolve($.anchor))}static create(T,$){return new Re(T.resolve($))}static isSelectable(T){return!T.isText&&T.type.spec.selectable!==!1}}Re.prototype.visible=!1,_.jsonID("node",Re);class Be{constructor(T){this.anchor=T}map(T){let{deleted:$,pos:Y}=T.mapResult(this.anchor);return $?new de(Y,Y):new Be(Y)}resolve(T){let $=T.resolve(this.anchor),Y=$.nodeAfter;return Y&&Re.isSelectable(Y)?new Re($):_.near($)}}class Pe extends _{constructor(T){super(T.resolve(0),T.resolve(T.content.size))}replace(T,$=j.j.empty){if($==j.j.empty){T.delete(0,T.doc.content.size);let Y=_.atStart(T.doc);Y.eq(T.selection)||T.setSelection(Y)}else super.replace(T,$)}toJSON(){return{type:"all"}}static fromJSON(T){return new Pe(T)}map(T){return new Pe(T)}eq(T){return T instanceof Pe}getBookmark(){return _e}}_.jsonID("all",Pe);const _e={map(){return this},resolve(be){return new Pe(be)}};function dt(be,T,$,Y,ce,Oe=!1){if(T.inlineContent)return ot.create(be,$);for(let je=Y-(ce>0?0:1);ce>0?je<T.childCount:je>=0;je+=ce){let tt=T.child(je);if(tt.isAtom){if(!Oe&&Re.isSelectable(tt))return Re.create(be,$-(ce<0?tt.nodeSize:0))}else{let at=dt(be,tt,$+ce,ce<0?tt.childCount:0,ce,Oe);if(at)return at}$+=tt.nodeSize*ce}return null}function et(be,T,$){let Y=be.steps.length-1;if(Y<T)return;let ce=be.steps[Y];if(!(ce instanceof Ee.c||ce instanceof Ee.b))return;let Oe=be.mapping.maps[Y],je;Oe.forEach((tt,at,Ct,vt)=>{je==null&&(je=vt)}),be.setSelection(_.near(be.doc.resolve(je),$))}const Je=1,ft=2,Ie=4;class Se extends Ee.d{constructor(T){super(T.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=T.selection,this.storedMarks=T.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(T){if(T.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=T,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Je)&~ft,this.storedMarks=null,this}get selectionSet(){return(this.updated&Je)>0}setStoredMarks(T){return this.storedMarks=T,this.updated|=ft,this}ensureMarks(T){return j.d.sameSet(this.storedMarks||this.selection.$from.marks(),T)||this.setStoredMarks(T),this}addStoredMark(T){return this.ensureMarks(T.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(T){return this.ensureMarks(T.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ft)>0}addStep(T,$){super.addStep(T,$),this.updated=this.updated&~ft,this.storedMarks=null}setTime(T){return this.time=T,this}replaceSelection(T){return this.selection.replace(this,T),this}replaceSelectionWith(T,$=!0){let Y=this.selection;return $&&(T=T.mark(this.storedMarks||(Y.empty?Y.$from.marks():Y.$from.marksAcross(Y.$to)||j.d.none))),Y.replaceWith(this,T),this}deleteSelection(){return this.selection.replace(this),this}insertText(T,$,Y){let ce=this.doc.type.schema;if($==null)return T?this.replaceSelectionWith(ce.text(T),!0):this.deleteSelection();{if(Y==null&&(Y=$),Y=Y==null?$:Y,!T)return this.deleteRange($,Y);let Oe=this.storedMarks;if(!Oe){let je=this.doc.resolve($);Oe=Y==$?je.marks():je.marksAcross(this.doc.resolve(Y))}return this.replaceRangeWith($,Y,ce.text(T,Oe)),this.selection.empty||this.setSelection(_.near(this.selection.$to)),this}}setMeta(T,$){return this.meta[typeof T=="string"?T:T.key]=$,this}getMeta(T){return this.meta[typeof T=="string"?T:T.key]}get isGeneric(){for(let T in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ie,this}get scrolledIntoView(){return(this.updated&Ie)>0}}function we(be,T){return!T||!be?be:be.bind(T)}class Me{constructor(T,$,Y){this.name=T,this.init=we($.init,Y),this.apply=we($.apply,Y)}}const Ke=[new Me("doc",{init(be){return be.doc||be.schema.topNodeType.createAndFill()},apply(be){return be.doc}}),new Me("selection",{init(be,T){return be.selection||_.atStart(T.doc)},apply(be){return be.selection}}),new Me("storedMarks",{init(be){return be.storedMarks||null},apply(be,T,$,Y){return Y.selection.$cursor?be.storedMarks:null}}),new Me("scrollToSelection",{init(){return 0},apply(be,T){return be.scrolledIntoView?T+1:T}})];class We{constructor(T,$){this.schema=T,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ke.slice(),$&&$.forEach(Y=>{if(this.pluginsByKey[Y.key])throw new RangeError("Adding different instances of a keyed plugin ("+Y.key+")");this.plugins.push(Y),this.pluginsByKey[Y.key]=Y,Y.spec.state&&this.fields.push(new Me(Y.key,Y.spec.state,Y))})}}class Ve{constructor(T){this.config=T}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(T){return this.applyTransaction(T).state}filterTransaction(T,$=-1){for(let Y=0;Y<this.config.plugins.length;Y++)if(Y!=$){let ce=this.config.plugins[Y];if(ce.spec.filterTransaction&&!ce.spec.filterTransaction.call(ce,T,this))return!1}return!0}applyTransaction(T){if(!this.filterTransaction(T))return{state:this,transactions:[]};let $=[T],Y=this.applyInner(T),ce=null;for(;;){let Oe=!1;for(let je=0;je<this.config.plugins.length;je++){let tt=this.config.plugins[je];if(tt.spec.appendTransaction){let at=ce?ce[je].n:0,Ct=ce?ce[je].state:this,vt=at<$.length&&tt.spec.appendTransaction.call(tt,at?$.slice(at):$,Ct,Y);if(vt&&Y.filterTransaction(vt,je)){if(vt.setMeta("appendedTransaction",T),!ce){ce=[];for(let Tt=0;Tt<this.config.plugins.length;Tt++)ce.push(Tt<je?{state:Y,n:$.length}:{state:this,n:0})}$.push(vt),Y=Y.applyInner(vt),Oe=!0}ce&&(ce[je]={state:Y,n:$.length})}}if(!Oe)return{state:Y,transactions:$}}}applyInner(T){if(!T.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let $=new Ve(this.config),Y=this.config.fields;for(let ce=0;ce<Y.length;ce++){let Oe=Y[ce];$[Oe.name]=Oe.apply(T,this[Oe.name],this,$)}return $}get tr(){return new Se(this)}static create(T){let $=new We(T.doc?T.doc.type.schema:T.schema,T.plugins),Y=new Ve($);for(let ce=0;ce<$.fields.length;ce++)Y[$.fields[ce].name]=$.fields[ce].init(T,Y);return Y}reconfigure(T){let $=new We(this.schema,T.plugins),Y=$.fields,ce=new Ve($);for(let Oe=0;Oe<Y.length;Oe++){let je=Y[Oe].name;ce[je]=this.hasOwnProperty(je)?this[je]:Y[Oe].init(T,ce)}return ce}toJSON(T){let $={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&($.storedMarks=this.storedMarks.map(Y=>Y.toJSON())),T&&typeof T=="object")for(let Y in T){if(Y=="doc"||Y=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let ce=T[Y],Oe=ce.spec.state;Oe&&Oe.toJSON&&($[Y]=Oe.toJSON.call(ce,this[ce.key]))}return $}static fromJSON(T,$,Y){if(!$)throw new RangeError("Invalid input for EditorState.fromJSON");if(!T.schema)throw new RangeError("Required config field 'schema' missing");let ce=new We(T.schema,T.plugins),Oe=new Ve(ce);return ce.fields.forEach(je=>{if(je.name=="doc")Oe.doc=j.f.fromJSON(T.schema,$.doc);else if(je.name=="selection")Oe.selection=_.fromJSON(Oe.doc,$.selection);else if(je.name=="storedMarks")$.storedMarks&&(Oe.storedMarks=$.storedMarks.map(T.schema.markFromJSON));else{if(Y)for(let tt in Y){let at=Y[tt],Ct=at.spec.state;if(at.key==je.name&&Ct&&Ct.fromJSON&&Object.prototype.hasOwnProperty.call($,tt)){Oe[je.name]=Ct.fromJSON.call(at,T,$[tt],Oe);return}}Oe[je.name]=je.init(T,Oe)}}),Oe}}function rt(be,T,$){for(let Y in be){let ce=be[Y];ce instanceof Function?ce=ce.bind(T):Y=="handleDOMEvents"&&(ce=rt(ce,T,{})),$[Y]=ce}return $}class Qe{constructor(T){this.spec=T,this.props={},T.props&&rt(T.props,this,this.props),this.key=T.key?T.key.key:it("plugin")}getState(T){return T[this.key]}}const mt=Object.create(null);function it(be){return be in mt?be+"$"+ ++mt[be]:(mt[be]=0,be+"$")}class Pt{constructor(T="key"){this.key=it(T)}get(T){return T.config.pluginsByKey[this.key]}getState(T){return T[this.key]}}},608:function(sn,pe,V){"use strict";var j=V(566);V.d(pe,"a",function(){return j.b}),V.d(pe,"b",function(){return j.c}),V.d(pe,"c",function(){return j.d}),V.d(pe,"d",function(){return j.e}),V.d(pe,"e",function(){return j.f}),V.d(pe,"f",function(){return j.g})},692:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return et});var j=V(11),Ee=V.n(j),me=V(80),_=V.n(me),xe=V(55),Dt=V.n(xe),Fe=V(6),ot=V.n(Fe),de=V(8),Re=V.n(de),Be=V(519),Pe=V(566),_e=V(1576),dt=V.n(_e),et=Be.c.create({name:"link",priority:1e3,inclusive:!1,addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:function(){return[{tag:"a[href]"}]},renderHTML:function(ft){var Ie=ft.HTMLAttributes;return["a",Object(Be.k)(this.options.HTMLAttributes,Ie),0]},addCommands:function(){return{setLink:function(Ie){return function(Se){var we=Se.commands;return we.setMark("link",Ie)}},toggleLink:function(Ie){return function(Se){var we=Se.commands;return we.toggleMark("link",Ie,{extendEmptyMarkRange:!0})}},unsetLink:function(){return function(Ie){var Se=Ie.commands;return Se.unsetMark("link",{extendEmptyMarkRange:!0})}}}},addPasteRules:function(){return[Object(Be.j)({find:function(Ie){return Object(_e.find)(Ie).filter(function(Se){return Se.isLink}).map(function(Se){return{text:Se.value,index:Se.start,data:Se}})},type:this.type,getAttributes:function(Ie){var Se;return{href:(Se=Ie.data)===null||Se===void 0?void 0:Se.href}}})]},addProseMirrorPlugins:function(){var ft=this,Ie=[];return this.options.openOnClick&&Ie.push(new Pe.d({key:new Pe.e("handleClickLink"),props:{handleClick:function(we,Me,Ke){var We,Ve=ft.editor.getAttributes("link"),rt=(We=Ke.target)===null||We===void 0?void 0:We.closest("a");return rt&&Ve.href?(window.open(Ve.href,Ve.target),!0):!1}}})),this.options.linkOnPaste&&Ie.push(new Pe.d({key:new Pe.e("handlePasteLink"),props:{handlePaste:function(we,Me,Ke){var We=we.state,Ve=We.selection,rt=Ve.empty;if(rt)return!1;var Qe="";Ke.content.forEach(function(it){Qe+=it.textContent});var mt=Object(_e.find)(Qe).find(function(it){return it.isLink&&it.value===Qe});return!Qe||!mt?!1:(ft.editor.commands.setMark(ft.type,{href:mt.href}),!0)}}})),Ie}})},781:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return _e}),V.d(pe,"b",function(){return We}),V.d(pe,"c",function(){return Ke}),V.d(pe,"d",function(){return He}),V.d(pe,"e",function(){return Tt}),V.d(pe,"f",function(){return Ct}),V.d(pe,"g",function(){return ln}),V.d(pe,"h",function(){return T}),V.d(pe,"i",function(){return Ht}),V.d(pe,"j",function(){return Pt}),V.d(pe,"k",function(){return xt});var j=V(1051);const Ee=65535,me=Math.pow(2,16);function _(K,m){return K+m*me}function xe(K){return K&Ee}function Dt(K){return(K-(K&Ee))/me}const Fe=1,ot=2,de=4,Re=8;class Be{constructor(m,p,C){this.pos=m,this.delInfo=p,this.recover=C}get deleted(){return(this.delInfo&Re)>0}get deletedBefore(){return(this.delInfo&(Fe|de))>0}get deletedAfter(){return(this.delInfo&(ot|de))>0}get deletedAcross(){return(this.delInfo&de)>0}}class Pe{constructor(m,p=!1){if(this.ranges=m,this.inverted=p,!m.length&&Pe.empty)return Pe.empty}recover(m){let p=0,C=xe(m);if(!this.inverted)for(let A=0;A<C;A++)p+=this.ranges[A*3+2]-this.ranges[A*3+1];return this.ranges[C*3]+p+Dt(m)}mapResult(m,p=1){return this._map(m,p,!1)}map(m,p=1){return this._map(m,p,!0)}_map(m,p,C){let A=0,I=this.inverted?2:1,W=this.inverted?1:2;for(let Z=0;Z<this.ranges.length;Z+=3){let ue=this.ranges[Z]-(this.inverted?A:0);if(ue>m)break;let k=this.ranges[Z+I],r=this.ranges[Z+W],s=ue+k;if(m<=s){let d=k?m==ue?-1:m==s?1:p:p,v=ue+A+(d<0?0:r);if(C)return v;let b=m==(p<0?ue:s)?null:_(Z/3,m-ue),O=m==ue?ot:m==s?Fe:de;return(p<0?m!=ue:m!=s)&&(O|=Re),new Be(v,O,b)}A+=r-k}return C?m+A:new Be(m+A,0,null)}touches(m,p){let C=0,A=xe(p),I=this.inverted?2:1,W=this.inverted?1:2;for(let Z=0;Z<this.ranges.length;Z+=3){let ue=this.ranges[Z]-(this.inverted?C:0);if(ue>m)break;let k=this.ranges[Z+I],r=ue+k;if(m<=r&&Z==A*3)return!0;C+=this.ranges[Z+W]-k}return!1}forEach(m){let p=this.inverted?2:1,C=this.inverted?1:2;for(let A=0,I=0;A<this.ranges.length;A+=3){let W=this.ranges[A],Z=W-(this.inverted?I:0),ue=W+(this.inverted?0:I),k=this.ranges[A+p],r=this.ranges[A+C];m(Z,Z+k,ue,ue+r),I+=r-k}}invert(){return new Pe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(m){return m==0?Pe.empty:new Pe(m<0?[0,-m,0]:[0,0,m])}}Pe.empty=new Pe([]);class _e{constructor(m=[],p,C=0,A=m.length){this.maps=m,this.mirror=p,this.from=C,this.to=A}slice(m=0,p=this.maps.length){return new _e(this.maps,this.mirror,m,p)}copy(){return new _e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(m,p){this.to=this.maps.push(m),p!=null&&this.setMirror(this.maps.length-1,p)}appendMapping(m){for(let p=0,C=this.maps.length;p<m.maps.length;p++){let A=m.getMirror(p);this.appendMap(m.maps[p],A!=null&&A<p?C+A:void 0)}}getMirror(m){if(this.mirror){for(let p=0;p<this.mirror.length;p++)if(this.mirror[p]==m)return this.mirror[p+(p%2?-1:1)]}}setMirror(m,p){this.mirror||(this.mirror=[]),this.mirror.push(m,p)}appendMappingInverted(m){for(let p=m.maps.length-1,C=this.maps.length+m.maps.length;p>=0;p--){let A=m.getMirror(p);this.appendMap(m.maps[p].invert(),A!=null&&A>p?C-A-1:void 0)}}invert(){let m=new _e;return m.appendMappingInverted(this),m}map(m,p=1){if(this.mirror)return this._map(m,p,!0);for(let C=this.from;C<this.to;C++)m=this.maps[C].map(m,p);return m}mapResult(m,p=1){return this._map(m,p,!1)}_map(m,p,C){let A=0;for(let I=this.from;I<this.to;I++){let W=this.maps[I],Z=W.mapResult(m,p);if(Z.recover!=null){let ue=this.getMirror(I);if(ue!=null&&ue>I&&ue<this.to){I=ue,m=this.maps[ue].recover(Z.recover);continue}}A|=Z.delInfo,m=Z.pos}return C?m:new Be(m,A,null)}}const dt=Object.create(null);class et{getMap(){return Pe.empty}merge(m){return null}static fromJSON(m,p){if(!p||!p.stepType)throw new RangeError("Invalid input for Step.fromJSON");let C=dt[p.stepType];if(!C)throw new RangeError(`No step type ${p.stepType} defined`);return C.fromJSON(m,p)}static jsonID(m,p){if(m in dt)throw new RangeError("Duplicate use of step JSON ID "+m);return dt[m]=p,p.prototype.jsonID=m,p}}class Je{constructor(m,p){this.doc=m,this.failed=p}static ok(m){return new Je(m,null)}static fail(m){return new Je(null,m)}static fromReplace(m,p,C,A){try{return Je.ok(m.replace(p,C,A))}catch(I){if(I instanceof j.h)return Je.fail(I.message);throw I}}}function ft(K,m,p){let C=[];for(let A=0;A<K.childCount;A++){let I=K.child(A);I.content.size&&(I=I.copy(ft(I.content,m,I))),I.isInline&&(I=m(I,p,A)),C.push(I)}return j.c.fromArray(C)}class Ie extends et{constructor(m,p,C){super(),this.from=m,this.to=p,this.mark=C}apply(m){let p=m.slice(this.from,this.to),C=m.resolve(this.from),A=C.node(C.sharedDepth(this.to)),I=new j.j(ft(p.content,(W,Z)=>!W.isAtom||!Z.type.allowsMarkType(this.mark.type)?W:W.mark(this.mark.addToSet(W.marks)),A),p.openStart,p.openEnd);return Je.fromReplace(m,this.from,this.to,I)}invert(){return new Se(this.from,this.to,this.mark)}map(m){let p=m.mapResult(this.from,1),C=m.mapResult(this.to,-1);return p.deleted&&C.deleted||p.pos>=C.pos?null:new Ie(p.pos,C.pos,this.mark)}merge(m){return m instanceof Ie&&m.mark.eq(this.mark)&&this.from<=m.to&&this.to>=m.from?new Ie(Math.min(this.from,m.from),Math.max(this.to,m.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(m,p){if(typeof p.from!="number"||typeof p.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ie(p.from,p.to,m.markFromJSON(p.mark))}}et.jsonID("addMark",Ie);class Se extends et{constructor(m,p,C){super(),this.from=m,this.to=p,this.mark=C}apply(m){let p=m.slice(this.from,this.to),C=new j.j(ft(p.content,A=>A.mark(this.mark.removeFromSet(A.marks)),m),p.openStart,p.openEnd);return Je.fromReplace(m,this.from,this.to,C)}invert(){return new Ie(this.from,this.to,this.mark)}map(m){let p=m.mapResult(this.from,1),C=m.mapResult(this.to,-1);return p.deleted&&C.deleted||p.pos>=C.pos?null:new Se(p.pos,C.pos,this.mark)}merge(m){return m instanceof Se&&m.mark.eq(this.mark)&&this.from<=m.to&&this.to>=m.from?new Se(Math.min(this.from,m.from),Math.max(this.to,m.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(m,p){if(typeof p.from!="number"||typeof p.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Se(p.from,p.to,m.markFromJSON(p.mark))}}et.jsonID("removeMark",Se);class we extends et{constructor(m,p){super(),this.pos=m,this.mark=p}apply(m){let p=m.nodeAt(this.pos);if(!p)return Je.fail("No node at mark step's position");let C=p.type.create(p.attrs,null,this.mark.addToSet(p.marks));return Je.fromReplace(m,this.pos,this.pos+1,new j.j(j.c.from(C),0,p.isLeaf?0:1))}invert(m){let p=m.nodeAt(this.pos);if(p){let C=this.mark.addToSet(p.marks);if(C.length==p.marks.length){for(let A=0;A<p.marks.length;A++)if(!p.marks[A].isInSet(C))return new we(this.pos,p.marks[A]);return new we(this.pos,this.mark)}}return new Me(this.pos,this.mark)}map(m){let p=m.mapResult(this.pos,1);return p.deletedAfter?null:new we(p.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(m,p){if(typeof p.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new we(p.pos,m.markFromJSON(p.mark))}}et.jsonID("addNodeMark",we);class Me extends et{constructor(m,p){super(),this.pos=m,this.mark=p}apply(m){let p=m.nodeAt(this.pos);if(!p)return Je.fail("No node at mark step's position");let C=p.type.create(p.attrs,null,this.mark.removeFromSet(p.marks));return Je.fromReplace(m,this.pos,this.pos+1,new j.j(j.c.from(C),0,p.isLeaf?0:1))}invert(m){let p=m.nodeAt(this.pos);return!p||!this.mark.isInSet(p.marks)?this:new we(this.pos,this.mark)}map(m){let p=m.mapResult(this.pos,1);return p.deletedAfter?null:new Me(p.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(m,p){if(typeof p.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Me(p.pos,m.markFromJSON(p.mark))}}et.jsonID("removeNodeMark",Me);class Ke extends et{constructor(m,p,C,A=!1){super(),this.from=m,this.to=p,this.slice=C,this.structure=A}apply(m){return this.structure&&Ve(m,this.from,this.to)?Je.fail("Structure replace would overwrite content"):Je.fromReplace(m,this.from,this.to,this.slice)}getMap(){return new Pe([this.from,this.to-this.from,this.slice.size])}invert(m){return new Ke(this.from,this.from+this.slice.size,m.slice(this.from,this.to))}map(m){let p=m.mapResult(this.from,1),C=m.mapResult(this.to,-1);return p.deletedAcross&&C.deletedAcross?null:new Ke(p.pos,Math.max(p.pos,C.pos),this.slice)}merge(m){if(!(m instanceof Ke)||m.structure||this.structure)return null;if(this.from+this.slice.size==m.from&&!this.slice.openEnd&&!m.slice.openStart){let p=this.slice.size+m.slice.size==0?j.j.empty:new j.j(this.slice.content.append(m.slice.content),this.slice.openStart,m.slice.openEnd);return new Ke(this.from,this.to+(m.to-m.from),p,this.structure)}else if(m.to==this.from&&!this.slice.openStart&&!m.slice.openEnd){let p=this.slice.size+m.slice.size==0?j.j.empty:new j.j(m.slice.content.append(this.slice.content),m.slice.openStart,this.slice.openEnd);return new Ke(m.from,this.to,p,this.structure)}else return null}toJSON(){let m={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(m.slice=this.slice.toJSON()),this.structure&&(m.structure=!0),m}static fromJSON(m,p){if(typeof p.from!="number"||typeof p.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ke(p.from,p.to,j.j.fromJSON(m,p.slice),!!p.structure)}}et.jsonID("replace",Ke);class We extends et{constructor(m,p,C,A,I,W,Z=!1){super(),this.from=m,this.to=p,this.gapFrom=C,this.gapTo=A,this.slice=I,this.insert=W,this.structure=Z}apply(m){if(this.structure&&(Ve(m,this.from,this.gapFrom)||Ve(m,this.gapTo,this.to)))return Je.fail("Structure gap-replace would overwrite content");let p=m.slice(this.gapFrom,this.gapTo);if(p.openStart||p.openEnd)return Je.fail("Gap is not a flat range");let C=this.slice.insertAt(this.insert,p.content);return C?Je.fromReplace(m,this.from,this.to,C):Je.fail("Content does not fit in gap")}getMap(){return new Pe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(m){let p=this.gapTo-this.gapFrom;return new We(this.from,this.from+this.slice.size+p,this.from+this.insert,this.from+this.insert+p,m.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(m){let p=m.mapResult(this.from,1),C=m.mapResult(this.to,-1),A=m.map(this.gapFrom,-1),I=m.map(this.gapTo,1);return p.deletedAcross&&C.deletedAcross||A<p.pos||I>C.pos?null:new We(p.pos,C.pos,A,I,this.slice,this.insert,this.structure)}toJSON(){let m={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(m.slice=this.slice.toJSON()),this.structure&&(m.structure=!0),m}static fromJSON(m,p){if(typeof p.from!="number"||typeof p.to!="number"||typeof p.gapFrom!="number"||typeof p.gapTo!="number"||typeof p.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new We(p.from,p.to,p.gapFrom,p.gapTo,j.j.fromJSON(m,p.slice),p.insert,!!p.structure)}}et.jsonID("replaceAround",We);function Ve(K,m,p){let C=K.resolve(m),A=p-m,I=C.depth;for(;A>0&&I>0&&C.indexAfter(I)==C.node(I).childCount;)I--,A--;if(A>0){let W=C.node(I).maybeChild(C.indexAfter(I));for(;A>0;){if(!W||W.isLeaf)return!0;W=W.firstChild,A--}}return!1}function rt(K,m,p,C){let A=[],I=[],W,Z;K.doc.nodesBetween(m,p,(ue,k,r)=>{if(!ue.isInline)return;let s=ue.marks;if(!C.isInSet(s)&&r.type.allowsMarkType(C.type)){let d=Math.max(k,m),v=Math.min(k+ue.nodeSize,p),b=C.addToSet(s);for(let O=0;O<s.length;O++)s[O].isInSet(b)||(W&&W.to==d&&W.mark.eq(s[O])?W.to=v:A.push(W=new Se(d,v,s[O])));Z&&Z.to==d?Z.to=v:I.push(Z=new Ie(d,v,C))}}),A.forEach(ue=>K.step(ue)),I.forEach(ue=>K.step(ue))}function Qe(K,m,p,C){let A=[],I=0;K.doc.nodesBetween(m,p,(W,Z)=>{if(!W.isInline)return;I++;let ue=null;if(C instanceof j.e){let k=W.marks,r;for(;r=C.isInSet(k);)(ue||(ue=[])).push(r),k=r.removeFromSet(k)}else C?C.isInSet(W.marks)&&(ue=[C]):ue=W.marks;if(ue&&ue.length){let k=Math.min(Z+W.nodeSize,p);for(let r=0;r<ue.length;r++){let s=ue[r],d;for(let v=0;v<A.length;v++){let b=A[v];b.step==I-1&&s.eq(A[v].style)&&(d=b)}d?(d.to=k,d.step=I):A.push({style:s,from:Math.max(Z,m),to:k,step:I})}}}),A.forEach(W=>K.step(new Se(W.from,W.to,W.style)))}function mt(K,m,p,C=p.contentMatch){let A=K.doc.nodeAt(m),I=[],W=m+1;for(let Z=0;Z<A.childCount;Z++){let ue=A.child(Z),k=W+ue.nodeSize,r=C.matchType(ue.type);if(!r)I.push(new Ke(W,k,j.j.empty));else{C=r;for(let s=0;s<ue.marks.length;s++)p.allowsMarkType(ue.marks[s].type)||K.step(new Se(W,k,ue.marks[s]))}W=k}if(!C.validEnd){let Z=C.fillBefore(j.c.empty,!0);K.replace(W,W,new j.j(Z,0,0))}for(let Z=I.length-1;Z>=0;Z--)K.step(I[Z])}function it(K,m,p){return(m==0||K.canReplace(m,K.childCount))&&(p==K.childCount||K.canReplace(0,p))}function Pt(K){let p=K.parent.content.cutByIndex(K.startIndex,K.endIndex);for(let C=K.depth;;--C){let A=K.$from.node(C),I=K.$from.index(C),W=K.$to.indexAfter(C);if(C<K.depth&&A.canReplace(I,W,p))return C;if(C==0||A.type.spec.isolating||!it(A,I,W))break}return null}function be(K,m,p){let{$from:C,$to:A,depth:I}=m,W=C.before(I+1),Z=A.after(I+1),ue=W,k=Z,r=j.c.empty,s=0;for(let b=I,O=!1;b>p;b--)O||C.index(b)>0?(O=!0,r=j.c.from(C.node(b).copy(r)),s++):ue--;let d=j.c.empty,v=0;for(let b=I,O=!1;b>p;b--)O||A.after(b+1)<A.end(b)?(O=!0,d=j.c.from(A.node(b).copy(d)),v++):k++;K.step(new We(ue,k,W,Z,new j.j(r.append(d),s,v),r.size-s,!0))}function T(K,m,p=null,C=K){let A=Y(K,m),I=A&&ce(C,m);return I?A.map($).concat({type:m,attrs:p}).concat(I.map($)):null}function $(K){return{type:K,attrs:null}}function Y(K,m){let{parent:p,startIndex:C,endIndex:A}=K,I=p.contentMatchAt(C).findWrapping(m);if(!I)return null;let W=I.length?I[0]:m;return p.canReplaceWith(C,A,W)?I:null}function ce(K,m){let{parent:p,startIndex:C,endIndex:A}=K,I=p.child(C),W=m.contentMatch.findWrapping(I.type);if(!W)return null;let ue=(W.length?W[W.length-1]:m).contentMatch;for(let k=C;ue&&k<A;k++)ue=ue.matchType(p.child(k).type);return!ue||!ue.validEnd?null:W}function Oe(K,m,p){let C=j.c.empty;for(let W=p.length-1;W>=0;W--){if(C.size){let Z=p[W].type.contentMatch.matchFragment(C);if(!Z||!Z.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}C=j.c.from(p[W].type.create(p[W].attrs,C))}let A=m.start,I=m.end;K.step(new We(A,I,A,I,new j.j(C,0,0),p.length,!0))}function je(K,m,p,C,A){if(!C.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let I=K.steps.length;K.doc.nodesBetween(m,p,(W,Z)=>{if(W.isTextblock&&!W.hasMarkup(C,A)&&tt(K.doc,K.mapping.slice(I).map(Z),C)){K.clearIncompatible(K.mapping.slice(I).map(Z,1),C);let ue=K.mapping.slice(I),k=ue.map(Z,1),r=ue.map(Z+W.nodeSize,1);return K.step(new We(k,r,k+1,r-1,new j.j(j.c.from(C.create(A,null,W.marks)),0,0),1,!0)),!1}})}function tt(K,m,p){let C=K.resolve(m),A=C.index();return C.parent.canReplaceWith(A,A+1,p)}function at(K,m,p,C,A){let I=K.doc.nodeAt(m);if(!I)throw new RangeError("No node at given position");p||(p=I.type);let W=p.create(C,null,A||I.marks);if(I.isLeaf)return K.replaceWith(m,m+I.nodeSize,W);if(!p.validContent(I.content))throw new RangeError("Invalid content for node type "+p.name);K.step(new We(m,m+I.nodeSize,m+1,m+I.nodeSize-1,new j.j(j.c.from(W),0,0),1,!0))}function Ct(K,m,p=1,C){let A=K.resolve(m),I=A.depth-p,W=C&&C[C.length-1]||A.parent;if(I<0||A.parent.type.spec.isolating||!A.parent.canReplace(A.index(),A.parent.childCount)||!W.type.validContent(A.parent.content.cutByIndex(A.index(),A.parent.childCount)))return!1;for(let k=A.depth-1,r=p-2;k>I;k--,r--){let s=A.node(k),d=A.index(k);if(s.type.spec.isolating)return!1;let v=s.content.cutByIndex(d,s.childCount),b=C&&C[r+1];b&&(v=v.replaceChild(0,b.type.create(b.attrs)));let O=C&&C[r]||s;if(!s.canReplace(d+1,s.childCount)||!O.type.validContent(v))return!1}let Z=A.indexAfter(I),ue=C&&C[0];return A.node(I).canReplaceWith(Z,Z,ue?ue.type:A.node(I+1).type)}function vt(K,m,p=1,C){let A=K.doc.resolve(m),I=j.c.empty,W=j.c.empty;for(let Z=A.depth,ue=A.depth-p,k=p-1;Z>ue;Z--,k--){I=j.c.from(A.node(Z).copy(I));let r=C&&C[k];W=j.c.from(r?r.type.create(r.attrs,W):A.node(Z).copy(W))}K.step(new Ke(m,m,new j.j(I.append(W),p,p),!0))}function Tt(K,m){let p=K.resolve(m),C=p.index();return Rt(p.nodeBefore,p.nodeAfter)&&p.parent.canReplace(C,C+1)}function Rt(K,m){return!!(K&&m&&!K.isLeaf&&K.canAppend(m))}function Ht(K,m,p=-1){let C=K.resolve(m);for(let A=C.depth;;A--){let I,W,Z=C.index(A);if(A==C.depth?(I=C.nodeBefore,W=C.nodeAfter):p>0?(I=C.node(A+1),Z++,W=C.node(A).maybeChild(Z)):(I=C.node(A).maybeChild(Z-1),W=C.node(A+1)),I&&!I.isTextblock&&Rt(I,W)&&C.node(A).canReplace(Z,Z+1))return m;if(A==0)break;m=p<0?C.before(A):C.after(A)}}function St(K,m,p){let C=new Ke(m-p,m+p,j.j.empty,!0);K.step(C)}function Ft(K,m,p){let C=K.resolve(m);if(C.parent.canReplaceWith(C.index(),C.index(),p))return m;if(C.parentOffset==0)for(let A=C.depth-1;A>=0;A--){let I=C.index(A);if(C.node(A).canReplaceWith(I,I,p))return C.before(A+1);if(I>0)return null}if(C.parentOffset==C.parent.content.size)for(let A=C.depth-1;A>=0;A--){let I=C.indexAfter(A);if(C.node(A).canReplaceWith(I,I,p))return C.after(A+1);if(I<C.node(A).childCount)return null}return null}function ln(K,m,p){let C=K.resolve(m);if(!p.content.size)return m;let A=p.content;for(let I=0;I<p.openStart;I++)A=A.firstChild.content;for(let I=1;I<=(p.openStart==0&&p.size?2:1);I++)for(let W=C.depth;W>=0;W--){let Z=W==C.depth?0:C.pos<=(C.start(W+1)+C.end(W+1))/2?-1:1,ue=C.index(W)+(Z>0?1:0),k=C.node(W),r=!1;if(I==1)r=k.canReplace(ue,ue,A);else{let s=k.contentMatchAt(ue).findWrapping(A.firstChild.type);r=s&&k.canReplaceWith(ue,ue,s[0])}if(r)return Z==0?C.pos:Z<0?C.before(W+1):C.after(W+1)}return null}function xt(K,m,p=m,C=j.j.empty){if(m==p&&!C.size)return null;let A=K.resolve(m),I=K.resolve(p);return J(A,I,C)?new Ke(m,p,C):new H(A,I,C).fit()}function J(K,m,p){return!p.openStart&&!p.openEnd&&K.start()==m.start()&&K.parent.canReplace(K.index(),m.index(),p.content)}class H{constructor(m,p,C){this.$from=m,this.$to=p,this.unplaced=C,this.frontier=[],this.placed=j.c.empty;for(let A=0;A<=m.depth;A++){let I=m.node(A);this.frontier.push({type:I.type,match:I.contentMatchAt(m.indexAfter(A))})}for(let A=m.depth;A>0;A--)this.placed=j.c.from(m.node(A).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let k=this.findFittable();k?this.placeNodes(k):this.openMore()||this.dropNode()}let m=this.mustMoveInline(),p=this.placed.size-this.depth-this.$from.depth,C=this.$from,A=this.close(m<0?this.$to:C.doc.resolve(m));if(!A)return null;let I=this.placed,W=C.depth,Z=A.depth;for(;W&&Z&&I.childCount==1;)I=I.firstChild.content,W--,Z--;let ue=new j.j(I,W,Z);return m>-1?new We(C.pos,m,this.$to.pos,this.$to.end(),ue,p):ue.size||C.pos!=this.$to.pos?new Ke(C.pos,A.pos,ue):null}findFittable(){let m=this.unplaced.openStart;for(let p=this.unplaced.content,C=0,A=this.unplaced.openEnd;C<m;C++){let I=p.firstChild;if(p.childCount>1&&(A=0),I.type.spec.isolating&&A<=C){m=C;break}p=I.content}for(let p=1;p<=2;p++)for(let C=p==1?m:this.unplaced.openStart;C>=0;C--){let A,I=null;C?(I=ee(this.unplaced.content,C-1).firstChild,A=I.content):A=this.unplaced.content;let W=A.firstChild;for(let Z=this.depth;Z>=0;Z--){let{type:ue,match:k}=this.frontier[Z],r,s=null;if(p==1&&(W?k.matchType(W.type)||(s=k.fillBefore(j.c.from(W),!1)):I&&ue.compatibleContent(I.type)))return{sliceDepth:C,frontierDepth:Z,parent:I,inject:s};if(p==2&&W&&(r=k.findWrapping(W.type)))return{sliceDepth:C,frontierDepth:Z,parent:I,wrap:r};if(I&&k.matchType(I.type))break}}}openMore(){let{content:m,openStart:p,openEnd:C}=this.unplaced,A=ee(m,p);return!A.childCount||A.firstChild.isLeaf?!1:(this.unplaced=new j.j(m,p+1,Math.max(C,A.size+p>=m.size-C?p+1:0)),!0)}dropNode(){let{content:m,openStart:p,openEnd:C}=this.unplaced,A=ee(m,p);if(A.childCount<=1&&p>0){let I=m.size-p<=p+A.size;this.unplaced=new j.j(G(m,p-1,1),p-1,I?p-1:C)}else this.unplaced=new j.j(G(m,p,1),p,C)}placeNodes({sliceDepth:m,frontierDepth:p,parent:C,inject:A,wrap:I}){for(;this.depth>p;)this.closeFrontierNode();if(I)for(let O=0;O<I.length;O++)this.openFrontierNode(I[O]);let W=this.unplaced,Z=C?C.content:W.content,ue=W.openStart-m,k=0,r=[],{match:s,type:d}=this.frontier[p];if(A){for(let O=0;O<A.childCount;O++)r.push(A.child(O));s=s.matchFragment(A)}let v=Z.size+m-(W.content.size-W.openEnd);for(;k<Z.childCount;){let O=Z.child(k),L=s.matchType(O.type);if(!L)break;k++,(k>1||ue==0||O.content.size)&&(s=L,r.push(ne(O.mark(d.allowedMarks(O.marks)),k==1?ue:0,k==Z.childCount?v:-1)))}let b=k==Z.childCount;b||(v=-1),this.placed=Q(this.placed,p,j.c.from(r)),this.frontier[p].match=s,b&&v<0&&C&&C.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let O=0,L=Z;O<v;O++){let U=L.lastChild;this.frontier.push({type:U.type,match:U.contentMatchAt(U.childCount)}),L=U.content}this.unplaced=b?m==0?j.j.empty:new j.j(G(W.content,m-1,1),m-1,v<0?W.openEnd:m-1):new j.j(G(W.content,m,k),W.openStart,W.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let m=this.frontier[this.depth],p;if(!m.type.isTextblock||!De(this.$to,this.$to.depth,m.type,m.match,!1)||this.$to.depth==this.depth&&(p=this.findCloseLevel(this.$to))&&p.depth==this.depth)return-1;let{depth:C}=this.$to,A=this.$to.after(C);for(;C>1&&A==this.$to.end(--C);)++A;return A}findCloseLevel(m){e:for(let p=Math.min(this.depth,m.depth);p>=0;p--){let{match:C,type:A}=this.frontier[p],I=p<m.depth&&m.end(p+1)==m.pos+(m.depth-(p+1)),W=De(m,p,A,C,I);if(W){for(let Z=p-1;Z>=0;Z--){let{match:ue,type:k}=this.frontier[Z],r=De(m,Z,k,ue,!0);if(!r||r.childCount)continue e}return{depth:p,fit:W,move:I?m.doc.resolve(m.after(p+1)):m}}}}close(m){let p=this.findCloseLevel(m);if(!p)return null;for(;this.depth>p.depth;)this.closeFrontierNode();p.fit.childCount&&(this.placed=Q(this.placed,p.depth,p.fit)),m=p.move;for(let C=p.depth+1;C<=m.depth;C++){let A=m.node(C),I=A.type.contentMatch.fillBefore(A.content,!0,m.index(C));this.openFrontierNode(A.type,A.attrs,I)}return m}openFrontierNode(m,p=null,C){let A=this.frontier[this.depth];A.match=A.match.matchType(m),this.placed=Q(this.placed,this.depth,j.c.from(m.create(p,C))),this.frontier.push({type:m,match:m.contentMatch})}closeFrontierNode(){let p=this.frontier.pop().match.fillBefore(j.c.empty,!0);p.childCount&&(this.placed=Q(this.placed,this.frontier.length,p))}}function G(K,m,p){return m==0?K.cutByIndex(p,K.childCount):K.replaceChild(0,K.firstChild.copy(G(K.firstChild.content,m-1,p)))}function Q(K,m,p){return m==0?K.append(p):K.replaceChild(K.childCount-1,K.lastChild.copy(Q(K.lastChild.content,m-1,p)))}function ee(K,m){for(let p=0;p<m;p++)K=K.firstChild.content;return K}function ne(K,m,p){if(m<=0)return K;let C=K.content;return m>1&&(C=C.replaceChild(0,ne(C.firstChild,m-1,C.childCount==1?p-1:0))),m>0&&(C=K.type.contentMatch.fillBefore(C).append(C),p<=0&&(C=C.append(K.type.contentMatch.matchFragment(C).fillBefore(j.c.empty,!0)))),K.copy(C)}function De(K,m,p,C,A){let I=K.node(m),W=A?K.indexAfter(m):K.index(m);if(W==I.childCount&&!p.compatibleContent(I.type))return null;let Z=C.fillBefore(I.content,!0,W);return Z&&!Ce(p,I.content,W)?Z:null}function Ce(K,m,p){for(let C=p;C<m.childCount;C++)if(!K.allowsMarks(m.child(C).marks))return!0;return!1}function $e(K){return K.spec.defining||K.spec.definingForContent}function nt(K,m,p,C){if(!C.size)return K.deleteRange(m,p);let A=K.doc.resolve(m),I=K.doc.resolve(p);if(J(A,I,C))return K.step(new Ke(m,p,C));let W=ct(A,K.doc.resolve(p));W[W.length-1]==0&&W.pop();let Z=-(A.depth+1);W.unshift(Z);for(let d=A.depth,v=A.pos-1;d>0;d--,v--){let b=A.node(d).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;W.indexOf(d)>-1?Z=d:A.before(d)==v&&W.splice(1,0,-d)}let ue=W.indexOf(Z),k=[],r=C.openStart;for(let d=C.content,v=0;;v++){let b=d.firstChild;if(k.push(b),v==C.openStart)break;d=b.content}for(let d=r-1;d>=0;d--){let v=k[d].type,b=$e(v);if(b&&A.node(ue).type!=v)r=d;else if(b||!v.isTextblock)break}for(let d=C.openStart;d>=0;d--){let v=(d+r+1)%(C.openStart+1),b=k[v];if(b)for(let O=0;O<W.length;O++){let L=W[(O+ue)%W.length],U=!0;L<0&&(U=!1,L=-L);let Ae=A.node(L-1),Ne=A.index(L-1);if(Ae.canReplaceWith(Ne,Ne,b.type,b.marks))return K.replace(A.before(L),U?I.after(L):p,new j.j(Xe(C.content,0,C.openStart,v),v,C.openEnd))}}let s=K.steps.length;for(let d=W.length-1;d>=0&&(K.replace(m,p,C),!(K.steps.length>s));d--){let v=W[d];v<0||(m=A.before(v),p=I.after(v))}}function Xe(K,m,p,C,A){if(m<p){let I=K.firstChild;K=K.replaceChild(0,I.copy(Xe(I.content,m+1,p,C,I)))}if(m>C){let I=A.contentMatchAt(0),W=I.fillBefore(K).append(K);K=W.append(I.matchFragment(W).fillBefore(j.c.empty,!0))}return K}function Ze(K,m,p,C){if(!C.isInline&&m==p&&K.doc.resolve(m).parent.content.size){let A=Ft(K.doc,m,C.type);A!=null&&(m=p=A)}K.replaceRange(m,p,new j.j(j.c.from(C),0,0))}function st(K,m,p){let C=K.doc.resolve(m),A=K.doc.resolve(p),I=ct(C,A);for(let W=0;W<I.length;W++){let Z=I[W],ue=W==I.length-1;if(ue&&Z==0||C.node(Z).type.contentMatch.validEnd)return K.delete(C.start(Z),A.end(Z));if(Z>0&&(ue||C.node(Z-1).canReplace(C.index(Z-1),A.indexAfter(Z-1))))return K.delete(C.before(Z),A.after(Z))}for(let W=1;W<=C.depth&&W<=A.depth;W++)if(m-C.start(W)==C.depth-W&&p>C.end(W)&&A.end(W)-p!=A.depth-W)return K.delete(C.before(W),p);K.delete(m,p)}function ct(K,m){let p=[],C=Math.min(K.depth,m.depth);for(let A=C;A>=0;A--){let I=K.start(A);if(I<K.pos-(K.depth-A)||m.end(A)>m.pos+(m.depth-A)||K.node(A).type.spec.isolating||m.node(A).type.spec.isolating)break;(I==m.start(A)||A==K.depth&&A==m.depth&&K.parent.inlineContent&&m.parent.inlineContent&&A&&m.start(A-1)==I-1)&&p.push(A)}return p}class Ye extends et{constructor(m,p,C){super(),this.pos=m,this.attr=p,this.value=C}apply(m){let p=m.nodeAt(this.pos);if(!p)return Je.fail("No node at attribute step's position");let C=Object.create(null);for(let I in p.attrs)C[I]=p.attrs[I];C[this.attr]=this.value;let A=p.type.create(C,null,p.marks);return Je.fromReplace(m,this.pos,this.pos+1,new j.j(j.c.from(A),0,p.isLeaf?0:1))}getMap(){return Pe.empty}invert(m){return new Ye(this.pos,this.attr,m.nodeAt(this.pos).attrs[this.attr])}map(m){let p=m.mapResult(this.pos,1);return p.deletedAfter?null:new Ye(p.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(m,p){if(typeof p.pos!="number"||typeof p.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ye(p.pos,p.attr,p.value)}}et.jsonID("attr",Ye);let ht=class extends Error{};ht=function K(m){let p=Error.call(this,m);return p.__proto__=K.prototype,p},ht.prototype=Object.create(Error.prototype),ht.prototype.constructor=ht,ht.prototype.name="TransformError";class He{constructor(m){this.doc=m,this.steps=[],this.docs=[],this.mapping=new _e}get before(){return this.docs.length?this.docs[0]:this.doc}step(m){let p=this.maybeStep(m);if(p.failed)throw new ht(p.failed);return this}maybeStep(m){let p=m.apply(this.doc);return p.failed||this.addStep(m,p.doc),p}get docChanged(){return this.steps.length>0}addStep(m,p){this.docs.push(this.doc),this.steps.push(m),this.mapping.appendMap(m.getMap()),this.doc=p}replace(m,p=m,C=j.j.empty){let A=xt(this.doc,m,p,C);return A&&this.step(A),this}replaceWith(m,p,C){return this.replace(m,p,new j.j(j.c.from(C),0,0))}delete(m,p){return this.replace(m,p,j.j.empty)}insert(m,p){return this.replaceWith(m,m,p)}replaceRange(m,p,C){return nt(this,m,p,C),this}replaceRangeWith(m,p,C){return Ze(this,m,p,C),this}deleteRange(m,p){return st(this,m,p),this}lift(m,p){return be(this,m,p),this}join(m,p=1){return St(this,m,p),this}wrap(m,p){return Oe(this,m,p),this}setBlockType(m,p=m,C,A=null){return je(this,m,p,C,A),this}setNodeMarkup(m,p,C=null,A){return at(this,m,p,C,A),this}setNodeAttribute(m,p,C){return this.step(new Ye(m,p,C)),this}addNodeMark(m,p){return this.step(new we(m,p)),this}removeNodeMark(m,p){if(!(p instanceof j.d)){let C=this.doc.nodeAt(m);if(!C)throw new RangeError("No node at position "+m);if(p=p.isInSet(C.marks),!p)return this}return this.step(new Me(m,p)),this}split(m,p=1,C){return vt(this,m,p,C),this}addMark(m,p,C){return rt(this,m,p,C),this}removeMark(m,p,C){return Qe(this,m,p,C),this}clearIncompatible(m,p,C){return mt(this,m,p,C),this}}},790:function(sn,pe,V){"use strict";V.d(pe,"a",function(){return Wt}),V.d(pe,"b",function(){return Mt}),V.d(pe,"c",function(){return ci});var j=V(566),Ee=V(1051),me=V(781);const _=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},xe=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Dt=null;const Fe=function(t,e,n){let i=Dt||(Dt=document.createRange());return i.setEnd(t,n==null?t.nodeValue.length:n),i.setStart(t,e||0),i},ot=function(t,e,n,i){return n&&(Re(t,e,n,i,-1)||Re(t,e,n,i,1))},de=/^(img|br|input|textarea|hr)$/i;function Re(t,e,n,i,a){for(;;){if(t==n&&e==i)return!0;if(e==(a<0?0:Be(t))){let u=t.parentNode;if(!u||u.nodeType!=1||_e(t)||de.test(t.nodeName)||t.contentEditable=="false")return!1;e=_(t)+(a<0?0:1),t=u}else if(t.nodeType==1){if(t=t.childNodes[e+(a<0?-1:0)],t.contentEditable=="false")return!1;e=a<0?Be(t):0}else return!1}}function Be(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Pe(t,e,n){for(let i=e==0,a=e==Be(t);i||a;){if(t==n)return!0;let u=_(t);if(t=t.parentNode,!t)return!1;i=i&&u==0,a=a&&u==Be(t)}}function _e(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const dt=function(t){return t.focusNode&&ot(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function et(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Je(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ft(t,e,n){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(e,n);if(i)return{node:i.offsetNode,offset:i.offset}}catch(i){}if(t.caretRangeFromPoint){let i=t.caretRangeFromPoint(e,n);if(i)return{node:i.startContainer,offset:i.startOffset}}}const Ie=typeof navigator!="undefined"?navigator:null,Se=typeof document!="undefined"?document:null,we=Ie&&Ie.userAgent||"",Me=/Edge\/(\d+)/.exec(we),Ke=/MSIE \d/.exec(we),We=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(we),Ve=!!(Ke||We||Me),rt=Ke?document.documentMode:We?+We[1]:Me?+Me[1]:0,Qe=!Ve&&/gecko\/(\d+)/i.test(we);Qe&&+(/Firefox\/(\d+)/.exec(we)||[0,0])[1];const mt=!Ve&&/Chrome\/(\d+)/.exec(we),it=!!mt,Pt=mt?+mt[1]:0,be=!Ve&&!!Ie&&/Apple Computer/.test(Ie.vendor),T=be&&(/Mobile\/\w+/.test(we)||!!Ie&&Ie.maxTouchPoints>2),$=T||(Ie?/Mac/.test(Ie.platform):!1),Y=Ie?/Win/.test(Ie.platform):!1,ce=/Android \d/.test(we),Oe=!!Se&&"webkitFontSmoothing"in Se.documentElement.style,je=Oe?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tt(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function at(t,e){return typeof t=="number"?t:t[e]}function Ct(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,i=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*i}}function vt(t,e,n){let i=t.someProp("scrollThreshold")||0,a=t.someProp("scrollMargin")||5,u=t.dom.ownerDocument;for(let g=n||t.dom;g;g=xe(g)){if(g.nodeType!=1)continue;let y=g,E=y==u.body,F=E?tt(u):Ct(y),w=0,q=0;if(e.top<F.top+at(i,"top")?q=-(F.top-e.top+at(a,"top")):e.bottom>F.bottom-at(i,"bottom")&&(q=e.bottom-F.bottom+at(a,"bottom")),e.left<F.left+at(i,"left")?w=-(F.left-e.left+at(a,"left")):e.right>F.right-at(i,"right")&&(w=e.right-F.right+at(a,"right")),w||q)if(E)u.defaultView.scrollBy(w,q);else{let ae=y.scrollLeft,te=y.scrollTop;q&&(y.scrollTop+=q),w&&(y.scrollLeft+=w);let le=y.scrollLeft-ae,ze=y.scrollTop-te;e={left:e.left-le,top:e.top-ze,right:e.right-le,bottom:e.bottom-ze}}if(E||/^(fixed|sticky)$/.test(getComputedStyle(g).position))break}}function Tt(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),i,a;for(let u=(e.left+e.right)/2,g=n+1;g<Math.min(innerHeight,e.bottom);g+=5){let y=t.root.elementFromPoint(u,g);if(!y||y==t.dom||!t.dom.contains(y))continue;let E=y.getBoundingClientRect();if(E.top>=n-20){i=y,a=E.top;break}}return{refDOM:i,refTop:a,stack:Rt(t.dom)}}function Rt(t){let e=[],n=t.ownerDocument;for(let i=t;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=n);i=xe(i));return e}function Ht({refDOM:t,refTop:e,stack:n}){let i=t?t.getBoundingClientRect().top:0;St(n,i==0?0:i-e)}function St(t,e){for(let n=0;n<t.length;n++){let{dom:i,top:a,left:u}=t[n];i.scrollTop!=a+e&&(i.scrollTop=a+e),i.scrollLeft!=u&&(i.scrollLeft=u)}}let Ft=null;function ln(t){if(t.setActive)return t.setActive();if(Ft)return t.focus(Ft);let e=Rt(t);t.focus(Ft==null?{get preventScroll(){return Ft={preventScroll:!0},!0}}:void 0),Ft||(Ft=!1,St(e,0))}function xt(t,e){let n,i=2e8,a,u=0,g=e.top,y=e.top,E,F;for(let w=t.firstChild,q=0;w;w=w.nextSibling,q++){let ae;if(w.nodeType==1)ae=w.getClientRects();else if(w.nodeType==3)ae=Fe(w).getClientRects();else continue;for(let te=0;te<ae.length;te++){let le=ae[te];if(le.top<=g&&le.bottom>=y){g=Math.max(le.bottom,g),y=Math.min(le.top,y);let ze=le.left>e.left?le.left-e.left:le.right<e.left?e.left-le.right:0;if(ze<i){n=w,i=ze,a=ze&&n.nodeType==3?{left:le.right<e.left?le.right:le.left,top:e.top}:e,w.nodeType==1&&ze&&(u=q+(e.left>=(le.left+le.right)/2?1:0));continue}}else le.top>e.top&&!E&&le.left<=e.left&&le.right>=e.left&&(E=w,F={left:Math.max(le.left,Math.min(le.right,e.left)),top:le.top});!n&&(e.left>=le.right&&e.top>=le.top||e.left>=le.left&&e.top>=le.bottom)&&(u=q+1)}}return!n&&E&&(n=E,a=F,i=0),n&&n.nodeType==3?J(n,a):!n||i&&n.nodeType==1?{node:t,offset:u}:xt(n,a)}function J(t,e){let n=t.nodeValue.length,i=document.createRange();for(let a=0;a<n;a++){i.setEnd(t,a+1),i.setStart(t,a);let u=$e(i,1);if(u.top!=u.bottom&&H(e,u))return{node:t,offset:a+(e.left>=(u.left+u.right)/2?1:0)}}return{node:t,offset:0}}function H(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function G(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Q(t,e,n){let{node:i,offset:a}=xt(e,n),u=-1;if(i.nodeType==1&&!i.firstChild){let g=i.getBoundingClientRect();u=g.left!=g.right&&n.left>(g.left+g.right)/2?1:-1}return t.docView.posFromDOM(i,a,u)}function ee(t,e,n,i){let a=-1;for(let u=e,g=!1;u!=t.dom;){let y=t.docView.nearestDesc(u,!0);if(!y)return null;if(y.dom.nodeType==1&&(y.node.isBlock&&y.parent&&!g||!y.contentDOM)){let E=y.dom.getBoundingClientRect();if(y.node.isBlock&&y.parent&&!g&&(g=!0,E.left>i.left||E.top>i.top?a=y.posBefore:(E.right<i.left||E.bottom<i.top)&&(a=y.posAfter)),!y.contentDOM&&a<0&&!y.node.isText)return(y.node.isBlock?i.top<(E.top+E.bottom)/2:i.left<(E.left+E.right)/2)?y.posBefore:y.posAfter}u=y.dom.parentNode}return a>-1?a:t.docView.posFromDOM(e,n,-1)}function ne(t,e,n){let i=t.childNodes.length;if(i&&n.top<n.bottom)for(let a=Math.max(0,Math.min(i-1,Math.floor(i*(e.top-n.top)/(n.bottom-n.top))-2)),u=a;;){let g=t.childNodes[u];if(g.nodeType==1){let y=g.getClientRects();for(let E=0;E<y.length;E++){let F=y[E];if(H(e,F))return ne(g,e,F)}}if((u=(u+1)%i)==a)break}return t}function De(t,e){let n=t.dom.ownerDocument,i,a=0,u=ft(n,e.left,e.top);u&&({node:i,offset:a}=u);let g=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),y;if(!g||!t.dom.contains(g.nodeType!=1?g.parentNode:g)){let F=t.dom.getBoundingClientRect();if(!H(e,F)||(g=ne(t.dom,e,F),!g))return null}if(be)for(let F=g;i&&F;F=xe(F))F.draggable&&(i=void 0);if(g=G(g,e),i){if(Qe&&i.nodeType==1&&(a=Math.min(a,i.childNodes.length),a<i.childNodes.length)){let F=i.childNodes[a],w;F.nodeName=="IMG"&&(w=F.getBoundingClientRect()).right<=e.left&&w.bottom>e.top&&a++}i==t.dom&&a==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?y=t.state.doc.content.size:(a==0||i.nodeType!=1||i.childNodes[a-1].nodeName!="BR")&&(y=ee(t,i,a,e))}y==null&&(y=Q(t,g,e));let E=t.docView.nearestDesc(g,!0);return{pos:y,inside:E?E.posAtStart-E.border:-1}}function Ce(t){return t.top<t.bottom||t.left<t.right}function $e(t,e){let n=t.getClientRects();if(n.length){let i=n[e<0?0:n.length-1];if(Ce(i))return i}return Array.prototype.find.call(n,Ce)||t.getBoundingClientRect()}const nt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Xe(t,e,n){let{node:i,offset:a,atom:u}=t.docView.domFromPos(e,n<0?-1:1),g=Oe||Qe;if(i.nodeType==3)if(g&&(nt.test(i.nodeValue)||(n<0?!a:a==i.nodeValue.length))){let E=$e(Fe(i,a,a),n);if(Qe&&a&&/\s/.test(i.nodeValue[a-1])&&a<i.nodeValue.length){let F=$e(Fe(i,a-1,a-1),-1);if(F.top==E.top){let w=$e(Fe(i,a,a+1),-1);if(w.top!=E.top)return Ze(w,w.left<F.left)}}return E}else{let E=a,F=a,w=n<0?1:-1;return n<0&&!a?(F++,w=-1):n>=0&&a==i.nodeValue.length?(E--,w=1):n<0?E--:F++,Ze($e(Fe(i,E,F),w),w<0)}if(!t.state.doc.resolve(e-(u||0)).parent.inlineContent){if(u==null&&a&&(n<0||a==Be(i))){let E=i.childNodes[a-1];if(E.nodeType==1)return st(E.getBoundingClientRect(),!1)}if(u==null&&a<Be(i)){let E=i.childNodes[a];if(E.nodeType==1)return st(E.getBoundingClientRect(),!0)}return st(i.getBoundingClientRect(),n>=0)}if(u==null&&a&&(n<0||a==Be(i))){let E=i.childNodes[a-1],F=E.nodeType==3?Fe(E,Be(E)-(g?0:1)):E.nodeType==1&&(E.nodeName!="BR"||!E.nextSibling)?E:null;if(F)return Ze($e(F,1),!1)}if(u==null&&a<Be(i)){let E=i.childNodes[a];for(;E.pmViewDesc&&E.pmViewDesc.ignoreForCoords;)E=E.nextSibling;let F=E?E.nodeType==3?Fe(E,0,g?0:1):E.nodeType==1?E:null:null;if(F)return Ze($e(F,-1),!0)}return Ze($e(i.nodeType==3?Fe(i):i,-n),n>=0)}function Ze(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function st(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function ct(t,e,n){let i=t.state,a=t.root.activeElement;i!=e&&t.updateState(e),a!=t.dom&&t.focus();try{return n()}finally{i!=e&&t.updateState(i),a!=t.dom&&a&&a.focus()}}function Ye(t,e,n){let i=e.selection,a=n=="up"?i.$from:i.$to;return ct(t,e,()=>{let{node:u}=t.docView.domFromPos(a.pos,n=="up"?-1:1);for(;;){let y=t.docView.nearestDesc(u,!0);if(!y)break;if(y.node.isBlock){u=y.contentDOM||y.dom;break}u=y.dom.parentNode}let g=Xe(t,a.pos,1);for(let y=u.firstChild;y;y=y.nextSibling){let E;if(y.nodeType==1)E=y.getClientRects();else if(y.nodeType==3)E=Fe(y,0,y.nodeValue.length).getClientRects();else continue;for(let F=0;F<E.length;F++){let w=E[F];if(w.bottom>w.top+1&&(n=="up"?g.top-w.top>(w.bottom-g.top)*2:w.bottom-g.bottom>(g.bottom-w.top)*2))return!1}}return!0})}const ht=/[\u0590-\u08ac]/;function He(t,e,n){let{$head:i}=e.selection;if(!i.parent.isTextblock)return!1;let a=i.parentOffset,u=!a,g=a==i.parent.content.size,y=t.domSelection();return!ht.test(i.parent.textContent)||!y.modify?n=="left"||n=="backward"?u:g:ct(t,e,()=>{let{focusNode:E,focusOffset:F,anchorNode:w,anchorOffset:q}=t.domSelectionRange(),ae=y.caretBidiLevel;y.modify("move",n,"character");let te=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:le,focusOffset:ze}=t.domSelectionRange(),ut=le&&!te.contains(le.nodeType==1?le:le.parentNode)||E==le&&F==ze;try{y.collapse(w,q),E&&(E!=w||F!=q)&&y.extend&&y.extend(E,F)}catch(bt){}return ae!=null&&(y.caretBidiLevel=ae),ut})}let K=null,m=null,p=!1;function C(t,e,n){return K==e&&m==n?p:(K=e,m=n,p=n=="up"||n=="down"?Ye(t,e,n):He(t,e,n))}const A=0,I=1,W=2,Z=3;class ue{constructor(e,n,i,a){this.parent=e,this.children=n,this.dom=i,this.contentDOM=a,this.dirty=A,i.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,i){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,i=this.posAtStart;;n++){let a=this.children[n];if(a==e)return i;i+=a.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,i){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(i<0){let u,g;if(e==this.contentDOM)u=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;u=e.previousSibling}for(;u&&!((g=u.pmViewDesc)&&g.parent==this);)u=u.previousSibling;return u?this.posBeforeChild(g)+g.size:this.posAtStart}else{let u,g;if(e==this.contentDOM)u=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;u=e.nextSibling}for(;u&&!((g=u.pmViewDesc)&&g.parent==this);)u=u.nextSibling;return u?this.posBeforeChild(g):this.posAtEnd}let a;if(e==this.dom&&this.contentDOM)a=n>_(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let u=e;;u=u.parentNode){if(u==this.dom){a=!1;break}if(u.previousSibling)break}if(a==null&&n==e.childNodes.length)for(let u=e;;u=u.parentNode){if(u==this.dom){a=!0;break}if(u.nextSibling)break}}return(a==null?i>0:a)?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let i=!0,a=e;a;a=a.parentNode){let u=this.getDesc(a),g;if(u&&(!n||u.node))if(i&&(g=u.nodeDOM)&&!(g.nodeType==1?g.contains(e.nodeType==1?e:e.parentNode):g==e))i=!1;else return u}}getDesc(e){let n=e.pmViewDesc;for(let i=n;i;i=i.parent)if(i==this)return n}posFromDOM(e,n,i){for(let a=e;a;a=a.parentNode){let u=this.getDesc(a);if(u)return u.localPosFromDOM(e,n,i)}return-1}descAt(e){for(let n=0,i=0;n<this.children.length;n++){let a=this.children[n],u=i+a.size;if(i==e&&u!=i){for(;!a.border&&a.children.length;)a=a.children[0];return a}if(e<u)return a.descAt(e-i-a.border);i=u}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let i=0,a=0;for(let u=0;i<this.children.length;i++){let g=this.children[i],y=u+g.size;if(y>e||g instanceof O){a=e-u;break}u=y}if(a)return this.children[i].domFromPos(a-this.children[i].border,n);for(let u;i&&!(u=this.children[i-1]).size&&u instanceof k&&u.side>=0;i--);if(n<=0){let u,g=!0;for(;u=i?this.children[i-1]:null,!(!u||u.dom.parentNode==this.contentDOM);i--,g=!1);return u&&n&&g&&!u.border&&!u.domAtom?u.domFromPos(u.size,n):{node:this.contentDOM,offset:u?_(u.dom)+1:0}}else{let u,g=!0;for(;u=i<this.children.length?this.children[i]:null,!(!u||u.dom.parentNode==this.contentDOM);i++,g=!1);return u&&g&&!u.border&&!u.domAtom?u.domFromPos(0,n):{node:this.contentDOM,offset:u?_(u.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,i=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let a=-1,u=-1;for(let g=i,y=0;;y++){let E=this.children[y],F=g+E.size;if(a==-1&&e<=F){let w=g+E.border;if(e>=w&&n<=F-E.border&&E.node&&E.contentDOM&&this.contentDOM.contains(E.contentDOM))return E.parseRange(e,n,w);e=g;for(let q=y;q>0;q--){let ae=this.children[q-1];if(ae.size&&ae.dom.parentNode==this.contentDOM&&!ae.emptyChildAt(1)){a=_(ae.dom)+1;break}e-=ae.size}a==-1&&(a=0)}if(a>-1&&(F>n||y==this.children.length-1)){n=F;for(let w=y+1;w<this.children.length;w++){let q=this.children[w];if(q.size&&q.dom.parentNode==this.contentDOM&&!q.emptyChildAt(-1)){u=_(q.dom);break}n+=q.size}u==-1&&(u=this.contentDOM.childNodes.length);break}g=F}return{node:this.contentDOM,from:e,to:n,fromOffset:a,toOffset:u}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:i}=this.domFromPos(e,0);if(n.nodeType!=1||i==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[i]}setSelection(e,n,i,a=!1){let u=Math.min(e,n),g=Math.max(e,n);for(let ae=0,te=0;ae<this.children.length;ae++){let le=this.children[ae],ze=te+le.size;if(u>te&&g<ze)return le.setSelection(e-te-le.border,n-te-le.border,i,a);te=ze}let y=this.domFromPos(e,e?-1:1),E=n==e?y:this.domFromPos(n,n?-1:1),F=i.getSelection(),w=!1;if((Qe||be)&&e==n){let{node:ae,offset:te}=y;if(ae.nodeType==3){if(w=!!(te&&ae.nodeValue[te-1]==`
`),w&&te==ae.nodeValue.length)for(let le=ae,ze;le;le=le.parentNode){if(ze=le.nextSibling){ze.nodeName=="BR"&&(y=E={node:ze.parentNode,offset:_(ze)+1});break}let ut=le.pmViewDesc;if(ut&&ut.node&&ut.node.isBlock)break}}else{let le=ae.childNodes[te-1];w=le&&(le.nodeName=="BR"||le.contentEditable=="false")}}if(Qe&&F.focusNode&&F.focusNode!=E.node&&F.focusNode.nodeType==1){let ae=F.focusNode.childNodes[F.focusOffset];ae&&ae.contentEditable=="false"&&(a=!0)}if(!(a||w&&be)&&ot(y.node,y.offset,F.anchorNode,F.anchorOffset)&&ot(E.node,E.offset,F.focusNode,F.focusOffset))return;let q=!1;if((F.extend||e==n)&&!w){F.collapse(y.node,y.offset);try{e!=n&&F.extend(E.node,E.offset),q=!0}catch(ae){}}if(!q){if(e>n){let te=y;y=E,E=te}let ae=document.createRange();ae.setEnd(E.node,E.offset),ae.setStart(y.node,y.offset),F.removeAllRanges(),F.addRange(ae)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let i=0,a=0;a<this.children.length;a++){let u=this.children[a],g=i+u.size;if(i==g?e<=g&&n>=i:e<g&&n>i){let y=i+u.border,E=g-u.border;if(e>=y&&n<=E){this.dirty=e==i||n==g?W:I,e==y&&n==E&&(u.contentLost||u.dom.parentNode!=this.contentDOM)?u.dirty=Z:u.markDirty(e-y,n-y);return}else u.dirty=u.dom==u.contentDOM&&u.dom.parentNode==this.contentDOM&&!u.children.length?W:Z}i=g}this.dirty=W}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let i=e==1?W:I;n.dirty<i&&(n.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class k extends ue{constructor(e,n,i,a){let u,g=n.type.toDOM;if(typeof g=="function"&&(g=g(i,()=>{if(!u)return a;if(u.parent)return u.parent.posBeforeChild(u)})),!n.type.spec.raw){if(g.nodeType!=1){let y=document.createElement("span");y.appendChild(g),g=y}g.contentEditable="false",g.classList.add("ProseMirror-widget")}super(e,[],g,null),this.widget=n,this.widget=n,u=this}matchesWidget(e){return this.dirty==A&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class r extends ue{constructor(e,n,i,a){super(e,[],n,null),this.textDOM=i,this.text=a}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class s extends ue{constructor(e,n,i,a){super(e,[],i,a),this.mark=n}static create(e,n,i,a){let u=a.nodeViews[n.type.name],g=u&&u(n,a,i);return(!g||!g.dom)&&(g=Ee.b.renderSpec(document,n.type.spec.toDOM(n,i))),new s(e,n,g.dom,g.contentDOM||g.dom)}parseRule(){return this.dirty&Z||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Z&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=A){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=A}}slice(e,n,i){let a=s.create(this.parent,this.mark,!0,i),u=this.children,g=this.size;n<g&&(u=pt(u,n,g,i)),e>0&&(u=pt(u,0,e,i));for(let y=0;y<u.length;y++)u[y].parent=a;return a.children=u,a}}class d extends ue{constructor(e,n,i,a,u,g,y,E,F){super(e,[],u,g),this.node=n,this.outerDeco=i,this.innerDeco=a,this.nodeDOM=y}static create(e,n,i,a,u,g){let y=u.nodeViews[n.type.name],E,F=y&&y(n,u,()=>{if(!E)return g;if(E.parent)return E.parent.posBeforeChild(E)},i,a),w=F&&F.dom,q=F&&F.contentDOM;if(n.isText){if(!w)w=document.createTextNode(n.text);else if(w.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else w||({dom:w,contentDOM:q}=Ee.b.renderSpec(document,n.type.spec.toDOM(n)));!q&&!n.isText&&w.nodeName!="BR"&&(w.hasAttribute("contenteditable")||(w.contentEditable="false"),n.type.spec.draggable&&(w.draggable=!0));let ae=w;return w=re(w,i,n),F?E=new L(e,n,i,a,w,q||null,ae,F,u,g+1):n.isText?new b(e,n,i,a,w,ae,u):new d(e,n,i,a,w,q||null,ae,u,g+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let i=this.children[n];if(this.dom.contains(i.dom.parentNode)){e.contentElement=i.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ee.c.empty)}return e}matchesNode(e,n,i){return this.dirty==A&&e.eq(this.node)&&z(n,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let i=this.node.inlineContent,a=n,u=e.composing?this.localCompositionInfo(e,n):null,g=u&&u.pos>-1?u:null,y=u&&u.pos<0,E=new ve(this,g&&g.node,e);Ue(this.node,this.innerDeco,(F,w,q)=>{F.spec.marks?E.syncToMarks(F.spec.marks,i,e):F.type.side>=0&&!q&&E.syncToMarks(w==this.node.childCount?Ee.d.none:this.node.child(w).marks,i,e),E.placeWidget(F,e,a)},(F,w,q,ae)=>{E.syncToMarks(F.marks,i,e);let te;E.findNodeMatch(F,w,q,ae)||y&&e.state.selection.from>a&&e.state.selection.to<a+F.nodeSize&&(te=E.findIndexWithChild(u.node))>-1&&E.updateNodeAt(F,w,q,te,e)||E.updateNextNode(F,w,q,e,ae,a)||E.addNode(F,w,q,e,a),a+=F.nodeSize}),E.syncToMarks([],i,e),this.node.isTextblock&&E.addTextblockHacks(),E.destroyRest(),(E.changed||this.dirty==W)&&(g&&this.protectLocalComposition(e,g),U(this.contentDOM,this.children,e),T&&It(this.dom))}localCompositionInfo(e,n){let{from:i,to:a}=e.state.selection;if(!(e.state.selection instanceof j.g)||i<n||a>n+this.node.content.size)return null;let u=e.domSelectionRange(),g=lt(u.focusNode,u.focusOffset);if(!g||!this.dom.contains(g.parentNode))return null;if(this.node.inlineContent){let y=g.nodeValue,E=qe(this.node.content,y,i-n,a-n);return E<0?null:{node:g,pos:E,text:y}}else return{node:g,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:i,text:a}){if(this.getDesc(n))return;let u=n;for(;u.parentNode!=this.contentDOM;u=u.parentNode){for(;u.previousSibling;)u.parentNode.removeChild(u.previousSibling);for(;u.nextSibling;)u.parentNode.removeChild(u.nextSibling);u.pmViewDesc&&(u.pmViewDesc=void 0)}let g=new r(this,u,n,a);e.input.compositionNodes.push(g),this.children=pt(this.children,i,i+a.length,e,g)}update(e,n,i,a){return this.dirty==Z||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,i,a),!0)}updateInner(e,n,i,a){this.updateOuterDeco(n),this.node=e,this.innerDeco=i,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=A}updateOuterDeco(e){if(z(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,i=this.dom;this.dom=un(this.dom,this.nodeDOM,wt(this.outerDeco,this.node,n),wt(e,this.node,n)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function v(t,e,n,i,a){re(i,e,t);let u=new d(void 0,t,e,n,i,i,i,a,0);return u.contentDOM&&u.updateChildren(a,0),u}class b extends d{constructor(e,n,i,a,u,g,y){super(e,n,i,a,u,null,g,y,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,i,a){return this.dirty==Z||this.dirty!=A&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=A||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=e,this.dirty=A,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,i){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,i)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,i){let a=this.node.cut(e,n),u=document.createTextNode(a.text);return new b(this.parent,a,this.outerDeco,this.innerDeco,u,u,i)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Z)}get domAtom(){return!1}}class O extends ue{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==A&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class L extends d{constructor(e,n,i,a,u,g,y,E,F,w){super(e,n,i,a,u,g,y,F,w),this.spec=E}update(e,n,i,a){if(this.dirty==Z)return!1;if(this.spec.update){let u=this.spec.update(e,n,i);return u&&this.updateInner(e,n,i,a),u}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,i,a)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,i,a){this.spec.setSelection?this.spec.setSelection(e,n,i):super.setSelection(e,n,i,a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function U(t,e,n){let i=t.firstChild,a=!1;for(let u=0;u<e.length;u++){let g=e[u],y=g.dom;if(y.parentNode==t){for(;y!=i;)i=ge(i),a=!0;i=i.nextSibling}else a=!0,t.insertBefore(y,i);if(g instanceof s){let E=i?i.previousSibling:t.lastChild;U(g.contentDOM,g.children,n),i=E?E.nextSibling:t.firstChild}}for(;i;)i=ge(i),a=!0;a&&n.trackWrites==t&&(n.trackWrites=null)}const Ae=function(t){t&&(this.nodeName=t)};Ae.prototype=Object.create(null);const Ne=[new Ae];function wt(t,e,n){if(t.length==0)return Ne;let i=n?Ne[0]:new Ae,a=[i];for(let u=0;u<t.length;u++){let g=t[u].type.attrs;if(g){g.nodeName&&a.push(i=new Ae(g.nodeName));for(let y in g){let E=g[y];E!=null&&(n&&a.length==1&&a.push(i=new Ae(e.isInline?"span":"div")),y=="class"?i.class=(i.class?i.class+" ":"")+E:y=="style"?i.style=(i.style?i.style+";":"")+E:y!="nodeName"&&(i[y]=E))}}}return a}function un(t,e,n,i){if(n==Ne&&i==Ne)return e;let a=e;for(let u=0;u<i.length;u++){let g=i[u],y=n[u];if(u){let E;y&&y.nodeName==g.nodeName&&a!=t&&(E=a.parentNode)&&E.nodeName.toLowerCase()==g.nodeName||(E=document.createElement(g.nodeName),E.pmIsDeco=!0,E.appendChild(a),y=Ne[0]),a=E}oe(a,y||Ne[0],g)}return a}function oe(t,e,n){for(let i in e)i!="class"&&i!="style"&&i!="nodeName"&&!(i in n)&&t.removeAttribute(i);for(let i in n)i!="class"&&i!="style"&&i!="nodeName"&&n[i]!=e[i]&&t.setAttribute(i,n[i]);if(e.class!=n.class){let i=e.class?e.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[];for(let u=0;u<i.length;u++)a.indexOf(i[u])==-1&&t.classList.remove(i[u]);for(let u=0;u<a.length;u++)i.indexOf(a[u])==-1&&t.classList.add(a[u]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,a;for(;a=i.exec(e.style);)t.style.removeProperty(a[1])}n.style&&(t.style.cssText+=n.style)}}function re(t,e,n){return un(t,t,Ne,wt(e,n,t.nodeType!=1))}function z(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function ge(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ve{constructor(e,n,i){this.lock=n,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Te(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let i=e;i<n;i++)this.top.children[i].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,i){let a=0,u=this.stack.length>>1,g=Math.min(u,e.length);for(;a<g&&(a==u-1?this.top:this.stack[a+1<<1]).matchesMark(e[a])&&e[a].type.spec.spanning!==!1;)a++;for(;a<u;)this.destroyRest(),this.top.dirty=A,this.index=this.stack.pop(),this.top=this.stack.pop(),u--;for(;u<e.length;){this.stack.push(this.top,this.index+1);let y=-1;for(let E=this.index;E<Math.min(this.index+3,this.top.children.length);E++){let F=this.top.children[E];if(F.matchesMark(e[u])&&!this.isLocked(F.dom)){y=E;break}}if(y>-1)y>this.index&&(this.changed=!0,this.destroyBetween(this.index,y)),this.top=this.top.children[this.index];else{let E=s.create(this.top,e[u],n,i);this.top.children.splice(this.index,0,E),this.top=E,this.changed=!0}this.index=0,u++}}findNodeMatch(e,n,i,a){let u=-1,g;if(a>=this.preMatch.index&&(g=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&g.matchesNode(e,n,i))u=this.top.children.indexOf(g,this.index);else for(let y=this.index,E=Math.min(this.top.children.length,y+5);y<E;y++){let F=this.top.children[y];if(F.matchesNode(e,n,i)&&!this.preMatch.matched.has(F)){u=y;break}}return u<0?!1:(this.destroyBetween(this.index,u),this.index++,!0)}updateNodeAt(e,n,i,a,u){let g=this.top.children[a];return g.dirty==Z&&g.dom==g.contentDOM&&(g.dirty=W),g.update(e,n,i,u)?(this.destroyBetween(this.index,a),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let i=e.pmViewDesc;if(i){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==i)return a}return-1}e=n}}updateNextNode(e,n,i,a,u,g){for(let y=this.index;y<this.top.children.length;y++){let E=this.top.children[y];if(E instanceof d){let F=this.preMatch.matched.get(E);if(F!=null&&F!=u)return!1;let w=E.dom,q,ae=this.isLocked(w)&&!(e.isText&&E.node&&E.node.isText&&E.nodeDOM.nodeValue==e.text&&E.dirty!=Z&&z(n,E.outerDeco));if(!ae&&E.update(e,n,i,a))return this.destroyBetween(this.index,y),E.dom!=w&&(this.changed=!0),this.index++,!0;if(!ae&&(q=this.recreateWrapper(E,e,n,i,a,g)))return this.top.children[this.index]=q,q.dirty=W,q.updateChildren(a,g+1),q.dirty=A,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,i,a,u,g){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let y=d.create(this.top,n,i,a,u,g);if(!y.contentDOM)return null;y.children=e.children,e.children=[],e.destroy();for(let E of y.children)E.parent=y;return y}addNode(e,n,i,a,u){let g=d.create(this.top,e,n,i,a,u);g.contentDOM&&g.updateChildren(a,u+1),this.top.children.splice(this.index++,0,g),this.changed=!0}placeWidget(e,n,i){let a=this.index<this.top.children.length?this.top.children[this.index]:null;if(a&&a.matchesWidget(e)&&(e==a.widget||!a.widget.type.toDOM.parentNode))this.index++;else{let u=new k(this.top,e,n,i);this.top.children.splice(this.index++,0,u),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof s;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof b)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((be||it)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let i=document.createElement(e);e=="IMG"&&(i.className="ProseMirror-separator",i.alt=""),e=="BR"&&(i.className="ProseMirror-trailingBreak");let a=new O(this.top,[],i,null);n!=this.top?n.children.push(a):n.children.splice(this.index++,0,a),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Te(t,e){let n=e,i=n.children.length,a=t.childCount,u=new Map,g=[];e:for(;a>0;){let y;for(;;)if(i){let F=n.children[i-1];if(F instanceof s)n=F,i=F.children.length;else{y=F,i--;break}}else{if(n==e)break e;i=n.parent.children.indexOf(n),n=n.parent}let E=y.node;if(E){if(E!=t.child(a-1))break;--a,u.set(y,a),g.push(y)}}return{index:a,matched:u,matches:g.reverse()}}function se(t,e){return t.type.side-e.type.side}function Ue(t,e,n,i){let a=e.locals(t),u=0;if(a.length==0){for(let F=0;F<t.childCount;F++){let w=t.child(F);i(w,a,e.forChild(u,w),F),u+=w.nodeSize}return}let g=0,y=[],E=null;for(let F=0;;){if(g<a.length&&a[g].to==u){let le=a[g++],ze;for(;g<a.length&&a[g].to==u;)(ze||(ze=[le])).push(a[g++]);if(ze){ze.sort(se);for(let ut=0;ut<ze.length;ut++)n(ze[ut],F,!!E)}else n(le,F,!!E)}let w,q;if(E)q=-1,w=E,E=null;else if(F<t.childCount)q=F,w=t.child(F++);else break;for(let le=0;le<y.length;le++)y[le].to<=u&&y.splice(le--,1);for(;g<a.length&&a[g].from<=u&&a[g].to>u;)y.push(a[g++]);let ae=u+w.nodeSize;if(w.isText){let le=ae;g<a.length&&a[g].from<le&&(le=a[g].from);for(let ze=0;ze<y.length;ze++)y[ze].to<le&&(le=y[ze].to);le<ae&&(E=w.cut(le-u),w=w.cut(0,le-u),ae=le,q=-1)}let te=w.isInline&&!w.isLeaf?y.filter(le=>!le.inline):y.slice();i(w,te,e.forChild(u,w),q),u=ae}}function It(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function lt(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Be(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function qe(t,e,n,i){for(let a=0,u=0;a<t.childCount&&u<=i;){let g=t.child(a++),y=u;if(u+=g.nodeSize,!g.isText)continue;let E=g.text;for(;a<t.childCount;){let F=t.child(a++);if(u+=F.nodeSize,!F.isText)break;E+=F.text}if(u>=n){let F=y<i?E.lastIndexOf(e,i-y-1):-1;if(F>=0&&F+e.length+y>=n)return y+F;if(n==i&&E.length>=i+e.length-y&&E.slice(i-y,i-y+e.length)==e)return i}}return-1}function pt(t,e,n,i,a){let u=[];for(let g=0,y=0;g<t.length;g++){let E=t[g],F=y,w=y+=E.size;F>=n||w<=e?u.push(E):(F<e&&u.push(E.slice(0,e-F,i)),a&&(u.push(a),a=void 0),w>n&&u.push(E.slice(n-F,E.size,i)))}return u}function yt(t,e=null){let n=t.domSelectionRange(),i=t.state.doc;if(!n.focusNode)return null;let a=t.docView.nearestDesc(n.focusNode),u=a&&a.size==0,g=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(g<0)return null;let y=i.resolve(g),E,F;if(dt(n)){for(E=y;a&&!a.node;)a=a.parent;let w=a.node;if(a&&w.isAtom&&j.c.isSelectable(w)&&a.parent&&!(w.isInline&&Pe(n.focusNode,n.focusOffset,a.dom))){let q=a.posBefore;F=new j.c(g==q?y:i.resolve(q))}}else{let w=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(w<0)return null;E=i.resolve(w)}if(!F){let w=e=="pointer"||t.state.selection.head<y.pos&&!u?1:-1;F=Gt(t,E,y,w)}return F}function Le(t){return t.editable?t.hasFocus():_t(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ot(t,e=!1){let n=t.state.selection;if(qt(t,n),!!Le(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&it){let i=t.domSelectionRange(),a=t.domObserver.currentSelection;if(i.anchorNode&&a.anchorNode&&ot(i.anchorNode,i.anchorOffset,a.anchorNode,a.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Vt(t);else{let{anchor:i,head:a}=n,u,g;Bt&&!(n instanceof j.g)&&(n.$from.parent.inlineContent||(u=Jt(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(g=Jt(t,n.to))),t.docView.setSelection(i,a,t.root,e),Bt&&(u&&Lt(u),g&&Lt(g)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ut(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Bt=be||it&&Pt<63;function Jt(t,e){let{node:n,offset:i}=t.docView.domFromPos(e,0),a=i<n.childNodes.length?n.childNodes[i]:null,u=i?n.childNodes[i-1]:null;if(be&&a&&a.contentEditable=="false")return jt(a);if((!a||a.contentEditable=="false")&&(!u||u.contentEditable=="false")){if(a)return jt(a);if(u)return jt(u)}}function jt(t){return t.contentEditable="true",be&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Lt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ut(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),i=n.anchorNode,a=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=a)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Le(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Vt(t){let e=t.domSelection(),n=document.createRange(),i=t.cursorWrapper.dom,a=i.nodeName=="IMG";a?n.setEnd(i.parentNode,_(i)+1):n.setEnd(i,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!a&&!t.state.selection.visible&&Ve&&rt<=11&&(i.disabled=!0,i.disabled=!1)}function qt(t,e){if(e instanceof j.c){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(on(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else on(t)}function on(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Gt(t,e,n,i){return t.someProp("createSelectionBetween",a=>a(t,e,n))||j.g.between(e,n,i)}function an(t){return t.editable&&!t.hasFocus()?!1:_t(t)}function _t(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function yn(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ot(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Dn(t,e){let{$anchor:n,$head:i}=t.selection,a=e>0?n.max(i):n.min(i),u=a.parent.inlineContent?a.depth?t.doc.resolve(e>0?a.after():a.before()):null:a;return u&&j.f.findFrom(u,e)}function en(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tn(t,e,n){let i=t.state.selection;if(i instanceof j.g){if(!i.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let a=Dn(t.state,e);return a&&a instanceof j.c?en(t,a):!1}else if(!($&&n.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter,g;if(!u||u.isText)return!1;let y=e<0?a.pos-u.nodeSize:a.pos;return u.isAtom||(g=t.docView.descAt(y))&&!g.contentDOM?j.c.isSelectable(u)?en(t,new j.c(e<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):Oe?en(t,new j.g(t.state.doc.resolve(e<0?y:y+u.nodeSize))):!1:!1}}else{if(i instanceof j.c&&i.node.isInline)return en(t,new j.g(e>0?i.$to:i.$from));{let a=Dn(t.state,e);return a?en(t,a):!1}}}function cn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kt(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function Yt(t,e){return e<0?xn(t):Rn(t)}function xn(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let a,u,g=!1;for(Qe&&n.nodeType==1&&i<cn(n)&&Kt(n.childNodes[i])&&(g=!0);;)if(i>0){if(n.nodeType!=1)break;{let y=n.childNodes[i-1];if(Kt(y))a=n,u=--i;else if(y.nodeType==3)n=y,i=n.nodeValue.length;else break}}else{if(At(n))break;{let y=n.previousSibling;for(;y&&Kt(y);)a=n.parentNode,u=_(y),y=y.previousSibling;if(y)n=y,i=cn(n);else{if(n=n.parentNode,n==t.dom)break;i=0}}}g?Et(t,n,i):a&&Et(t,a,u)}function Rn(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let a=cn(n),u,g;for(;;)if(i<a){if(n.nodeType!=1)break;let y=n.childNodes[i];if(Kt(y))u=n,g=++i;else break}else{if(At(n))break;{let y=n.nextSibling;for(;y&&Kt(y);)u=y.parentNode,g=_(y)+1,y=y.nextSibling;if(y)n=y,i=0,a=cn(n);else{if(n=n.parentNode,n==t.dom)break;i=a=0}}}u&&Et(t,u,g)}function At(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Et(t,e,n){let i=t.domSelection();if(dt(i)){let u=document.createRange();u.setEnd(e,n),u.setStart(e,n),i.removeAllRanges(),i.addRange(u)}else i.extend&&i.extend(e,n);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&Ot(t)},50)}function $t(t,e){let n=t.state.doc.resolve(e);if(!(it||Y)&&n.parent.inlineContent){let a=t.coordsAtPos(e);if(e>n.start()){let u=t.coordsAtPos(e-1),g=(u.top+u.bottom)/2;if(g>a.top&&g<a.bottom&&Math.abs(u.left-a.left)>1)return u.left<a.left?"ltr":"rtl"}if(e<n.end()){let u=t.coordsAtPos(e+1),g=(u.top+u.bottom)/2;if(g>a.top&&g<a.bottom&&Math.abs(u.left-a.left)>1)return u.left>a.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function $n(t,e,n){let i=t.state.selection;if(i instanceof j.g&&!i.empty||n.indexOf("s")>-1||$&&n.indexOf("m")>-1)return!1;let{$from:a,$to:u}=i;if(!a.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let g=Dn(t.state,e);if(g&&g instanceof j.c)return en(t,g)}if(!a.parent.inlineContent){let g=e<0?a:u,y=i instanceof j.a?j.f.near(g,e):j.f.findFrom(g,e);return y?en(t,y):!1}return!1}function In(t,e){if(!(t.state.selection instanceof j.g))return!0;let{$head:n,$anchor:i,empty:a}=t.state.selection;if(!n.sameParent(i))return!0;if(!a)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let u=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(u&&!u.isText){let g=t.state.tr;return e<0?g.delete(n.pos-u.nodeSize,n.pos):g.delete(n.pos,n.pos+u.nodeSize),t.dispatch(g),!0}return!1}function rr(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Fr(t){if(!be||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let i=e.firstChild;rr(t,i,"true"),setTimeout(()=>rr(t,i,"false"),20)}return!1}function wr(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Br(t,e){let n=e.keyCode,i=wr(e);if(n==8||$&&n==72&&i=="c")return In(t,-1)||Yt(t,-1);if(n==46&&!e.shiftKey||$&&n==68&&i=="c")return In(t,1)||Yt(t,1);if(n==13||n==27)return!0;if(n==37||$&&n==66&&i=="c"){let a=n==37?$t(t,t.state.selection.from)=="ltr"?-1:1:-1;return tn(t,a,i)||Yt(t,a)}else if(n==39||$&&n==70&&i=="c"){let a=n==39?$t(t,t.state.selection.from)=="ltr"?1:-1:1;return tn(t,a,i)||Yt(t,a)}else{if(n==38||$&&n==80&&i=="c")return $n(t,-1,i)||Yt(t,-1);if(n==40||$&&n==78&&i=="c")return Fr(t)||$n(t,1,i)||Rn(t);if(i==($?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Wn(t,e){t.someProp("transformCopied",te=>{e=te(e,t)});let n=[],{content:i,openStart:a,openEnd:u}=e;for(;a>1&&u>1&&i.childCount==1&&i.firstChild.childCount==1;){a--,u--;let te=i.firstChild;n.push(te.type.name,te.attrs!=te.type.defaultAttrs?te.attrs:null),i=te.content}let g=t.someProp("clipboardSerializer")||Ee.b.fromSchema(t.state.schema),y=Ln(),E=y.createElement("div");E.appendChild(g.serializeFragment(i,{document:y}));let F=E.firstChild,w,q=0;for(;F&&F.nodeType==1&&(w=jn[F.nodeName.toLowerCase()]);){for(let te=w.length-1;te>=0;te--){let le=y.createElement(w[te]);for(;E.firstChild;)le.appendChild(E.firstChild);E.appendChild(le),q++}F=E.firstChild}F&&F.nodeType==1&&F.setAttribute("data-pm-slice",`${a} ${u}${q?` -${q}`:""} ${JSON.stringify(n)}`);let ae=t.someProp("clipboardTextSerializer",te=>te(e,t))||e.content.textBetween(0,e.content.size,`

`);return{dom:E,text:ae}}function Hn(t,e,n,i,a){let u=a.parent.type.spec.code,g,y;if(!n&&!e)return null;let E=e&&(i||u||!n);if(E){if(t.someProp("transformPastedText",ae=>{e=ae(e,u||i,t)}),u)return e?new Ee.j(Ee.c.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0):Ee.j.empty;let q=t.someProp("clipboardTextParser",ae=>ae(e,a,i,t));if(q)y=q;else{let ae=a.marks(),{schema:te}=t.state,le=Ee.b.fromSchema(te);g=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(ze=>{let ut=g.appendChild(document.createElement("p"));ze&&ut.appendChild(le.serializeNode(te.text(ze,ae)))})}}else t.someProp("transformPastedHTML",q=>{n=q(n,t)}),g=hn(n),Oe&&Ir(g);let F=g&&g.querySelector("[data-pm-slice]"),w=F&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(F.getAttribute("data-pm-slice")||"");if(w&&w[3])for(let q=+w[3];q>0;q--){let ae=g.firstChild;for(;ae&&ae.nodeType!=1;)ae=ae.nextSibling;if(!ae)break;g=ae}if(y||(y=(t.someProp("clipboardParser")||t.someProp("domParser")||Ee.a.fromSchema(t.state.schema)).parseSlice(g,{preserveWhitespace:!!(E||w),context:a,ruleFromNode(ae){return ae.nodeName=="BR"&&!ae.nextSibling&&ae.parentNode&&!Pr.test(ae.parentNode.nodeName)?{ignore:!0}:null}})),w)y=jr(Mn(y,+w[1],+w[2]),w[4]);else if(y=Ee.j.maxOpen(Rr(y.content,a),!0),y.openStart||y.openEnd){let q=0,ae=0;for(let te=y.content.firstChild;q<y.openStart&&!te.type.spec.isolating;q++,te=te.firstChild);for(let te=y.content.lastChild;ae<y.openEnd&&!te.type.spec.isolating;ae++,te=te.lastChild);y=Mn(y,q,ae)}return t.someProp("transformPasted",q=>{y=q(y,t)}),y}const Pr=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Rr(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let a=e.node(n).contentMatchAt(e.index(n)),u,g=[];if(t.forEach(y=>{if(!g)return;let E=a.findWrapping(y.type),F;if(!E)return g=null;if(F=g.length&&u.length&&sr(E,u,y,g[g.length-1],0))g[g.length-1]=F;else{g.length&&(g[g.length-1]=or(g[g.length-1],u.length));let w=ir(y,E);g.push(w),a=a.matchType(w.type),u=E}}),g)return Ee.c.from(g)}return t}function ir(t,e,n=0){for(let i=e.length-1;i>=n;i--)t=e[i].create(null,Ee.c.from(t));return t}function sr(t,e,n,i,a){if(a<t.length&&a<e.length&&t[a]==e[a]){let u=sr(t,e,n,i.lastChild,a+1);if(u)return i.copy(i.content.replaceChild(i.childCount-1,u));if(i.contentMatchAt(i.childCount).matchType(a==t.length-1?n.type:t[a+1]))return i.copy(i.content.append(Ee.c.from(ir(n,t,a+1))))}}function or(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,or(t.lastChild,e-1)),i=t.contentMatchAt(t.childCount).fillBefore(Ee.c.empty,!0);return t.copy(n.append(i))}function Jn(t,e,n,i,a,u){let g=e<0?t.firstChild:t.lastChild,y=g.content;return t.childCount>1&&(u=0),a<i-1&&(y=Jn(y,e,n,i,a+1,u)),a>=n&&(y=e<0?g.contentMatchAt(0).fillBefore(y,u<=a).append(y):y.append(g.contentMatchAt(g.childCount).fillBefore(Ee.c.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,g.copy(y))}function Mn(t,e,n){return e<t.openStart&&(t=new Ee.j(Jn(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Ee.j(Jn(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const jn={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ar=null;function Ln(){return ar||(ar=document.implementation.createHTMLDocument("title"))}function hn(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Ln().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),a;if((a=i&&jn[i[1].toLowerCase()])&&(t=a.map(u=>"<"+u+">").join("")+t+a.map(u=>"</"+u+">").reverse().join("")),n.innerHTML=t,a)for(let u=0;u<a.length;u++)n=n.querySelector(a[u])||n;return n}function Ir(t){let e=t.querySelectorAll(it?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let i=e[n];i.childNodes.length==1&&i.textContent=="\xA0"&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}function jr(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch(y){return t}let{content:a,openStart:u,openEnd:g}=t;for(let y=i.length-2;y>=0;y-=2){let E=n.nodes[i[y]];if(!E||E.hasRequiredAttrs())break;a=Ee.c.from(E.create(i[y+1],a)),u++,g++}return new Ee.j(a,u,g)}const Nt={},kt={},lr={touchstart:!0,touchmove:!0};class zn{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Lr(t){for(let e in Nt){let n=Nt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=i=>{Vr(t,i)&&!bn(t,i)&&(t.editable||!(i.type in kt))&&n(t,i)},lr[e]?{passive:!0}:void 0)}be&&t.dom.addEventListener("input",()=>null),Tn(t)}function pn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function zr(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Tn(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=i=>bn(t,i))})}function bn(t,e){return t.someProp("handleDOMEvents",n=>{let i=n[e.type];return i?i(t,e)||e.defaultPrevented:!1})}function Vr(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Kr(t,e){!bn(t,e)&&Nt[e.type]&&(t.editable||!(e.type in kt))&&Nt[e.type](t,e)}kt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Fn(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ce&&it&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),T&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();t.input.lastIOSEnter=i,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==i&&(t.someProp("handleKeyDown",a=>a(t,et(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",i=>i(t,n))||Br(t,n)?n.preventDefault():pn(t,"key")},kt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},kt.keypress=(t,e)=>{let n=e;if(Fn(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||$&&n.metaKey)return;if(t.someProp("handleKeyPress",a=>a(t,n))){n.preventDefault();return}let i=t.state.selection;if(!(i instanceof j.g)||!i.$from.sameParent(i.$to)){let a=String.fromCharCode(n.charCode);!/[\r\n]/.test(a)&&!t.someProp("handleTextInput",u=>u(t,i.$from.pos,i.$to.pos,a))&&t.dispatch(t.state.tr.insertText(a).scrollIntoView()),n.preventDefault()}};function Vn(t){return{left:t.clientX,top:t.clientY}}function $r(t,e){let n=e.x-t.clientX,i=e.y-t.clientY;return n*n+i*i<100}function Un(t,e,n,i,a){if(i==-1)return!1;let u=t.state.doc.resolve(i);for(let g=u.depth+1;g>0;g--)if(t.someProp(e,y=>g>u.depth?y(t,n,u.nodeAfter,u.before(g),a,!0):y(t,n,u.node(g),u.before(g),a,!1)))return!0;return!1}function Cn(t,e,n){t.focused||t.focus();let i=t.state.tr.setSelection(e);n=="pointer"&&i.setMeta("pointer",!0),t.dispatch(i)}function Wr(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return i&&i.isAtom&&j.c.isSelectable(i)?(Cn(t,new j.c(n),"pointer"),!0):!1}function ur(t,e){if(e==-1)return!1;let n=t.state.selection,i,a;n instanceof j.c&&(i=n.node);let u=t.state.doc.resolve(e);for(let g=u.depth+1;g>0;g--){let y=g>u.depth?u.nodeAfter:u.node(g);if(j.c.isSelectable(y)){i&&n.$from.depth>0&&g>=n.$from.depth&&u.before(n.$from.depth+1)==n.$from.pos?a=u.before(n.$from.depth):a=u.before(g);break}}return a!=null?(Cn(t,j.c.create(t.state.doc,a),"pointer"),!0):!1}function Hr(t,e,n,i,a){return Un(t,"handleClickOn",e,n,i)||t.someProp("handleClick",u=>u(t,e,i))||(a?ur(t,n):Wr(t,n))}function Jr(t,e,n,i){return Un(t,"handleDoubleClickOn",e,n,i)||t.someProp("handleDoubleClick",a=>a(t,e,i))}function Nn(t,e,n,i){return Un(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",a=>a(t,e,i))||Ur(t,n,i)}function Ur(t,e,n){if(n.button!=0)return!1;let i=t.state.doc;if(e==-1)return i.inlineContent?(Cn(t,j.g.create(i,0,i.content.size),"pointer"),!0):!1;let a=i.resolve(e);for(let u=a.depth+1;u>0;u--){let g=u>a.depth?a.nodeAfter:a.node(u),y=a.before(u);if(g.inlineContent)Cn(t,j.g.create(i,y+1,y+1+g.content.size),"pointer");else if(j.c.isSelectable(g))Cn(t,j.c.create(i,y),"pointer");else continue;return!0}}function Gn(t){return wn(t)}const cr=$?"metaKey":"ctrlKey";Nt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let i=Gn(t),a=Date.now(),u="singleClick";a-t.input.lastClick.time<500&&$r(n,t.input.lastClick)&&!n[cr]&&(t.input.lastClick.type=="singleClick"?u="doubleClick":t.input.lastClick.type=="doubleClick"&&(u="tripleClick")),t.input.lastClick={time:a,x:n.clientX,y:n.clientY,type:u};let g=t.posAtCoords(Vn(n));g&&(u=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Gr(t,g,n,!!i)):(u=="doubleClick"?Jr:Nn)(t,g.pos,g.inside,n)?n.preventDefault():pn(t,"pointer"))};class Gr{constructor(e,n,i,a){this.view=e,this.pos=n,this.event=i,this.flushed=a,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[cr],this.allowDefault=i.shiftKey;let u,g;if(n.inside>-1)u=e.state.doc.nodeAt(n.inside),g=n.inside;else{let w=e.state.doc.resolve(n.pos);u=w.parent,g=w.depth?w.before():0}const y=a?null:i.target,E=y?e.docView.nearestDesc(y,!0):null;this.target=E?E.dom:null;let{selection:F}=e.state;(i.button==0&&u.type.spec.draggable&&u.type.spec.selectable!==!1||F instanceof j.c&&F.from<=g&&F.to>g)&&(this.mightDrag={node:u,pos:g,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qe&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),pn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ot(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Vn(e))),this.updateAllowDefault(e),this.allowDefault||!n?pn(this.view,"pointer"):Hr(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||be&&this.mightDrag&&!this.mightDrag.node.isAtom||it&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Cn(this.view,j.f.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pn(this.view,"pointer")}move(e){this.updateAllowDefault(e),pn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Nt.touchstart=t=>{t.input.lastTouch=Date.now(),Gn(t),pn(t,"pointer")},Nt.touchmove=t=>{t.input.lastTouch=Date.now(),pn(t,"pointer")},Nt.contextmenu=t=>Gn(t);function Fn(t,e){return t.composing?!0:be&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const fr=ce?5e3:-1;kt.compositionstart=kt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),wn(t,!0),t.markCursor=null;else if(wn(t),Qe&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=t.domSelectionRange();for(let a=i.focusNode,u=i.focusOffset;a&&a.nodeType==1&&u!=0;){let g=u<0?a.lastChild:a.childNodes[u-1];if(!g)break;if(g.nodeType==3){t.domSelection().collapse(g,g.nodeValue.length);break}else a=g,u=-1}}t.input.composing=!0}dr(t,fr)},kt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,dr(t,20))};function dr(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>wn(t),e))}function hr(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Yr());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Yr(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function wn(t,e=!1){if(!(ce&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),hr(t),e||t.docView&&t.docView.dirty){let n=yt(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function Qr(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),a=document.createRange();a.selectNodeContents(e),t.dom.blur(),i.removeAllRanges(),i.addRange(a),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const En=Ve&&rt<15||T&&je<604;Nt.copy=kt.cut=(t,e)=>{let n=e,i=t.state.selection,a=n.type=="cut";if(i.empty)return;let u=En?null:n.clipboardData,g=i.content(),{dom:y,text:E}=Wn(t,g);u?(n.preventDefault(),u.clearData(),u.setData("text/html",y.innerHTML),u.setData("text/plain",E)):Qr(t,y),a&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Xr(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Zr(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let a=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),n?kn(t,i.value,null,a,e):kn(t,i.textContent,i.innerHTML,a,e)},50)}function kn(t,e,n,i,a){let u=Hn(t,e,n,i,t.state.selection.$from);if(t.someProp("handlePaste",E=>E(t,a,u||Ee.j.empty)))return!0;if(!u)return!1;let g=Xr(u),y=g?t.state.tr.replaceSelectionWith(g,i):t.state.tr.replaceSelection(u);return t.dispatch(y.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.paste=(t,e)=>{let n=e;if(t.composing&&!ce)return;let i=En?null:n.clipboardData,a=t.input.shiftKey&&t.input.lastKeyCode!=45;i&&kn(t,i.getData("text/plain"),i.getData("text/html"),a,n)?n.preventDefault():Zr(t,n)};class qr{constructor(e,n){this.slice=e,this.move=n}}const _r=$?"altKey":"ctrlKey";Nt.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let a=t.state.selection,u=a.empty?null:t.posAtCoords(Vn(n));if(!(u&&u.pos>=a.from&&u.pos<=(a instanceof j.c?a.to-1:a.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(j.c.create(t.state.doc,i.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let F=t.docView.nearestDesc(n.target,!0);F&&F.node.type.spec.draggable&&F!=t.docView&&t.dispatch(t.state.tr.setSelection(j.c.create(t.state.doc,F.posBefore)))}}let g=t.state.selection.content(),{dom:y,text:E}=Wn(t,g);n.dataTransfer.clearData(),n.dataTransfer.setData(En?"Text":"text/html",y.innerHTML),n.dataTransfer.effectAllowed="copyMove",En||n.dataTransfer.setData("text/plain",E),t.dragging=new qr(g,!n[_r])},Nt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},kt.dragover=kt.dragenter=(t,e)=>e.preventDefault(),kt.drop=(t,e)=>{let n=e,i=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let a=t.posAtCoords(Vn(n));if(!a)return;let u=t.state.doc.resolve(a.pos),g=i&&i.slice;g?t.someProp("transformPasted",le=>{g=le(g,t)}):g=Hn(t,n.dataTransfer.getData(En?"Text":"text/plain"),En?null:n.dataTransfer.getData("text/html"),!1,u);let y=!!(i&&!n[_r]);if(t.someProp("handleDrop",le=>le(t,n,g||Ee.j.empty,y))){n.preventDefault();return}if(!g)return;n.preventDefault();let E=g?Object(me.g)(t.state.doc,u.pos,g):u.pos;E==null&&(E=u.pos);let F=t.state.tr;y&&F.deleteSelection();let w=F.mapping.map(E),q=g.openStart==0&&g.openEnd==0&&g.content.childCount==1,ae=F.doc;if(q?F.replaceRangeWith(w,w,g.content.firstChild):F.replaceRange(w,w,g),F.doc.eq(ae))return;let te=F.doc.resolve(w);if(q&&j.c.isSelectable(g.content.firstChild)&&te.nodeAfter&&te.nodeAfter.sameMarkup(g.content.firstChild))F.setSelection(new j.c(te));else{let le=F.mapping.map(E);F.mapping.maps[F.mapping.maps.length-1].forEach((ze,ut,bt,nn)=>le=nn),F.setSelection(Gt(t,te,F.doc.resolve(le)))}t.focus(),t.dispatch(F.setMeta("uiEvent","drop"))},Nt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ot(t)},20))},Nt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Nt.beforeinput=(t,e)=>{if(it&&ce&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:i}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=i||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",u=>u(t,et(8,"Backspace")))))return;let{$cursor:a}=t.state.selection;a&&a.pos>0&&t.dispatch(t.state.tr.delete(a.pos-1,a.pos).scrollIntoView())},50)}};for(let t in kt)Nt[t]=kt[t];function Bn(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class pr{constructor(e,n){this.toDOM=e,this.spec=n||fn,this.side=this.spec.side||0}map(e,n,i,a){let{pos:u,deleted:g}=e.mapResult(n.from+a,this.side<0?-1:1);return g?null:new Wt(u-i,u-i,this)}valid(){return!0}eq(e){return this==e||e instanceof pr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Bn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class mn{constructor(e,n){this.attrs=e,this.spec=n||fn}map(e,n,i,a){let u=e.map(n.from+a,this.spec.inclusiveStart?-1:1)-i,g=e.map(n.to+a,this.spec.inclusiveEnd?1:-1)-i;return u>=g?null:new Wt(u,g,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof mn&&Bn(this.attrs,e.attrs)&&Bn(this.spec,e.spec)}static is(e){return e.type instanceof mn}destroy(){}}class Yn{constructor(e,n){this.attrs=e,this.spec=n||fn}map(e,n,i,a){let u=e.mapResult(n.from+a,1);if(u.deleted)return null;let g=e.mapResult(n.to+a,-1);return g.deleted||g.pos<=u.pos?null:new Wt(u.pos-i,g.pos-i,this)}valid(e,n){let{index:i,offset:a}=e.content.findIndex(n.from),u;return a==n.from&&!(u=e.child(i)).isText&&a+u.nodeSize==n.to}eq(e){return this==e||e instanceof Yn&&Bn(this.attrs,e.attrs)&&Bn(this.spec,e.spec)}destroy(){}}class Wt{constructor(e,n,i){this.from=e,this.to=n,this.type=i}copy(e,n){return new Wt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,i){return this.type.map(e,this,n,i)}static widget(e,n,i){return new Wt(e,e,new pr(n,i))}static inline(e,n,i,a){return new Wt(e,n,new mn(i,a))}static node(e,n,i,a){return new Wt(e,n,new Yn(i,a))}get spec(){return this.type.spec}get inline(){return this.type instanceof mn}}const gn=[],fn={};class Mt{constructor(e,n){this.local=e.length?e:gn,this.children=n.length?n:gn}static create(e,n){return n.length?Kn(n,e,0,fn):zt}find(e,n,i){let a=[];return this.findInner(e==null?0:e,n==null?1e9:n,a,0,i),a}findInner(e,n,i,a,u){for(let g=0;g<this.local.length;g++){let y=this.local[g];y.from<=n&&y.to>=e&&(!u||u(y.spec))&&i.push(y.copy(y.from+a,y.to+a))}for(let g=0;g<this.children.length;g+=3)if(this.children[g]<n&&this.children[g+1]>e){let y=this.children[g]+1;this.children[g+2].findInner(e-y,n-y,i,a+y,u)}}map(e,n,i){return this==zt||e.maps.length==0?this:this.mapInner(e,n,0,0,i||fn)}mapInner(e,n,i,a,u){let g;for(let y=0;y<this.local.length;y++){let E=this.local[y].map(e,i,a);E&&E.type.valid(n,E)?(g||(g=[])).push(E):u.onRemove&&u.onRemove(this.local[y].spec)}return this.children.length?pi(this.children,g||[],e,n,i,a,u):g?new Mt(g.sort(Sn),gn):zt}add(e,n){return n.length?this==zt?Mt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,i){let a,u=0;e.forEach((y,E)=>{let F=E+i,w;if(w=mr(n,y,F)){for(a||(a=this.children.slice());u<a.length&&a[u]<E;)u+=3;a[u]==E?a[u+2]=a[u+2].addInner(y,w,F+1):a.splice(u,0,E,E+y.nodeSize,Kn(w,y,F+1,fn)),u+=3}});let g=Qn(u?gr(n):n,-i);for(let y=0;y<g.length;y++)g[y].type.valid(e,g[y])||g.splice(y--,1);return new Mt(g.length?this.local.concat(g).sort(Sn):this.local,a||this.children)}remove(e){return e.length==0||this==zt?this:this.removeInner(e,0)}removeInner(e,n){let i=this.children,a=this.local;for(let u=0;u<i.length;u+=3){let g,y=i[u]+n,E=i[u+1]+n;for(let w=0,q;w<e.length;w++)(q=e[w])&&q.from>y&&q.to<E&&(e[w]=null,(g||(g=[])).push(q));if(!g)continue;i==this.children&&(i=this.children.slice());let F=i[u+2].removeInner(g,y+1);F!=zt?i[u+2]=F:(i.splice(u,3),u-=3)}if(a.length){for(let u=0,g;u<e.length;u++)if(g=e[u])for(let y=0;y<a.length;y++)a[y].eq(g,n)&&(a==this.local&&(a=this.local.slice()),a.splice(y--,1))}return i==this.children&&a==this.local?this:a.length||i.length?new Mt(a,i):zt}forChild(e,n){if(this==zt)return this;if(n.isLeaf)return Mt.empty;let i,a;for(let y=0;y<this.children.length;y+=3)if(this.children[y]>=e){this.children[y]==e&&(i=this.children[y+2]);break}let u=e+1,g=u+n.content.size;for(let y=0;y<this.local.length;y++){let E=this.local[y];if(E.from<g&&E.to>u&&E.type instanceof mn){let F=Math.max(u,E.from)-u,w=Math.min(g,E.to)-u;F<w&&(a||(a=[])).push(E.copy(F,w))}}if(a){let y=new Mt(a.sort(Sn),gn);return i?new dn([y,i]):y}return i||zt}eq(e){if(this==e)return!0;if(!(e instanceof Mt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Xn(this.localsInner(e))}localsInner(e){if(this==zt)return gn;if(e.inlineContent||!this.local.some(mn.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof mn||n.push(this.local[i]);return n}}Mt.empty=new Mt([],[]),Mt.removeOverlap=Xn;const zt=Mt.empty;class dn{constructor(e){this.members=e}map(e,n){const i=this.members.map(a=>a.map(e,n,fn));return dn.from(i)}forChild(e,n){if(n.isLeaf)return Mt.empty;let i=[];for(let a=0;a<this.members.length;a++){let u=this.members[a].forChild(e,n);u!=zt&&(u instanceof dn?i=i.concat(u.members):i.push(u))}return dn.from(i)}eq(e){if(!(e instanceof dn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,i=!0;for(let a=0;a<this.members.length;a++){let u=this.members[a].localsInner(e);if(u.length)if(!n)n=u;else{i&&(n=n.slice(),i=!1);for(let g=0;g<u.length;g++)n.push(u[g])}}return n?Xn(i?n:n.sort(Sn)):gn}static from(e){switch(e.length){case 0:return zt;case 1:return e[0];default:return new dn(e.every(n=>n instanceof Mt)?e:e.reduce((n,i)=>n.concat(i instanceof Mt?i:i.members),[]))}}}function pi(t,e,n,i,a,u,g){let y=t.slice();for(let F=0,w=u;F<n.maps.length;F++){let q=0;n.maps[F].forEach((ae,te,le,ze)=>{let ut=ze-le-(te-ae);for(let bt=0;bt<y.length;bt+=3){let nn=y[bt+1];if(nn<0||ae>nn+w-q)continue;let rn=y[bt]+w-q;te>=rn?y[bt+1]=ae<=rn?-2:-1:le>=a&&ut&&(y[bt]+=ut,y[bt+1]+=ut)}q+=ut}),w=n.maps[F].map(w,-1)}let E=!1;for(let F=0;F<y.length;F+=3)if(y[F+1]<0){if(y[F+1]==-2){E=!0,y[F+1]=-1;continue}let w=n.map(t[F]+u),q=w-a;if(q<0||q>=i.content.size){E=!0;continue}let ae=n.map(t[F+1]+u,-1),te=ae-a,{index:le,offset:ze}=i.content.findIndex(q),ut=i.maybeChild(le);if(ut&&ze==q&&ze+ut.nodeSize==te){let bt=y[F+2].mapInner(n,ut,w+1,t[F]+u+1,g);bt!=zt?(y[F]=q,y[F+1]=te,y[F+2]=bt):(y[F+1]=-2,E=!0)}else E=!0}if(E){let F=ei(y,t,e,n,a,u,g),w=Kn(F,i,0,g);e=w.local;for(let q=0;q<y.length;q+=3)y[q+1]<0&&(y.splice(q,3),q-=3);for(let q=0,ae=0;q<w.children.length;q+=3){let te=w.children[q];for(;ae<y.length&&y[ae]<te;)ae+=3;y.splice(ae,0,w.children[q],w.children[q+1],w.children[q+2])}}return new Mt(e.sort(Sn),y)}function Qn(t,e){if(!e||!t.length)return t;let n=[];for(let i=0;i<t.length;i++){let a=t[i];n.push(new Wt(a.from+e,a.to+e,a.type))}return n}function ei(t,e,n,i,a,u,g){function y(E,F){for(let w=0;w<E.local.length;w++){let q=E.local[w].map(i,a,F);q?n.push(q):g.onRemove&&g.onRemove(E.local[w].spec)}for(let w=0;w<E.children.length;w+=3)y(E.children[w+2],E.children[w]+F+1)}for(let E=0;E<t.length;E+=3)t[E+1]==-1&&y(t[E+2],e[E]+u+1);return n}function mr(t,e,n){if(e.isLeaf)return null;let i=n+e.nodeSize,a=null;for(let u=0,g;u<t.length;u++)(g=t[u])&&g.from>n&&g.to<i&&((a||(a=[])).push(g),t[u]=null);return a}function gr(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Kn(t,e,n,i){let a=[],u=!1;e.forEach((y,E)=>{let F=mr(t,y,E+n);if(F){u=!0;let w=Kn(F,y,n+E+1,i);w!=zt&&a.push(E,E+y.nodeSize,w)}});let g=Qn(u?gr(t):t,-n).sort(Sn);for(let y=0;y<g.length;y++)g[y].type.valid(e,g[y])||(i.onRemove&&i.onRemove(g[y].spec),g.splice(y--,1));return g.length||a.length?new Mt(g,a):zt}function Sn(t,e){return t.from-e.from||t.to-e.to}function Xn(t){let e=t;for(let n=0;n<e.length-1;n++){let i=e[n];if(i.from!=i.to)for(let a=n+1;a<e.length;a++){let u=e[a];if(u.from==i.from){u.to!=i.to&&(e==t&&(e=t.slice()),e[a]=u.copy(u.from,i.to),Zn(e,a+1,u.copy(i.to,u.to)));continue}else{u.from<i.to&&(e==t&&(e=t.slice()),e[n]=i.copy(i.from,u.from),Zn(e,a,i.copy(u.from,i.to)));break}}}return e}function Zn(t,e,n){for(;e<t.length&&Sn(n,t[e])>0;)e++;t.splice(e,0,n)}function On(t){let e=[];return t.someProp("decorations",n=>{let i=n(t.state);i&&i!=zt&&e.push(i)}),t.cursorWrapper&&e.push(Mt.create(t.state.doc,[t.cursorWrapper.deco])),dn.from(e)}const qn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ti=Ve&&rt<=11;class vr{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ni{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new vr,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let a=0;a<i.length;a++)this.queue.push(i[a]);Ve&&rt<=11&&i.some(a=>a.type=="childList"&&a.removedNodes.length||a.type=="characterData"&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():this.flush()}),ti&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,qn)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(an(this.view)){if(this.suppressingSelectionUpdates)return Ot(this.view);if(Ve&&rt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ot(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,i;for(let u=e.focusNode;u;u=xe(u))n.add(u);for(let u=e.anchorNode;u;u=xe(u))if(n.has(u)){i=u;break}let a=i&&this.view.docView.nearestDesc(i);if(a&&a.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let i=e.domSelectionRange(),a=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&an(e)&&!this.ignoreSelectionChange(i),u=-1,g=-1,y=!1,E=[];if(e.editable)for(let w=0;w<n.length;w++){let q=this.registerMutation(n[w],E);q&&(u=u<0?q.from:Math.min(q.from,u),g=g<0?q.to:Math.max(q.to,g),q.typeOver&&(y=!0))}if(Qe&&E.length>1){let w=E.filter(q=>q.nodeName=="BR");if(w.length==2){let q=w[0],ae=w[1];q.parentNode&&q.parentNode.parentNode==ae.parentNode?ae.remove():q.remove()}}let F=null;u<0&&a&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&dt(i)&&(F=yt(e))&&F.eq(j.f.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ot(e),this.currentSelection.set(i),e.scrollToSelection()):(u>-1||a)&&(u>-1&&(e.docView.markDirty(u,g),ri(e)),this.handleDOMChange(u,g,y,E),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||Ot(e),this.currentSelection.set(i))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let w=0;w<e.addedNodes.length;w++)n.push(e.addedNodes[w]);if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let a=e.previousSibling,u=e.nextSibling;if(Ve&&rt<=11&&e.addedNodes.length)for(let w=0;w<e.addedNodes.length;w++){let{previousSibling:q,nextSibling:ae}=e.addedNodes[w];(!q||Array.prototype.indexOf.call(e.addedNodes,q)<0)&&(a=q),(!ae||Array.prototype.indexOf.call(e.addedNodes,ae)<0)&&(u=ae)}let g=a&&a.parentNode==e.target?_(a)+1:0,y=i.localPosFromDOM(e.target,g,-1),E=u&&u.parentNode==e.target?_(u):e.target.childNodes.length,F=i.localPosFromDOM(e.target,E,1);return{from:y,to:F}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let yr=new WeakMap,Dr=!1;function ri(t){if(!yr.has(t)&&(yr.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Qe,Dr)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Dr=!0}}function ii(t){let e;function n(E){E.preventDefault(),E.stopImmediatePropagation(),e=E.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let i=e.startContainer,a=e.startOffset,u=e.endContainer,g=e.endOffset,y=t.domAtPos(t.state.selection.anchor);return ot(y.node,y.offset,u,g)&&([i,a,u,g]=[u,g,i,a]),{anchorNode:i,anchorOffset:a,focusNode:u,focusOffset:g}}function si(t,e,n){let{node:i,fromOffset:a,toOffset:u,from:g,to:y}=t.docView.parseRange(e,n),E=t.domSelectionRange(),F,w=E.anchorNode;if(w&&t.dom.contains(w.nodeType==1?w:w.parentNode)&&(F=[{node:w,offset:E.anchorOffset}],dt(E)||F.push({node:E.focusNode,offset:E.focusOffset})),it&&t.input.lastKeyCode===8)for(let ut=u;ut>a;ut--){let bt=i.childNodes[ut-1],nn=bt.pmViewDesc;if(bt.nodeName=="BR"&&!nn){u=ut;break}if(!nn||nn.size)break}let q=t.state.doc,ae=t.someProp("domParser")||Ee.a.fromSchema(t.state.schema),te=q.resolve(g),le=null,ze=ae.parse(i,{topNode:te.parent,topMatch:te.parent.contentMatchAt(te.index()),topOpen:!0,from:a,to:u,preserveWhitespace:te.parent.type.whitespace=="pre"?"full":!0,findPositions:F,ruleFromNode:oi,context:te});if(F&&F[0].pos!=null){let ut=F[0].pos,bt=F[1]&&F[1].pos;bt==null&&(bt=ut),le={anchor:ut+g,head:bt+g}}return{doc:ze,sel:le,from:g,to:y}}function oi(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(be&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||be&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ai=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function li(t,e,n,i,a){if(e<0){let f=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,c=yt(t,f);if(c&&!t.state.selection.eq(c)){if(it&&ce&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",l=>l(t,et(13,"Enter"))))return;let o=t.state.tr.setSelection(c);f=="pointer"?o.setMeta("pointer",!0):f=="key"&&o.scrollIntoView(),t.composing&&o.setMeta("composition",t.input.compositionID),t.dispatch(o)}return}let u=t.state.doc.resolve(e),g=u.sharedDepth(n);e=u.before(g+1),n=t.state.doc.resolve(n).after(g+1);let y=t.state.selection,E=si(t,e,n),F=t.state.doc,w=F.slice(E.from,E.to),q,ae;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(q=t.state.selection.to,ae="end"):(q=t.state.selection.from,ae="start"),t.input.lastKeyCode=null;let te=er(w.content,E.doc.content,E.from,q,ae);if((T&&t.input.lastIOSEnter>Date.now()-225||ce)&&a.some(f=>f.nodeType==1&&!ai.test(f.nodeName))&&(!te||te.endA>=te.endB)&&t.someProp("handleKeyDown",f=>f(t,et(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!te)if(i&&y instanceof j.g&&!y.empty&&y.$head.sameParent(y.$anchor)&&!t.composing&&!(E.sel&&E.sel.anchor!=E.sel.head))te={start:y.from,endA:y.to,endB:y.to};else{if(E.sel){let f=br(t,t.state.doc,E.sel);if(f&&!f.eq(t.state.selection)){let c=t.state.tr.setSelection(f);t.composing&&c.setMeta("composition",t.input.compositionID),t.dispatch(c)}}return}if(it&&t.cursorWrapper&&E.sel&&E.sel.anchor==t.cursorWrapper.deco.from&&E.sel.head==E.sel.anchor){let f=te.endB-te.start;E.sel={anchor:E.sel.anchor+f,head:E.sel.anchor+f}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&te.start==te.endB&&t.state.selection instanceof j.g&&(te.start>t.state.selection.from&&te.start<=t.state.selection.from+2&&t.state.selection.from>=E.from?te.start=t.state.selection.from:te.endA<t.state.selection.to&&te.endA>=t.state.selection.to-2&&t.state.selection.to<=E.to&&(te.endB+=t.state.selection.to-te.endA,te.endA=t.state.selection.to)),Ve&&rt<=11&&te.endB==te.start+1&&te.endA==te.start&&te.start>E.from&&E.doc.textBetween(te.start-E.from-1,te.start-E.from+1)==" \xA0"&&(te.start--,te.endA--,te.endB--);let le=E.doc.resolveNoCache(te.start-E.from),ze=E.doc.resolveNoCache(te.endB-E.from),ut=F.resolve(te.start),bt=le.sameParent(ze)&&le.parent.inlineContent&&ut.end()>=te.endA,nn;if((T&&t.input.lastIOSEnter>Date.now()-225&&(!bt||a.some(f=>f.nodeName=="DIV"||f.nodeName=="P"))||!bt&&le.pos<E.doc.content.size&&!le.sameParent(ze)&&(nn=j.f.findFrom(E.doc.resolve(le.pos+1),1,!0))&&nn.head==ze.pos)&&t.someProp("handleKeyDown",f=>f(t,et(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>te.start&&ui(F,te.start,te.endA,le,ze)&&t.someProp("handleKeyDown",f=>f(t,et(8,"Backspace")))){ce&&it&&t.domObserver.suppressSelectionUpdates();return}it&&ce&&te.endB==te.start&&(t.input.lastAndroidDelete=Date.now()),ce&&!bt&&le.start()!=ze.start()&&ze.parentOffset==0&&le.depth==ze.depth&&E.sel&&E.sel.anchor==E.sel.head&&E.sel.head==te.endA&&(te.endB-=2,ze=E.doc.resolveNoCache(te.endB-E.from),setTimeout(()=>{t.someProp("handleKeyDown",function(f){return f(t,et(13,"Enter"))})},20));let rn=te.start,An=te.endA,Qt,Mr,tr;if(bt){if(le.pos==ze.pos)Ve&&rt<=11&&le.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ot(t),20)),Qt=t.state.tr.delete(rn,An),Mr=F.resolve(te.start).marksAcross(F.resolve(te.endA));else if(te.endA==te.endB&&(tr=Cr(le.parent.content.cut(le.parentOffset,ze.parentOffset),ut.parent.content.cut(ut.parentOffset,te.endA-ut.start()))))Qt=t.state.tr,tr.type=="add"?Qt.addMark(rn,An,tr.mark):Qt.removeMark(rn,An,tr.mark);else if(le.parent.child(le.index()).isText&&le.index()==ze.index()-(ze.textOffset?0:1)){let f=le.parent.textBetween(le.parentOffset,ze.parentOffset);if(t.someProp("handleTextInput",c=>c(t,rn,An,f)))return;Qt=t.state.tr.insertText(f,rn,An)}}if(Qt||(Qt=t.state.tr.replace(rn,An,E.doc.slice(te.start-E.from,te.endB-E.from))),E.sel){let f=br(t,Qt.doc,E.sel);f&&!(it&&ce&&t.composing&&f.empty&&(te.start!=te.endB||t.input.lastAndroidDelete<Date.now()-100)&&(f.head==rn||f.head==Qt.mapping.map(An)-1)||Ve&&f.empty&&f.head==rn)&&Qt.setSelection(f)}Mr&&Qt.ensureMarks(Mr),t.composing&&Qt.setMeta("composition",t.input.compositionID),t.dispatch(Qt.scrollIntoView())}function br(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Gt(t,e.resolve(n.anchor),e.resolve(n.head))}function Cr(t,e){let n=t.firstChild.marks,i=e.firstChild.marks,a=n,u=i,g,y,E;for(let w=0;w<i.length;w++)a=i[w].removeFromSet(a);for(let w=0;w<n.length;w++)u=n[w].removeFromSet(u);if(a.length==1&&u.length==0)y=a[0],g="add",E=w=>w.mark(y.addToSet(w.marks));else if(a.length==0&&u.length==1)y=u[0],g="remove",E=w=>w.mark(y.removeFromSet(w.marks));else return null;let F=[];for(let w=0;w<e.childCount;w++)F.push(E(e.child(w)));if(Ee.c.from(F).eq(t))return{mark:y,type:g}}function ui(t,e,n,i,a){if(!i.parent.isTextblock||n-e<=a.pos-i.pos||_n(i,!0,!1)<a.pos)return!1;let u=t.resolve(e);if(u.parentOffset<u.parent.content.size||!u.parent.isTextblock)return!1;let g=t.resolve(_n(u,!0,!0));return!g.parent.isTextblock||g.pos>n||_n(g,!0,!1)<n?!1:i.parent.content.cut(i.parentOffset).eq(g.parent.content)}function _n(t,e,n){let i=t.depth,a=e?t.end():t.pos;for(;i>0&&(e||t.indexAfter(i)==t.node(i).childCount);)i--,a++,e=!1;if(n){let u=t.node(i).maybeChild(t.indexAfter(i));for(;u&&!u.isLeaf;)u=u.firstChild,a++}return a}function er(t,e,n,i,a){let u=t.findDiffStart(e,n);if(u==null)return null;let{a:g,b:y}=t.findDiffEnd(e,n+t.size,n+e.size);if(a=="end"){let E=Math.max(0,u-Math.min(g,y));i-=g+E-u}if(g<u&&t.size<e.size){let E=i<=u&&i>=g?u-i:0;u-=E,y=u+(y-g),g=u}else if(y<u){let E=i<=u&&i>=y?u-i:0;u-=E,g=u+(g-y),y=u}return{start:u,endA:g,endB:y}}const Er=Wn,mi=Hn,gi=wn;class ci{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new zn,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(xr),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Or(this),Sr(this),this.nodeViews=Ar(this),this.docView=v(this.state.doc,kr(this),On(this),this.dom,this),this.domObserver=new ni(this,(i,a,u,g)=>li(this,i,a,u,g)),this.domObserver.start(),Lr(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Tn(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(xr),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in e)n[i]=e[i];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let i=this.state,a=!1,u=!1;e.storedMarks&&this.composing&&(hr(this),u=!0),this.state=e;let g=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(g||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let ae=Ar(this);di(ae,this.nodeViews)&&(this.nodeViews=ae,a=!0)}(g||n.handleDOMEvents!=this._props.handleDOMEvents)&&Tn(this),this.editable=Or(this),Sr(this);let y=On(this),E=kr(this),F=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",w=a||!this.docView.matchesNode(e.doc,E,y);(w||!e.selection.eq(i.selection))&&(u=!0);let q=F=="preserve"&&u&&this.dom.style.overflowAnchor==null&&Tt(this);if(u){this.domObserver.stop();let ae=w&&(Ve||it)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&fi(i.selection,e.selection);if(w){let te=it?this.trackWrites=this.domSelectionRange().focusNode:null;(a||!this.docView.update(e.doc,E,y,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=v(e.doc,E,y,this.dom,this)),te&&!this.trackWrites&&(ae=!0)}ae||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yn(this))?Ot(this,ae):(qt(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),F=="reset"?this.dom.scrollTop=0:F=="to selection"?this.scrollToSelection():q&&Ht(q)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof j.c){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&vt(this,n.getBoundingClientRect(),e)}else vt(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let i=this.state.plugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let i=this.pluginViews[n];i.update&&i.update(this,e)}}someProp(e,n){let i=this._props&&this._props[e],a;if(i!=null&&(a=n?n(i):i))return a;for(let g=0;g<this.directPlugins.length;g++){let y=this.directPlugins[g].props[e];if(y!=null&&(a=n?n(y):y))return a}let u=this.state.plugins;if(u)for(let g=0;g<u.length;g++){let y=u[g].props[e];if(y!=null&&(a=n?n(y):y))return a}}hasFocus(){if(Ve){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ln(this.dom),Ot(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return De(this,e)}coordsAtPos(e,n=1){return Xe(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,i=-1){let a=this.docView.posFromDOM(e,n,i);if(a==null)throw new RangeError("DOM position not inside the editor");return a}endOfTextblock(e,n){return C(this,n||this.state,e)}pasteHTML(e,n){return kn(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return kn(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(zr(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],On(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Kr(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return be&&this.root.nodeType===11&&Je(this.dom.ownerDocument)==this.dom?ii(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function kr(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let i in n)i=="class"?e.class+=" "+n[i]:i=="style"?e.style=(e.style?e.style+";":"")+n[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(n[i]))}),e.translate||(e.translate="no"),[Wt.node(0,t.state.doc.content.size,e)]}function Sr(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Wt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Or(t){return!t.someProp("editable",e=>e(t.state)===!1)}function fi(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ar(t){let e=Object.create(null);function n(i){for(let a in i)Object.prototype.hasOwnProperty.call(e,a)||(e[a]=i[a])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function di(t,e){let n=0,i=0;for(let a in t){if(t[a]!=e[a])return!0;n++}for(let a in e)i++;return n!=i}function xr(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},797:function(sn,pe,V){"use strict";var j=V(790);V.d(pe,"a",function(){return j.a}),V.d(pe,"b",function(){return j.b}),V.d(pe,"c",function(){return j.c})}}]);
