@tiptap/starter-kit 2.0.0-beta.21 → 2.0.0-beta.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.cjs +89 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +89 -0
- package/package.json +50 -26
- package/src/index.ts +5 -56
- package/src/starter-kit.ts +122 -0
- package/CHANGELOG.md +0 -296
- package/LICENSE.md +0 -21
- package/dist/packages/starter-kit/src/index.d.ts +0 -32
- package/dist/tiptap-starter-kit.bundle.umd.min.js +0 -2
- package/dist/tiptap-starter-kit.bundle.umd.min.js.map +0 -1
- package/dist/tiptap-starter-kit.cjs.js +0 -69
- package/dist/tiptap-starter-kit.cjs.js.map +0 -1
- package/dist/tiptap-starter-kit.esm.js +0 -44
- package/dist/tiptap-starter-kit.esm.js.map +0 -1
- package/dist/tiptap-starter-kit.umd.js +0 -56
- package/dist/tiptap-starter-kit.umd.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/starter-kit"]={},t["@tiptap/core"])}(this,(function(t,e){"use strict";function n(t,e,r){for(var o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:r;var i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){var c=n(i.content,s.content,r+1);if(null!=c)return c}r+=i.nodeSize}else r+=i.nodeSize}}function r(t,e,n,o){for(var i=t.childCount,s=e.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:o};var a=t.child(--i),c=e.child(--s),p=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:o};if(a.isText&&a.text!=c.text){for(var l=0,h=Math.min(a.text.length,c.text.length);l<h&&a.text[a.text.length-l-1]==c.text[c.text.length-l-1];)l++,n--,o--;return{a:n,b:o}}if(a.content.size||c.content.size){var u=r(a.content,c.content,n-1,o-1);if(u)return u}n-=p,o-=p}else n-=p,o-=p}}var o=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},i={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};o.prototype.nodesBetween=function(t,e,n,r,o){void 0===r&&(r=0);for(var i=0,s=0;s<e;i++){var a=this.content[i],c=s+a.nodeSize;if(c>t&&!1!==n(a,r+s,o,i)&&a.content.size){var p=s+1;a.nodesBetween(Math.max(0,t-p),Math.min(a.content.size,e-p),n,r+p)}s=c}},o.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},o.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},o.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new o(r,this.size+t.size)},o.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],r=0;if(e>t)for(var i=0,s=0;s<e;i++){var a=this.content[i],c=s+a.nodeSize;c>t&&((s<t||c>e)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new o(n,r)},o.prototype.cutByIndex=function(t,e){return t==e?o.empty:0==t&&e==this.content.length?this:new o(this.content.slice(t,e))},o.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new o(r,i)},o.prototype.addToStart=function(t){return new o([t].concat(this.content),this.size+t.nodeSize)},o.prototype.addToEnd=function(t){return new o(this.content.concat(t),this.size+t.nodeSize)},o.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},i.firstChild.get=function(){return this.content.length?this.content[0]:null},i.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},i.childCount.get=function(){return this.content.length},o.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},o.prototype.maybeChild=function(t){return this.content[t]},o.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}},o.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),n(this,t,e)},o.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),r(this,t,e,n)},o.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return a(0,t);if(t==this.size)return a(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?a(n+1,o):a(n,r);r=o}},o.prototype.toString=function(){return"<"+this.toStringInner()+">"},o.prototype.toStringInner=function(){return this.content.join(", ")},o.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},o.fromJSON=function(t,e){if(!e)return o.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new o(e.map(t.nodeFromJSON))},o.fromArray=function(t){if(!t.length)return o.empty;for(var e,n=0,r=0;r<t.length;r++){var i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new o(e||t,n)},o.from=function(t){if(!t)return o.empty;if(t instanceof o)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new o([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(o.prototype,i);var s={index:0,offset:0};function a(t,e){return s.index=t,s.offset=e,s}function c(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!c(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e)||!c(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}o.empty=new o([],0);var p=function(t,e){this.type=t,this.attrs=e};function l(t){var e=Error.call(this,t);return e.__proto__=l.prototype,e}p.prototype.addToSet=function(t){for(var e,n=!1,r=0;r<t.length;r++){var o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},p.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},p.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},p.prototype.eq=function(t){return this==t||this.type==t.type&&c(this.attrs,t.attrs)},p.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},p.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},p.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},p.setFrom=function(t){if(!t||0==t.length)return p.none;if(t instanceof p)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},p.none=[],l.prototype=Object.create(Error.prototype),l.prototype.constructor=l,l.prototype.name="ReplaceError";var h=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},u={size:{configurable:!0}};function f(t,e,n){var r=t.findIndex(e),o=r.index,i=r.offset,s=t.maybeChild(o),a=t.findIndex(n),c=a.index,p=a.offset;if(i==e||s.isText){if(p!=n&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(f(s.content,e-i-1,n-i-1)))}function d(t,e,n,r){var o=t.findIndex(e),i=o.index,s=o.offset,a=t.maybeChild(i);if(s==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));var c=d(a.content,e-s-1,n);return c&&t.replaceChild(i,a.copy(c))}function m(t,e,n){if(n.openStart>t.depth)throw new l("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new l("Inconsistent open depths");return v(t,e,n,0)}function v(t,e,n,r){var i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){var a=v(t,e,n,r+1);return s.copy(s.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){var c=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(o.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return k(s,S(t,c.start,c.end,e,r))}var p=t.parent,l=p.content;return k(p,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}return k(s,x(t,e,r))}function g(t,e){if(!e.type.compatibleContent(t.type))throw new l("Cannot join "+e.type.name+" onto "+t.type.name)}function y(t,e,n){var r=t.node(n);return g(r,e.node(n)),r}function b(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function w(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(b(t.nodeAfter,r),i++));for(var a=i;a<s;a++)b(o.child(a),r);e&&e.depth==n&&e.textOffset&&b(e.nodeBefore,r)}function k(t,e){if(!t.type.validContent(e))throw new l("Invalid content for node "+t.type.name);return t.copy(e)}function S(t,e,n,r,i){var s=t.depth>i&&y(t,e,i+1),a=r.depth>i&&y(n,r,i+1),c=[];return w(null,t,i,c),s&&a&&e.index(i)==n.index(i)?(g(s,a),b(k(s,S(t,e,n,r,i+1)),c)):(s&&b(k(s,x(t,e,i+1)),c),w(e,n,i,c),a&&b(k(a,x(n,r,i+1)),c)),w(r,null,i,c),new o(c)}function x(t,e,n){var r=[];(w(null,t,n,r),t.depth>n)&&b(k(y(t,e,n+1),x(t,e,n+1)),r);return w(e,null,n,r),new o(r)}u.size.get=function(){return this.content.size-this.openStart-this.openEnd},h.prototype.insertAt=function(t,e){var n=d(this.content,t+this.openStart,e,null);return n&&new h(n,this.openStart,this.openEnd)},h.prototype.removeBetween=function(t,e){return new h(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},h.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},h.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},h.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},h.fromJSON=function(t,e){if(!e)return h.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new h(o.fromJSON(t,e.content),n,r)},h.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new h(t,n,r)},Object.defineProperties(h.prototype,u),h.empty=new h(o.empty,0,0);var M=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},C={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};M.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},C.parent.get=function(){return this.node(this.depth)},C.doc.get=function(){return this.node(0)},M.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},M.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},M.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},M.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},M.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},M.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},M.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},C.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},C.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},C.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},M.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o<t;o++)r+=n.child(o).nodeSize;return r},M.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return p.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i},M.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},M.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},M.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new A(this,t,n)},M.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},M.prototype.max=function(t){return t.pos>this.pos?t:this},M.prototype.min=function(t){return t.pos<this.pos?t:this},M.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},M.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,p=o-c;if(n.push(i,a,r+c),!p)break;if((i=i.child(a)).isText)break;o=p-1,r+=c+1}return new M(e,n,o)},M.resolveCached=function(t,e){for(var n=0;n<O.length;n++){var r=O[n];if(r.pos==e&&r.doc==t)return r}var o=O[T]=M.resolve(t,e);return T=(T+1)%N,o},Object.defineProperties(M.prototype,C);var O=[],T=0,N=12,A=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},D={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};D.start.get=function(){return this.$from.before(this.depth+1)},D.end.get=function(){return this.$to.after(this.depth+1)},D.parent.get=function(){return this.$from.node(this.depth)},D.startIndex.get=function(){return this.$from.index(this.depth)},D.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(A.prototype,D);var E=Object.create(null),I=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||o.empty,this.marks=r||p.none},R={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};R.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},R.childCount.get=function(){return this.content.childCount},I.prototype.child=function(t){return this.content.child(t)},I.prototype.maybeChild=function(t){return this.content.maybeChild(t)},I.prototype.forEach=function(t){this.content.forEach(t)},I.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},I.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},R.textContent.get=function(){return this.textBetween(0,this.content.size,"")},I.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},R.firstChild.get=function(){return this.content.firstChild},R.lastChild.get=function(){return this.content.lastChild},I.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},I.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},I.prototype.hasMarkup=function(t,e,n){return this.type==t&&c(this.attrs,e||t.defaultAttrs||E)&&p.sameSet(this.marks,n||p.none)},I.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},I.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},I.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},I.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return h.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new h(a,r.depth-i,o.depth-i)},I.prototype.replace=function(t,e,n){return m(this.resolve(t),this.resolve(e),n)},I.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},I.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},I.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},I.prototype.resolve=function(t){return M.resolveCached(this,t)},I.prototype.resolveNoCache=function(t){return M.resolve(this,t)},I.prototype.rangeHasMark=function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},R.isBlock.get=function(){return this.type.isBlock},R.isTextblock.get=function(){return this.type.isTextblock},R.inlineContent.get=function(){return this.type.inlineContent},R.isInline.get=function(){return this.type.isInline},R.isText.get=function(){return this.type.isText},R.isLeaf.get=function(){return this.type.isLeaf},R.isAtom.get=function(){return this.type.isAtom},I.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),function(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}(this.marks,t)},I.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},I.prototype.canReplace=function(t,e,n,r,i){void 0===n&&(n=o.empty),void 0===r&&(r=0),void 0===i&&(i=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,r,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},I.prototype.canReplaceWith=function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd},I.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},I.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var t=p.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!p.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(t){return t.type.name})));this.content.forEach((function(t){return t.check()}))},I.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},I.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=o.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)},Object.defineProperties(I.prototype,R);var P=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},z={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};P.parse=function(t,e){var n=new B(t,e);if(null==n.next)return P.empty;var r=V(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return n(q(t,0));function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];q(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new P(r.indexOf(t.length-1)>-1),s=0;s<o.length;s+=2){var a=o[s+1].sort(j);i.next.push(o[s],e[a.join(",")]||n(a))}return i}}(function(t){var e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((function(t){return t.to=e}))}function i(t,e){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(i(n,e))}),[]);if("seq"==t.type)for(var s=0;;s++){var a=i(t.exprs[s],e);if(s==t.exprs.length-1)return a;o(a,e=n())}else{if("star"==t.type){var c=n();return r(e,c),o(i(t.expr,c),c),[r(c)]}if("plus"==t.type){var p=n();return o(i(t.expr,e),p),o(i(t.expr,p),p),[r(p)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){for(var l=e,h=0;h<t.min;h++){var u=n();o(i(t.expr,l),u),l=u}if(-1==t.max)o(i(t.expr,l),l);else for(var f=t.min;f<t.max;f++){var d=n();r(l,d),o(i(t.expr,l),d),l=d}return[r(l)]}if("name"==t.type)return[r(e,null,t.value)]}}}(r));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var o=r[n],i=!o.validEnd,s=[],a=0;a<o.next.length;a+=2){var c=o.next[a],p=o.next[a+1];s.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(p)&&r.push(p)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o},P.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},P.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var r=this,o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r},z.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},z.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},P.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},P.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var r=[this];return function i(s,a){var c=s.matchFragment(t,n);if(c&&(!e||c.validEnd))return o.from(a.map((function(t){return t.createAndFill()})));for(var p=0;p<s.next.length;p+=2){var l=s.next[p],h=s.next[p+1];if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(h)){r.push(h);var u=i(h,a.concat(l));if(u)return u}}}(this,[])},P.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},P.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(t)){for(var i=[],s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(var a=0;a<o.next.length;a+=2){var c=o.next[a];c.isLeaf||c.hasRequiredAttrs()||c.name in e||r.type&&!o.next[a+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}},z.edgeCount.get=function(){return this.next.length>>1},P.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},P.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r<n.next.length;r+=2)-1==t.indexOf(n.next[r])&&e(n.next[r])}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",o=0;o<e.next.length;o+=2)r+=(o?", ":"")+e.next[o].name+"->"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(P.prototype,z),P.empty=new P(!0);var B=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},L={next:{configurable:!0}};function V(t){var e=[];do{e.push($(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function $(t){var e=[];do{e.push(F(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function F(t){for(var e=function(t){if(t.eat("(")){var e=V(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=H(t,e)}return e}function _(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function H(t,e){var n=_(t),r=n;return t.eat(",")&&(r="}"!=t.next?_(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function j(t,e){return e-t}function q(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var s=o[i],a=s.term,c=s.to;a||-1!=n.indexOf(c)||e(c)}}(e),n.sort(j)}function J(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function W(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(void 0===o){var i=t[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function K(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new X(t[n]);return e}L.next.get=function(){return this.tokens[this.pos]},B.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},B.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(B.prototype,L);var U=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=K(n.attrs),this.defaultAttrs=J(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},G={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};G.isInline.get=function(){return!this.isBlock},G.isTextblock.get=function(){return this.isBlock&&this.inlineContent},G.isLeaf.get=function(){return this.contentMatch==P.empty},G.isAtom.get=function(){return this.isLeaf||this.spec.atom},U.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},U.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},U.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,t)},U.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new I(this,this.computeAttrs(t),o.from(e),p.setFrom(n))},U.prototype.createChecked=function(t,e,n){if(e=o.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new I(this,this.computeAttrs(t),e,p.setFrom(n))},U.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=o.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e).fillBefore(o.empty,!0);return i?new I(this,t,e.append(i),p.setFrom(n)):null},U.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},U.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},U.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},U.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:p.empty:t},U.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,r){return n[t]=new U(t,e,r)}));var r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(U.prototype,G);var X=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},Y={isRequired:{configurable:!0}};Y.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(X.prototype,Y);var Q=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=K(r.attrs),this.rank=e,this.excluded=null;var o=J(this.attrs);this.instance=o&&new p(this,o)};Q.prototype.create=function(t){return!t&&this.instance?this.instance:new p(this,W(this.attrs,t))},Q.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach((function(t,o){return n[t]=new Q(t,r++,e,o)})),n},Q.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},Q.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},Q.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var Z=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};Z.prototype.parse=function(t,e){void 0===e&&(e={});var n=new it(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},Z.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new it(this,e,!0);return n.addAll(t,null,e.from,e.to),h.maxOpen(n.finish())},Z.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(at(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},Z.prototype.matchStyle=function(t,e,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},Z.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var o=e[r];if((null==o.priority?50:o.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=ct(t)),t.mark=e}))};for(var o in t.marks)r(o);var i;for(var s in t.nodes)i=void 0,(i=t.nodes[s].spec.parseDOM)&&i.forEach((function(t){n(t=ct(t)),t.node=s}));return e},Z.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new Z(t,Z.schemaRules(t)))};var tt={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},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},nt={ol:!0,ul:!0};function rt(t){return(t?1:0)|("full"===t?2:0)}var ot=function(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.solid=o,this.match=i||(4&s?null:t.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=p.none,this.pendingMarks=r,this.stashMarks=[]};ot.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(o.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},ot.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=o.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(o.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},ot.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},ot.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):pt(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}};var it=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,o=e.topNode,i=rt(e.preserveWhitespace)|(n?4:0);r=o?new ot(o.type,o.attrs,p.none,p.none,!0,e.topMatch||o.type.contentMatch,i):new ot(n?null:t.schema.topNodeType,null,p.none,p.none,!0,null,i),this.nodes=[r],this.open=0,this.find=e.findPositions,this.needsBlock=!1},st={top:{configurable:!0},currentPos:{configurable:!0}};function at(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ct(t){var e={};for(var n in t)e[n]=t[n];return e}function pt(t,e){var n=e.schema.nodes,r=function(r){var o=n[r];if(o.allowsMarkType(t)){var i=[],s=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var r=t.edge(n),o=r.type,a=r.next;if(o==e)return!0;if(i.indexOf(a)<0&&s(a))return!0}};return s(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var i=r(o);if(i)return i.v}}st.top.get=function(){return this.nodes[this.open]},it.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}},it.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},it.prototype.addElement=function(t,e){var n,r=t.nodeName.toLowerCase();nt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&nt.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:et.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var i,s=this.top,a=this.needsBlock;if(tt.hasOwnProperty(r))i=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(s),this.needsBlock=a}else this.addElementByRule(t,o,!1===o.consuming?n:null)},it.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},it.prototype.ignoreFallback=function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},it.prototype.readStyles=function(t){var e=p.none;t:for(var n=0;n<t.length;n+=2)for(var r=null;;){var o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e},it.prototype.addElementByRule=function(t,e,n){var r,o,i,s=this;e.node?(o=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return s.insertNode(t)}));else{var c=e.contentElement;"string"==typeof c?c=t.querySelector(c):"function"==typeof c&&(c=c(t)),c||(c=t),this.findAround(t,c,!0),this.addAll(c,r)}r&&(this.sync(a),this.open--),i&&this.removePendingMark(i,a)},it.prototype.addAll=function(t,e,n,r){for(var o=n||0,i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i),e&&tt.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,o)},it.prototype.findPlace=function(t){for(var e,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0},it.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,o=0;o<t.marks.length;o++)n.type&&!n.type.allowsMarkType(t.marks[o].type)||(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1},it.prototype.enter=function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r},it.prototype.enterInner=function(t,e,n,r){this.closeExtra();var o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t,e);var i=null==r?-5&o.options:rt(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ot(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++},it.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},it.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},it.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},st.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},it.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},it.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},it.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node))e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},it.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},it.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var p=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!p||p.name!=c&&-1==p.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},it.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},it.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},it.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(it.prototype,st);var lt=function(t,e){this.nodes=t||{},this.marks=e||{}};function ht(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ut(t){return t.document||window.document}lt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=ut(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n<i.length&&s<t.marks.length;){var a=t.marks[s];if(r.marks[a.type.name]){if(!a.eq(i[n])||!1===a.type.spec.spanning)break;n+=2,s++}else s++}for(;n<i.length;)o=i.pop(),i.pop();for(;s<t.marks.length;){var c=t.marks[s++],p=r.serializeMark(c,t.isInline,e);p&&(i.push(c,o),o.appendChild(p.dom),o=p.contentDOM||p.dom)}}o.appendChild(r.serializeNode(t,e))})),n},lt.prototype.serializeNode=function(t,e){void 0===e&&(e={});var n=lt.renderSpec(ut(e),this.nodes[t.type.name](t)),r=n.dom,o=n.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,o,e):this.serializeFragment(t.content,e,o)}return r},lt.prototype.serializeNodeAndMarks=function(t,e){void 0===e&&(e={});for(var n=this.serializeNode(t,e),r=t.marks.length-1;r>=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},lt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&<.renderSpec(ut(n),r(t,e))},lt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var p in c=2,a)if(null!=a[p]){var l=p.indexOf(" ");l>0?s.setAttributeNS(p.slice(0,l),p.slice(l+1),a[p]):s.setAttribute(p,a[p])}for(var h=c;h<e.length;h++){var u=e[h];if(0===u){if(h<e.length-1||h>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var f=lt.renderSpec(t,u,n),d=f.dom,m=f.contentDOM;if(s.appendChild(d),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},lt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new lt(this.nodesFromSchema(t),this.marksFromSchema(t)))},lt.nodesFromSchema=function(t){var e=ht(t.nodes);return e.text||(e.text=function(t){return t.text}),e},lt.marksFromSchema=function(t){return ht(t.marks)};var ft=Math.pow(2,16);function dt(t){return 65535&t}var mt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},vt=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};vt.prototype.recover=function(t){var e=0,n=dt(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ft}(t)},vt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},vt.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},vt.prototype._map=function(t,e,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;var c=this.ranges[s+o],p=this.ranges[s+i],l=a+c;if(t<=l){var h=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:p);if(n)return h;var u=t==(e<0?a:l)?null:s/3+(t-a)*ft;return new mt(h,e<0?t!=a:t!=l,u)}r+=p-c}return n?t+r:new mt(t+r)},vt.prototype.touches=function(t,e){for(var n=0,r=dt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>t)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},vt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+e],p=this.ranges[r+n];t(s,s+c,a,a+p),o+=p-c}},vt.prototype.invert=function(){return new vt(this.ranges,!this.inverted)},vt.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},vt.offset=function(t){return 0==t?vt.empty:new vt(t<0?[0,-t,0]:[0,0,t])},vt.empty=new vt([]);var gt=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};function yt(t){var e=Error.call(this,t);return e.__proto__=yt.prototype,e}gt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new gt(this.maps,this.mirror,t,e)},gt.prototype.copy=function(){return new gt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},gt.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},gt.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:null)}},gt.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},gt.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},gt.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},gt.prototype.invert=function(){var t=new gt;return t.appendMappingInverted(this),t},gt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},gt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},gt.prototype._map=function(t,e,n){for(var r=!1,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(t,e);if(null!=i.recover){var s=this.getMirror(o);if(null!=s&&s>o&&s<this.to){o=s,t=this.maps[s].recover(i.recover);continue}}i.deleted&&(r=!0),t=i.pos}return n?t:new mt(t,r)},yt.prototype=Object.create(Error.prototype),yt.prototype.constructor=yt,yt.prototype.name="TransformError";var bt=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new gt},wt={before:{configurable:!0},docChanged:{configurable:!0}};function kt(){throw new Error("Override me")}wt.before.get=function(){return this.docs.length?this.docs[0]:this.doc},bt.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new yt(e.failed);return this},bt.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},wt.docChanged.get=function(){return this.steps.length>0},bt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(bt.prototype,wt);var St=Object.create(null),xt=function(){};xt.prototype.apply=function(t){return kt()},xt.prototype.getMap=function(){return vt.empty},xt.prototype.invert=function(t){return kt()},xt.prototype.map=function(t){return kt()},xt.prototype.merge=function(t){return null},xt.prototype.toJSON=function(){return kt()},xt.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=St[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},xt.jsonID=function(t,e){if(t in St)throw new RangeError("Duplicate use of step JSON ID "+t);return St[t]=e,e.prototype.jsonID=t,e};var Mt=function(t,e){this.doc=t,this.failed=e};Mt.ok=function(t){return new Mt(t,null)},Mt.fail=function(t){return new Mt(null,t)},Mt.fromReplace=function(t,e,n,r){try{return Mt.ok(t.replace(e,n,r))}catch(t){if(t instanceof l)return Mt.fail(t.message);throw t}};var Ct=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Tt(t,this.from,this.to)?Mt.fail("Structure replace would overwrite content"):Mt.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new vt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?h.empty:new h(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?h.empty:new h(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,h.fromJSON(t,n.slice),!!n.structure)},e}(xt);xt.jsonID("replace",Ct);var Ot=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Tt(t,this.from,this.gapFrom)||Tt(t,this.gapTo,this.to)))return Mt.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Mt.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Mt.fromReplace(t,this.from,this.to,n):Mt.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,h.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(xt);function Tt(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Nt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function At(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Nt(r,o,i))break}}function Dt(t){return{type:t,attrs:null}}function Et(t,e,n,r){void 0===n&&(n=1);var o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=n-2;a>i;a--,c--){var p=o.node(a),l=o.index(a);if(p.type.spec.isolating)return!1;var h=p.content.cutByIndex(l,p.childCount),u=r&&r[c]||p;if(u!=p&&(h=h.replaceChild(0,u.type.create(u.attrs))),!p.canReplace(l+1,p.childCount)||!u.type.validContent(h))return!1}var f=o.indexAfter(i),d=r&&r[0];return o.node(i).canReplaceWith(f,f,d?d.type:o.node(i+1).type)}function It(t,e){var n,r,o=t.resolve(e),i=o.index();return n=o.nodeBefore,r=o.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&o.parent.canReplace(i,i+1)}function Rt(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,p=r.index(a)+(c>0?1:0),l=r.node(a),h=!1;if(1==s)h=l.canReplace(p,p,o);else{var u=l.contentMatchAt(p).findWrapping(o.firstChild.type);h=u&&l.canReplaceWith(p,p,u[0])}if(h)return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Pt(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var s=t.child(i);s.content.size&&(s=s.copy(Pt(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return o.fromArray(r)}xt.jsonID("replaceAround",Ot),bt.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,i=t.depth,s=n.before(i+1),a=r.after(i+1),c=s,p=a,l=o.empty,u=0,f=i,d=!1;f>e;f--)d||n.index(f)>0?(d=!0,l=o.from(n.node(f).copy(l)),u++):c--;for(var m=o.empty,v=0,g=i,y=!1;g>e;g--)y||r.after(g+1)<r.end(g)?(y=!0,m=o.from(r.node(g).copy(m)),v++):p++;return this.step(new Ot(c,p,s,a,new h(l.append(m),u,v),l.size-u,!0))},bt.prototype.wrap=function(t,e){for(var n=o.empty,r=e.length-1;r>=0;r--)n=o.from(e[r].type.create(e[r].attrs,n));var i=t.start,s=t.end;return this.step(new Ot(i,s,i,s,new h(n,0,0),e.length,!0))},bt.prototype.setBlockType=function(t,e,n,r){var i=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(s).map(e),n)){i.clearIncompatible(i.mapping.slice(s).map(e,1),n);var a=i.mapping.slice(s),c=a.map(e,1),p=a.map(e+t.nodeSize,1);return i.step(new Ot(c,p,c+1,p-1,new h(o.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},bt.prototype.setNodeMarkup=function(t,e,n,r){var i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");e||(e=i.type);var s=e.create(n,null,r||i.marks);if(i.isLeaf)return this.replaceWith(t,t+i.nodeSize,s);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Ot(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new h(o.from(s),0,0),1,!0))},bt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),i=o.empty,s=o.empty,a=r.depth,c=r.depth-e,p=e-1;a>c;a--,p--){i=o.from(r.node(a).copy(i));var l=n&&n[p];s=o.from(l?l.type.create(l.attrs,s):r.node(a).copy(s))}return this.step(new Ct(t,t,new h(i.append(s),e,e),!0))},bt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Ct(t-e,t+e,h.empty,!0);return this.step(n)};var zt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new h(Pt(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return Mt.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Bt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);xt.jsonID("addMark",zt);var Bt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new h(Pt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return Mt.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new zt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);function Lt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}xt.jsonID("removeMark",Bt),bt.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,p){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&p.type.allowsMarkType(n.type)){for(var h=Math.max(c,t),u=Math.min(c+r.nodeSize,e),f=n.addToSet(l),d=0;d<l.length;d++)l[d].isInSet(f)||(s&&s.to==h&&s.mark.eq(l[d])?s.to=u:o.push(s=new Bt(h,u,l[d])));a&&a.to==h?a.to=u:i.push(a=new zt(h,u,n))}}})),o.forEach((function(t){return r.step(t)})),i.forEach((function(t){return r.step(t)})),this},bt.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var o=[],i=0;return this.doc.nodesBetween(t,e,(function(r,s){if(r.isInline){i++;var a=null;if(n instanceof Q)for(var c,p=r.marks;c=n.isInSet(p);)(a||(a=[])).push(c),p=c.removeFromSet(p);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var l=Math.min(s+r.nodeSize,e),h=0;h<a.length;h++){for(var u=a[h],f=void 0,d=0;d<o.length;d++){var m=o[d];m.step==i-1&&u.eq(o[d].style)&&(f=m)}f?(f.to=l,f.step=i):o.push({style:u,from:Math.max(s,t),to:l,step:i})}}})),o.forEach((function(t){return r.step(new Bt(t.from,t.to,t.style))})),this},bt.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var r=this.doc.nodeAt(t),i=[],s=t+1,a=0;a<r.childCount;a++){var c=r.child(a),p=s+c.nodeSize,l=n.matchType(c.type,c.attrs);if(l){n=l;for(var u=0;u<c.marks.length;u++)e.allowsMarkType(c.marks[u].type)||this.step(new Bt(s,p,c.marks[u]))}else i.push(new Ct(s,p,h.empty));s=p}if(!n.validEnd){var f=n.fillBefore(o.empty,!0);this.replace(s,s,new h(f,0,0))}for(var d=i.length-1;d>=0;d--)this.step(i[d]);return this},bt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=h.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=h.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Lt(o,i,r)?new Ct(e,n,r):new Vt(o,i,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},bt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new h(o.from(n),0,0))},bt.prototype.delete=function(t,e){return this.replace(t,e,h.empty)},bt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Vt=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var i=t.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(r))})}this.placed=o.empty;for(var s=t.depth;s>0;s--)this.placed=o.from(t.node(s).copy(this.placed))},$t={depth:{configurable:!0}};function Ft(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Ft(t.firstChild.content,e-1,n)))}function _t(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_t(t.lastChild.content,e-1,n)))}function Ht(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function jt(t,e,n){if(e<=0)return t;var r=t.content;return e>1&&(r=r.replaceChild(0,jt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(o.empty,!0)))),t.copy(r)}function qt(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Jt(t,e,n,r,i){if(e<n){var s=t.firstChild;t=t.replaceChild(0,s.copy(Jt(s.content,e+1,n,r,s)))}if(e>r){var a=i.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(o.empty,!0))}return t}function Wt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}$t.depth.get=function(){return this.frontier.length-1},Vt.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new h(i,s,a);return e>-1?new Ot(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ct(r.pos,o.pos,c):void 0},Vt.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Ht(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var s=this.frontier[i],a=s.type,c=s.match,p=void 0,l=void 0;if(1==t&&(r?c.matchType(r.type)||(l=c.fillBefore(o.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:i,parent:n,inject:l};if(2==t&&r&&(p=c.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:i,parent:n,wrap:p};if(n&&c.matchType(n.type))break}},Vt.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ht(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new h(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},Vt.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Ht(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new h(Ft(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new h(Ft(e,n,1),n,r)},Vt.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var c=this.unplaced,p=r?r.content:c.content,l=c.openStart-e,u=0,f=[],d=this.frontier[n],m=d.match,v=d.type;if(i){for(var g=0;g<i.childCount;g++)f.push(i.child(g));m=m.matchFragment(i)}for(var y=p.size+e-(c.content.size-c.openEnd);u<p.childCount;){var b=p.child(u),w=m.matchType(b.type);if(!w)break;(++u>1||0==l||b.content.size)&&(m=w,f.push(jt(b.mark(v.allowedMarks(b.marks)),1==u?l:0,u==p.childCount?y:-1)))}var k=u==p.childCount;k||(y=-1),this.placed=_t(this.placed,n,o.from(f)),this.frontier[n].match=m,k&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var S=0,x=p;S<y;S++){var M=x.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),x=M.content}this.unplaced=k?0==e?h.empty:new h(Ft(c.content,e-1,1),e-1,y<0?c.openEnd:e-1):new h(Ft(c.content,e,u),c.openStart,c.openEnd)},Vt.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!qt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},Vt.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=qt(t,e,o,r,i);if(s){for(var a=e-1;a>=0;a--){var c=this.frontier[a],p=c.match,l=qt(t,a,c.type,p,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},Vt.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=_t(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},Vt.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=_t(this.placed,this.depth,o.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Vt.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(o.empty,!0);t.childCount&&(this.placed=_t(this.placed,this.frontier.length,t))},Object.defineProperties(Vt.prototype,$t),bt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Lt(r,o,n))return this.step(new Ct(t,e,n));var i=Wt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var p=r.node(a).type.spec;if(p.defining||p.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),u=[],f=n.openStart,d=n.content,m=0;;m++){var v=d.firstChild;if(u.push(v),m==n.openStart)break;d=v.content}f>0&&u[f-1].type.spec.defining&&r.node(l).type!=u[f-1].type?f-=1:f>=2&&u[f-1].isTextblock&&u[f-2].type.spec.defining&&r.node(l).type!=u[f-2].type&&(f-=2);for(var g=n.openStart;g>=0;g--){var y=(g+f+1)%(n.openStart+1),b=u[y];if(b)for(var w=0;w<i.length;w++){var k=i[(w+l)%i.length],S=!0;k<0&&(S=!1,k=-k);var x=r.node(k-1),M=r.index(k-1);if(x.canReplaceWith(M,M,b.type,b.marks))return this.replace(r.before(k),S?o.after(k):e,new h(Jt(n.content,0,n.openStart,y),y,n.openEnd))}}for(var C=this.steps.length,O=i.length-1;O>=0&&(this.replace(t,e,n),!(this.steps.length>C));O--){var T=i[O];T<0||(t=r.before(T),e=o.after(T))}return this},bt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)return null}}(this.doc,t,n.type);null!=r&&(t=e=r)}return this.replaceRange(t,e,new h(o.from(n),0,0))},bt.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=this.doc.resolve(e),o=Wt(n,r),i=0;i<o.length;i++){var s=o[i],a=i==o.length-1;if(a&&0==s||n.node(s).type.contentMatch.validEnd)return this.delete(n.start(s),r.end(s));if(s>0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Kt=Object.create(null),Ut=function(t,e,n){this.ranges=n||[new Xt(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Gt={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Gt.anchor.get=function(){return this.$anchor.pos},Gt.head.get=function(){return this.$head.pos},Gt.from.get=function(){return this.$from.pos},Gt.to.get=function(){return this.$to.pos},Gt.$from.get=function(){return this.ranges[0].$from},Gt.$to.get=function(){return this.ranges[0].$to},Gt.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},Ut.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},Ut.prototype.replace=function(t,e){void 0===e&&(e=h.empty);for(var n=e.content.lastChild,r=null,o=0;o<e.openEnd;o++)r=n,n=n.lastChild;for(var i=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var c=s[a],p=c.$from,l=c.$to,u=t.mapping.slice(i);t.replaceRange(u.map(p.pos),u.map(l.pos),a?h.empty:e),0==a&&oe(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}},Ut.prototype.replaceWith=function(t,e){for(var n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],s=i.$from,a=i.$to,c=t.mapping.slice(n),p=c.map(s.pos),l=c.map(a.pos);o?t.deleteRange(p,l):(t.replaceRangeWith(p,l,e),oe(t,n,e.isInline?-1:1))}},Ut.findFrom=function(t,e,n){var r=t.parent.inlineContent?new Yt(t):re(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;o>=0;o--){var i=e<0?re(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):re(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},Ut.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ee(t.node(0))},Ut.atStart=function(t){return re(t,t,0,0,1)||new ee(t)},Ut.atEnd=function(t){return re(t,t,t.content.size,t.childCount,-1)||new ee(t)},Ut.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Kt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},Ut.jsonID=function(t,e){if(t in Kt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Kt[t]=e,e.prototype.jsonID=t,e},Ut.prototype.getBookmark=function(){return Yt.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(Ut.prototype,Gt),Ut.prototype.visible=!0;var Xt=function(t,e){this.$from=t,this.$to=e},Yt=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=h.empty),t.prototype.replace.call(this,e,n),n==h.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new Qt(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new e(n,r)},Object.defineProperties(e.prototype,n),e}(Ut);Ut.jsonID("text",Yt);var Qt=function(t,e){this.anchor=t,this.head=e};Qt.prototype.map=function(t){return new Qt(t.map(this.anchor),t.map(this.head))},Qt.prototype.resolve=function(t){return Yt.between(t.resolve(this.anchor),t.resolve(this.head))};var Zt=function(t){function e(e){var n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,r),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,s=o.pos,a=n.resolve(s);return i?t.near(a):new e(a)},e.prototype.content=function(){return new h(o.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new te(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(Ut);Zt.prototype.visible=!1,Ut.jsonID("node",Zt);var te=function(t){this.anchor=t};te.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,r=e.pos;return n?new Qt(r,r):new te(r)},te.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Zt.isSelectable(n)?new Zt(e):Ut.near(e)};var ee=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=h.empty),n==h.empty){e.delete(0,e.doc.content.size);var r=t.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return ne},e}(Ut);Ut.jsonID("all",ee);var ne={map:function(){return this},resolve:function(t){return new ee(t)}};function re(t,e,n,r,o,i){if(e.inlineContent)return Yt.create(t,n);for(var s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&Zt.isSelectable(a))return Zt.create(t,n-(o<0?a.nodeSize:0))}else{var c=re(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function oe(t,e,n){var r=t.steps.length-1;if(!(r<e)){var o,i=t.steps[r];if(i instanceof Ct||i instanceof Ot)t.mapping.maps[r].forEach((function(t,e,n,r){null==o&&(o=r)})),t.setSelection(Ut.near(t.doc.resolve(o),n))}}var ie=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){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},e.prototype.setSelection=function(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=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return p.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||p.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Ut.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(bt);function se(t,e){return e&&t?t.bind(e):t}var ae=function(t,e,n){this.name=t,this.init=se(e.init,n),this.apply=se(e.apply,n)},ce=[new ae("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new ae("selection",{init:function(t,e){return t.selection||Ut.atStart(e.doc)},apply:function(t){return t.selection}}),new ae("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ae("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],pe=function(t,e){var n=this;this.schema=t,this.fields=ce.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new ae(t.key,t.spec.state,t))}))},le=function(t){this.config=t},he={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};he.schema.get=function(){return this.config.schema},he.plugins.get=function(){return this.config.plugins},le.prototype.apply=function(t){return this.applyTransaction(t).state},le.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0},le.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var s=this.config.plugins[i];if(s.spec.appendTransaction){var a=r?r[i].n:0,c=r?r[i].state:this,p=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,c,n);if(p&&n.filterTransaction(p,i)){if(p.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:e.length}:{state:this,n:0})}e.push(p),n=n.applyInner(p),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}},le.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new le(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}for(var i=0;i<ue.length;i++)ue[i](this,t,e);return e},he.tr.get=function(){return new ie(this)},le.create=function(t){for(var e=new pe(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new le(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},le.prototype.reconfigure=function(t){for(var e=new pe(this.schema,t.plugins),n=e.fields,r=new le(e),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(t,r)}return r},le.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e},le.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new pe(t.schema,t.plugins),o=new le(r);return r.fields.forEach((function(r){if("doc"==r.name)o.doc=I.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Ut.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var i in n){var s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o},le.addApplyListener=function(t){ue.push(t)},le.removeApplyListener=function(t){var e=ue.indexOf(t);e>-1&&ue.splice(e,1)},Object.defineProperties(le.prototype,he);var ue=[];function fe(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=fe(o,e,{})),n[r]=o}return n}var de=function(t){this.props={},t.props&&fe(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:ve("plugin")};de.prototype.getState=function(t){return t[this.key]};var me=Object.create(null);function ve(t){return t in me?t+"$"+ ++me[t]:(me[t]=0,t+"$")}var ge=function(t){void 0===t&&(t="key"),this.key=ve(t)};ge.prototype.get=function(t){return t.config.pluginsByKey[this.key]},ge.prototype.getState=function(t){return t[this.key]};var ye=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};ye.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},ye.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&this.updateOverlay()},ye.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},ye.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,c,p=this.editorView.dom.offsetParent;if(this.element||(this.element=p.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!p||p==document.body&&"static"==getComputedStyle(p).position)a=-pageXOffset,c=-pageYOffset;else{var l=p.getBoundingClientRect();a=l.left-p.scrollLeft,c=l.top-p.scrollTop}this.element.style.left=t.left-a+"px",this.element.style.top=t.top-c+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},ye.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},ye.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(e){var n=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Rt(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},ye.prototype.dragend=function(){this.scheduleRemoval(20)},ye.prototype.drop=function(){this.scheduleRemoval(20)},ye.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};const be=e.Extension.create({name:"dropCursor",defaultOptions:{color:"black",width:1,class:null},addProseMirrorPlugins(){return[(t=this.options,void 0===t&&(t={}),new de({view:function(e){return new ye(e,t)}}))];var t}});for(var we={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"},ke={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"},Se="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),xe="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Me="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ce="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Oe="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Te=Se&&(Ce||+Se[1]<57)||Me&&Ce,Ne=0;Ne<10;Ne++)we[48+Ne]=we[96+Ne]=String(Ne);for(Ne=1;Ne<=24;Ne++)we[Ne+111]="F"+Ne;for(Ne=65;Ne<=90;Ne++)we[Ne]=String.fromCharCode(Ne+32),ke[Ne]=String.fromCharCode(Ne);for(var Ae in we)ke.hasOwnProperty(Ae)||(ke[Ae]=we[Ae]);var De="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function Ee(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a<i.length-1;a++){var c=i[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);De?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ie(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}var Re={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var Pe=/Edge\/(\d+)/.exec(navigator.userAgent),ze=/MSIE \d/.test(navigator.userAgent),Be=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);Re.mac=/Mac/.test(navigator.platform);var Le=Re.ie=!!(ze||Be||Pe);Re.ie_version=ze?document.documentMode||6:Be?+Be[1]:Pe?+Pe[1]:null,Re.gecko=!Le&&/gecko\/(\d+)/i.test(navigator.userAgent),Re.gecko_version=Re.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var Ve=!Le&&/Chrome\/(\d+)/.exec(navigator.userAgent);Re.chrome=!!Ve,Re.chrome_version=Ve&&+Ve[1],Re.safari=!Le&&/Apple Computer/.test(navigator.vendor),Re.ios=Re.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),Re.android=/Android \d/.test(navigator.userAgent),Re.webkit="webkitFontSmoothing"in document.documentElement.style,Re.webkit_version=Re.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var $e=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Fe=function(t){var e=t.parentNode;return e&&11==e.nodeType?e.host:e},_e=null,He=function(t,e,n){var r=_e||(_e=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},je=function(t,e,n,r){return n&&(Je(t,e,n,r,-1)||Je(t,e,n,r,1))},qe=/^(img|br|input|textarea|hr)$/i;function Je(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:We(t))){var i=t.parentNode;if(1!=i.nodeType||Ke(t)||qe.test(t.nodeName)||"false"==t.contentEditable)return!1;e=$e(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?We(t):0}}}function We(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ke(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Ue=function(t){var e=t.isCollapsed;return e&&Re.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Ge(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Xe(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ye(t,e){return"number"==typeof t?t:t[e]}function Qe(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ze(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=Fe(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?Xe(i):Qe(s),p=0,l=0;if(e.top<c.top+Ye(r,"top")?l=-(c.top-e.top+Ye(o,"top")):e.bottom>c.bottom-Ye(r,"bottom")&&(l=e.bottom-c.bottom+Ye(o,"bottom")),e.left<c.left+Ye(r,"left")?p=-(c.left-e.left+Ye(o,"left")):e.right>c.right-Ye(r,"right")&&(p=e.right-c.right+Ye(o,"right")),p||l)if(a)i.defaultView.scrollBy(p,l);else{var h=s.scrollLeft,u=s.scrollTop;l&&(s.scrollTop+=l),p&&(s.scrollLeft+=p);var f=s.scrollLeft-h,d=s.scrollTop-u;e={left:e.left-f,top:e.top-d,right:e.right-f,bottom:e.bottom-d}}if(a)break}}function tn(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=Fe(t));return e}function en(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=r.dom,i=r.top,s=r.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}var nn=null;function rn(t,e){for(var n,r,o=2e8,i=0,s=e.top,a=e.top,c=t.firstChild,p=0;c;c=c.nextSibling,p++){var l=void 0;if(1==c.nodeType)l=c.getClientRects();else{if(3!=c.nodeType)continue;l=He(c).getClientRects()}for(var h=0;h<l.length;h++){var u=l[h];if(u.top<=s&&u.bottom>=a){s=Math.max(u.bottom,s),a=Math.min(u.top,a);var f=u.left>e.left?u.left-e.left:u.right<e.left?e.left-u.right:0;if(f<o){n=c,o=f,r=f&&3==n.nodeType?{left:u.right<e.left?u.right:u.left,top:e.top}:e,1==c.nodeType&&f&&(i=p+(e.left>=(u.left+u.right)/2?1:0));continue}}!n&&(e.left>=u.right&&e.top>=u.top||e.left>=u.left&&e.top>=u.bottom)&&(i=p+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);var i=cn(r,1);if(i.top!=i.bottom&&on(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:rn(n,r)}function on(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function sn(t,e,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var s=t.childNodes[i];if(1==s.nodeType)for(var a=s.getClientRects(),c=0;c<a.length;c++){var p=a[c];if(on(e,p))return sn(s,e,p)}if((i=(i+1)%r)==o)break}return t}function an(t,e){var n,r,o,i,s=t.root;if(s.caretPositionFromPoint)try{var a=s.caretPositionFromPoint(e.left,e.top);a&&(o=(n=a).offsetNode,i=n.offset)}catch(t){}if(!o&&s.caretRangeFromPoint){var c=s.caretRangeFromPoint(e.left,e.top);c&&(o=(r=c).startContainer,i=r.startOffset)}var p,l=s.elementFromPoint(e.left,e.top+1);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){var h=t.dom.getBoundingClientRect();if(!on(e,h))return null;if(!(l=sn(t.dom,e,h)))return null}if(Re.safari&&l.draggable&&(o=i=null),l=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),o){if(Re.gecko&&1==o.nodeType&&(i=Math.min(i,o.childNodes.length))<o.childNodes.length){var u,f=o.childNodes[i];"IMG"==f.nodeName&&(u=f.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?p=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(p=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;o=s.posAfter}}i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==p&&(p=function(t,e,n){var r=rn(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,l,e));var d=t.docView.nearestDesc(l,!0);return{pos:p,inside:d?d.posAtStart-d.border:-1}}function cn(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var pn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ln(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,s=Re.webkit||Re.gecko;if(3==o.nodeType){if(!s||!pn.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var a=i,c=i,p=n<0?1:-1;return n<0&&!i?(c++,p=-1):n>=0&&i==o.nodeValue.length?(a--,p=1):n<0?a--:c++,hn(cn(He(o,a,c),p),p<0)}var l=cn(He(o,i,i),n);if(Re.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var h=cn(He(o,i-1,i-1),-1);if(h.top==l.top){var u=cn(He(o,i,i+1),-1);if(u.top!=l.top)return hn(u,u.left<h.left)}}return l}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==We(o))){var f=o.childNodes[i-1];if(1==f.nodeType)return un(f.getBoundingClientRect(),!1)}if(i<We(o)){var d=o.childNodes[i];if(1==d.nodeType)return un(d.getBoundingClientRect(),!0)}return un(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==We(o))){var m=o.childNodes[i-1],v=3==m.nodeType?He(m,We(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return hn(cn(v,1),!1)}if(i<We(o)){var g=o.childNodes[i],y=3==g.nodeType?He(g,0,s?0:1):1==g.nodeType?g:null;if(y)return hn(cn(y,-1),!0)}return hn(cn(3==o.nodeType?He(o):o,-n),n>=0)}function hn(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function un(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function fn(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var dn=/[\u0590-\u08ac]/;var mn=null,vn=null,gn=!1;function yn(t,e,n){return mn==e&&vn==n?gn:(mn=e,vn=n,gn="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return fn(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=ln(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=He(s,0,s.nodeValue.length).getClientRects()}for(var c=0;c<a.length;c++){var p=a[c];if(p.bottom>p.top&&("up"==n?p.bottom<i.top+1:p.top>i.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return dn.test(r.parent.textContent)&&a.modify?fn(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var bn=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},wn={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};bn.prototype.matchesWidget=function(){return!1},bn.prototype.matchesMark=function(){return!1},bn.prototype.matchesNode=function(){return!1},bn.prototype.matchesHack=function(){return!1},wn.beforePosition.get=function(){return!1},bn.prototype.parseRule=function(){return null},bn.prototype.stopEvent=function(){return!1},wn.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},wn.border.get=function(){return 0},bn.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},bn.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var r=this.children[e];if(r==t)return n;n+=r.size}},wn.posBefore.get=function(){return this.parent.posBeforeChild(this)},wn.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},wn.posAfter.get=function(){return this.posBefore+this.size},wn.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},bn.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,o;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,s;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(s=i.pmViewDesc)||s.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}var a;if(t==this.dom&&this.contentDOM)a=e>$e(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==this.dom){a=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},bn.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},bn.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},bn.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},bn.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}},bn.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,o=!0;;r++,o=!1){for(;r<this.children.length&&(this.children[r].beforePosition||this.children[r].dom.parentNode!=this.contentDOM);)n+=this.children[r++].size;var i=r==this.children.length?null:this.children[r];if(n==t&&(0==e||!i||!i.size||i.border||e<0&&o)||i&&i.domAtom&&t<n+i.size)return{node:this.contentDOM,offset:i?$e(i.dom):this.contentDOM.childNodes.length};if(!i)throw new Error("Invalid position "+t);var s=n+i.size;if(!i.domAtom&&(e<0&&!i.border?s>=t:s>t)&&(s>t||r+1>=this.children.length||!this.children[r+1].beforePosition))return i.domFromPos(t-n-i.border,e);n=s}},bn.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var p=i+a.border;if(t>=p&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,p);t=i;for(var l=s;l>0;l--){var h=this.children[l-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=$e(h.dom)+1;break}t-=h.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var u=s+1;u<this.children.length;u++){var f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=$e(f.dom);break}e+=f.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}},bn.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},bn.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},bn.prototype.setSelection=function(t,e,n,r){for(var o=Math.min(t,e),i=Math.max(t,e),s=0,a=0;s<this.children.length;s++){var c=this.children[s],p=a+c.size;if(o>a&&i<p)return c.setSelection(t-a-c.border,e-a-c.border,n,r);a=p}var l=this.domFromPos(t,t?-1:1),h=e==t?l:this.domFromPos(e,e?-1:1),u=n.getSelection(),f=!1;if((Re.gecko||Re.safari)&&t==e){var d=l.node,m=l.offset;if(3==d.nodeType)(f=m&&"\n"==d.nodeValue[m-1])&&m==d.nodeValue.length&&d.nextSibling&&"BR"==d.nextSibling.nodeName&&(l=h={node:d.parentNode,offset:$e(d)+1});else{var v=d.childNodes[m-1];f=v&&("BR"==v.nodeName||"false"==v.contentEditable)}}if(r||f&&Re.safari||!je(l.node,l.offset,u.anchorNode,u.anchorOffset)||!je(h.node,h.offset,u.focusNode,u.focusOffset)){var g=!1;if((u.extend||t==e)&&!f){u.collapse(l.node,l.offset);try{t!=e&&u.extend(h.node,h.offset),g=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!g){if(t>e){var y=l;l=h,h=y}var b=document.createRange();b.setEnd(h.node,h.offset),b.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(b)}}},bn.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},wn.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},bn.prototype.markDirty=function(t,e){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},bn.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},wn.domAtom.get=function(){return!1},Object.defineProperties(bn.prototype,wn);var kn=[],Sn=function(t){function e(e,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}t.call(this,e,kn,s,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={beforePosition:{configurable:!0},domAtom:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(bn),xn=function(t){function e(e,n,r,o){t.call(this,e,kn,n,null),this.textDOM=r,this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(bn),Mn=function(t){function e(e,n,r,o){t.call(this,e,[],r,o),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o){var i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return s&&s.dom||(s=lt.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,s.dom,s.contentDOM||s.dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,r){var o=e.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=_n(i,n,s,r)),t>0&&(i=_n(i,0,t,r));for(var a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o},e}(bn),Cn=function(t){function e(e,n,r,o,i,s,a,c,p){t.call(this,e,n.isLeaf?kn:[],i,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=o,s&&this.updateChildren(c,p)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,r,o,i,s){var a,c,p=i.nodeViews[n.type.name],l=p&&p(n,i,(function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:s}),r,o),h=l&&l.dom,u=l&&l.contentDOM;if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else h||(h=(a=lt.renderSpec(document,n.type.spec.toDOM(n))).dom,u=a.contentDOM);u||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),n.type.spec.draggable&&(h.draggable=!0));var f=h;return h=Bn(h,r,n),l?c=new An(t,n,r,o,h,u,f,l,i,s+1):n.isText?new Tn(t,n,r,o,h,f,i):new e(t,n,r,o,h,u,f,i,s+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?o.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Ln(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,r=this.node.inlineContent,o=e,i=r&&t.composing&&this.localCompositionNode(t,e),s=new $n(this,i&&i.node);!function(t,e,n,r){var o=e.locals(t),i=0;if(0==o.length){for(var s=0;s<t.childCount;s++){var a=t.child(s);r(a,o,e.forChild(i,a),s),i+=a.nodeSize}return}for(var c=0,p=[],l=null,h=0;;){if(c<o.length&&o[c].to==i){for(var u=o[c++],f=void 0;c<o.length&&o[c].to==i;)(f||(f=[u])).push(o[c++]);if(f){f.sort(Fn);for(var d=0;d<f.length;d++)n(f[d],h,!!l)}else n(u,h,!!l)}var m=void 0,v=void 0;if(l)v=-1,m=l,l=null;else{if(!(h<t.childCount))break;v=h,m=t.child(h++)}for(var g=0;g<p.length;g++)p[g].to<=i&&p.splice(g--,1);for(;c<o.length&&o[c].from<=i&&o[c].to>i;)p.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<p.length;w++)p[w].to<b&&(b=p[w].to);b<y&&(l=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}r(m,p.length?m.isInline&&!m.isLeaf?p.filter((function(t){return!t.inline})):p.slice():kn,e.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(e,i,a){e.spec.marks?s.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!a&&s.syncToMarks(i==n.node.childCount?p.none:n.node.child(i).marks,r,t),s.placeWidget(e,t,o)}),(function(e,n,i,a){s.syncToMarks(e.marks,r,t),s.findNodeMatch(e,n,i,a)||s.updateNextNode(e,n,i,t,a)||s.addNode(e,n,i,t,o),o+=e.nodeSize})),s.syncToMarks(kn,r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),Dn(this.contentDOM,this.children,t),Re.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionNode=function(t,e){var n=t.state.selection,r=n.from,o=n.to;if(!(!(t.state.selection instanceof Yt)||r<e||o>e+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=We(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(i.focusNode,i.focusOffset);if(s&&this.dom.contains(s.parentNode)){var a=s.nodeValue,c=function(t,e,n,r){for(var o=0,i=0;o<t.childCount&&i<=r;){var s=t.child(o++),a=i;if(i+=s.nodeSize,s.isText){for(var c=s.text;o<t.childCount;){var p=t.child(o++);if(i+=p.nodeSize,!p.isText)break;c+=p.text}if(i>=n){var l=c.lastIndexOf(e,r-a);if(l>=0&&l+e.length+a>=n)return a+l}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new xn(this,i,n,o);t.compositionNodes.push(s),this.children=_n(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!Ln(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Pn(this.dom,this.nodeDOM,Rn(this.outerDeco,this.node,e),Rn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(bn);function On(t,e,n,r,o){return Bn(r,e,t),new Cn(null,t,e,n,r,r,r,o,0)}var Tn=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(Cn),Nn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return 0==this.dirty},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(bn),An=function(t){function e(e,n,r,o,i,s,a,c,p,l){t.call(this,e,n,r,o,i,s,a,p,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(Cn);function Dn(t,e,n){for(var r=t.firstChild,o=!1,i=0;i<e.length;i++){var s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Vn(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof Mn){var c=r?r.previousSibling:t.lastChild;Dn(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=Vn(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}function En(t){t&&(this.nodeName=t)}En.prototype=Object.create(null);var In=[new En];function Rn(t,e,n){if(0==t.length)return In;for(var r=n?In[0]:new En,o=[r],i=0;i<t.length;i++){var s=t[i].type.attrs;if(s)for(var a in s.nodeName&&o.push(r=new En(s.nodeName)),s){var c=s[a];null!=c&&(n&&1==o.length&&o.push(r=new En(e.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+c:"style"==a?r.style=(r.style?r.style+";":"")+c:"nodeName"!=a&&(r[a]=c))}}return o}function Pn(t,e,n,r){if(n==In&&r==In)return e;for(var o=e,i=0;i<r.length;i++){var s=r[i],a=n[i];if(i){var c=void 0;a&&a.nodeName==s.nodeName&&o!=t&&(c=o.parentNode)&&c.tagName.toLowerCase()==s.nodeName||((c=document.createElement(s.nodeName)).pmIsDeco=!0,c.appendChild(o),a=In[0]),o=c}zn(o,a||In[0],s)}return o}function zn(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):kn,s=n.class?n.class.split(" ").filter(Boolean):kn,a=0;a<i.length;a++)-1==s.indexOf(i[a])&&t.classList.remove(i[a]);for(var c=0;c<s.length;c++)-1==i.indexOf(s[c])&&t.classList.add(s[c])}if(e.style!=n.style){if(e.style)for(var p,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;p=l.exec(e.style);)t.style.removeProperty(p[1]);n.style&&(t.style.cssText+=n.style)}}function Bn(t,e,n){return Pn(t,t,In,Rn(e,n,1!=t.nodeType))}function Ln(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Vn(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var $n=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(t,e){for(var n=t.childCount,r=e.length,o=new Map;n>0&&r>0;r--){var i=e[r-1],s=i.node;if(s){if(s!=t.child(n-1))break;--n,o.set(i,n)}}return{index:n,matched:o}}(t.node.content,t.children)};function Fn(t,e){return t.type.side-e.type.side}function _n(t,e,n,r,o){for(var i=[],s=0,a=0;s<t.length;s++){var c=t[s],p=a,l=a+=c.size;p>=n||l<=e?i.push(c):(p<e&&i.push(c.slice(0,e-p,r)),o&&(i.push(o),o=null),l>n&&i.push(c.slice(n-p,c.size,r)))}return i}function Hn(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(s<0)return null;var a,c,p=r.resolve(s);if(Ue(n)){for(a=p;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&Zt.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(t,e,n){for(var r=0==e,o=e==We(t);r||o;){if(t==n)return!0;var i=$e(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==We(t)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new Zt(s==l?p:r.resolve(l))}}else{var h=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(h<0)return null;a=r.resolve(h)}c||(c=Yn(t,a,p,"pointer"==e||t.state.selection.head<p.pos&&!i?1:-1));return c}function jn(t){return t.editable?t.hasFocus():Qn(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function qn(t,e){var n=t.state.selection;if(Gn(t,n),jn(t)){if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,$e(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Re.ie&&Re.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{var r,o,i=n.anchor,s=n.head;!Jn||n instanceof Yt||(n.$from.parent.inlineContent||(r=Wn(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=Wn(t,n.to))),t.docView.setSelection(i,s,t.root,e),Jn&&(r&&Un(r),o&&Un(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout((function(){jn(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}$n.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},$n.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},$n.prototype.syncToMarks=function(t,e,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,t.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);for(var s=-1,a=this.index;a<Math.min(this.index+3,this.top.children.length);a++)if(this.top.children[a].matchesMark(t[o])){s=a;break}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=Mn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},$n.prototype.findNodeMatch=function(t,e,n,r){var o=this.top.children,i=-1;if(r>=this.preMatch.index){for(var s=this.index;s<o.length;s++)if(o[s].matchesNode(t,e,n)){i=s;break}}else for(var a=this.index,c=Math.min(o.length,a+1);a<c;a++){var p=o[a];if(p.matchesNode(t,e,n)&&!this.preMatch.matched.has(p)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},$n.prototype.updateNextNode=function(t,e,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var s=this.top.children[i];if(s instanceof Cn){var a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Ln(e,s.outerDeco)))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},$n.prototype.addNode=function(t,e,n,r,o){this.top.children.splice(this.index++,0,Cn.create(this.top,t,e,n,r,o)),this.changed=!0},$n.prototype.placeWidget=function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Sn(this.top,t,e,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},$n.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof Mn;)t=t.children[t.children.length-1];if(!t||!(t instanceof Tn)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new Nn(this.top,kn,e,null)),this.changed=!0}};var Jn=Re.safari||Re.chrome&&Re.chrome_version<63;function Wn(t,e){var n=t.docView.domFromPos(e,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,s=o?r.childNodes[o-1]:null;if(Re.safari&&i&&"false"==i.contentEditable)return Kn(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return Kn(i);if(s)return Kn(s)}}function Kn(t){return t.contentEditable="true",Re.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Un(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Gn(t,e){if(e instanceof Zt){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Xn(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Xn(t)}function Xn(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function Yn(t,e,n,r){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||Yt.between(e,n,r)}function Qn(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Zn(t,e){var n=t.selection,r=n.$anchor,o=n.$head,i=e>0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Ut.findFrom(s,e)}function tr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function er(t,e,n){var r=t.state.selection;if(!(r instanceof Yt)){if(r instanceof Zt&&r.node.isInline)return tr(t,new Yt(e>0?r.$to:r.$from));var o=Zn(t.state,e);return!!o&&tr(t,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=Zn(t.state,e);return!!(i&&i instanceof Zt)&&tr(t,i)}if(!(Re.mac&&n.indexOf("m")>-1)){var s,a=r.$head,c=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!c||c.isText)return!1;var p=e<0?a.pos-c.nodeSize:a.pos;return!!(c.isAtom||(s=t.docView.descAt(p))&&!s.contentDOM)&&(Zt.isSelectable(c)?tr(t,new Zt(e<0?t.state.doc.resolve(a.pos-c.nodeSize):a)):!!Re.webkit&&tr(t,new Yt(t.state.doc.resolve(e<0?p:p+c.nodeSize))))}}function nr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function rr(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function or(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(Re.gecko&&1==n.nodeType&&r<nr(n)&&rr(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(rr(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(sr(n))break;for(var c=n.previousSibling;c&&rr(c);)o=n.parentNode,i=$e(c),c=c.previousSibling;if(c)r=nr(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?ar(t,e,n,r):o&&ar(t,e,o,i)}}function ir(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=nr(n);;)if(r<s){if(1!=n.nodeType)break;if(!rr(n.childNodes[r]))break;o=n,i=++r}else{if(sr(n))break;for(var a=n.nextSibling;a&&rr(a);)o=a.parentNode,i=$e(a)+1,a=a.nextSibling;if(a)r=0,s=nr(n=a);else{if((n=n.parentNode)==t.dom)break;r=s=0}}o&&ar(t,e,o,i)}}function sr(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function ar(t,e,n,r){if(Ue(e)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),e.removeAllRanges(),e.addRange(o)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&qn(t)}),50)}function cr(t,e,n){var r=t.state.selection;if(r instanceof Yt&&!r.empty||n.indexOf("s")>-1)return!1;if(Re.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=Zn(t.state,e);if(s&&s instanceof Zt)return tr(t,s)}if(!o.parent.inlineContent){var a=e<0?o:i,c=r instanceof ee?Ut.near(a,e):Ut.findFrom(a,e);return!!c&&tr(t,c)}return!1}function pr(t,e){if(!(t.state.selection instanceof Yt))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function lr(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function hr(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Re.mac&&72==n&&"c"==r?pr(t,-1)||or(t):46==n||Re.mac&&68==n&&"c"==r?pr(t,1)||ir(t):13==n||27==n||(37==n?er(t,-1,r)||or(t):39==n?er(t,1,r)||ir(t):38==n?cr(t,-1,r)||or(t):40==n?function(t){if(Re.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;lr(t,o,!0),setTimeout((function(){return lr(t,o,!1)}),20)}}}(t)||cr(t,1,r)||ir(t):r==(Re.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function ur(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Re.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||Re.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function fr(t,e,n,r,i){if(e<0){var s=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=Hn(t,s);if(a&&!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),t.dispatch(c)}}else{var p=t.state.doc.resolve(e),l=p.sharedDepth(n);e=p.before(l+1),n=t.state.doc.resolve(n).after(l+1);var h=t.state.selection,u=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,p=t.root.getSelection(),l=null,h=p.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(l=[{node:h,offset:p.anchorOffset}],Ue(p)||l.push({node:p.focusNode,offset:p.focusOffset})),Re.chrome&&8===t.lastKeyCode)for(var u=s;u>i;u--){var f=o.childNodes[u-1],d=f.pmViewDesc;if("BR"==f.nodeType&&!d){s=u;break}if(!d||d.size)break}var m=t.state.doc,v=t.someProp("domParser")||Z.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:!g.parent.type.spec.code||"full",editableContent:!0,findPositions:l,ruleFromNode:ur,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,k=l[1]&&l[1].pos;null==k&&(k=w),y={anchor:w+a,head:k+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n);if(Re.chrome&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,d=f&&f.nodeValue?f.nodeValue.length:1;u.sel={anchor:u.sel.anchor+d,head:u.sel.anchor+d}}var m,v,g=t.state.doc,y=g.slice(u.from,u.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(m=t.state.selection.to,v="end"):(m=t.state.selection.from,v="start"),t.lastKeyCode=null;var b=function(t,e,n,r,o){var i=t.findDiffStart(e,n);if(null==i)return null;var s=t.findDiffEnd(e,n+t.size,n+e.size),a=s.a,c=s.b;if("end"==o){r-=a+Math.max(0,i-Math.min(a,c))-i}if(a<i&&t.size<e.size){c=(i-=r<=i&&r>=a?i-r:0)+(c-a),a=i}else if(c<i){a=(i-=r<=i&&r>=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,u.doc.content,u.from,m,v);if(!b){if(!(r&&h instanceof Yt&&!h.empty&&h.$head.sameParent(h.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(Re.ios&&t.lastIOSEnter>Date.now()-225&&i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,Ge(13,"Enter"))})))return void(t.lastIOSEnter=0);if(u.sel){var w=dr(t,t.state.doc,u.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:h.from,endA:h.to,endB:h.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof Yt&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),Re.ie&&Re.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>u.from&&" "==u.doc.textBetween(b.start-u.from-1,b.start-u.from+1)&&(b.start--,b.endA--,b.endB--);var k,S=u.doc.resolveNoCache(b.start-u.from),x=u.doc.resolveNoCache(b.endB-u.from),M=S.sameParent(x)&&S.parent.inlineContent;if((Re.ios&&t.lastIOSEnter>Date.now()-225&&(!M||i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!M&&S.pos<u.doc.content.size&&(k=Ut.findFrom(u.doc.resolve(S.pos+1),1,!0))&&k.head==x.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Ge(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||mr(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(mr(i,!0,!0));if(!s.parent.isTextblock||s.pos>n||mr(s,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(g,b.start,b.endA,S,x)&&t.someProp("handleKeyDown",(function(e){return e(t,Ge(8,"Backspace"))})))Re.android&&Re.chrome&&t.domObserver.suppressSelectionUpdates();else{Re.android&&!M&&S.start()!=x.start()&&0==x.parentOffset&&S.depth==x.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==b.endA&&(b.endB-=2,x=u.doc.resolveNoCache(b.endB-u.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Ge(13,"Enter"))}))}),20));var C,O,T,N,A=b.start,D=b.endA;if(M)if(S.pos==x.pos)Re.ie&&Re.ie_version<=11&&0==S.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return qn(t)}),20)),C=t.state.tr.delete(A,D),O=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(N=g.resolve(b.start))&&(T=function(t,e){for(var n,r,i,s=t.firstChild.marks,a=e.firstChild.marks,c=s,p=a,l=0;l<a.length;l++)c=a[l].removeFromSet(c);for(var h=0;h<s.length;h++)p=s[h].removeFromSet(p);if(1==c.length&&0==p.length)r=c[0],n="add",i=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=c.length||1!=p.length)return null;r=p[0],n="remove",i=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var u=[],f=0;f<e.childCount;f++)u.push(i(e.child(f)));if(o.from(u).eq(t))return{mark:r,type:n}}(S.parent.content.cut(S.parentOffset,x.parentOffset),N.parent.content.cut(N.parentOffset,b.endA-N.start()))))C=t.state.tr,"add"==T.type?C.addMark(A,D,T.mark):C.removeMark(A,D,T.mark);else if(S.parent.child(S.index()).isText&&S.index()==x.index()-(x.textOffset?0:1)){var E=S.parent.textBetween(S.parentOffset,x.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,A,D,E)})))return;C=t.state.tr.insertText(E,A,D)}if(C||(C=t.state.tr.replace(A,D,u.doc.slice(b.start-u.from,b.endB-u.from))),u.sel){var I=dr(t,C.doc,u.sel);I&&!(Re.chrome&&Re.android&&t.composing&&I.empty&&(I.head==A||I.head==C.mapping.map(D)-1)||Re.ie&&I.empty&&I.head==A)&&C.setSelection(I)}O&&C.ensureMarks(O),t.dispatch(C.scrollIntoView())}}}function dr(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Yn(t,e.resolve(n.anchor),e.resolve(n.head))}function mr(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function vr(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||lt.fromSchema(t.state.schema),c=Mr(),p=c.createElement("div");p.appendChild(a.serializeFragment(r,{document:c}));for(var l,h=p.firstChild;h&&1==h.nodeType&&(l=Sr[h.nodeName.toLowerCase()]);){for(var u=l.length-1;u>=0;u--){for(var f=c.createElement(l[u]);p.firstChild;)f.appendChild(p.firstChild);p.appendChild(f)}h=p.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:p,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function gr(t,e,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!e)return null;var p=e&&(r||c||!n);if(p){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return new h(o.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0);var l=t.someProp("clipboardTextParser",(function(t){return t(e,i,r)}));l?a=l:(s=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){s.appendChild(document.createElement("p")).textContent=t})))}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=Mr().createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),i=0;(n=o&&Sr[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""),i=n.length);r.innerHTML=t;for(var s=0;s<i;s++)r=r.firstChild;return r}(n);var u=s&&s.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+) (.*)/.exec(u.getAttribute("data-pm-slice"));if(!a){var d=t.someProp("clipboardParser")||t.someProp("domParser")||Z.fromSchema(t.state.schema);a=d.parseSlice(s,{preserveWhitespace:!(!p&&!f),context:i})}return a=f?function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var i=t.content,s=t.openStart,a=t.openEnd,c=n.length-2;c>=0;c-=2){var p=r.nodes[n[c]];if(!p||p.hasRequiredAttrs())break;i=o.from(p.create(n[c+1],i)),s++,a++}return new h(i,s,a)}(function(t,e,n){e<t.openStart&&(t=new h(kr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd));n<t.openEnd&&(t=new h(kr(t.content,1,n,t.openEnd,0,0),t.openStart,n));return t}(a,+f[1],+f[2]),f[3]):h.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),i=void 0,s=[];if(t.forEach((function(t){if(s){var e,n=r.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&i.length&&br(n,i,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=wr(s[s.length-1],i.length));var o=yr(t,n);s.push(o),r=r.matchType(o.type,o.attrs),i=n}}})),s)return{v:o.from(s)}},r=e.depth;r>=0;r--){var i=n(r);if(i)return i.v}return t}(a.content,i),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function yr(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,o.from(t));return t}function br(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){var s=br(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(o.from(yr(n,t,i+1))))}}function wr(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,wr(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(o.empty,!0);return t.copy(n.append(r))}function kr(t,e,n,r,i,s){var a=e<0?t.firstChild:t.lastChild,c=a.content;return i<r-1&&(c=kr(c,e,n,r,i+1,s)),i>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}var Sr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},xr=null;function Mr(){return xr||(xr=document.implementation.createHTMLDocument("title"))}var Cr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Or=Re.ie&&Re.ie_version<=11,Tr=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Tr.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},Tr.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Nr=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);Re.ie&&Re.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new Tr,Or&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Nr.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},Nr.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Nr.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Cr),Or&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Nr.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}Or&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Nr.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Nr.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Nr.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},Nr.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&Qn(t)){var t;if(this.suppressingSelectionUpdates)return qn(this.view);if(Re.ie&&Re.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&je(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},Nr.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Nr.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},Nr.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Qn(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(var a=0;a<t.length;a++){var c=this.registerMutation(t[a],s);c&&(r=r<0?c.from:Math.min(c.from,r),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(i=!0))}if(Re.gecko&&s.length>1){var p=s.filter((function(t){return"BR"==t.nodeName}));if(2==p.length){var l=p[0],h=p[1];l.parentNode&&l.parentNode.parentNode==h.parentNode?h.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(Ar)return;Ar=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||qn(this.view),this.currentSelection.set(e))}},Nr.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var r=t.previousSibling,o=t.nextSibling;if(Re.ie&&Re.ie_version<=11&&t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){var s=t.addedNodes[i],a=s.previousSibling,c=s.nextSibling;(!a||Array.prototype.indexOf.call(t.addedNodes,a)<0)&&(r=a),(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(o=c)}for(var p=r&&r.parentNode==t.target?$e(r)+1:0,l=n.localPosFromDOM(t.target,p,-1),h=o&&o.parentNode==t.target?$e(o):t.target.childNodes.length,u=0;u<t.addedNodes.length;u++)e.push(t.addedNodes[u]);return{from:l,to:n.localPosFromDOM(t.target,h,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var Ar=!1;var Dr={},Er={};function Ir(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function Rr(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return Pr(t,e)})}))}function Pr(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function zr(t){return{left:t.clientX,top:t.clientY}}function Br(t,e,n,r,o){if(-1==r)return!1;for(var i=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,(function(e){return r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function Lr(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Vr(t,e,n,r,o){return Br(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof Zt&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(Zt.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(Lr(t,Zt.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Zt.isSelectable(r))&&(Lr(t,new Zt(n),"pointer"),!0)}(t,n))}function $r(t,e,n,r){return Br(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Fr(t,e,n,r){return Br(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e){var n=t.state.doc;if(-1==e)return!!n.inlineContent&&(Lr(t,Yt.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),o=r.depth+1;o>0;o--){var i=o>r.depth?r.nodeAfter:r.node(o),s=r.before(o);if(i.inlineContent)Lr(t,Yt.create(n,s+1,s+1+i.content.size),"pointer");else{if(!Zt.isSelectable(i))continue;Lr(t,Zt.create(n,s),"pointer")}return!0}}(t,n)}function _r(t){return Ur(t)}Er.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!qr(t,e))if(t.domObserver.forceFlush(),t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!Re.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||hr(t,e)?e.preventDefault():Ir(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,Ge(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},Er.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},Er.keypress=function(t,e){if(!(qr(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||Re.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof Yt&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var Hr=Re.mac?"metaKey":"ctrlKey";Dr.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=_r(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[Hr]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(zr(e));i&&("singleClick"==o?t.mouseDown=new jr(t,i,e,n):("doubleClick"==o?$r:Fr)(t,i.pos,i.inside,e)?e.preventDefault():Ir(t,"pointer"))};var jr=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[Hr],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,p=c?t.docView.nearestDesc(c,!0):null;this.target=p?p.dom:null,(o.type.spec.draggable&&!1!==o.type.spec.selectable||t.state.selection instanceof Zt&&i==t.state.selection.from)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&Re.gecko&&!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((function(){return s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ir(t,"pointer")};function qr(t,e){return!!t.composing||!!(Re.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}jr.prototype.done=function(){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.view.mouseDown=null},jr.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(zr(t))),this.allowDefault||!e?Ir(this.view,"pointer"):Vr(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():this.flushed||Re.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||Re.chrome&&!(this.view.state.selection instanceof Yt)&&(e.pos==this.view.state.selection.from||e.pos==this.view.state.selection.to)?(Lr(this.view,Ut.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Ir(this.view,"pointer")}},jr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),Ir(this.view,"pointer")},Dr.touchdown=function(t){_r(t),Ir(t,"pointer")},Dr.contextmenu=function(t){return _r(t)};var Jr=Re.android?5e3:-1;function Wr(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Ur(t)}),e))}function Kr(t){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Ur(t,e){if(t.domObserver.forceFlush(),Kr(t),e||t.docView.dirty){var n=Hn(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}Er.compositionstart=Er.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Ur(t,!0),t.markCursor=null;else if(Ur(t),Re.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}Wr(t,Jr)},Er.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,Wr(t,20))};var Gr=Re.ie&&Re.ie_version<15||Re.ios&&Re.webkit_version<604;function Xr(t,e,n,r){var o=gr(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,o||h.empty)})))return!0;if(!o)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Dr.copy=Er.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=Gr?null:e.clipboardData,i=vr(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Er.paste=function(t,e){var n=Gr?null:e.clipboardData;n&&Xr(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xr(t,r.value,null,e):Xr(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)};var Yr=function(t,e){this.slice=t,this.move=e},Qr=Re.mac?"altKey":"ctrlKey";for(var Zr in Dr.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(zr(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof Zt?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(Zt.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);if(!i||!i.node.type.spec.draggable||i==t.docView)return;t.dispatch(t.state.tr.setSelection(Zt.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=vr(t,s),c=a.dom,p=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(Gr?"Text":"text/html",c.innerHTML),Gr||e.dataTransfer.setData("text/plain",p),t.dragging=new Yr(s,!e[Qr])}},Dr.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},Er.dragover=Er.dragenter=function(t,e){return e.preventDefault()},Er.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(zr(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice||gr(t,e.dataTransfer.getData(Gr?"Text":"text/plain"),Gr?null:e.dataTransfer.getData("text/html"),!1,o),s=n&&!e[Qr];if(t.someProp("handleDrop",(function(n){return n(t,e,i||h.empty,s)})))e.preventDefault();else if(i){e.preventDefault();var a=i?Rt(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);var c=t.state.tr;s&&c.deleteSelection();var p=c.mapping.map(a),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=c.doc;if(l?c.replaceRangeWith(p,p,i.content.firstChild):c.replaceRange(p,p,i),!c.doc.eq(u)){var f=c.doc.resolve(p);if(l&&Zt.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Zt(f));else{var d=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return d=r})),c.setSelection(Yn(t,f,c.doc.resolve(d)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},Dr.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&qn(t)}),20))},Dr.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},Dr.beforeinput=function(t,e){if(Re.chrome&&Re.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Ge(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},Er)Dr[Zr]=Er[Zr];function to(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var eo=function(t,e){this.spec=e||ao,this.side=this.spec.side||0,this.toDOM=t};eo.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new oo(i-n,i-n,this)},eo.prototype.valid=function(){return!0},eo.prototype.eq=function(t){return this==t||t instanceof eo&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&to(this.spec,t.spec))};var no=function(t,e){this.spec=e||ao,this.attrs=t};no.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new oo(o,i,this)},no.prototype.valid=function(t,e){return e.from<e.to},no.prototype.eq=function(t){return this==t||t instanceof no&&to(this.attrs,t.attrs)&&to(this.spec,t.spec)},no.is=function(t){return t.type instanceof no};var ro=function(t,e){this.spec=e||ao,this.attrs=t};ro.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new oo(o.pos-n,i.pos-n,this)},ro.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,o=n.offset;return o==e.from&&o+t.child(r).nodeSize==e.to},ro.prototype.eq=function(t){return this==t||t instanceof ro&&to(this.attrs,t.attrs)&&to(this.spec,t.spec)};var oo=function(t,e,n){this.from=t,this.to=e,this.type=n},io={spec:{configurable:!0},inline:{configurable:!0}};oo.prototype.copy=function(t,e){return new oo(t,e,this.type)},oo.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},oo.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},oo.widget=function(t,e,n){return new oo(t,t,new eo(e,n))},oo.inline=function(t,e,n,r){return new oo(t,e,new no(n,r))},oo.node=function(t,e,n,r){return new oo(t,e,new ro(n,r))},io.spec.get=function(){return this.type.spec},io.inline.get=function(){return this.type instanceof no},Object.defineProperties(oo.prototype,io);var so=[],ao={},co=function(t,e){this.local=t&&t.length?t:so,this.children=e&&e.length?e:so};co.create=function(t,e){return e.length?mo(e,t,0,ao):po},co.prototype.find=function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r},co.prototype.findInner=function(t,e,n,r,o){for(var i=0;i<this.local.length;i++){var s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>t){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},co.prototype.map=function(t,e,n){return this==po||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ao)},co.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;s<this.local.length;s++){var a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){for(var a=t.slice(),c=function(t,e,n,r){for(var s=0;s<a.length;s+=3){var c=a[s+1],p=void 0;-1==c||t>c+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(p=r-n-(e-t))&&(a[s]+=p,a[s+1]+=p))}},p=0;p<n.maps.length;p++)n.maps[p].forEach(c);for(var l=!1,h=0;h<a.length;h+=3)if(-1==a[h+1]){var u=n.map(t[h]+i),f=u-o;if(f<0||f>=r.content.size){l=!0;continue}var d=n.map(t[h+1]+i,-1)-o,m=r.content.findIndex(f),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==f&&g+y.nodeSize==d){var b=a[h+2].mapInner(n,y,u+1,t[h]+i+1,s);b!=po?(a[h]=f,a[h+1]=d,a[h+2]=b):(a[h+1]=-2,l=!0)}else l=!0}if(l){var w=mo(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;i<t.local.length;i++){var c=t.local[i].map(r,o,e);c?n.push(c):s.onRemove&&s.onRemove(t.local[i].spec)}for(var p=0;p<t.children.length;p+=3)a(t.children[p+2],t.children[p]+e+1)}for(var c=0;c<t.length;c+=3)-1==t[c+1]&&a(t[c+2],e[c]+i+1);return n}(a,t,e||[],n,o,i,s),r,0,s);e=w.local;for(var k=0;k<a.length;k+=3)a[k+1]<0&&(a.splice(k,3),k-=3);for(var S=0,x=0;S<w.children.length;S+=3){for(var M=w.children[S];x<a.length&&a[x]<M;)x+=3;a.splice(x,0,w.children[S],w.children[S+1],w.children[S+2])}}return new co(e&&e.sort(vo),a)}(this.children,i,t,e,n,r,o):i?new co(i.sort(vo)):po},co.prototype.add=function(t,e){return e.length?this==po?co.create(t,e):this.addInner(t,e,0):this},co.prototype.addInner=function(t,e,n){var r,o=this,i=0;t.forEach((function(t,s){var a,c=s+n;if(a=uo(e,t,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(t,a,c+1):r.splice(i,0,s,s+t.nodeSize,mo(a,t,c+1,ao)),i+=3}}));for(var s=ho(i?fo(e):e,-n),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new co(s.length?this.local.concat(s).sort(vo):this.local,r||this.children)},co.prototype.remove=function(t){return 0==t.length||this==po?this:this.removeInner(t,0)},co.prototype.removeInner=function(t,e){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,s=n[o]+e,a=n[o+1]+e,c=0,p=void 0;c<t.length;c++)(p=t[c])&&p.from>s&&p.to<a&&(t[c]=null,(i||(i=[])).push(p));if(i){n==this.children&&(n=this.children.slice());var l=n[o+2].removeInner(i,s+1);l!=po?n[o+2]=l:(n.splice(o,3),o-=3)}}if(r.length)for(var h=0,u=void 0;h<t.length;h++)if(u=t[h])for(var f=0;f<r.length;f++)r[f].eq(u,e)&&(r==this.local&&(r=this.local.slice()),r.splice(f--,1));return n==this.children&&r==this.local?this:r.length||n.length?new co(r,n):po},co.prototype.forChild=function(t,e){if(this==po)return this;if(e.isLeaf)return co.empty;for(var n,r,o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;a<this.local.length;a++){var c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof no){var p=Math.max(i,c.from)-i,l=Math.min(s,c.to)-i;p<l&&(r||(r=[])).push(c.copy(p,l))}}if(r){var h=new co(r.sort(vo));return n?new lo([h,n]):h}return n||po},co.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof co)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},co.prototype.locals=function(t){return go(this.localsInner(t))},co.prototype.localsInner=function(t){if(this==po)return so;if(t.inlineContent||!this.local.some(no.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof no||e.push(this.local[n]);return e};var po=new co;co.empty=po,co.removeOverlap=go;var lo=function(t){this.members=t};function ho(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new oo(o.from+e,o.to+e,o.type))}return n}function uo(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,o=null,i=0,s=void 0;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function fo(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function mo(t,e,n,r){var o=[],i=!1;e.forEach((function(e,s){var a=uo(t,e,s+n);if(a){i=!0;var c=mo(a,e,n+s+1,r);c!=po&&o.push(s,s+e.nodeSize,c)}}));for(var s=ho(i?fo(t):t,-n).sort(vo),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new co(s,o):po}function vo(t,e){return t.from-e.from||t.to-e.to}function go(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),yo(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),yo(e,o+1,i.copy(r.to,i.to)))}}return e}function yo(t,e,n){for(;e<t.length&&vo(n,t[e])>0;)e++;t.splice(e,0,n)}function bo(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=po&&e.push(r)})),t.cursorWrapper&&e.push(co.create(t.state.doc,[t.cursorWrapper.deco])),lo.from(e)}lo.prototype.forChild=function(t,e){if(e.isLeaf)return co.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(t,e);o!=po&&(o instanceof lo?n=n.concat(o.members):n.push(o))}return lo.from(n)},lo.prototype.eq=function(t){if(!(t instanceof lo)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},lo.prototype.locals=function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<o.length;i++)e.push(o[i])}else e=o}return e?go(n?e:e.sort(vo)):so},lo.from=function(t){switch(t.length){case 0:return po;case 1:return t[0];default:return new lo(t)}};var wo=function(t,e){this._props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Mo(this),this.markCursor=null,this.cursorWrapper=null,xo(this),this.nodeViews=Co(this),this.docView=On(this.state.doc,So(this),bo(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new Nr(t,(function(e,n,r,o){return fr(t,e,n,r,o)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=Dr[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||Pr(t,e)||!t.editable&&e.type in Er||n(t,e)})};for(var n in Dr)e(n);Re.safari&&t.dom.addEventListener("input",(function(){return null})),Rr(t)}(this),this.pluginViews=[],this.updatePluginViews()},ko={props:{configurable:!0},root:{configurable:!0}};function So(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e.class+=" "+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))})),[oo.node(0,t.state.doc.content.size,e)]}function xo(t){if(t.markCursor){var e=document.createElement("img");e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:oo.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Mo(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function Co(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}ko.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},wo.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Rr(this),this._props=t,this.updateStateInner(t.state,!0)},wo.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)},wo.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},wo.prototype.updateStateInner=function(t,e){var n=this,r=this.state,o=!1,i=!1;if(t.storedMarks&&this.composing&&(Kr(this),i=!0),this.state=t,e){var s=Co(this);(function(t,e){var n=0,r=0;for(var o in t){if(t[o]!=e[o])return!0;n++}for(var i in e)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,o=!0),Rr(this)}this.editable=Mo(this),xo(this);var a=bo(this),c=So(this),p=e?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(t.doc,c,a);!l&&t.selection.eq(r.selection)||(i=!0);var h,u,f,d,m,v,g,y,b,w,k,S="preserve"==p&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=t.root.elementFromPoint(i,s);if(a!=t.dom&&t.dom.contains(a)){var c=a.getBoundingClientRect();if(c.top>=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:tn(t.dom)}}(this);if(i){this.domObserver.stop();var x=l&&(Re.ie||Re.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(d=r.selection,m=t.selection,v=Math.min(d.$anchor.sharedDepth(d.head),m.$anchor.sharedDepth(m.head)),d.$anchor.start(v)!=m.$anchor.start(v));if(l){var M=Re.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=On(t.doc,c,a,this.dom,this)),M&&!this.trackWrites&&(x=!0)}x||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(h=this,u=h.docView.domFromPos(h.state.selection.anchor,0),f=h.root.getSelection(),je(u.node,u.offset,f.anchorNode,f.anchorOffset)))?qn(this,x):(Gn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var C=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof Zt?Ze(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),C):Ze(this,this.coordsAtPos(t.selection.head,1),C))}else S&&(y=(g=S).refDOM,b=g.refTop,w=g.stack,k=y?y.getBoundingClientRect().top:0,en(w,0==k?0:k-b))},wo.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},wo.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},wo.prototype.someProp=function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var s=o[i].props[t];if(null!=s&&(n=e?e(s):s))return n}},wo.prototype.hasFocus=function(){return this.root.activeElement==this.dom},wo.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(nn)return t.focus(nn);var e=tn(t);t.focus(null==nn?{get preventScroll(){return nn={preventScroll:!0},!0}}:void 0),nn||(nn=!1,en(e,0))}(this.dom),qn(this),this.domObserver.start()},ko.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},wo.prototype.posAtCoords=function(t){return an(this,t)},wo.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),ln(this,t,e)},wo.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},wo.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},wo.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},wo.prototype.endOfTextblock=function(t,e){return yn(this,e||this.state,t)},wo.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},wo.prototype.dispatchEvent=function(t){return function(t,e){Pr(t,e)||!Dr[e.type]||!t.editable&&e.type in Er||Dr[e.type](t,e)}(this,t)},wo.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(wo.prototype,ko);var Oo=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return h.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new To(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e);if(0!=n)for(var r=t.node(e).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;;){var p=n>0?i.firstChild:i.lastChild;if(!p){if(i.isAtom&&!i.isText&&!Zt.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue t}break}i=p,o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null}},e}(Ut);Oo.prototype.visible=!1,Ut.jsonID("gapcursor",Oo);var To=function(t){this.pos=t};To.prototype.map=function(t){return new To(t.map(this.pos))},To.prototype.resolve=function(t){var e=t.resolve(this.pos);return Oo.valid(e)?new Oo(e):Ut.near(e)};var No,Ao,Do=(No={ArrowLeft:Eo("horiz",-1),ArrowRight:Eo("horiz",1),ArrowUp:Eo("vert",-1),ArrowDown:Eo("vert",1)},Ao=function(t){var e=Object.create(null);for(var n in t)e[Ee(n)]=t[n];return e}(No),function(t,e){var n,r=function(t){var e=!(Te&&(t.ctrlKey||t.altKey||t.metaKey)||(xe||Oe)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?ke:we)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=1==r.length&&" "!=r,i=Ao[Ie(r,e,!o)];if(i&&i(t.state,t.dispatch,t))return!0;if(o&&(e.shiftKey||e.altKey||e.metaKey||r.charCodeAt(0)>127)&&(n=we[e.keyCode])&&n!=r){var s=Ao[Ie(n,e,!0)];if(s&&s(t.state,t.dispatch,t))return!0}else if(o&&e.shiftKey){var a=Ao[Ie(r,e,!0)];if(a&&a(t.state,t.dispatch,t))return!0}return!1});function Eo(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof Yt){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=Oo.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new Oo(c))),!0)}}function Io(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Oo.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&Zt.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new Oo(r))),!0)}function Ro(t){if(!(t.selection instanceof Oo))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",co.create(t.doc,[oo.widget(t.selection.head,e,{key:"gapcursor"})])}const Po=e.Extension.create({name:"gapCursor",addProseMirrorPlugins:()=>[new de({props:{decorations:Ro,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Oo.valid(n))return new Oo(n)},handleClick:Io,handleKeyDown:Do}})],extendNodeSchema(t){var n;const r={options:t.options};return{allowGapCursor:null!==(n=e.callOrReturn(t.config.allowGapCursor,r))&&void 0!==n?n:null}}}),zo=e.Node.create({name:"doc",topNode:!0,content:"block+"}),Bo=e.Node.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setParagraph:()=>({commands:t})=>t.toggleNode("paragraph","paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Lo=e.Node.create({name:"text",group:"inline"});var Vo=200,$o=function(){};$o.prototype.append=function(t){return t.length?(t=$o.from(t),!this.length&&t||t.length<Vo&&this.leafAppend(t)||this.length<Vo&&t.leafPrepend(this)||this.appendInner(t)):this},$o.prototype.prepend=function(t){return t.length?$o.from(t).append(this):this},$o.prototype.appendInner=function(t){return new _o(this,t)},$o.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?$o.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},$o.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},$o.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},$o.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},$o.from=function(t){return t instanceof $o?t:t&&t.length?new Fo(t):$o.empty};var Fo=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Vo)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Vo)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}($o);$o.empty=new Fo([]);var _o=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}($o),Ho=$o,jo=function(t,e){this.items=t,this.eventCount=e};jo.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,p=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void l.push(t);if(r){l.push(new qo(t.map));var h,u=t.step.map(r.slice(o));u&&c.maybeStep(u).doc&&(h=c.mapping.maps[c.mapping.maps.length-1],p.push(new qo(h,null,null,p.length+l.length))),o--,h&&r.appendMap(h,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new jo(n.items.slice(0,i).append(l.reverse().concat(p)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},jo.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var p,l=t.steps[c].invert(t.docs[c]),h=new qo(t.mapping.maps[c],l,e);(p=a&&a.merge(h))&&(h=p,c?o.pop():s=s.slice(0,s.length-1)),o.push(h),e&&(i++,e=null),r||(a=h)}var u,f,d,m=i-n.depth;return m>Wo&&(f=m,(u=s).forEach((function(t,e){if(t.selection&&0==f--)return d=e,!1})),s=u.slice(d),i-=m),new jo(s.append(o),i)},jo.prototype.remapping=function(t,e){var n=new gt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},jo.prototype.addMaps=function(t){return 0==this.eventCount?this:new jo(this.items.append(t.map((function(t){return new qo(t)}))),this.eventCount)},jo.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var p=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new qo(c,p,l))}else n.push(new qo(c))}}),r);for(var c=[],p=e;p<i;p++)c.push(new qo(o.maps[p]));var l=this.items.slice(0,r).append(c).append(n),h=new jo(l,s);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h},jo.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},jo.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var p=i.selection&&i.selection.map(e.slice(n));p&&o++;var l,h=new qo(c.invert(),a,p),u=r.length-1;(l=r.length&&r[u].merge(h))?r[u]=l:r.push(h)}}else i.map&&n--}),this.items.length,0),new jo(Ho.from(r.reverse()),o)},jo.empty=new jo(Ho.empty,0);var qo=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};qo.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new qo(e.getMap().invert(),e,this.selection)}};var Jo=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},Wo=20;function Ko(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function Uo(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function Go(t,e,n,r){var o=Qo(e),i=Zo.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(s){var a=s.selection.resolve(s.transform.doc),c=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),p=new Jo(r?c:s.remaining,r?s.remaining:c,null,0);n(s.transform.setSelection(a).setMeta(Zo,{redo:r,historyState:p}).scrollIntoView())}}var Xo=!1,Yo=null;function Qo(t){var e=t.plugins;if(Yo!=e){Xo=!1,Yo=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Xo=!0;break}}return Xo}var Zo=new ge("history"),ti=new ge("closeHistory");function ei(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new de({key:Zo,state:{init:function(){return new Jo(jo.empty,jo.empty,null,0)},apply:function(e,n,r){return function(t,e,n,r){var o,i=n.getMeta(Zo);if(i)return i.historyState;n.getMeta(ti)&&(t=new Jo(t.done,t.undone,null,0));var s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Zo))return s.getMeta(Zo).redo?new Jo(t.done.addTransform(n,null,r,Qo(e)),t.undone,Ko(n.mapping.maps[n.steps.length-1]),t.prevTime):new Jo(t.done,t.undone.addTransform(n,null,r,Qo(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Jo(t.done.rebased(n,o),t.undone.rebased(n,o),Uo(t.prevRanges,n.mapping),t.prevTime):new Jo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Uo(t.prevRanges,n.mapping),t.prevTime);var a=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?Uo(t.prevRanges,n.mapping):Ko(n.mapping.maps[n.steps.length-1]);return new Jo(t.done.addTransform(n,a?e.selection.getBookmark():null,r,Qo(e)),jo.empty,c,n.time)}(n,r,e,t)}},config:t})}const ni=e.Extension.create({name:"history",defaultOptions:{depth:100,newGroupDelay:500},addCommands:()=>({undo:()=>({state:t,dispatch:e})=>function(t,e){var n=Zo.getState(t);return!(!n||0==n.done.eventCount||(e&&Go(n,t,e,!1),0))}(t,e),redo:()=>({state:t,dispatch:e})=>function(t,e){var n=Zo.getState(t);return!(!n||0==n.undone.eventCount||(e&&Go(n,t,e,!0),0))}(t,e)}),addProseMirrorPlugins(){return[ei(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}}}),ri=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,oi=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,ii=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,si=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,ai=e.Mark.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBold:()=>({commands:t})=>t.setMark("bold"),toggleBold:()=>({commands:t})=>t.toggleMark("bold"),unsetBold:()=>({commands:t})=>t.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[e.markInputRule(ri,this.type),e.markInputRule(ii,this.type)]},addPasteRules(){return[e.markPasteRule(oi,this.type),e.markPasteRule(si,this.type)]}}),ci=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,pi=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,li=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,hi=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,ui=e.Mark.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setItalic:()=>({commands:t})=>t.setMark("italic"),toggleItalic:()=>({commands:t})=>t.toggleMark("italic"),unsetItalic:()=>({commands:t})=>t.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[e.markInputRule(ci,this.type),e.markInputRule(li,this.type)]},addPasteRules(){return[e.markPasteRule(pi,this.type),e.markPasteRule(hi,this.type)]}}),fi=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,di=e.Mark.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setCode:()=>({commands:t})=>t.setMark("code"),toggleCode:()=>({commands:t})=>t.toggleMark("code"),unsetCode:()=>({commands:t})=>t.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[e.markInputRule(fi,this.type)]},addPasteRules(){return[e.markPasteRule(fi,this.type)]}});var mi=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function vi(t,e,n,r){return new mi(t,(function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr.delete(i,s),p=c.doc.resolve(i).blockRange(),l=p&&function(t,e,n,r){void 0===r&&(r=t);var o=function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;var s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(Dt).concat({type:e,attrs:n}).concat(i.map(Dt)):null}(p,e,a);if(!l)return null;c.wrap(p,l);var h=c.doc.resolve(i-1).nodeBefore;return h&&h.type==e&&It(c.doc,i-1)&&(!r||r(o,h))&&c.join(i-1),c}))}function gi(t,e,n){return new mi(t,(function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}const yi=/^```(?<language>[a-z]*)? $/,bi=/^~~~(?<language>[a-z]*)? $/,wi=e.Node.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const n=null===(e=t.firstElementChild)||void 0===e?void 0:e.getAttribute("class");if(!n)return null;const r=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:n.replace(r,"")}},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",this.options.HTMLAttributes,["code",t,0]]},addCommands:()=>({setCodeBlock:t=>({commands:e})=>e.setNode("codeBlock",t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode("codeBlock","paragraph",t)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock()}},addInputRules(){return[gi(yi,this.type,(({groups:t})=>t)),gi(bi,this.type,(({groups:t})=>t))]}}),ki=e.Node.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,e.mergeAttributes(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode("heading",t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode("heading","paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>gi(new RegExp(`^(#{1,${t}})\\s$`),this.type,{level:t})))}});function Si(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function xi(t,e){for(;t;t="start"==e?t.firstChild:t.lastChild)if(t.isTextblock)return!0;return!1}function Mi(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Ci(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Oi(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Ti(t,e){var n=t.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),s=r.indexAfter(-1),a=Oi(i.contentMatchAt(s));if(!i.canReplaceWith(s,s,a))return!1;if(e){var c=r.after(),p=t.tr.replaceWith(c,c,a.createAndFill());p.setSelection(Ut.near(p.doc.resolve(c),1)),e(p.scrollIntoView())}return!0}function Ni(t,e,n){var r,i,s=e.nodeBefore,a=e.nodeAfter;if(s.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!It(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;var c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(r=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(r[0]||a.type).validEnd){if(n){for(var p=e.pos+a.nodeSize,l=o.empty,u=r.length-1;u>=0;u--)l=o.from(r[u].create(null,l));l=o.from(s.copy(l));var f=t.tr.step(new Ot(e.pos-1,p,e.pos,p,new h(l,1,0),r.length,!0)),d=p+2*r.length;It(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var m=Ut.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&At(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(c&&a.isTextblock&&xi(s,"end")){for(var y=s,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;if(y.canReplace(y.childCount,y.childCount,a.content)){if(n){for(var w=o.empty,k=b.length-1;k>=0;k--)w=o.from(b[k].copy(w));n(t.tr.step(new Ot(e.pos-b.length,e.pos+a.nodeSize,e.pos+1,e.pos+a.nodeSize-1,new h(w,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ai(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}Ai(Si,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;var o=Mi(r);if(!o){var i=r.blockRange(),s=i&&At(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&Ni(t,o,e))return!0;if(0==r.parent.content.size&&(xi(a,"end")||Zt.isSelectable(a))){if(e){var c=t.tr.deleteRange(r.before(),r.after());c.setSelection(xi(a,"end")?Ut.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):Zt.create(c.doc,o.pos-a.nodeSize)),e(c.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Mi(o)}var s=i&&i.nodeBefore;return!(!s||!Zt.isSelectable(s))&&(e&&e(t.tr.setSelection(Zt.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)})),Ai(Si,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;var o=Ci(r);if(!o)return!1;var i=o.nodeAfter;if(Ni(t,o,e))return!0;if(0==r.parent.content.size&&(xi(i,"start")||Zt.isSelectable(i))){if(e){var s=t.tr.deleteRange(r.before(),r.after());s.setSelection(xi(i,"start")?Ut.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):Zt.create(s.doc,s.mapping.map(o.pos))),e(s.scrollIntoView())}return!0}return!(!i.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;i=Ci(o)}var s=i&&i.nodeAfter;return!(!s||!Zt.isSelectable(s))&&(e&&e(t.tr.setSelection(Zt.create(t.doc,i.pos)).scrollIntoView()),!0)}));Ai((function(t,e){var n=t.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),(function(t,e){var n=t.selection,r=n.$from,o=n.$to;if(n instanceof ee||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=Oi(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Yt.create(a.doc,s+1)),e(a.scrollIntoView())}return!0}),(function(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Et(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&At(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}),(function(t,e){var n=t.selection,r=n.$from,i=n.$to;if(t.selection instanceof Zt&&t.selection.node.isBlock)return!(!r.parentOffset||!Et(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var s=i.parentOffset==i.parent.content.size,a=t.tr;(t.selection instanceof Yt||t.selection instanceof ee)&&a.deleteSelection();var c=0==r.depth?null:Oi(r.node(-1).contentMatchAt(r.indexAfter(-1))),p=s&&c?[{type:c}]:null,l=Et(a.doc,a.mapping.map(r.pos),1,p);p||l||!Et(a.doc,a.mapping.map(r.pos),1,c&&[{type:c}])||(p=[{type:c}],l=!0),l&&(a.split(a.mapping.map(r.pos),1,p),s||r.parentOffset||r.parent.type==c||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),o.from([c.create(),r.parent]))||a.setNodeMarkup(a.mapping.map(r.before()),c)),e(a.scrollIntoView())}return!0})),"undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&os.platform();const Di=e.Node.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",e.mergeAttributes(this.options.HTMLAttributes,t)]},addCommands(){return{setHardBreak:()=>({commands:t,state:e,dispatch:n})=>t.first([()=>Ti(e,n),()=>(n&&e.tr.replaceSelectionWith(this.type.create()).scrollIntoView(),!0)])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ei=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,Ii=e.Mark.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration=line-through"}],renderHTML({HTMLAttributes:t}){return["s",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setStrike:()=>({commands:t})=>t.setMark("strike"),toggleStrike:()=>({commands:t})=>t.toggleMark("strike"),unsetStrike:()=>({commands:t})=>t.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[e.markInputRule(Ei,this.type)]},addPasteRules(){return[e.markPasteRule(Ei,this.type)]}}),Ri=/^\s*>\s$/gm,Pi=e.Node.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBlockquote:()=>({commands:t})=>t.wrapIn("blockquote"),toggleBlockquote:()=>({commands:t})=>t.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:t})=>t.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[vi(Ri,this.type)]}}),zi=e.Node.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",e.mergeAttributes(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({tr:t,dispatch:e})=>{var n;if(e){t.replaceSelectionWith(this.type.create());const{parent:e,pos:r}=t.selection.$from,o=r+1;if(!t.doc.nodeAt(o)){const r=null===(n=e.type.contentMatch.defaultType)||void 0===n?void 0:n.create();r&&(t.insert(o,r),t.setSelection(Yt.create(t.doc,o)))}t.scrollIntoView()}return!0}}},addInputRules(){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,this.type)]}}),Bi=/^\s*([-+*])\s$/,Li=e.Node.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleBulletList:()=>({commands:t})=>t.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[vi(Bi,this.type)]}}),Vi=/^(\d+)\.\s$/,$i=e.Node.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:t=>({start:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1})}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:n,...r}=t;return 1===n?["ol",e.mergeAttributes(this.options.HTMLAttributes,r),0]:["ol",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleOrderedList:()=>({commands:t})=>t.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[vi(Vi,this.type,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}}),Fi=e.Node.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}});t.defaultExtensions=function(t){return[zo,Bo.configure(null==t?void 0:t.paragraph),Lo,ai.configure(null==t?void 0:t.bold),ui.configure(null==t?void 0:t.italic),di.configure(null==t?void 0:t.code),Ii.configure(null==t?void 0:t.strike),Di.configure(null==t?void 0:t.hardBreak),ki.configure(null==t?void 0:t.heading),Pi.configure(null==t?void 0:t.blockquote),Li.configure(null==t?void 0:t.bulletList),$i.configure(null==t?void 0:t.orderedList),Fi.configure(null==t?void 0:t.listItem),zi.configure(null==t?void 0:t.horizontalRule),wi.configure(null==t?void 0:t.codeBlock),ni.configure(null==t?void 0:t.history),be.configure(null==t?void 0:t.dropcursor),Po]},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=tiptap-starter-kit.bundle.umd.min.js.map
|